@mastra/deployer-cloud 1.29.0-alpha.4 → 1.29.0-alpha.5

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.
Files changed (22) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/studio/assets/{index-INDGHWda.js → index-B3MkakF9.js} +1 -1
  3. package/dist/studio/assets/{index-DZGUrxZX.js → index-BCwR6vp1.js} +1 -1
  4. package/dist/studio/assets/{index-DT5D4yC-.js → index-BD28sRL1.js} +1 -1
  5. package/dist/studio/assets/{index-t9BeTtDH.js → index-CAegeqJM.js} +1 -1
  6. package/dist/studio/assets/{index-IXYxgw4s.js → index-CW06ies5.js} +1 -1
  7. package/dist/studio/assets/{index-BRMZatgw.js → index-CpYIvTVc.js} +1 -1
  8. package/dist/studio/assets/{index-d4s816My.js → index-CxVdYbxX.js} +1 -1
  9. package/dist/studio/assets/{index-B8cV0zRm.js → index-D8SDA92a.js} +1 -1
  10. package/dist/studio/assets/{index-BiF4UJ-6.js → index-DEKily7r.js} +1 -1
  11. package/dist/studio/assets/{index-Byq1vBNP.js → index-DGC3u8bI.js} +1 -1
  12. package/dist/studio/assets/{index-BYBUim5q.js → index-DGZMX6ra.js} +1 -1
  13. package/dist/studio/assets/{index-DDrT7DaU.js → index-DeN__BFT.js} +1 -1
  14. package/dist/studio/assets/{index-AZoMSWCV.js → index-Di1ViftD.js} +1 -1
  15. package/dist/studio/assets/{index-Cc35J9cg.js → index-OuYdvUUh.js} +1 -1
  16. package/dist/studio/assets/{index-CDRe4wFV.js → index-V44U4ji8.js} +1 -1
  17. package/dist/studio/assets/{index-Cdp8HP4v.js → index-iS9-i0x7.js} +1 -1
  18. package/dist/studio/assets/{index-BwqJphcf.js → index-og54ikTe.js} +1 -1
  19. package/dist/studio/assets/{index-D62VpsVa.js → index-wHzEsd80.js} +1 -1
  20. package/dist/studio/assets/{main-C0hFzgVU.js → main-D8_Y-Hlo.js} +5 -5
  21. package/dist/studio/index.html +1 -1
  22. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DZGUrxZX.js","./index-BRMZatgw.js","./index-INDGHWda.js","./index-D62VpsVa.js","./index-B8cV0zRm.js","./index-AZoMSWCV.js","./index-Byq1vBNP.js","./index-BiF4UJ-6.js","./index-IXYxgw4s.js","./index-BwqJphcf.js","./index-BYBUim5q.js","./index-CDRe4wFV.js","./index-d4s816My.js","./index-Cdp8HP4v.js","./index-t9BeTtDH.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-DT5D4yC-.js","./index-DDrT7DaU.js","./index-Cc35J9cg.js"])))=>i.map(i=>d[i]);
2
- import{_ as Ke}from"./index-BRMZatgw.js";function JBe(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oU={exports:{}},Oj={};var dwe;function f_t(){if(dwe)return Oj;dwe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return Oj.Fragment=t,Oj.jsx=r,Oj.jsxs=r,Oj}var fwe;function h_t(){return fwe||(fwe=1,oU.exports=f_t()),oU.exports}var o=h_t(),lU={exports:{}},mn={},hwe;function p_t(){if(hwe)return mn;hwe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(V,D,W){this.props=V,this.context=D,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,D){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,D,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(V,D,W){this.props=V,this.context=D,this.refs=x,this.updater=W||g}var _=k.prototype=new S;_.constructor=k,y(_,w.prototype),_.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,D,W){var G=W.ref;return{$$typeof:t,type:V,key:D,ref:G!==void 0?G:null,props:W}}function P(V,D){return I(V.type,D,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var D={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return D[W]})}var M=/\/+/g;function F(V,D){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):D.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function(D){V.status==="pending"&&(V.status="fulfilled",V.value=D)},function(D){V.status==="pending"&&(V.status="rejected",V.reason=D)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,D,W,G,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case r:te=!0;break;case f:return te=V._init,z(te(V._payload),D,W,G,J)}}if(te)return J=J(V),te=G===""?"."+F(V,0):G,E(J)?(W="",te!=null&&(W=te.replace(M,"$&/")+"/"),z(J,D,W,"",function(fe){return fe})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(M,"$&/")+"/")+te)),D.push(J)),1;te=0;var re=G===""?".":G+":";if(E(V))for(var ie=0;ie<V.length;ie++)G=V[ie],ae=re+F(G,ie),te+=z(G,D,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(G=V.next()).done;)G=G.value,ae=re+F(G,ie++),te+=z(G,D,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),D,W,G,J);throw D=String(V),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(V,D,W){if(V==null)return V;var G=[],J=0;return z(V,G,"","",function(ae){return D.call(W,ae,J++)}),G}function Q(V){if(V._status===-1){var D=V._result;D=D(),D.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=D)}if(V._status===1)return V._result.default;throw V._result}var L=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(D))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Z={map:H,forEach:function(V,D,W){H(V,function(){D.apply(this,arguments)},W)},count:function(V){var D=0;return H(V,function(){D++}),D},toArray:function(V){return H(V,function(D){return D})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return mn.Activity=h,mn.Children=Z,mn.Component=w,mn.Fragment=n,mn.Profiler=a,mn.PureComponent=k,mn.StrictMode=s,mn.Suspense=u,mn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,mn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},mn.cache=function(V){return function(){return V.apply(null,arguments)}},mn.cacheSignal=function(){return null},mn.cloneElement=function(V,D,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=y({},V.props),J=V.key;if(D!=null)for(ae in D.key!==void 0&&(J=""+D.key),D)!N.call(D,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&D.ref===void 0||(G[ae]=D[ae]);var ae=arguments.length-2;if(ae===1)G.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];G.children=te}return I(V.type,J,G)},mn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},mn.createElement=function(V,D,W){var G,J={},ae=null;if(D!=null)for(G in D.key!==void 0&&(ae=""+D.key),D)N.call(D,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=D[G]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(G in te=V.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return I(V,ae,J)},mn.createRef=function(){return{current:null}},mn.forwardRef=function(V){return{$$typeof:c,render:V}},mn.isValidElement=R,mn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},mn.memo=function(V,D){return{$$typeof:d,type:V,compare:D===void 0?null:D}},mn.startTransition=function(V){var D=j.T,W={};j.T=W;try{var G=V(),J=j.S;J!==null&&J(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ae){L(ae)}finally{D!==null&&W.types!==null&&(D.types=W.types),j.T=D}},mn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},mn.use=function(V){return j.H.use(V)},mn.useActionState=function(V,D,W){return j.H.useActionState(V,D,W)},mn.useCallback=function(V,D){return j.H.useCallback(V,D)},mn.useContext=function(V){return j.H.useContext(V)},mn.useDebugValue=function(){},mn.useDeferredValue=function(V,D){return j.H.useDeferredValue(V,D)},mn.useEffect=function(V,D){return j.H.useEffect(V,D)},mn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},mn.useId=function(){return j.H.useId()},mn.useImperativeHandle=function(V,D,W){return j.H.useImperativeHandle(V,D,W)},mn.useInsertionEffect=function(V,D){return j.H.useInsertionEffect(V,D)},mn.useLayoutEffect=function(V,D){return j.H.useLayoutEffect(V,D)},mn.useMemo=function(V,D){return j.H.useMemo(V,D)},mn.useOptimistic=function(V,D){return j.H.useOptimistic(V,D)},mn.useReducer=function(V,D,W){return j.H.useReducer(V,D,W)},mn.useRef=function(V){return j.H.useRef(V)},mn.useState=function(V){return j.H.useState(V)},mn.useSyncExternalStore=function(V,D,W){return j.H.useSyncExternalStore(V,D,W)},mn.useTransition=function(){return j.H.useTransition()},mn.version="19.2.5",mn}var pwe;function TE(){return pwe||(pwe=1,lU.exports=p_t()),lU.exports}var b=TE();const je=Uo(b),e1=JBe({__proto__:null,default:je},[b]);var cU={exports:{}},kj={},uU={exports:{}},dU={};var mwe;function m_t(){return mwe||(mwe=1,(function(e){function t(U,z){var H=U.length;U.push(z);e:for(;0<H;){var Q=H-1>>>1,L=U[Q];if(0<s(L,z))U[Q]=z,U[H]=L,H=Q;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var z=U[0],H=U.pop();if(H!==z){U[0]=H;e:for(var Q=0,L=U.length,Z=L>>>1;Q<Z;){var V=2*(Q+1)-1,D=U[V],W=V+1,G=U[W];if(0>s(D,H))W<L&&0>s(G,D)?(U[Q]=G,U[W]=H,Q=W):(U[Q]=D,U[V]=H,Q=V);else if(W<L&&0>s(G,H))U[Q]=G,U[W]=H,Q=W;else break e}}return z}function s(U,z){var H=U.sortIndex-z.sortIndex;return H!==0?H:U.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(U){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=U)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function _(U){if(g=!1,k(U),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var z=r(u);z!==null&&F(_,z.startTime-U)}}var E=!1,T=-1,j=5,N=-1;function I(){return y?!0:!(e.unstable_now()-N<j)}function P(){if(y=!1,E){var U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(U),f=r(c);f!==null&&!(f.expirationTime>U&&I());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var L=Q(f.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){f.callback=L,k(U),z=!0;break t}f===r(c)&&n(c),k(U)}else n(c);f=r(c)}if(f!==null)z=!0;else{var Z=r(u);Z!==null&&F(_,Z.startTime-U),z=!1}}break e}finally{f=null,h=H,p=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,R=function(){M.postMessage(null)}}else R=function(){x(P,0)};function F(U,z){T=x(function(){U(e.unstable_now())},z)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var H=h;h=z;try{return U()}finally{h=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return z()}finally{h=H}},e.unstable_scheduleCallback=function(U,z,H){var Q=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Q+H:Q):H=Q,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,U={id:d++,callback:z,priorityLevel:U,startTime:H,expirationTime:L,sortIndex:-1},H>Q?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(g?(w(T),T=-1):g=!0,F(_,H-Q))):(U.sortIndex=L,t(c,U),m||p||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=h;return function(){var H=h;h=z;try{return U.apply(this,arguments)}finally{h=H}}}})(dU)),dU}var gwe;function g_t(){return gwe||(gwe=1,uU.exports=m_t()),uU.exports}var fU={exports:{}},rc={};var ywe;function y_t(){if(ywe)return rc;ywe=1;var e=TE();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return rc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,rc.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(c,u,null,d)},rc.flushSync=function(c){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,c)return c()}finally{i.T=u,n.p=d,n.d.f()}},rc.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},rc.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},rc.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,p=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:p}):d==="script"&&n.d.X(c,{crossOrigin:f,integrity:h,fetchPriority:p,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},rc.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},rc.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},rc.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},rc.requestFormReset=function(c){n.d.r(c)},rc.unstable_batchedUpdates=function(c,u){return c(u)},rc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},rc.useFormStatus=function(){return i.H.useHostTransitionStatus()},rc.version="19.2.5",rc}var vwe;function e7e(){if(vwe)return fU.exports;vwe=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fU.exports=y_t(),fU.exports}var bwe;function v_t(){if(bwe)return kj;bwe=1;var e={env:{}};var t=g_t(),r=TE(),n=e7e();function s(v){var O="https://react.dev/errors/"+v;if(1<arguments.length){O+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)O+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function i(v){var O=v,C=v;if(v.alternate)for(;O.return;)O=O.return;else{v=O;do O=v,(O.flags&4098)!==0&&(C=O.return),v=O.return;while(v)}return O.tag===3?C:null}function l(v){if(v.tag===13){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function c(v){if(v.tag===31){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function u(v){if(i(v)!==v)throw Error(s(188))}function d(v){var O=v.alternate;if(!O){if(O=i(v),O===null)throw Error(s(188));return O!==v?null:v}for(var C=v,A=O;;){var $=C.return;if($===null)break;var q=$.alternate;if(q===null){if(A=$.return,A!==null){C=A;continue}break}if($.child===q.child){for(q=$.child;q;){if(q===C)return u($),v;if(q===A)return u($),O;q=q.sibling}throw Error(s(188))}if(C.return!==A.return)C=$,A=q;else{for(var ee=!1,de=$.child;de;){if(de===C){ee=!0,C=$,A=q;break}if(de===A){ee=!0,A=$,C=q;break}de=de.sibling}if(!ee){for(de=q.child;de;){if(de===C){ee=!0,C=q,A=$;break}if(de===A){ee=!0,A=q,C=$;break}de=de.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?v:O}function f(v){var O=v.tag;if(O===5||O===26||O===27||O===6)return v;for(v=v.child;v!==null;){if(O=f(v),O!==null)return O;v=v.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(v){return v===null||typeof v!="object"?null:(v=R&&v[R]||v["@@iterator"],typeof v=="function"?v:null)}var M=Symbol.for("react.client.reference");function F(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===M?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof v=="object")switch(v.$$typeof){case g:return"Portal";case k:return v.displayName||"Context";case S:return(v._context.displayName||"Context")+".Consumer";case _:var O=v.render;return v=v.displayName,v||(v=O.displayName||O.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case j:return O=v.displayName||null,O!==null?O:F(v.type)||"Memo";case N:O=v._payload,v=v._init;try{return F(v(O))}catch{}}return null}var U=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function V(v){return{current:v}}function D(v){0>Z||(v.current=L[Z],L[Z]=null,Z--)}function W(v,O){Z++,L[Z]=v.current,v.current=O}var G=V(null),J=V(null),ae=V(null),te=V(null);function re(v,O){switch(W(ae,O),W(J,v),W(G,null),O.nodeType){case 9:case 11:v=(v=O.documentElement)&&(v=v.namespaceURI)?P0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=P0e(O),v=M0e(O,v);else switch(v){case"svg":v=1;break;case"math":v=2;break;default:v=0}}D(G),W(G,v)}function ie(){D(G),D(J),D(ae)}function fe(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=M0e(O,v.type);O!==C&&(W(J,v),W(G,C))}function X(v){J.current===v&&(D(G),D(J)),te.current===v&&(D(te),bj._currentValue=Q)}var se,le;function xe(v){if(se===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);se=O&&O[1]||"",le=-1<C.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BCwR6vp1.js","./index-CpYIvTVc.js","./index-B3MkakF9.js","./index-wHzEsd80.js","./index-D8SDA92a.js","./index-Di1ViftD.js","./index-DGC3u8bI.js","./index-DEKily7r.js","./index-CW06ies5.js","./index-og54ikTe.js","./index-DGZMX6ra.js","./index-V44U4ji8.js","./index-CxVdYbxX.js","./index-iS9-i0x7.js","./index-CAegeqJM.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-BD28sRL1.js","./index-DeN__BFT.js","./index-OuYdvUUh.js"])))=>i.map(i=>d[i]);
2
+ import{_ as Ke}from"./index-CpYIvTVc.js";function JBe(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oU={exports:{}},Oj={};var dwe;function f_t(){if(dwe)return Oj;dwe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return Oj.Fragment=t,Oj.jsx=r,Oj.jsxs=r,Oj}var fwe;function h_t(){return fwe||(fwe=1,oU.exports=f_t()),oU.exports}var o=h_t(),lU={exports:{}},mn={},hwe;function p_t(){if(hwe)return mn;hwe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(V,D,W){this.props=V,this.context=D,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,D){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,D,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(V,D,W){this.props=V,this.context=D,this.refs=x,this.updater=W||g}var _=k.prototype=new S;_.constructor=k,y(_,w.prototype),_.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,D,W){var G=W.ref;return{$$typeof:t,type:V,key:D,ref:G!==void 0?G:null,props:W}}function P(V,D){return I(V.type,D,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var D={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return D[W]})}var M=/\/+/g;function F(V,D){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):D.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function(D){V.status==="pending"&&(V.status="fulfilled",V.value=D)},function(D){V.status==="pending"&&(V.status="rejected",V.reason=D)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,D,W,G,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case r:te=!0;break;case f:return te=V._init,z(te(V._payload),D,W,G,J)}}if(te)return J=J(V),te=G===""?"."+F(V,0):G,E(J)?(W="",te!=null&&(W=te.replace(M,"$&/")+"/"),z(J,D,W,"",function(fe){return fe})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(M,"$&/")+"/")+te)),D.push(J)),1;te=0;var re=G===""?".":G+":";if(E(V))for(var ie=0;ie<V.length;ie++)G=V[ie],ae=re+F(G,ie),te+=z(G,D,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(G=V.next()).done;)G=G.value,ae=re+F(G,ie++),te+=z(G,D,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),D,W,G,J);throw D=String(V),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(V,D,W){if(V==null)return V;var G=[],J=0;return z(V,G,"","",function(ae){return D.call(W,ae,J++)}),G}function Q(V){if(V._status===-1){var D=V._result;D=D(),D.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=D)}if(V._status===1)return V._result.default;throw V._result}var L=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(D))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Z={map:H,forEach:function(V,D,W){H(V,function(){D.apply(this,arguments)},W)},count:function(V){var D=0;return H(V,function(){D++}),D},toArray:function(V){return H(V,function(D){return D})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return mn.Activity=h,mn.Children=Z,mn.Component=w,mn.Fragment=n,mn.Profiler=a,mn.PureComponent=k,mn.StrictMode=s,mn.Suspense=u,mn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,mn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},mn.cache=function(V){return function(){return V.apply(null,arguments)}},mn.cacheSignal=function(){return null},mn.cloneElement=function(V,D,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=y({},V.props),J=V.key;if(D!=null)for(ae in D.key!==void 0&&(J=""+D.key),D)!N.call(D,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&D.ref===void 0||(G[ae]=D[ae]);var ae=arguments.length-2;if(ae===1)G.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];G.children=te}return I(V.type,J,G)},mn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},mn.createElement=function(V,D,W){var G,J={},ae=null;if(D!=null)for(G in D.key!==void 0&&(ae=""+D.key),D)N.call(D,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=D[G]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(G in te=V.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return I(V,ae,J)},mn.createRef=function(){return{current:null}},mn.forwardRef=function(V){return{$$typeof:c,render:V}},mn.isValidElement=R,mn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},mn.memo=function(V,D){return{$$typeof:d,type:V,compare:D===void 0?null:D}},mn.startTransition=function(V){var D=j.T,W={};j.T=W;try{var G=V(),J=j.S;J!==null&&J(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ae){L(ae)}finally{D!==null&&W.types!==null&&(D.types=W.types),j.T=D}},mn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},mn.use=function(V){return j.H.use(V)},mn.useActionState=function(V,D,W){return j.H.useActionState(V,D,W)},mn.useCallback=function(V,D){return j.H.useCallback(V,D)},mn.useContext=function(V){return j.H.useContext(V)},mn.useDebugValue=function(){},mn.useDeferredValue=function(V,D){return j.H.useDeferredValue(V,D)},mn.useEffect=function(V,D){return j.H.useEffect(V,D)},mn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},mn.useId=function(){return j.H.useId()},mn.useImperativeHandle=function(V,D,W){return j.H.useImperativeHandle(V,D,W)},mn.useInsertionEffect=function(V,D){return j.H.useInsertionEffect(V,D)},mn.useLayoutEffect=function(V,D){return j.H.useLayoutEffect(V,D)},mn.useMemo=function(V,D){return j.H.useMemo(V,D)},mn.useOptimistic=function(V,D){return j.H.useOptimistic(V,D)},mn.useReducer=function(V,D,W){return j.H.useReducer(V,D,W)},mn.useRef=function(V){return j.H.useRef(V)},mn.useState=function(V){return j.H.useState(V)},mn.useSyncExternalStore=function(V,D,W){return j.H.useSyncExternalStore(V,D,W)},mn.useTransition=function(){return j.H.useTransition()},mn.version="19.2.5",mn}var pwe;function TE(){return pwe||(pwe=1,lU.exports=p_t()),lU.exports}var b=TE();const je=Uo(b),e1=JBe({__proto__:null,default:je},[b]);var cU={exports:{}},kj={},uU={exports:{}},dU={};var mwe;function m_t(){return mwe||(mwe=1,(function(e){function t(U,z){var H=U.length;U.push(z);e:for(;0<H;){var Q=H-1>>>1,L=U[Q];if(0<s(L,z))U[Q]=z,U[H]=L,H=Q;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var z=U[0],H=U.pop();if(H!==z){U[0]=H;e:for(var Q=0,L=U.length,Z=L>>>1;Q<Z;){var V=2*(Q+1)-1,D=U[V],W=V+1,G=U[W];if(0>s(D,H))W<L&&0>s(G,D)?(U[Q]=G,U[W]=H,Q=W):(U[Q]=D,U[V]=H,Q=V);else if(W<L&&0>s(G,H))U[Q]=G,U[W]=H,Q=W;else break e}}return z}function s(U,z){var H=U.sortIndex-z.sortIndex;return H!==0?H:U.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(U){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=U)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function _(U){if(g=!1,k(U),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var z=r(u);z!==null&&F(_,z.startTime-U)}}var E=!1,T=-1,j=5,N=-1;function I(){return y?!0:!(e.unstable_now()-N<j)}function P(){if(y=!1,E){var U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(U),f=r(c);f!==null&&!(f.expirationTime>U&&I());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var L=Q(f.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){f.callback=L,k(U),z=!0;break t}f===r(c)&&n(c),k(U)}else n(c);f=r(c)}if(f!==null)z=!0;else{var Z=r(u);Z!==null&&F(_,Z.startTime-U),z=!1}}break e}finally{f=null,h=H,p=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,R=function(){M.postMessage(null)}}else R=function(){x(P,0)};function F(U,z){T=x(function(){U(e.unstable_now())},z)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var H=h;h=z;try{return U()}finally{h=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return z()}finally{h=H}},e.unstable_scheduleCallback=function(U,z,H){var Q=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Q+H:Q):H=Q,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,U={id:d++,callback:z,priorityLevel:U,startTime:H,expirationTime:L,sortIndex:-1},H>Q?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(g?(w(T),T=-1):g=!0,F(_,H-Q))):(U.sortIndex=L,t(c,U),m||p||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=h;return function(){var H=h;h=z;try{return U.apply(this,arguments)}finally{h=H}}}})(dU)),dU}var gwe;function g_t(){return gwe||(gwe=1,uU.exports=m_t()),uU.exports}var fU={exports:{}},rc={};var ywe;function y_t(){if(ywe)return rc;ywe=1;var e=TE();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return rc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,rc.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(c,u,null,d)},rc.flushSync=function(c){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,c)return c()}finally{i.T=u,n.p=d,n.d.f()}},rc.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},rc.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},rc.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,p=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:p}):d==="script"&&n.d.X(c,{crossOrigin:f,integrity:h,fetchPriority:p,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},rc.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},rc.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},rc.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},rc.requestFormReset=function(c){n.d.r(c)},rc.unstable_batchedUpdates=function(c,u){return c(u)},rc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},rc.useFormStatus=function(){return i.H.useHostTransitionStatus()},rc.version="19.2.5",rc}var vwe;function e7e(){if(vwe)return fU.exports;vwe=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fU.exports=y_t(),fU.exports}var bwe;function v_t(){if(bwe)return kj;bwe=1;var e={env:{}};var t=g_t(),r=TE(),n=e7e();function s(v){var O="https://react.dev/errors/"+v;if(1<arguments.length){O+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)O+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function i(v){var O=v,C=v;if(v.alternate)for(;O.return;)O=O.return;else{v=O;do O=v,(O.flags&4098)!==0&&(C=O.return),v=O.return;while(v)}return O.tag===3?C:null}function l(v){if(v.tag===13){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function c(v){if(v.tag===31){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function u(v){if(i(v)!==v)throw Error(s(188))}function d(v){var O=v.alternate;if(!O){if(O=i(v),O===null)throw Error(s(188));return O!==v?null:v}for(var C=v,A=O;;){var $=C.return;if($===null)break;var q=$.alternate;if(q===null){if(A=$.return,A!==null){C=A;continue}break}if($.child===q.child){for(q=$.child;q;){if(q===C)return u($),v;if(q===A)return u($),O;q=q.sibling}throw Error(s(188))}if(C.return!==A.return)C=$,A=q;else{for(var ee=!1,de=$.child;de;){if(de===C){ee=!0,C=$,A=q;break}if(de===A){ee=!0,A=$,C=q;break}de=de.sibling}if(!ee){for(de=q.child;de;){if(de===C){ee=!0,C=q,A=$;break}if(de===A){ee=!0,A=q,C=$;break}de=de.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?v:O}function f(v){var O=v.tag;if(O===5||O===26||O===27||O===6)return v;for(v=v.child;v!==null;){if(O=f(v),O!==null)return O;v=v.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(v){return v===null||typeof v!="object"?null:(v=R&&v[R]||v["@@iterator"],typeof v=="function"?v:null)}var M=Symbol.for("react.client.reference");function F(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===M?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof v=="object")switch(v.$$typeof){case g:return"Portal";case k:return v.displayName||"Context";case S:return(v._context.displayName||"Context")+".Consumer";case _:var O=v.render;return v=v.displayName,v||(v=O.displayName||O.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case j:return O=v.displayName||null,O!==null?O:F(v.type)||"Memo";case N:O=v._payload,v=v._init;try{return F(v(O))}catch{}}return null}var U=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function V(v){return{current:v}}function D(v){0>Z||(v.current=L[Z],L[Z]=null,Z--)}function W(v,O){Z++,L[Z]=v.current,v.current=O}var G=V(null),J=V(null),ae=V(null),te=V(null);function re(v,O){switch(W(ae,O),W(J,v),W(G,null),O.nodeType){case 9:case 11:v=(v=O.documentElement)&&(v=v.namespaceURI)?P0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=P0e(O),v=M0e(O,v);else switch(v){case"svg":v=1;break;case"math":v=2;break;default:v=0}}D(G),W(G,v)}function ie(){D(G),D(J),D(ae)}function fe(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=M0e(O,v.type);O!==C&&(W(J,v),W(G,C))}function X(v){J.current===v&&(D(G),D(J)),te.current===v&&(D(te),bj._currentValue=Q)}var se,le;function xe(v){if(se===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);se=O&&O[1]||"",le=-1<C.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+se+v+le}var ue=!1;function ce(v,O){if(!v||ue)return"";ue=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(O){var ut=function(){throw Error()};if(Object.defineProperty(ut.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ut,[])}catch(et){var Ze=et}Reflect.construct(v,[],ut)}else{try{ut.call()}catch(et){Ze=et}v.call(ut.prototype)}}else{try{throw Error()}catch(et){Ze=et}(ut=v())&&typeof ut.catch=="function"&&ut.catch(function(){})}}catch(et){if(et&&Ze&&typeof et.stack=="string")return[et.stack,Ze.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var q=A.DetermineComponentFrameRoot(),ee=q[0],de=q[1];if(ee&&de){var Te=ee.split(`
5
5
  `),We=de.split(`
@@ -109,7 +109,7 @@ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}
109
109
  constructor(\${params}) {
110
110
  \${}
111
111
  }
112
- }`,{label:"class",detail:"definition",type:"keyword"}),Eu('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Eu('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],$Ge=Due.concat([Eu("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Eu("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Eu("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Eke=new $He,FGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Lj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const TQt=["FunctionDeclaration"],NQt={FunctionDeclaration:Lj("function"),ClassDeclaration:Lj("class"),ClassExpression:()=>!0,EnumDeclaration:Lj("constant"),TypeAliasDeclaration:Lj("type"),NamespaceDeclaration:Lj("namespace"),VariableDefinition(e,t){e.matchContext(TQt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function zGe(e,t){let r=Eke.get(t);if(r)return r;let n=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);n.push({label:c,type:l})}return t.cursor(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=NQt[i.name];if(l&&l(i,a)||FGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of zGe(e,i.node))n.push(l);return!1}}),Eke.set(t,n),n}const G3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Lue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function BGe(e){let t=Ia(e.state).resolveInner(e.pos,-1);if(Lue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&G3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)FGe.has(s.name)&&(n=n.concat(zGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:G3}}function pV(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function UGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ia(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pV(t,r.parent,""):Lue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&G3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pV(t,r,""):e.explicit?{path:[],name:""}:null}function AQt(e,t){let r=e,n=[],s=new Set;for(let a=0;;a++){for(let l of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||s.has(l))continue;s.add(l);let c;try{c=r[l]}catch{continue}n.push({label:l,type:typeof c=="function"?/^[A-Z]/.test(l)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return n;e=i}}function IQt(e){let t=new Map;return r=>{let n=UGe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=AQt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:G3}}}const gh=cS.define({name:"javascript",parser:jQt.configure({props:[u1.add({IfStatement:qk({except:/^\s*({|else\b)/}),TryStatement:qk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jUt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:CUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":qk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),d1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":gue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let r=e.lastChild;return{from:t.to,to:r.type.isError?e.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let r=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,n=e.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),VGe={test:e=>/^JSX/.test(e.name),facet:LF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},$ue=gh.configure({dialect:"ts"},"typescript"),Fue=gh.configure({dialect:"jsx",props:[hue.add(e=>e.isTop?[VGe]:void 0)]}),zue=gh.configure({dialect:"jsx ts",props:[hue.add(e=>e.isTop?[VGe]:void 0)]},"typescript");let qGe=e=>({label:e,type:"keyword"});const HGe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(qGe),RQt=HGe.concat(["declare","implements","private","protected","public"].map(qGe));function Z3(e={}){let t=e.jsx?e.typescript?zue:Fue:e.typescript?$ue:gh,r=e.typescript?$Ge.concat(RQt):Due.concat(HGe);return new dS(t,[gh.data.of({autocomplete:hVt(Lue,zWe(r))}),gh.data.of({autocomplete:BGe}),e.jsx?QGe:[]])}function PQt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Cke(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const MQt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),QGe=ft.inputHandler.of((e,t,r,n,s)=>{if((MQt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!gh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Ia(i).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=n||f.name=="JSXAttributeValue"&&f.to>d)){if(n==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=Cke(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:nt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let p=PQt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Cke(i.doc,p,d)))return{range:c,changes:{from:d,insert:`</${h}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function DQt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of gh.findRegions(n)){let l=n.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(LQt(u,n.doc,c))}return s}}function jke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function LQt(e,t,r){let n=jke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?jke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const nD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:QGe,completionPath:UGe,esLint:DQt,javascript:Z3,javascriptLanguage:gh,jsxLanguage:Fue,localCompletionSource:BGe,scopeCompletionSource:IQt,snippets:Due,tsxLanguage:zue,typescriptLanguage:$ue,typescriptSnippets:$Ge},Symbol.toStringTag,{value:"Module"})),$j=["_blank","_self","_top","_parent"],mV=["ascii","utf-8","utf-16","latin1","latin1"],gV=["get","post","put","delete"],yV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Sd=["true","false"],Dr={},$Qt={a:{attrs:{href:null,ping:null,type:null,media:null,target:$j,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:$j}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:$j,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":mV,autocomplete:["on","off"],enctype:yV,method:gV,novalidate:["novalidate"],target:$j}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:$j,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mV,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mV}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},WGe={accesskey:null,class:null,contenteditable:Sd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Sd,autocorrect:Sd,autocapitalize:Sd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Sd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Sd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Sd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Sd,"aria-hidden":Sd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Sd,"aria-multiselectable":Sd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Sd,"aria-relevant":null,"aria-required":Sd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},GGe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of GGe)WGe[e]=null;let IA=class{constructor(t,r){this.tags={...$Qt,...t},this.globalAttrs={...WGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};IA.default=new IA;function P_(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function M_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function ZGe(e,t,r){let n=r.tags[P_(e,M_(t))];return n?.children||r.allTags}function Bue(e,t){let r=[];for(let n=M_(t);n&&!n.type.isTop;n=M_(n.parent)){let s=P_(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const YGe=/^[:\-\.\w\u00b7-\uffff]*$/;function Tke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=M_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:ZGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Bue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Nke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Bue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:YGe}}function FQt(e,t,r,n){let s=[],a=0;for(let i of ZGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Bue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function zQt(e,t,r,n,s){let a=M_(r),i=a?t.tags[P_(e.doc,a)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:YGe}}function BQt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),l=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=M_(r),h=f?t.tags[P_(e.doc,f)]:null;d=h?.attrs&&h.attrs[u]}if(d){let f=e.sliceDoc(n,s).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),n++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:h+m+p,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function XGe(e,t){let{state:r,pos:n}=t,s=Ia(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,l;a==s&&(l=s.childBefore(i));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=l,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Nke(r,s,s.from,n):Tke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?Tke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Nke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?zQt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?BQt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?FQt(r,e,s,n):null}function KGe(e){return XGe(IA.default,e)}function JGe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new IA(t,r):IA.default;return s=>XGe(n,s)}const UQt=gh.parser.configure({top:"SingleExpression"}),eZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:$ue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Fue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:zue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:UQt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:gh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:AA.parser}],tZe=[{name:"style",parser:AA.parser.configure({top:"Styles"})}].concat(GGe.map(e=>({name:e,parser:gh.parser}))),rZe=cS.define({name:"html",parser:yHt.configure({props:[u1.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),d1.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),RWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),SN=rZe.configure({wrap:jGe(eZe,tZe)});function nZe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=jGe((e.nestedLanguages||[]).concat(eZe),(e.nestedAttributes||[]).concat(tZe)));let n=r?rZe.configure({wrap:r,dialect:t}):t?SN.configure({dialect:t}):SN;return new dS(n,[SN.data.of({autocomplete:JGe(e)}),e.autoCloseTags!==!1?sZe:[],Z3().support,DGe().support])}const Ake=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),sZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!SN.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let h=i.doc.sliceString(c.from-1,c.to)==n,{head:p}=c,m=Ia(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let y=m.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=P_(i.doc,y.parent,p))&&!Ake.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:p,to:x,insert:w}}}}else if(h&&n=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==p-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=P_(i.doc,y,p))&&!Ake.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`${g}>`;return{range:nt.cursor(p+w.length,-1),changes:{from:p,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),VQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:sZe,html:nZe,htmlCompletionSource:KGe,htmlCompletionSourceWith:JGe,htmlLanguage:SN},Symbol.toStringTag,{value:"Module"})),aZe=LF({commentTokens:{block:{open:"<!--",close:"-->"}}}),iZe=new hn,oZe=bqt.configure({props:[d1.add(e=>!e.is("Block")||e.is("Document")||nse(e)!=null||qQt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),iZe.add(nse),u1.add({Document:()=>null}),Fb.add({Document:aZe})]});function nse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function qQt(e){return e.name=="OrderedList"||e.name=="BulletList"}function HQt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=nse(n.type))!=null&&s<=t)break;r=n}return r.to}const QQt=wWe.of((e,t,r)=>{for(let n=Ia(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(iZe);if(s==null)continue;let a=HQt(n,s);if(a>r)return{from:r,to:a}}return null});function Uue(e){return new qd(aZe,e,[],"markdown")}const lZe=Uue(oZe),WQt=oZe.configure([Nqt,Iqt,Aqt,Rqt,{props:[d1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),pS=Uue(WQt);function GQt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=Ye.matchLanguageName(e,r,!0),n instanceof Ye)return n.support?n.support.language.parser:uS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class vV{constructor(t,r,n,s,a,i,l){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+uZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function cZe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new vV(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new vV(a.parent,c,c+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),n.push(new vV(a.parent,c,c+d,i[1],u,f,a))}}return n}function uZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=uZe(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;r.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+n)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Vue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(HE)!=" ")return e;let n=Ep(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const dZe=(e={})=>({state:t,dispatch:r})=>{let n=Ia(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!pS.isActiveAt(t,l.from,-1)&&!pS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=cZe(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,k,_="";S&&S.item?(k=u.from+S.from,_=S.marker(s,1)):k=u.from+(S?S.to:0);let E=[{from:k,to:c,insert:_}];return f.node.name=="OrderedList"&&bV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=Rke(d,t,u);return{range:nt.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let S=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(S),changes:S}}}let p=[];f.node.name=="OrderedList"&&bV(f.item,s,p);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)g+=x==w&&!m?d[x].marker(s,1):d[x].blank(x<w?Ep(u.text,4,d[x+1].from)-g.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return g=Vue(g,t),ZQt(f.node,t.doc)&&(g=Rke(d,t,u)+t.lineBreak+g),p.push({from:y,to:c,insert:t.lineBreak+g}),{range:nt.cursor(y+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},fZe=dZe();function Ike(e){return e.name=="QuoteMark"||e.name=="ListMark"}function ZQt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function Rke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Ep(r.text,4,e[s+1].from)-n.length:null,s<a);return Vue(n,t)}function YQt(e,t){let r=e.resolveInner(t,-1),n=t;Ike(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Ike(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const hZe=({state:e,dispatch:t})=>{let r=Ia(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&pS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=cZe(YQt(r,i),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:nt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let p=d.blank(Ep(c.text,4,d.to)-Ep(c.text,4,d.from));return h==c.from&&(p=Vue(p,e)),{range:nt.cursor(h+p.length),changes:{from:h,to:c.from+d.to,insert:p}}}if(h<i)return{range:nt.cursor(h),changes:{from:h,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},pZe=[{key:"Enter",run:fZe},{key:"Backspace",run:hZe}],mZe=nZe({matchClosingTags:!1});function que(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=lZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=mZe}=e;if(!(s instanceof BF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,QQt],d;i&&u.push(gZe),r instanceof dS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?GQt(t,d):void 0;c.push(wqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Lp.high(qE.of(pZe)));let h=Uue(s.configure(c));return a&&u.push(h.data.of({autocomplete:XQt})),new dS(h,u)}function XQt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ia(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:KQt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xV=null;function KQt(){if(xV)return xV;let e=KGe(new xue(zn.create({extensions:mZe}),0,!0));return xV=e?e.options:[]}const JQt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,gZe=ft.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!pS.isActiveAt(t.state,n.from,1)))return!1;let a=Ia(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||JQt.test(l.name))&&(i=!0)},leave:l=>{l.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),eWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:lZe,deleteMarkupBackward:hZe,insertNewlineContinueMarkup:fZe,insertNewlineContinueMarkupCommand:dZe,markdown:que,markdownKeymap:pZe,markdownLanguage:pS,pasteURLAsLink:gZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new dS(yue.define(e))}function nb(e){return Ke(()=>import("./index-DZGUrxZX.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const yZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-INDGHWda.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ke(()=>import("./index-INDGHWda.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return nb("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>XHt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-D62VpsVa.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ke(()=>Promise.resolve().then(()=>VQt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-B8cV0zRm.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-AZoMSWCV.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ke(()=>Promise.resolve().then(()=>dVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-Byq1vBNP.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-BiF4UJ-6.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return nb("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>eWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return nb("MSSQL")}}),Ye.of({name:"MySQL",load(){return nb("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-IXYxgw4s.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return nb("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return nb("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-BwqJphcf.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-BYBUim5q.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-CDRe4wFV.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return Ke(()=>import("./index-CDRe4wFV.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return nb("StandardSQL")}}),Ye.of({name:"SQLite",load(){return nb("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-d4s816My.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ke(()=>import("./index-Cdp8HP4v.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ke(()=>import("./index-t9BeTtDH.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return Ke(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>pt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ke(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>pt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ke(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>pt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ke(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>pt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ke(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>pt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ke(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>pt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ke(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>pt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ke(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>pt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ke(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>pt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ke(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>pt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ke(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>pt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ke(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>pt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return Ke(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>pt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return Ke(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>pt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return Ke(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>pt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ke(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>pt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return Ke(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>pt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ke(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>pt(e.dylan))}}),Ye.of({name:"EBNF",load(){return Ke(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>pt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return Ke(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>pt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return Ke(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>pt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return Ke(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>pt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return Ke(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>pt(e.erlang))}}),Ye.of({name:"Esper",load(){return Ke(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>pt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return Ke(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>pt(e.factor))}}),Ye.of({name:"FCL",load(){return Ke(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>pt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ke(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>pt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ke(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>pt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return Ke(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>pt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return Ke(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>pt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ke(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>pt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return Ke(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>pt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.hxml))}}),Ye.of({name:"HTTP",load(){return Ke(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>pt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return Ke(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>pt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ke(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>pt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return Ke(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>pt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ke(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>pt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return Ke(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>pt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return Ke(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>pt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ke(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>pt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return Ke(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>pt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return Ke(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>pt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return Ke(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>pt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ke(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>pt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ke(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>pt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return Ke(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>pt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return Ke(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>pt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return Ke(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>pt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return Ke(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>pt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return Ke(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>pt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return Ke(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>pt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ke(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>pt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ke(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>pt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return Ke(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>pt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ke(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>pt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return Ke(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>pt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return Ke(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>pt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ke(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>pt(e.r))}}),Ye.of({name:"RPM Changes",load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ke(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>pt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return Ke(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>pt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return Ke(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>pt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ke(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>pt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ke(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>pt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return Ke(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>pt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return Ke(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>pt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ke(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>pt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ke(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>pt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return Ke(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>pt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return Ke(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>pt(e.swift))}}),Ye.of({name:"sTeX",load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return Ke(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>pt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return Ke(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>pt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return Ke(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>pt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return Ke(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>pt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return Ke(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>pt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ke(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>pt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ke(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>pt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ke(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>pt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return Ke(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>pt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return Ke(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>pt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return Ke(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>pt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return Ke(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>pt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return Ke(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>pt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ke(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>pt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ke(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>pt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return Ke(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>pt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return Ke(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>pt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return Ke(()=>import("./index-DT5D4yC-.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-DDrT7DaU.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function Ox(){return Ox=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ox.apply(null,arguments)}var tWt=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=ft.theme(s,{dark:t==="dark"}),c=$p.define(n),u=[l,Yx(c)];return u},rWt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},nWt=[{tag:ne.comment,color:"#6272a4"},{tag:ne.string,color:"#f1fa8c"},{tag:ne.atom,color:"#bd93f9"},{tag:ne.meta,color:"#f8f8f2"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"#ff79c6"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"#66d9ef"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"#50fa7b"},{tag:ne.atom,color:"#bd93f9"}],WE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return tWt({theme:t,settings:Ox({},rWt,r),styles:[...nWt,...n]})};WE();function Hue(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const sWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Wue(e.state,r.from);return n.line?aWt(e):n.block?oWt(e):!1};function Que(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const aWt=Que(uWt,0),iWt=Que(vZe,0),oWt=Que((e,t)=>vZe(e,t,cWt(t)),0);function Wue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Fj=50;function lWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Fj,n),i=e.sliceDoc(s,s+Fj),l=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-l;if(a.slice(u-t.length,u)==t&&i.slice(c,c+r.length)==r)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-n<=2*Fj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Fj),f=e.sliceDoc(s-Fj,s));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-r.length;return d.slice(h,h+t.length)==t&&f.slice(m,m+r.length)==r?{open:{pos:n+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:s-p-r.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function cWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function vZe(e,t,r=t.selection.ranges){let n=r.map(a=>Wue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>lWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,l;i<s.length;i++)if(l=s[i]){let c=n[i],{open:u,close:d}=l;a.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function uWt(e,t,r=t.selection.ranges){let n=[],s=-1;e:for(let{from:a,to:i}of r){let l=n.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=Wue(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),n.push({line:f,comment:m,token:u,indent:h,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of n)(f||!d)&&a.push({from:l.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of n)if(l>=0){let u=i.from+l,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const sse=vg.define(),dWt=vg.define(),fWt=Kt.define(),bZe=Kt.define({combine(e){return bg(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),xZe=Oo.define({create(){return Pm.empty},update(e,t){let r=t.state.facet(bZe),n=t.annotation(sse);if(n){let c=zu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=Y3(d,d.length,r.minDepth,c):d=OZe(d,t.startState.selection),new Pm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(dWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=zu.fromTransaction(t),i=t.annotation(Mo.time),l=t.annotation(Mo.userEvent);return a?e=e.addChanges(a,i,l,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Pm(e.done.map(zu.fromJSON),e.undone.map(zu.fromJSON))}});function hWt(e={}){return[xZe,bZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?wZe:t.inputType=="historyRedo"?ase:null;return n?(t.preventDefault(),n(r)):!1}})]}function UF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(xZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const wZe=UF(0,!1),ase=UF(1,!1),pWt=UF(0,!0),mWt=UF(1,!0);class zu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new zu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new zu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Wm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=ch;for(let s of t.startState.facet(fWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new zu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,ch)}static selection(t){return new zu(void 0,ch,void 0,void 0,t)}}function Y3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function gWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<r.length;){let u=r[c++],d=r[c++];l>=u&&i<=d&&(n=!0)}}),n}function yWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function SZe(e,t){return e.length?t.length?e.concat(t):e:t}const ch=[],vWt=200;function OZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-vWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Y3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[zu.selection([t])]}function bWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function wV(e,t){if(!e.length)return e;let r=e.length,n=ch;for(;r;){let s=xWt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[zu.selection(n)]:ch}function xWt(e,t,r){let n=SZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):ch,r);if(!e.changes)return zu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new zu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const wWt=/^(input\.type|delete)($|\.)/;class Pm{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Pm(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!n||wWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,gWt(l.changes,t.changes))||n=="input.type.compose")?i=Y3(i,i.length-1,s.minDepth,new zu(t.changes.compose(l.changes),SZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,ch)):i=Y3(i,i.length,s.minDepth,t),new Pm(i,ch,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:ch;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&yWt(a[a.length-1],t)?this:new Pm(OZe(this.done,t),this.undone,r,n)}addMapping(t){return new Pm(wV(this.done,t),wV(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):r.selection);if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:sse.of({side:t,rest:bWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?ch:s.slice(0,s.length-1);return a.mapped&&(l=wV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:sse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Pm.empty=new Pm(ch,ch);const SWt=[{key:"Mod-z",run:wZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ase,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ase,preventDefault:!0},{key:"Mod-u",run:pWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:mWt,preventDefault:!0}];function GE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function Fp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function zp({state:e,dispatch:t},r){let n=GE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Fp(e,n)),!0)}function VF(e,t){return nt.cursor(t?e.to:e.from)}function kZe(e,t){return zp(e,r=>r.empty?e.moveByChar(r,t):VF(r,t))}function Ec(e){return e.textDirectionAt(e.state.selection.main.head)==La.LTR}const _Ze=e=>kZe(e,!Ec(e)),EZe=e=>kZe(e,Ec(e));function CZe(e,t){return zp(e,r=>r.empty?e.moveByGroup(r,t):VF(r,t))}const OWt=e=>CZe(e,!Ec(e)),kWt=e=>CZe(e,Ec(e));function _Wt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qF(e,t,r){let n=Ia(e).resolveInner(t.head),s=r?hn.closedBy:hn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;_Wt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Rm(e,n.from,1):Rm(e,n.to,-1))&&i.matched?l=r?i.end.to:i.end.from:l=r?n.to:n.from,nt.cursor(l,r?-1:1)}const EWt=e=>zp(e,t=>qF(e.state,t,!Ec(e))),CWt=e=>zp(e,t=>qF(e.state,t,Ec(e)));function jZe(e,t){return zp(e,r=>{if(!r.empty)return VF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const TZe=e=>jZe(e,!1),NZe=e=>jZe(e,!0);function AZe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(ft.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function IZe(e,t){let r=AZe(e),{state:n}=e,s=GE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):VF(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+r.marginTop,u=l.bottom-r.marginBottom;i&&i.top>c&&i.bottom<u&&(a=ft.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Fp(n,s),{effects:a}),!0}const Pke=e=>IZe(e,!1),ise=e=>IZe(e,!0);function Xx(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=nt.cursor(n.from+a))}return s}const jWt=e=>zp(e,t=>Xx(e,t,!0)),TWt=e=>zp(e,t=>Xx(e,t,!1)),NWt=e=>zp(e,t=>Xx(e,t,!Ec(e))),AWt=e=>zp(e,t=>Xx(e,t,Ec(e))),IWt=e=>zp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),RWt=e=>zp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function PWt(e,t,r){let n=!1,s=GE(e.selection,a=>{let i=Rm(e,a.head,-1)||Rm(e,a.head,1)||a.head>0&&Rm(e,a.head-1,1)||a.head<e.doc.length&&Rm(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return nt.cursor(l)});return n?(t(Fp(e,s)),!0):!1}const MWt=({state:e,dispatch:t})=>PWt(e,t);function Lh(e,t){let r=GE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Fp(e.state,r)),!0)}function RZe(e,t){return Lh(e,r=>e.moveByChar(r,t))}const PZe=e=>RZe(e,!Ec(e)),MZe=e=>RZe(e,Ec(e));function DZe(e,t){return Lh(e,r=>e.moveByGroup(r,t))}const DWt=e=>DZe(e,!Ec(e)),LWt=e=>DZe(e,Ec(e)),$Wt=e=>Lh(e,t=>qF(e.state,t,!Ec(e))),FWt=e=>Lh(e,t=>qF(e.state,t,Ec(e)));function LZe(e,t){return Lh(e,r=>e.moveVertically(r,t))}const $Ze=e=>LZe(e,!1),FZe=e=>LZe(e,!0);function zZe(e,t){return Lh(e,r=>e.moveVertically(r,t,AZe(e).height))}const Mke=e=>zZe(e,!1),Dke=e=>zZe(e,!0),zWt=e=>Lh(e,t=>Xx(e,t,!0)),BWt=e=>Lh(e,t=>Xx(e,t,!1)),UWt=e=>Lh(e,t=>Xx(e,t,!Ec(e))),VWt=e=>Lh(e,t=>Xx(e,t,Ec(e))),qWt=e=>Lh(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),HWt=e=>Lh(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Lke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:0})),!0),$ke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:e.doc.length})),!0),Fke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:e.selection.main.anchor,head:0})),!0),zke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),QWt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),WWt=({state:e,dispatch:t})=>{let r=HF(e).map(({from:n,to:s})=>nt.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:nt.create(r),userEvent:"select"})),!0},GWt=({state:e,dispatch:t})=>{let r=GE(e.selection,n=>{let s=Ia(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:l}=i;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&i.next)return nt.range(l.to,l.from)}return n});return r.eq(e.selection)?!1:(t(Fp(e,r)),!0)};function BZe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let l=a;;){let c=e.moveVertically(l,t);if(c.head<i.from||c.head>i.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(e.dispatch(Fp(r,nt.create(s,s.length-1))),!0)}const ZWt=e=>BZe(e,!1),YWt=e=>BZe(e,!0),XWt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=nt.create([r.main]):r.main.empty||(n=nt.create([nt.cursor(r.main.head)])),n?(t(Fp(e,n)),!0):!1};function qR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=sD(e,c,!1)):c>i&&(r="delete.forward",c=sD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=sD(e,i,!1),l=sD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function sD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const UZe=(e,t,r)=>qR(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(l=i.text.slice(0,s-i.from))){if(l[l.length-1]==" ")return s-1;let u=Ep(l,a.tabSize),d=u%fS(a)||fS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=bl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=bl(i.text,c-i.from,!1,!1)+i.from);return c}),ose=e=>UZe(e,!1,!0),VZe=e=>UZe(e,!0,!1),qZe=(e,t)=>qR(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let l=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let c=bl(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,c)-a.from,Math.max(n,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||n!=r.head)&&(l=d),n=c}return n}),HZe=e=>qZe(e,!1),KWt=e=>qZe(e,!0),JWt=e=>qR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),eGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),tGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),rGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Fs.of(["",""])},range:nt.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},nGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:bl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:bl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:nt.cursor(l)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function HF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function QZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of HF(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),l=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(nt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(nt.range(c.anchor-l,c.head-l))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:nt.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const sGt=({state:e,dispatch:t})=>QZe(e,t,!1),aGt=({state:e,dispatch:t})=>QZe(e,t,!0);function WZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of HF(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const iGt=({state:e,dispatch:t})=>WZe(e,t,!1),oGt=({state:e,dispatch:t})=>WZe(e,t,!0),lGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(HF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=GE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function cGt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ia(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(hn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const Bke=GZe(!1),uGt=GZe(!0);function GZe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&cGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new $F(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=pue(u,a);for(d==null&&(d=Ep(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<l.to&&/\s/.test(l.text[i-l.from]);)i++;c?{from:a,to:i}=c:a>l.from&&a<l.from+100&&!/\S/.test(l.text.slice(0,a))&&(a=l.from);let f=["",OA(t,d)];return c&&f.push(OA(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:Fs.of(f)},range:nt.cursor(a+1+f[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Gue(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let l=e.doc.lineAt(i);l.number>r&&(n.empty||n.to>l.from)&&(t(l,s,n),r=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:nt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const dGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new $F(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Gue(e,(a,i,l)=>{let c=pue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=OA(e,c);(u!=d||l.from<a.from+u.length)&&(r[a.from]=c,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},ZZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Gue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(HE)})}),{userEvent:"input.indent"})),!0),YZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Gue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Ep(s,e.tabSize),i=0,l=OA(e,Math.max(0,a-fS(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),fGt=e=>(e.setTabFocusMode(),!0),hGt=[{key:"Ctrl-b",run:_Ze,shift:PZe,preventDefault:!0},{key:"Ctrl-f",run:EZe,shift:MZe},{key:"Ctrl-p",run:TZe,shift:$Ze},{key:"Ctrl-n",run:NZe,shift:FZe},{key:"Ctrl-a",run:IWt,shift:qWt},{key:"Ctrl-e",run:RWt,shift:HWt},{key:"Ctrl-d",run:VZe},{key:"Ctrl-h",run:ose},{key:"Ctrl-k",run:JWt},{key:"Ctrl-Alt-h",run:HZe},{key:"Ctrl-o",run:rGt},{key:"Ctrl-t",run:nGt},{key:"Ctrl-v",run:ise}],pGt=[{key:"ArrowLeft",run:_Ze,shift:PZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:OWt,shift:DWt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:NWt,shift:UWt,preventDefault:!0},{key:"ArrowRight",run:EZe,shift:MZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:kWt,shift:LWt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:AWt,shift:VWt,preventDefault:!0},{key:"ArrowUp",run:TZe,shift:$Ze,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Lke,shift:Fke},{mac:"Ctrl-ArrowUp",run:Pke,shift:Mke},{key:"ArrowDown",run:NZe,shift:FZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$ke,shift:zke},{mac:"Ctrl-ArrowDown",run:ise,shift:Dke},{key:"PageUp",run:Pke,shift:Mke},{key:"PageDown",run:ise,shift:Dke},{key:"Home",run:TWt,shift:BWt,preventDefault:!0},{key:"Mod-Home",run:Lke,shift:Fke},{key:"End",run:jWt,shift:zWt,preventDefault:!0},{key:"Mod-End",run:$ke,shift:zke},{key:"Enter",run:Bke,shift:Bke},{key:"Mod-a",run:QWt},{key:"Backspace",run:ose,shift:ose,preventDefault:!0},{key:"Delete",run:VZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:HZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:KWt,preventDefault:!0},{mac:"Mod-Backspace",run:eGt,preventDefault:!0},{mac:"Mod-Delete",run:tGt,preventDefault:!0}].concat(hGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),mGt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:EWt,shift:$Wt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:CWt,shift:FWt},{key:"Alt-ArrowUp",run:sGt},{key:"Shift-Alt-ArrowUp",run:iGt},{key:"Alt-ArrowDown",run:aGt},{key:"Shift-Alt-ArrowDown",run:oGt},{key:"Mod-Alt-ArrowUp",run:ZWt},{key:"Mod-Alt-ArrowDown",run:YWt},{key:"Escape",run:XWt},{key:"Mod-Enter",run:uGt},{key:"Alt-l",mac:"Ctrl-l",run:WWt},{key:"Mod-i",run:GWt,preventDefault:!0},{key:"Mod-[",run:YZe},{key:"Mod-]",run:ZZe},{key:"Mod-Alt-\\",run:dGt},{key:"Shift-Mod-k",run:lGt},{key:"Shift-Mod-\\",run:MWt},{key:"Mod-/",run:sWt},{key:"Alt-A",run:iWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:fGt}].concat(pGt),gGt={key:"Tab",run:ZZe,shift:YZe},Uke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Wy{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?l=>a(Uke(l)):Uke,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Iu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Zce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Sm(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let l=s.charCodeAt(a),c=this.match(l,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}i==n&&a<r.length&&r.charCodeAt(a)==l&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],l=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,l=!0)),l||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Wy.prototype[Symbol.iterator]=function(){return this});const XZe={from:-1,to:-1,match:/.*/.exec("")},Zue="gm"+(/x/.unicode==null?"":"u");class KZe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=XZe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new JZe(t,r,n,s,a);this.re=new RegExp(r,Zue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=X3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=X3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const SV=new WeakMap;class Qk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=SV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Qk(r,t.sliceString(r,n));return SV.set(t,l),l}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),SV.set(t,new Qk(i,a)),new Qk(r,a.slice(r-i,n-i))}}class JZe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=XZe,this.matchPos=X3(t,s),this.re=new RegExp(r,Zue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Qk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=X3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Qk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(KZe.prototype[Symbol.iterator]=JZe.prototype[Symbol.iterator]=function(){return this});function yGt(e){try{return new RegExp(e,Zue),!0}catch{return!1}}function X3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}const vGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=sUt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(a=>{let i=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!i){e.dispatch({effects:n});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let y=p/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*y)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),g=nt.cursor(m.from+Math.max(0,Math.min(h,m.length)));e.dispatch({effects:[n,ft.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},bGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xGt=Kt.define({combine(e){return bg(e,bGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function wGt(e){return[EGt,_Gt]}const SGt=er.mark({class:"cm-selectionMatch"}),OGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Vke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=xi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=xi.Word)}function kGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const _Gt=Oi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(xGt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return er.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return er.none;let c=r.wordAt(s.head);if(!c)return er.none;i=r.charCategorizer(s.head),a=r.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return er.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(Vke(i,r,s.from,s.to)&&kGt(i,r,s.from,s.to)))return er.none}else if(a=r.sliceDoc(s.from,s.to),!a)return er.none}let l=[];for(let c of e.visibleRanges){let u=new Wy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Vke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(OGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(SGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),EGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),CGt=({state:e,dispatch:t})=>{let{selection:r}=e,n=nt.create(r.ranges.map(s=>e.wordAt(s.head)||nt.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function jGt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,l=new Wy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Wy(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(c=>c.from==l.value.from))continue;if(a){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const TGt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return CGt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=jGt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},ZE=Kt.define({combine(e){return bg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new VGt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class eYe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||yGt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
112
+ }`,{label:"class",detail:"definition",type:"keyword"}),Eu('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Eu('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],$Ge=Due.concat([Eu("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Eu("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Eu("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Eke=new $He,FGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Lj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const TQt=["FunctionDeclaration"],NQt={FunctionDeclaration:Lj("function"),ClassDeclaration:Lj("class"),ClassExpression:()=>!0,EnumDeclaration:Lj("constant"),TypeAliasDeclaration:Lj("type"),NamespaceDeclaration:Lj("namespace"),VariableDefinition(e,t){e.matchContext(TQt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function zGe(e,t){let r=Eke.get(t);if(r)return r;let n=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);n.push({label:c,type:l})}return t.cursor(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=NQt[i.name];if(l&&l(i,a)||FGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of zGe(e,i.node))n.push(l);return!1}}),Eke.set(t,n),n}const G3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Lue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function BGe(e){let t=Ia(e.state).resolveInner(e.pos,-1);if(Lue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&G3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)FGe.has(s.name)&&(n=n.concat(zGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:G3}}function pV(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function UGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ia(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pV(t,r.parent,""):Lue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&G3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pV(t,r,""):e.explicit?{path:[],name:""}:null}function AQt(e,t){let r=e,n=[],s=new Set;for(let a=0;;a++){for(let l of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||s.has(l))continue;s.add(l);let c;try{c=r[l]}catch{continue}n.push({label:l,type:typeof c=="function"?/^[A-Z]/.test(l)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return n;e=i}}function IQt(e){let t=new Map;return r=>{let n=UGe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=AQt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:G3}}}const gh=cS.define({name:"javascript",parser:jQt.configure({props:[u1.add({IfStatement:qk({except:/^\s*({|else\b)/}),TryStatement:qk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jUt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:CUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":qk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),d1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":gue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let r=e.lastChild;return{from:t.to,to:r.type.isError?e.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let r=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,n=e.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),VGe={test:e=>/^JSX/.test(e.name),facet:LF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},$ue=gh.configure({dialect:"ts"},"typescript"),Fue=gh.configure({dialect:"jsx",props:[hue.add(e=>e.isTop?[VGe]:void 0)]}),zue=gh.configure({dialect:"jsx ts",props:[hue.add(e=>e.isTop?[VGe]:void 0)]},"typescript");let qGe=e=>({label:e,type:"keyword"});const HGe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(qGe),RQt=HGe.concat(["declare","implements","private","protected","public"].map(qGe));function Z3(e={}){let t=e.jsx?e.typescript?zue:Fue:e.typescript?$ue:gh,r=e.typescript?$Ge.concat(RQt):Due.concat(HGe);return new dS(t,[gh.data.of({autocomplete:hVt(Lue,zWe(r))}),gh.data.of({autocomplete:BGe}),e.jsx?QGe:[]])}function PQt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Cke(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const MQt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),QGe=ft.inputHandler.of((e,t,r,n,s)=>{if((MQt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!gh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Ia(i).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=n||f.name=="JSXAttributeValue"&&f.to>d)){if(n==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=Cke(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:nt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let p=PQt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Cke(i.doc,p,d)))return{range:c,changes:{from:d,insert:`</${h}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function DQt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of gh.findRegions(n)){let l=n.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(LQt(u,n.doc,c))}return s}}function jke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function LQt(e,t,r){let n=jke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?jke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const nD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:QGe,completionPath:UGe,esLint:DQt,javascript:Z3,javascriptLanguage:gh,jsxLanguage:Fue,localCompletionSource:BGe,scopeCompletionSource:IQt,snippets:Due,tsxLanguage:zue,typescriptLanguage:$ue,typescriptSnippets:$Ge},Symbol.toStringTag,{value:"Module"})),$j=["_blank","_self","_top","_parent"],mV=["ascii","utf-8","utf-16","latin1","latin1"],gV=["get","post","put","delete"],yV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Sd=["true","false"],Dr={},$Qt={a:{attrs:{href:null,ping:null,type:null,media:null,target:$j,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:$j}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:$j,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":mV,autocomplete:["on","off"],enctype:yV,method:gV,novalidate:["novalidate"],target:$j}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:$j,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mV,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mV}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},WGe={accesskey:null,class:null,contenteditable:Sd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Sd,autocorrect:Sd,autocapitalize:Sd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Sd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Sd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Sd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Sd,"aria-hidden":Sd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Sd,"aria-multiselectable":Sd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Sd,"aria-relevant":null,"aria-required":Sd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},GGe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of GGe)WGe[e]=null;let IA=class{constructor(t,r){this.tags={...$Qt,...t},this.globalAttrs={...WGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};IA.default=new IA;function P_(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function M_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function ZGe(e,t,r){let n=r.tags[P_(e,M_(t))];return n?.children||r.allTags}function Bue(e,t){let r=[];for(let n=M_(t);n&&!n.type.isTop;n=M_(n.parent)){let s=P_(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const YGe=/^[:\-\.\w\u00b7-\uffff]*$/;function Tke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=M_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:ZGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Bue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Nke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Bue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:YGe}}function FQt(e,t,r,n){let s=[],a=0;for(let i of ZGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Bue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function zQt(e,t,r,n,s){let a=M_(r),i=a?t.tags[P_(e.doc,a)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:YGe}}function BQt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),l=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=M_(r),h=f?t.tags[P_(e.doc,f)]:null;d=h?.attrs&&h.attrs[u]}if(d){let f=e.sliceDoc(n,s).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),n++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:h+m+p,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function XGe(e,t){let{state:r,pos:n}=t,s=Ia(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,l;a==s&&(l=s.childBefore(i));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=l,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Nke(r,s,s.from,n):Tke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?Tke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Nke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?zQt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?BQt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?FQt(r,e,s,n):null}function KGe(e){return XGe(IA.default,e)}function JGe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new IA(t,r):IA.default;return s=>XGe(n,s)}const UQt=gh.parser.configure({top:"SingleExpression"}),eZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:$ue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Fue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:zue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:UQt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:gh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:AA.parser}],tZe=[{name:"style",parser:AA.parser.configure({top:"Styles"})}].concat(GGe.map(e=>({name:e,parser:gh.parser}))),rZe=cS.define({name:"html",parser:yHt.configure({props:[u1.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),d1.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),RWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),SN=rZe.configure({wrap:jGe(eZe,tZe)});function nZe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=jGe((e.nestedLanguages||[]).concat(eZe),(e.nestedAttributes||[]).concat(tZe)));let n=r?rZe.configure({wrap:r,dialect:t}):t?SN.configure({dialect:t}):SN;return new dS(n,[SN.data.of({autocomplete:JGe(e)}),e.autoCloseTags!==!1?sZe:[],Z3().support,DGe().support])}const Ake=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),sZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!SN.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let h=i.doc.sliceString(c.from-1,c.to)==n,{head:p}=c,m=Ia(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let y=m.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=P_(i.doc,y.parent,p))&&!Ake.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:p,to:x,insert:w}}}}else if(h&&n=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==p-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=P_(i.doc,y,p))&&!Ake.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`${g}>`;return{range:nt.cursor(p+w.length,-1),changes:{from:p,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),VQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:sZe,html:nZe,htmlCompletionSource:KGe,htmlCompletionSourceWith:JGe,htmlLanguage:SN},Symbol.toStringTag,{value:"Module"})),aZe=LF({commentTokens:{block:{open:"<!--",close:"-->"}}}),iZe=new hn,oZe=bqt.configure({props:[d1.add(e=>!e.is("Block")||e.is("Document")||nse(e)!=null||qQt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),iZe.add(nse),u1.add({Document:()=>null}),Fb.add({Document:aZe})]});function nse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function qQt(e){return e.name=="OrderedList"||e.name=="BulletList"}function HQt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=nse(n.type))!=null&&s<=t)break;r=n}return r.to}const QQt=wWe.of((e,t,r)=>{for(let n=Ia(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(iZe);if(s==null)continue;let a=HQt(n,s);if(a>r)return{from:r,to:a}}return null});function Uue(e){return new qd(aZe,e,[],"markdown")}const lZe=Uue(oZe),WQt=oZe.configure([Nqt,Iqt,Aqt,Rqt,{props:[d1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),pS=Uue(WQt);function GQt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=Ye.matchLanguageName(e,r,!0),n instanceof Ye)return n.support?n.support.language.parser:uS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class vV{constructor(t,r,n,s,a,i,l){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+uZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function cZe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new vV(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new vV(a.parent,c,c+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),n.push(new vV(a.parent,c,c+d,i[1],u,f,a))}}return n}function uZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=uZe(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;r.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+n)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Vue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(HE)!=" ")return e;let n=Ep(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const dZe=(e={})=>({state:t,dispatch:r})=>{let n=Ia(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!pS.isActiveAt(t,l.from,-1)&&!pS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=cZe(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,k,_="";S&&S.item?(k=u.from+S.from,_=S.marker(s,1)):k=u.from+(S?S.to:0);let E=[{from:k,to:c,insert:_}];return f.node.name=="OrderedList"&&bV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=Rke(d,t,u);return{range:nt.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let S=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(S),changes:S}}}let p=[];f.node.name=="OrderedList"&&bV(f.item,s,p);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)g+=x==w&&!m?d[x].marker(s,1):d[x].blank(x<w?Ep(u.text,4,d[x+1].from)-g.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return g=Vue(g,t),ZQt(f.node,t.doc)&&(g=Rke(d,t,u)+t.lineBreak+g),p.push({from:y,to:c,insert:t.lineBreak+g}),{range:nt.cursor(y+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},fZe=dZe();function Ike(e){return e.name=="QuoteMark"||e.name=="ListMark"}function ZQt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function Rke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Ep(r.text,4,e[s+1].from)-n.length:null,s<a);return Vue(n,t)}function YQt(e,t){let r=e.resolveInner(t,-1),n=t;Ike(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Ike(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const hZe=({state:e,dispatch:t})=>{let r=Ia(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&pS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=cZe(YQt(r,i),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:nt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let p=d.blank(Ep(c.text,4,d.to)-Ep(c.text,4,d.from));return h==c.from&&(p=Vue(p,e)),{range:nt.cursor(h+p.length),changes:{from:h,to:c.from+d.to,insert:p}}}if(h<i)return{range:nt.cursor(h),changes:{from:h,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},pZe=[{key:"Enter",run:fZe},{key:"Backspace",run:hZe}],mZe=nZe({matchClosingTags:!1});function que(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=lZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=mZe}=e;if(!(s instanceof BF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,QQt],d;i&&u.push(gZe),r instanceof dS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?GQt(t,d):void 0;c.push(wqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Lp.high(qE.of(pZe)));let h=Uue(s.configure(c));return a&&u.push(h.data.of({autocomplete:XQt})),new dS(h,u)}function XQt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ia(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:KQt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xV=null;function KQt(){if(xV)return xV;let e=KGe(new xue(zn.create({extensions:mZe}),0,!0));return xV=e?e.options:[]}const JQt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,gZe=ft.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!pS.isActiveAt(t.state,n.from,1)))return!1;let a=Ia(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||JQt.test(l.name))&&(i=!0)},leave:l=>{l.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),eWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:lZe,deleteMarkupBackward:hZe,insertNewlineContinueMarkup:fZe,insertNewlineContinueMarkupCommand:dZe,markdown:que,markdownKeymap:pZe,markdownLanguage:pS,pasteURLAsLink:gZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new dS(yue.define(e))}function nb(e){return Ke(()=>import("./index-BCwR6vp1.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const yZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-B3MkakF9.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ke(()=>import("./index-B3MkakF9.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return nb("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>XHt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-wHzEsd80.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ke(()=>Promise.resolve().then(()=>VQt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-D8SDA92a.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-Di1ViftD.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ke(()=>Promise.resolve().then(()=>dVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-DGC3u8bI.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-DEKily7r.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return nb("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>eWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return nb("MSSQL")}}),Ye.of({name:"MySQL",load(){return nb("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-CW06ies5.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return nb("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return nb("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-og54ikTe.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-DGZMX6ra.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-V44U4ji8.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return Ke(()=>import("./index-V44U4ji8.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return nb("StandardSQL")}}),Ye.of({name:"SQLite",load(){return nb("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>nD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-CxVdYbxX.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ke(()=>import("./index-iS9-i0x7.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ke(()=>import("./index-CAegeqJM.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return Ke(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>pt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ke(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>pt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ke(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>pt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ke(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>pt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ke(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>pt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ke(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>pt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ke(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>pt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ke(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>pt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ke(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>pt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ke(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>pt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ke(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>pt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ke(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>pt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return Ke(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>pt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return Ke(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>pt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return Ke(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>pt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ke(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>pt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return Ke(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>pt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ke(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>pt(e.dylan))}}),Ye.of({name:"EBNF",load(){return Ke(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>pt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return Ke(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>pt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return Ke(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>pt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return Ke(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>pt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return Ke(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>pt(e.erlang))}}),Ye.of({name:"Esper",load(){return Ke(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>pt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return Ke(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>pt(e.factor))}}),Ye.of({name:"FCL",load(){return Ke(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>pt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ke(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>pt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ke(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>pt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return Ke(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>pt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return Ke(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>pt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ke(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>pt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return Ke(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>pt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.hxml))}}),Ye.of({name:"HTTP",load(){return Ke(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>pt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return Ke(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>pt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ke(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>pt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return Ke(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>pt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ke(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>pt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return Ke(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>pt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return Ke(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>pt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ke(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>pt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return Ke(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>pt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return Ke(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>pt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return Ke(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>pt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ke(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>pt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ke(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>pt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return Ke(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>pt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return Ke(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>pt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return Ke(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>pt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return Ke(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>pt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return Ke(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>pt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return Ke(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>pt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ke(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>pt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ke(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>pt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return Ke(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>pt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ke(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>pt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return Ke(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>pt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return Ke(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>pt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ke(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>pt(e.r))}}),Ye.of({name:"RPM Changes",load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ke(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>pt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return Ke(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>pt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return Ke(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>pt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ke(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>pt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ke(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>pt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return Ke(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>pt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return Ke(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>pt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ke(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>pt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ke(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>pt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return Ke(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>pt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return Ke(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>pt(e.swift))}}),Ye.of({name:"sTeX",load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return Ke(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>pt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return Ke(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>pt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return Ke(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>pt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return Ke(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>pt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return Ke(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>pt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ke(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>pt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ke(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>pt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ke(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>pt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return Ke(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>pt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return Ke(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>pt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return Ke(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>pt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return Ke(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>pt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return Ke(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>pt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ke(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>pt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ke(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>pt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return Ke(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>pt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return Ke(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>pt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return Ke(()=>import("./index-BD28sRL1.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-DeN__BFT.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function Ox(){return Ox=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ox.apply(null,arguments)}var tWt=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=ft.theme(s,{dark:t==="dark"}),c=$p.define(n),u=[l,Yx(c)];return u},rWt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},nWt=[{tag:ne.comment,color:"#6272a4"},{tag:ne.string,color:"#f1fa8c"},{tag:ne.atom,color:"#bd93f9"},{tag:ne.meta,color:"#f8f8f2"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"#ff79c6"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"#66d9ef"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"#50fa7b"},{tag:ne.atom,color:"#bd93f9"}],WE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return tWt({theme:t,settings:Ox({},rWt,r),styles:[...nWt,...n]})};WE();function Hue(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const sWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Wue(e.state,r.from);return n.line?aWt(e):n.block?oWt(e):!1};function Que(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const aWt=Que(uWt,0),iWt=Que(vZe,0),oWt=Que((e,t)=>vZe(e,t,cWt(t)),0);function Wue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Fj=50;function lWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Fj,n),i=e.sliceDoc(s,s+Fj),l=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-l;if(a.slice(u-t.length,u)==t&&i.slice(c,c+r.length)==r)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-n<=2*Fj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Fj),f=e.sliceDoc(s-Fj,s));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-r.length;return d.slice(h,h+t.length)==t&&f.slice(m,m+r.length)==r?{open:{pos:n+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:s-p-r.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function cWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function vZe(e,t,r=t.selection.ranges){let n=r.map(a=>Wue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>lWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,l;i<s.length;i++)if(l=s[i]){let c=n[i],{open:u,close:d}=l;a.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function uWt(e,t,r=t.selection.ranges){let n=[],s=-1;e:for(let{from:a,to:i}of r){let l=n.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=Wue(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),n.push({line:f,comment:m,token:u,indent:h,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of n)(f||!d)&&a.push({from:l.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of n)if(l>=0){let u=i.from+l,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const sse=vg.define(),dWt=vg.define(),fWt=Kt.define(),bZe=Kt.define({combine(e){return bg(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),xZe=Oo.define({create(){return Pm.empty},update(e,t){let r=t.state.facet(bZe),n=t.annotation(sse);if(n){let c=zu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=Y3(d,d.length,r.minDepth,c):d=OZe(d,t.startState.selection),new Pm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(dWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=zu.fromTransaction(t),i=t.annotation(Mo.time),l=t.annotation(Mo.userEvent);return a?e=e.addChanges(a,i,l,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Pm(e.done.map(zu.fromJSON),e.undone.map(zu.fromJSON))}});function hWt(e={}){return[xZe,bZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?wZe:t.inputType=="historyRedo"?ase:null;return n?(t.preventDefault(),n(r)):!1}})]}function UF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(xZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const wZe=UF(0,!1),ase=UF(1,!1),pWt=UF(0,!0),mWt=UF(1,!0);class zu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new zu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new zu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Wm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=ch;for(let s of t.startState.facet(fWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new zu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,ch)}static selection(t){return new zu(void 0,ch,void 0,void 0,t)}}function Y3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function gWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<r.length;){let u=r[c++],d=r[c++];l>=u&&i<=d&&(n=!0)}}),n}function yWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function SZe(e,t){return e.length?t.length?e.concat(t):e:t}const ch=[],vWt=200;function OZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-vWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Y3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[zu.selection([t])]}function bWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function wV(e,t){if(!e.length)return e;let r=e.length,n=ch;for(;r;){let s=xWt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[zu.selection(n)]:ch}function xWt(e,t,r){let n=SZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):ch,r);if(!e.changes)return zu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new zu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const wWt=/^(input\.type|delete)($|\.)/;class Pm{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Pm(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!n||wWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,gWt(l.changes,t.changes))||n=="input.type.compose")?i=Y3(i,i.length-1,s.minDepth,new zu(t.changes.compose(l.changes),SZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,ch)):i=Y3(i,i.length,s.minDepth,t),new Pm(i,ch,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:ch;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&yWt(a[a.length-1],t)?this:new Pm(OZe(this.done,t),this.undone,r,n)}addMapping(t){return new Pm(wV(this.done,t),wV(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):r.selection);if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:sse.of({side:t,rest:bWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?ch:s.slice(0,s.length-1);return a.mapped&&(l=wV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:sse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Pm.empty=new Pm(ch,ch);const SWt=[{key:"Mod-z",run:wZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ase,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ase,preventDefault:!0},{key:"Mod-u",run:pWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:mWt,preventDefault:!0}];function GE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function Fp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function zp({state:e,dispatch:t},r){let n=GE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Fp(e,n)),!0)}function VF(e,t){return nt.cursor(t?e.to:e.from)}function kZe(e,t){return zp(e,r=>r.empty?e.moveByChar(r,t):VF(r,t))}function Ec(e){return e.textDirectionAt(e.state.selection.main.head)==La.LTR}const _Ze=e=>kZe(e,!Ec(e)),EZe=e=>kZe(e,Ec(e));function CZe(e,t){return zp(e,r=>r.empty?e.moveByGroup(r,t):VF(r,t))}const OWt=e=>CZe(e,!Ec(e)),kWt=e=>CZe(e,Ec(e));function _Wt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qF(e,t,r){let n=Ia(e).resolveInner(t.head),s=r?hn.closedBy:hn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;_Wt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Rm(e,n.from,1):Rm(e,n.to,-1))&&i.matched?l=r?i.end.to:i.end.from:l=r?n.to:n.from,nt.cursor(l,r?-1:1)}const EWt=e=>zp(e,t=>qF(e.state,t,!Ec(e))),CWt=e=>zp(e,t=>qF(e.state,t,Ec(e)));function jZe(e,t){return zp(e,r=>{if(!r.empty)return VF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const TZe=e=>jZe(e,!1),NZe=e=>jZe(e,!0);function AZe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(ft.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function IZe(e,t){let r=AZe(e),{state:n}=e,s=GE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):VF(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+r.marginTop,u=l.bottom-r.marginBottom;i&&i.top>c&&i.bottom<u&&(a=ft.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Fp(n,s),{effects:a}),!0}const Pke=e=>IZe(e,!1),ise=e=>IZe(e,!0);function Xx(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=nt.cursor(n.from+a))}return s}const jWt=e=>zp(e,t=>Xx(e,t,!0)),TWt=e=>zp(e,t=>Xx(e,t,!1)),NWt=e=>zp(e,t=>Xx(e,t,!Ec(e))),AWt=e=>zp(e,t=>Xx(e,t,Ec(e))),IWt=e=>zp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),RWt=e=>zp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function PWt(e,t,r){let n=!1,s=GE(e.selection,a=>{let i=Rm(e,a.head,-1)||Rm(e,a.head,1)||a.head>0&&Rm(e,a.head-1,1)||a.head<e.doc.length&&Rm(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return nt.cursor(l)});return n?(t(Fp(e,s)),!0):!1}const MWt=({state:e,dispatch:t})=>PWt(e,t);function Lh(e,t){let r=GE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Fp(e.state,r)),!0)}function RZe(e,t){return Lh(e,r=>e.moveByChar(r,t))}const PZe=e=>RZe(e,!Ec(e)),MZe=e=>RZe(e,Ec(e));function DZe(e,t){return Lh(e,r=>e.moveByGroup(r,t))}const DWt=e=>DZe(e,!Ec(e)),LWt=e=>DZe(e,Ec(e)),$Wt=e=>Lh(e,t=>qF(e.state,t,!Ec(e))),FWt=e=>Lh(e,t=>qF(e.state,t,Ec(e)));function LZe(e,t){return Lh(e,r=>e.moveVertically(r,t))}const $Ze=e=>LZe(e,!1),FZe=e=>LZe(e,!0);function zZe(e,t){return Lh(e,r=>e.moveVertically(r,t,AZe(e).height))}const Mke=e=>zZe(e,!1),Dke=e=>zZe(e,!0),zWt=e=>Lh(e,t=>Xx(e,t,!0)),BWt=e=>Lh(e,t=>Xx(e,t,!1)),UWt=e=>Lh(e,t=>Xx(e,t,!Ec(e))),VWt=e=>Lh(e,t=>Xx(e,t,Ec(e))),qWt=e=>Lh(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),HWt=e=>Lh(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Lke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:0})),!0),$ke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:e.doc.length})),!0),Fke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:e.selection.main.anchor,head:0})),!0),zke=({state:e,dispatch:t})=>(t(Fp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),QWt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),WWt=({state:e,dispatch:t})=>{let r=HF(e).map(({from:n,to:s})=>nt.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:nt.create(r),userEvent:"select"})),!0},GWt=({state:e,dispatch:t})=>{let r=GE(e.selection,n=>{let s=Ia(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:l}=i;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&i.next)return nt.range(l.to,l.from)}return n});return r.eq(e.selection)?!1:(t(Fp(e,r)),!0)};function BZe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let l=a;;){let c=e.moveVertically(l,t);if(c.head<i.from||c.head>i.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(e.dispatch(Fp(r,nt.create(s,s.length-1))),!0)}const ZWt=e=>BZe(e,!1),YWt=e=>BZe(e,!0),XWt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=nt.create([r.main]):r.main.empty||(n=nt.create([nt.cursor(r.main.head)])),n?(t(Fp(e,n)),!0):!1};function qR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=sD(e,c,!1)):c>i&&(r="delete.forward",c=sD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=sD(e,i,!1),l=sD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function sD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const UZe=(e,t,r)=>qR(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(l=i.text.slice(0,s-i.from))){if(l[l.length-1]==" ")return s-1;let u=Ep(l,a.tabSize),d=u%fS(a)||fS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=bl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=bl(i.text,c-i.from,!1,!1)+i.from);return c}),ose=e=>UZe(e,!1,!0),VZe=e=>UZe(e,!0,!1),qZe=(e,t)=>qR(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let l=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let c=bl(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,c)-a.from,Math.max(n,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||n!=r.head)&&(l=d),n=c}return n}),HZe=e=>qZe(e,!1),KWt=e=>qZe(e,!0),JWt=e=>qR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),eGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),tGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),rGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Fs.of(["",""])},range:nt.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},nGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:bl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:bl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:nt.cursor(l)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function HF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function QZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of HF(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),l=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(nt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(nt.range(c.anchor-l,c.head-l))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:nt.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const sGt=({state:e,dispatch:t})=>QZe(e,t,!1),aGt=({state:e,dispatch:t})=>QZe(e,t,!0);function WZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of HF(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const iGt=({state:e,dispatch:t})=>WZe(e,t,!1),oGt=({state:e,dispatch:t})=>WZe(e,t,!0),lGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(HF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=GE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function cGt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ia(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(hn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const Bke=GZe(!1),uGt=GZe(!0);function GZe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&cGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new $F(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=pue(u,a);for(d==null&&(d=Ep(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<l.to&&/\s/.test(l.text[i-l.from]);)i++;c?{from:a,to:i}=c:a>l.from&&a<l.from+100&&!/\S/.test(l.text.slice(0,a))&&(a=l.from);let f=["",OA(t,d)];return c&&f.push(OA(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:Fs.of(f)},range:nt.cursor(a+1+f[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Gue(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let l=e.doc.lineAt(i);l.number>r&&(n.empty||n.to>l.from)&&(t(l,s,n),r=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:nt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const dGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new $F(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Gue(e,(a,i,l)=>{let c=pue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=OA(e,c);(u!=d||l.from<a.from+u.length)&&(r[a.from]=c,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},ZZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Gue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(HE)})}),{userEvent:"input.indent"})),!0),YZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Gue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Ep(s,e.tabSize),i=0,l=OA(e,Math.max(0,a-fS(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),fGt=e=>(e.setTabFocusMode(),!0),hGt=[{key:"Ctrl-b",run:_Ze,shift:PZe,preventDefault:!0},{key:"Ctrl-f",run:EZe,shift:MZe},{key:"Ctrl-p",run:TZe,shift:$Ze},{key:"Ctrl-n",run:NZe,shift:FZe},{key:"Ctrl-a",run:IWt,shift:qWt},{key:"Ctrl-e",run:RWt,shift:HWt},{key:"Ctrl-d",run:VZe},{key:"Ctrl-h",run:ose},{key:"Ctrl-k",run:JWt},{key:"Ctrl-Alt-h",run:HZe},{key:"Ctrl-o",run:rGt},{key:"Ctrl-t",run:nGt},{key:"Ctrl-v",run:ise}],pGt=[{key:"ArrowLeft",run:_Ze,shift:PZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:OWt,shift:DWt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:NWt,shift:UWt,preventDefault:!0},{key:"ArrowRight",run:EZe,shift:MZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:kWt,shift:LWt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:AWt,shift:VWt,preventDefault:!0},{key:"ArrowUp",run:TZe,shift:$Ze,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Lke,shift:Fke},{mac:"Ctrl-ArrowUp",run:Pke,shift:Mke},{key:"ArrowDown",run:NZe,shift:FZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$ke,shift:zke},{mac:"Ctrl-ArrowDown",run:ise,shift:Dke},{key:"PageUp",run:Pke,shift:Mke},{key:"PageDown",run:ise,shift:Dke},{key:"Home",run:TWt,shift:BWt,preventDefault:!0},{key:"Mod-Home",run:Lke,shift:Fke},{key:"End",run:jWt,shift:zWt,preventDefault:!0},{key:"Mod-End",run:$ke,shift:zke},{key:"Enter",run:Bke,shift:Bke},{key:"Mod-a",run:QWt},{key:"Backspace",run:ose,shift:ose,preventDefault:!0},{key:"Delete",run:VZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:HZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:KWt,preventDefault:!0},{mac:"Mod-Backspace",run:eGt,preventDefault:!0},{mac:"Mod-Delete",run:tGt,preventDefault:!0}].concat(hGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),mGt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:EWt,shift:$Wt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:CWt,shift:FWt},{key:"Alt-ArrowUp",run:sGt},{key:"Shift-Alt-ArrowUp",run:iGt},{key:"Alt-ArrowDown",run:aGt},{key:"Shift-Alt-ArrowDown",run:oGt},{key:"Mod-Alt-ArrowUp",run:ZWt},{key:"Mod-Alt-ArrowDown",run:YWt},{key:"Escape",run:XWt},{key:"Mod-Enter",run:uGt},{key:"Alt-l",mac:"Ctrl-l",run:WWt},{key:"Mod-i",run:GWt,preventDefault:!0},{key:"Mod-[",run:YZe},{key:"Mod-]",run:ZZe},{key:"Mod-Alt-\\",run:dGt},{key:"Shift-Mod-k",run:lGt},{key:"Shift-Mod-\\",run:MWt},{key:"Mod-/",run:sWt},{key:"Alt-A",run:iWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:fGt}].concat(pGt),gGt={key:"Tab",run:ZZe,shift:YZe},Uke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Wy{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?l=>a(Uke(l)):Uke,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Iu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Zce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Sm(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let l=s.charCodeAt(a),c=this.match(l,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}i==n&&a<r.length&&r.charCodeAt(a)==l&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],l=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,l=!0)),l||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Wy.prototype[Symbol.iterator]=function(){return this});const XZe={from:-1,to:-1,match:/.*/.exec("")},Zue="gm"+(/x/.unicode==null?"":"u");class KZe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=XZe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new JZe(t,r,n,s,a);this.re=new RegExp(r,Zue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=X3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=X3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const SV=new WeakMap;class Qk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=SV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Qk(r,t.sliceString(r,n));return SV.set(t,l),l}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),SV.set(t,new Qk(i,a)),new Qk(r,a.slice(r-i,n-i))}}class JZe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=XZe,this.matchPos=X3(t,s),this.re=new RegExp(r,Zue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Qk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=X3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Qk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(KZe.prototype[Symbol.iterator]=JZe.prototype[Symbol.iterator]=function(){return this});function yGt(e){try{return new RegExp(e,Zue),!0}catch{return!1}}function X3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}const vGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=sUt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(a=>{let i=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!i){e.dispatch({effects:n});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let y=p/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*y)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),g=nt.cursor(m.from+Math.max(0,Math.min(h,m.length)));e.dispatch({effects:[n,ft.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},bGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xGt=Kt.define({combine(e){return bg(e,bGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function wGt(e){return[EGt,_Gt]}const SGt=er.mark({class:"cm-selectionMatch"}),OGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Vke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=xi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=xi.Word)}function kGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const _Gt=Oi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(xGt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return er.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return er.none;let c=r.wordAt(s.head);if(!c)return er.none;i=r.charCategorizer(s.head),a=r.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return er.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(Vke(i,r,s.from,s.to)&&kGt(i,r,s.from,s.to)))return er.none}else if(a=r.sliceDoc(s.from,s.to),!a)return er.none}let l=[];for(let c of e.visibleRanges){let u=new Wy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Vke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(OGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(SGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),EGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),CGt=({state:e,dispatch:t})=>{let{selection:r}=e,n=nt.create(r.ranges.map(s=>e.wordAt(s.head)||nt.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function jGt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,l=new Wy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Wy(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(c=>c.from==l.value.from))continue;if(a){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const TGt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return CGt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=jGt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},ZE=Kt.define({combine(e){return bg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new VGt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class eYe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||yGt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
113
113
  `:n=="r"?"\r":n=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new MGt(this):new IGt(this)}getCursor(t,r=0,n){let s=t.doc?t:zn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?QO(this,s,r,n):HO(this,s,r,n)}}class tYe{constructor(t){this.spec=t}}function NGt(e,t,r){return(n,s,a,i)=>{if(r&&!r(n,s,a,i))return!1;let l=n>=i&&s<=i+a.length?a.slice(n-i,s-i):t.doc.sliceString(n,s);return e(l,t,n,s)}}function HO(e,t,r,n){let s;return e.wholeWord&&(s=AGt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=NGt(e.test,t,s)),new Wy(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function AGt(e,t){return(r,n,s,a)=>((a>r||a+s.length<n)&&(a=Math.max(0,r-2),s=e.sliceString(a,Math.min(e.length,n+2))),(t(K3(s,r-a))!=xi.Word||t(J3(s,r-a))!=xi.Word)&&(t(J3(s,n-a))!=xi.Word||t(K3(s,n-a))!=xi.Word))}class IGt extends tYe{constructor(t){super(t)}nextMatch(t,r,n){let s=HO(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=HO(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==r&&s.value.to==n?null:s.value}prevMatchInRange(t,r,n){for(let s=n;;){let a=Math.max(r,s-1e4-this.spec.unquoted.length),i=HO(this.spec,t,a,s),l=null;for(;!i.nextOverlapping().done;)l=i.value;if(l)return l;if(a==r)return null;s-=1e4}}prevMatch(t,r,n){let s=this.prevMatchInRange(t,0,r);return s||(s=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=r||s.to!=n)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,r){let n=HO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=HO(this.spec,t,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function RGt(e,t,r){return(n,s,a)=>(!r||r(n,s,a))&&e(a[0],t,n,s)}function QO(e,t,r,n){let s;return e.wholeWord&&(s=PGt(t.charCategorizer(t.selection.main.head))),e.test&&(s=RGt(e.test,t,s)),new KZe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},r,n)}function K3(e,t){return e.slice(bl(e,t,!1),t)}function J3(e,t){return e.slice(t,bl(e,t))}function PGt(e){return(t,r,n)=>!n[0].length||(e(K3(n.input,n.index))!=xi.Word||e(J3(n.input,n.index))!=xi.Word)&&(e(J3(n.input,n.index+n[0].length))!=xi.Word||e(K3(n.input,n.index+n[0].length))!=xi.Word)}class MGt extends tYe{nextMatch(t,r,n){let s=QO(this.spec,t,n,t.doc.length).next();return s.done&&(s=QO(this.spec,t,0,r).next()),s.done?null:s.value}prevMatchInRange(t,r,n){for(let s=1;;s++){let a=Math.max(r,n-s*1e4),i=QO(this.spec,t,a,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(a==r||l.from>a+10))return l;if(a==r)return null}}prevMatch(t,r,n){return this.prevMatchInRange(t,0,r)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return t.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let a=+n.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+n.slice(s)}return r})}matchAll(t,r){let n=QO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=QO(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const RA=rn.define(),Yue=rn.define(),Hb=Oo.define({create(e){return new OV(lse(e).create(),null)},update(e,t){for(let r of t.effects)r.is(RA)?e=new OV(r.value.create(),e.panel):r.is(Yue)&&(e=new OV(e.query,r.value?Xue:null));return e},provide:e=>SA.from(e,t=>t.panel)});class OV{constructor(t,r){this.query=t,this.panel=r}}const DGt=er.mark({class:"cm-searchMatch"}),LGt=er.mark({class:"cm-searchMatch cm-searchMatch-selected"}),$Gt=Oi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Hb))}update(e){let t=e.state.field(Hb);(t!=e.startState.field(Hb)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return er.none;let{view:r}=this,n=new au;for(let s=0,a=r.visibleRanges,i=a.length;s<i;s++){let{from:l,to:c}=a[s];for(;s<i-1&&c>a[s+1].from-500;)c=a[++s].to;e.highlight(r.state,l,c,(u,d)=>{let f=r.state.selection.ranges.some(h=>h.from==u&&h.to==d);n.add(u,d,f?LGt:DGt)})}return n.finish()}},{decorations:e=>e.decorations});function HR(e){return t=>{let r=t.state.field(Hb,!1);return r&&r.query.spec.valid?e(t,r):sYe(t)}}const e5=HR((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let s=nt.single(n.from,n.to),a=e.state.facet(ZE);return e.dispatch({selection:s,effects:[Kue(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),nYe(e),!0}),t5=HR((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,s=t.prevMatch(r,n,n);if(!s)return!1;let a=nt.single(s.from,s.to),i=e.state.facet(ZE);return e.dispatch({selection:a,effects:[Kue(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),nYe(e),!0}),FGt=HR((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:nt.create(r.map(n=>nt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),zGt=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:s}=r.main,a=[],i=0;for(let l=new Wy(e.doc,e.sliceDoc(n,s));!l.next().done;){if(a.length>1e3)return!1;l.value.from==n&&(i=a.length),a.push(nt.range(l.value.from,l.value.to))}return t(e.update({selection:nt.create(a,i),userEvent:"select.search.matches"})),!0},qke=HR((e,{query:t})=>{let{state:r}=e,{from:n,to:s}=r.selection.main;if(r.readOnly)return!1;let a=t.nextMatch(r,n,n);if(!a)return!1;let i=a,l=[],c,u,d=[];i.from==n&&i.to==s&&(u=r.toText(t.getReplacement(i)),l.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(r,i.from,i.to),d.push(ft.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let f=e.state.changes(l);return i&&(c=nt.single(i.from,i.to).map(f),d.push(Kue(e,i)),d.push(r.facet(ZE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),BGt=HR((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map(s=>{let{from:a,to:i}=s;return{from:a,to:i,insert:t.getReplacement(s)}});if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:ft.announce.of(n),userEvent:"input.replace.all"}),!0});function Xue(e){return e.state.facet(ZE).createPanel(e)}function lse(e,t){var r,n,s,a,i;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(ZE);return new eYe({search:((r=t?.literal)!==null&&r!==void 0?r:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=t?.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(s=t?.literal)!==null&&s!==void 0?s:u.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:u.wholeWord})}function rYe(e){let t=fue(e,Xue);return t&&t.dom.querySelector("[main-field]")}function nYe(e){let t=rYe(e);t&&t==e.root.activeElement&&t.select()}const sYe=e=>{let t=e.state.field(Hb,!1);if(t&&t.panel){let r=rYe(e);if(r&&r!=e.root.activeElement){let n=lse(e.state,t.query.spec);n.valid&&e.dispatch({effects:RA.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[Yue.of(!0),t?RA.of(lse(e.state,t.query.spec)):rn.appendConfig.of(HGt)]});return!0},aYe=e=>{let t=e.state.field(Hb,!1);if(!t||!t.panel)return!1;let r=fue(e,Xue);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Yue.of(!1)}),!0},UGt=[{key:"Mod-f",run:sYe,scope:"editor search-panel"},{key:"F3",run:e5,shift:t5,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:e5,shift:t5,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:aYe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:zGt},{key:"Mod-Alt-g",run:vGt},{key:"Mod-d",run:TGt,preventDefault:!0}];class VGt{constructor(t){this.view=t;let r=this.query=t.state.field(Hb).query.spec;this.commit=this.commit.bind(this),this.searchField=Ea("input",{value:r.search,placeholder:Od(t,"Find"),"aria-label":Od(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ea("input",{value:r.replace,placeholder:Od(t,"Replace"),"aria-label":Od(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ea("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=Ea("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=Ea("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,a,i){return Ea("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Ea("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>e5(t),[Od(t,"next")]),n("prev",()=>t5(t),[Od(t,"previous")]),n("select",()=>FGt(t),[Od(t,"all")]),Ea("label",null,[this.caseField,Od(t,"match case")]),Ea("label",null,[this.reField,Od(t,"regexp")]),Ea("label",null,[this.wordField,Od(t,"by word")]),...t.state.readOnly?[]:[Ea("br"),this.replaceField,n("replace",()=>qke(t),[Od(t,"replace")]),n("replaceAll",()=>BGt(t),[Od(t,"replace all")])],Ea("button",{name:"close",onclick:()=>aYe(t),"aria-label":Od(t,"close"),type:"button"},["×"])])}commit(){let t=new eYe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:RA.of(t)}))}keydown(t){m7t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?t5:e5)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),qke(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(RA)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ZE).top}}function Od(e,t){return e.state.phrase(t)}const aD=30,iD=/[\s\.,:;?!]/;function Kue(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),s=e.state.doc.lineAt(r).to,a=Math.max(n.from,t-aD),i=Math.min(s,r+aD),l=e.state.sliceDoc(a,i);if(a!=n.from){for(let c=0;c<aD;c++)if(!iD.test(l[c+1])&&iD.test(l[c])){l=l.slice(c);break}}if(i!=s){for(let c=l.length-1;c>l.length-aD;c--)if(!iD.test(l[c-1])&&iD.test(l[c])){l=l.slice(0,c);break}}return ft.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${n.number}.`)}const qGt=ft.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),HGt=[Hb,Lp.low($Gt),qGt];class Hke{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class yw{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(PA).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new au,l=[],c=0;for(let d=0;;){let f=d==a.length?null:a[d];if(!f&&!l.length)break;let h,p;for(l.length?(h=c,p=l.reduce((g,y)=>Math.min(g,y.to),f&&f.from>h?f.from:1e8)):(h=f.from,p=f.to,l.push(f),d++);d<a.length;){let g=a[d];if(g.from==h&&(g.to>g.from||g.to==h))l.push(g),d++,p=Math.min(g.to,p);else{p=Math.min(g.from,p);break}}let m=sZt(l);if(l.some(g=>g.from==g.to||g.from==g.to-1&&n.doc.lineAt(g.from).to==g.from))i.add(h,h,er.widget({widget:new eZt(m),diagnostics:l.slice()}));else{let g=l.reduce((y,x)=>x.markClass?y+" "+x.markClass:y,"");i.add(h,p,er.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:l.slice(),inclusiveEnd:l.some(y=>y.to>p)}))}c=p;for(let g=0;g<l.length;g++)l[g].to<=c&&l.splice(g--,1)}let u=i.finish();return new yw(u,r,D_(u))}}function D_(e,t=null,r=0){let n=null;return e.between(r,1e9,(s,a,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!n)n=new Hke(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Hke(n.from,a,n.diagnostic)}}),n}function QGt(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(PA).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(iYe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function WGt(e,t){return e.field(Hd,!1)?t:t.concat(rn.appendConfig.of(aZt))}const iYe=rn.define(),Jue=rn.define(),oYe=rn.define(),Hd=Oo.define({create(){return new yw(er.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let r=e.diagnostics.map(t.changes),n=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);n=D_(r,e.selected.diagnostic,a)||D_(r,null,a)}!r.size&&s&&t.state.facet(PA).autoPanel&&(s=null),e=new yw(r,s,n)}for(let r of t.effects)if(r.is(iYe)){let n=t.state.facet(PA).autoPanel?r.value.length?MA.open:null:e.panel;e=yw.init(r.value,n,t.state)}else r.is(Jue)?e=new yw(e.diagnostics,r.value?MA.open:null,e.selected):r.is(oYe)&&(e=new yw(e.diagnostics,e.panel,r.value));return e},provide:e=>[SA.from(e,t=>t.panel),ft.decorations.from(e,t=>t.diagnostics)]}),GGt=er.mark({class:"cm-lintRange cm-lintRange-active"});function ZGt(e,t,r){let{diagnostics:n}=e.state.field(Hd),s,a=-1,i=-1;n.between(t-(r<0?1:0),t+(r>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||r>0)&&(t<u||r<0)))return s=d.diagnostics,a=c,i=u,!1});let l=e.state.facet(PA).tooltipFilter;return s&&l&&(s=l(s,e.state)),s?{pos:a,end:i,above:e.state.doc.lineAt(a).to<i,create(){return{dom:YGt(e,s)}}}:null}function YGt(e,t){return Ea("ul",{class:"cm-tooltip-lint"},t.map(r=>cYe(e,r,!1)))}const XGt=e=>{let t=e.state.field(Hd,!1);(!t||!t.panel)&&e.dispatch({effects:WGt(e.state,[Jue.of(!0)])});let r=fue(e,MA.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},Qke=e=>{let t=e.state.field(Hd,!1);return!t||!t.panel?!1:(e.dispatch({effects:Jue.of(!1)}),!0)},KGt=e=>{let t=e.state.field(Hd,!1);if(!t)return!1;let r=e.state.selection.main,n=t.diagnostics.iter(r.to+1);return!n.value&&(n=t.diagnostics.iter(0),!n.value||n.from==r.from&&n.to==r.to)?!1:(e.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},JGt=[{key:"Mod-Shift-m",run:XGt,preventDefault:!0},{key:"F8",run:KGt}],PA=Kt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...bg(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Wke,tooltipFilter:Wke,needsRefresh:(t,r)=>t?r?n=>t(n)||r(n):t:r,hideOn:(t,r)=>t?r?(n,s,a)=>t(n,s,a)||r(n,s,a):t:r,autoPanel:(t,r)=>t||r})}}});function Wke(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function lYe(e){let t=[];if(e)e:for(let{name:r}of e){for(let n=0;n<r.length;n++){let s=r[n];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function cYe(e,t,r){var n;let s=r?lYe(t.actions):[];return Ea("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ea("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(n=t.actions)===null||n===void 0?void 0:n.map((a,i)=>{let l=!1,c=p=>{if(p.preventDefault(),l)return;l=!0;let m=D_(e.state.field(Hd).diagnostics,t);m&&a.apply(e,m.from,m.to)},{name:u}=a,d=s[i]?u.indexOf(s[i]):-1,f=d<0?u:[u.slice(0,d),Ea("u",u.slice(d,d+1)),u.slice(d+1)],h=a.markClass?" "+a.markClass:"";return Ea("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&Ea("div",{class:"cm-diagnosticSource"},t.source))}class eZt extends Of{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ea("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Gke{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=cYe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class MA{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)Qke(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],i=lYe(a.actions);for(let l=0;l<i.length;l++)if(i[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=D_(this.view.state.field(Hd).diagnostics,a);c&&a.actions[l].apply(t,c.from,c.to)}}else return;s.preventDefault()},n=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=Ea("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=Ea("div",{class:"cm-panel-lint"},this.list,Ea("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Qke(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Hd).selected;if(!t)return-1;for(let r=0;r<this.items.length;r++)if(this.items[r].diagnostic==t.diagnostic)return r;return-1}update(){let{diagnostics:t,selected:r}=this.view.state.field(Hd),n=0,s=!1,a=null,i=new Set;for(t.between(0,this.view.state.doc.length,(l,c,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let f=-1,h;for(let p=n;p<this.items.length;p++)if(this.items[p].diagnostic==d){f=p;break}f<0?(h=new Gke(this.view,d),this.items.splice(n,0,h),s=!0):(h=this.items[f],f>n&&(this.items.splice(n,f-n),s=!0)),r&&h.diagnostic==r.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),a=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new Gke(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/u:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function r(){let n=t;t=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;t!=n.dom;)r();t=n.dom.nextSibling}else this.list.insertBefore(n.dom,t);for(;t;)r()}moveSelection(t){if(this.selectedIndex<0)return;let r=this.view.state.field(Hd),n=D_(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:oYe.of(n)})}static open(t){return new MA(t)}}function tZt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function oD(e){return tZt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const rZt=ft.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:oD("#d11")},".cm-lintRange-warning":{backgroundImage:oD("orange")},".cm-lintRange-info":{backgroundImage:oD("#999")},".cm-lintRange-hint":{backgroundImage:oD("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function nZt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function sZt(e){let t="hint",r=1;for(let n of e){let s=nZt(n.severity);s>r&&(r=s,t=n.severity)}return t}const aZt=[Hd,ft.decorations.compute([Hd],e=>{let{selected:t,panel:r}=e.field(Hd);return!t||!r||t.from==t.to?er.none:er.set([GGt.range(t.from,t.to)])}),rUt(ZGt,{hideOn:QGt}),rZt];var Zke=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(JVt)),t.defaultKeymap!==!1&&(n=n.concat(mGt)),t.searchKeymap!==!1&&(n=n.concat(UGt)),t.historyKeymap!==!1&&(n=n.concat(SWt)),t.foldKeymap!==!1&&(n=n.concat($Ut)),t.completionKeymap!==!1&&(n=n.concat(YWe)),t.lintKeymap!==!1&&(n=n.concat(JGt));var s=[];return t.lineNumbers!==!1&&s.push(pUt()),t.highlightActiveLineGutter!==!1&&s.push(yUt()),t.highlightSpecialChars!==!1&&s.push(A7t()),t.history!==!1&&s.push(hWt()),t.foldGutter!==!1&&s.push(UUt()),t.drawSelection!==!1&&s.push(w7t()),t.dropCursor!==!1&&s.push(E7t()),t.allowMultipleSelections!==!1&&s.push(zn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(NUt()),t.syntaxHighlighting!==!1&&s.push(Yx(QUt,{fallback:!0})),t.bracketMatching!==!1&&s.push(JUt()),t.closeBrackets!==!1&&s.push(ZVt()),t.autocompletion!==!1&&s.push(ZWe()),t.rectangularSelection!==!1&&s.push(H7t()),r!==!1&&s.push(G7t()),t.highlightActiveLine!==!1&&s.push(L7t()),t.highlightSelectionMatches!==!1&&s.push(wGt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(HE.of(" ".repeat(t.tabSize))),s.concat([qE.of(n.flat())]).filter(Boolean)};const iZt="#e5c07b",Yke="#e06c75",oZt="#56b6c2",lZt="#ffffff",d$="#abb2bf",cse="#7d8799",cZt="#61afef",uZt="#98c379",Xke="#d19a66",dZt="#c678dd",fZt="#21252b",Kke="#2c313a",Jke="#282c34",kV="#353a42",hZt="#3E4451",e_e="#528bff",pZt=ft.theme({"&":{color:d$,backgroundColor:Jke},".cm-content":{caretColor:e_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:e_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:hZt},".cm-panels":{backgroundColor:fZt,color:d$},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Jke,color:cse,border:"none"},".cm-activeLineGutter":{backgroundColor:Kke},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:kV},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:kV,borderBottomColor:kV},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Kke,color:d$}}},{dark:!0}),mZt=$p.define([{tag:ne.keyword,color:dZt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:Yke},{tag:[ne.function(ne.variableName),ne.labelName],color:cZt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:Xke},{tag:[ne.definition(ne.name),ne.separator],color:d$},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:iZt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:oZt},{tag:[ne.meta,ne.comment],color:cse},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:cse,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:Yke},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:Xke},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:uZt},{tag:ne.invalid,color:lZt}]),gZt=[pZt,Yx(mZt)];var yZt=ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),vZt=function(t){t===void 0&&(t={});var{indentWithTab:r=!0,editable:n=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:l=!0}=t,c=[];switch(r&&c.unshift(qE.of([gGt])),l&&(typeof l=="boolean"?c.unshift(Zke()):c.unshift(Zke(l))),i&&c.unshift(B7t(i)),a){case"light":c.push(yZt);break;case"dark":c.push(gZt);break;case"none":break;default:c.push(a);break}return n===!1&&c.push(ft.editable.of(!1)),s&&c.push(zn.readOnly.of(!0)),[...c]},bZt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class xZt{constructor(t,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(r=>{try{r()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}let t_e=class{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}};var _V=null,wZt=()=>typeof window>"u"?new t_e:(_V||(_V=new t_e),_V),r_e=vg.define(),SZt=200,OZt=[];function kZt(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:l=OZt,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:h=null,width:p=null,minWidth:m=null,maxWidth:g=null,placeholder:y="",editable:x=!0,readOnly:w=!1,indentWithTab:S=!0,basicSetup:k=!0,root:_,initialState:E}=e,[T,j]=b.useState(),[N,I]=b.useState(),[P,R]=b.useState(),B=b.useState(()=>({current:null}))[0],M=b.useState(()=>({current:null}))[0],F=ft.theme({"&":{height:d,minHeight:f,maxHeight:h,width:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),U=ft.updateListener.of(Q=>{if(Q.docChanged&&typeof n=="function"&&!Q.transactions.some(V=>V.annotation(r_e))){B.current?B.current.reset():(B.current=new xZt(()=>{if(M.current){var V=M.current;M.current=null,V()}B.current=null},SZt),wZt().add(B.current));var L=Q.state.doc,Z=L.toString();n(Z,Q)}s&&s(bZt(Q))}),z=vZt({theme:u,editable:x,readOnly:w,placeholder:y,indentWithTab:S,basicSetup:k}),H=[U,F,...z];return i&&typeof i=="function"&&H.push(ft.updateListener.of(i)),H=H.concat(l),b.useLayoutEffect(()=>{if(T&&!P){var Q={doc:t,selection:r,extensions:H},L=E?zn.fromJSON(E.json,Q,E.fields):zn.create(Q);if(R(L),!N){var Z=new ft({state:L,parent:T,root:_});I(Z),a&&a(Z,L)}}return()=>{N&&(R(void 0),I(void 0))}},[T,P]),b.useEffect(()=>{e.container&&j(e.container)},[e.container]),b.useEffect(()=>()=>{N&&(N.destroy(),I(void 0)),B.current&&(B.current.cancel(),B.current=null)},[N]),b.useEffect(()=>{c&&N&&N.focus()},[c,N]),b.useEffect(()=>{N&&N.dispatch({effects:rn.reconfigure.of(H)})},[u,l,d,f,h,p,m,g,y,x,w,S,k,n,i]),b.useEffect(()=>{if(t!==void 0){var Q=N?N.state.doc.toString():"";if(N&&t!==Q){var L=B.current&&!B.current.isDone,Z=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[r_e.of(!0)]})};L?M.current=Z:Z()}}},[t,N]),{state:P,setState:R,view:N,setView:I,container:T,setContainer:j}}var _Zt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],xc=b.forwardRef((e,t)=>{var{className:r,value:n="",selection:s,extensions:a=[],onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:h,minHeight:p,maxHeight:m,width:g,minWidth:y,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,root:T,initialState:j}=e,N=Hue(e,_Zt),I=b.useRef(null),{state:P,view:R,container:B,setContainer:M}=kZt({root:T,value:n,autoFocus:d,theme:f,height:h,minHeight:p,maxHeight:m,width:g,minWidth:y,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,selection:s,onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:a,initialState:j});b.useImperativeHandle(t,()=>({editor:I.current,state:P,view:R}),[I,B,P,R]);var F=b.useCallback(z=>{I.current=z,M(z)},[M]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var U=typeof f=="string"?"cm-theme-"+f:"cm-theme";return o.jsx("div",Ox({ref:F,className:""+U+(r?" "+r:"")},N))});xc.displayName="CodeMirror";function EZt(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const CZt=e=>{switch(e){case"success":return NZt;case"info":return IZt;case"warning":return AZt;case"error":return RZt;default:return null}},jZt=Array(12).fill(0),TZt=({visible:e,className:t})=>je.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},je.createElement("div",{className:"sonner-spinner"},jZt.map((r,n)=>je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),NZt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),AZt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),IZt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),RZt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),PZt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),MZt=()=>{const[e,t]=je.useState(document.hidden);return je.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let use=1;class DZt{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:use++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=s.then(async u=>{if(i=["resolve",u],je.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if($Zt(u)&&!u.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,h=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...m})}else if(u instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...m})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(u):r.success,h=typeof r.description=="function"?await r.description(u):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:h,...m})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,f=typeof r.description=="function"?await r.description(u):r.description,p=typeof d=="object"&&!je.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:f,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,d)=>l.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=r?.id||use++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ju=new DZt,LZt=(e,t)=>{const r=t?.id||use++;return ju.addToast({title:e,...t,id:r}),r},$Zt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",FZt=LZt,zZt=()=>ju.toasts,BZt=()=>ju.getActiveToasts(),vc=Object.assign(FZt,{success:ju.success,info:ju.info,warning:ju.warning,error:ju.error,custom:ju.custom,message:ju.message,promise:ju.promise,dismiss:ju.dismiss,loading:ju.loading},{getHistory:zZt,getToasts:BZt});EZt("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function lD(e){return e.label!==void 0}const UZt=3,VZt="24px",qZt="16px",n_e=4e3,HZt=356,QZt=14,WZt=45,GZt=200;function sm(...e){return e.filter(Boolean).join(" ")}function ZZt(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const YZt=e=>{var t,r,n,s,a,i,l,c,u;const{invert:d,toast:f,unstyled:h,interacting:p,setHeights:m,visibleToasts:g,heights:y,index:x,toasts:w,expanded:S,removeToast:k,defaultRichColors:_,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:N,className:I="",descriptionClassName:P="",duration:R,position:B,gap:M,expandByDefault:F,classNames:U,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[Q,L]=je.useState(null),[Z,V]=je.useState(null),[D,W]=je.useState(!1),[G,J]=je.useState(!1),[ae,te]=je.useState(!1),[re,ie]=je.useState(!1),[fe,X]=je.useState(!1),[se,le]=je.useState(0),[xe,ue]=je.useState(0),ce=je.useRef(f.duration||R||n_e),ve=je.useRef(null),we=je.useRef(null),Ne=x===0,K=x+1<=g,oe=f.type,be=f.dismissible!==!1,Ae=f.className||"",$e=f.descriptionClassName||"",ye=je.useMemo(()=>y.findIndex(tt=>tt.toastId===f.id)||0,[y,f.id]),ke=je.useMemo(()=>{var tt;return(tt=f.closeButton)!=null?tt:E},[f.closeButton,E]),ge=je.useMemo(()=>f.duration||R||n_e,[f.duration,R]),Ee=je.useRef(0),Fe=je.useRef(0),ct=je.useRef(0),wt=je.useRef(null),[lr,Ve]=B.split("-"),qe=je.useMemo(()=>y.reduce((tt,Jt,Tr)=>Tr>=ye?tt:tt+Jt.height,0),[y,ye]),Ie=MZt(),Le=f.invert||d,Re=oe==="loading";Fe.current=je.useMemo(()=>ye*M+qe,[ye,qe]),je.useEffect(()=>{ce.current=ge},[ge]),je.useEffect(()=>{W(!0)},[]),je.useEffect(()=>{const tt=we.current;if(tt){const Jt=tt.getBoundingClientRect().height;return ue(Jt),m(Tr=>[{toastId:f.id,height:Jt,position:f.position},...Tr]),()=>m(Tr=>Tr.filter(ir=>ir.toastId!==f.id))}},[m,f.id]),je.useLayoutEffect(()=>{if(!D)return;const tt=we.current,Jt=tt.style.height;tt.style.height="auto";const Tr=tt.getBoundingClientRect().height;tt.style.height=Jt,ue(Tr),m(ir=>ir.find(Ur=>Ur.toastId===f.id)?ir.map(Ur=>Ur.toastId===f.id?{...Ur,height:Tr}:Ur):[{toastId:f.id,height:Tr,position:f.position},...ir])},[D,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const it=je.useCallback(()=>{J(!0),le(Fe.current),m(tt=>tt.filter(Jt=>Jt.toastId!==f.id)),setTimeout(()=>{k(f)},GZt)},[f,k,m,Fe]);je.useEffect(()=>{if(f.promise&&oe==="loading"||f.duration===1/0||f.type==="loading")return;let tt;return S||p||Ie?(()=>{if(ct.current<Ee.current){const ir=new Date().getTime()-Ee.current;ce.current=ce.current-ir}ct.current=new Date().getTime()})():ce.current!==1/0&&(Ee.current=new Date().getTime(),tt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),it()},ce.current)),()=>clearTimeout(tt)},[S,p,f,oe,Ie,it]),je.useEffect(()=>{f.delete&&(it(),f.onDismiss==null||f.onDismiss.call(f,f))},[it,f.delete]);function rt(){var tt;if(z?.loading){var Jt;return je.createElement("div",{className:sm(U?.loader,f==null||(Jt=f.classNames)==null?void 0:Jt.loader,"sonner-loader"),"data-visible":oe==="loading"},z.loading)}return je.createElement(TZt,{className:sm(U?.loader,f==null||(tt=f.classNames)==null?void 0:tt.loader),visible:oe==="loading"})}const ht=f.icon||z?.[oe]||CZt(oe);var Ut,$r;return je.createElement("li",{tabIndex:0,ref:we,className:sm(I,Ae,U?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,U?.default,U?.[oe],f==null||(r=f.classNames)==null?void 0:r[oe]),"data-sonner-toast":"","data-rich-colors":(Ut=f.richColors)!=null?Ut:_,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":D,"data-promise":!!f.promise,"data-swiped":fe,"data-removed":G,"data-visible":K,"data-y-position":lr,"data-x-position":Ve,"data-index":x,"data-front":Ne,"data-swiping":ae,"data-dismissible":be,"data-type":oe,"data-invert":Le,"data-swipe-out":re,"data-swipe-direction":Z,"data-expanded":!!(S||F&&D),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${G?se:Fe.current}px`,"--initial-height":F?"auto":`${xe}px`,...T,...f.style},onDragEnd:()=>{te(!1),L(null),wt.current=null},onPointerDown:tt=>{tt.button!==2&&(Re||!be||(ve.current=new Date,le(Fe.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(te(!0),wt.current={x:tt.clientX,y:tt.clientY})))},onPointerUp:()=>{var tt,Jt,Tr;if(re||!be)return;wt.current=null;const ir=Number(((tt=we.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((Jt=we.current)==null?void 0:Jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ur=new Date().getTime()-((Tr=ve.current)==null?void 0:Tr.getTime()),It=Q==="x"?ir:$n,xn=Math.abs(It)/Ur;if(Math.abs(It)>=WZt||xn>.11){le(Fe.current),f.onDismiss==null||f.onDismiss.call(f,f),V(Q==="x"?ir>0?"right":"left":$n>0?"down":"up"),it(),ie(!0);return}else{var Er,Oe;(Er=we.current)==null||Er.style.setProperty("--swipe-amount-x","0px"),(Oe=we.current)==null||Oe.style.setProperty("--swipe-amount-y","0px")}X(!1),te(!1),L(null)},onPointerMove:tt=>{var Jt,Tr,ir;if(!wt.current||!be||((Jt=window.getSelection())==null?void 0:Jt.toString().length)>0)return;const Ur=tt.clientY-wt.current.y,It=tt.clientX-wt.current.x;var xn;const Er=(xn=e.swipeDirections)!=null?xn:ZZt(B);!Q&&(Math.abs(It)>1||Math.abs(Ur)>1)&&L(Math.abs(It)>Math.abs(Ur)?"x":"y");let Oe={x:0,y:0};const Me=Ue=>1/(1.5+Math.abs(Ue)/20);if(Q==="y"){if(Er.includes("top")||Er.includes("bottom"))if(Er.includes("top")&&Ur<0||Er.includes("bottom")&&Ur>0)Oe.y=Ur;else{const Ue=Ur*Me(Ur);Oe.y=Math.abs(Ue)<Math.abs(Ur)?Ue:Ur}}else if(Q==="x"&&(Er.includes("left")||Er.includes("right")))if(Er.includes("left")&&It<0||Er.includes("right")&&It>0)Oe.x=It;else{const Ue=It*Me(It);Oe.x=Math.abs(Ue)<Math.abs(It)?Ue:It}(Math.abs(Oe.x)>0||Math.abs(Oe.y)>0)&&X(!0),(Tr=we.current)==null||Tr.style.setProperty("--swipe-amount-x",`${Oe.x}px`),(ir=we.current)==null||ir.style.setProperty("--swipe-amount-y",`${Oe.y}px`)}},ke&&!f.jsx&&oe!=="loading"?je.createElement("button",{"aria-label":H,"data-disabled":Re,"data-close-button":!0,onClick:Re||!be?()=>{}:()=>{it(),f.onDismiss==null||f.onDismiss.call(f,f)},className:sm(U?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},($r=z?.close)!=null?$r:PZt):null,(oe||f.icon||f.promise)&&f.icon!==null&&(z?.[oe]!==null||f.icon)?je.createElement("div",{"data-icon":"",className:sm(U?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||rt():null,f.type!=="loading"?ht:null):null,je.createElement("div",{"data-content":"",className:sm(U?.content,f==null||(a=f.classNames)==null?void 0:a.content)},je.createElement("div",{"data-title":"",className:sm(U?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?je.createElement("div",{"data-description":"",className:sm(P,$e,U?.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),je.isValidElement(f.cancel)?f.cancel:f.cancel&&lD(f.cancel)?je.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:tt=>{lD(f.cancel)&&be&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,tt),it())},className:sm(U?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,je.isValidElement(f.action)?f.action:f.action&&lD(f.action)?je.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:tt=>{lD(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,tt),!tt.defaultPrevented&&it())},className:sm(U?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function s_e(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function XZt(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?qZt:VZt;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=l:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}const uYe=je.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:m,style:g,visibleToasts:y=UZt,toastOptions:x,dir:w=s_e(),gap:S=QZt,icons:k,containerAriaLabel:_="Notifications"}=t,[E,T]=je.useState([]),j=je.useMemo(()=>n?E.filter(D=>D.toasterId===n):E.filter(D=>!D.toasterId),[E,n]),N=je.useMemo(()=>Array.from(new Set([a].concat(j.filter(D=>D.position).map(D=>D.position)))),[j,a]),[I,P]=je.useState([]),[R,B]=je.useState(!1),[M,F]=je.useState(!1),[U,z]=je.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=je.useRef(null),Q=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=je.useRef(null),Z=je.useRef(!1),V=je.useCallback(D=>{T(W=>{var G;return(G=W.find(J=>J.id===D.id))!=null&&G.delete||ju.dismiss(D.id),W.filter(({id:J})=>J!==D.id)})},[]);return je.useEffect(()=>ju.subscribe(D=>{if(D.dismiss){requestAnimationFrame(()=>{T(W=>W.map(G=>G.id===D.id?{...G,delete:!0}:G))});return}setTimeout(()=>{fce.flushSync(()=>{T(W=>{const G=W.findIndex(J=>J.id===D.id);return G!==-1?[...W.slice(0,G),{...W[G],...D},...W.slice(G+1)]:[D,...W]})})})}),[E]),je.useEffect(()=>{if(h!=="system"){z(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:W})=>{z(W?"dark":"light")})}catch{D.addListener(({matches:G})=>{try{z(G?"dark":"light")}catch(J){console.error(J)}})}},[h]),je.useEffect(()=>{E.length<=1&&B(!1)},[E]),je.useEffect(()=>{const D=W=>{var G;if(i.every(te=>W[te]||W.code===te)){var ae;B(!0),(ae=H.current)==null||ae.focus()}W.code==="Escape"&&(document.activeElement===H.current||(G=H.current)!=null&&G.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[i]),je.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Z.current=!1)}},[H.current]),je.createElement("section",{ref:r,"aria-label":`${_} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((D,W)=>{var G;const[J,ae]=D.split("-");return j.length?je.createElement("ol",{key:D,dir:w==="auto"?s_e():w,tabIndex:-1,ref:H,className:u,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":J,"data-x-position":ae,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${HZt}px`,"--gap":`${S}px`,...g,...XZt(d,f)},onBlur:te=>{Z.current&&!te.currentTarget.contains(te.relatedTarget)&&(Z.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,L.current=te.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{M||B(!1)},onDragEnd:()=>B(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},j.filter(te=>!te.position&&W===0||te.position===D).map((te,re)=>{var ie,fe;return je.createElement(YZt,{key:te.id,icons:k,index:re,toast:te,defaultRichColors:p,duration:(ie=x?.duration)!=null?ie:m,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(fe=x?.closeButton)!=null?fe:c,interacting:M,position:D,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:V,toasts:j.filter(X=>X.position==te.position),heights:I.filter(X=>X.position==te.position),setHeights:P,expandByDefault:l,gap:S,expanded:R,swipeDirections:t.swipeDirections})})):null}))});var EV="focusScope.autoFocusOnMount",CV="focusScope.autoFocusOnUnmount",a_e={bubbles:!1,cancelable:!0},KZt="FocusScope",QR=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[l,c]=b.useState(null),u=bi(s),d=bi(a),f=b.useRef(null),h=Br(t,g=>c(g)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let g=function(S){if(p.paused||!l)return;const k=S.target;l.contains(k)?f.current=k:mb(f.current,{select:!0})},y=function(S){if(p.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||mb(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&mb(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(x);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[n,l,p.paused]),b.useEffect(()=>{if(l){o_e.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(EV,a_e);l.addEventListener(EV,u),l.dispatchEvent(x),x.defaultPrevented||(JZt(sYt(dYe(l)),{select:!0}),document.activeElement===g&&mb(l))}return()=>{l.removeEventListener(EV,u),setTimeout(()=>{const x=new CustomEvent(CV,a_e);l.addEventListener(CV,d),l.dispatchEvent(x),x.defaultPrevented||mb(g??document.body,{select:!0}),l.removeEventListener(CV,d),o_e.remove(p)},0)}}},[l,u,d,p]);const m=b.useCallback(g=>{if(!r&&!n||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const w=g.currentTarget,[S,k]=eYt(w);S&&k?!g.shiftKey&&x===k?(g.preventDefault(),r&&mb(S,{select:!0})):g.shiftKey&&x===S&&(g.preventDefault(),r&&mb(k,{select:!0})):x===w&&g.preventDefault()}},[r,n,p.paused]);return o.jsx(wr.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});QR.displayName=KZt;function JZt(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(mb(n,{select:t}),document.activeElement!==r)return}function eYt(e){const t=dYe(e),r=i_e(t,e),n=i_e(t.reverse(),e);return[r,n]}function dYe(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function i_e(e,t){for(const r of e)if(!tYt(r,{upTo:t}))return r}function tYt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function rYt(e){return e instanceof HTMLInputElement&&"select"in e}function mb(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&rYt(e)&&t&&e.select()}}var o_e=nYt();function nYt(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=l_e(e,t),e.unshift(t)},remove(t){e=l_e(e,t),e[0]?.resume()}}}function l_e(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function sYt(e){return e.filter(t=>t.tagName!=="A")}var jV=0;function QF(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??c_e()),document.body.insertAdjacentElement("beforeend",e[1]??c_e()),jV++,()=>{jV===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jV--}},[])}function c_e(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var km=function(){return km=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},km.apply(this,arguments)};function fYe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function aYt(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,a;n<s;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var f$="right-scroll-bar-position",h$="width-before-scroll-bar",iYt="with-scroll-bars-hidden",oYt="--removed-body-scroll-bar-size";function TV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lYt(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var cYt=typeof window<"u"?b.useLayoutEffect:b.useEffect,u_e=new WeakMap;function uYt(e,t){var r=lYt(null,function(n){return e.forEach(function(s){return TV(s,n)})});return cYt(function(){var n=u_e.get(r);if(n){var s=new Set(n),a=new Set(e),i=r.current;s.forEach(function(l){a.has(l)||TV(l,null)}),a.forEach(function(l){s.has(l)||TV(l,i)})}u_e.set(r,e)},[e]),r}function dYt(e){return e}function fYt(e,t){t===void 0&&(t=dYt);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var c=function(){var d=i;i=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),r}}}};return s}function hYt(e){e===void 0&&(e={});var t=fYt(null);return t.options=km({async:!0,ssr:!1},e),t}var hYe=function(e){var t=e.sideCar,r=fYe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,km({},r))};hYe.isSideCarExport=!0;function pYt(e,t){return e.useMedium(t),hYe}var pYe=hYt(),NV=function(){},WF=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:NV,onWheelCapture:NV,onTouchMoveCapture:NV}),s=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,k=fYe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,E=uYt([r,t]),T=km(km({},k),s);return b.createElement(b.Fragment,null,d&&b.createElement(_,{sideCar:pYe,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:S}),i?b.cloneElement(b.Children.only(l),km(km({},T),{ref:E})):b.createElement(w,km({},T,{className:c,ref:E}),l))});WF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};WF.classNames={fullWidth:h$,zeroRight:f$};var mYt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gYt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mYt();return t&&e.setAttribute("nonce",t),e}function yYt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vYt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bYt=function(){var e=0,t=null;return{add:function(r){e==0&&(t=gYt())&&(yYt(t,r),vYt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xYt=function(){var e=bYt();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},mYe=function(){var e=xYt(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},wYt={left:0,top:0,right:0,gap:0},AV=function(e){return parseInt(e||"",10)||0},SYt=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[AV(r),AV(n),AV(s)]},OYt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wYt;var t=SYt(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},kYt=mYe(),Wk="data-scroll-locked",_Yt=function(e,t,r,n){var s=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
114
114
  .`.concat(iYt,` {
115
115
  overflow: hidden `).concat(n,`;
@@ -287,7 +287,7 @@ ${J.current.stack}
287
287
  A`,",",",0,",",",",",",",`
288
288
  A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(d<0),E.x,E.y,n,n,+(N>180),+(d>0),S.x,S.y,a,a,+(d<0),k.x,k.y)}else w+=Qi(eNe||(eNe=Ew(["L",",","Z"])),t,r);return w},X1r={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},vit=e=>{var t=id(e,X1r),{cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a<s||u===d)return null;var h=ba("recharts-sector",f),p=a-s,m=Ex(i,p,0,!0),g;return m>0&&Math.abs(u-d)<360?g=Y1r({cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=yit({cx:r,cy:n,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d}),b.createElement("path",Iae({},iu(t),{className:h,d:g}))};function K1r(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(rat(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:a,outerRadius:i,angle:l}=t,c=Hl(n,s,a,l),u=Hl(n,s,i,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return git(t)}}var RH={},PH={},MH={},tNe;function J1r(){return tNe||(tNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fat();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(MH)),MH}var rNe;function eOr(){return rNe||(rNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=J1r();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(PH)),PH}var nNe;function tOr(){return nNe||(nNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hat(),r=eOr();function n(s,a,i){i&&typeof i!="number"&&t.isIterateeCall(s,a,i)&&(a=i=void 0),s=r.toFinite(s),a===void 0?(a=s,s=0):a=r.toFinite(a),i=i===void 0?s<a?1:-1:r.toFinite(i);const l=Math.max(Math.ceil((a-s)/(i||1)),0),c=new Array(l);for(let u=0;u<l;u++)c[u]=s,s+=i;return c}e.range=n})(RH)),RH}var DH,sNe;function rOr(){return sNe||(sNe=1,DH=tOr().range),DH}var nOr=rOr();const bit=Uo(nOr);var s0=e=>e.chartData,sOr=Xe([s0],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Ehe=(e,t,r,n)=>n?sOr(e):s0(e);function Gm(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(zs(t)&&zs(r))return!0}return!1}function aNe(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function xit(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,a;if(zs(r))s=r;else if(typeof r=="function")return;if(zs(n))a=n;else if(typeof n=="function")return;var i=[s,a];if(Gm(i))return i}}function aOr(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Gm(n))return aNe(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,a]=e,i,l;if(s==="auto")t!=null&&(i=Math.min(...t));else if(qr(s))i=s;else if(typeof s=="function")try{t!=null&&(i=s(t?.[0]))}catch{}else if(typeof s=="string"&&eTe.test(s)){var c=eTe.exec(s);if(c==null||c[1]==null||t==null)i=void 0;else{var u=+c[1];i=t[0]-u}}else i=t?.[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(qr(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t?.[1]))}catch{}else if(typeof a=="string"&&tTe.test(a)){var d=tTe.exec(a);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[1]+f}}else l=t?.[1];var h=[i,l];if(Gm(h))return t==null?h:aNe(h,t,r)}}}var aC=1e9,iOr={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},jhe,wi=!0,Ch="[DecimalError] ",qw=Ch+"Invalid argument: ",Che=Ch+"Exponent out of range: ",iC=Math.floor,lw=Math.pow,oOr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Bd,hl=1e7,ci=7,wit=9007199254740991,a4=iC(wit/ci),fr={};fr.absoluteValue=fr.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};fr.comparedTo=fr.cmp=function(e){var t,r,n,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===s?0:n>s^a.s<0?1:-1};fr.decimalPlaces=fr.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ci;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};fr.dividedBy=fr.div=function(e){return Ly(this,new this.constructor(e))};fr.dividedToIntegerBy=fr.idiv=function(e){var t=this,r=t.constructor;return $a(Ly(t,new r(e),0,1),r.precision)};fr.equals=fr.eq=function(e){return!this.cmp(e)};fr.exponent=function(){return Lo(this)};fr.greaterThan=fr.gt=function(e){return this.cmp(e)>0};fr.greaterThanOrEqualTo=fr.gte=function(e){return this.cmp(e)>=0};fr.isInteger=fr.isint=function(){return this.e>this.d.length-2};fr.isNegative=fr.isneg=function(){return this.s<0};fr.isPositive=fr.ispos=function(){return this.s>0};fr.isZero=function(){return this.s===0};fr.lessThan=fr.lt=function(e){return this.cmp(e)<0};fr.lessThanOrEqualTo=fr.lte=function(e){return this.cmp(e)<1};fr.logarithm=fr.log=function(e){var t,r=this,n=r.constructor,s=n.precision,a=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Bd))throw Error(Ch+"NaN");if(r.s<1)throw Error(Ch+(r.s?"NaN":"-Infinity"));return r.eq(Bd)?new n(0):(wi=!1,t=Ly(sI(r,a),sI(e,a),a),wi=!0,$a(t,s))};fr.minus=fr.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kit(t,e):Sit(t,(e.s=-e.s,e))};fr.modulo=fr.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(Ch+"NaN");return r.s?(wi=!1,t=Ly(r,e,0,1).times(e),wi=!0,r.minus(t)):$a(new n(r),s)};fr.naturalExponential=fr.exp=function(){return Oit(this)};fr.naturalLogarithm=fr.ln=function(){return sI(this)};fr.negated=fr.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};fr.plus=fr.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Sit(t,e):kit(t,(e.s=-e.s,e))};fr.precision=fr.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qw+e);if(t=Lo(s)+1,n=s.d.length-1,r=n*ci+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};fr.squareRoot=fr.sqrt=function(){var e,t,r,n,s,a,i,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Ch+"NaN")}for(e=Lo(l),wi=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Lm(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=iC((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=i=r+3;;)if(a=n,n=a.plus(Ly(l,a,i+2)).times(.5),Lm(a.d).slice(0,i)===(t=Lm(n.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if($a(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;i+=4}return wi=!0,$a(n,r)};fr.times=fr.mul=function(e){var t,r,n,s,a,i,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,i=c,c=u,u=i),a=[],i=c+u,n=i;n--;)a.push(0);for(n=u;--n>=0;){for(t=0,s=c+n;s>n;)l=a[s]+p[n]*h[s-n-1]+t,a[s--]=l%hl|0,t=l/hl|0;a[s]=(a[s]+t)%hl|0}for(;!a[--i];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,wi?$a(e,f.precision):e};fr.toDecimalPlaces=fr.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ig(e,0,aC),t===void 0?t=n.rounding:ig(t,0,8),$a(r,e+Lo(r)+1,t))};fr.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=NS(n,!0):(ig(e,0,aC),t===void 0?t=s.rounding:ig(t,0,8),n=$a(new s(n),e+1,t),r=NS(n,!0,e+1)),r};fr.toFixed=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?NS(s):(ig(e,0,aC),t===void 0?t=a.rounding:ig(t,0,8),n=$a(new a(s),e+Lo(s)+1,t),r=NS(n.abs(),!1,e+Lo(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};fr.toInteger=fr.toint=function(){var e=this,t=e.constructor;return $a(new t(e),Lo(e)+1,t.rounding)};fr.toNumber=function(){return+this};fr.toPower=fr.pow=function(e){var t,r,n,s,a,i,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Bd);if(l=new c(l),!l.s){if(e.s<1)throw Error(Ch+"Infinity");return l}if(l.eq(Bd))return l;if(n=c.precision,e.eq(Bd))return $a(l,n);if(t=e.e,r=e.d.length-1,i=t>=r,a=l.s,i){if((r=d<0?-d:d)<=wit){for(s=new c(Bd),t=Math.ceil(n/ci+4),wi=!1;r%2&&(s=s.times(l),oNe(s.d,t)),r=iC(r/2),r!==0;)l=l.times(l),oNe(l.d,t);return wi=!0,e.s<0?new c(Bd).div(s):$a(s,n)}}else if(a<0)throw Error(Ch+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,wi=!1,s=e.times(sI(l,n+u)),wi=!0,s=Oit(s),s.s=a,s};fr.toPrecision=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?(r=Lo(s),n=NS(s,r<=a.toExpNeg||r>=a.toExpPos)):(ig(e,1,aC),t===void 0?t=a.rounding:ig(t,0,8),s=$a(new a(s),e,t),r=Lo(s),n=NS(s,e<=r||r<=a.toExpNeg,e)),n};fr.toSignificantDigits=fr.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ig(e,1,aC),t===void 0?t=n.rounding:ig(t,0,8)),$a(new n(r),e,t)};fr.toString=fr.valueOf=fr.val=fr.toJSON=fr[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lo(e),r=e.constructor;return NS(e,t<=r.toExpNeg||t>=r.toExpPos)};function Sit(e,t){var r,n,s,a,i,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wi?$a(t,f):t;if(c=e.d,u=t.d,i=e.e,s=t.e,c=c.slice(),a=i-s,a){for(a<0?(n=c,a=-a,l=u.length):(n=u,s=i,l=c.length),i=Math.ceil(f/ci),l=i>l?i+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,n=u,u=c,c=n),r=0;a;)r=(c[--a]=c[a]+u[a]+r)/hl|0,c[a]%=hl;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,wi?$a(t,f):t}function ig(e,t,r){if(e!==~~e||e<t||e>r)throw Error(qw+e)}function Lm(e){var t,r,n,s=e.length-1,a="",i=e[0];if(s>0){for(a+=i,t=1;t<s;t++)n=e[t]+"",r=ci-n.length,r&&(a+=Sb(r)),a+=n;i=e[t],n=i+"",r=ci-n.length,r&&(a+=Sb(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var Ly=(function(){function e(n,s){var a,i=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+i,n[l]=a%hl|0,i=a/hl|0;return i&&n.unshift(i),n}function t(n,s,a,i){var l,c;if(a!=i)c=a>i?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,a){for(var i=0;a--;)n[a]-=i,i=n[a]<s[a]?1:0,n[a]=i*hl+n[a]-s[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,a,i){var l,c,u,d,f,h,p,m,g,y,x,w,S,k,_,E,T,j,N=n.constructor,I=n.s==s.s?1:-1,P=n.d,R=s.d;if(!n.s)return new N(n);if(!s.s)throw Error(Ch+"Division by zero");for(c=n.e-s.e,T=R.length,_=P.length,p=new N(I),m=p.d=[],u=0;R[u]==(P[u]||0);)++u;if(R[u]>(P[u]||0)&&--c,a==null?w=a=N.precision:i?w=a+(Lo(n)-Lo(s))+1:w=a,w<0)return new N(0);if(w=w/ci+2|0,u=0,T==1)for(d=0,R=R[0],w++;(u<_||d)&&w--;u++)S=d*hl+(P[u]||0),m[u]=S/R|0,d=S%R|0;else{for(d=hl/(R[0]+1)|0,d>1&&(R=e(R,d),P=e(P,d),T=R.length,_=P.length),k=T,g=P.slice(0,T),y=g.length;y<T;)g[y++]=0;j=R.slice(),j.unshift(0),E=R[0],R[1]>=hl/2&&++E;do d=0,l=t(R,g,T,y),l<0?(x=g[0],T!=y&&(x=x*hl+(g[1]||0)),d=x/E|0,d>1?(d>=hl&&(d=hl-1),f=e(R,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,r(f,T<h?j:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<y&&f.unshift(0),r(g,f,y),l==-1&&(y=g.length,l=t(R,g,T,y),l<1&&(d++,r(g,T<y?j:R,y))),y=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[y++]=P[k]||0:(g=[P[k]],y=1);while((k++<_||g[0]!==void 0)&&w--)}return m[0]||m.shift(),p.e=c,$a(p,i?a+Lo(p)+1:a)}})();function Oit(e,t){var r,n,s,a,i,l,c=0,u=0,d=e.constructor,f=d.precision;if(Lo(e)>16)throw Error(Che+Lo(e));if(!e.s)return new d(Bd);for(wi=!1,l=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(n=Math.log(lw(2,u))/Math.LN10*2+5|0,l+=n,r=s=a=new d(Bd),d.precision=l;;){if(s=$a(s.times(e),l),r=r.times(++c),i=a.plus(Ly(s,r,l)),Lm(i.d).slice(0,l)===Lm(a.d).slice(0,l)){for(;u--;)a=$a(a.times(a),l);return d.precision=f,t==null?(wi=!0,$a(a,f)):a}a=i}}function Lo(e){for(var t=e.e*ci,r=e.d[0];r>=10;r/=10)t++;return t}function LH(e,t,r){if(t>e.LN10.sd())throw wi=!0,r&&(e.precision=r),Error(Ch+"LN10 precision limit exceeded");return $a(new e(e.LN10),t)}function Sb(e){for(var t="";e--;)t+="0";return t}function sI(e,t){var r,n,s,a,i,l,c,u,d,f=1,h=10,p=e,m=p.d,g=p.constructor,y=g.precision;if(p.s<1)throw Error(Ch+(p.s?"NaN":"-Infinity"));if(p.eq(Bd))return new g(0);if(t==null?(wi=!1,u=y):u=t,p.eq(10))return t==null&&(wi=!0),LH(g,u);if(u+=h,g.precision=u,r=Lm(m),n=r.charAt(0),a=Lo(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Lm(p.d),n=r.charAt(0),f++;a=Lo(p),n>1?(p=new g("0."+r),a++):p=new g(n+"."+r.slice(1))}else return c=LH(g,u+2,y).times(a+""),p=sI(new g(n+"."+r.slice(1)),u-h).plus(c),g.precision=y,t==null?(wi=!0,$a(p,y)):p;for(l=i=p=Ly(p.minus(Bd),p.plus(Bd),u),d=$a(p.times(p),u),s=3;;){if(i=$a(i.times(d),u),c=l.plus(Ly(i,new g(s),u)),Lm(c.d).slice(0,u)===Lm(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(LH(g,u+2,y).times(a+""))),l=Ly(l,new g(f),u),g.precision=y,t==null?(wi=!0,$a(l,y)):l;l=c,s+=2}}function iNe(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=iC(r/ci),e.d=[],n=(r+1)%ci,r<0&&(n+=ci),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ci;n<s;)e.d.push(+t.slice(n,n+=ci));t=t.slice(n),n=ci-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),wi&&(e.e>a4||e.e<-a4))throw Error(Che+r)}else e.s=0,e.e=0,e.d=[0];return e}function $a(e,t,r){var n,s,a,i,l,c,u,d,f=e.d;for(i=1,a=f[0];a>=10;a/=10)i++;if(n=t-i,n<0)n+=ci,s=t,u=f[d=0];else{if(d=Math.ceil((n+1)/ci),a=f.length,d>=a)return e;for(u=a=f[d],i=1;a>=10;a/=10)i++;n%=ci,s=n-ci+i}if(r!==void 0&&(a=lw(10,i-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?u/lw(10,i-s):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Lo(e),f.length=1,t=t-a-1,f[0]=lw(10,(ci-t%ci)%ci),e.e=iC(-t/ci)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=lw(10,ci-n),f[d]=s>0?(u/lw(10,i-s)%lw(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==hl&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=hl)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(wi&&(e.e>a4||e.e<-a4))throw Error(Che+Lo(e));return e}function kit(e,t){var r,n,s,a,i,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),wi?$a(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),i=u-n,i){for(d=i<0,d?(r=c,i=-i,l=f.length):(r=f,n=u,l=c.length),s=Math.max(Math.ceil(p/ci),l)+2,i>s&&(i=s,r.length=1),r.reverse(),s=i;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){d=c[s]<f[s];break}i=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>i;){if(c[--s]<f[s]){for(a=s;a&&c[--a]===0;)c[a]=hl-1;--c[a],c[s]+=hl}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,wi?$a(t,p):t):new h(0)}function NS(e,t,r){var n,s=Lo(e),a=Lm(e.d),i=a.length;return t?(r&&(n=r-i)>0?a=a.charAt(0)+"."+a.slice(1)+Sb(n):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Sb(-s-1)+a,r&&(n=r-i)>0&&(a+=Sb(n))):s>=i?(a+=Sb(s+1-i),r&&(n=r-s-1)>0&&(a=a+"."+Sb(n))):((n=s+1)<i&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-i)>0&&(s+1===i&&(a+="."),a+=Sb(n))),e.s<0?"-"+a:a}function oNe(e,t){if(e.length>t)return e.length=t,!0}function _it(e){var t,r,n;function s(a){var i=this;if(!(i instanceof s))return new s(a);if(i.constructor=s,a instanceof s){i.s=a.s,i.e=a.e,i.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(qw+a);if(a>0)i.s=1;else if(a<0)a=-a,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(a===~~a&&a<1e7){i.e=0,i.d=[a];return}return iNe(i,a.toString())}else if(typeof a!="string")throw Error(qw+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,oOr.test(a))iNe(i,a);else throw Error(qw+a)}if(s.prototype=fr,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=_it,s.config=s.set=lOr,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function lOr(e){if(!e||typeof e!="object")throw Error(Ch+"Object expected");var t,r,n,s=["precision",1,aC,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(iC(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(qw+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(qw+r+": "+n);return this}var jhe=_it(iOr);Bd=new jhe(1);const bs=jhe;function Eit(e){var t;return e===0?t=1:t=Math.floor(new bs(e).abs().log(10).toNumber())+1,t}function Cit(e,t,r){for(var n=new bs(e),s=0,a=[];n.lt(t)&&s<1e5;)a.push(n.toNumber()),n=n.add(r),s++;return a}var jit=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},The=(e,t,r)=>{if(e.lte(0))return new bs(0);var n=Eit(e.toNumber()),s=new bs(10).pow(n),a=e.div(s),i=n!==1?.05:.1,l=new bs(Math.ceil(a.div(i).toNumber())).add(r).mul(i),c=l.mul(s);return t?new bs(c.toNumber()):new bs(Math.ceil(c.toNumber()))},Tit=(e,t,r)=>{var n;if(e.lte(0))return new bs(0);var s=[1,2,2.5,5],a=e.toNumber(),i=Math.floor(new bs(a).abs().log(10).toNumber()),l=new bs(10).pow(i),c=e.div(l).toNumber(),u=s.findIndex(p=>p>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=r,u>=s.length){var d=Math.floor(u/s.length);u%=s.length,l=l.mul(new bs(10).pow(d))}var f=(n=s[u])!==null&&n!==void 0?n:1,h=new bs(f).mul(l);return t?h:new bs(Math.ceil(h.toNumber()))},cOr=(e,t,r)=>{var n=new bs(1),s=new bs(e);if(!s.isint()&&r){var a=Math.abs(e);a<1?(n=new bs(10).pow(Eit(e)-1),s=new bs(Math.floor(s.div(n).toNumber())).mul(n)):a>1&&(s=new bs(Math.floor(e)))}else e===0?s=new bs(Math.floor((t-1)/2)):r||(s=new bs(Math.floor(e)));for(var i=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new bs(c-i).mul(n)).toNumber());return l},Nit=function(t,r,n,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:The;if(!Number.isFinite((r-t)/(n-1)))return{step:new bs(0),tickMin:new bs(0),tickMax:new bs(0)};var l=i(new bs(r).sub(t).div(n-1),s,a),c;t<=0&&r>=0?c=new bs(0):(c=new bs(t).add(r).div(2),c=c.sub(new bs(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),d=Math.ceil(new bs(r).sub(c).div(l).toNumber()),f=u+d+1;return f>n?Nit(t,r,n,s,a+1,i):(f<n&&(d=r>0?d+(n-f):d,u=r>0?u:u+(n-f)),{step:l,tickMin:c.sub(new bs(u).mul(l)),tickMax:c.add(new bs(d).mul(l))})},lNe=function(t){var[r,n]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(s,2),[c,u]=jit([r,n]);if(c===-1/0||u===1/0){var d=u===1/0?[c,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),u];return r>n?d.reverse():d}if(c===u)return cOr(c,s,a);var f=i==="snap125"?Tit:The,{step:h,tickMin:p,tickMax:m}=Nit(c,u,l,a,0,f),g=Cit(p,m.add(new bs(.1).mul(h)),h);return r>n?g.reverse():g},cNe=function(t,r){var[n,s]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,c]=jit([n,s]);if(l===-1/0||c===1/0)return[n,s];if(l===c)return[l];var u=i==="snap125"?Tit:The,d=Math.max(r,2),f=u(new bs(c).sub(l).div(d-1),a,0),h=[...Cit(new bs(l),new bs(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),n>s?h.reverse():h},uOr=e=>e.rootProps.barCategoryGap,u9=e=>e.rootProps.stackOffset,Ait=e=>e.rootProps.reverseStackOrder,Nhe=e=>e.options.chartName,Ahe=e=>e.rootProps.syncId,Iit=e=>e.rootProps.syncMethod,Ihe=e=>e.options.eventEmitter,Yc={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},F0={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},im={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},d9=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function f9(e,t,r){if(r!=="auto")return r;if(e!=null)return gv(e,t)?"category":"number"}function uNe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function i4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uNe(Object(r),!0).forEach(function(n){dOr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dOr(e,t,r){return(t=fOr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fOr(e){var t=hOr(e,"string");return typeof t=="symbol"?t:t+""}function hOr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dNe={allowDataOverflow:F0.allowDataOverflow,allowDecimals:F0.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:F0.angleAxisId,includeHidden:!1,name:void 0,reversed:F0.reversed,scale:F0.scale,tick:F0.tick,tickCount:void 0,ticks:void 0,type:F0.type,unit:void 0,niceTicks:"auto"},fNe={allowDataOverflow:im.allowDataOverflow,allowDecimals:im.allowDecimals,allowDuplicatedCategory:im.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:im.radiusAxisId,includeHidden:im.includeHidden,name:void 0,reversed:im.reversed,scale:im.scale,tick:im.tick,tickCount:im.tickCount,ticks:void 0,type:im.type,unit:void 0,niceTicks:"auto"},pOr=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Rhe=Xe([pOr,eit],(e,t)=>{var r;if(e!=null)return e;var n=(r=f9(t,"angleAxis",dNe.type))!==null&&r!==void 0?r:"category";return i4(i4({},dNe),{},{type:n})}),mOr=(e,t)=>e.polarAxis.radiusAxis[t],Phe=Xe([mOr,eit],(e,t)=>{var r;if(e!=null)return e;var n=(r=f9(t,"radiusAxis",fNe.type))!==null&&r!==void 0?r:"category";return i4(i4({},fNe),{},{type:n})}),h9=e=>e.polarOptions,Mhe=Xe([yv,vv,ec],V1r),Rit=Xe([h9,Mhe],(e,t)=>{if(e!=null)return Ex(e.innerRadius,t,0)}),Pit=Xe([h9,Mhe],(e,t)=>{if(e!=null)return Ex(e.outerRadius,t,t*.8)}),gOr=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},Mit=Xe([h9],gOr);Xe([Rhe,Mit],d9);var Dit=Xe([Mhe,Rit,Pit],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Xe([Phe,Dit],d9);var Lit=Xe([Fi,h9,Rit,Pit,yv,vv],(e,t,r,n,s,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:i,cy:l,startAngle:c,endAngle:u}=t;return{cx:Ex(i,s,s/2),cy:Ex(l,a,a/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:u,clockWise:!1}}}),El=(e,t)=>t,p9=(e,t,r)=>r;function $it(e){return e?.id}function Fit(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:s,dataKey:a}=r,i=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:n;if(!(u==null||u.length===0)){var d=$it(l);u.forEach((f,h)=>{var p=a==null||s?h:String(Yl(f,a,null)),m=Yl(f,l.dataKey,0),g;i.has(p)?g=i.get(p):g={},Object.assign(g,{[d]:m}),i.set(p,g)})}}),Array.from(i.values())}function Dhe(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var m9=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function g9(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function yOr(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var Cl=e=>{var t=Fi(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},oC=e=>e.tooltip.settings.axisId;function Lhe(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),s=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(a){function i(){return a.apply(this,arguments)}return i.toString=function(){return a.toString()},i})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(a){var i=s[0],l=s[1];return i<=l?a>=i&&a<=l:a>=l&&a<=i},bandwidth:r?()=>r.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,i)=>{var l=e(a);if(l!=null){if(e.bandwidth&&i!==null&&i!==void 0&&i.position){var c=e.bandwidth();switch(i.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var vOr=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Gm(t)){for(var r,n,s=0;s<t.length;s++){var a=t[s];zs(a)&&((r===void 0||a<r)&&(r=a),(n===void 0||a>n)&&(n=a))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function Xb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bOr(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function $he(e){let t,r,n;e.length!==2?(t=Xb,r=(l,c)=>Xb(e(l),c),n=(l,c)=>e(l)-c):(t=e===Xb||e===bOr?e:xOr,r=e,n=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){const f=s(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:i,right:a}}function xOr(){return 0}function zit(e){return e===null?NaN:+e}function*wOr(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const SOr=$he(Xb),wP=SOr.right;$he(zit).center;class hNe extends Map{constructor(t,r=_Or){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(pNe(this,t))}has(t){return super.has(pNe(this,t))}set(t,r){return super.set(OOr(this,t),r)}delete(t){return super.delete(kOr(this,t))}}function pNe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function OOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function kOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function _Or(e){return e!==null&&typeof e=="object"?e.valueOf():e}function EOr(e=Xb){if(e===Xb)return Bit;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Bit(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const COr=Math.sqrt(50),jOr=Math.sqrt(10),TOr=Math.sqrt(2);function o4(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),a=n/Math.pow(10,s),i=a>=COr?10:a>=jOr?5:a>=TOr?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/i,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*i,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?o4(e,t,r*2):[l,c,u]}function Rae(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,a,i]=n?o4(t,e,r):o4(e,t,r);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(n)if(i<0)for(let u=0;u<l;++u)c[u]=(a-u)/-i;else for(let u=0;u<l;++u)c[u]=(a-u)*i;else if(i<0)for(let u=0;u<l;++u)c[u]=(s+u)/-i;else for(let u=0;u<l;++u)c[u]=(s+u)*i;return c}function Pae(e,t,r){return t=+t,e=+e,r=+r,o4(e,t,r)[2]}function Mae(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?Pae(t,e,r):Pae(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function mNe(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function gNe(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Uit(e,t,r=0,n=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(s=s===void 0?Bit:EOr(s);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),m=Math.min(n,Math.floor(t+(c-u)*f/c+h));Uit(e,t,p,m,s)}const a=e[t];let i=r,l=n;for(rT(e,r,t),s(e[n],a)>0&&rT(e,r,n);i<l;){for(rT(e,i,l),++i,--l;s(e[i],a)<0;)++i;for(;s(e[l],a)>0;)--l}s(e[r],a)===0?rT(e,r,l):(++l,rT(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function rT(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function NOr(e,t,r){if(e=Float64Array.from(wOr(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return gNe(e);if(t>=1)return mNe(e);var n,s=(n-1)*t,a=Math.floor(s),i=mNe(Uit(e,a).subarray(0,a+1)),l=gNe(e.subarray(a+1));return i+(l-i)*(s-a)}}function AOr(e,t,r=zit){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,s=(n-1)*t,a=Math.floor(s),i=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return i+(l-i)*(s-a)}}function IOr(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(s);++n<s;)a[n]=e+n*r;return a}function Fh(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function bv(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Dae=Symbol("implicit");function Fhe(){var e=new hNe,t=[],r=[],n=Dae;function s(a){let i=e.get(a);if(i===void 0){if(n!==Dae)return n;e.set(a,i=t.push(a)-1)}return r[i%r.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new hNe;for(const i of a)e.has(i)||e.set(i,t.push(i)-1);return s},s.range=function(a){return arguments.length?(r=Array.from(a),s):r.slice()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return Fhe(t,r).unknown(n)},Fh.apply(s,arguments),s}function zhe(){var e=Fhe().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,a,i,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=s<n,m=p?s:n,g=p?n:s;a=(g-m)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),m+=(g-m-a*(h-c))*d,i=a*(1-c),l&&(m=Math.round(m),i=Math.round(i));var y=IOr(h).map(function(x){return m+a*x});return r(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,s]=h,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(h){return[n,s]=h,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return i},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return zhe(t(),[n,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Fh.apply(f(),arguments)}function Vit(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Vit(t())},e}function ROr(){return Vit(zhe.apply(null,arguments).paddingInner(1))}function Bhe(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function qit(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function SP(){}var aI=.7,l4=1/aI,e_="\\s*([+-]?\\d+)\\s*",iI="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",POr=/^#([0-9a-f]{3,8})$/,MOr=new RegExp(`^rgb\\(${e_},${e_},${e_}\\)$`),DOr=new RegExp(`^rgb\\(${Zm},${Zm},${Zm}\\)$`),LOr=new RegExp(`^rgba\\(${e_},${e_},${e_},${iI}\\)$`),$Or=new RegExp(`^rgba\\(${Zm},${Zm},${Zm},${iI}\\)$`),FOr=new RegExp(`^hsl\\(${iI},${Zm},${Zm}\\)$`),zOr=new RegExp(`^hsla\\(${iI},${Zm},${Zm},${iI}\\)$`),yNe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bhe(SP,AS,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vNe,formatHex:vNe,formatHex8:BOr,formatHsl:UOr,formatRgb:bNe,toString:bNe});function vNe(){return this.rgb().formatHex()}function BOr(){return this.rgb().formatHex8()}function UOr(){return Hit(this).formatHsl()}function bNe(){return this.rgb().formatRgb()}function AS(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=POr.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?xNe(t):r===3?new Uu(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?BD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?BD(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=MOr.exec(e))?new Uu(t[1],t[2],t[3],1):(t=DOr.exec(e))?new Uu(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LOr.exec(e))?BD(t[1],t[2],t[3],t[4]):(t=$Or.exec(e))?BD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=FOr.exec(e))?ONe(t[1],t[2]/100,t[3]/100,1):(t=zOr.exec(e))?ONe(t[1],t[2]/100,t[3]/100,t[4]):yNe.hasOwnProperty(e)?xNe(yNe[e]):e==="transparent"?new Uu(NaN,NaN,NaN,0):null}function xNe(e){return new Uu(e>>16&255,e>>8&255,e&255,1)}function BD(e,t,r,n){return n<=0&&(e=t=r=NaN),new Uu(e,t,r,n)}function VOr(e){return e instanceof SP||(e=AS(e)),e?(e=e.rgb(),new Uu(e.r,e.g,e.b,e.opacity)):new Uu}function Lae(e,t,r,n){return arguments.length===1?VOr(e):new Uu(e,t,r,n??1)}function Uu(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Bhe(Uu,Lae,qit(SP,{brighter(e){return e=e==null?l4:Math.pow(l4,e),new Uu(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?aI:Math.pow(aI,e),new Uu(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Uu(Hw(this.r),Hw(this.g),Hw(this.b),c4(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wNe,formatHex:wNe,formatHex8:qOr,formatRgb:SNe,toString:SNe}));function wNe(){return`#${Cw(this.r)}${Cw(this.g)}${Cw(this.b)}`}function qOr(){return`#${Cw(this.r)}${Cw(this.g)}${Cw(this.b)}${Cw((isNaN(this.opacity)?1:this.opacity)*255)}`}function SNe(){const e=c4(this.opacity);return`${e===1?"rgb(":"rgba("}${Hw(this.r)}, ${Hw(this.g)}, ${Hw(this.b)}${e===1?")":`, ${e})`}`}function c4(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cw(e){return e=Hw(e),(e<16?"0":"")+e.toString(16)}function ONe(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new dp(e,t,r,n)}function Hit(e){if(e instanceof dp)return new dp(e.h,e.s,e.l,e.opacity);if(e instanceof SP||(e=AS(e)),!e)return new dp;if(e instanceof dp)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),a=Math.max(t,r,n),i=NaN,l=a-s,c=(a+s)/2;return l?(t===a?i=(r-n)/l+(r<n)*6:r===a?i=(n-t)/l+2:i=(t-r)/l+4,l/=c<.5?a+s:2-a-s,i*=60):l=c>0&&c<1?0:i,new dp(i,l,c,e.opacity)}function HOr(e,t,r,n){return arguments.length===1?Hit(e):new dp(e,t,r,n??1)}function dp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Bhe(dp,HOr,qit(SP,{brighter(e){return e=e==null?l4:Math.pow(l4,e),new dp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?aI:Math.pow(aI,e),new dp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new Uu($H(e>=240?e-240:e+120,s,n),$H(e,s,n),$H(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new dp(kNe(this.h),UD(this.s),UD(this.l),c4(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=c4(this.opacity);return`${e===1?"hsl(":"hsla("}${kNe(this.h)}, ${UD(this.s)*100}%, ${UD(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kNe(e){return e=(e||0)%360,e<0?e+360:e}function UD(e){return Math.max(0,Math.min(1,e||0))}function $H(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Uhe=e=>()=>e;function QOr(e,t){return function(r){return e+r*t}}function WOr(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function GOr(e){return(e=+e)==1?Qit:function(t,r){return r-t?WOr(t,r,e):Uhe(isNaN(t)?r:t)}}function Qit(e,t){var r=t-e;return r?QOr(e,r):Uhe(isNaN(e)?t:e)}const u4=(function e(t){var r=GOr(t);function n(s,a){var i=r((s=Lae(s)).r,(a=Lae(a)).r),l=r(s.g,a.g),c=r(s.b,a.b),u=Qit(s.opacity,a.opacity);return function(d){return s.r=i(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return n.gamma=e,n})(1);function ZOr(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(a){for(s=0;s<r;++s)n[s]=e[s]*(1-a)+t[s]*a;return n}}function YOr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function XOr(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),a=new Array(r),i;for(i=0;i<n;++i)s[i]=$y(e[i],t[i]);for(;i<r;++i)a[i]=t[i];return function(l){for(i=0;i<n;++i)a[i]=s[i](l);return a}}function KOr(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function op(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function JOr(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=$y(e[s],t[s]):n[s]=t[s];return function(a){for(s in r)n[s]=r[s](a);return n}}var $ae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,FH=new RegExp($ae.source,"g");function ekr(e){return function(){return e}}function tkr(e){return function(t){return e(t)+""}}function Wit(e,t){var r=$ae.lastIndex=FH.lastIndex=0,n,s,a,i=-1,l=[],c=[];for(e=e+"",t=t+"";(n=$ae.exec(e))&&(s=FH.exec(t));)(a=s.index)>r&&(a=t.slice(r,a),l[i]?l[i]+=a:l[++i]=a),(n=n[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,c.push({i,x:op(n,s)})),r=FH.lastIndex;return r<t.length&&(a=t.slice(r),l[i]?l[i]+=a:l[++i]=a),l.length<2?c[0]?tkr(c[0].x):ekr(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function $y(e,t){var r=typeof t,n;return t==null||r==="boolean"?Uhe(t):(r==="number"?op:r==="string"?(n=AS(t))?(t=n,u4):Wit:t instanceof AS?u4:t instanceof Date?KOr:YOr(t)?ZOr:Array.isArray(t)?XOr:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?JOr:op)(e,t)}function Vhe(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var _Ne=180/Math.PI,Fae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Git(e,t,r,n,s,a){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,c/=l),e*n<t*r&&(e=-e,t=-t,c=-c,i=-i),{translateX:s,translateY:a,rotate:Math.atan2(t,e)*_Ne,skewX:Math.atan(c)*_Ne,scaleX:i,scaleY:l}}var VD;function rkr(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fae:Git(t.a,t.b,t.c,t.d,t.e,t.f)}function nkr(e){return e==null||(VD||(VD=document.createElementNS("http://www.w3.org/2000/svg","g")),VD.setAttribute("transform",e),!(e=VD.transform.baseVal.consolidate()))?Fae:(e=e.matrix,Git(e.a,e.b,e.c,e.d,e.e,e.f))}function Zit(e,t,r,n){function s(u){return u.length?u.pop()+" ":""}function a(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push("translate(",null,t,null,r);m.push({i:g-4,x:op(u,f)},{i:g-2,x:op(d,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function i(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,n)-2,x:op(u,d)})):d&&f.push(s(f)+"rotate("+d+n)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,n)-2,x:op(u,d)}):d&&f.push(s(f)+"skewX("+d+n)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:op(u,f)},{i:g-2,x:op(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),a(u.translateX,u.translateY,d.translateX,d.translateY,f,h),i(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,g=h.length,y;++m<g;)f[(y=h[m]).i]=y.x(p);return f.join("")}}}var skr=Zit(rkr,"px, ","px)","deg)"),akr=Zit(nkr,", ",")",")"),ikr=1e-12;function ENe(e){return((e=Math.exp(e))+1/e)/2}function okr(e){return((e=Math.exp(e))-1/e)/2}function lkr(e){return((e=Math.exp(2*e))-1)/(e+1)}const k$=(function e(t,r,n){function s(a,i){var l=a[0],c=a[1],u=a[2],d=i[0],f=i[1],h=i[2],p=d-l,m=f-c,g=p*p+m*m,y,x;if(g<ikr)x=Math.log(h/u)/t,y=function(T){return[l+T*p,c+T*m,u*Math.exp(t*T*x)]};else{var w=Math.sqrt(g),S=(h*h-u*u+n*g)/(2*u*r*w),k=(h*h-u*u-n*g)/(2*h*r*w),_=Math.log(Math.sqrt(S*S+1)-S),E=Math.log(Math.sqrt(k*k+1)-k);x=(E-_)/t,y=function(T){var j=T*x,N=ENe(_),I=u/(r*w)*(N*lkr(t*j+_)-okr(_));return[l+I*p,c+I*m,u*N/ENe(t*j+_)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return s.rho=function(a){var i=Math.max(.001,+a),l=i*i,c=l*l;return e(i,l,c)},s})(Math.SQRT2,2,4);function ckr(e,t){t===void 0&&(t=e,e=$y);for(var r=0,n=t.length-1,s=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(s,s=t[++r]);return function(i){var l=Math.max(0,Math.min(n-1,Math.floor(i*=n)));return a[l](i-l)}}function ukr(e){return function(){return e}}function d4(e){return+e}var CNe=[0,1];function Xc(e){return e}function zae(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:ukr(isNaN(t)?NaN:.5)}function dkr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function fkr(e,t,r){var n=e[0],s=e[1],a=t[0],i=t[1];return s<n?(n=zae(s,n),a=r(i,a)):(n=zae(n,s),a=r(a,i)),function(l){return a(n(l))}}function hkr(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),a=new Array(n),i=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<n;)s[i]=zae(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(l){var c=wP(e,l,1,n)-1;return a[c](s[c](l))}}function OP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function y9(){var e=CNe,t=CNe,r=$y,n,s,a,i=Xc,l,c,u;function d(){var h=Math.min(e.length,t.length);return i!==Xc&&(i=dkr(e[0],e[h-1])),l=h>2?hkr:fkr,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(i(h)))}return f.invert=function(h){return i(s((u||(u=l(t,e.map(n),op)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,d4),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=Vhe,d()},f.clamp=function(h){return arguments.length?(i=h?!0:Xc,d()):i!==Xc},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return n=h,s=p,d()}}function qhe(){return y9()(Xc,Xc)}function pkr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function f4(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function X_(e){return e=f4(Math.abs(e)),e?e[1]:NaN}function mkr(e,t){return function(r,n){for(var s=r.length,a=[],i=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[i=(i+1)%e.length];return a.reverse().join(t)}}function gkr(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var ykr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function oI(e){if(!(t=ykr.exec(e)))throw new Error("invalid format: "+e);var t;return new Hhe({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}oI.prototype=Hhe.prototype;function Hhe(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Hhe.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function vkr(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var h4;function bkr(e,t){var r=f4(e,t);if(!r)return h4=void 0,e.toPrecision(t);var n=r[0],s=r[1],a=s-(h4=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,i=n.length;return a===i?n:a>i?n+new Array(a-i+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+f4(e,Math.max(0,t+a-1))[0]}function jNe(e,t){var r=f4(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const TNe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:pkr,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>jNe(e*100,t),r:jNe,s:bkr,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function NNe(e){return e}var ANe=Array.prototype.map,INe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xkr(e){var t=e.grouping===void 0||e.thousands===void 0?NNe:mkr(ANe.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?NNe:gkr(ANe.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=oI(f);var p=f.fill,m=f.align,g=f.sign,y=f.symbol,x=f.zero,w=f.width,S=f.comma,k=f.precision,_=f.trim,E=f.type;E==="n"?(S=!0,E="g"):TNe[E]||(k===void 0&&(k=12),_=!0,E="g"),(x||p==="0"&&m==="=")&&(x=!0,p="0",m="=");var T=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),j=(y==="$"?n:/[%p]/.test(E)?i:"")+(h&&h.suffix!==void 0?h.suffix:""),N=TNe[E],I=/[defgprs%]/.test(E);k=k===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function P(R){var B=T,M=j,F,U,z;if(E==="c")M=N(R)+M,R="";else{R=+R;var H=R<0||1/R<0;if(R=isNaN(R)?c:N(Math.abs(R),k),_&&(R=vkr(R)),H&&+R==0&&g!=="+"&&(H=!1),B=(H?g==="("?g:l:g==="-"||g==="("?"":g)+B,M=(E==="s"&&!isNaN(R)&&h4!==void 0?INe[8+h4/3]:"")+M+(H&&g==="("?")":""),I){for(F=-1,U=R.length;++F<U;)if(z=R.charCodeAt(F),48>z||z>57){M=(z===46?s+R.slice(F+1):R.slice(F))+M,R=R.slice(0,F);break}}}S&&!x&&(R=t(R,1/0));var Q=B.length+R.length+M.length,L=Q<w?new Array(w-Q+1).join(p):"";switch(S&&x&&(R=t(L+R,L.length?w-M.length:1/0),L=""),m){case"<":R=B+R+M+L;break;case"=":R=B+L+R+M;break;case"^":R=L.slice(0,Q=L.length>>1)+B+R+M+L.slice(Q);break;default:R=L+B+R+M;break}return a(R)}return P.toString=function(){return f+""},P}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(X_(h)/3)))*3,m=Math.pow(10,-p),g=u((f=oI(f),f.type="f",f),{suffix:INe[8+p/3]});return function(y){return g(m*y)}}return{format:u,formatPrefix:d}}var qD,Qhe,Yit;wkr({thousands:",",grouping:[3],currency:["$",""]});function wkr(e){return qD=xkr(e),Qhe=qD.format,Yit=qD.formatPrefix,qD}function Skr(e){return Math.max(0,-X_(Math.abs(e)))}function Okr(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(X_(t)/3)))*3-X_(Math.abs(e)))}function kkr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,X_(t)-X_(e))+1}function Xit(e,t,r,n){var s=Mae(e,t,r),a;switch(n=oI(n??",f"),n.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Okr(s,i))&&(n.precision=a),Yit(n,i)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=kkr(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Skr(s))&&(n.precision=a-(n.type==="%")*2);break}}return Qhe(n)}function a0(e){var t=e.domain;return e.ticks=function(r){var n=t();return Rae(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return Xit(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,a=n.length-1,i=n[s],l=n[a],c,u,d=10;for(l<i&&(u=i,i=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=Pae(i,l,r),u===c)return n[s]=i,n[a]=l,t(n);if(u>0)i=Math.floor(i/u)*u,l=Math.ceil(l/u)*u;else if(u<0)i=Math.ceil(i*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Kit(){var e=qhe();return e.copy=function(){return OP(e,Kit())},Fh.apply(e,arguments),a0(e)}function Jit(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,d4),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Jit(e).unknown(t)},e=arguments.length?Array.from(e,d4):[0,1],a0(r)}function eot(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],a=e[n],i;return a<s&&(i=r,r=n,n=i,i=s,s=a,a=i),e[r]=t.floor(s),e[n]=t.ceil(a),e}function RNe(e){return Math.log(e)}function PNe(e){return Math.exp(e)}function _kr(e){return-Math.log(-e)}function Ekr(e){return-Math.exp(-e)}function Ckr(e){return isFinite(e)?+("1e"+e):e<0?0:e}function jkr(e){return e===10?Ckr:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Tkr(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function MNe(e){return(t,r)=>-e(-t,r)}function Whe(e){const t=e(RNe,PNe),r=t.domain;let n=10,s,a;function i(){return s=Tkr(n),a=jkr(n),r()[0]<0?(s=MNe(s),a=MNe(a),e(_kr,Ekr)):e(RNe,PNe),t}return t.base=function(l){return arguments.length?(n=+l,i()):n},t.domain=function(l){return arguments.length?(r(l),i()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=s(u),p=s(d),m,g;const y=l==null?10:+l;let x=[];if(!(n%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(m=1;m<n;++m)if(g=h<0?m/a(-h):m*a(h),!(g<u)){if(g>d)break;x.push(g)}}else for(;h<=p;++h)for(m=n-1;m>=1;--m)if(g=h>0?m/a(-h):m*a(h),!(g<u)){if(g>d)break;x.push(g)}x.length*2<y&&(x=Rae(u,d,y))}else x=Rae(h,p,Math.min(p-h,y)).map(a);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=oI(c)).precision==null&&(c.trim=!0),c=Qhe(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(eot(r(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function tot(){const e=Whe(y9()).domain([1,10]);return e.copy=()=>OP(e,tot()).base(e.base()),Fh.apply(e,arguments),e}function DNe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function LNe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ghe(e){var t=1,r=e(DNe(t),LNe(t));return r.constant=function(n){return arguments.length?e(DNe(t=+n),LNe(t)):t},a0(r)}function rot(){var e=Ghe(y9());return e.copy=function(){return OP(e,rot()).constant(e.constant())},Fh.apply(e,arguments)}function $Ne(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Nkr(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Akr(e){return e<0?-e*e:e*e}function Zhe(e){var t=e(Xc,Xc),r=1;function n(){return r===1?e(Xc,Xc):r===.5?e(Nkr,Akr):e($Ne(r),$Ne(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},a0(t)}function Yhe(){var e=Zhe(y9());return e.copy=function(){return OP(e,Yhe()).exponent(e.exponent())},Fh.apply(e,arguments),e}function Ikr(){return Yhe.apply(null,arguments).exponent(.5)}function FNe(e){return Math.sign(e)*e*e}function Rkr(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function not(){var e=qhe(),t=[0,1],r=!1,n;function s(a){var i=Rkr(e(a));return isNaN(i)?n:r?Math.round(i):i}return s.invert=function(a){return e.invert(FNe(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,d4)).map(FNe)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(r=!!a,s):r},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return not(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Fh.apply(s,arguments),a0(s)}function sot(){var e=[],t=[],r=[],n;function s(){var i=0,l=Math.max(1,t.length);for(r=new Array(l-1);++i<l;)r[i-1]=AOr(e,i/l);return a}function a(i){return i==null||isNaN(i=+i)?n:t[wP(r,i)]}return a.invertExtent=function(i){var l=t.indexOf(i);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let l of i)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Xb),s()},a.range=function(i){return arguments.length?(t=Array.from(i),s()):t.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return sot().domain(e).range(t).unknown(n)},Fh.apply(a,arguments)}function aot(){var e=0,t=1,r=1,n=[.5],s=[0,1],a;function i(c){return c!=null&&c<=c?s[wP(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return i}return i.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},i.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},i.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},i.unknown=function(c){return arguments.length&&(a=c),i},i.thresholds=function(){return n.slice()},i.copy=function(){return aot().domain([e,t]).range(s).unknown(a)},Fh.apply(a0(i),arguments)}function iot(){var e=[.5],t=[0,1],r,n=1;function s(a){return a!=null&&a<=a?t[wP(e,a,0,n)]:r}return s.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var i=t.indexOf(a);return[e[i-1],e[i]]},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return iot().domain(e).range(t).unknown(r)},Fh.apply(s,arguments)}const zH=new Date,BH=new Date;function sl(e,t,r,n){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const i=s(a),l=s.ceil(a);return a-i<l-a?i:l},s.offset=(a,i)=>(t(a=new Date(+a),i==null?1:Math.floor(i)),a),s.range=(a,i,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<i)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<i);return c},s.filter=a=>sl(i=>{if(i>=i)for(;e(i),!a(i);)i.setTime(i-1)},(i,l)=>{if(i>=i)if(l<0)for(;++l<=0;)for(;t(i,-1),!a(i););else for(;--l>=0;)for(;t(i,1),!a(i););}),r&&(s.count=(a,i)=>(zH.setTime(+a),BH.setTime(+i),e(zH),e(BH),Math.floor(r(zH,BH))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(n?i=>n(i)%a===0:i=>s.count(0,i)%a===0):s)),s}const p4=sl(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);p4.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?sl(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):p4);p4.range;const Ty=1e3,hh=Ty*60,Ny=hh*60,Ky=Ny*24,Xhe=Ky*7,zNe=Ky*30,UH=Ky*365,jw=sl(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ty)},(e,t)=>(t-e)/Ty,e=>e.getUTCSeconds());jw.range;const Khe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ty)},(e,t)=>{e.setTime(+e+t*hh)},(e,t)=>(t-e)/hh,e=>e.getMinutes());Khe.range;const Jhe=sl(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*hh)},(e,t)=>(t-e)/hh,e=>e.getUTCMinutes());Jhe.range;const epe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ty-e.getMinutes()*hh)},(e,t)=>{e.setTime(+e+t*Ny)},(e,t)=>(t-e)/Ny,e=>e.getHours());epe.range;const tpe=sl(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ny)},(e,t)=>(t-e)/Ny,e=>e.getUTCHours());tpe.range;const kP=sl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*hh)/Ky,e=>e.getDate()-1);kP.range;const v9=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ky,e=>e.getUTCDate()-1);v9.range;const oot=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ky,e=>Math.floor(e/Ky));oot.range;function v1(e){return sl(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*hh)/Xhe)}const b9=v1(0),m4=v1(1),Pkr=v1(2),Mkr=v1(3),K_=v1(4),Dkr=v1(5),Lkr=v1(6);b9.range;m4.range;Pkr.range;Mkr.range;K_.range;Dkr.range;Lkr.range;function b1(e){return sl(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Xhe)}const x9=b1(0),g4=b1(1),$kr=b1(2),Fkr=b1(3),J_=b1(4),zkr=b1(5),Bkr=b1(6);x9.range;g4.range;$kr.range;Fkr.range;J_.range;zkr.range;Bkr.range;const rpe=sl(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());rpe.range;const npe=sl(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());npe.range;const Jy=sl(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Jy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sl(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Jy.range;const ev=sl(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ev.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sl(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ev.range;function lot(e,t,r,n,s,a){const i=[[jw,1,Ty],[jw,5,5*Ty],[jw,15,15*Ty],[jw,30,30*Ty],[a,1,hh],[a,5,5*hh],[a,15,15*hh],[a,30,30*hh],[s,1,Ny],[s,3,3*Ny],[s,6,6*Ny],[s,12,12*Ny],[n,1,Ky],[n,2,2*Ky],[r,1,Xhe],[t,1,zNe],[t,3,3*zNe],[e,1,UH]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),m=p?p.range(u,+d+1):[];return h?m.reverse():m}function c(u,d,f){const h=Math.abs(d-u)/f,p=$he(([,,y])=>y).right(i,h);if(p===i.length)return e.every(Mae(u/UH,d/UH,f));if(p===0)return p4.every(Math.max(Mae(u,d,f),1));const[m,g]=i[h/i[p-1][2]<i[p][2]/h?p-1:p];return m.every(g)}return[l,c]}const[Ukr,Vkr]=lot(ev,npe,x9,oot,tpe,Jhe),[qkr,Hkr]=lot(Jy,rpe,b9,kP,epe,Khe);function VH(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function qH(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function nT(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Qkr(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,a=e.days,i=e.shortDays,l=e.months,c=e.shortMonths,u=sT(s),d=aT(s),f=sT(a),h=aT(a),p=sT(i),m=aT(i),g=sT(l),y=aT(l),x=sT(c),w=aT(c),S={a:z,A:H,b:Q,B:L,c:null,d:QNe,e:QNe,f:m_r,g:__r,G:C_r,H:f_r,I:h_r,j:p_r,L:cot,m:g_r,M:y_r,p:Z,q:V,Q:ZNe,s:YNe,S:v_r,u:b_r,U:x_r,V:w_r,w:S_r,W:O_r,x:null,X:null,y:k_r,Y:E_r,Z:j_r,"%":GNe},k={a:D,A:W,b:G,B:J,c:null,d:WNe,e:WNe,f:I_r,g:U_r,G:q_r,H:T_r,I:N_r,j:A_r,L:dot,m:R_r,M:P_r,p:ae,q:te,Q:ZNe,s:YNe,S:M_r,u:D_r,U:L_r,V:$_r,w:F_r,W:z_r,x:null,X:null,y:B_r,Y:V_r,Z:H_r,"%":GNe},_={a:I,A:P,b:R,B,c:M,d:qNe,e:qNe,f:l_r,g:VNe,G:UNe,H:HNe,I:HNe,j:s_r,L:o_r,m:n_r,M:a_r,p:N,q:r_r,Q:u_r,s:d_r,S:i_r,u:Xkr,U:Kkr,V:Jkr,w:Ykr,W:e_r,x:F,X:U,y:VNe,Y:UNe,Z:t_r,"%":c_r};S.x=E(r,S),S.X=E(n,S),S.c=E(t,S),k.x=E(r,k),k.X=E(n,k),k.c=E(t,k);function E(re,ie){return function(fe){var X=[],se=-1,le=0,xe=re.length,ue,ce,ve;for(fe instanceof Date||(fe=new Date(+fe));++se<xe;)re.charCodeAt(se)===37&&(X.push(re.slice(le,se)),(ce=BNe[ue=re.charAt(++se)])!=null?ue=re.charAt(++se):ce=ue==="e"?" ":"0",(ve=ie[ue])&&(ue=ve(fe,ce)),X.push(ue),le=se+1);return X.push(re.slice(le,se)),X.join("")}}function T(re,ie){return function(fe){var X=nT(1900,void 0,1),se=j(X,re,fe+="",0),le,xe;if(se!=fe.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ie&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(le=qH(nT(X.y,0,1)),xe=le.getUTCDay(),le=xe>4||xe===0?g4.ceil(le):g4(le),le=v9.offset(le,(X.V-1)*7),X.y=le.getUTCFullYear(),X.m=le.getUTCMonth(),X.d=le.getUTCDate()+(X.w+6)%7):(le=VH(nT(X.y,0,1)),xe=le.getDay(),le=xe>4||xe===0?m4.ceil(le):m4(le),le=kP.offset(le,(X.V-1)*7),X.y=le.getFullYear(),X.m=le.getMonth(),X.d=le.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),xe="Z"in X?qH(nT(X.y,0,1)).getUTCDay():VH(nT(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(xe+5)%7:X.w+X.U*7-(xe+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,qH(X)):VH(X)}}function j(re,ie,fe,X){for(var se=0,le=ie.length,xe=fe.length,ue,ce;se<le;){if(X>=xe)return-1;if(ue=ie.charCodeAt(se++),ue===37){if(ue=ie.charAt(se++),ce=_[ue in BNe?ie.charAt(se++):ue],!ce||(X=ce(re,fe,X))<0)return-1}else if(ue!=fe.charCodeAt(X++))return-1}return X}function N(re,ie,fe){var X=u.exec(ie.slice(fe));return X?(re.p=d.get(X[0].toLowerCase()),fe+X[0].length):-1}function I(re,ie,fe){var X=p.exec(ie.slice(fe));return X?(re.w=m.get(X[0].toLowerCase()),fe+X[0].length):-1}function P(re,ie,fe){var X=f.exec(ie.slice(fe));return X?(re.w=h.get(X[0].toLowerCase()),fe+X[0].length):-1}function R(re,ie,fe){var X=x.exec(ie.slice(fe));return X?(re.m=w.get(X[0].toLowerCase()),fe+X[0].length):-1}function B(re,ie,fe){var X=g.exec(ie.slice(fe));return X?(re.m=y.get(X[0].toLowerCase()),fe+X[0].length):-1}function M(re,ie,fe){return j(re,t,ie,fe)}function F(re,ie,fe){return j(re,r,ie,fe)}function U(re,ie,fe){return j(re,n,ie,fe)}function z(re){return i[re.getDay()]}function H(re){return a[re.getDay()]}function Q(re){return c[re.getMonth()]}function L(re){return l[re.getMonth()]}function Z(re){return s[+(re.getHours()>=12)]}function V(re){return 1+~~(re.getMonth()/3)}function D(re){return i[re.getUTCDay()]}function W(re){return a[re.getUTCDay()]}function G(re){return c[re.getUTCMonth()]}function J(re){return l[re.getUTCMonth()]}function ae(re){return s[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ie=E(re+="",S);return ie.toString=function(){return re},ie},parse:function(re){var ie=T(re+="",!1);return ie.toString=function(){return re},ie},utcFormat:function(re){var ie=E(re+="",k);return ie.toString=function(){return re},ie},utcParse:function(re){var ie=T(re+="",!0);return ie.toString=function(){return re},ie}}}var BNe={"-":"",_:" ",0:"0"},jl=/^\s*\d+/,Wkr=/^%/,Gkr=/[\\^$*+?|[\]().{}]/g;function Bs(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",a=s.length;return n+(a<r?new Array(r-a+1).join(t)+s:s)}function Zkr(e){return e.replace(Gkr,"\\$&")}function sT(e){return new RegExp("^(?:"+e.map(Zkr).join("|")+")","i")}function aT(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Ykr(e,t,r){var n=jl.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Xkr(e,t,r){var n=jl.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Kkr(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Jkr(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function e_r(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function UNe(e,t,r){var n=jl.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function VNe(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function t_r(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function r_r(e,t,r){var n=jl.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function n_r(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function qNe(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function s_r(e,t,r){var n=jl.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function HNe(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function a_r(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function i_r(e,t,r){var n=jl.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function o_r(e,t,r){var n=jl.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function l_r(e,t,r){var n=jl.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function c_r(e,t,r){var n=Wkr.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function u_r(e,t,r){var n=jl.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function d_r(e,t,r){var n=jl.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function QNe(e,t){return Bs(e.getDate(),t,2)}function f_r(e,t){return Bs(e.getHours(),t,2)}function h_r(e,t){return Bs(e.getHours()%12||12,t,2)}function p_r(e,t){return Bs(1+kP.count(Jy(e),e),t,3)}function cot(e,t){return Bs(e.getMilliseconds(),t,3)}function m_r(e,t){return cot(e,t)+"000"}function g_r(e,t){return Bs(e.getMonth()+1,t,2)}function y_r(e,t){return Bs(e.getMinutes(),t,2)}function v_r(e,t){return Bs(e.getSeconds(),t,2)}function b_r(e){var t=e.getDay();return t===0?7:t}function x_r(e,t){return Bs(b9.count(Jy(e)-1,e),t,2)}function uot(e){var t=e.getDay();return t>=4||t===0?K_(e):K_.ceil(e)}function w_r(e,t){return e=uot(e),Bs(K_.count(Jy(e),e)+(Jy(e).getDay()===4),t,2)}function S_r(e){return e.getDay()}function O_r(e,t){return Bs(m4.count(Jy(e)-1,e),t,2)}function k_r(e,t){return Bs(e.getFullYear()%100,t,2)}function __r(e,t){return e=uot(e),Bs(e.getFullYear()%100,t,2)}function E_r(e,t){return Bs(e.getFullYear()%1e4,t,4)}function C_r(e,t){var r=e.getDay();return e=r>=4||r===0?K_(e):K_.ceil(e),Bs(e.getFullYear()%1e4,t,4)}function j_r(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bs(t/60|0,"0",2)+Bs(t%60,"0",2)}function WNe(e,t){return Bs(e.getUTCDate(),t,2)}function T_r(e,t){return Bs(e.getUTCHours(),t,2)}function N_r(e,t){return Bs(e.getUTCHours()%12||12,t,2)}function A_r(e,t){return Bs(1+v9.count(ev(e),e),t,3)}function dot(e,t){return Bs(e.getUTCMilliseconds(),t,3)}function I_r(e,t){return dot(e,t)+"000"}function R_r(e,t){return Bs(e.getUTCMonth()+1,t,2)}function P_r(e,t){return Bs(e.getUTCMinutes(),t,2)}function M_r(e,t){return Bs(e.getUTCSeconds(),t,2)}function D_r(e){var t=e.getUTCDay();return t===0?7:t}function L_r(e,t){return Bs(x9.count(ev(e)-1,e),t,2)}function fot(e){var t=e.getUTCDay();return t>=4||t===0?J_(e):J_.ceil(e)}function $_r(e,t){return e=fot(e),Bs(J_.count(ev(e),e)+(ev(e).getUTCDay()===4),t,2)}function F_r(e){return e.getUTCDay()}function z_r(e,t){return Bs(g4.count(ev(e)-1,e),t,2)}function B_r(e,t){return Bs(e.getUTCFullYear()%100,t,2)}function U_r(e,t){return e=fot(e),Bs(e.getUTCFullYear()%100,t,2)}function V_r(e,t){return Bs(e.getUTCFullYear()%1e4,t,4)}function q_r(e,t){var r=e.getUTCDay();return e=r>=4||r===0?J_(e):J_.ceil(e),Bs(e.getUTCFullYear()%1e4,t,4)}function H_r(){return"+0000"}function GNe(){return"%"}function ZNe(e){return+e}function YNe(e){return Math.floor(+e/1e3)}var OO,hot,pot;Q_r({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Q_r(e){return OO=Qkr(e),hot=OO.format,OO.parse,pot=OO.utcFormat,OO.utcParse,OO}function W_r(e){return new Date(e)}function G_r(e){return e instanceof Date?+e:+new Date(+e)}function spe(e,t,r,n,s,a,i,l,c,u){var d=qhe(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),w=u("%b %d"),S=u("%B"),k=u("%Y");function _(E){return(c(E)<E?p:l(E)<E?m:i(E)<E?g:a(E)<E?y:n(E)<E?s(E)<E?x:w:r(E)<E?S:k)(E)}return d.invert=function(E){return new Date(f(E))},d.domain=function(E){return arguments.length?h(Array.from(E,G_r)):h().map(W_r)},d.ticks=function(E){var T=h();return e(T[0],T[T.length-1],E??10)},d.tickFormat=function(E,T){return T==null?_:u(T)},d.nice=function(E){var T=h();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?h(eot(T,E)):d},d.copy=function(){return OP(d,spe(e,t,r,n,s,a,i,l,c,u))},d}function Z_r(){return Fh.apply(spe(qkr,Hkr,Jy,rpe,b9,kP,epe,Khe,jw,hot).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Y_r(){return Fh.apply(spe(Ukr,Vkr,ev,npe,x9,v9,tpe,Jhe,jw,pot).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function w9(){var e=0,t=1,r,n,s,a,i=Xc,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:i(s===0?.5:(f=(a(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),s=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(i=f,u):i};function d(f){return function(h){var p,m;return arguments.length?([p,m]=h,i=f(p,m),u):[i(0),i(1)]}}return u.range=d($y),u.rangeRound=d(Vhe),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),u}}function i0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function mot(){var e=a0(w9()(Xc));return e.copy=function(){return i0(e,mot())},bv.apply(e,arguments)}function got(){var e=Whe(w9()).domain([1,10]);return e.copy=function(){return i0(e,got()).base(e.base())},bv.apply(e,arguments)}function yot(){var e=Ghe(w9());return e.copy=function(){return i0(e,yot()).constant(e.constant())},bv.apply(e,arguments)}function ape(){var e=Zhe(w9());return e.copy=function(){return i0(e,ape()).exponent(e.exponent())},bv.apply(e,arguments)}function X_r(){return ape.apply(null,arguments).exponent(.5)}function vot(){var e=[],t=Xc;function r(n){if(n!=null&&!isNaN(n=+n))return t((wP(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Xb),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,a)=>NOr(e,a/n))},r.copy=function(){return vot(t).domain(e)},bv.apply(r,arguments)}function S9(){var e=0,t=.5,r=1,n=1,s,a,i,l,c,u=Xc,d,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-a)*(n*g<n*a?l:c),u(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,s=d(e=+e),a=d(t=+t),i=d(r=+r),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),n=a<s?-1:1,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(u=g,p):u};function m(g){return function(y){var x,w,S;return arguments.length?([x,w,S]=y,u=ckr(g,[x,w,S]),p):[u(0),u(.5),u(1)]}}return p.range=m($y),p.rangeRound=m(Vhe),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return d=g,s=g(e),a=g(t),i=g(r),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),n=a<s?-1:1,p}}function bot(){var e=a0(S9()(Xc));return e.copy=function(){return i0(e,bot())},bv.apply(e,arguments)}function xot(){var e=Whe(S9()).domain([.1,1,10]);return e.copy=function(){return i0(e,xot()).base(e.base())},bv.apply(e,arguments)}function wot(){var e=Ghe(S9());return e.copy=function(){return i0(e,wot()).constant(e.constant())},bv.apply(e,arguments)}function ipe(){var e=Zhe(S9());return e.copy=function(){return i0(e,ipe()).exponent(e.exponent())},bv.apply(e,arguments)}function K_r(){return ipe.apply(null,arguments).exponent(.5)}const HT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:zhe,scaleDiverging:bot,scaleDivergingLog:xot,scaleDivergingPow:ipe,scaleDivergingSqrt:K_r,scaleDivergingSymlog:wot,scaleIdentity:Jit,scaleImplicit:Dae,scaleLinear:Kit,scaleLog:tot,scaleOrdinal:Fhe,scalePoint:ROr,scalePow:Yhe,scaleQuantile:sot,scaleQuantize:aot,scaleRadial:not,scaleSequential:mot,scaleSequentialLog:got,scaleSequentialPow:ape,scaleSequentialQuantile:vot,scaleSequentialSqrt:X_r,scaleSequentialSymlog:yot,scaleSqrt:Ikr,scaleSymlog:rot,scaleThreshold:iot,scaleTime:Z_r,scaleUtc:Y_r,tickFormat:Xit},Symbol.toStringTag,{value:"Module"}));function J_r(e){if(e in HT)return HT[e]();var t="scale".concat(pP(e));if(t in HT)return HT[t]()}function XNe(e,t,r){if(typeof e=="function")return e.copy().domain(t).range(r);if(e!=null){var n=J_r(e);if(n!=null)return n.domain(t).range(r),n}}function ope(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?XNe(e.scale,r,n):XNe(t,r,n)}function eEr(e){return"scale".concat(pP(e))}function tEr(e){return eEr(e)in HT}var Sot=(e,t,r)=>{if(e!=null){var{scale:n,type:s}=e;if(n==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof n=="string")return tEr(n)?n:"point"}};function rEr(e,t){for(var r=0,n=e.length,s=e[0]<e[e.length-1];r<n;){var a=Math.floor((r+n)/2);(s?e[a]<t:e[a]>t)?r=a+1:n=a}return r}function Oot(e,t){if(e){var r=t??e.domain(),n=r.map(a=>{var i;return(i=e(a))!==null&&i!==void 0?i:0}),s=e.range();if(!(r.length===0||s.length<2))return a=>{var i,l,c=rEr(n,a);if(c<=0)return r[0];if(c>=r.length)return r[r.length-1];var u=(i=n[c-1])!==null&&i!==void 0?i:0,d=(l=n[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-d)?r[c-1]:r[c]}}}function nEr(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Oot(e,void 0)}function KNe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function y4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KNe(Object(r),!0).forEach(function(n){sEr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sEr(e,t,r){return(t=aEr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aEr(e){var t=iEr(e,"string");return typeof t=="symbol"?t:t+""}function iEr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bae=[0,"auto"],Yo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},kot=(e,t)=>e.cartesianAxis.xAxis[t],xv=(e,t)=>{var r=kot(e,t);return r??Yo},Xo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Bae,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:yP},_ot=(e,t)=>e.cartesianAxis.yAxis[t],wv=(e,t)=>{var r=_ot(e,t);return r??Xo},oEr={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},lpe=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??oEr},hu=(e,t,r)=>{switch(t){case"xAxis":return xv(e,r);case"yAxis":return wv(e,r);case"zAxis":return lpe(e,r);case"angleAxis":return Rhe(e,r);case"radiusAxis":return Phe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},lEr=(e,t,r)=>{switch(t){case"xAxis":return xv(e,r);case"yAxis":return wv(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},_P=(e,t,r)=>{switch(t){case"xAxis":return xv(e,r);case"yAxis":return wv(e,r);case"angleAxis":return Rhe(e,r);case"radiusAxis":return Phe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Eot=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Cot(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var jot=e=>e.graphicalItems.cartesianItems,cEr=Xe([El,p9],Cot),Tot=(e,t,r)=>e.filter(r).filter(n=>t?.includeHidden===!0?!0:!n.hide),EP=Xe([jot,hu,cEr],Tot,{memoizeOptions:{resultEqualityCheck:g9}}),Not=Xe([EP],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Dhe)),Aot=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),uEr=Xe([EP],Aot),Iot=e=>e.map(t=>t.data).filter(Boolean).flat(1),dEr=Xe([EP],Iot,{memoizeOptions:{resultEqualityCheck:g9}}),Rot=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},cpe=Xe([dEr,Ehe],Rot),Pot=(e,t,r)=>t?.dataKey!=null?e.map(n=>({value:Yl(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:Yl(s,n)}))):e.map(n=>({value:n})),CP=Xe([cpe,hu,EP],Pot);function t_(e){if(sg(e)||e instanceof Date){var t=Number(e);if(zs(t))return t}}function JNe(e){if(Array.isArray(e)){var t=[t_(e[0]),t_(e[1])];return Gm(t)?t:void 0}var r=t_(e);if(r!=null)return[r,r]}function tv(e){return e.map(t_).filter(Bu)}function fEr(e,t){var r=t_(e),n=t_(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var hEr=Xe([CP],e=>e?.map(t=>t.value).sort(fEr));function Mot(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function pEr(e,t,r){return!r||typeof t!="number"||Yy(t)?[]:r.length?tv(r.flatMap(n=>{var s=Yl(e,n.dataKey),a,i;if(Array.isArray(s)?[a,i]=s:a=i=s,!(!zs(a)||!zs(i)))return[t-a,t+i]})):[]}var al=e=>{var t=Cl(e),r=oC(e);return _P(e,t,r)},jP=Xe([al],e=>e?.dataKey),mEr=Xe([Not,Ehe,al],Fit),Dot=(e,t,r,n)=>{var s={},a=t.reduce((i,l)=>{if(l.stackId==null)return i;var c=i[l.stackId];return c==null&&(c=[]),c.push(l),i[l.stackId]=c,i},s);return Object.fromEntries(Object.entries(a).map(i=>{var[l,c]=i,u=n?[...c].reverse():c,d=u.map($it);return[l,{stackedData:Twr(e,d,r),graphicalItems:u}]}))},gEr=Xe([mEr,Not,u9,Ait],Dot),Lot=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var i=Iwr(e,s,a);if(!(i!=null&&i[0]===0&&i[1]===0))return i}},yEr=Xe([hu],e=>e.allowDataOverflow),upe=e=>{var t;if(e==null||!("domain"in e))return Bae;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=tv(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:Bae},$ot=Xe([hu],upe),Fot=Xe([$ot,yEr],xit),vEr=Xe([gEr,s0,El,Fot],Lot,{memoizeOptions:{resultEqualityCheck:m9}}),dpe=e=>e.errorBars,bEr=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>Mot(r,n)),v4=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r.filter(Boolean);if(s.length!==0){var a=s.flat(),i=Math.min(...a),l=Math.max(...a);return[i,l]}},zot=(e,t,r,n,s)=>{var a,i;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var u,d,f=(u=n[c.id])===null||u===void 0?void 0:u.filter(x=>Mot(s,x)),h=Yl(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=pEr(l,h,f);if(p.length>=2){var m=Math.min(...p),g=Math.max(...p);(a==null||m<a)&&(a=m),(i==null||g>i)&&(i=g)}var y=JNe(h);y!=null&&(a=a==null?y[0]:Math.min(a,y[0]),i=i==null?y[1]:Math.max(i,y[1]))})}),t?.dataKey!=null&&e.forEach(l=>{var c=JNe(Yl(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),i=i==null?c[1]:Math.max(i,c[1]))}),zs(a)&&zs(i))return[a,i]},xEr=Xe([cpe,hu,uEr,dpe,El],zot,{memoizeOptions:{resultEqualityCheck:m9}});function wEr(e){var{value:t}=e;if(sg(t)||t instanceof Date)return t}var SEr=(e,t,r)=>{var n=e.map(wEr).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&Kst(n))?bit(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},Bot=e=>e.referenceElements.dots,lC=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),OEr=Xe([Bot,El,p9],lC),Uot=e=>e.referenceElements.areas,kEr=Xe([Uot,El,p9],lC),Vot=e=>e.referenceElements.lines,_Er=Xe([Vot,El,p9],lC),qot=(e,t)=>{if(e!=null){var r=tv(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},EEr=Xe(OEr,El,qot),Hot=(e,t)=>{if(e!=null){var r=tv(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},CEr=Xe([kEr,El],Hot);function jEr(e){var t;if(e.x!=null)return tv([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:tv(r)}function TEr(e){var t;if(e.y!=null)return tv([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:tv(r)}var Qot=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?jEr(n):TEr(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},NEr=Xe([_Er,El],Qot),AEr=Xe(EEr,NEr,CEr,(e,t,r)=>v4(e,r,t)),Wot=(e,t,r,n,s,a,i,l)=>{if(r!=null)return r;var c=i==="vertical"&&l==="xAxis"||i==="horizontal"&&l==="yAxis",u=c?v4(n,a,s):v4(a,s);return aOr(t,u,e.allowDataOverflow)},IEr=Xe([hu,$ot,Fot,vEr,xEr,AEr,Fi,El],Wot,{memoizeOptions:{resultEqualityCheck:m9}}),REr=[0,1],Got=(e,t,r,n,s,a,i)=>{if(!((e==null||r==null||r.length===0)&&i===void 0)){var{dataKey:l,type:c}=e,u=gv(t,a);if(u&&l==null){var d;return bit(0,(d=r?.length)!==null&&d!==void 0?d:0)}return c==="category"?SEr(n,e,u):s==="expand"?REr:i}},fpe=Xe([hu,Fi,cpe,CP,u9,El,IEr],Got),cC=Xe([hu,Eot,Nhe],Sot),Zot=(e,t,r)=>{var{niceTicks:n}=t;if(n!=="none"){var s=upe(t),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Gm(e)){if(a)return lNe(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return cNe(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&Gm(e))return lNe(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Gm(e))return cNe(e,t.tickCount,t.allowDecimals,"adaptive")}}},hpe=Xe([fpe,_P,cC],Zot),Yot=(e,t,r,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&Gm(t)&&Array.isArray(r)&&r.length>0){var s,a,i=t[0],l=(s=r[0])!==null&&s!==void 0?s:0,c=t[1],u=(a=r[r.length-1])!==null&&a!==void 0?a:0;return[Math.min(i,l),Math.max(c,u)]}return t},PEr=Xe([hu,fpe,hpe,El],Yot),MEr=Xe(CP,hu,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(tv(e.map(f=>f.value))).sort((f,h)=>f-h),s=n[0],a=n[n.length-1];if(s==null||a==null)return 1/0;var i=a-s;if(i===0)return 1/0;for(var l=0;l<n.length-1;l++){var c=n[l],u=n[l+1];if(!(c==null||u==null)){var d=u-c;r=Math.min(r,d)}}return r/i}}),Xot=Xe(MEr,Fi,uOr,ec,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!zs(e))return 0;var a=t==="vertical"?n.height:n.width;if(s==="gap")return e*a/2;if(s==="no-gap"){var i=Ex(r,e*a),l=e*a/2;return l-i-(l-i)/a*i}return 0}),DEr=(e,t,r)=>{var n=xv(e,t);return n==null||typeof n.padding!="string"?0:Xot(e,"xAxis",t,r,n.padding)},LEr=(e,t,r)=>{var n=wv(e,t);return n==null||typeof n.padding!="string"?0:Xot(e,"yAxis",t,r,n.padding)},$Er=Xe(xv,DEr,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((n=s.right)!==null&&n!==void 0?n:0)+t}}),FEr=Xe(wv,LEr,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((n=s.bottom)!==null&&n!==void 0?n:0)+t}}),zEr=Xe([ec,$Er,s9,n9,(e,t,r)=>r],(e,t,r,n,s)=>{var{padding:a}=n;return s?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),BEr=Xe([ec,Fi,FEr,s9,n9,(e,t,r)=>r],(e,t,r,n,s,a)=>{var{padding:i}=s;return a?[n.height-i.bottom,i.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),TP=(e,t,r,n)=>{var s;switch(t){case"xAxis":return zEr(e,r,n);case"yAxis":return BEr(e,r,n);case"zAxis":return(s=lpe(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return Mit(e);case"radiusAxis":return Dit(e,r);default:return}},Kot=Xe([hu,TP],d9),UEr=Xe([cC,PEr],vOr),ppe=Xe([hu,cC,UEr,Kot],ope),Jot=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:a}=r,i=gv(e,n);if(i&&(s==="number"||a!=="auto"))return t.map(l=>l.value)}},mpe=Xe([Fi,CP,_P,El],Jot),O9=Xe([ppe],Lhe);Xe([ppe],nEr);Xe([ppe,hEr],Oot);Xe([EP,dpe,El],bEr);function elt(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var k9=(e,t)=>t,_9=(e,t,r)=>r,VEr=Xe(t9,k9,_9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(elt)),qEr=Xe(r9,k9,_9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(elt)),tlt=(e,t)=>({width:e.width,height:t.height}),HEr=(e,t)=>{var r=typeof t.width=="number"?t.width:yP;return{width:r,height:e.height}},QEr=Xe(ec,xv,tlt),WEr=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},GEr=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},ZEr=Xe(vv,ec,VEr,k9,_9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=tlt(t,l);i==null&&(i=WEr(t,n,e));var u=n==="top"&&!s||n==="bottom"&&s;a[l.id]=i-Number(u)*c.height,i+=(u?-1:1)*c.height}),a}),YEr=Xe(yv,ec,qEr,k9,_9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=HEr(t,l);i==null&&(i=GEr(t,n,e));var u=n==="left"&&!s||n==="right"&&s;a[l.id]=i-Number(u)*c.width,i+=(u?-1:1)*c.width}),a}),XEr=(e,t)=>{var r=xv(e,t);if(r!=null)return ZEr(e,r.orientation,r.mirror)},KEr=Xe([ec,xv,XEr,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r?.[n];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),JEr=(e,t)=>{var r=wv(e,t);if(r!=null)return YEr(e,r.orientation,r.mirror)},eCr=Xe([ec,wv,JEr,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r?.[n];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),tCr=Xe(ec,wv,(e,t)=>{var r=typeof t.width=="number"?t.width:yP;return{width:r,height:e.height}}),rlt=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:a,dataKey:i}=r,l=gv(e,n),c=t.map(u=>u.value);if(i&&l&&a==="category"&&s&&Kst(c))return c}},gpe=Xe([Fi,CP,hu,El],rlt),eAe=Xe([Fi,lEr,cC,O9,gpe,mpe,TP,hpe,El],(e,t,r,n,s,a,i,l,c)=>{if(t!=null){var u=gv(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:s,isCategorical:u,niceTicks:l,range:i,realScaleType:r,scale:n}}}),rCr=(e,t,r,n,s,a,i,l,c)=>{if(!(t==null||n==null)){var u=gv(e,c),{type:d,ticks:f,tickCount:h}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,m=d==="category"&&n.bandwidth?n.bandwidth()/p:0;m=c==="angleAxis"&&a!=null&&a.length>=2?dh(a[0]-a[1])*2*m:m;var g=f||s;return g?g.map((y,x)=>{var w=i?i.indexOf(y):y,S=n.map(w);return zs(S)?{index:x,coordinate:S+m,value:y,offset:m}:null}).filter(Bu):u&&l?l.map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:y,index:x,offset:m}:null}).filter(Bu):n.ticks?n.ticks(h).map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:y,index:x,offset:m}:null}).filter(Bu):n.domain().map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:i?i[y]:y,index:x,offset:m}:null}).filter(Bu)}},nlt=Xe([Fi,_P,cC,O9,hpe,TP,gpe,mpe,El],rCr),nCr=(e,t,r,n,s,a,i)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=gv(e,i),{tickCount:c}=t,u=0;return u=i==="angleAxis"&&n?.length>=2?dh(n[0]-n[1])*2*u:u,l&&a?a.map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(Bu):r.ticks?r.ticks(c).map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(Bu):r.domain().map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:s?s[d]:d,index:f,offset:u}:null}).filter(Bu)}},slt=Xe([Fi,_P,O9,TP,gpe,mpe,El],nCr),alt=Xe(hu,O9,(e,t)=>{if(!(e==null||t==null))return y4(y4({},e),{},{scale:t})}),sCr=Xe([hu,cC,fpe,Kot],ope),aCr=Xe([sCr],Lhe);Xe((e,t,r)=>lpe(e,r),aCr,(e,t)=>{if(!(e==null||t==null))return y4(y4({},e),{},{scale:t})});var iCr=Xe([Fi,t9,r9],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),oCr=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Xe([oCr],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,s=e[0];for(var a of e){var i=Math.abs(a.coordinate-t);i<n&&(n=i,s=a)}return(r=s)===null||r===void 0?void 0:r.value}});var ilt=e=>e.options.defaultTooltipEventType,olt=e=>e.options.validateTooltipEventTypes;function llt(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function ype(e,t){var r=ilt(e),n=olt(e);return llt(t,r,n)}function lCr(e){return en(t=>ype(t,e))}var clt=(e,t)=>{var r,n=Number(t);if(!(Yy(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},cCr=e=>e.tooltip.settings,jb={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},uCr={itemInteraction:{click:jb,hover:jb},axisInteraction:{click:jb,hover:jb},keyboardInteraction:jb,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},ult=jc({name:"tooltip",initialState:uCr,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:li()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=fh(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:li()},removeTooltipEntrySettings:{reducer(e,t){var r=fh(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:li()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:dCr,replaceTooltipEntrySettings:fCr,removeTooltipEntrySettings:hCr,setTooltipSettingsState:pCr,setActiveMouseOverItemIndex:mCr,mouseLeaveItem:mPn,mouseLeaveChart:dlt,setActiveClickItemIndex:gPn,setMouseOverAxisIndex:flt,setMouseClickAxisIndex:gCr,setSyncInteraction:Uae,setKeyboardInteraction:b4}=ult.actions,yCr=ult.reducer;function tAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function HD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tAe(Object(r),!0).forEach(function(n){vCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vCr(e,t,r){return(t=bCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bCr(e){var t=xCr(e,"string");return typeof t=="symbol"?t:t+""}function xCr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wCr(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function SCr(e){return e.index!=null}var hlt=(e,t,r,n)=>{if(t==null)return jb;var s=wCr(e,t,r);if(s==null)return jb;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(SCr(s)){if(a)return HD(HD({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return HD(HD({},jb),{},{coordinate:s.coordinate})};function OCr(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function kCr(e,t){var r=OCr(e),n=t[0],s=t[1];if(r===void 0)return!1;var a=Math.min(n,s),i=Math.max(n,s);return r>=a&&r<=i}function _Cr(e,t,r){if(r==null||t==null)return!0;var n=Yl(e,t);return n==null||!Gm(r)?!0:kCr(n,r)}var vpe=(e,t,r,n)=>{var s=e?.index;if(s==null)return null;var a=Number(s);if(!zs(a))return s;var i=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(i,Math.min(a,l)),u=t[c];return u==null||_Cr(u,r,n)?String(c):null},plt=(e,t,r,n,s,a,i)=>{if(a!=null){var l=i[0],c=l?.getPosition(a);if(c!=null)return c;var u=s?.[Number(a)];if(u)return r==="horizontal"?{x:u.coordinate,y:(n.top+t)/2}:{x:(n.left+e)/2,y:u.coordinate}}},mlt=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&s==null)return e.tooltipItemPayloads;if(s==null&&n!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(i=>{var l;return((l=i.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},glt=e=>e.options.tooltipPayloadSearcher,uC=e=>e.tooltip;function rAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function nAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rAe(Object(r),!0).forEach(function(n){ECr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ECr(e,t,r){return(t=CCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CCr(e){var t=jCr(e,"string");return typeof t=="symbol"?t:t+""}function jCr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TCr(e){if(typeof e=="string"||typeof e=="number")return e}function NCr(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function ACr(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function sAe(e){if(typeof e=="string")return e}function ICr(e){if(!(e==null||typeof e!="object")){var t="name"in e?TCr(e.name):void 0,r="unit"in e?NCr(e.unit):void 0,n="dataKey"in e?ACr(e.dataKey):void 0,s="payload"in e?e.payload:void 0,a="color"in e?sAe(e.color):void 0,i="fill"in e?sAe(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:s,color:a,fill:i}}}function RCr(e,t){return e??t}var ylt=(e,t,r,n,s,a,i)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=r,f=[];return e.reduce((h,p)=>{var m,{dataDefinedOnItem:g,settings:y}=p,x=RCr(g,l),w=Array.isArray(x)?Bat(x,u,d):x,S=(m=y?.dataKey)!==null&&m!==void 0?m:n,k=y?.nameKey,_;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&i==="axis"?_=Jst(w,n,s):_=a(w,t,c,k),Array.isArray(_))_.forEach(T=>{var j,N,I=ICr(T),P=I?.name,R=I?.dataKey,B=I?.payload,M=nAe(nAe({},y),{},{name:P,unit:I?.unit,color:(j=I?.color)!==null&&j!==void 0?j:y?.color,fill:(N=I?.fill)!==null&&N!==void 0?N:y?.fill});h.push(rTe({tooltipEntrySettings:M,dataKey:R,payload:B,value:Yl(B,R),name:P==null?void 0:String(P)}))});else{var E;h.push(rTe({tooltipEntrySettings:y,dataKey:S,payload:_,value:Yl(_,S),name:(E=Yl(_,k))!==null&&E!==void 0?E:y?.name}))}return h},f)}},bpe=Xe([al,Eot,Nhe],Sot),PCr=Xe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),MCr=Xe([Cl,oC],Cot),dC=Xe([PCr,al,MCr],Tot,{memoizeOptions:{resultEqualityCheck:g9}}),DCr=Xe([dC],e=>e.filter(Dhe)),LCr=Xe([dC],Iot,{memoizeOptions:{resultEqualityCheck:g9}}),fC=Xe([LCr,s0],Rot),$Cr=Xe([DCr,s0,al],Fit),xpe=Xe([fC,al,dC],Pot),vlt=Xe([al],upe),FCr=Xe([al],e=>e.allowDataOverflow),blt=Xe([vlt,FCr],xit),zCr=Xe([dC],e=>e.filter(Dhe)),BCr=Xe([$Cr,zCr,u9,Ait],Dot),UCr=Xe([BCr,s0,Cl,blt],Lot),VCr=Xe([dC],Aot),qCr=Xe([fC,al,VCr,dpe,Cl],zot,{memoizeOptions:{resultEqualityCheck:m9}}),HCr=Xe([Bot,Cl,oC],lC),QCr=Xe([HCr,Cl],qot),WCr=Xe([Uot,Cl,oC],lC),GCr=Xe([WCr,Cl],Hot),ZCr=Xe([Vot,Cl,oC],lC),YCr=Xe([ZCr,Cl],Qot),XCr=Xe([QCr,YCr,GCr],v4),KCr=Xe([al,vlt,blt,UCr,qCr,XCr,Fi,Cl],Wot),NP=Xe([al,Fi,fC,xpe,u9,Cl,KCr],Got),JCr=Xe([NP,al,bpe],Zot),ejr=Xe([al,NP,JCr,Cl],Yot),xlt=e=>{var t=Cl(e),r=oC(e),n=!1;return TP(e,t,r,n)},wlt=Xe([al,xlt],d9),tjr=Xe([al,bpe,ejr,wlt],ope),Slt=Xe([tjr],Lhe),rjr=Xe([Fi,xpe,al,Cl],rlt),njr=Xe([Fi,xpe,al,Cl],Jot),sjr=(e,t,r,n,s,a,i,l)=>{if(t){var{type:c}=t,u=gv(e,l);if(n){var d=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/d:0;return f=l==="angleAxis"&&s!=null&&s?.length>=2?dh(s[0]-s[1])*2*f:f,u&&i?i.map((h,p)=>{var m=n.map(h);return zs(m)?{coordinate:m+f,value:h,index:p,offset:f}:null}).filter(Bu):n.domain().map((h,p)=>{var m=n.map(h);return zs(m)?{coordinate:m+f,value:a?a[h]:h,index:p,offset:f}:null}).filter(Bu)}}},Sv=Xe([Fi,al,bpe,Slt,xlt,rjr,njr,Cl],sjr),wpe=Xe([ilt,olt,cCr],(e,t,r)=>llt(r.shared,e,t)),Olt=e=>e.tooltip.settings.trigger,Spe=e=>e.tooltip.settings.defaultIndex,AP=Xe([uC,wpe,Olt,Spe],hlt),lI=Xe([AP,fC,jP,NP],vpe),klt=Xe([Sv,lI],clt),ajr=Xe([AP],e=>{if(e)return e.dataKey}),ijr=Xe([AP],e=>{if(e)return e.graphicalItemId}),_lt=Xe([uC,wpe,Olt,Spe],mlt),ojr=Xe([yv,vv,Fi,ec,Sv,Spe,_lt],plt),ljr=Xe([AP,ojr],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),cjr=Xe([AP],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),ujr=Xe([_lt,lI,s0,jP,klt,glt,wpe],ylt),djr=Xe([ujr],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function aAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function iAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aAe(Object(r),!0).forEach(function(n){fjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fjr(e,t,r){return(t=hjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hjr(e){var t=pjr(e,"string");return typeof t=="symbol"?t:t+""}function pjr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mjr=()=>en(al),gjr=()=>{var e=mjr(),t=en(Sv),r=en(Slt);return Z5(!e||!r?void 0:iAe(iAe({},e),{},{scale:r}),t)};function oAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function kO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oAe(Object(r),!0).forEach(function(n){yjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yjr(e,t,r){return(t=vjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vjr(e){var t=bjr(e,"string");return typeof t=="symbol"?t:t+""}function bjr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xjr=(e,t,r,n)=>{var s=t.find(a=>a&&a.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:s.coordinate}}return{x:0,y:0}},wjr=(e,t,r,n)=>{var s=t.find(u=>u&&u.index===r);if(s){if(e==="centric"){var a=s.coordinate,{radius:i}=n;return kO(kO(kO({},n),Hl(n.cx,n.cy,i,a)),{},{angle:a,radius:i})}var l=s.coordinate,{angle:c}=n;return kO(kO(kO({},n),Hl(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Sjr(e,t){var{relativeX:r,relativeY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var Elt=(e,t,r,n,s)=>{var a,i=(a=t?.length)!==null&&a!==void 0?a:0;if(i<=1||e==null)return 0;if(n==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=0;l<i;l++){var c,u,d,f,h,p=l>0?(c=r[l-1])===null||c===void 0?void 0:c.coordinate:(u=r[i-1])===null||u===void 0?void 0:u.coordinate,m=(d=r[l])===null||d===void 0?void 0:d.coordinate,g=l>=i-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(h=r[l+1])===null||h===void 0?void 0:h.coordinate,y=void 0;if(!(p==null||m==null||g==null))if(dh(m-p)!==dh(g-m)){var x=[];if(dh(g-m)===dh(s[1]-s[0])){y=g;var w=m+s[1]-s[0];x[0]=Math.min(w,(w+p)/2),x[1]=Math.max(w,(w+p)/2)}else{y=p;var S=g+s[1]-s[0];x[0]=Math.min(m,(S+m)/2),x[1]=Math.max(m,(S+m)/2)}var k=[Math.min(m,(y+m)/2),Math.max(m,(y+m)/2)];if(e>k[0]&&e<=k[1]||e>=x[0]&&e<=x[1]){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}else{var E=Math.min(p,g),T=Math.max(p,g);if(e>(E+m)/2&&e<=(T+m)/2){var j;return(j=r[l])===null||j===void 0?void 0:j.index}}}else if(t)for(var N=0;N<i;N++){var I=t[N];if(I!=null){var P=t[N+1],R=t[N-1];if(N===0&&P!=null&&e<=(I.coordinate+P.coordinate)/2||N===i-1&&R!=null&&e>(I.coordinate+R.coordinate)/2||N>0&&N<i-1&&R!=null&&P!=null&&e>(I.coordinate+R.coordinate)/2&&e<=(I.coordinate+P.coordinate)/2)return I.index}}return-1},Ojr=()=>en(Nhe),Ope=(e,t)=>t,Clt=(e,t,r)=>r,kpe=(e,t,r,n)=>n,kjr=Xe(Sv,e=>Hz(e,t=>t.coordinate)),_pe=Xe([uC,Ope,Clt,kpe],hlt),Epe=Xe([_pe,fC,jP,NP],vpe),_jr=(e,t,r)=>{if(t!=null){var n=uC(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},jlt=Xe([uC,Ope,Clt,kpe],mlt),x4=Xe([yv,vv,Fi,ec,Sv,kpe,jlt],plt),Ejr=Xe([_pe,x4],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Tlt=Xe([Sv,Epe],clt),Cjr=Xe([jlt,Epe,s0,jP,Tlt,glt,Ope],ylt),jjr=Xe([_pe,Epe],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Tjr=(e,t,r,n,s,a,i)=>{if(!(!e||!r||!n||!s)&&Sjr(e,i)){var l=Rwr(e,t),c=Elt(l,a,s,r,n),u=xjr(t,s,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Njr=(e,t,r,n,s,a,i)=>{if(!(!e||!n||!s||!a||!r)){var l=G1r(e,r);if(l){var c=Pwr(l,t),u=Elt(c,i,a,n,s),d=wjr(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},Ajr=(e,t,r,n,s,a,i,l)=>{if(!(!e||!t||!n||!s||!a))return t==="horizontal"||t==="vertical"?Tjr(e,t,n,s,a,i,l):Njr(e,t,r,n,s,a,i)},Ijr=Xe(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),Rjr=Xe(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Yc)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:yOr}});function lAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lAe(Object(r),!0).forEach(function(n){Pjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pjr(e,t,r){return(t=Mjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mjr(e){var t=Djr(e,"string");return typeof t=="symbol"?t:t+""}function Djr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ljr={},$jr={zIndexMap:Object.values(Yc).reduce((e,t)=>cAe(cAe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Ljr)},Fjr=new Set(Object.values(Yc));function zjr(e){return Fjr.has(e)}var Nlt=jc({name:"zIndex",initialState:$jr,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:li()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!zjr(r)&&delete e.zIndexMap[r])},prepare:li()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:s?void 0:n,panoramaElement:s?n:void 0}},prepare:li()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:li()}}}),{registerZIndexPortal:Bjr,unregisterZIndexPortal:Ujr,registerZIndexPortalElement:Vjr,unregisterZIndexPortalElement:qjr}=Nlt.actions,Hjr=Nlt.reducer;function Ov(e){var{zIndex:t,children:r}=e,n=hSr(),s=n&&t!==void 0&&t!==0,a=od(),i=Vo();b.useLayoutEffect(()=>s?(i(Bjr({zIndex:t})),()=>{i(Ujr({zIndex:t}))}):y1,[i,t,s]);var l=en(c=>Ijr(c,t,a));return s?l?du.createPortal(r,l):null:r}function Vae(){return Vae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vae.apply(null,arguments)}function uAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function QD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uAe(Object(r),!0).forEach(function(n){Qjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qjr(e,t,r){return(t=Wjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wjr(e){var t=Gjr(e,"string");return typeof t=="symbol"?t:t+""}function Gjr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zjr(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return b.isValidElement(t)?b.cloneElement(t,n):b.createElement(r,n)}function Yjr(e){var t,{coordinate:r,payload:n,index:s,offset:a,tooltipAxisBandSize:i,layout:l,cursor:c,tooltipEventType:u,chartName:d}=e,f=r,h=n,p=s;if(!c||!f||d!=="ScatterChart"&&u!=="axis")return null;var m,g,y;if(d==="ScatterChart")m=f,g=l1r,y=Yc.cursorLine;else if(d==="BarChart")m=c1r(l,f,a,i),g=mit,y=Yc.cursorRectangle;else if(l==="radial"&&rat(f)){var{cx:x,cy:w,radius:S,startAngle:k,endAngle:_}=git(f);m={cx:x,cy:w,startAngle:k,endAngle:_,innerRadius:S,outerRadius:S},g=vit,y=Yc.cursorLine}else m={points:K1r(l,f,a)},g=uit,y=Yc.cursorLine;var E=typeof c=="object"&&"className"in c?c.className:void 0,T=QD(QD(QD(QD({stroke:"#ccc",pointerEvents:"none"},a),m),zz(c)),{},{payload:h,payloadIndex:p,className:ba("recharts-tooltip-cursor",E)});return b.createElement(Ov,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},b.createElement(Zjr,{cursor:c,cursorComp:g,cursorProps:T}))}function Xjr(e){var t=gjr(),r=Yat(),n=sC(),s=Ojr();return t==null||r==null||n==null||s==null?null:b.createElement(Yjr,Vae({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var Alt=b.createContext(null),Kjr=()=>b.useContext(Alt),HH={exports:{}},dAe;function Jjr(){return dAe||(dAe=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,f||c,h),m=r?r+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function i(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,m){var g=r?r+u:u;if(!this._events[g])return!1;var y=this._events[g],x=arguments.length,w,S;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),x){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,p),!0;case 6:return y.fn.call(y.context,d,f,h,p,m),!0}for(S=1,w=new Array(x-1);S<x;S++)w[S-1]=arguments[S];y.fn.apply(y.context,w)}else{var k=y.length,_;for(S=0;S<k;S++)switch(y[S].once&&this.removeListener(u,y[S].fn,void 0,!0),x){case 1:y[S].fn.call(y[S].context);break;case 2:y[S].fn.call(y[S].context,d);break;case 3:y[S].fn.call(y[S].context,d,f);break;case 4:y[S].fn.call(y[S].context,d,f,h);break;default:if(!w)for(_=1,w=new Array(x-1);_<x;_++)w[_-1]=arguments[_];y[S].fn.apply(y[S].context,w)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return i(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&i(this,p);else{for(var g=0,y=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&y.push(m[g]);y.length?this._events[p]=y.length===1?y[0]:y:i(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&i(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(HH)),HH.exports}var eTr=Jjr();const tTr=Uo(eTr);var cI=new tTr,qae="recharts.syncEvent.tooltip",fAe="recharts.syncEvent.brush",rTr=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Yy(r))return e[r]}},nTr={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Ilt=jc({name:"options",initialState:nTr,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),sTr=Ilt.reducer,{createEventEmitter:aTr}=Ilt.actions;function iTr(e){return e.tooltip.syncInteraction}var oTr={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Rlt=jc({name:"chartData",initialState:oTr,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:hAe,setDataStartEndIndexes:lTr,setComputedData:yPn}=Rlt.actions,cTr=Rlt.reducer,uTr=["x","y"];function pAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _O(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pAe(Object(r),!0).forEach(function(n){dTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dTr(e,t,r){return(t=fTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fTr(e){var t=hTr(e,"string");return typeof t=="symbol"?t:t+""}function hTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pTr(e,t){if(e==null)return{};var r,n,s=mTr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function mTr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function gTr(){var e=en(Ahe),t=en(Ihe),r=Vo(),n=en(Iit),s=en(Sv),a=sC(),i=a9(),l=en(c=>c.rootProps.className);b.useEffect(()=>{if(e==null)return y1;var c=(u,d,f)=>{if(t!==f&&e===u){if(n==="index"){var h;if(i&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var p=d.payload.coordinate,{x:m,y:g}=p,y=pTr(p,uTr),{x,y:w,width:S,height:k}=d.payload.sourceViewBox,_=_O(_O({},y),{},{x:i.x+(S?(m-x)/S:0)*i.width,y:i.y+(k?(g-w)/k:0)*i.height});r(_O(_O({},d),{},{payload:_O(_O({},d.payload),{},{coordinate:_})}))}else r(d);return}if(s!=null){var E;if(typeof n=="function"){var T={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},j=n(s,T);E=s[j]}else n==="value"&&(E=s.find(U=>String(U.value)===d.payload.label));var{coordinate:N}=d.payload;if(E==null||d.payload.active===!1||N==null||i==null){r(Uae({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:P}=N,R=Math.min(I,i.x+i.width),B=Math.min(P,i.y+i.height),M={x:a==="horizontal"?E.coordinate:R,y:a==="horizontal"?B:E.coordinate},F=Uae({active:d.payload.active,coordinate:M,dataKey:d.payload.dataKey,index:String(E.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});r(F)}}};return cI.on(qae,c),()=>{cI.off(qae,c)}},[l,r,t,e,n,s,a,i])}function yTr(){var e=en(Ahe),t=en(Ihe),r=Vo();b.useEffect(()=>{if(e==null)return y1;var n=(s,a,i)=>{t!==i&&e===s&&r(lTr(a))};return cI.on(fAe,n),()=>{cI.off(fAe,n)}},[r,t,e])}function vTr(){var e=Vo();b.useEffect(()=>{e(aTr())},[e]),gTr(),yTr()}function bTr(e,t,r,n,s,a){var i=en(m=>_jr(m,e,t)),l=en(ijr),c=en(Ihe),u=en(Ahe),d=en(Iit),f=en(iTr),h=f?.active,p=a9();b.useEffect(()=>{if(!h&&u!=null&&c!=null){var m=Uae({active:a,coordinate:r,dataKey:i,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:p,graphicalItemId:l});cI.emit(qae,u,m,c)}},[h,r,i,l,s,n,c,u,d,a,p])}function mAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function gAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mAe(Object(r),!0).forEach(function(n){xTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xTr(e,t,r){return(t=wTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wTr(e){var t=STr(e,"string");return typeof t=="symbol"?t:t+""}function STr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OTr(e){return e.dataKey}function kTr(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(LSr,t)}var yAe=[],_Tr={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function ETr(e){var t,r,n=id(e,_Tr),{active:s,allowEscapeViewBox:a,animationDuration:i,animationEasing:l,content:c,filterNull:u,isAnimationActive:d,offset:f,payloadUniqBy:h,position:p,reverseDirection:m,useTranslate3d:g,wrapperStyle:y,cursor:x,shared:w,trigger:S,defaultIndex:k,portal:_,axisId:E}=n,T=Vo(),j=typeof k=="number"?String(k):k;b.useEffect(()=>{T(pCr({shared:w,trigger:S,axisId:E,active:s,defaultIndex:j}))},[T,w,S,E,s,j]);var N=a9(),I=cit(),P=lCr(w),{activeIndex:R,isActive:B}=(t=en(te=>jjr(te,P,S,j)))!==null&&t!==void 0?t:{},M=en(te=>Cjr(te,P,S,j)),F=en(te=>Tlt(te,P,S,j)),U=en(te=>Ejr(te,P,S,j)),z=M,H=Kjr(),Q=(r=s??B)!==null&&r!==void 0?r:!1,[L,Z]=_0r([z,Q]),V=P==="axis"?F:void 0;bTr(P,S,U,V,R,Q);var D=_??H;if(D==null||N==null||P==null)return null;var W=z??yAe;Q||(W=yAe),u&&W.length&&(W=f0r(W.filter(te=>te.value!=null&&(te.hide!==!0||n.includeHidden)),h,OTr));var G=W.length>0,J=gAe(gAe({},n),{},{payload:W,label:V,active:Q,activeIndex:R,coordinate:U,accessibilityLayer:I}),ae=b.createElement(GSr,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:Q,coordinate:U,hasPayload:G,offset:f,position:p,reverseDirection:m,useTranslate3d:g,viewBox:N,wrapperStyle:y,lastBoundingBox:L,innerRef:Z,hasPortalFromProps:!!_},kTr(c,J));return b.createElement(b.Fragment,null,du.createPortal(ae,D),Q&&b.createElement(Xjr,{cursor:x,tooltipEventType:P,coordinate:U,payload:W,index:R}))}function CTr(e,t,r){return(t=jTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jTr(e){var t=TTr(e,"string");return typeof t=="symbol"?t:t+""}function TTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class NTr{constructor(t){CTr(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function vAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ATr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vAe(Object(r),!0).forEach(function(n){ITr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ITr(e,t,r){return(t=RTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RTr(e){var t=PTr(e,"string");return typeof t=="symbol"?t:t+""}function PTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MTr={cacheSize:2e3,enableCache:!0},Plt=ATr({},MTr),bAe=new NTr(Plt.cacheSize),DTr={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},xAe="recharts_measurement_span";function LTr(e,t){var r=t.fontSize||"",n=t.fontFamily||"",s=t.fontWeight||"",a=t.fontStyle||"",i=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(s,"|").concat(a,"|").concat(i,"|").concat(l)}var wAe=(e,t)=>{try{var r=document.getElementById(xAe);r||(r=document.createElement("span"),r.setAttribute("id",xAe),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,DTr,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},NN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||xP.isSsr)return{width:0,height:0};if(!Plt.enableCache)return wAe(t,r);var n=LTr(t,r),s=bAe.get(n);if(s)return s;var a=wAe(t,r);return bAe.set(n,a),a},Mlt;function $Tr(e,t,r){return(t=FTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FTr(e){var t=zTr(e,"string");return typeof t=="symbol"?t:t+""}function zTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,OAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,BTr=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,UTr=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,VTr={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},qTr=["cm","mm","pt","pc","in","Q","px"];function HTr(e){return qTr.includes(e)}var yk="NaN";function QTr(e,t){return e*VTr[t]}class Dl{static parse(t){var r,[,n,s]=(r=UTr.exec(t))!==null&&r!==void 0?r:[];return n==null?Dl.NaN:new Dl(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Yy(t)&&(this.unit=""),r!==""&&!BTr.test(r)&&(this.num=NaN,this.unit=""),HTr(r)&&(this.num=QTr(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new Dl(NaN,""):new Dl(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Dl(NaN,""):new Dl(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Dl(NaN,""):new Dl(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Dl(NaN,""):new Dl(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Yy(this.num)}}Mlt=Dl;$Tr(Dl,"NaN",new Mlt(NaN,""));function Dlt(e){if(e==null||e.includes(yk))return yk;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,a]=(r=SAe.exec(t))!==null&&r!==void 0?r:[],i=Dl.parse(n??""),l=Dl.parse(a??""),c=s==="*"?i.multiply(l):i.divide(l);if(c.isNaN())return yk;t=t.replace(SAe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=OAe.exec(t))!==null&&u!==void 0?u:[],p=Dl.parse(d??""),m=Dl.parse(h??""),g=f==="+"?p.add(m):p.subtract(m);if(g.isNaN())return yk;t=t.replace(OAe,g.toString())}return t}var kAe=/\(([^()]*)\)/;function WTr(e){for(var t=e,r;(r=kAe.exec(t))!=null;){var[,n]=r;t=t.replace(kAe,Dlt(n))}return t}function GTr(e){var t=e.replace(/\s+/g,"");return t=WTr(t),t=Dlt(t),t}function ZTr(e){try{return GTr(e)}catch{return yk}}function QH(e){var t=ZTr(e.slice(5,-1));return t===yk?"":t}var YTr=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],XTr=["dx","dy","angle","className","breakAll"];function Hae(){return Hae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hae.apply(null,arguments)}function _Ae(e,t){if(e==null)return{};var r,n,s=KTr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function KTr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Llt=/[ \f\n\r\t\v\u2028\u2029]+/,$lt=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];kl(t)||(r?s=t.toString().split(""):s=t.toString().split(Llt));var a=s.map(l=>({word:l,width:NN(l,n).width})),i=r?0:NN(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}};function Flt(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function JTr(e){return kl(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var zlt=(e,t,r,n)=>e.reduce((s,a)=>{var{word:i,width:l}=a,c=s[s.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(i),c.width+=l+r;else{var u={words:[i],width:l};s.push(u)}return s},[]),Blt=e=>e.reduce((t,r)=>t.width>r.width?t:r),eNr="…",EAe=(e,t,r,n,s,a,i,l)=>{var c=e.slice(0,t),u=$lt({breakAll:r,style:n,children:c+eNr});if(!u)return[!1,[]];var d=zlt(u.wordsWithComputedWidth,a,i,l),f=d.length>s||Blt(d).width>Number(a);return[f,d]},tNr=(e,t,r,n,s)=>{var{maxLines:a,children:i,style:l,breakAll:c}=e,u=qr(a),d=String(i),f=zlt(t,n,r,s);if(!u||s)return f;var h=f.length>a||Blt(f).width>Number(n);if(!h)return f;for(var p=0,m=d.length-1,g=0,y;p<=m&&g<=d.length-1;){var x=Math.floor((p+m)/2),w=x-1,[S,k]=EAe(d,w,c,l,a,n,r,s),[_]=EAe(d,x,c,l,a,n,r,s);if(!S&&!_&&(p=x+1),S&&_&&(m=x-1),!S&&_){y=k;break}g++}return y||f},CAe=e=>{var t=kl(e)?[]:e.toString().split(Llt);return[{words:t,width:void 0}]},rNr=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:a,maxLines:i}=e;if((t||r)&&!xP.isSsr){var l,c,u=$lt({breakAll:a,children:n,style:s});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return CAe(n);return tNr({breakAll:a,children:n,maxLines:i,style:s},l,c,t,!!r)}return CAe(n)},Ult="#808080",nNr={angle:0,breakAll:!1,capHeight:"0.71em",fill:Ult,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Cpe=b.forwardRef((e,t)=>{var r=id(e,nNr),{x:n,y:s,lineHeight:a,capHeight:i,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=r,f=_Ae(r,YTr),h=b.useMemo(()=>rNr({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:p,dy:m,angle:g,className:y,breakAll:x}=f,w=_Ae(f,XTr);if(!sg(n)||!sg(s)||h.length===0)return null;var S=Number(n)+(qr(p)?p:0),k=Number(s)+(qr(m)?m:0);if(!zs(S)||!zs(k))return null;var _;switch(d){case"start":_=QH("calc(".concat(i,")"));break;case"middle":_=QH("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(i," / 2))"));break;default:_=QH("calc(".concat(h.length-1," * -").concat(a,")"));break}var E=[],T=h[0];if(c&&T!=null){var j=T.width,{width:N}=f;E.push("scale(".concat(qr(N)&&qr(j)?N/j:1,")"))}return g&&E.push("rotate(".concat(g,", ").concat(S,", ").concat(k,")")),E.length&&(w.transform=E.join(" ")),b.createElement("text",Hae({},iu(w),{ref:t,x:S,y:k,className:ba("recharts-text",y),textAnchor:u,fill:l.includes("url")?Ult:l}),h.map((I,P)=>{var R=I.words.join(x?"":" ");return b.createElement("tspan",{x:S,dy:P===0?_:a,key:"".concat(R,"-").concat(P)},R)}))});Cpe.displayName="Text";function jAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function om(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jAe(Object(r),!0).forEach(function(n){sNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sNr(e,t,r){return(t=aNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aNr(e){var t=iNr(e,"string");return typeof t=="symbol"?t:t+""}function iNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oNr=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:a,y:i,height:l,upperWidth:c,lowerWidth:u}=whe(t),d=a,f=a+(c-u)/2,h=(d+f)/2,p=(c+u)/2,m=d+c/2,g=l>=0?1:-1,y=g*n,x=g>0?"end":"start",w=g>0?"start":"end",S=c>=0?1:-1,k=S*n,_=S>0?"end":"start",E=S>0?"start":"end",T=s;if(r==="top"){var j={x:d+c/2,y:i-y,horizontalAnchor:"middle",verticalAnchor:x};return T&&(j.height=Math.max(i-T.y,0),j.width=c),j}if(r==="bottom"){var N={x:f+u/2,y:i+l+y,horizontalAnchor:"middle",verticalAnchor:w};return T&&(N.height=Math.max(T.y+T.height-(i+l),0),N.width=u),N}if(r==="left"){var I={x:h-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(r==="right"){var P={x:h+p+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"};return T&&(P.width=Math.max(T.x+T.width-P.x,0),P.height=l),P}var R=T?{width:p,height:l}:{};return r==="insideLeft"?om({x:h+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideRight"?om({x:h+p-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"},R):r==="insideTop"?om({x:d+c/2,y:i+y,horizontalAnchor:"middle",verticalAnchor:w},R):r==="insideBottom"?om({x:f+u/2,y:i+l-y,horizontalAnchor:"middle",verticalAnchor:x},R):r==="insideTopLeft"?om({x:d+k,y:i+y,horizontalAnchor:E,verticalAnchor:w},R):r==="insideTopRight"?om({x:d+c-k,y:i+y,horizontalAnchor:_,verticalAnchor:w},R):r==="insideBottomLeft"?om({x:f+k,y:i+l-y,horizontalAnchor:E,verticalAnchor:x},R):r==="insideBottomRight"?om({x:f+u-k,y:i+l-y,horizontalAnchor:_,verticalAnchor:x},R):r&&typeof r=="object"&&(qr(r.x)||ES(r.x))&&(qr(r.y)||ES(r.y))?om({x:a+Ex(r.x,p),y:i+Ex(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):om({x:m,y:i+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},lNr=["labelRef"],cNr=["content"];function TAe(e,t){if(e==null)return{};var r,n,s=uNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function uNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function NAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function QT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NAe(Object(r),!0).forEach(function(n){dNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dNr(e,t,r){return(t=fNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fNr(e){var t=hNr(e,"string");return typeof t=="symbol"?t:t+""}function hNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_y.apply(null,arguments)}var Vlt=b.createContext(null),pNr=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:a,height:i,children:l}=e,c=b.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:a,height:i}),[t,r,n,s,a,i]);return b.createElement(Vlt.Provider,{value:c},l)},qlt=()=>{var e=b.useContext(Vlt),t=a9();return e||(t?whe(t):void 0)},mNr=b.createContext(null),gNr=()=>{var e=b.useContext(mNr),t=en(Lit);return e||t},yNr=e=>{var{value:t,formatter:r}=e,n=kl(e.children)?t:e.children;return typeof r=="function"?r(n):n},jpe=e=>e!=null&&typeof e=="function",vNr=(e,t)=>{var r=dh(t-e),n=Math.min(Math.abs(t-e),360);return r*n},bNr=(e,t,r,n,s)=>{var{offset:a,className:i}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:h,clockWise:p}=s,m=(u+d)/2,g=vNr(f,h),y=g>=0?1:-1,x,w;switch(t){case"insideStart":x=f+y*a,w=p;break;case"insideEnd":x=h-y*a,w=!p;break;case"end":x=h+y*a,w=p;break;default:throw new Error("Unsupported position ".concat(t))}w=g<=0?w:!w;var S=Hl(l,c,m,x),k=Hl(l,c,m,x+(w?1:-1)*359),_="M".concat(S.x,",").concat(S.y,`
289
289
  A`).concat(m,",").concat(m,",0,1,").concat(w?0:1,`,
290
- `).concat(k.x,",").concat(k.y),E=kl(e.id)?YA("recharts-radial-line-"):e.id;return b.createElement("text",_y({},n,{dominantBaseline:"central",className:ba("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},xNr=(e,t,r)=>{var{cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(r==="outside"){var{x:d,y:f}=Hl(n,s,i+t,u);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(a+i)/2,{x:p,y:m}=Hl(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},_$=e=>e!=null&&"cx"in e&&qr(e.cx),wNr={angle:0,offset:5,zIndex:Yc.label,position:"middle",textBreakAll:!1};function SNr(e){if(!_$(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function Ob(e){var t=id(e,wNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=gNr(),h=qlt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:_$(r)?m=r:m=whe(r);var x=SNr(m);if(!m||kl(a)&&kl(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=QT(QT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=TAe(w,lNr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=TAe(w,cNr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=yNr(t);var T=iu(t);if(_$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return bNr(t,s,g,T,m);y=xNr(m,t.offset,t.position)}else{if(!x)return null;var j=oNr({viewBox:x,position:s,offset:t.offset,parentViewBox:_$(n)?void 0:n});y=QT(QT({x:j.x,y:j.y,textAnchor:j.horizontalAnchor,verticalAnchor:j.verticalAnchor},j.width!==void 0?{width:j.width}:{}),j.height!==void 0?{height:j.height}:{})}return b.createElement(Ov,{zIndex:t.zIndex},b.createElement(Cpe,_y({ref:d,className:ba("recharts-label",c)},T,y,{textAnchor:Flt(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}Ob.displayName="Label";var ONr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(Ob,_y({key:"label-implicit"},n)):sg(e)?b.createElement(Ob,_y({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===Ob?b.cloneElement(e,QT({key:"label-implicit"},n)):b.createElement(Ob,_y({key:"label-implicit",content:e},n)):jpe(e)?b.createElement(Ob,_y({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(Ob,_y({},e,{key:"label-implicit"},n)):null};function kNr(e){var{label:t,labelRef:r}=e,n=qlt();return ONr(t,n,r)||null}var _Nr=["valueAccessor"],ENr=["dataKey","clockWise","id","textBreakAll","zIndex"];function w4(){return w4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w4.apply(null,arguments)}function AAe(e,t){if(e==null)return{};var r,n,s=CNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function CNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var jNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(JTr(t))return t},Hlt=b.createContext(void 0),TNr=Hlt.Provider,Qlt=b.createContext(void 0);Qlt.Provider;function NNr(){return b.useContext(Hlt)}function ANr(){return b.useContext(Qlt)}function E$(e){var{valueAccessor:t=jNr}=e,r=AAe(e,_Nr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=AAe(r,ENr),u=NNr(),d=ANr(),f=u||d;return!f||!f.length?null:b.createElement(Ov,{zIndex:l??Yc.label},b.createElement(Zy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=kl(n)?t(h,p):Yl(h.payload,n),y=kl(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(Ob,w4({key:"label-".concat(p)},iu(h),c,y,{fill:(m=r.fill)!==null&&m!==void 0?m:h.fill,parentViewBox:h.parentViewBox,value:g,textBreakAll:i,viewBox:h.viewBox,index:p,zIndex:0}))})))}E$.displayName="LabelList";function INr(e){var{label:t}=e;return t?t===!0?b.createElement(E$,{key:"labelList-implicit"}):b.isValidElement(t)||jpe(t)?b.createElement(E$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(E$,w4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Qae(){return Qae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qae.apply(null,arguments)}var Wlt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=ba("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Qae({},ng(e),fhe(e),{className:a,cx:t,cy:r,r:n})):null},RNr={radiusAxis:{},angleAxis:{}},Glt=jc({name:"polarAxis",initialState:RNr,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:vPn,removeRadiusAxis:bPn,addAngleAxis:xPn,removeAngleAxis:wPn}=Glt.actions,PNr=Glt.reducer;function MNr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WH={exports:{}},Ks={};var IAe;function DNr(){if(IAe)return Ks;IAe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case r:case s:case n:case u:case d:return y;default:switch(y=y&&y.$$typeof,y){case l:case i:case c:case h:case f:case a:return y;default:return x}}case t:return x}}}return Ks.ContextConsumer=i,Ks.ContextProvider=a,Ks.Element=e,Ks.ForwardRef=c,Ks.Fragment=r,Ks.Lazy=h,Ks.Memo=f,Ks.Portal=t,Ks.Profiler=s,Ks.StrictMode=n,Ks.Suspense=u,Ks.SuspenseList=d,Ks.isAsyncMode=function(){return!1},Ks.isConcurrentMode=function(){return!1},Ks.isContextConsumer=function(y){return g(y)===i},Ks.isContextProvider=function(y){return g(y)===a},Ks.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ks.isForwardRef=function(y){return g(y)===c},Ks.isFragment=function(y){return g(y)===r},Ks.isLazy=function(y){return g(y)===h},Ks.isMemo=function(y){return g(y)===f},Ks.isPortal=function(y){return g(y)===t},Ks.isProfiler=function(y){return g(y)===s},Ks.isStrictMode=function(y){return g(y)===n},Ks.isSuspense=function(y){return g(y)===u},Ks.isSuspenseList=function(y){return g(y)===d},Ks.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===u||y===d||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===a||y.$$typeof===i||y.$$typeof===c||y.$$typeof===m||y.getModuleId!==void 0)},Ks.typeOf=g,Ks}var RAe;function LNr(){return RAe||(RAe=1,WH.exports=DNr()),WH.exports}LNr();var Zlt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,GH={},PAe;function $Nr(){return PAe||(PAe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(GH)),GH}var ZH,MAe;function FNr(){return MAe||(MAe=1,ZH=$Nr().isPlainObject),ZH}var zNr=FNr();const BNr=Uo(zNr);var DAe,LAe,$Ae,FAe,zAe;function BAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function UAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BAe(Object(r),!0).forEach(function(n){UNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UNr(e,t,r){return(t=VNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VNr(e){var t=qNr(e,"string");return typeof t=="symbol"?t:t+""}function qNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S4(){return S4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S4.apply(null,arguments)}function iT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var VAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(DAe||(DAe=iT(["M ",",",""])),e,t),i+=Qi(LAe||(LAe=iT(["L ",",",""])),e+r,t),i+=Qi($Ae||($Ae=iT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(FAe||(FAe=iT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(zAe||(zAe=iT(["L ",","," Z"])),e,t),i},HNr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},QNr=e=>{var t=id(e,HNr),{x:r,y:n,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,h=b.useRef(null),[p,m]=b.useState(-1),g=b.useRef(s),y=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=_he(e,"trapezoid-");if(b.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var M=h.current.getTotalLength();M&&m(M)}catch{}},[]),r!==+r||n!==+n||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var _=ba("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",S4({},iu(t),{className:_,d:VAe(r,n,s,a,i)})));var E=g.current,T=y.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(p===-1?1:p,"px"),R="".concat(p,"px ").concat(p,"px"),B=dit(["strokeDasharray"],u,c);return b.createElement(khe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},M=>{var F=Lu(E,s,M),U=Lu(T,a,M),z=Lu(j,i,M),H=Lu(N,r,M),Q=Lu(I,n,M);h.current&&(g.current=F,y.current=U,x.current=z,w.current=H,S.current=Q);var L=M>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",S4({},iu(t),{className:_,d:VAe(H,Q,F,U,z),ref:h,style:UAe(UAe({},L),t.style)}))})},WNr=["option","shapeType","activeClassName","inActiveClassName"];function GNr(e,t){if(e==null)return{};var r,n,s=ZNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ZNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function qAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function O4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qAe(Object(r),!0).forEach(function(n){YNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YNr(e,t,r){return(t=XNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XNr(e){var t=KNr(e,"string");return typeof t=="symbol"?t:t+""}function KNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JNr(e,t){return O4(O4({},t),e)}function eAr(e,t){return e==="symbols"}function HAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(mit,r);case"trapezoid":return b.createElement(QNr,r);case"sector":return b.createElement(vit,r);case"symbols":if(eAr(t))return b.createElement(tat,r);break;case"curve":return b.createElement(uit,r);default:return null}}function tAr(e){return b.isValidElement(e)?e.props:e}function rAr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=GNr(e,WNr),i;if(b.isValidElement(t))i=b.cloneElement(t,O4(O4({},a),tAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(BNr(t)&&typeof t!="boolean"){var l=JNr(t,a);i=b.createElement(HAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(HAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Zy,{className:n},i):b.createElement(Zy,{className:s},i)}function nAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=od(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(dCr(t)):s.current!==t&&r(fCr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(hCr(s.current)),s.current=null)},[r]),null}function sAr(e){var{legendPayload:t}=e,r=Vo(),n=od(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(ESr(t)):s.current!==t&&r(CSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(jSr(s.current)),s.current=null)},[r]),null}var YH,aAr=()=>{var[e]=b.useState(()=>YA("uid-"));return e},iAr=(YH=e1.useId)!==null&&YH!==void 0?YH:aAr;function oAr(e,t){var r=iAr();return t||(e?"".concat(e,"-").concat(r):r)}var lAr=b.createContext(void 0),cAr=e=>{var{id:t,type:r,children:n}=e,s=oAr("recharts-".concat(r),t);return b.createElement(lAr.Provider,{value:s},n(s))},uAr={cartesianItems:[],polarItems:[]},Ylt=jc({name:"graphicalItems",initialState:uAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:li()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=fh(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:li()},removeCartesianGraphicalItem:{reducer(e,t){var r=fh(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:li()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:li()},removePolarGraphicalItem:{reducer(e,t){var r=fh(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:li()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=fh(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:li()}}}),{addCartesianGraphicalItem:dAr,replaceCartesianGraphicalItem:fAr,removeCartesianGraphicalItem:hAr,addPolarGraphicalItem:SPn,removePolarGraphicalItem:OPn,replacePolarGraphicalItem:kPn}=Ylt.actions,pAr=Ylt.reducer,mAr=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(dAr(e)):r.current!==e&&t(fAr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(hAr(r.current)),r.current=null)},[t]),null},gAr=b.memo(mAr),yAr=["points"];function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){vAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vAr(e,t,r){return(t=bAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bAr(e){var t=xAr(e,"string");return typeof t=="symbol"?t:t+""}function xAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k4(){return k4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k4.apply(null,arguments)}function wAr(e,t){if(e==null)return{};var r,n,s=SAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function SAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function OAr(e){var{option:t,dotProps:r,className:n}=e;if(b.isValidElement(t))return b.cloneElement(t,r);if(typeof t=="function")return t(r);var s=ba(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=wAr(a,yAr);return b.createElement(Wlt,k4({},l,{className:s}))}function kAr(e,t){return e==null?!1:t?!0:e.length===1}function _Ar(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Yc.scatter}=e;if(!kAr(t,r))return null;var d=Zlt(r),f=Lbr(r),h=t.map((m,g)=>{var y,x,w=XH(XH(XH({r:3},i),f),{},{index:g,cx:(y=m.x)!==null&&y!==void 0?y:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return b.createElement(OAr,{key:"dot-".concat(g),option:r,dotProps:w,className:s})}),p={};return l&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(Ov,{zIndex:u},b.createElement(Zy,k4({className:n},p),h))}function WAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function GAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WAe(Object(r),!0).forEach(function(n){EAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EAr(e,t,r){return(t=CAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CAr(e){var t=jAr(e,"string");return typeof t=="symbol"?t:t+""}function jAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TAr={xAxis:{},yAxis:{},zAxis:{}},Xlt=jc({name:"cartesianAxis",initialState:TAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:li()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:li()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:li()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:li()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:li()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:li()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:li()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:li()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:li()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&n===i[1]&&n!==s.width&&Math.abs(n-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,n].slice(-3);e.yAxis[r]=GAe(GAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:NAr,replaceXAxis:AAr,removeXAxis:IAr,addYAxis:RAr,replaceYAxis:PAr,removeYAxis:MAr,addZAxis:_Pn,replaceZAxis:EPn,removeZAxis:CPn,updateYAxisWidth:DAr}=Xlt.actions,LAr=Xlt.reducer,$Ar=Xe([ec],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),FAr=Xe([$Ar,yv,vv],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Tpe=()=>en(FAr),zAr=()=>en(djr);function ZAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function KH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZAe(Object(r),!0).forEach(function(n){BAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BAr(e,t,r){return(t=UAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UAr(e){var t=VAr(e,"string");return typeof t=="symbol"?t:t+""}function VAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qAr=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KH(KH(KH({},l),zz(s)),fhe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Wlt,c),b.createElement(Zy,{className:"recharts-active-dot",clipPath:i},u)};function HAr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Yc.activeDot}=e,l=en(lI),c=zAr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return kl(u)?null:b.createElement(Ov,{zIndex:i},b.createElement(qAr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var QAr=e=>{var{chartData:t}=e,r=Vo(),n=od();return b.useEffect(()=>n?()=>{}:(r(hAe(t)),()=>{r(hAe(void 0))}),[t,r,n]),null},YAe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Klt=jc({name:"brush",initialState:YAe,reducers:{setBrushSettings(e,t){return t.payload==null?YAe:t.payload}}}),{setBrushSettings:jPn}=Klt.actions,WAr=Klt.reducer;function GAr(e){return(e%180+180)%180}var ZAr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=GAr(s),i=a*Math.PI/180,l=Math.atan(n/r),c=i>l&&i<Math.PI-l?n/Math.sin(i):r/Math.cos(i);return Math.abs(c)},YAr={dots:[],areas:[],lines:[]},Jlt=jc({name:"referenceElements",initialState:YAr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=fh(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=fh(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=fh(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:TPn,removeDot:NPn,addArea:APn,removeArea:IPn,addLine:RPn,removeLine:PPn}=Jlt.actions,XAr=Jlt.reducer,KAr=b.createContext(void 0),JAr=e=>{var{children:t}=e,[r]=b.useState("".concat(YA("recharts"),"-clip")),n=Tpe();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(KAr.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function ect(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function eIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return ZAr(n,r)}function tIr(e,t,r){var n=r==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:n?s:a,end:n?s+i:a+l}:{start:n?s+i:a+l,end:n?s:a}}function uI(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-s)<=0}function rIr(e,t){return ect(e,t+1)}function nIr(e,t,r,n,s){for(var a=(n||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=n?.[c];if(m===void 0)return{v:ect(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||uI(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function sIr(e,t,r,n,s){var a=(n||[]).slice(),i=a.length;if(i===0)return[];for(var{start:l,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=l,h=!0,p=function(){var k=n[g];if(k==null)return 0;var _=g,E,T=()=>(E===void 0&&(E=r(k,_)),E),j=k.coordinate,N=g===d||uI(e,j,T,f,c);if(!N)return h=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=p(),!(m!==0&&m===1));g+=u);if(h){for(var y=[],x=d;x<i;x+=u){var w=n[x];w!=null&&y.push(w)}return y}}return[]}function XAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ic(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XAe(Object(r),!0).forEach(function(n){aIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aIr(e,t,r){return(t=iIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iIr(e){var t=oIr(e,"string");return typeof t=="symbol"?t:t+""}function oIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lIr(e,t,r,n,s){for(var a=(n||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var m=p,g,y=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*y()/2-c);a[h]=m=ic(ic({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=ic(ic({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=uI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=ic(ic({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function cIr(e,t,r,n,s,a){var i=(n||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=n[l-1];if(d!=null){var f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=ic(ic({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=uI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=ic(ic({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var k=S,_,E=()=>(_===void 0&&(_=r(S,w)),_);if(w===0){var T=e*(k.coordinate-e*E()/2-c);i[w]=k=ic(ic({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=ic(ic({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=uI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=ic(ic({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Npe(e,t,r){var{tick:n,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!n)return[];if(qr(c)||xP.isSsr){var h;return(h=rIr(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?NN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?eIr(NN(T,{fontSize:t,letterSpacing:r}),g,f):NN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?dh(w.coordinate-x.coordinate):1,k=tIr(a,S,m);return c==="equidistantPreserveStart"?nIr(S,k,y,s,i):c==="equidistantPreserveEnd"?sIr(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=cIr(S,k,y,s,i,c==="preserveStartEnd"):p=lIr(S,k,y,s,i),p.filter(_=>_.isShow))}var uIr=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=e,i=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>i&&(i=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(r?n:0);return Math.round(u)}return 0},dIr={xAxis:{},yAxis:{}},tct=jc({name:"renderedTicks",initialState:dIr,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:n,ticks:s}=t.payload;e[r][n]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:n}=t.payload;delete e[r][n]}}}),{setRenderedTicks:fIr,removeRenderedTicks:hIr}=tct.actions,pIr=tct.reducer,mIr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function gIr(e,t){if(e==null)return{};var r,n,s=yIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function yIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function IS(){return IS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IS.apply(null,arguments)}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){vIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vIr(e,t,r){return(t=bIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bIr(e){var t=xIr(e,"string");return typeof t=="symbol"?t:t+""}function xIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fy={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Yc.axis};function wIr(e){var{x:t,y:r,width:n,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Hi(Hi(Hi({},c),ng(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Hi(Hi({},u),{},{x1:t,y1:r+d*s,x2:t+n,y2:r+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Hi(Hi({},u),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return b.createElement("line",IS({},u,{className:ba("recharts-cartesian-axis-line",qz(l,"className"))}))}function SIr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,y=e.tickSize||i,x=qr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*y,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*y,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*y,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*y,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function OIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function kIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function _Ir(e){var{option:t,tickProps:r,value:n}=e,s,a=ba(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Hi(Hi({},r),{},{className:a}));else if(typeof t=="function")s=t(Hi(Hi({},r),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=ba(i,MNr(t))),s=b.createElement(Cpe,IS({},r,{className:i}),n)}return s}function EIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return y1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(fIr({ticks:a,axisId:n,axisType:r})),()=>{s(hIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var CIr=b.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:m,height:g,tickSize:y,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=Npe(Hi(Hi({},k),{},{ticks:r}),w,S),N=ng(k),I=zz(n),P=Flt(N.textAnchor)?N.textAnchor:OIr(d,f),R=kIr(d,f),B={};typeof s=="object"&&(B=s);var M=Hi(Hi({},N),{},{fill:"none"},B),F=j.map(H=>Hi({entry:H},SIr(H,h,p,m,g,d,y,f,x))),U=F.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Zy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",IS({},M,L,{className:ba("recharts-cartesian-axis-tick-line",qz(s,"className"))})))}),z=F.map((H,Q)=>{var L,Z,{entry:V,tick:D}=H,W=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},D),{},{index:Q,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Z=u?.angle)!==null&&Z!==void 0?Z:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},W),I);return b.createElement(Zy,IS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},Bxr(_,V,Q)),n&&b.createElement(_Ir,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,Q):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(EIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(Ov,{zIndex:Yc.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),jIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=gIr(e,mIr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return uIr({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=b.useCallback(x=>{if(x){var w=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=w;var S=w[0];if(S){var k=window.getComputedStyle(S),_=k.fontSize,E=k.letterSpacing;(_!==f||E!==p)&&(h(_),m(E))}}},[f,p]);return i||n!=null&&n<=0||s!=null&&s<=0?null:b.createElement(Ov,{zIndex:e.zIndex},b.createElement(Zy,{className:ba("recharts-cartesian-axis",a)},b.createElement(wIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ng(e)}),b.createElement(CIr,{ref:y,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),b.createElement(pNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(kNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ape=b.forwardRef((e,t)=>{var r=id(e,Fy);return b.createElement(jIr,IS({},r,{ref:t}))});Ape.displayName="CartesianAxis";var TIr=["x1","y1","x2","y2","key"],NIr=["offset"],AIr=["xAxisId","yAxisId"],IIr=["xAxisId","yAxisId"];function JAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JAe(Object(r),!0).forEach(function(n){RIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RIr(e,t,r){return(t=PIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PIr(e){var t=MIr(e,"string");return typeof t=="symbol"?t:t+""}function MIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tw(){return Tw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tw.apply(null,arguments)}function _4(e,t){if(e==null)return{};var r,n,s=DIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var LIr=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:n,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function rct(e){var{option:t,lineItemProps:r}=e,n;if(b.isValidElement(t))n=b.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=r,d=_4(r,TIr),f=(s=ng(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=_4(f,NIr);n=b.createElement("line",Tw({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function $Ir(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,AIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(rct,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function FIr(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,IIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(rct,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function zIr(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:a,height:i,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function BIr(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var UIr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Uat(Npe(fc(fc(fc({},Fy),r),{},{ticks:Vat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},VIr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Uat(Npe(fc(fc(fc({},Fy),r),{},{ticks:Vat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},qIr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Yc.grid};function nct(e){var t=Xat(),r=Kat(),n=Yat(),s=fc(fc({},id(e,qIr)),{},{x:qr(e.x)?e.x:n.left,y:qr(e.y)?e.y:n.top,width:qr(e.width)?e.width:n.width,height:qr(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=s,m=od(),g=en(N=>eAe(N,"xAxis",a,m)),y=en(N=>eAe(N,"yAxis",i,m));if(!ag(u)||!ag(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||UIr,w=s.horizontalCoordinatesGenerator||VIr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?fc(fc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);Y5(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!k||!k.length)&&typeof x=="function"){var T=p&&p.length,j=x({xAxis:g?fc(fc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);Y5(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(Ov,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(LIr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(zIr,Tw({},s,{horizontalPoints:S})),b.createElement(BIr,Tw({},s,{verticalPoints:k})),b.createElement($Ir,Tw({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(FIr,Tw({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}nct.displayName="CartesianGrid";var HIr={},sct=jc({name:"errorBars",initialState:HIr,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:MPn,replaceErrorBar:DPn,removeErrorBar:LPn}=sct.actions,QIr=sct.reducer,WIr=["children"];function GIr(e,t){if(e==null)return{};var r,n,s=ZIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ZIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var YIr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},XIr=b.createContext(YIr);function KIr(e){var{children:t}=e,r=GIr(e,WIr);return b.createElement(XIr.Provider,{value:r},t)}function act(e,t){var r,n,s=en(u=>xv(u,e)),a=en(u=>wv(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Yo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Xo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function JIr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Tpe(),{needClipX:a,needClipY:i,needClip:l}=act(t,r);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(n)},b.createElement("rect",{x:a?c:c-d/2,y:i?u:u-f/2,width:a?d:d*2,height:i?f:f*2}))}var ict=(e,t,r,n)=>alt(e,"xAxis",t,n),oct=(e,t,r,n)=>slt(e,"xAxis",t,n),lct=(e,t,r,n)=>alt(e,"yAxis",r,n),cct=(e,t,r,n)=>slt(e,"yAxis",r,n),eRr=Xe([Fi,ict,lct,oct,cct],(e,t,r,n,s)=>gv(e,"xAxis")?Z5(t,n,!1):Z5(r,s,!1)),tRr=(e,t,r,n,s)=>s;function rRr(e){return e.type==="line"}var nRr=Xe([jot,tRr],(e,t)=>e.filter(rRr).find(r=>r.id===t)),sRr=Xe([Fi,ict,lct,oct,cct,nRr,eRr,Ehe],(e,t,r,n,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||r==null||n==null||s==null||n.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=a,p;if(h!=null&&h.length>0?p=h:p=c?.slice(u,d+1),p!=null)return _Rr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function aRr(e){var t=zz(e),r=3,n=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=r),(Number.isNaN(l)||l<0)&&(l=n),{r:i,strokeWidth:l}}return{r,strokeWidth:n}}var iRr=["id"],oRr=["type","layout","connectNulls","needClip","shape"],lRr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function dI(){return dI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dI.apply(null,arguments)}function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){cRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cRr(e,t,r){return(t=uRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uRr(e){var t=dRr(e,"string");return typeof t=="symbol"?t:t+""}function dRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ipe(e,t){if(e==null)return{};var r,n,s=fRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:qat(r,t),payload:e}]},pRr=b.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r,getPosition:y1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:qat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(nAr,{tooltipEntrySettings:f})}),uct=(e,t)=>"".concat(t,"px ").concat(e,"px");function mRr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var gRr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return uct(t,e);for(var s=Math.floor(e/n),a=e%n,i=[],l=0,c=0;l<r.length;c+=(u=r[l])!==null&&u!==void 0?u:0,++l){var u,d=r[l];if(d!=null&&c+d>a){i=[...r.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...mRr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function yRr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Ipe(n,iRr),u=ng(c);return b.createElement(_Ar,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function vRr(e){var{showLabels:t,children:r,points:n}=e,s=b.useMemo(()=>n?.map(a=>{var i,l,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return vm(vm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(TNr,{value:t?s:void 0},r)}function tIe(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=Ipe(a,oRr),h=vm(vm({},iu(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,n?.length>1&&b.createElement(rAr,dI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(yRr,{points:n,clipPathId:t,props:a}))}function bRr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function xRr(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:h,width:p,height:m,onAnimationEnd:g,onAnimationStart:y}=r,x=s.current,w=_he(i,"recharts-line-"),S=b.useRef(w),[k,_]=b.useState(!1),E=!k,T=b.useCallback(()=>{typeof g=="function"&&g(),_(!1)},[g]),j=b.useCallback(()=>{typeof y=="function"&&y(),_(!0)},[y]),N=bRr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(vRr,{points:i,showLabels:E},r.children,b.createElement(khe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Lu(P,N+P,R),M=Math.min(B,N),F;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));F=gRr(M,N,U)}else F=uct(N,M);else F=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,M)),x){var z=x.length/i.length,H=R===1?i:i.map((Q,L)=>{var Z=Math.floor(L*z);if(x[Z]){var V=x[Z];return vm(vm({},Q),{},{x:Lu(V.x,Q.x,R),y:Lu(V.y,Q.y,R)})}return h?vm(vm({},Q),{},{x:Lu(p*2,Q.x,R),y:Lu(m/2,Q.y,R)}):vm(vm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(tIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:F})}return b.createElement(tIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:F})}),b.createElement(INr,{label:r.label}))}function wRr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(xRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var SRr=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Yl(e.payload,t)}};class ORr extends b.Component{render(){var{hide:t,dot:r,points:n,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:h,zIndex:p}=this.props;if(t)return null;var m=ba("recharts-line",s),g=f,{r:y,strokeWidth:x}=aRr(r),w=Zlt(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(Ov,{zIndex:p},b.createElement(Zy,{className:m},h&&b.createElement("defs",null,b.createElement(JIr,{clipPathId:g,xAxisId:a,yAxisId:i}),!w&&b.createElement("clipPath",{id:"clipPath-dots-".concat(g)},b.createElement("rect",{x:c-S/2,y:l-S/2,width:u+S,height:d+S}))),b.createElement(KIr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:SRr,errorBarOffset:0},b.createElement(wRr,{props:this.props,clipPathId:g}))),b.createElement(HAr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var dct={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Yc.line,type:"linear"};function kRr(e){var t=id(e,dct),{activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:h,xAxisId:p,yAxisId:m,id:g}=t,y=Ipe(t,lRr),{needClip:x}=act(p,m),w=Tpe(),S=sC(),k=od(),_=en(I=>sRr(I,p,m,k,g));if(S!=="horizontal"&&S!=="vertical"||_==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(ORr,dI({},y,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:h,xAxisId:p,yAxisId:m,points:_,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function _Rr(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Yl(u,i);if(t==="horizontal"){var h=Jje({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=kl(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=kl(f)?null:r.scale.map(f),g=Jje({axis:n,ticks:a,bandSize:l,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function ERr(e){var t=id(e,dct),r=od();return b.createElement(cAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(sAr,{legendPayload:hRr(t)}),b.createElement(pRr,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),b.createElement(gAr,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),b.createElement(kRr,dI({},t,{id:n}))))}var fct=b.memo(ERr,c9);fct.displayName="Line";var CRr=["domain","range"],jRr=["domain","range"];function rIe(e,t){if(e==null)return{};var r,n,s=TRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function TRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function nIe(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function hct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=rIe(e,CRr),{domain:a,range:i}=t,l=rIe(t,jRr);return!nIe(r,a)||!nIe(n,i)?!1:c9(s,l)}var NRr=["type"],ARr=["dangerouslySetInnerHTML","ticks","scale"],IRr=["id","scale"];function Wae(){return Wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wae.apply(null,arguments)}function sIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function aIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sIe(Object(r),!0).forEach(function(n){RRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RRr(e,t,r){return(t=PRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PRr(e){var t=MRr(e,"string");return typeof t=="symbol"?t:t+""}function MRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var r,n,s=DRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function LRr(e){var t=Vo(),r=b.useRef(null),n=Jat(),{type:s}=e,a=Gae(e,NRr),i=f9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return aIe(aIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(NAr(l)):r.current!==l&&t(AAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(IAr(r.current)),r.current=null)},[t]),null}var $Rr=e=>{var{xAxisId:t,className:r}=e,n=en(Qat),s=od(),a="xAxis",i=en(x=>nlt(x,a,t,s)),l=en(x=>QEr(x,t)),c=en(x=>KEr(x,t)),u=en(x=>kot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Gae(e,ARr),{id:m,scale:g}=u,y=Gae(u,IRr);return b.createElement(Ape,Wae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:ba("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},FRr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:Fy.axisLine,height:Yo.height,hide:!1,includeHidden:Yo.includeHidden,interval:Yo.interval,label:!1,minTickGap:Yo.minTickGap,mirror:Yo.mirror,orientation:Yo.orientation,padding:Yo.padding,reversed:Yo.reversed,scale:Yo.scale,tick:Yo.tick,tickCount:Yo.tickCount,tickLine:Fy.tickLine,tickSize:Fy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},zRr=e=>{var t=id(e,FRr);return b.createElement(b.Fragment,null,b.createElement(LRr,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),b.createElement($Rr,t))},pct=b.memo(zRr,hct);pct.displayName="XAxis";var BRr=["type"],URr=["dangerouslySetInnerHTML","ticks","scale"],VRr=["id","scale"];function Zae(){return Zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zae.apply(null,arguments)}function iIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function oIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iIe(Object(r),!0).forEach(function(n){qRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qRr(e,t,r){return(t=HRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HRr(e){var t=QRr(e,"string");return typeof t=="symbol"?t:t+""}function QRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){if(e==null)return{};var r,n,s=WRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function WRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function GRr(e){var t=Vo(),r=b.useRef(null),n=Jat(),{type:s}=e,a=Yae(e,BRr),i=f9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return oIe(oIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(RAr(l)):r.current!==l&&t(PAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(MAr(r.current)),r.current=null)},[t]),null}function ZRr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Qat),c=od(),u=Vo(),d="yAxis",f=en(E=>tCr(E,t)),h=en(E=>eCr(E,t)),p=en(E=>nlt(E,d,t,c)),m=en(E=>_ot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||jpe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(DAr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:x}=e,w=Yae(e,URr),{id:S,scale:k}=m,_=Yae(m,VRr);return b.createElement(Ape,Zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ba("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var YRr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:Fy.axisLine,hide:!1,includeHidden:Xo.includeHidden,interval:Xo.interval,label:!1,minTickGap:Xo.minTickGap,mirror:Xo.mirror,orientation:Xo.orientation,padding:Xo.padding,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:Xo.tickCount,tickLine:Fy.tickLine,tickSize:Fy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},XRr=e=>{var t=id(e,YRr);return b.createElement(b.Fragment,null,b.createElement(GRr,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),b.createElement(ZRr,t))},mct=b.memo(XRr,hct);mct.displayName="YAxis";var KRr=(e,t)=>t,Rpe=Xe([KRr,Fi,Lit,Cl,wlt,Sv,kjr,ec],Ajr);function JRr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Ppe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(JRr(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,n=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((c-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var gct=uf("mouseClick"),yct=gP();yct.startListening({actionCreator:gct,effect:(e,t)=>{var r=e.payload,n=Rpe(t.getState(),Ppe(r));n?.activeIndex!=null&&t.dispatch(gCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Xae=uf("mouseMove"),vct=gP(),EO=null,z0=null,JH=null;vct.startListening({actionCreator:Xae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");EO!==null&&(cancelAnimationFrame(EO),EO=null),z0!==null&&(typeof s!="number"||!i)&&(clearTimeout(z0),z0=null),JH=Ppe(r);var l=()=>{var c=t.getState(),u=ype(c,c.tooltip.settings.shared);if(!JH){EO=null,z0=null;return}if(u==="axis"){var d=Rpe(c,JH);d?.activeIndex!=null?t.dispatch(flt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(dlt())}EO=null,z0=null};if(!i){l();return}s==="raf"?EO=requestAnimationFrame(l):typeof s=="number"&&z0===null&&(z0=setTimeout(l,s))}});function ePr(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var lIe={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},bct=jc({name:"rootProps",initialState:lIe,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:lIe.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),tPr=bct.reducer,{updateOptions:rPr}=bct.actions,nPr=null,sPr={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},xct=jc({name:"polarOptions",initialState:nPr,reducers:sPr}),{updatePolarOptions:$Pn}=xct.actions,aPr=xct.reducer,wct=uf("keyDown"),Sct=uf("focus"),Oct=uf("blur"),E9=gP(),CO=null,B0=null,WD=null;E9.startListening({actionCreator:wct,effect:(e,t)=>{WD=e.payload,CO!==null&&(cancelAnimationFrame(CO),CO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");B0!==null&&(typeof n!="number"||!a)&&(clearTimeout(B0),B0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=WD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=vpe(u,fC(l),jP(l),NP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Sv(l);if(d==="Enter"){var m=x4(l,"axis","hover",String(u.index));t.dispatch(b4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=iCr(l),y=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*y;if(p==null||w>=p.length||w<0)return;var S=x4(l,"axis","hover",String(w));t.dispatch(b4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{CO=null,B0=null}};if(!a){i();return}n==="raf"?CO=requestAnimationFrame(i):typeof n=="number"&&B0===null&&(i(),WD=null,B0=setTimeout(()=>{WD?i():(B0=null,CO=null)},n))}});E9.startListening({actionCreator:Sct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var a="0",i=x4(r,"axis","hover",String(a));t.dispatch(b4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});E9.startListening({actionCreator:Oct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(b4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function kct(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var s=Reflect.get(r,n);return typeof s=="function"?s.bind(r):s}})}var Yf=uf("externalEvent"),_ct=gP(),GD=new Map,oT=new Map,eQ=new Map;_ct.startListening({actionCreator:Yf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=kct(n);eQ.set(s,{handler:r,reactEvent:a});var i=GD.get(s);i!==void 0&&(cancelAnimationFrame(i),GD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=oT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),oT.delete(s));var p=()=>{var y=eQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:ljr(S),activeDataKey:ajr(S),activeIndex:lI(S),activeLabel:klt(S),activeTooltipIndex:lI(S),isTooltipActive:cjr(S)};x&&x(k,w)}finally{GD.delete(s),oT.delete(s),eQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);GD.set(s,m)}else if(typeof c=="number"){if(!oT.has(s)){p();var g=setTimeout(p,c);oT.set(s,g)}}else p()}}});var iPr=Xe([uC],e=>e.tooltipItemPayloads),oPr=Xe([iPr,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),Ect=uf("touchMove"),Cct=gP(),U0=null,ib=null,cIe=null,lT=null;Cct.startListening({actionCreator:Ect,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){lT=kct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");U0!==null&&(cancelAnimationFrame(U0),U0=null),ib!==null&&(typeof s!="number"||!i)&&(clearTimeout(ib),ib=null),cIe=Array.from(r.touches).map(c=>Ppe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(lT!=null){var c=t.getState(),u=ype(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=cIe)===null||d===void 0?void 0:d[0];if(f==null){U0=null,ib=null;return}var h=Rpe(c,f);h?.activeIndex!=null&&t.dispatch(flt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=lT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(Dwr),x=(p=g.getAttribute(Lwr))!==null&&p!==void 0?p:void 0,w=dC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=oPr(c,y,x);t.dispatch(mCr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}U0=null,ib=null}};if(!i){l();return}s==="raf"?U0=requestAnimationFrame(l):typeof s=="number"&&ib===null&&(l(),lT=null,ib=setTimeout(()=>{lT?l():(ib=null,U0=null)},s))}}});var jct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Tct=jc({name:"eventSettings",initialState:jct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:lPr}=Tct.actions,cPr=Tct.reducer,uPr=ant({brush:WAr,cartesianAxis:LAr,chartData:cTr,errorBars:QIr,eventSettings:cPr,graphicalItems:pAr,layout:wwr,legend:TSr,options:sTr,polarAxis:PNr,polarOptions:aPr,referenceElements:XAr,renderedTicks:pIr,rootProps:tPr,tooltip:yCr,zIndex:Hjr}),dPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Q0r({reducer:uPr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([yct.middleware,vct.middleware,E9.middleware,_ct.middleware,Cct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(jat({type:"raf"}))},devTools:{serialize:{replacer:ePr},name:"recharts-".concat(r)}})};function fPr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=od(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=dPr(t,n));var i=phe;return b.createElement(pnt,{context:i,store:a.current},r)}function hPr(e){var{layout:t,margin:r}=e,n=Vo(),s=od();return b.useEffect(()=>{s||(n(vwr(t)),n(ywr(r)))},[n,s,t,r]),null}var pPr=b.memo(hPr,c9);function mPr(e){var t=Vo();return b.useEffect(()=>{t(rPr(e))},[t,e]),null}var gPr=e=>{var t=Vo();return b.useEffect(()=>{t(lPr(e))},[t,e]),null},yPr=b.memo(gPr,c9);function uIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(Vjr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(qjr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function dIe(e){var{children:t,isPanorama:r}=e,n=en(Rjr);if(!n||n.length===0)return t;var s=n.filter(i=>i<0),a=n.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(uIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(uIe,{key:i,zIndex:i,isPanorama:r})))}var vPr=["children"];function bPr(e,t){if(e==null)return{};var r,n,s=xPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function xPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E4(){return E4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E4.apply(null,arguments)}var wPr={width:"100%",height:"100%",display:"block"},SPr=b.forwardRef((e,t)=>{var r=Xat(),n=Kat(),s=cit();if(!ag(r)||!ag(n))return null;var{children:a,otherAttributes:i,title:l,desc:c}=e,u,d;return i!=null&&(typeof i.tabIndex=="number"?u=i.tabIndex:u=s?0:void 0,typeof i.role=="string"?d=i.role:d=s?"application":void 0),b.createElement(Pst,E4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:wPr,ref:t}),a)}),OPr=e=>{var{children:t}=e,r=en(s9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(Pst,{width:n,height:s,x:i,y:a},t)},fIe=b.forwardRef((e,t)=>{var{children:r}=e,n=bPr(e,vPr),s=od();return s?b.createElement(OPr,null,b.createElement(dIe,{isPanorama:!0},r)):b.createElement(SPr,E4({ref:t},n),b.createElement(dIe,{isPanorama:!1},r))});function kPr(){var e=Vo(),[t,r]=b.useState(null),n=en(Mwr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(xwr(a))}},[t,e,n]),r}function hIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hIe(Object(r),!0).forEach(function(n){EPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EPr(e,t,r){return(t=CPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CPr(e){var t=jPr(e,"string");return typeof t=="symbol"?t:t+""}function jPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kb(){return Kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kb.apply(null,arguments)}var TPr=()=>(vTr(),null);function C4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var NPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:C4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:C4((n=e.style)===null||n===void 0?void 0:n.height)}),l=b.useCallback((u,d)=>{i(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=b.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var h=m=>{var g=m[0];if(g!=null){var{width:y,height:x}=g.contentRect;l(y,x)}},p=new ResizeObserver(h);p.observe(u),s.current=p}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(vP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Kb({ref:c},e)))}),APr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:C4(r),containerHeight:C4(n)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),l=b.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return b.createElement(b.Fragment,null,b.createElement(vP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Kb({ref:l},e)))}),IPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Kb({ref:t},e)))}),RPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(APr,Kb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(IPr,Kb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Kb({ref:t},e)))});function PPr(e){return e?NPr:RPr}var MPr=b.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:y,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Vo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=kPr(),P=xhe(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,M=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(k.current=ie)},[I,t,T,N]),F=b.useCallback(ie=>{_(gct(ie)),_(Yf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(Xae(ie)),_(Yf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(dlt()),_(Yf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Xae(ie)),_(Yf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(Sct())},[_]),L=b.useCallback(()=>{_(Oct())},[_]),Z=b.useCallback(ie=>{_(wct(ie.key))},[_]),V=b.useCallback(ie=>{_(Yf({handler:i,reactEvent:ie}))},[_,i]),D=b.useCallback(ie=>{_(Yf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Yf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Yf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Yf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(Ect(ie)),_(Yf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Yf({handler:p,reactEvent:ie}))},[_,p]),re=PPr(w);return b.createElement(Alt.Provider,{value:E},b.createElement(qbr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:ba("recharts-wrapper",n),style:_Pr({position:"relative",cursor:"default",width:R,height:B},y),onClick:F,onContextMenu:V,onDoubleClick:D,onFocus:Q,onBlur:L,onKeyDown:Z,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:H,onMouseUp:G,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:M},b.createElement(TPr,null),r)))}),DPr=["width","height","responsive","children","className","style","compact","title","desc"];function LPr(e,t){if(e==null)return{};var r,n,s=$Pr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $Pr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var FPr=b.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=LPr(e,DPr),h=ng(f);return c?b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement(fIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(MPr,{className:i,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(fIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(JAr,null,a)))});function Kae(){return Kae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kae.apply(null,arguments)}function pIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zPr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pIe(Object(r),!0).forEach(function(n){BPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BPr(e,t,r){return(t=UPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UPr(e){var t=VPr(e,"string");return typeof t=="symbol"?t:t+""}function VPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qPr={top:5,right:5,bottom:5,left:5},HPr=zPr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:qPr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},jct),QPr=b.forwardRef(function(t,r){var n,s=id(t.categoricalChartProps,HPr),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return b.createElement(fPr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(QAr,{chartData:u.data}),b.createElement(pPr,{layout:s.layout,margin:s.margin}),b.createElement(yPr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(mPr,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),b.createElement(FPr,Kae({},s,{ref:r})))}),WPr=["axis"],GPr=b.forwardRef((e,t)=>b.createElement(QPr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:WPr,tooltipPayloadSearcher:rTr,categoricalChartProps:e,ref:t}));function ZPr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function YPr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function XPr(e){return e/100*window.innerHeight}function KPr(e){return e/100*window.innerWidth}function JPr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function WT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=JPr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=YPr(t,s);break}case"em":{n=ZPr(t,s);break}case"vh":{n=XPr(s);break}case"vw":{n=KPr(s);break}}return n}function Vu(e){return parseFloat(e.toFixed(3))}function eE({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,s)=>(n+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,n),0)}function Jae(e){const{panels:t}=e,r=eE({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:s,panelConstraints:a}=n;let i=0;if(a.collapsedSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=Vu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=Vu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.minSize});c=Vu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=Vu(d/r*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:n.id}})}function Ca(e,t="Assertion error"){if(!e)throw Error(t)}function eie(e,t){return Array.from(t).sort(e==="horizontal"?eMr:tMr)}function eMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function tMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Nct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Act(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function rMr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=Act(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return Ca(s,"No rect found"),s}let ZD;function nMr(){return ZD===void 0&&(typeof matchMedia=="function"?ZD=!!matchMedia("(pointer:coarse)").matches:ZD=!1),ZD}function Ict(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=eie(r,Array.from(t.children).filter(Nct).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,h,p=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.ariaDisabled===null&&(f++,u===-1&&(u=m),d=m))}if(f>1){let m=-1;for(const g of a)if(g.hasAttribute("data-panel")){m++;const y=n.find(x=>x.element===g);if(y){if(h){const x=h.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const k=r==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),_=r==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(p.length){case 0:{S=[k,_];break}case 1:{const E=p[0],T=rMr({orientation:r,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?_:k];break}default:{S=p;break}}}else p.length?S=p:S=[r==="horizontal"?new DOMRect(x.right,w.top,w.left-x.right,w.height):new DOMRect(w.left,x.bottom,w.width,w.top-x.bottom)];for(const k of S){let _="width"in k?k:k.element.getBoundingClientRect();const E=nMr()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(_.width<E){const j=E-_.width;_=new DOMRect(_.x-j/2,_.y,_.width+j,_.height)}if(_.height<E){const j=E-_.height;_=new DOMRect(_.x,_.y-j/2,_.width,_.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:eE({group:e}),panels:[h,y],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=y,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const y=s.find(x=>x.element===g);y?p.push(y):(h=void 0,p=[])}else c=!0}return i}let Rct=class{#e={};addListener(t,r){const n=this.#e[t];return n===void 0?this.#e[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=this.#e[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let s=!1,a=null;const i=Array.from(n);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,r)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,r){const n=this.#e[t];if(n!==void 0){const s=n.indexOf(r);s>=0&&n.splice(s,1)}}},$m=new Map;const Pct=new Rct;function sMr(e){$m=new Map($m),$m.delete(e)}function mIe(e,t){for(const[r]of $m)if(r.id===e)return r}function Jb(e,t){for(const[r,n]of $m)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function x1(){return $m}function Mpe(e,t){return Pct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function rv(e,t){const r=$m.get(e);$m=new Map($m),$m.set(e,t),Pct.emit("groupChange",{group:e,prev:r,next:t})}function aMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Act(r,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(n=a,s=i);break}case"vertical":{i.y<=s.y&&(n=a,s=i);break}}}return n?{distance:s,hitRegion:n}:void 0}function iMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function oMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:vIe(e),b:vIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();Ca(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:yIe(gIe(r.a)),b:yIe(gIe(r.b))};if(s.a===s.b){const a=n.childNodes,i={a:r.a.at(-1),b:r.b.at(-1)};let l=a.length;for(;l--;){const c=a[l];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const lMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function cMr(e){const t=getComputedStyle(Mct(e)??e).display;return t==="flex"||t==="inline-flex"}function uMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||cMr(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||lMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function gIe(e){let t=e.length;for(;t--;){const r=e[t];if(Ca(r,"Missing node"),uMr(r))return r}return null}function yIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function vIe(e){const t=[];for(;e;)t.push(e),e=Mct(e);return t}function Mct(e){const{parentNode:t}=e;return iMr(t)?t.host:t}function dMr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function fMr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Nct(r)||r.contains(e)||e.contains(r))return!0;if(oMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(dMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Dpe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Ict(s),i=aMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&fMr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function hMr(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function Hc(e,t,r=0){return Math.abs(Vu(e)-Vu(t))<=r}function pm(e,t){return Hc(e,t)?0:e>t?1:-1}function vk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(pm(n,c)<0)if(a){const u=(s+c)/2;pm(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=Vu(n),n}function fI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(Hc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;Ca(d!=null,"Invalid first pivot index"),Ca(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,y=r[g];Ca(y,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(Ca(k!=null,`Previous layout not found for panel index ${g}`),Hc(k,x)){const _=S-k;pm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,y=r[g];Ca(y,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(Ca(k!=null,`Previous layout not found for panel index ${g}`),Hc(k,S)){const _=k-x;pm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,y=r[g];Ca(y,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=y;if(w&&pm(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;pm(T,k)<0&&(e=pm(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;pm(T,k)<0&&(e=pm(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let y=e<0?f:d,x=0;for(;;){const S=l[y];Ca(S!=null,`Previous layout not found for panel index ${y}`);const k=vk({overrideDisabledPanels:i,panelConstraints:r[y],prevSize:S,size:100})-S;if(x+=k,y+=g,y<0||y>=r.length)break}const w=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-w:w}{let g=e<0?d:f;for(;g>=0&&g<r.length;){const y=Math.abs(e)-Math.abs(h),x=l[g];Ca(x!=null,`Previous layout not found for panel index ${g}`);const w=x-y,S=vk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!Hc(x,S)&&(h+=x-S,u[g]=S,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(hMr(c,u))return s;{const g=e<0?f:d,y=l[g];Ca(y!=null,`Previous layout not found for panel index ${g}`);const x=y+h,w=vk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!Hc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];Ca(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=vk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(Hc(_,T)||(S-=T-_,u[k]=T),Hc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!Hc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function RS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||pm(e[r],t[r])!==0)return!1;return!0}function PS({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],s=n.reduce((l,c)=>l+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!Hc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];Ca(c!=null,`No layout data found for index ${l}`);const u=100/s*c;n[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=r[l];Ca(c!=null,`No layout data found for index ${l}`);const u=n[l];Ca(u!=null,`No layout data found for index ${l}`);const d=vk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!Hc(a,0))for(let l=0;l<t.length;l++){const c=n[l];Ca(c!=null,`No layout data found for index ${l}`);const u=c+a,d=vk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,Hc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Dct({groupId:e,panelId:t}){const r=()=>{const l=x1();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:h,separatorToPanels:p}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:h,layout:f,separatorToPanels:p};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=r().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=l=>{const c=a();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:h,layout:p,separatorToPanels:m}=r(),g=f.panels.findIndex(S=>S.id===t),y=g===f.panels.length-1,x=fI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=PS({layout:x,panelConstraints:d});RS(p,w)||rv(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:h,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=n(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=n(),{mutableValues:d}=s(),f=a();if(l&&f===c){let h=d.expandToSize??u;h===0&&(h=1),i(h)}},getSize:()=>{const{group:l}=r(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=n(),u=a();return l&&Hc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=eE({group:c}),f=WT({groupSize:d,panelElement:u,styleProp:l}),h=Vu(f/d*100);i(h)}}}function bIe(e){if(e.defaultPrevented)return;const t=x1();Dpe(e,t).forEach(r=>{if(r.separator){const n=r.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(n){const s=n.panelConstraints.defaultSize,a=Dct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function C$(e){const t=x1();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function Lct({groupId:e}){const t=()=>{const r=x1();for(const[n,s]of r)if(n.id===e)return{group:n,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=PS({layout:r,panelConstraints:s});return n?l:(RS(l,u)||rv(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function V0(e,t){const r=C$(e),n=Jb(r.id,!0),s=r.separators.find(d=>d.element===e);Ca(s,"Matching separator not found");const a=n.separatorToPanels.get(s);Ca(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=Lct({groupId:r.id}).getLayout(),c=fI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=PS({layout:c,panelConstraints:n.derivedPanelConstraints});RS(l,u)||rv(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function xIe(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=C$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&V0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&V0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&V0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&V0(t,-5);break}case"End":{e.preventDefault(),V0(t,100);break}case"Enter":{e.preventDefault();const n=C$(t),s=Jb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);Ca(c,"Matching separator not found");const u=l.get(c);Ca(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(Ca(f,"Panel metadata not found"),f.collapsible){const h=i[d.id],p=f.collapsedSize===h?n.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;V0(t,p-h)}break}case"F6":{e.preventDefault();const n=C$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);Ca(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:n.length-1:s+1<n.length?s+1:0;n[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),V0(t,-100);break}}}let r_={cursorFlags:0,state:"inactive"};const Lpe=new Rct;function MS(){return r_}function pMr(e){return Lpe.addListener("change",e)}function mMr(e){const t=r_,r={...r_};r.cursorFlags=e,r_=r,Lpe.emit("change",{prev:t,next:r})}function n_(e){const t=r_;r_=e,Lpe.emit("change",{prev:t,next:e})}function wIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=x1(),r=Dpe(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),n_({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const gMr=e=>e,tQ=()=>{},$ct=1,Fct=2,zct=4,Bct=8,SIe=3,OIe=12;let YD;function kIe(){return YD===void 0&&(YD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(YD=!0)),YD}function yMr({cursorFlags:e,groups:t,state:r}){let n=0,s=0;switch(r){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{n++;break}case"vertical":{s++;break}}})}if(!(n===0&&s===0)){switch(r){case"active":{if(e&&kIe()){const a=(e&$ct)!==0,i=(e&Fct)!==0,l=(e&zct)!==0,c=(e&Bct)!==0;if(a)return l?"se-resize":c?"ne-resize":"e-resize";if(i)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}break}}return kIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const _Ie=new WeakMap;function $pe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=_Ie.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=MS();switch(n.state){case"active":case"hover":{const s=yMr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(i=>i.group),state:n.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?r.cssRules.length===0?r.insertRule(a):r.replaceSync(a):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}_Ie.set(e,{prevStyle:t,styleSheet:r})}function Uct({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;r.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:h,panels:p}=d,{disableCursor:m}=d.mutableState;let g=0;a?h==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:h==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const y=n.get(d),x=s.get(d);if(!y||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=fI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(RS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?$ct:Fct;break}case"vertical":{l|=g<0?zct:Bct;break}}}else rv(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&SIe:c|=l&SIe,t.movementY===0?c|=i&OIe:c|=l&OIe,mMr(c),$pe(e)}function EIe(e){const t=x1(),r=MS();r.state==="active"&&Uct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function CIe(e){if(e.defaultPrevented)return;const t=MS(),r=x1();switch(t.state){case"active":{if(e.buttons===0){n_({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Jb(n.group.id,!0);rv(n.group,s)});return}Uct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=Dpe(e,r);n.length===0?t.state!=="inactive"&&n_({cursorFlags:0,state:"inactive"}):n_({cursorFlags:0,hitRegions:n,state:"hover"}),$pe(e.currentTarget);break}}}function jIe(e){e.relatedTarget instanceof HTMLIFrameElement&&MS().state==="hover"&&n_({cursorFlags:0,state:"inactive"})}function TIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=MS();t.state==="active"&&(n_({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&($pe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Jb(r.group.id,!0);rv(r.group,n)}),e.preventDefault()))}function NIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=Vu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=Vu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function vMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=eE({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:Vu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function bMr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function xMr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const h=n[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const p=h/100*r,m=Vu(p/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=h}if(!i||c.length===0)return n;const u=100-s,d={...n};if(l.forEach((f,h)=>{d[h]=f}),a>0)for(const f of c){const h=n[f]??0;d[f]=Vu(h/a*u)}else{const f=Vu(u/c.length);for(const h of c)d[h]=f}return d}function wMr(e,t){const r=e.map(s=>s.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s))return!1;return!0}const jO=new Map;function SMr(e){let t=!0;Ca(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,s=new Set,a=new r(m=>{for(const g of m){const{borderBoxSize:y,target:x}=g;if(x===e.element){if(t){const w=eE({group:e});if(w===0)return;const S=Jb(e.id);if(!S)return;const k=Jae(e),_=S.defaultLayoutDeferred?NIe(k):S.layout,E=xMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=PS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&RS(S.layout,T)&&bMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;rv(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else vMr(e,x,y)}});a.observe(e.element),e.panels.forEach(m=>{Ca(!n.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),n.add(m.id),m.onResize&&a.observe(m.element)});const i=eE({group:e}),l=Jae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(wMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??NIe(l),f=PS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;jO.set(h,(jO.get(h)??0)+1);const p=new Map;return Ict(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),rv(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{Ca(!s.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),s.add(m.id),m.element.addEventListener("keydown",xIe)}),jO.get(h)===1&&(h.addEventListener("dblclick",bIe,!0),h.addEventListener("pointerdown",wIe,!0),h.addEventListener("pointerleave",EIe),h.addEventListener("pointermove",CIe),h.addEventListener("pointerout",jIe),h.addEventListener("pointerup",TIe,!0)),function(){t=!1,jO.set(h,Math.max(0,(jO.get(h)??0)-1)),sMr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",xIe)}),jO.get(h)||(h.removeEventListener("dblclick",bIe,!0),h.removeEventListener("pointerdown",wIe,!0),h.removeEventListener("pointerleave",EIe),h.removeEventListener("pointermove",CIe),h.removeEventListener("pointerout",jIe),h.removeEventListener("pointerup",TIe,!0)),a.disconnect()}}function OMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Fpe(e){const t=b.useId();return`${e??t}`}const w1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function AN(e){const t=b.useRef(e);return w1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function zpe(...e){return AN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Bpe(e){const t=b.useRef({...e});return w1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Vct=b.createContext(null);function kMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:gMr});b.useImperativeHandle(t,()=>r.current,[]),w1(()=>{Object.assign(r.current,Lct({groupId:e}))})}function C9({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:h,...p}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=AN(P=>{RS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=AN(P=>{RS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Fpe(l),w=b.useRef(null),[S,k]=OMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=zpe(w,a);kMr(x,i);const T=AN((P,R)=>{const B=MS(),M=mIe(P),F=Jb(P);if(F){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===M)),{flexGrow:F.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Bpe({defaultLayout:r,disableCursor:n}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=_.current;return R.panels=eie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=eie(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(B=>B!==P),k()}},togglePanelDisabled:(P,R)=>{const B=_.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const M=mIe(x),F=Jb(x);M&&F&&rv(M,{...F,derivedPanelConstraints:Jae(M)})},toggleSeparatorDisabled:(P,R)=>{const B=_.current.separators.find(M=>M.id===P);B&&(B.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return w1(()=>{const P=w.current;if(P===null)return;const R=_.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const L of R.panels){const Z=j.defaultLayout[L.id];Z!==void 0&&(B[L.id]=Z)}}const M={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=M;const F=SMr(M),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=Jb(M.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Mpe(x,L=>{const{defaultLayoutDeferred:Z,derivedPanelConstraints:V,layout:D}=L.next;if(Z||V.length===0)return;const W=M.panels.map(({id:J})=>J).join(",");M.mutableState.layouts[W]=D,V.forEach(J=>{if(J.collapsible){const{layout:ae}=L.prev??{};if(ae){const te=Hc(J.collapsedSize,D[J.panelId]),re=Hc(J.collapsedSize,ae[J.panelId]);te&&!re&&(M.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=MS().state!=="active";g(D),G&&y(D)});return()=>{I.current=null,F(),Q()}},[s,x,y,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Vct.Provider,{value:N,children:o.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...h,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}C9.displayName="Group";function rQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function Upe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=rQ(a,t??[]),l=b.useSyncExternalStore(_Mr,()=>r.getItem(i),()=>r.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const p=u.current;p&&(u.current=null,clearTimeout(p))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(p=>{d();let m;s?m=rQ(a,Object.keys(p)):m=rQ(a,[]);try{r.setItem(m,JSON.stringify(p))}catch(g){console.error(g)}},[d,s,a,r]),h=b.useCallback(p=>{d(),e===0?f(p):u.current=setTimeout(()=>{f(p)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:h,onLayoutChanged:f}}function _Mr(){return function(){}}function Vpe(){const e=b.useContext(Vct);return Ca(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function EMr(e,t){const{id:r}=Vpe(),n=b.useRef({collapse:tQ,expand:tQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tQ});b.useImperativeHandle(t,()=>n.current,[]),w1(()=>{Object.assign(n.current,Dct({groupId:r,panelId:e}))})}function tE({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:h,style:p,...m}){const g=!!c,y=Fpe(c),x=Bpe({disabled:a}),w=b.useRef(null),S=zpe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Vpe(),N=f!==null,I=AN((R,B,M)=>{f?.(R,c,M)});w1(()=>{const R=w.current;if(R!==null){const B={element:R,id:y,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,r,n,s,N,y,g,u,d,I,T,x]),b.useEffect(()=>{j(y,!!a)},[a,y,j]),EMr(y,h);const P=b.useSyncExternalStore(R=>Mpe(_,R),()=>JSON.stringify(k(_,y)),()=>JSON.stringify(k(_,y)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":y,id:y,ref:S,style:{...CMr,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(P)},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}tE.displayName="Panel";const CMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function jMr(){return b.useRef(null)}function TMr({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let s,a;const i=e[r],l=t.find(c=>c.panelId===r);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[n,n+1];a=PS({layout:fI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=PS({layout:fI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function qct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Fpe(s),c=Bpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=zpe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Vpe(),k=x==="horizontal"?"vertical":"horizontal";w1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=pMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Mpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:M}=P.next,F=M.get(T);if(F){const U=F[0],z=F.indexOf(U);d(TMr({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[y,l,w,c]),b.useEffect(()=>{S(l,!!r)},[r,l,S]);let _;return r&&!g&&(_="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":r||void 0,"aria-orientation":k,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":r?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:_,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}qct.displayName="Separator";const AIe=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(p=>p(t,h))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},NMr=(e=>e?AIe(e):AIe),AMr=e=>e;function IMr(e,t=AMr){const r=je.useSyncExternalStore(e.subscribe,je.useCallback(()=>t(e.getState()),[e,t]),je.useCallback(()=>t(e.getInitialState()),[e,t]));return je.useDebugValue(r),r}const IIe=e=>{const t=NMr(e),r=n=>IMr(t,n);return Object.assign(r,t),r},qpe=(e=>e?IIe(e):IIe);function RMr(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=r.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const tie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tie(n)(r)}}}},PMr=(e,t)=>(r,n,s)=>{let a={storage:RMr(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,s);const f=()=>{const y=a.partialize({...n()});return d.setItem(a.name,{state:y,version:a.version})},h=s.setState;s.setState=(y,x)=>(h(y,x),f());const p=e((...y)=>(r(...y),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var y,x;if(!d)return;const w=++l;i=!1,c.forEach(k=>{var _;return k((_=n())!=null?_:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(y=n())!=null?y:p))||void 0;return tie(d.getItem.bind(d))(a.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==a.version){if(a.migrate){const _=a.migrate(k.state,k.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var _;if(w!==l)return;const[E,T]=k;if(m=a.merge(T,(_=n())!=null?_:p),r(m,!0),E)return f()}).then(()=>{w===l&&(S?.(n(),void 0),m=n(),i=!0,u.forEach(k=>k(m)))}).catch(k=>{w===l&&S?.(void 0,k)})};return s.persist={setOptions:y=>{a={...a,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},a.skipHydration||g(),m||p},MMr=PMr;var S1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},DMr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},LMr=class{#e=DMr;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Nw=new LMr;function $Mr(e){setTimeout(e,0)}var DS=typeof window>"u"||"Deno"in globalThis;function uc(){}function FMr(e,t){return typeof e=="function"?e(t):e}function rie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ex(e,t){return typeof e=="function"?e(t):e}function Jf(e,t){return typeof e=="function"?e(t):e}function RIe(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Hpe(i,t.options))return!1}else if(!hI(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function PIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(LS(t.options.mutationKey)!==LS(a))return!1}else if(!hI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Hpe(e,t){return(t?.queryKeyHashFn||LS)(e)}function LS(e){return JSON.stringify(e,(t,r)=>nie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function hI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>hI(e[r],t[r])):!1}var zMr=Object.prototype.hasOwnProperty;function Qpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=MIe(e)&&MIe(t);if(!n&&!(nie(e)&&nie(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=n?d:i[d],h=e[f],p=t[f];if(h===p){c[f]=h,(n?d<a:zMr.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Qpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function pI(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function MIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nie(e){if(!DIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!DIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function DIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function BMr(e){return new Promise(t=>{Nw.setTimeout(t,e)})}function sie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Qpe(e,t):t}function UMr(e){return e}function VMr(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function qMr(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Wpe=Symbol();function Qct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Wpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gpe(e,t){return typeof e=="function"?e(...t):!!e}function HMr(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var QMr=class extends S1{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!DS&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Zpe=new QMr;function aie(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var WMr=$Mr;function GMr(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=WMr;const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Zi=GMr(),ZMr=class extends S1{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!DS&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},j4=new ZMr;function YMr(e){return Math.min(1e3*2**e,3e4)}function Wct(e){return(e??"online")==="online"?j4.isOnline():!0}var iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Gct(e){let t=!1,r=0,n;const s=aie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new iie(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Zpe.isFocused()&&(e.networkMode==="always"||j4.isOnline())&&e.canRun(),d=()=>Wct(e.networkMode)&&e.canRun(),f=g=>{a()||(n?.(),s.resolve(g))},h=g=>{a()||(n?.(),s.reject(g))},p=()=>new Promise(g=>{n=y=>{(a()||u())&&g(y)},e.onPause?.()}).then(()=>{n=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(DS?0:3),S=e.retryDelay??YMr,k=typeof S=="function"?S(r,x):S,_=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,x);if(t||!_){h(x);return}r++,e.onFail?.(r,x),BMr(k).then(()=>u()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),s)}}var Zct=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rie(this.gcTime)&&(this.#e=Nw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(DS?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Nw.clearTimeout(this.#e),this.#e=void 0)}},XMr=class extends Zct{#e;#t;#r;#s;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=$Ie(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=$Ie(this.options);t.data!==void 0&&(this.setState(LIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=sie(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(uc).catch(uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Jf(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ex(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Hct(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const l=Qct(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=Gct({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof iie&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#n.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof iie){if(l.silent)return this.#n.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Yct(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...LIe(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Zi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Yct(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function LIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $Ie(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var j9=class extends S1{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=aie(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#a;#o;#i;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),FIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jf(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!pI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&zIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||Jf(this.options.enabled,this.#t)!==Jf(t.enabled,this.#t)||ex(this.options.staleTime,this.#t)!==ex(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||Jf(this.options.enabled,this.#t)!==Jf(t.enabled,this.#t)||s!==this.#l)&&this.#v(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return JMr(this,r)&&(this.#s=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(uc)),t}#g(){this.#x();const e=ex(this.options.staleTime,this.#t);if(DS||this.#s.isStale||!rie(e))return;const r=Hct(this.#s.dataUpdatedAt,e)+1;this.#c=Nw.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(DS||Jf(this.options.enabled,this.#t)===!1||!rie(this.#l)||this.#l===0)&&(this.#u=Nw.setInterval(()=>{(this.options.refetchIntervalInBackground||Zpe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Nw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Nw.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#s,a=this.#n,i=this.#a,c=e!==r?e.state:this.#r,{state:u}=e;let d={...u},f=!1,h;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&FIe(e,t),I=j&&zIe(e,r,t,n);(N||I)&&(d={...d,...Yct(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,y=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",h=sie(s?.data,j,t),f=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===a?.data&&t.select===this.#p)h=this.#d;else try{this.#p=t.select,h=t.select(h),h=sie(s?.data,h,t),this.#d=h,this.#i=null}catch(j){this.#i=j}this.#i&&(p=this.#i,h=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",k=w&&x,_=h!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&_,isStale:Ype(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Jf(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=aie();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===r.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#t),pI(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#h.size)return!0;const a=new Set(s??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#O({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Zi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function KMr(e,t){return Jf(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function FIe(e,t){return KMr(e,t)||e.state.data!==void 0&&oie(e,t,t.refetchOnMount)}function oie(e,t,r){if(Jf(t.enabled,e)!==!1&&ex(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ype(e,t)}return!1}function zIe(e,t,r,n){return(e!==t||Jf(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ype(e,r)}function Ype(e,t){return Jf(t.enabled,e)!==!1&&e.isStaleByTime(ex(t.staleTime,e))}function JMr(e,t){return!pI(e.getCurrentResult(),t)}function T4(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{HMr(m,()=>t.signal,()=>d=!0)},h=Qct(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await h(w),{maxPages:k}=t.options,_=y?qMr:VMr;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?Xct:lie,y={pages:a,pageParams:i},x=g(n,y);l=await p(y,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??n.initialPageParam:lie(n,l);if(c>0&&g==null)break;l=await p(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function lie(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Xct(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function e2r(e,t){return t?lie(e,t)!=null:!1}function t2r(e,t){return!t||!e.getPreviousPageParam?!1:Xct(e,t)!=null}var r2r=class extends j9{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:T4()})}getOptimisticResult(e){return e.behavior=T4(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=n,c=r.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",h=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:e2r(t,r.data),hasPreviousPage:t2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},n2r=class extends Zct{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||Kct(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Gct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#n({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const i=await this.options.onMutate?.(e,r);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#n({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(i){Promise.reject(i)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(i){Promise.reject(i)}throw this.#n({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Zi.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function Kct(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s2r=class extends S1{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new n2r({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=XD(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=XD(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=XD(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=XD(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zi.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>PIe(t,r))}findAll(e={}){return this.getAll().filter(t=>PIe(e,t))}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zi.batch(()=>Promise.all(e.map(t=>t.continue().catch(uc))))}};function XD(e){return e.options.scope?.id}var a2r=class extends S1{#e;#t=void 0;#r;#s;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),pI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&LS(r.mutationKey)!==LS(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(t,r){return this.#s=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#n(){const t=this.#r?.state??Kct();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Zi.batch(()=>{if(this.#s&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,r,n,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,r,n,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(r=>{r(this.#t)})})}};function BIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function i2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var o2r=class extends S1{#e;#t;#r;#s;#n;#a;#o;#i;#p;#d=[];constructor(e,t,r){super(),this.#e=e,this.#s=r,this.#r=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,Zi.batch(()=>{const r=this.#n,n=this.#u(this.#r);n.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=n.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=r.length!==s.length,l=s.some((d,f)=>d!==r[f]),c=i||l,u=c?!0:a.some((d,f)=>{const h=this.#t[f];return!h||!pI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(BIe(r,s).forEach(d=>{d.destroy()}),BIe(s,r).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#u(e),n=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=r.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#c(a??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,r){if(t){const n=this.#p,s=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((a,i)=>a!==n[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,r!==void 0&&(this.#p=r),this.#a=Qpe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#e.defaultQueryOptions(n),i=t.get(s.queryHash)?.shift()??new j9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=i2r(this.#t,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&Zi.batch(()=>{this.listeners.forEach(n=>{n(this.#t)})})}}},l2r=class extends S1{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Hpe(n,t);let a=this.get(s);return a||(a=new XMr({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Zi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>RIe(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>RIe(e,r)):t}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new l2r,this.#t=e.mutationCache||new s2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Zpe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=j4.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ex(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(n.queryHash)?.state.data,i=FMr(t,a);if(i!==void 0)return this.#e.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Zi.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Zi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Zi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zi.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(uc).catch(uc)}invalidateQueries(e,t={}){return Zi.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zi.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(uc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(uc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(ex(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(uc).catch(uc)}fetchInfiniteQuery(e){return e.behavior=T4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(uc).catch(uc)}ensureInfiniteQueryData(e){return e.behavior=T4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return j4.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(LS(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{hI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(LS(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{hI(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hpe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Wpe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Jct=b.createContext(void 0),xa=e=>{const t=b.useContext(Jct);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},u2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(Jct.Provider,{value:e,children:t})),eut=b.createContext(!1),tut=()=>b.useContext(eut);eut.Provider;function d2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var f2r=b.createContext(d2r()),rut=()=>b.useContext(f2r),nut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Gpe(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},sut=e=>{b.useEffect(()=>{e.clearReset()},[e])},aut=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Gpe(r,[e.error,n])),iut=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},h2r=(e,t)=>e.isLoading&&e.isFetching&&!t,cie=(e,t)=>e?.suspense&&t.isPending,uie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function p2r({queries:e,...t},r){const n=xa(),s=tut(),a=rut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{iut(g);const y=n.getQueryCache().get(g.queryHash);nut(g,a,y)}),sut(a);const[l]=b.useState(()=>new o2r(n,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(Zi.batchCalls(g)):uc,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>cie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&cie(x,g)){const w=new j9(n,x);return uie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&aut({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function out(e,t,r){const n=tut(),s=rut(),a=xa(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",iut(i),nut(i,s,l),sut(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Zi.batchCalls(h)):uc;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),cie(i,d))throw uie(i,u,s);if(aut({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!DS&&h2r(d,n)&&(c?uie(i,u,s):l?.promise)?.catch(uc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Ot(e,t){return out(e,j9)}function Kr(e,t){const r=xa(),[n]=b.useState(()=>new a2r(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const s=b.useSyncExternalStore(b.useCallback(i=>n.subscribe(Zi.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((i,l)=>{n.mutate(i,l).catch(uc)},[n]);if(s.error&&Gpe(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function o0(e,t){return out(e,r2r)}var Do=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(Do||{});r1().describe("Database record creation time");var m2r=r1().describe("Database record last update time");m2r.nullable();var T9=_e({page:eSe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:eSe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),N9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),zt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),g2r=_e({start:tSe().optional().describe("Start of date range (inclusive by default)"),end:tSe().optional().describe("End of date range (inclusive by default)"),startExclusive:yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),A9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),_g=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),O1=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),Xpe=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),k1=Et(he()).min(1).describe("Fields to group by"),Kpe=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),Jpe={value:St().nullable().describe("Aggregated value"),previousValue:St().nullable().optional().describe("Value from comparison period"),changePercent:St().nullable().optional().describe("Percentage change from comparison period")},eme=Ws(he(),he().nullable()).describe("Dimension values for this group"),hC=St().describe("Aggregated value"),pC=r1().describe("Bucket timestamp"),tme=St().describe("Percentile value"),rme=St().describe("Percentile value at this bucket"),mC=Xle(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),y2r=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),lut=he().describe("Name of the entity"),cut=he().describe("Human end-user who triggered execution"),uut=he().describe("Multi-tenant organization/account"),dut=he().describe("Broader resource context (Mastra memory compatibility)"),fut=he().describe("Unique execution run identifier"),hut=he().describe("Session identifier for grouping traces"),put=he().describe("Conversation thread identifier"),mut=he().describe("HTTP request ID for log correlation"),gut=he().describe('Environment (e.g., "production" | "staging" | "development")'),v2r=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),yut=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),vut=he().describe("Name of the service"),but=Xle(Do).describe("Entity type of the parent entity"),b2r=he().describe("ID of the parent entity"),xut=he().describe("Name of the parent entity"),wut=Xle(Do).describe("Entity type of the root entity"),x2r=he().describe("ID of the root entity"),Sut=he().describe("Name of the root entity"),Out=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),kut=he().describe("Version ID of the parent entity that produced this signal"),_ut=he().describe("Version ID of the root entity that produced this signal"),I9=he().describe("Experiment or eval run identifier"),w2r=Ws(he(),Aa()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),Eut=Ws(he(),Aa()).describe("User-defined metadata for custom filtering"),Cut=Et(he()).describe("Labels for filtering"),S2r={entityType:mC.nullish(),entityId:y2r.nullish(),entityName:lut.nullish(),parentEntityType:but.nullish(),parentEntityId:b2r.nullish(),parentEntityName:xut.nullish(),rootEntityType:wut.nullish(),rootEntityId:x2r.nullish(),rootEntityName:Sut.nullish(),userId:cut.nullish(),organizationId:uut.nullish(),resourceId:dut.nullish(),runId:fut.nullish(),sessionId:hut.nullish(),threadId:put.nullish(),requestId:mut.nullish(),environment:gut.nullish(),serviceName:vut.nullish(),scope:w2r.nullish(),entityVersionId:Out.nullish(),parentEntityVersionId:kut.nullish(),rootEntityVersionId:_ut.nullish(),experimentId:I9.nullish()},R9={...S2r,executionSource:yut.nullish(),tags:Cut.nullish()};v2r.nullish();var P9={timestamp:g2r.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:mC.optional(),entityName:lut.optional(),entityVersionId:Out.optional(),parentEntityVersionId:kut.optional(),rootEntityVersionId:_ut.optional(),userId:cut.optional(),organizationId:uut.optional(),experimentId:I9.optional(),serviceName:vut.optional(),environment:gut.optional(),parentEntityType:but.optional(),parentEntityName:xut.optional(),rootEntityType:wut.optional(),rootEntityName:Sut.optional(),resourceId:dut.optional(),runId:fut.optional(),sessionId:hut.optional(),threadId:put.optional(),requestId:mut.optional(),executionSource:yut.optional(),tags:Et(he()).optional().describe("Filter by tags (must have all specified tags)")},M9=he().describe("Unique trace identifier"),D9=he().describe("Unique span identifier within a trace"),N4=So(["debug","info","warn","error","fatal"]),jut=he().describe("Log message"),Tut=Ws(he(),Aa()).describe("Structured data attached to the log"),Nut=_e({logId:he().nullish().describe("Unique id for this log event"),timestamp:r1().describe("When the log was created"),level:N4.describe("Log severity level"),message:jut,data:Tut.nullish(),traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:he().nullish().describe("Execution source"),metadata:Eut.nullish()}).describe("Log record as stored in the database");_e({level:N4,message:jut,data:Tut.optional(),tags:Cut.optional()}).describe("User-provided log input");var O2r=Nut;_e({logs:Et(O2r)}).describe("Arguments for batch creating logs");var k2r=_e({...P9,source:he().optional().describe("Filter by execution source"),level:Hr([N4,Et(N4)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),_2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),E2r=_e({field:_2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:k2r.optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:E2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:N9,logs:Et(Nut)});var gC=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Aut=he().describe("Display name of the scorer"),Iut=he().describe("Version of the scorer"),og=he().describe("How the score was produced (e.g., manual, automated, experiment)"),Rut=St().describe("Score value (range defined by scorer)"),Put=he().describe("Explanation for the score"),Mut=_e({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:r1().describe("When the score was recorded"),traceId:M9.nullish().describe("Trace that anchors the scored target when available"),spanId:D9.nullish().describe("Span ID this score applies to"),scorerId:gC,scorerName:Aut.nullish(),scorerVersion:Iut.nullish(),scoreSource:og.nullish(),source:og.nullish(),score:Rut,reason:Put.nullish(),...R9,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(he(),Aa()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:gC,scorerName:Aut.optional(),scorerVersion:Iut.optional(),scoreSource:og.optional(),source:og.optional(),score:Rut,reason:Put.optional(),metadata:Ws(he(),Aa()).optional().describe("Additional scorer-specific metadata"),experimentId:I9.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:mC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var nme=Mut;_e({score:nme}).describe("Arguments for creating a score");_e({score:nme.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(nme)}).describe("Arguments for batch recording scores");var IP=_e({...P9,scorerId:Hr([he(),Et(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:og.optional().describe("Filter by how the score was produced"),source:og.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),C2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),j2r=_e({field:C2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:IP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:j2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:N9,scores:Et(Mut)});_e({scorerId:gC,scoreSource:og.optional(),aggregation:_g,filters:IP.optional(),comparePeriod:Xpe.optional()}).describe("Arguments for getting a score aggregate");_e(Jpe);_e({scorerId:gC,scoreSource:og.optional(),groupBy:k1,aggregation:_g,filters:IP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:eme,value:hC}))});_e({scorerId:gC,scoreSource:og.optional(),interval:O1,aggregation:_g,filters:IP.optional(),groupBy:k1.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:he().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:pC,value:hC}))}))});_e({scorerId:gC,scoreSource:og.optional(),percentiles:Kpe,interval:O1,filters:IP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:tme,points:Et(_e({timestamp:pC,value:rme}))}))});var lg=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),yC=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),Dut=Hr([St(),he()]).describe("Feedback value (rating number or correction text)"),Lut=he().describe("Additional comment or context"),A4=he().describe("User who provided the feedback");function sme(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var L9=_e({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:r1().describe("When the feedback was recorded"),traceId:M9.nullish().describe("Trace that anchors the feedback target when available"),spanId:D9.nullish().describe("Span ID this feedback applies to"),feedbackSource:lg.nullish(),source:lg.nullish(),feedbackType:yC,value:Dut,comment:Lut.nullish(),feedbackUserId:A4.nullish(),...R9,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(he(),Aa()).nullish().describe("User-defined metadata")}),T2r=_e(L9.shape).describe("Feedback record as stored in the database"),N2r=_e({feedbackSource:lg.optional(),source:lg.optional(),feedbackType:yC,value:Dut,comment:Lut.optional(),feedbackUserId:A4.optional(),userId:A4.optional(),metadata:Ws(he(),Aa()).optional().describe("Additional feedback-specific metadata"),experimentId:I9.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});_e(N2r.shape).describe("User-provided feedback input");_e({feedback:tce(sme,L9)}).describe("Arguments for creating feedback");_e({feedback:L9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(tce(sme,L9))}).describe("Arguments for batch recording feedback");var $ut=_e({...P9,feedbackType:Hr([he(),Et(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:lg.optional(),source:lg.optional(),feedbackUserId:A4.optional()}),$9=_e($ut.shape).describe("Filters for querying feedback"),A2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),I2r=_e({field:A2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:tce(sme,$ut).optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:I2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:N9,feedback:Et(T2r)});_e({feedbackType:yC,feedbackSource:lg.optional(),aggregation:_g,filters:$9.optional(),comparePeriod:Xpe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(Jpe);_e({feedbackType:yC,feedbackSource:lg.optional(),groupBy:k1,aggregation:_g,filters:$9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:eme,value:hC}))});_e({feedbackType:yC,feedbackSource:lg.optional(),interval:O1,aggregation:_g,filters:$9.optional(),groupBy:k1.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:he().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:pC,value:hC}))}))});_e({feedbackType:yC,feedbackSource:lg.optional(),percentiles:Kpe,interval:O1,filters:$9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:tme,points:Et(_e({timestamp:pC,value:rme}))}))});So(["counter","gauge","histogram"]);var Fut=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),zut=St().describe("Metric value"),But=Ws(he(),he()).describe("Metric labels for dimensional filtering"),Uut=he().describe("Model provider"),Vut=he().describe("Model"),R2r=St().describe("Estimated cost"),qut=he().describe("Unit for the estimated cost (e.g., usd)"),P2r=Ws(he(),Aa()).nullish().describe("Structured costing metadata"),Hut=_e({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:r1().describe("When the metric was recorded"),name:Fut,value:zut,traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:he().nullish().describe("Execution source"),provider:Uut.nullish(),model:Vut.nullish(),estimatedCost:R2r.nullish(),costUnit:qut.nullish(),costMetadata:P2r.nullish(),labels:But.default({}),metadata:Eut.nullish()}).describe("Metric record as stored in the database");_e({name:Fut,value:zut,labels:But.optional()}).describe("User-provided metric input");var M2r=Hut;_e({metrics:Et(M2r)}).describe("Arguments for batch recording metrics");_e({type:_g,interval:O1.optional(),groupBy:k1.optional()}).describe("Metrics aggregation configuration");var RP=_e({...P9,name:Et(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:Uut.optional(),model:Vut.optional(),costUnit:qut.optional(),labels:Ws(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),D2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),L2r=_e({field:D2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:RP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:L2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");_e({pagination:N9,metrics:Et(Hut)});_e({name:Et(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:_g,filters:RP.optional(),comparePeriod:Xpe.optional()}).describe("Arguments for getting a metric aggregate");_e({...Jpe,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:St().nullable().optional().describe("Percentage change in estimated cost from comparison period")});_e({name:Et(he()).nonempty().describe("Metric name(s) to break down"),groupBy:k1,aggregation:_g,filters:RP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:eme,value:hC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(he()).nonempty().describe("Metric name(s)"),interval:O1,aggregation:_g,filters:RP.optional(),groupBy:k1.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:pC,value:hC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:he().describe("Metric name"),percentiles:Kpe,interval:O1,filters:RP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:tme,points:Et(_e({timestamp:pC,value:rme}))}))});_e({prefix:he().optional().describe("Filter metric names by prefix"),limit:St().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");_e({names:Et(he()).describe("Distinct metric names")});_e({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(he()).describe("Distinct label keys for the metric")});_e({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().optional().describe("Filter values by prefix"),limit:St().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");_e({values:Et(he()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(mC).describe("Distinct entity types")});_e({entityType:mC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(he()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(he()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(he()).describe("Distinct environments")});_e({entityType:mC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(he()).describe("Distinct tags")});const Ql={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},PP="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",$2r="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",F2r="rounded-md",ame="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",ime="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ome="disabled:opacity-50 disabled:cursor-not-allowed";function Qut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Qut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Wut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Qut(e))&&(n&&(n+=" "),n+=t);return n}const z2r=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},B2r=(e,t)=>({classGroupId:e,validator:t}),Gut=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),I4="-",UIe=[],U2r="arbitrary..",V2r=e=>{const t=H2r(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return q2r(i);const l=i.split(I4),c=l[0]===""&&l.length>1?1:0;return Zut(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?z2r(u,c):c:u||UIe}return r[i]||UIe}}},Zut=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Zut(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(I4):e.slice(t).join(I4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},q2r=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?U2r+n:void 0})(),H2r=e=>{const{theme:t,classGroups:r}=e;return Q2r(r,t)},Q2r=(e,t)=>{const r=Gut();for(const n in e){const s=e[n];lme(s,r,n,t)}return r},lme=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];W2r(i,t,r,n)}},W2r=(e,t,r,n)=>{if(typeof e=="string"){G2r(e,t,r);return}if(typeof e=="function"){Z2r(e,t,r,n);return}Y2r(e,t,r,n)},G2r=(e,t,r)=>{const n=e===""?t:Yut(t,e);n.classGroupId=r},Z2r=(e,t,r,n)=>{if(X2r(e)){lme(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(B2r(r,e))},Y2r=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];lme(c,Yut(t,l),r,n)}},Yut=(e,t)=>{let r=e;const n=t.split(I4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Gut(),r.nextPart.set(i,l)),r=l}return r},X2r=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,K2r=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},die="!",VIe=":",J2r=[],qIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),eDr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const y=s[g];if(i===0&&l===0){if(y===VIe){a.push(s.slice(c,g)),c=g+1;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(die)?(h=f.slice(0,-1),p=!0):f.startsWith(die)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return qIe(a,p,h,m)};if(t){const s=t+VIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):qIe(J2r,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},tDr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},rDr=e=>({cache:K2r(e.cacheSize),parseClassName:eDr(e),sortModifiers:tDr(e),...V2r(e)}),nDr=/\s+/,sDr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(nDr);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!g,x=n(y?m.substring(0,g):m);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+die:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,y);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},aDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Xut(r))&&(s&&(s+=" "),s+=n);return s},Xut=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Xut(e[n]))&&(r&&(r+=" "),r+=t);return r},HIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=rDr(u),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=sDr(c,r);return s(c,d),d};return a=i,(...c)=>a(aDr(...c))},iDr=[],Go=e=>{const t=r=>r[e]||iDr;return t.isThemeGetter=!0,t},Kut=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jut=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oDr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cDr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uDr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ob=e=>oDr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),lb=e=>!!e&&Number.isInteger(Number(e)),nQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),ny=e=>lDr.test(e),edt=()=>!0,hDr=e=>cDr.test(e)&&!uDr.test(e),cme=()=>!1,pDr=e=>dDr.test(e),mDr=e=>fDr.test(e),gDr=e=>!vr(e)&&!kr(e),yDr=e=>l0(e,ndt,cme),vr=e=>Kut.test(e),q0=e=>l0(e,sdt,hDr),QIe=e=>l0(e,_Dr,qn),vDr=e=>l0(e,idt,edt),bDr=e=>l0(e,adt,cme),WIe=e=>l0(e,tdt,cme),xDr=e=>l0(e,rdt,mDr),KD=e=>l0(e,odt,pDr),kr=e=>Jut.test(e),cT=e=>_1(e,sdt),wDr=e=>_1(e,adt),GIe=e=>_1(e,tdt),SDr=e=>_1(e,ndt),ODr=e=>_1(e,rdt),JD=e=>_1(e,odt,!0),kDr=e=>_1(e,idt,!0),l0=(e,t,r)=>{const n=Kut.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},_1=(e,t,r=!1)=>{const n=Jut.exec(e);return n?n[1]?t(n[1]):r:!1},tdt=e=>e==="position"||e==="percentage",rdt=e=>e==="image"||e==="url",ndt=e=>e==="length"||e==="size"||e==="bg-size",sdt=e=>e==="length",_Dr=e=>e==="number",adt=e=>e==="family-name",idt=e=>e==="number"||e==="weight",odt=e=>e==="shadow",ZIe=()=>{const e=Go("color"),t=Go("font"),r=Go("text"),n=Go("font-weight"),s=Go("tracking"),a=Go("leading"),i=Go("breakpoint"),l=Go("container"),c=Go("spacing"),u=Go("radius"),d=Go("shadow"),f=Go("inset-shadow"),h=Go("text-shadow"),p=Go("drop-shadow"),m=Go("blur"),g=Go("perspective"),y=Go("aspect"),x=Go("ease"),w=Go("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),kr,vr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,vr,c],N=()=>[ob,"full","auto",...j()],I=()=>[lb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",lb,kr,vr]},lb,kr,vr],R=()=>[lb,"auto",kr,vr],B=()=>["auto","min","max","fr",kr,vr],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[ob,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[ob,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[ob,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),GIe,WIe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",SDr,yDr,{size:[kr,vr]}],W=()=>[nQ,cT,q0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,cT,q0],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[qn,nQ,GIe,WIe],ie=()=>["","none",m,kr,vr],fe=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[ob,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ny],breakpoint:[ny],color:[edt],container:[ny],"drop-shadow":[ny],ease:["in","out","in-out"],font:[gDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ny],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ny],shadow:[ny],spacing:["px",qn],text:[ny],"text-shadow":[ny],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ob,vr,kr,y]}],container:["container"],columns:[{columns:[qn,vr,kr,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[lb,"auto",kr,vr]}],basis:[{basis:[ob,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,ob,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[lb,"first","last","none",kr,vr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,cT,q0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,kDr,vDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nQ,vr]}],"font-family":[{font:[wDr,bDr,t]}],"font-features":[{"font-features":[vr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,kr,vr]}],"line-clamp":[{"line-clamp":[qn,"none",kr,QIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,vr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,vr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[qn,"from-font","auto",kr,q0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qn,"auto",kr,vr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr,vr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kr,vr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},lb,kr,vr],radial:["",kr,vr],conic:[lb,kr,vr]},ODr,xDr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qn,kr,vr]}],"outline-w":[{outline:["",qn,cT,q0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,JD,KD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,JD,KD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qn,q0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,JD,KD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qn,kr,vr]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[kr,vr]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,vr]}],filter:[{filter:["","none",kr,vr]}],blur:[{blur:ie()}],brightness:[{brightness:[qn,kr,vr]}],contrast:[{contrast:[qn,kr,vr]}],"drop-shadow":[{"drop-shadow":["","none",p,JD,KD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qn,kr,vr]}],"hue-rotate":[{"hue-rotate":[qn,kr,vr]}],invert:[{invert:["",qn,kr,vr]}],saturate:[{saturate:[qn,kr,vr]}],sepia:[{sepia:["",qn,kr,vr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,vr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[qn,kr,vr]}],"backdrop-contrast":[{"backdrop-contrast":[qn,kr,vr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qn,kr,vr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qn,kr,vr]}],"backdrop-invert":[{"backdrop-invert":["",qn,kr,vr]}],"backdrop-opacity":[{"backdrop-opacity":[qn,kr,vr]}],"backdrop-saturate":[{"backdrop-saturate":[qn,kr,vr]}],"backdrop-sepia":[{"backdrop-sepia":["",qn,kr,vr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kr,vr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qn,"initial",kr,vr]}],ease:[{ease:["linear","initial",x,kr,vr]}],delay:[{delay:[qn,kr,vr]}],animate:[{animate:["none",w,kr,vr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,vr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[kr,vr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",kr,vr]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",kr,vr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qn,cT,q0,QIe]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},EDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(GT(e,"cacheSize",t),GT(e,"prefix",r),GT(e,"experimentalParseClassName",n),eL(e.theme,a.theme),eL(e.classGroups,a.classGroups),eL(e.conflictingClassGroups,a.conflictingClassGroups),eL(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),GT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),tL(e.theme,s.theme),tL(e.classGroups,s.classGroups),tL(e.conflictingClassGroups,s.conflictingClassGroups),tL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ldt(e,s,"orderSensitiveModifiers"),e),GT=(e,t,r)=>{r!==void 0&&(e[t]=r)},eL=(e,t)=>{if(t)for(const r in t)GT(e,r,t[r])},tL=(e,t)=>{if(t)for(const r in t)ldt(e,t,r)},ldt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},CDr=(e,...t)=>typeof e=="function"?HIe(ZIe,e,...t):HIe(()=>EDr(ZIe(),e),...t),jDr=Object.keys({...Lb,...k9t}),TDr=Object.keys(N9t),NDr=Object.keys(_9t),ADr=Object.keys(E9t),IDr=Object.keys(O9t),H0=Object.keys(T9t),RDr=Object.keys(C9t).concat(Object.keys(j9t)),PDr=CDr({extend:{theme:{color:jDr,spacing:TDr,radius:IDr,leading:ADr,shadow:RDr},classGroups:{"font-size":[{text:NDr}],h:[{h:H0}],w:[{w:H0}],size:[{size:H0}],"min-h":[{"min-h":H0}],"min-w":[{"min-w":H0}],"max-h":[{"max-h":H0}],"max-w":[{"max-w":H0}]}}});function Y(...e){return PDr(Wut(e))}const MDr={sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em] `,lg:`${Ql.lg} text-ui-lg px-[1em] `},DDr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:ame,light:"",outline:"",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},LDr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",ome,ime),$Dr={light:"default",outline:"default"};function FDr(e){return $Dr[e]??e}function vC(e){const t=FDr(e?.variant||"default"),r=e?.size||"default";return Y(LDr,MDr[r],DDr[t],e?.iconOnly&&"[&>svg]:opacity-75")}function cdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...cdt(r.props.children)):t.push(r)}),t}function zDr(e){const t=cdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}const me=je.forwardRef(({className:e,as:t,size:r="default",variant:n="default",disabled:s,children:a,...i},l)=>{const c=t||"button",u=zDr(a);return o.jsx(c,{ref:l,disabled:s,className:Y(vC({variant:n,size:r,iconOnly:u}),e),...i,children:a})});me.displayName="Button";const ld=W3t,Yr=G3t,Xr=Z3t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(Y3t,{children:o.jsxs(Nqe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n,children:[r,o.jsx(X3t,{className:"fill-surface3"})]})}));Wr.displayName=Nqe.displayName;const Cn=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Cn.displayName="ButtonWithTooltip";const BDr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},Ce=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Y("block",BDr[r],t),...n,children:e}),sn={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},c0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},udt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),R4=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",sn.colors,n),children:e}),ddt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),P4=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",sn.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),fdt=({onClick:e})=>o.jsx(me,{variant:"ghost",className:Y("shrink-0 opacity-0",sn.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ce,{children:o.jsx(Xl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),UDr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},VDr={mono:"font-mono"},pe=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(UDr[r],n&&VDr[n],t),...s}),ma=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),o.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),qDr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),o.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),ume=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),dme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),u0=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),hdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:o.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_22095",children:o.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),pdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[o.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),o.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),o.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),o.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_20513",children:o.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),HDr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),o.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),o.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),F9=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),fme=e=>o.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),QDr=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Mi=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),bC=e=>o.jsx(w9t,{...e}),Di=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),vl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),z9=e=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});function fp(e){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),o.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),o.jsx("path",{d:"M15 2v2"}),o.jsx("path",{d:"M15 20v2"}),o.jsx("path",{d:"M2 15h2"}),o.jsx("path",{d:"M2 9h2"}),o.jsx("path",{d:"M20 15h2"}),o.jsx("path",{d:"M20 9h2"}),o.jsx("path",{d:"M9 2v2"}),o.jsx("path",{d:"M9 20v2"})]})}const mdt=e=>o.jsxs("svg",{className:"h-3 w-3",width:"16",height:"16",viewBox:"0 0 181 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[o.jsx("path",{d:"M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",fill:"#FF9900"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",fill:"#FF9900"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1480_1723",children:o.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),WDr=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),GDr=e=>o.jsx("svg",{className:"h-3 w-3",fill:"white",height:"78",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"78",style:{color:"currentcolor"},...e,children:o.jsx("g",{transform:"translate(0,2)",children:o.jsx("path",{d:"M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",fill:"currentColor"})})}),gdt=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...e,children:o.jsx("path",{d:"M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",fill:"#0089D6",style:{fill:"#0089D6",fillOpacity:1}})}),ZDr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[o.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:o.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),o.jsxs("g",{mask:"url(#mask0_174_2406)",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",fill:"#39594D"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",fill:"#D18EE2"}),o.jsx("path",{d:"M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",fill:"#FF7759"})]})]}),YDr=e=>o.jsxs("svg",{className:"h-3 w-3","data-testid":"geist-icon",height:"78",strokeLinejoin:"round",viewBox:"0 0 160 59",width:"104",style:{color:"currentcolor"},...e,children:[o.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:o.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),o.jsx("g",{mask:"url(#mask0_4345_1846)",children:o.jsx("path",{d:"M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",fill:"currentColor"})})]}),XDr=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:e.fill||"currentColor"})}),KDr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"176",height:"162",viewBox:"0 0 176 162",fill:"none",...e,children:[o.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),o.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),JDr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[o.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[o.jsx("path",{d:"M34.593 94.0509H33.3844L27.3514 88.0179V86.8094L36.5743 77.5866H42.9639L43.8158 78.4385V84.8281L34.593 94.0509Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M27.3514 25.816V24.6074L33.3844 18.5744H34.593L43.8158 27.7972V34.1868L42.9639 35.0388H36.5743L27.3514 25.816Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M80.4594 74.6047H71.6824L70.9493 73.8717V53.3259C70.9493 49.6705 69.5129 46.8372 65.1046 46.7382C62.836 46.6787 60.2405 46.7382 57.4668 46.8471L57.0507 47.2731V73.8618L56.3176 74.5948H47.5406L46.8075 73.8618V38.7636L47.5406 38.0305H67.2939C74.9713 38.0305 81.1925 44.2517 81.1925 51.9291V73.8717L80.4594 74.6047Z",fill:e.fill||"#014847"}),o.jsx("path",{d:"M35.8412 61.4491H0.73307L0 60.716V51.9192L0.73307 51.1861H35.8412L36.5743 51.9192V60.716L35.8412 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M127.277 61.4491H92.1687L91.4356 60.716V51.9192L92.1687 51.1861H127.277L128.01 51.9192V60.716L127.277 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 27.0642V0.73307L59.6759 0H68.4727L69.2058 0.73307V27.0642L68.4727 27.7972H59.6759L58.9428 27.0642Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 111.902V85.5711L59.6759 84.838H68.4727L69.2058 85.5711V111.902L68.4727 112.635H59.6759L58.9428 111.902Z",fill:e.fill||"#05BDBA"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_236_138",children:o.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),YIe=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),eLr=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:"78",height:"78",style:{color:"currentcolor"},...e,children:o.jsxs("g",{children:[o.jsx("polygon",{fill:"currentColor",points:"226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"}),o.jsx("polygon",{fill:"currentColor",points:"348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"}),o.jsx("polygon",{fill:"currentColor",points:"651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"}),o.jsx("polygon",{fill:"currentColor",points:"673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"})]})}),tLr={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},rLr={warning:BE,destructive:TF,info:$R},Bl=({children:e,variant:t="destructive",className:r})=>{const n=rLr[t];return o.jsx("div",{className:Y(tLr[t],"p-3 rounded-md border shadow-sm",sn.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(Ce,{className:"mt-0.5 shrink-0",children:o.jsx(n,{})}),o.jsx("div",{className:"text-neutral4",children:e})]})})},Ul=({children:e,as:t="h5"})=>o.jsx(pe,{as:t,variant:"ui-md",className:"font-semibold",children:e}),$u=({children:e,as:t="p"})=>o.jsx(pe,{as:t,variant:"ui-sm",children:e}),nLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},ydt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(nLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",sn.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(pe,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),sLr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},aLr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},vt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",sn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":sLr[t],r),...s,children:[e&&o.jsx("span",{className:aLr[t],children:o.jsx(Ce,{children:e})}),n]}),Ya=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),jr=({className:e,as:t,isCurrent:r,action:n,...s})=>{const a=t||"span";return o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"flex h-full shrink-0 items-center gap-1",children:[o.jsx(a,{"aria-current":r?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",sn.colors,r?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),n]}),!r&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ce,{className:Y("text-neutral2",sn.colors),children:o.jsx(QDr,{})})})]})};function iLr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))n(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))n(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function oLr(e){const t=iLr(e);return ZWe({override:[lLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function lLr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const l=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,h)=>{const g=u.state.sliceDoc(h,h+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:h,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const cLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,uLr=er.mark({class:"cm-variable-highlight"}),XIe=new cWe({regexp:cLr,decoration:()=>uLr}),dLr=Oi.fromClass(class{decorations;constructor(e){this.decorations=XIe.createDeco(e)}update(e){this.decorations=XIe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),fLr=dLr,hLr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Xl,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",actionButton:"bg-white! flex items-center justify-center font-medium text-black! order-last hover:opacity-80"}};function rf(e){const{classNames:t,...r}=hLr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Y(t?.title,n?.title),toast:Y(t?.toast,n?.toast),cancelButton:Y(t?.cancelButton,n?.cancelButton),actionButton:Y(t?.actionButton,n?.actionButton),description:Y(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>vc(r,rf(t)));if(je.isValidElement(e))return vc(e,rf(t));if(typeof e=="string")return vc(e,rf(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent1 shrink-0",children:o.jsx(dzt,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.success(e,rf(r));case"object":return e.forEach(n=>vc.success(n,rf(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(jHe,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.error(e,rf(r));case"object":return e.forEach(n=>vc.error(n,rf(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(TF,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.warning(e,rf(r));case"object":return e.forEach(n=>vc.warning(n,rf(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx($R,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.info(e,rf(r));case"object":return e.forEach(n=>vc.info(n,rf(r)))}};ze.custom=(e,t={})=>vc(e,rf(t));ze.dismiss=e=>{e&&vc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>vc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...rf(i)});function ff({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}function Ka({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=ff({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(fv,{}):o.jsx(NHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const pLr="mastra-theme",mLr="mastra-playground-store",fie=e=>e==="dark"||e==="light"||e==="system",gLr=e=>{try{const t=e.getItem(mLr);if(!t)return;const n=JSON.parse(t)?.state?.theme;return fie(n)?n:void 0}catch{return}},yLr=(e=pLr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(fie(t))return t;const r=gLr(window.localStorage);return r?(window.localStorage.setItem(e,r),r):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const r=n=>{if(n.key===e){if(n.newValue===null){t(null);return}fie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),vdt=b.createContext(null),bdt="(prefers-color-scheme: dark)",vLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,xdt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(bdt).matches?"dark":"light",wdt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(bdt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},bLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},Sdt=({children:e,defaultTheme:t="system",storageKey:r,target:n})=>{const s=b.useMemo(()=>yLr(r),[r]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(wdt,xdt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;vLr(()=>{const f=n??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&bLr(f,u),a.current=f},[u,n]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(vdt.Provider,{value:d,children:e})},xLr=()=>{},xC=()=>{const e=b.useContext(vdt),t=b.useSyncExternalStore(wdt,xdt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:xLr},[e,t])};function wLr(){const e=WE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)",caret:"var(--neutral6)"},styles:[{tag:[ne.className,ne.propertyName],color:"var(--neutral6)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ne.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ft.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]}function SLr(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--neutral3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:"color-mix(in srgb, var(--accent3) 22%, transparent) !important"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}}),t=$p.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ne.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:[ne.deleted],color:"var(--accent2)"},{tag:ne.invalid,color:"var(--error)"},{tag:[ne.standard(ne.tagName)],color:"var(--accent1)"}]);return[e,Yx(t)]}const kv=()=>{const e=xC().resolvedTheme==="dark";return b.useMemo(()=>e?wLr():SLr(),[e])},Xn=b.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...h},p)=>{const m=kv(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Xd):a==="markdown"&&(x.push(que({base:pS,codeLanguages:yZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(fLr),c&&a==="markdown"&&x.push(oLr(c)),f===!1&&x.push(zn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(Ka,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(xc,{ref:p,value:g,theme:m,extensions:y,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function OLr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-Cc35J9cg.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function Ja({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&o.jsx("div",{className:"mt-5",children:n})]})}const kf=({children:e,className:t,onClick:r})=>o.jsx("div",{tabIndex:r?0:void 0,onKeyDown:n=>{r&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",r&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:r,children:e}),Odt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),_f=({children:e,className:t})=>o.jsx(pe,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Ef=({children:e,className:t})=>o.jsx(pe,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),Cf=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Zs({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return o.jsx(Ja,{className:s,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(o9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function na({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=Ge(),i=b.useCallback(async()=>{try{s(!0);const{baseUrl:l="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),h=`${l}${d}/auth/sso/login?${f}`,p=await fetch(h,{credentials:"include",headers:{"Content-Type":"application/json"}});if(p.ok){const m=await p.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(Ja,{className:r,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(e9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(me,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const En=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Zu=({children:e})=>o.jsx(pe,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),pu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),kLr=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),tx=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:"currentColor"})}),_Lr={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},ELr=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Y("w-full",_Lr[r],e),style:n,children:t}),CLr=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),jLr=({className:e,children:t,...r})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),TLr=({className:e,children:t,...r})=>o.jsx("tbody",{className:Y("",e),...r,children:t}),NLr=b.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),ALr=({className:e,children:t,...r})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),KIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,JIe=Wut,wC=(e,t)=>r=>{var n;if(t?.variants==null)return JIe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],f=a?.[u];if(d===null)return null;const h=KIe(d)||KIe(f);return s[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,f,h]:u},[]);return JIe(e,i,c,r?.class,r?.className)},ILr=wC(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(ame,ime,ome),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:"px-2 py-1.5 text-ui-sm",md:"px-3 py-2 text-ui-sm",default:"px-3 py-2 text-ui-md",lg:"px-4 py-3 text-ui-sm"}},defaultVariants:{variant:"default",size:"default"}}),bc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Y(ILr({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));bc.displayName="Textarea";const RLr=cXt,PLr=uXt,kdt=dXt;function Bt({open:e,onOpenChange:t,children:r}){return o.jsx(RLr,{open:e,onOpenChange:t,children:r})}const hme=b.forwardRef(({className:e,...t},r)=>o.jsx(XYe,{className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-150",e),...t,ref:r}));hme.displayName=XYe.displayName;const _dt=b.forwardRef(({className:e,...t},r)=>o.jsxs(kdt,{children:[o.jsx(hme,{}),o.jsx(KYe,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border1 bg-surface3 p-6 shadow-dialog rounded-md","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=closed]:duration-150",e),...t})]}));_dt.displayName=KYe.displayName;const Edt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});Edt.displayName="AlertDialogHeader";const Cdt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cdt.displayName="AlertDialogFooter";const jdt=b.forwardRef(({className:e,...t},r)=>o.jsx(tXe,{ref:r,className:Y("text-lg font-semibold",e),...t}));jdt.displayName=tXe.displayName;const Tdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rXe,{ref:r,className:Y("text-sm text-neutral3",e),...t}));Tdt.displayName=rXe.displayName;const Ndt=b.forwardRef(({className:e,...t},r)=>o.jsx(JYe,{ref:r,className:Y(vC({variant:"primary",size:"default"}),e),...t}));Ndt.displayName=JYe.displayName;const Adt=b.forwardRef(({className:e,...t},r)=>o.jsx(eXe,{ref:r,className:Y(vC({variant:"default",size:"default"}),"mt-2 sm:mt-0",e),...t}));Adt.displayName=eXe.displayName;Bt.Trigger=PLr;Bt.Portal=kdt;Bt.Overlay=hme;Bt.Content=_dt;Bt.Header=Edt;Bt.Footer=Cdt;Bt.Title=jdt;Bt.Description=Tdt;Bt.Action=Ndt;Bt.Cancel=Adt;const fi=b.forwardRef(({className:e,...t},r)=>o.jsx(sde,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",sn.all,"hover:border-neutral5 hover:shadow-md",PP,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(iXe,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(fv,{className:"h-3.5 w-3.5 stroke-3"})})}));fi.displayName=sde.displayName;const Ap=bXt,jh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(ide,{ref:n,className:Y("-outline-offset-2",sn.colors,c0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));jh.displayName=ide.displayName;const Th=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(lde,{ref:n,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));Th.displayName=lde.displayName;const gn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",sn.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",sn.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",sn.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",sn.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Kl({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="inputLike",size:u="default",open:d,onOpenChange:f,container:h,error:p}){const m=e.find(y=>y.value===t)??null,g=y=>{y&&r?.(y.value)};return o.jsxs("div",{className:gn.root,children:[o.jsxs(cKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(yKe,{className:Y(vC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(YJt,{placeholder:n})]}),o.jsx(jF,{className:gn.chevron})]}),o.jsx(wKe,{container:h,children:o.jsx(kKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(_Ke,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(__,{className:gn.searchIcon}),o.jsx(gKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(NKe,{className:gn.empty,children:a}),o.jsx(bKe,{className:gn.list,children:y=>o.jsxs(TKe,{value:y,className:Y(gn.item,gn.itemSelected),children:[o.jsx("span",{className:gn.checkContainer,children:o.jsx(Ler,{children:o.jsx(fv,{className:gn.checkIcon})})}),o.jsxs("span",{className:gn.optionContent,children:[y.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:gn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:gn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}function Idt({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:h,error:p}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&r?.(x.map(w=>w.value))},y=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:gn.root,children:[o.jsxs(cKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(yKe,{className:Y(vC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&gn.placeholder),children:y}),o.jsx(jF,{className:gn.chevron})]}),o.jsx(wKe,{container:h,children:o.jsx(kKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(_Ke,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(__,{className:gn.searchIcon}),o.jsx(gKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(NKe,{className:gn.empty,children:a}),o.jsx(bKe,{className:gn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(TKe,{value:x,className:gn.item,children:[o.jsx("span",{className:Y(gn.checkbox,w?gn.checkboxSelected:gn.checkboxUnselected),children:w&&o.jsx(fv,{className:gn.checkboxIcon})}),o.jsxs("span",{className:gn.optionContent,children:[x.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:gn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:gn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}const Sn=YF,Rdt=LYe,MLr=XF,DLr=YR,Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(GR,{ref:r,className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Pdt.displayName=GR.displayName;const yn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(MLr,{children:[o.jsx(Pdt,{}),o.jsxs(ZR,{ref:n,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-bottom-4","data-[state=open]:slide-in-from-bottom-4",e),...r,children:[t,o.jsxs(YR,{className:Y("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[o.jsx(Xl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yn.displayName=ZR.displayName;const On=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});On.displayName="DialogHeader";const hf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const vn=b.forwardRef(({className:e,...t},r)=>o.jsx(KF,{ref:r,className:Y("text-ui-md font-medium",e),...t}));vn.displayName=KF.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(JF,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=JF.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(ad,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Mdt.displayName=ad.displayName;const LLr=({children:e,title:t="Command Palette",description:r="Search for commands and actions",...n})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(h=>c.includes(h))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx(Sn,{...n,children:o.jsxs(yn,{className:"overflow-hidden p-0",children:[o.jsx(vn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(Mdt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5","**:[[cmdk-input]]:h-12","**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3","[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"),children:e})]})})},Ddt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",sn.colors),"cmdk-input-wrapper":"",children:[o.jsx(__,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors)}),o.jsx(ad.Input,{ref:r,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",sn.colors,e),...t})]}));Ddt.displayName=ad.Input.displayName;const Ldt=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Ldt.displayName=ad.List.displayName;const $dt=b.forwardRef((e,t)=>o.jsx(ad.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));$dt.displayName=ad.Empty.displayName;const gb=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.Group,{ref:r,className:Y("overflow-hidden p-1 text-neutral5","**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3",e),...t}));gb.displayName=ad.Group.displayName;const cw=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));cw.displayName=ad.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.Item,{ref:r,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",sn.colors,"data-[selected=true]:bg-surface5 data-[selected=true]:text-neutral5","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=ad.Item.displayName;const Fdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});Fdt.displayName="CommandShortcut";function zdt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const $Lr=Prr,FLr=Mrr,zLr=aP,BLr=$rr,ULr=Drr,pme=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Bdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(RJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Bdt.displayName=RJe.displayName;const Udt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(zJe,{ref:s,className:Y(pme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(Fce,{className:"-rotate-90 opacity-50"})})]}));Udt.displayName=zJe.displayName;const Vdt=b.forwardRef(({className:e,...t},r)=>o.jsx(aP,{children:o.jsx(fz,{ref:r,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));Vdt.displayName=fz.displayName;const qdt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(aP,{container:t,children:o.jsx(PJe,{ref:s,sideOffset:r,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...n})}));qdt.displayName=PJe.displayName;const Hdt=b.forwardRef(({className:e,...t},r)=>o.jsx(DJe,{ref:r,className:Y(pme,e),...t}));Hdt.displayName=DJe.displayName;const Qdt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(LJe,{ref:s,className:Y(pme,"w-full gap-4 px-2",e),checked:r,...n,children:[o.jsx("div",{className:"border dark:border-white/20 border-black/20 flex h-4 w-4 items-center justify-center rounded-sm",children:r&&o.jsx(fv,{})}),t]}));Qdt.displayName=LJe.displayName;const Wdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs($Je,{ref:n,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Lrr,{children:o.jsx(THe,{className:"h-2 w-2 fill-current"})})}),t]}));Wdt.displayName=$Je.displayName;const Gdt=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(MJe,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Gdt.displayName=MJe.displayName;const Zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(FJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Zdt.displayName=FJe.displayName;const Ydt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});Ydt.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx($Lr,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Bdt;yt.Content=qdt;yt.Group=FLr;yt.Portal=zLr;yt.Item=Hdt;yt.CheckboxItem=Qdt;yt.RadioItem=Wdt;yt.Label=Gdt;yt.Separator=Zdt;yt.Shortcut=Ydt;yt.Sub=BLr;yt.SubContent=Vdt;yt.SubTrigger=Udt;yt.RadioGroup=ULr;const rL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Ln({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const Xdt=({icon:e,title:t,isLoading:r,children:n})=>o.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[o.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(Ln,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(pe,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function VLr({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function qLr({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx(BE,{})," ",e]})}function HLr({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function QLr({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":n==="bigger"},s),children:[e,r&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function WLr({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":r==="horizontal"},t),style:r==="horizontal"&&n?{gridTemplateColumns:`${n} 1fr`}:void 0,children:e})}const mo=Object.assign({},{Layout:WLr,Column:VLr,Label:QLr,HelpText:HLr,ErrorMsg:qLr});function GLr({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function ZLr({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(ZLr,{Column:GLr});const YLr=wC(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(ame,ime,ome),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em]`,lg:`${Ql.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),ar=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(YLr({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));ar.displayName="Input";function Cx({name:e,value:t,label:r,labelIsHidden:n=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:h="default",testId:p,className:m,...g}){return o.jsxs(mo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(Ku,{children:r}):r})}):null,o.jsxs(mo.Column,{children:[!n&&d==="vertical"?o.jsx(mo.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(ar,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(mo.HelpText,{children:a}),i&&o.jsx(mo.ErrorMsg,{children:i})]})]})}function jx({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:h,size:p,isMinimized:m,onMinimizedChange:g}){const y=b.useRef(null);return b.useEffect(()=>{m===!1&&y.current?.focus()},[m]),m?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(__,{})})}),o.jsx(Wr,{children:i||"Search"})]}):o.jsxs(mo.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:l?o.jsx(Ku,{children:i}):i})}):null,o.jsxs(mo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(mo.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(ar,{ref:y,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Y(p==="sm"&&"pl-8 pr-8",p==="md"&&"pl-9 pr-9",(!p||p==="default")&&"pl-10 pr-10",p==="lg"&&"pl-11 pr-11")}),o.jsx(__,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",p==="sm"&&"w-3.5 h-3.5",p==="md"&&"w-4 h-4",(!p||p==="default")&&"w-[1.125rem] h-[1.125rem]",p==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(me,{variant:"ghost",size:p||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(Xl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const hi=hnr,pi=pnr,ei=b.forwardRef(({className:e,children:t,variant:r="inputLike",size:n="default",...s},a)=>o.jsxs(fet,{ref:a,className:Y(vC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(mnr,{asChild:!0,children:o.jsx(Fce,{className:Y("h-4 w-4 text-neutral3",sn.colors)})})]}));ei.displayName=fet.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(gnr,{children:o.jsx(het,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:o.jsx(ynr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=het.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(pet,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",sn.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-disabled:pointer-events-none data-disabled:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(bnr,{children:o.jsx(fv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(vnr,{children:t})]}));ss.displayName=pet.displayName;function $o({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:h="Select an option",onValueChange:p,className:m}){return o.jsxs(mo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:c?o.jsx(Ku,{children:l}):l})}):null,o.jsxs(mo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(mo.Label,{name:e,required:n,children:l}):null,o.jsxs(hi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(pi,{placeholder:h})}),o.jsx(ti,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const XLr={sm:`${Ql.sm} w-form-sm`,md:`${Ql.md} w-form-md`,lg:`${Ql.lg} w-form-lg`,default:`${Ql.default}`},KLr={sm:"sm",md:"default",lg:"lg",default:"default"},JLr={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},e$r="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",jn=je.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},l)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("button",{ref:l,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:Y(e$r,PP,JLr[s],XLr[n],a&&"active:scale-100",e),...i,children:o.jsx(Ce,{size:KLr[n],children:t})})}),o.jsx(Wr,{children:r})]}));jn.displayName="IconButton";const t$r=wC("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(get,{ref:r,className:Y(t$r(),e),...t}));xt.displayName=get.displayName;function rE({children:e}){const t=e.replace(/\\n/g,`
290
+ `).concat(k.x,",").concat(k.y),E=kl(e.id)?YA("recharts-radial-line-"):e.id;return b.createElement("text",_y({},n,{dominantBaseline:"central",className:ba("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},xNr=(e,t,r)=>{var{cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(r==="outside"){var{x:d,y:f}=Hl(n,s,i+t,u);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(a+i)/2,{x:p,y:m}=Hl(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},_$=e=>e!=null&&"cx"in e&&qr(e.cx),wNr={angle:0,offset:5,zIndex:Yc.label,position:"middle",textBreakAll:!1};function SNr(e){if(!_$(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function Ob(e){var t=id(e,wNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=gNr(),h=qlt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:_$(r)?m=r:m=whe(r);var x=SNr(m);if(!m||kl(a)&&kl(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=QT(QT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=TAe(w,lNr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=TAe(w,cNr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=yNr(t);var T=iu(t);if(_$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return bNr(t,s,g,T,m);y=xNr(m,t.offset,t.position)}else{if(!x)return null;var j=oNr({viewBox:x,position:s,offset:t.offset,parentViewBox:_$(n)?void 0:n});y=QT(QT({x:j.x,y:j.y,textAnchor:j.horizontalAnchor,verticalAnchor:j.verticalAnchor},j.width!==void 0?{width:j.width}:{}),j.height!==void 0?{height:j.height}:{})}return b.createElement(Ov,{zIndex:t.zIndex},b.createElement(Cpe,_y({ref:d,className:ba("recharts-label",c)},T,y,{textAnchor:Flt(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}Ob.displayName="Label";var ONr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(Ob,_y({key:"label-implicit"},n)):sg(e)?b.createElement(Ob,_y({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===Ob?b.cloneElement(e,QT({key:"label-implicit"},n)):b.createElement(Ob,_y({key:"label-implicit",content:e},n)):jpe(e)?b.createElement(Ob,_y({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(Ob,_y({},e,{key:"label-implicit"},n)):null};function kNr(e){var{label:t,labelRef:r}=e,n=qlt();return ONr(t,n,r)||null}var _Nr=["valueAccessor"],ENr=["dataKey","clockWise","id","textBreakAll","zIndex"];function w4(){return w4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w4.apply(null,arguments)}function AAe(e,t){if(e==null)return{};var r,n,s=CNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function CNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var jNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(JTr(t))return t},Hlt=b.createContext(void 0),TNr=Hlt.Provider,Qlt=b.createContext(void 0);Qlt.Provider;function NNr(){return b.useContext(Hlt)}function ANr(){return b.useContext(Qlt)}function E$(e){var{valueAccessor:t=jNr}=e,r=AAe(e,_Nr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=AAe(r,ENr),u=NNr(),d=ANr(),f=u||d;return!f||!f.length?null:b.createElement(Ov,{zIndex:l??Yc.label},b.createElement(Zy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=kl(n)?t(h,p):Yl(h.payload,n),y=kl(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(Ob,w4({key:"label-".concat(p)},iu(h),c,y,{fill:(m=r.fill)!==null&&m!==void 0?m:h.fill,parentViewBox:h.parentViewBox,value:g,textBreakAll:i,viewBox:h.viewBox,index:p,zIndex:0}))})))}E$.displayName="LabelList";function INr(e){var{label:t}=e;return t?t===!0?b.createElement(E$,{key:"labelList-implicit"}):b.isValidElement(t)||jpe(t)?b.createElement(E$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(E$,w4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Qae(){return Qae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qae.apply(null,arguments)}var Wlt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=ba("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Qae({},ng(e),fhe(e),{className:a,cx:t,cy:r,r:n})):null},RNr={radiusAxis:{},angleAxis:{}},Glt=jc({name:"polarAxis",initialState:RNr,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:vPn,removeRadiusAxis:bPn,addAngleAxis:xPn,removeAngleAxis:wPn}=Glt.actions,PNr=Glt.reducer;function MNr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WH={exports:{}},Ks={};var IAe;function DNr(){if(IAe)return Ks;IAe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case r:case s:case n:case u:case d:return y;default:switch(y=y&&y.$$typeof,y){case l:case i:case c:case h:case f:case a:return y;default:return x}}case t:return x}}}return Ks.ContextConsumer=i,Ks.ContextProvider=a,Ks.Element=e,Ks.ForwardRef=c,Ks.Fragment=r,Ks.Lazy=h,Ks.Memo=f,Ks.Portal=t,Ks.Profiler=s,Ks.StrictMode=n,Ks.Suspense=u,Ks.SuspenseList=d,Ks.isAsyncMode=function(){return!1},Ks.isConcurrentMode=function(){return!1},Ks.isContextConsumer=function(y){return g(y)===i},Ks.isContextProvider=function(y){return g(y)===a},Ks.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ks.isForwardRef=function(y){return g(y)===c},Ks.isFragment=function(y){return g(y)===r},Ks.isLazy=function(y){return g(y)===h},Ks.isMemo=function(y){return g(y)===f},Ks.isPortal=function(y){return g(y)===t},Ks.isProfiler=function(y){return g(y)===s},Ks.isStrictMode=function(y){return g(y)===n},Ks.isSuspense=function(y){return g(y)===u},Ks.isSuspenseList=function(y){return g(y)===d},Ks.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===u||y===d||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===a||y.$$typeof===i||y.$$typeof===c||y.$$typeof===m||y.getModuleId!==void 0)},Ks.typeOf=g,Ks}var RAe;function LNr(){return RAe||(RAe=1,WH.exports=DNr()),WH.exports}LNr();var Zlt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,GH={},PAe;function $Nr(){return PAe||(PAe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(GH)),GH}var ZH,MAe;function FNr(){return MAe||(MAe=1,ZH=$Nr().isPlainObject),ZH}var zNr=FNr();const BNr=Uo(zNr);var DAe,LAe,$Ae,FAe,zAe;function BAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function UAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BAe(Object(r),!0).forEach(function(n){UNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UNr(e,t,r){return(t=VNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VNr(e){var t=qNr(e,"string");return typeof t=="symbol"?t:t+""}function qNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S4(){return S4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S4.apply(null,arguments)}function iT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var VAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(DAe||(DAe=iT(["M ",",",""])),e,t),i+=Qi(LAe||(LAe=iT(["L ",",",""])),e+r,t),i+=Qi($Ae||($Ae=iT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(FAe||(FAe=iT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(zAe||(zAe=iT(["L ",","," Z"])),e,t),i},HNr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},QNr=e=>{var t=id(e,HNr),{x:r,y:n,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,h=b.useRef(null),[p,m]=b.useState(-1),g=b.useRef(s),y=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=_he(e,"trapezoid-");if(b.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var M=h.current.getTotalLength();M&&m(M)}catch{}},[]),r!==+r||n!==+n||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var _=ba("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",S4({},iu(t),{className:_,d:VAe(r,n,s,a,i)})));var E=g.current,T=y.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(p===-1?1:p,"px"),R="".concat(p,"px ").concat(p,"px"),B=dit(["strokeDasharray"],u,c);return b.createElement(khe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},M=>{var F=Lu(E,s,M),U=Lu(T,a,M),z=Lu(j,i,M),H=Lu(N,r,M),Q=Lu(I,n,M);h.current&&(g.current=F,y.current=U,x.current=z,w.current=H,S.current=Q);var L=M>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",S4({},iu(t),{className:_,d:VAe(H,Q,F,U,z),ref:h,style:UAe(UAe({},L),t.style)}))})},WNr=["option","shapeType","activeClassName","inActiveClassName"];function GNr(e,t){if(e==null)return{};var r,n,s=ZNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ZNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function qAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function O4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qAe(Object(r),!0).forEach(function(n){YNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YNr(e,t,r){return(t=XNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XNr(e){var t=KNr(e,"string");return typeof t=="symbol"?t:t+""}function KNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JNr(e,t){return O4(O4({},t),e)}function eAr(e,t){return e==="symbols"}function HAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(mit,r);case"trapezoid":return b.createElement(QNr,r);case"sector":return b.createElement(vit,r);case"symbols":if(eAr(t))return b.createElement(tat,r);break;case"curve":return b.createElement(uit,r);default:return null}}function tAr(e){return b.isValidElement(e)?e.props:e}function rAr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=GNr(e,WNr),i;if(b.isValidElement(t))i=b.cloneElement(t,O4(O4({},a),tAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(BNr(t)&&typeof t!="boolean"){var l=JNr(t,a);i=b.createElement(HAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(HAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Zy,{className:n},i):b.createElement(Zy,{className:s},i)}function nAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=od(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(dCr(t)):s.current!==t&&r(fCr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(hCr(s.current)),s.current=null)},[r]),null}function sAr(e){var{legendPayload:t}=e,r=Vo(),n=od(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(ESr(t)):s.current!==t&&r(CSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(jSr(s.current)),s.current=null)},[r]),null}var YH,aAr=()=>{var[e]=b.useState(()=>YA("uid-"));return e},iAr=(YH=e1.useId)!==null&&YH!==void 0?YH:aAr;function oAr(e,t){var r=iAr();return t||(e?"".concat(e,"-").concat(r):r)}var lAr=b.createContext(void 0),cAr=e=>{var{id:t,type:r,children:n}=e,s=oAr("recharts-".concat(r),t);return b.createElement(lAr.Provider,{value:s},n(s))},uAr={cartesianItems:[],polarItems:[]},Ylt=jc({name:"graphicalItems",initialState:uAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:li()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=fh(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:li()},removeCartesianGraphicalItem:{reducer(e,t){var r=fh(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:li()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:li()},removePolarGraphicalItem:{reducer(e,t){var r=fh(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:li()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=fh(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:li()}}}),{addCartesianGraphicalItem:dAr,replaceCartesianGraphicalItem:fAr,removeCartesianGraphicalItem:hAr,addPolarGraphicalItem:SPn,removePolarGraphicalItem:OPn,replacePolarGraphicalItem:kPn}=Ylt.actions,pAr=Ylt.reducer,mAr=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(dAr(e)):r.current!==e&&t(fAr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(hAr(r.current)),r.current=null)},[t]),null},gAr=b.memo(mAr),yAr=["points"];function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){vAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vAr(e,t,r){return(t=bAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bAr(e){var t=xAr(e,"string");return typeof t=="symbol"?t:t+""}function xAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k4(){return k4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k4.apply(null,arguments)}function wAr(e,t){if(e==null)return{};var r,n,s=SAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function SAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function OAr(e){var{option:t,dotProps:r,className:n}=e;if(b.isValidElement(t))return b.cloneElement(t,r);if(typeof t=="function")return t(r);var s=ba(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=wAr(a,yAr);return b.createElement(Wlt,k4({},l,{className:s}))}function kAr(e,t){return e==null?!1:t?!0:e.length===1}function _Ar(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Yc.scatter}=e;if(!kAr(t,r))return null;var d=Zlt(r),f=Lbr(r),h=t.map((m,g)=>{var y,x,w=XH(XH(XH({r:3},i),f),{},{index:g,cx:(y=m.x)!==null&&y!==void 0?y:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return b.createElement(OAr,{key:"dot-".concat(g),option:r,dotProps:w,className:s})}),p={};return l&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(Ov,{zIndex:u},b.createElement(Zy,k4({className:n},p),h))}function WAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function GAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WAe(Object(r),!0).forEach(function(n){EAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EAr(e,t,r){return(t=CAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CAr(e){var t=jAr(e,"string");return typeof t=="symbol"?t:t+""}function jAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TAr={xAxis:{},yAxis:{},zAxis:{}},Xlt=jc({name:"cartesianAxis",initialState:TAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:li()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:li()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:li()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:li()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:li()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:li()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:li()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:li()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:li()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&n===i[1]&&n!==s.width&&Math.abs(n-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,n].slice(-3);e.yAxis[r]=GAe(GAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:NAr,replaceXAxis:AAr,removeXAxis:IAr,addYAxis:RAr,replaceYAxis:PAr,removeYAxis:MAr,addZAxis:_Pn,replaceZAxis:EPn,removeZAxis:CPn,updateYAxisWidth:DAr}=Xlt.actions,LAr=Xlt.reducer,$Ar=Xe([ec],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),FAr=Xe([$Ar,yv,vv],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Tpe=()=>en(FAr),zAr=()=>en(djr);function ZAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function KH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZAe(Object(r),!0).forEach(function(n){BAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BAr(e,t,r){return(t=UAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UAr(e){var t=VAr(e,"string");return typeof t=="symbol"?t:t+""}function VAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qAr=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KH(KH(KH({},l),zz(s)),fhe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Wlt,c),b.createElement(Zy,{className:"recharts-active-dot",clipPath:i},u)};function HAr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Yc.activeDot}=e,l=en(lI),c=zAr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return kl(u)?null:b.createElement(Ov,{zIndex:i},b.createElement(qAr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var QAr=e=>{var{chartData:t}=e,r=Vo(),n=od();return b.useEffect(()=>n?()=>{}:(r(hAe(t)),()=>{r(hAe(void 0))}),[t,r,n]),null},YAe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Klt=jc({name:"brush",initialState:YAe,reducers:{setBrushSettings(e,t){return t.payload==null?YAe:t.payload}}}),{setBrushSettings:jPn}=Klt.actions,WAr=Klt.reducer;function GAr(e){return(e%180+180)%180}var ZAr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=GAr(s),i=a*Math.PI/180,l=Math.atan(n/r),c=i>l&&i<Math.PI-l?n/Math.sin(i):r/Math.cos(i);return Math.abs(c)},YAr={dots:[],areas:[],lines:[]},Jlt=jc({name:"referenceElements",initialState:YAr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=fh(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=fh(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=fh(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:TPn,removeDot:NPn,addArea:APn,removeArea:IPn,addLine:RPn,removeLine:PPn}=Jlt.actions,XAr=Jlt.reducer,KAr=b.createContext(void 0),JAr=e=>{var{children:t}=e,[r]=b.useState("".concat(YA("recharts"),"-clip")),n=Tpe();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(KAr.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function ect(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function eIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return ZAr(n,r)}function tIr(e,t,r){var n=r==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:n?s:a,end:n?s+i:a+l}:{start:n?s+i:a+l,end:n?s:a}}function uI(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-s)<=0}function rIr(e,t){return ect(e,t+1)}function nIr(e,t,r,n,s){for(var a=(n||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=n?.[c];if(m===void 0)return{v:ect(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||uI(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function sIr(e,t,r,n,s){var a=(n||[]).slice(),i=a.length;if(i===0)return[];for(var{start:l,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=l,h=!0,p=function(){var k=n[g];if(k==null)return 0;var _=g,E,T=()=>(E===void 0&&(E=r(k,_)),E),j=k.coordinate,N=g===d||uI(e,j,T,f,c);if(!N)return h=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=p(),!(m!==0&&m===1));g+=u);if(h){for(var y=[],x=d;x<i;x+=u){var w=n[x];w!=null&&y.push(w)}return y}}return[]}function XAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ic(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XAe(Object(r),!0).forEach(function(n){aIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aIr(e,t,r){return(t=iIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iIr(e){var t=oIr(e,"string");return typeof t=="symbol"?t:t+""}function oIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lIr(e,t,r,n,s){for(var a=(n||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var m=p,g,y=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*y()/2-c);a[h]=m=ic(ic({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=ic(ic({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=uI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=ic(ic({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function cIr(e,t,r,n,s,a){var i=(n||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=n[l-1];if(d!=null){var f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=ic(ic({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=uI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=ic(ic({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var k=S,_,E=()=>(_===void 0&&(_=r(S,w)),_);if(w===0){var T=e*(k.coordinate-e*E()/2-c);i[w]=k=ic(ic({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=ic(ic({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=uI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=ic(ic({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Npe(e,t,r){var{tick:n,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!n)return[];if(qr(c)||xP.isSsr){var h;return(h=rIr(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?NN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?eIr(NN(T,{fontSize:t,letterSpacing:r}),g,f):NN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?dh(w.coordinate-x.coordinate):1,k=tIr(a,S,m);return c==="equidistantPreserveStart"?nIr(S,k,y,s,i):c==="equidistantPreserveEnd"?sIr(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=cIr(S,k,y,s,i,c==="preserveStartEnd"):p=lIr(S,k,y,s,i),p.filter(_=>_.isShow))}var uIr=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=e,i=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>i&&(i=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(r?n:0);return Math.round(u)}return 0},dIr={xAxis:{},yAxis:{}},tct=jc({name:"renderedTicks",initialState:dIr,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:n,ticks:s}=t.payload;e[r][n]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:n}=t.payload;delete e[r][n]}}}),{setRenderedTicks:fIr,removeRenderedTicks:hIr}=tct.actions,pIr=tct.reducer,mIr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function gIr(e,t){if(e==null)return{};var r,n,s=yIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function yIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function IS(){return IS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IS.apply(null,arguments)}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){vIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vIr(e,t,r){return(t=bIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bIr(e){var t=xIr(e,"string");return typeof t=="symbol"?t:t+""}function xIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fy={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Yc.axis};function wIr(e){var{x:t,y:r,width:n,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Hi(Hi(Hi({},c),ng(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Hi(Hi({},u),{},{x1:t,y1:r+d*s,x2:t+n,y2:r+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Hi(Hi({},u),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return b.createElement("line",IS({},u,{className:ba("recharts-cartesian-axis-line",qz(l,"className"))}))}function SIr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,y=e.tickSize||i,x=qr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*y,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*y,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*y,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*y,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function OIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function kIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function _Ir(e){var{option:t,tickProps:r,value:n}=e,s,a=ba(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Hi(Hi({},r),{},{className:a}));else if(typeof t=="function")s=t(Hi(Hi({},r),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=ba(i,MNr(t))),s=b.createElement(Cpe,IS({},r,{className:i}),n)}return s}function EIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return y1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(fIr({ticks:a,axisId:n,axisType:r})),()=>{s(hIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var CIr=b.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:m,height:g,tickSize:y,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=Npe(Hi(Hi({},k),{},{ticks:r}),w,S),N=ng(k),I=zz(n),P=Flt(N.textAnchor)?N.textAnchor:OIr(d,f),R=kIr(d,f),B={};typeof s=="object"&&(B=s);var M=Hi(Hi({},N),{},{fill:"none"},B),F=j.map(H=>Hi({entry:H},SIr(H,h,p,m,g,d,y,f,x))),U=F.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Zy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",IS({},M,L,{className:ba("recharts-cartesian-axis-tick-line",qz(s,"className"))})))}),z=F.map((H,Q)=>{var L,Z,{entry:V,tick:D}=H,W=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},D),{},{index:Q,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Z=u?.angle)!==null&&Z!==void 0?Z:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},W),I);return b.createElement(Zy,IS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},Bxr(_,V,Q)),n&&b.createElement(_Ir,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,Q):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(EIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(Ov,{zIndex:Yc.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),jIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=gIr(e,mIr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return uIr({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=b.useCallback(x=>{if(x){var w=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=w;var S=w[0];if(S){var k=window.getComputedStyle(S),_=k.fontSize,E=k.letterSpacing;(_!==f||E!==p)&&(h(_),m(E))}}},[f,p]);return i||n!=null&&n<=0||s!=null&&s<=0?null:b.createElement(Ov,{zIndex:e.zIndex},b.createElement(Zy,{className:ba("recharts-cartesian-axis",a)},b.createElement(wIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ng(e)}),b.createElement(CIr,{ref:y,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),b.createElement(pNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(kNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ape=b.forwardRef((e,t)=>{var r=id(e,Fy);return b.createElement(jIr,IS({},r,{ref:t}))});Ape.displayName="CartesianAxis";var TIr=["x1","y1","x2","y2","key"],NIr=["offset"],AIr=["xAxisId","yAxisId"],IIr=["xAxisId","yAxisId"];function JAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JAe(Object(r),!0).forEach(function(n){RIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RIr(e,t,r){return(t=PIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PIr(e){var t=MIr(e,"string");return typeof t=="symbol"?t:t+""}function MIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tw(){return Tw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tw.apply(null,arguments)}function _4(e,t){if(e==null)return{};var r,n,s=DIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var LIr=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:n,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function rct(e){var{option:t,lineItemProps:r}=e,n;if(b.isValidElement(t))n=b.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=r,d=_4(r,TIr),f=(s=ng(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=_4(f,NIr);n=b.createElement("line",Tw({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function $Ir(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,AIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(rct,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function FIr(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,IIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(rct,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function zIr(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:a,height:i,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function BIr(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var UIr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Uat(Npe(fc(fc(fc({},Fy),r),{},{ticks:Vat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},VIr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Uat(Npe(fc(fc(fc({},Fy),r),{},{ticks:Vat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},qIr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Yc.grid};function nct(e){var t=Xat(),r=Kat(),n=Yat(),s=fc(fc({},id(e,qIr)),{},{x:qr(e.x)?e.x:n.left,y:qr(e.y)?e.y:n.top,width:qr(e.width)?e.width:n.width,height:qr(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=s,m=od(),g=en(N=>eAe(N,"xAxis",a,m)),y=en(N=>eAe(N,"yAxis",i,m));if(!ag(u)||!ag(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||UIr,w=s.horizontalCoordinatesGenerator||VIr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?fc(fc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);Y5(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!k||!k.length)&&typeof x=="function"){var T=p&&p.length,j=x({xAxis:g?fc(fc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);Y5(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(Ov,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(LIr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(zIr,Tw({},s,{horizontalPoints:S})),b.createElement(BIr,Tw({},s,{verticalPoints:k})),b.createElement($Ir,Tw({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(FIr,Tw({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}nct.displayName="CartesianGrid";var HIr={},sct=jc({name:"errorBars",initialState:HIr,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:MPn,replaceErrorBar:DPn,removeErrorBar:LPn}=sct.actions,QIr=sct.reducer,WIr=["children"];function GIr(e,t){if(e==null)return{};var r,n,s=ZIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ZIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var YIr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},XIr=b.createContext(YIr);function KIr(e){var{children:t}=e,r=GIr(e,WIr);return b.createElement(XIr.Provider,{value:r},t)}function act(e,t){var r,n,s=en(u=>xv(u,e)),a=en(u=>wv(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Yo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Xo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function JIr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Tpe(),{needClipX:a,needClipY:i,needClip:l}=act(t,r);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(n)},b.createElement("rect",{x:a?c:c-d/2,y:i?u:u-f/2,width:a?d:d*2,height:i?f:f*2}))}var ict=(e,t,r,n)=>alt(e,"xAxis",t,n),oct=(e,t,r,n)=>slt(e,"xAxis",t,n),lct=(e,t,r,n)=>alt(e,"yAxis",r,n),cct=(e,t,r,n)=>slt(e,"yAxis",r,n),eRr=Xe([Fi,ict,lct,oct,cct],(e,t,r,n,s)=>gv(e,"xAxis")?Z5(t,n,!1):Z5(r,s,!1)),tRr=(e,t,r,n,s)=>s;function rRr(e){return e.type==="line"}var nRr=Xe([jot,tRr],(e,t)=>e.filter(rRr).find(r=>r.id===t)),sRr=Xe([Fi,ict,lct,oct,cct,nRr,eRr,Ehe],(e,t,r,n,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||r==null||n==null||s==null||n.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=a,p;if(h!=null&&h.length>0?p=h:p=c?.slice(u,d+1),p!=null)return _Rr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function aRr(e){var t=zz(e),r=3,n=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=r),(Number.isNaN(l)||l<0)&&(l=n),{r:i,strokeWidth:l}}return{r,strokeWidth:n}}var iRr=["id"],oRr=["type","layout","connectNulls","needClip","shape"],lRr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function dI(){return dI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dI.apply(null,arguments)}function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){cRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cRr(e,t,r){return(t=uRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uRr(e){var t=dRr(e,"string");return typeof t=="symbol"?t:t+""}function dRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ipe(e,t){if(e==null)return{};var r,n,s=fRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:qat(r,t),payload:e}]},pRr=b.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r,getPosition:y1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:qat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(nAr,{tooltipEntrySettings:f})}),uct=(e,t)=>"".concat(t,"px ").concat(e,"px");function mRr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var gRr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return uct(t,e);for(var s=Math.floor(e/n),a=e%n,i=[],l=0,c=0;l<r.length;c+=(u=r[l])!==null&&u!==void 0?u:0,++l){var u,d=r[l];if(d!=null&&c+d>a){i=[...r.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...mRr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function yRr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Ipe(n,iRr),u=ng(c);return b.createElement(_Ar,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function vRr(e){var{showLabels:t,children:r,points:n}=e,s=b.useMemo(()=>n?.map(a=>{var i,l,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return vm(vm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(TNr,{value:t?s:void 0},r)}function tIe(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=Ipe(a,oRr),h=vm(vm({},iu(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,n?.length>1&&b.createElement(rAr,dI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(yRr,{points:n,clipPathId:t,props:a}))}function bRr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function xRr(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:h,width:p,height:m,onAnimationEnd:g,onAnimationStart:y}=r,x=s.current,w=_he(i,"recharts-line-"),S=b.useRef(w),[k,_]=b.useState(!1),E=!k,T=b.useCallback(()=>{typeof g=="function"&&g(),_(!1)},[g]),j=b.useCallback(()=>{typeof y=="function"&&y(),_(!0)},[y]),N=bRr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(vRr,{points:i,showLabels:E},r.children,b.createElement(khe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Lu(P,N+P,R),M=Math.min(B,N),F;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));F=gRr(M,N,U)}else F=uct(N,M);else F=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,M)),x){var z=x.length/i.length,H=R===1?i:i.map((Q,L)=>{var Z=Math.floor(L*z);if(x[Z]){var V=x[Z];return vm(vm({},Q),{},{x:Lu(V.x,Q.x,R),y:Lu(V.y,Q.y,R)})}return h?vm(vm({},Q),{},{x:Lu(p*2,Q.x,R),y:Lu(m/2,Q.y,R)}):vm(vm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(tIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:F})}return b.createElement(tIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:F})}),b.createElement(INr,{label:r.label}))}function wRr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(xRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var SRr=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Yl(e.payload,t)}};class ORr extends b.Component{render(){var{hide:t,dot:r,points:n,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:h,zIndex:p}=this.props;if(t)return null;var m=ba("recharts-line",s),g=f,{r:y,strokeWidth:x}=aRr(r),w=Zlt(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(Ov,{zIndex:p},b.createElement(Zy,{className:m},h&&b.createElement("defs",null,b.createElement(JIr,{clipPathId:g,xAxisId:a,yAxisId:i}),!w&&b.createElement("clipPath",{id:"clipPath-dots-".concat(g)},b.createElement("rect",{x:c-S/2,y:l-S/2,width:u+S,height:d+S}))),b.createElement(KIr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:SRr,errorBarOffset:0},b.createElement(wRr,{props:this.props,clipPathId:g}))),b.createElement(HAr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var dct={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Yc.line,type:"linear"};function kRr(e){var t=id(e,dct),{activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:h,xAxisId:p,yAxisId:m,id:g}=t,y=Ipe(t,lRr),{needClip:x}=act(p,m),w=Tpe(),S=sC(),k=od(),_=en(I=>sRr(I,p,m,k,g));if(S!=="horizontal"&&S!=="vertical"||_==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(ORr,dI({},y,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:h,xAxisId:p,yAxisId:m,points:_,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function _Rr(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Yl(u,i);if(t==="horizontal"){var h=Jje({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=kl(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=kl(f)?null:r.scale.map(f),g=Jje({axis:n,ticks:a,bandSize:l,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function ERr(e){var t=id(e,dct),r=od();return b.createElement(cAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(sAr,{legendPayload:hRr(t)}),b.createElement(pRr,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),b.createElement(gAr,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),b.createElement(kRr,dI({},t,{id:n}))))}var fct=b.memo(ERr,c9);fct.displayName="Line";var CRr=["domain","range"],jRr=["domain","range"];function rIe(e,t){if(e==null)return{};var r,n,s=TRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function TRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function nIe(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function hct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=rIe(e,CRr),{domain:a,range:i}=t,l=rIe(t,jRr);return!nIe(r,a)||!nIe(n,i)?!1:c9(s,l)}var NRr=["type"],ARr=["dangerouslySetInnerHTML","ticks","scale"],IRr=["id","scale"];function Wae(){return Wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wae.apply(null,arguments)}function sIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function aIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sIe(Object(r),!0).forEach(function(n){RRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RRr(e,t,r){return(t=PRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PRr(e){var t=MRr(e,"string");return typeof t=="symbol"?t:t+""}function MRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var r,n,s=DRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function LRr(e){var t=Vo(),r=b.useRef(null),n=Jat(),{type:s}=e,a=Gae(e,NRr),i=f9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return aIe(aIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(NAr(l)):r.current!==l&&t(AAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(IAr(r.current)),r.current=null)},[t]),null}var $Rr=e=>{var{xAxisId:t,className:r}=e,n=en(Qat),s=od(),a="xAxis",i=en(x=>nlt(x,a,t,s)),l=en(x=>QEr(x,t)),c=en(x=>KEr(x,t)),u=en(x=>kot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Gae(e,ARr),{id:m,scale:g}=u,y=Gae(u,IRr);return b.createElement(Ape,Wae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:ba("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},FRr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:Fy.axisLine,height:Yo.height,hide:!1,includeHidden:Yo.includeHidden,interval:Yo.interval,label:!1,minTickGap:Yo.minTickGap,mirror:Yo.mirror,orientation:Yo.orientation,padding:Yo.padding,reversed:Yo.reversed,scale:Yo.scale,tick:Yo.tick,tickCount:Yo.tickCount,tickLine:Fy.tickLine,tickSize:Fy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},zRr=e=>{var t=id(e,FRr);return b.createElement(b.Fragment,null,b.createElement(LRr,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),b.createElement($Rr,t))},pct=b.memo(zRr,hct);pct.displayName="XAxis";var BRr=["type"],URr=["dangerouslySetInnerHTML","ticks","scale"],VRr=["id","scale"];function Zae(){return Zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zae.apply(null,arguments)}function iIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function oIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iIe(Object(r),!0).forEach(function(n){qRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qRr(e,t,r){return(t=HRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HRr(e){var t=QRr(e,"string");return typeof t=="symbol"?t:t+""}function QRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){if(e==null)return{};var r,n,s=WRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function WRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function GRr(e){var t=Vo(),r=b.useRef(null),n=Jat(),{type:s}=e,a=Yae(e,BRr),i=f9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return oIe(oIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(RAr(l)):r.current!==l&&t(PAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(MAr(r.current)),r.current=null)},[t]),null}function ZRr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Qat),c=od(),u=Vo(),d="yAxis",f=en(E=>tCr(E,t)),h=en(E=>eCr(E,t)),p=en(E=>nlt(E,d,t,c)),m=en(E=>_ot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||jpe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(DAr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:x}=e,w=Yae(e,URr),{id:S,scale:k}=m,_=Yae(m,VRr);return b.createElement(Ape,Zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ba("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var YRr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:Fy.axisLine,hide:!1,includeHidden:Xo.includeHidden,interval:Xo.interval,label:!1,minTickGap:Xo.minTickGap,mirror:Xo.mirror,orientation:Xo.orientation,padding:Xo.padding,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:Xo.tickCount,tickLine:Fy.tickLine,tickSize:Fy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},XRr=e=>{var t=id(e,YRr);return b.createElement(b.Fragment,null,b.createElement(GRr,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),b.createElement(ZRr,t))},mct=b.memo(XRr,hct);mct.displayName="YAxis";var KRr=(e,t)=>t,Rpe=Xe([KRr,Fi,Lit,Cl,wlt,Sv,kjr,ec],Ajr);function JRr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Ppe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(JRr(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,n=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((c-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var gct=uf("mouseClick"),yct=gP();yct.startListening({actionCreator:gct,effect:(e,t)=>{var r=e.payload,n=Rpe(t.getState(),Ppe(r));n?.activeIndex!=null&&t.dispatch(gCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Xae=uf("mouseMove"),vct=gP(),EO=null,z0=null,JH=null;vct.startListening({actionCreator:Xae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");EO!==null&&(cancelAnimationFrame(EO),EO=null),z0!==null&&(typeof s!="number"||!i)&&(clearTimeout(z0),z0=null),JH=Ppe(r);var l=()=>{var c=t.getState(),u=ype(c,c.tooltip.settings.shared);if(!JH){EO=null,z0=null;return}if(u==="axis"){var d=Rpe(c,JH);d?.activeIndex!=null?t.dispatch(flt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(dlt())}EO=null,z0=null};if(!i){l();return}s==="raf"?EO=requestAnimationFrame(l):typeof s=="number"&&z0===null&&(z0=setTimeout(l,s))}});function ePr(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var lIe={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},bct=jc({name:"rootProps",initialState:lIe,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:lIe.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),tPr=bct.reducer,{updateOptions:rPr}=bct.actions,nPr=null,sPr={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},xct=jc({name:"polarOptions",initialState:nPr,reducers:sPr}),{updatePolarOptions:$Pn}=xct.actions,aPr=xct.reducer,wct=uf("keyDown"),Sct=uf("focus"),Oct=uf("blur"),E9=gP(),CO=null,B0=null,WD=null;E9.startListening({actionCreator:wct,effect:(e,t)=>{WD=e.payload,CO!==null&&(cancelAnimationFrame(CO),CO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");B0!==null&&(typeof n!="number"||!a)&&(clearTimeout(B0),B0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=WD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=vpe(u,fC(l),jP(l),NP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Sv(l);if(d==="Enter"){var m=x4(l,"axis","hover",String(u.index));t.dispatch(b4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=iCr(l),y=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*y;if(p==null||w>=p.length||w<0)return;var S=x4(l,"axis","hover",String(w));t.dispatch(b4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{CO=null,B0=null}};if(!a){i();return}n==="raf"?CO=requestAnimationFrame(i):typeof n=="number"&&B0===null&&(i(),WD=null,B0=setTimeout(()=>{WD?i():(B0=null,CO=null)},n))}});E9.startListening({actionCreator:Sct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var a="0",i=x4(r,"axis","hover",String(a));t.dispatch(b4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});E9.startListening({actionCreator:Oct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(b4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function kct(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var s=Reflect.get(r,n);return typeof s=="function"?s.bind(r):s}})}var Yf=uf("externalEvent"),_ct=gP(),GD=new Map,oT=new Map,eQ=new Map;_ct.startListening({actionCreator:Yf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=kct(n);eQ.set(s,{handler:r,reactEvent:a});var i=GD.get(s);i!==void 0&&(cancelAnimationFrame(i),GD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=oT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),oT.delete(s));var p=()=>{var y=eQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:ljr(S),activeDataKey:ajr(S),activeIndex:lI(S),activeLabel:klt(S),activeTooltipIndex:lI(S),isTooltipActive:cjr(S)};x&&x(k,w)}finally{GD.delete(s),oT.delete(s),eQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);GD.set(s,m)}else if(typeof c=="number"){if(!oT.has(s)){p();var g=setTimeout(p,c);oT.set(s,g)}}else p()}}});var iPr=Xe([uC],e=>e.tooltipItemPayloads),oPr=Xe([iPr,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),Ect=uf("touchMove"),Cct=gP(),U0=null,ib=null,cIe=null,lT=null;Cct.startListening({actionCreator:Ect,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){lT=kct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");U0!==null&&(cancelAnimationFrame(U0),U0=null),ib!==null&&(typeof s!="number"||!i)&&(clearTimeout(ib),ib=null),cIe=Array.from(r.touches).map(c=>Ppe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(lT!=null){var c=t.getState(),u=ype(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=cIe)===null||d===void 0?void 0:d[0];if(f==null){U0=null,ib=null;return}var h=Rpe(c,f);h?.activeIndex!=null&&t.dispatch(flt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=lT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(Dwr),x=(p=g.getAttribute(Lwr))!==null&&p!==void 0?p:void 0,w=dC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=oPr(c,y,x);t.dispatch(mCr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}U0=null,ib=null}};if(!i){l();return}s==="raf"?U0=requestAnimationFrame(l):typeof s=="number"&&ib===null&&(l(),lT=null,ib=setTimeout(()=>{lT?l():(ib=null,U0=null)},s))}}});var jct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Tct=jc({name:"eventSettings",initialState:jct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:lPr}=Tct.actions,cPr=Tct.reducer,uPr=ant({brush:WAr,cartesianAxis:LAr,chartData:cTr,errorBars:QIr,eventSettings:cPr,graphicalItems:pAr,layout:wwr,legend:TSr,options:sTr,polarAxis:PNr,polarOptions:aPr,referenceElements:XAr,renderedTicks:pIr,rootProps:tPr,tooltip:yCr,zIndex:Hjr}),dPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Q0r({reducer:uPr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([yct.middleware,vct.middleware,E9.middleware,_ct.middleware,Cct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(jat({type:"raf"}))},devTools:{serialize:{replacer:ePr},name:"recharts-".concat(r)}})};function fPr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=od(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=dPr(t,n));var i=phe;return b.createElement(pnt,{context:i,store:a.current},r)}function hPr(e){var{layout:t,margin:r}=e,n=Vo(),s=od();return b.useEffect(()=>{s||(n(vwr(t)),n(ywr(r)))},[n,s,t,r]),null}var pPr=b.memo(hPr,c9);function mPr(e){var t=Vo();return b.useEffect(()=>{t(rPr(e))},[t,e]),null}var gPr=e=>{var t=Vo();return b.useEffect(()=>{t(lPr(e))},[t,e]),null},yPr=b.memo(gPr,c9);function uIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(Vjr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(qjr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function dIe(e){var{children:t,isPanorama:r}=e,n=en(Rjr);if(!n||n.length===0)return t;var s=n.filter(i=>i<0),a=n.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(uIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(uIe,{key:i,zIndex:i,isPanorama:r})))}var vPr=["children"];function bPr(e,t){if(e==null)return{};var r,n,s=xPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function xPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E4(){return E4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E4.apply(null,arguments)}var wPr={width:"100%",height:"100%",display:"block"},SPr=b.forwardRef((e,t)=>{var r=Xat(),n=Kat(),s=cit();if(!ag(r)||!ag(n))return null;var{children:a,otherAttributes:i,title:l,desc:c}=e,u,d;return i!=null&&(typeof i.tabIndex=="number"?u=i.tabIndex:u=s?0:void 0,typeof i.role=="string"?d=i.role:d=s?"application":void 0),b.createElement(Pst,E4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:wPr,ref:t}),a)}),OPr=e=>{var{children:t}=e,r=en(s9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(Pst,{width:n,height:s,x:i,y:a},t)},fIe=b.forwardRef((e,t)=>{var{children:r}=e,n=bPr(e,vPr),s=od();return s?b.createElement(OPr,null,b.createElement(dIe,{isPanorama:!0},r)):b.createElement(SPr,E4({ref:t},n),b.createElement(dIe,{isPanorama:!1},r))});function kPr(){var e=Vo(),[t,r]=b.useState(null),n=en(Mwr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(xwr(a))}},[t,e,n]),r}function hIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hIe(Object(r),!0).forEach(function(n){EPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EPr(e,t,r){return(t=CPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CPr(e){var t=jPr(e,"string");return typeof t=="symbol"?t:t+""}function jPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kb(){return Kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kb.apply(null,arguments)}var TPr=()=>(vTr(),null);function C4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var NPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:C4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:C4((n=e.style)===null||n===void 0?void 0:n.height)}),l=b.useCallback((u,d)=>{i(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=b.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var h=m=>{var g=m[0];if(g!=null){var{width:y,height:x}=g.contentRect;l(y,x)}},p=new ResizeObserver(h);p.observe(u),s.current=p}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(vP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Kb({ref:c},e)))}),APr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:C4(r),containerHeight:C4(n)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),l=b.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return b.createElement(b.Fragment,null,b.createElement(vP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Kb({ref:l},e)))}),IPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Kb({ref:t},e)))}),RPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(APr,Kb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(IPr,Kb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Kb({ref:t},e)))});function PPr(e){return e?NPr:RPr}var MPr=b.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:y,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Vo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=kPr(),P=xhe(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,M=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(k.current=ie)},[I,t,T,N]),F=b.useCallback(ie=>{_(gct(ie)),_(Yf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(Xae(ie)),_(Yf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(dlt()),_(Yf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Xae(ie)),_(Yf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(Sct())},[_]),L=b.useCallback(()=>{_(Oct())},[_]),Z=b.useCallback(ie=>{_(wct(ie.key))},[_]),V=b.useCallback(ie=>{_(Yf({handler:i,reactEvent:ie}))},[_,i]),D=b.useCallback(ie=>{_(Yf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Yf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Yf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Yf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(Ect(ie)),_(Yf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Yf({handler:p,reactEvent:ie}))},[_,p]),re=PPr(w);return b.createElement(Alt.Provider,{value:E},b.createElement(qbr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:ba("recharts-wrapper",n),style:_Pr({position:"relative",cursor:"default",width:R,height:B},y),onClick:F,onContextMenu:V,onDoubleClick:D,onFocus:Q,onBlur:L,onKeyDown:Z,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:H,onMouseUp:G,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:M},b.createElement(TPr,null),r)))}),DPr=["width","height","responsive","children","className","style","compact","title","desc"];function LPr(e,t){if(e==null)return{};var r,n,s=$Pr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $Pr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var FPr=b.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=LPr(e,DPr),h=ng(f);return c?b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement(fIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(MPr,{className:i,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(fIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(JAr,null,a)))});function Kae(){return Kae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kae.apply(null,arguments)}function pIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zPr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pIe(Object(r),!0).forEach(function(n){BPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BPr(e,t,r){return(t=UPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UPr(e){var t=VPr(e,"string");return typeof t=="symbol"?t:t+""}function VPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qPr={top:5,right:5,bottom:5,left:5},HPr=zPr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:qPr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},jct),QPr=b.forwardRef(function(t,r){var n,s=id(t.categoricalChartProps,HPr),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return b.createElement(fPr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(QAr,{chartData:u.data}),b.createElement(pPr,{layout:s.layout,margin:s.margin}),b.createElement(yPr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(mPr,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),b.createElement(FPr,Kae({},s,{ref:r})))}),WPr=["axis"],GPr=b.forwardRef((e,t)=>b.createElement(QPr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:WPr,tooltipPayloadSearcher:rTr,categoricalChartProps:e,ref:t}));function ZPr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function YPr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function XPr(e){return e/100*window.innerHeight}function KPr(e){return e/100*window.innerWidth}function JPr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function WT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=JPr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=YPr(t,s);break}case"em":{n=ZPr(t,s);break}case"vh":{n=XPr(s);break}case"vw":{n=KPr(s);break}}return n}function Vu(e){return parseFloat(e.toFixed(3))}function eE({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,s)=>(n+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,n),0)}function Jae(e){const{panels:t}=e,r=eE({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:s,panelConstraints:a}=n;let i=0;if(a.collapsedSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=Vu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=Vu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.minSize});c=Vu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=WT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=Vu(d/r*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:n.id}})}function Ca(e,t="Assertion error"){if(!e)throw Error(t)}function eie(e,t){return Array.from(t).sort(e==="horizontal"?eMr:tMr)}function eMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function tMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Nct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Act(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function rMr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=Act(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return Ca(s,"No rect found"),s}let ZD;function nMr(){return ZD===void 0&&(typeof matchMedia=="function"?ZD=!!matchMedia("(pointer:coarse)").matches:ZD=!1),ZD}function Ict(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=eie(r,Array.from(t.children).filter(Nct).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,h,p=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.ariaDisabled===null&&(f++,u===-1&&(u=m),d=m))}if(f>1){let m=-1;for(const g of a)if(g.hasAttribute("data-panel")){m++;const y=n.find(x=>x.element===g);if(y){if(h){const x=h.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const k=r==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),_=r==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(p.length){case 0:{S=[k,_];break}case 1:{const E=p[0],T=rMr({orientation:r,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?_:k];break}default:{S=p;break}}}else p.length?S=p:S=[r==="horizontal"?new DOMRect(x.right,w.top,w.left-x.right,w.height):new DOMRect(w.left,x.bottom,w.width,w.top-x.bottom)];for(const k of S){let _="width"in k?k:k.element.getBoundingClientRect();const E=nMr()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(_.width<E){const j=E-_.width;_=new DOMRect(_.x-j/2,_.y,_.width+j,_.height)}if(_.height<E){const j=E-_.height;_=new DOMRect(_.x,_.y-j/2,_.width,_.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:eE({group:e}),panels:[h,y],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=y,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const y=s.find(x=>x.element===g);y?p.push(y):(h=void 0,p=[])}else c=!0}return i}let Rct=class{#e={};addListener(t,r){const n=this.#e[t];return n===void 0?this.#e[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=this.#e[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let s=!1,a=null;const i=Array.from(n);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,r)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,r){const n=this.#e[t];if(n!==void 0){const s=n.indexOf(r);s>=0&&n.splice(s,1)}}},$m=new Map;const Pct=new Rct;function sMr(e){$m=new Map($m),$m.delete(e)}function mIe(e,t){for(const[r]of $m)if(r.id===e)return r}function Jb(e,t){for(const[r,n]of $m)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function x1(){return $m}function Mpe(e,t){return Pct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function rv(e,t){const r=$m.get(e);$m=new Map($m),$m.set(e,t),Pct.emit("groupChange",{group:e,prev:r,next:t})}function aMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Act(r,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(n=a,s=i);break}case"vertical":{i.y<=s.y&&(n=a,s=i);break}}}return n?{distance:s,hitRegion:n}:void 0}function iMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function oMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:vIe(e),b:vIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();Ca(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:yIe(gIe(r.a)),b:yIe(gIe(r.b))};if(s.a===s.b){const a=n.childNodes,i={a:r.a.at(-1),b:r.b.at(-1)};let l=a.length;for(;l--;){const c=a[l];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const lMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function cMr(e){const t=getComputedStyle(Mct(e)??e).display;return t==="flex"||t==="inline-flex"}function uMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||cMr(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||lMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function gIe(e){let t=e.length;for(;t--;){const r=e[t];if(Ca(r,"Missing node"),uMr(r))return r}return null}function yIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function vIe(e){const t=[];for(;e;)t.push(e),e=Mct(e);return t}function Mct(e){const{parentNode:t}=e;return iMr(t)?t.host:t}function dMr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function fMr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Nct(r)||r.contains(e)||e.contains(r))return!0;if(oMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(dMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Dpe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Ict(s),i=aMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&fMr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function hMr(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function Hc(e,t,r=0){return Math.abs(Vu(e)-Vu(t))<=r}function pm(e,t){return Hc(e,t)?0:e>t?1:-1}function vk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(pm(n,c)<0)if(a){const u=(s+c)/2;pm(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=Vu(n),n}function fI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(Hc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;Ca(d!=null,"Invalid first pivot index"),Ca(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,y=r[g];Ca(y,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(Ca(k!=null,`Previous layout not found for panel index ${g}`),Hc(k,x)){const _=S-k;pm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,y=r[g];Ca(y,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(Ca(k!=null,`Previous layout not found for panel index ${g}`),Hc(k,S)){const _=k-x;pm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,y=r[g];Ca(y,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=y;if(w&&pm(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;pm(T,k)<0&&(e=pm(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;pm(T,k)<0&&(e=pm(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let y=e<0?f:d,x=0;for(;;){const S=l[y];Ca(S!=null,`Previous layout not found for panel index ${y}`);const k=vk({overrideDisabledPanels:i,panelConstraints:r[y],prevSize:S,size:100})-S;if(x+=k,y+=g,y<0||y>=r.length)break}const w=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-w:w}{let g=e<0?d:f;for(;g>=0&&g<r.length;){const y=Math.abs(e)-Math.abs(h),x=l[g];Ca(x!=null,`Previous layout not found for panel index ${g}`);const w=x-y,S=vk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!Hc(x,S)&&(h+=x-S,u[g]=S,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(hMr(c,u))return s;{const g=e<0?f:d,y=l[g];Ca(y!=null,`Previous layout not found for panel index ${g}`);const x=y+h,w=vk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!Hc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];Ca(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=vk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(Hc(_,T)||(S-=T-_,u[k]=T),Hc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!Hc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function RS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||pm(e[r],t[r])!==0)return!1;return!0}function PS({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],s=n.reduce((l,c)=>l+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!Hc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];Ca(c!=null,`No layout data found for index ${l}`);const u=100/s*c;n[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=r[l];Ca(c!=null,`No layout data found for index ${l}`);const u=n[l];Ca(u!=null,`No layout data found for index ${l}`);const d=vk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!Hc(a,0))for(let l=0;l<t.length;l++){const c=n[l];Ca(c!=null,`No layout data found for index ${l}`);const u=c+a,d=vk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,Hc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Dct({groupId:e,panelId:t}){const r=()=>{const l=x1();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:h,separatorToPanels:p}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:h,layout:f,separatorToPanels:p};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=r().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=l=>{const c=a();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:h,layout:p,separatorToPanels:m}=r(),g=f.panels.findIndex(S=>S.id===t),y=g===f.panels.length-1,x=fI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=PS({layout:x,panelConstraints:d});RS(p,w)||rv(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:h,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=n(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=n(),{mutableValues:d}=s(),f=a();if(l&&f===c){let h=d.expandToSize??u;h===0&&(h=1),i(h)}},getSize:()=>{const{group:l}=r(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=n(),u=a();return l&&Hc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=eE({group:c}),f=WT({groupSize:d,panelElement:u,styleProp:l}),h=Vu(f/d*100);i(h)}}}function bIe(e){if(e.defaultPrevented)return;const t=x1();Dpe(e,t).forEach(r=>{if(r.separator){const n=r.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(n){const s=n.panelConstraints.defaultSize,a=Dct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function C$(e){const t=x1();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function Lct({groupId:e}){const t=()=>{const r=x1();for(const[n,s]of r)if(n.id===e)return{group:n,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=PS({layout:r,panelConstraints:s});return n?l:(RS(l,u)||rv(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function V0(e,t){const r=C$(e),n=Jb(r.id,!0),s=r.separators.find(d=>d.element===e);Ca(s,"Matching separator not found");const a=n.separatorToPanels.get(s);Ca(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=Lct({groupId:r.id}).getLayout(),c=fI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=PS({layout:c,panelConstraints:n.derivedPanelConstraints});RS(l,u)||rv(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function xIe(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=C$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&V0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&V0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&V0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&V0(t,-5);break}case"End":{e.preventDefault(),V0(t,100);break}case"Enter":{e.preventDefault();const n=C$(t),s=Jb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);Ca(c,"Matching separator not found");const u=l.get(c);Ca(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(Ca(f,"Panel metadata not found"),f.collapsible){const h=i[d.id],p=f.collapsedSize===h?n.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;V0(t,p-h)}break}case"F6":{e.preventDefault();const n=C$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);Ca(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:n.length-1:s+1<n.length?s+1:0;n[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),V0(t,-100);break}}}let r_={cursorFlags:0,state:"inactive"};const Lpe=new Rct;function MS(){return r_}function pMr(e){return Lpe.addListener("change",e)}function mMr(e){const t=r_,r={...r_};r.cursorFlags=e,r_=r,Lpe.emit("change",{prev:t,next:r})}function n_(e){const t=r_;r_=e,Lpe.emit("change",{prev:t,next:e})}function wIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=x1(),r=Dpe(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),n_({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const gMr=e=>e,tQ=()=>{},$ct=1,Fct=2,zct=4,Bct=8,SIe=3,OIe=12;let YD;function kIe(){return YD===void 0&&(YD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(YD=!0)),YD}function yMr({cursorFlags:e,groups:t,state:r}){let n=0,s=0;switch(r){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{n++;break}case"vertical":{s++;break}}})}if(!(n===0&&s===0)){switch(r){case"active":{if(e&&kIe()){const a=(e&$ct)!==0,i=(e&Fct)!==0,l=(e&zct)!==0,c=(e&Bct)!==0;if(a)return l?"se-resize":c?"ne-resize":"e-resize";if(i)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}break}}return kIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const _Ie=new WeakMap;function $pe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=_Ie.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=MS();switch(n.state){case"active":case"hover":{const s=yMr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(i=>i.group),state:n.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?r.cssRules.length===0?r.insertRule(a):r.replaceSync(a):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}_Ie.set(e,{prevStyle:t,styleSheet:r})}function Uct({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;r.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:h,panels:p}=d,{disableCursor:m}=d.mutableState;let g=0;a?h==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:h==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const y=n.get(d),x=s.get(d);if(!y||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=fI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(RS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?$ct:Fct;break}case"vertical":{l|=g<0?zct:Bct;break}}}else rv(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&SIe:c|=l&SIe,t.movementY===0?c|=i&OIe:c|=l&OIe,mMr(c),$pe(e)}function EIe(e){const t=x1(),r=MS();r.state==="active"&&Uct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function CIe(e){if(e.defaultPrevented)return;const t=MS(),r=x1();switch(t.state){case"active":{if(e.buttons===0){n_({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Jb(n.group.id,!0);rv(n.group,s)});return}Uct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=Dpe(e,r);n.length===0?t.state!=="inactive"&&n_({cursorFlags:0,state:"inactive"}):n_({cursorFlags:0,hitRegions:n,state:"hover"}),$pe(e.currentTarget);break}}}function jIe(e){e.relatedTarget instanceof HTMLIFrameElement&&MS().state==="hover"&&n_({cursorFlags:0,state:"inactive"})}function TIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=MS();t.state==="active"&&(n_({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&($pe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Jb(r.group.id,!0);rv(r.group,n)}),e.preventDefault()))}function NIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=Vu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=Vu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function vMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=eE({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:Vu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function bMr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function xMr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const h=n[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const p=h/100*r,m=Vu(p/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=h}if(!i||c.length===0)return n;const u=100-s,d={...n};if(l.forEach((f,h)=>{d[h]=f}),a>0)for(const f of c){const h=n[f]??0;d[f]=Vu(h/a*u)}else{const f=Vu(u/c.length);for(const h of c)d[h]=f}return d}function wMr(e,t){const r=e.map(s=>s.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s))return!1;return!0}const jO=new Map;function SMr(e){let t=!0;Ca(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,s=new Set,a=new r(m=>{for(const g of m){const{borderBoxSize:y,target:x}=g;if(x===e.element){if(t){const w=eE({group:e});if(w===0)return;const S=Jb(e.id);if(!S)return;const k=Jae(e),_=S.defaultLayoutDeferred?NIe(k):S.layout,E=xMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=PS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&RS(S.layout,T)&&bMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;rv(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else vMr(e,x,y)}});a.observe(e.element),e.panels.forEach(m=>{Ca(!n.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),n.add(m.id),m.onResize&&a.observe(m.element)});const i=eE({group:e}),l=Jae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(wMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??NIe(l),f=PS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;jO.set(h,(jO.get(h)??0)+1);const p=new Map;return Ict(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),rv(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{Ca(!s.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),s.add(m.id),m.element.addEventListener("keydown",xIe)}),jO.get(h)===1&&(h.addEventListener("dblclick",bIe,!0),h.addEventListener("pointerdown",wIe,!0),h.addEventListener("pointerleave",EIe),h.addEventListener("pointermove",CIe),h.addEventListener("pointerout",jIe),h.addEventListener("pointerup",TIe,!0)),function(){t=!1,jO.set(h,Math.max(0,(jO.get(h)??0)-1)),sMr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",xIe)}),jO.get(h)||(h.removeEventListener("dblclick",bIe,!0),h.removeEventListener("pointerdown",wIe,!0),h.removeEventListener("pointerleave",EIe),h.removeEventListener("pointermove",CIe),h.removeEventListener("pointerout",jIe),h.removeEventListener("pointerup",TIe,!0)),a.disconnect()}}function OMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Fpe(e){const t=b.useId();return`${e??t}`}const w1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function AN(e){const t=b.useRef(e);return w1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function zpe(...e){return AN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Bpe(e){const t=b.useRef({...e});return w1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Vct=b.createContext(null);function kMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:gMr});b.useImperativeHandle(t,()=>r.current,[]),w1(()=>{Object.assign(r.current,Lct({groupId:e}))})}function C9({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:h,...p}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=AN(P=>{RS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=AN(P=>{RS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Fpe(l),w=b.useRef(null),[S,k]=OMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=zpe(w,a);kMr(x,i);const T=AN((P,R)=>{const B=MS(),M=mIe(P),F=Jb(P);if(F){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===M)),{flexGrow:F.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Bpe({defaultLayout:r,disableCursor:n}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=_.current;return R.panels=eie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=eie(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(B=>B!==P),k()}},togglePanelDisabled:(P,R)=>{const B=_.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const M=mIe(x),F=Jb(x);M&&F&&rv(M,{...F,derivedPanelConstraints:Jae(M)})},toggleSeparatorDisabled:(P,R)=>{const B=_.current.separators.find(M=>M.id===P);B&&(B.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return w1(()=>{const P=w.current;if(P===null)return;const R=_.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const L of R.panels){const Z=j.defaultLayout[L.id];Z!==void 0&&(B[L.id]=Z)}}const M={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=M;const F=SMr(M),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=Jb(M.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Mpe(x,L=>{const{defaultLayoutDeferred:Z,derivedPanelConstraints:V,layout:D}=L.next;if(Z||V.length===0)return;const W=M.panels.map(({id:J})=>J).join(",");M.mutableState.layouts[W]=D,V.forEach(J=>{if(J.collapsible){const{layout:ae}=L.prev??{};if(ae){const te=Hc(J.collapsedSize,D[J.panelId]),re=Hc(J.collapsedSize,ae[J.panelId]);te&&!re&&(M.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=MS().state!=="active";g(D),G&&y(D)});return()=>{I.current=null,F(),Q()}},[s,x,y,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Vct.Provider,{value:N,children:o.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...h,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}C9.displayName="Group";function rQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function Upe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=rQ(a,t??[]),l=b.useSyncExternalStore(_Mr,()=>r.getItem(i),()=>r.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const p=u.current;p&&(u.current=null,clearTimeout(p))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(p=>{d();let m;s?m=rQ(a,Object.keys(p)):m=rQ(a,[]);try{r.setItem(m,JSON.stringify(p))}catch(g){console.error(g)}},[d,s,a,r]),h=b.useCallback(p=>{d(),e===0?f(p):u.current=setTimeout(()=>{f(p)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:h,onLayoutChanged:f}}function _Mr(){return function(){}}function Vpe(){const e=b.useContext(Vct);return Ca(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function EMr(e,t){const{id:r}=Vpe(),n=b.useRef({collapse:tQ,expand:tQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tQ});b.useImperativeHandle(t,()=>n.current,[]),w1(()=>{Object.assign(n.current,Dct({groupId:r,panelId:e}))})}function tE({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:h,style:p,...m}){const g=!!c,y=Fpe(c),x=Bpe({disabled:a}),w=b.useRef(null),S=zpe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Vpe(),N=f!==null,I=AN((R,B,M)=>{f?.(R,c,M)});w1(()=>{const R=w.current;if(R!==null){const B={element:R,id:y,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,r,n,s,N,y,g,u,d,I,T,x]),b.useEffect(()=>{j(y,!!a)},[a,y,j]),EMr(y,h);const P=b.useSyncExternalStore(R=>Mpe(_,R),()=>JSON.stringify(k(_,y)),()=>JSON.stringify(k(_,y)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":y,id:y,ref:S,style:{...CMr,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(P)},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}tE.displayName="Panel";const CMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function jMr(){return b.useRef(null)}function TMr({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let s,a;const i=e[r],l=t.find(c=>c.panelId===r);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[n,n+1];a=PS({layout:fI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=PS({layout:fI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function qct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Fpe(s),c=Bpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=zpe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Vpe(),k=x==="horizontal"?"vertical":"horizontal";w1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=pMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Mpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:M}=P.next,F=M.get(T);if(F){const U=F[0],z=F.indexOf(U);d(TMr({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[y,l,w,c]),b.useEffect(()=>{S(l,!!r)},[r,l,S]);let _;return r&&!g&&(_="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":r||void 0,"aria-orientation":k,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":r?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:_,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}qct.displayName="Separator";const AIe=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(p=>p(t,h))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},NMr=(e=>e?AIe(e):AIe),AMr=e=>e;function IMr(e,t=AMr){const r=je.useSyncExternalStore(e.subscribe,je.useCallback(()=>t(e.getState()),[e,t]),je.useCallback(()=>t(e.getInitialState()),[e,t]));return je.useDebugValue(r),r}const IIe=e=>{const t=NMr(e),r=n=>IMr(t,n);return Object.assign(r,t),r},qpe=(e=>e?IIe(e):IIe);function RMr(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=r.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const tie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tie(n)(r)}}}},PMr=(e,t)=>(r,n,s)=>{let a={storage:RMr(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,s);const f=()=>{const y=a.partialize({...n()});return d.setItem(a.name,{state:y,version:a.version})},h=s.setState;s.setState=(y,x)=>(h(y,x),f());const p=e((...y)=>(r(...y),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var y,x;if(!d)return;const w=++l;i=!1,c.forEach(k=>{var _;return k((_=n())!=null?_:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(y=n())!=null?y:p))||void 0;return tie(d.getItem.bind(d))(a.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==a.version){if(a.migrate){const _=a.migrate(k.state,k.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var _;if(w!==l)return;const[E,T]=k;if(m=a.merge(T,(_=n())!=null?_:p),r(m,!0),E)return f()}).then(()=>{w===l&&(S?.(n(),void 0),m=n(),i=!0,u.forEach(k=>k(m)))}).catch(k=>{w===l&&S?.(void 0,k)})};return s.persist={setOptions:y=>{a={...a,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},a.skipHydration||g(),m||p},MMr=PMr;var S1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},DMr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},LMr=class{#e=DMr;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Nw=new LMr;function $Mr(e){setTimeout(e,0)}var DS=typeof window>"u"||"Deno"in globalThis;function uc(){}function FMr(e,t){return typeof e=="function"?e(t):e}function rie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ex(e,t){return typeof e=="function"?e(t):e}function Jf(e,t){return typeof e=="function"?e(t):e}function RIe(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Hpe(i,t.options))return!1}else if(!hI(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function PIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(LS(t.options.mutationKey)!==LS(a))return!1}else if(!hI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Hpe(e,t){return(t?.queryKeyHashFn||LS)(e)}function LS(e){return JSON.stringify(e,(t,r)=>nie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function hI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>hI(e[r],t[r])):!1}var zMr=Object.prototype.hasOwnProperty;function Qpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=MIe(e)&&MIe(t);if(!n&&!(nie(e)&&nie(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=n?d:i[d],h=e[f],p=t[f];if(h===p){c[f]=h,(n?d<a:zMr.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Qpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function pI(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function MIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nie(e){if(!DIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!DIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function DIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function BMr(e){return new Promise(t=>{Nw.setTimeout(t,e)})}function sie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Qpe(e,t):t}function UMr(e){return e}function VMr(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function qMr(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Wpe=Symbol();function Qct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Wpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gpe(e,t){return typeof e=="function"?e(...t):!!e}function HMr(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var QMr=class extends S1{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!DS&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Zpe=new QMr;function aie(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var WMr=$Mr;function GMr(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=WMr;const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Zi=GMr(),ZMr=class extends S1{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!DS&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},j4=new ZMr;function YMr(e){return Math.min(1e3*2**e,3e4)}function Wct(e){return(e??"online")==="online"?j4.isOnline():!0}var iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Gct(e){let t=!1,r=0,n;const s=aie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new iie(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Zpe.isFocused()&&(e.networkMode==="always"||j4.isOnline())&&e.canRun(),d=()=>Wct(e.networkMode)&&e.canRun(),f=g=>{a()||(n?.(),s.resolve(g))},h=g=>{a()||(n?.(),s.reject(g))},p=()=>new Promise(g=>{n=y=>{(a()||u())&&g(y)},e.onPause?.()}).then(()=>{n=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(DS?0:3),S=e.retryDelay??YMr,k=typeof S=="function"?S(r,x):S,_=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,x);if(t||!_){h(x);return}r++,e.onFail?.(r,x),BMr(k).then(()=>u()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),s)}}var Zct=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rie(this.gcTime)&&(this.#e=Nw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(DS?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Nw.clearTimeout(this.#e),this.#e=void 0)}},XMr=class extends Zct{#e;#t;#r;#s;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=$Ie(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=$Ie(this.options);t.data!==void 0&&(this.setState(LIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=sie(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(uc).catch(uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Jf(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ex(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Hct(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const l=Qct(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=Gct({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof iie&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#n.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof iie){if(l.silent)return this.#n.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Yct(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...LIe(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Zi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Yct(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function LIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $Ie(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var j9=class extends S1{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=aie(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#a;#o;#i;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),FIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jf(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!pI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&zIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||Jf(this.options.enabled,this.#t)!==Jf(t.enabled,this.#t)||ex(this.options.staleTime,this.#t)!==ex(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||Jf(this.options.enabled,this.#t)!==Jf(t.enabled,this.#t)||s!==this.#l)&&this.#v(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return JMr(this,r)&&(this.#s=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(uc)),t}#g(){this.#x();const e=ex(this.options.staleTime,this.#t);if(DS||this.#s.isStale||!rie(e))return;const r=Hct(this.#s.dataUpdatedAt,e)+1;this.#c=Nw.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(DS||Jf(this.options.enabled,this.#t)===!1||!rie(this.#l)||this.#l===0)&&(this.#u=Nw.setInterval(()=>{(this.options.refetchIntervalInBackground||Zpe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Nw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Nw.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#s,a=this.#n,i=this.#a,c=e!==r?e.state:this.#r,{state:u}=e;let d={...u},f=!1,h;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&FIe(e,t),I=j&&zIe(e,r,t,n);(N||I)&&(d={...d,...Yct(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,y=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",h=sie(s?.data,j,t),f=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===a?.data&&t.select===this.#p)h=this.#d;else try{this.#p=t.select,h=t.select(h),h=sie(s?.data,h,t),this.#d=h,this.#i=null}catch(j){this.#i=j}this.#i&&(p=this.#i,h=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",k=w&&x,_=h!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&_,isStale:Ype(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Jf(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=aie();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===r.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#t),pI(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#h.size)return!0;const a=new Set(s??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#O({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Zi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function KMr(e,t){return Jf(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function FIe(e,t){return KMr(e,t)||e.state.data!==void 0&&oie(e,t,t.refetchOnMount)}function oie(e,t,r){if(Jf(t.enabled,e)!==!1&&ex(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ype(e,t)}return!1}function zIe(e,t,r,n){return(e!==t||Jf(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ype(e,r)}function Ype(e,t){return Jf(t.enabled,e)!==!1&&e.isStaleByTime(ex(t.staleTime,e))}function JMr(e,t){return!pI(e.getCurrentResult(),t)}function T4(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{HMr(m,()=>t.signal,()=>d=!0)},h=Qct(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await h(w),{maxPages:k}=t.options,_=y?qMr:VMr;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?Xct:lie,y={pages:a,pageParams:i},x=g(n,y);l=await p(y,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??n.initialPageParam:lie(n,l);if(c>0&&g==null)break;l=await p(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function lie(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Xct(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function e2r(e,t){return t?lie(e,t)!=null:!1}function t2r(e,t){return!t||!e.getPreviousPageParam?!1:Xct(e,t)!=null}var r2r=class extends j9{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:T4()})}getOptimisticResult(e){return e.behavior=T4(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=n,c=r.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",h=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:e2r(t,r.data),hasPreviousPage:t2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},n2r=class extends Zct{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||Kct(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Gct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#n({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const i=await this.options.onMutate?.(e,r);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#n({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(i){Promise.reject(i)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(i){Promise.reject(i)}throw this.#n({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Zi.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function Kct(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s2r=class extends S1{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new n2r({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=XD(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=XD(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=XD(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=XD(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zi.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>PIe(t,r))}findAll(e={}){return this.getAll().filter(t=>PIe(e,t))}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zi.batch(()=>Promise.all(e.map(t=>t.continue().catch(uc))))}};function XD(e){return e.options.scope?.id}var a2r=class extends S1{#e;#t=void 0;#r;#s;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),pI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&LS(r.mutationKey)!==LS(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(t,r){return this.#s=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#n(){const t=this.#r?.state??Kct();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Zi.batch(()=>{if(this.#s&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,r,n,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,r,n,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(r=>{r(this.#t)})})}};function BIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function i2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var o2r=class extends S1{#e;#t;#r;#s;#n;#a;#o;#i;#p;#d=[];constructor(e,t,r){super(),this.#e=e,this.#s=r,this.#r=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,Zi.batch(()=>{const r=this.#n,n=this.#u(this.#r);n.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=n.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=r.length!==s.length,l=s.some((d,f)=>d!==r[f]),c=i||l,u=c?!0:a.some((d,f)=>{const h=this.#t[f];return!h||!pI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(BIe(r,s).forEach(d=>{d.destroy()}),BIe(s,r).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#u(e),n=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=r.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#c(a??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,r){if(t){const n=this.#p,s=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((a,i)=>a!==n[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,r!==void 0&&(this.#p=r),this.#a=Qpe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#e.defaultQueryOptions(n),i=t.get(s.queryHash)?.shift()??new j9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=i2r(this.#t,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&Zi.batch(()=>{this.listeners.forEach(n=>{n(this.#t)})})}}},l2r=class extends S1{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Hpe(n,t);let a=this.get(s);return a||(a=new XMr({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Zi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>RIe(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>RIe(e,r)):t}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new l2r,this.#t=e.mutationCache||new s2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Zpe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=j4.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ex(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(n.queryHash)?.state.data,i=FMr(t,a);if(i!==void 0)return this.#e.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Zi.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Zi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Zi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zi.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(uc).catch(uc)}invalidateQueries(e,t={}){return Zi.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zi.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(uc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(uc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(ex(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(uc).catch(uc)}fetchInfiniteQuery(e){return e.behavior=T4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(uc).catch(uc)}ensureInfiniteQueryData(e){return e.behavior=T4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return j4.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(LS(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{hI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(LS(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{hI(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hpe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Wpe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Jct=b.createContext(void 0),xa=e=>{const t=b.useContext(Jct);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},u2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(Jct.Provider,{value:e,children:t})),eut=b.createContext(!1),tut=()=>b.useContext(eut);eut.Provider;function d2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var f2r=b.createContext(d2r()),rut=()=>b.useContext(f2r),nut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Gpe(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},sut=e=>{b.useEffect(()=>{e.clearReset()},[e])},aut=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Gpe(r,[e.error,n])),iut=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},h2r=(e,t)=>e.isLoading&&e.isFetching&&!t,cie=(e,t)=>e?.suspense&&t.isPending,uie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function p2r({queries:e,...t},r){const n=xa(),s=tut(),a=rut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{iut(g);const y=n.getQueryCache().get(g.queryHash);nut(g,a,y)}),sut(a);const[l]=b.useState(()=>new o2r(n,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(Zi.batchCalls(g)):uc,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>cie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&cie(x,g)){const w=new j9(n,x);return uie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&aut({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function out(e,t,r){const n=tut(),s=rut(),a=xa(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",iut(i),nut(i,s,l),sut(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Zi.batchCalls(h)):uc;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),cie(i,d))throw uie(i,u,s);if(aut({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!DS&&h2r(d,n)&&(c?uie(i,u,s):l?.promise)?.catch(uc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Ot(e,t){return out(e,j9)}function Kr(e,t){const r=xa(),[n]=b.useState(()=>new a2r(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const s=b.useSyncExternalStore(b.useCallback(i=>n.subscribe(Zi.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((i,l)=>{n.mutate(i,l).catch(uc)},[n]);if(s.error&&Gpe(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function o0(e,t){return out(e,r2r)}var Do=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(Do||{});r1().describe("Database record creation time");var m2r=r1().describe("Database record last update time");m2r.nullable();var T9=_e({page:eSe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:eSe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),N9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),zt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),g2r=_e({start:tSe().optional().describe("Start of date range (inclusive by default)"),end:tSe().optional().describe("End of date range (inclusive by default)"),startExclusive:yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),A9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),_g=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),O1=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),Xpe=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),k1=Et(he()).min(1).describe("Fields to group by"),Kpe=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),Jpe={value:St().nullable().describe("Aggregated value"),previousValue:St().nullable().optional().describe("Value from comparison period"),changePercent:St().nullable().optional().describe("Percentage change from comparison period")},eme=Ws(he(),he().nullable()).describe("Dimension values for this group"),hC=St().describe("Aggregated value"),pC=r1().describe("Bucket timestamp"),tme=St().describe("Percentile value"),rme=St().describe("Percentile value at this bucket"),mC=Xle(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),y2r=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),lut=he().describe("Name of the entity"),cut=he().describe("Human end-user who triggered execution"),uut=he().describe("Multi-tenant organization/account"),dut=he().describe("Broader resource context (Mastra memory compatibility)"),fut=he().describe("Unique execution run identifier"),hut=he().describe("Session identifier for grouping traces"),put=he().describe("Conversation thread identifier"),mut=he().describe("HTTP request ID for log correlation"),gut=he().describe('Environment (e.g., "production" | "staging" | "development")'),v2r=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),yut=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),vut=he().describe("Name of the service"),but=Xle(Do).describe("Entity type of the parent entity"),b2r=he().describe("ID of the parent entity"),xut=he().describe("Name of the parent entity"),wut=Xle(Do).describe("Entity type of the root entity"),x2r=he().describe("ID of the root entity"),Sut=he().describe("Name of the root entity"),Out=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),kut=he().describe("Version ID of the parent entity that produced this signal"),_ut=he().describe("Version ID of the root entity that produced this signal"),I9=he().describe("Experiment or eval run identifier"),w2r=Ws(he(),Aa()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),Eut=Ws(he(),Aa()).describe("User-defined metadata for custom filtering"),Cut=Et(he()).describe("Labels for filtering"),S2r={entityType:mC.nullish(),entityId:y2r.nullish(),entityName:lut.nullish(),parentEntityType:but.nullish(),parentEntityId:b2r.nullish(),parentEntityName:xut.nullish(),rootEntityType:wut.nullish(),rootEntityId:x2r.nullish(),rootEntityName:Sut.nullish(),userId:cut.nullish(),organizationId:uut.nullish(),resourceId:dut.nullish(),runId:fut.nullish(),sessionId:hut.nullish(),threadId:put.nullish(),requestId:mut.nullish(),environment:gut.nullish(),serviceName:vut.nullish(),scope:w2r.nullish(),entityVersionId:Out.nullish(),parentEntityVersionId:kut.nullish(),rootEntityVersionId:_ut.nullish(),experimentId:I9.nullish()},R9={...S2r,executionSource:yut.nullish(),tags:Cut.nullish()};v2r.nullish();var P9={timestamp:g2r.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:mC.optional(),entityName:lut.optional(),entityVersionId:Out.optional(),parentEntityVersionId:kut.optional(),rootEntityVersionId:_ut.optional(),userId:cut.optional(),organizationId:uut.optional(),experimentId:I9.optional(),serviceName:vut.optional(),environment:gut.optional(),parentEntityType:but.optional(),parentEntityName:xut.optional(),rootEntityType:wut.optional(),rootEntityName:Sut.optional(),resourceId:dut.optional(),runId:fut.optional(),sessionId:hut.optional(),threadId:put.optional(),requestId:mut.optional(),executionSource:yut.optional(),tags:Et(he()).optional().describe("Filter by tags (must have all specified tags)")},M9=he().describe("Unique trace identifier"),D9=he().describe("Unique span identifier within a trace"),N4=So(["debug","info","warn","error","fatal"]),jut=he().describe("Log message"),Tut=Ws(he(),Aa()).describe("Structured data attached to the log"),Nut=_e({logId:he().nullish().describe("Unique id for this log event"),timestamp:r1().describe("When the log was created"),level:N4.describe("Log severity level"),message:jut,data:Tut.nullish(),traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:he().nullish().describe("Execution source"),metadata:Eut.nullish()}).describe("Log record as stored in the database");_e({level:N4,message:jut,data:Tut.optional(),tags:Cut.optional()}).describe("User-provided log input");var O2r=Nut;_e({logs:Et(O2r)}).describe("Arguments for batch creating logs");var k2r=_e({...P9,source:he().optional().describe("Filter by execution source"),level:Hr([N4,Et(N4)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),_2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),E2r=_e({field:_2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:k2r.optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:E2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:N9,logs:Et(Nut)});var gC=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Aut=he().describe("Display name of the scorer"),Iut=he().describe("Version of the scorer"),og=he().describe("How the score was produced (e.g., manual, automated, experiment)"),Rut=St().describe("Score value (range defined by scorer)"),Put=he().describe("Explanation for the score"),Mut=_e({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:r1().describe("When the score was recorded"),traceId:M9.nullish().describe("Trace that anchors the scored target when available"),spanId:D9.nullish().describe("Span ID this score applies to"),scorerId:gC,scorerName:Aut.nullish(),scorerVersion:Iut.nullish(),scoreSource:og.nullish(),source:og.nullish(),score:Rut,reason:Put.nullish(),...R9,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(he(),Aa()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:gC,scorerName:Aut.optional(),scorerVersion:Iut.optional(),scoreSource:og.optional(),source:og.optional(),score:Rut,reason:Put.optional(),metadata:Ws(he(),Aa()).optional().describe("Additional scorer-specific metadata"),experimentId:I9.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:mC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var nme=Mut;_e({score:nme}).describe("Arguments for creating a score");_e({score:nme.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(nme)}).describe("Arguments for batch recording scores");var IP=_e({...P9,scorerId:Hr([he(),Et(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:og.optional().describe("Filter by how the score was produced"),source:og.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),C2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),j2r=_e({field:C2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:IP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:j2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:N9,scores:Et(Mut)});_e({scorerId:gC,scoreSource:og.optional(),aggregation:_g,filters:IP.optional(),comparePeriod:Xpe.optional()}).describe("Arguments for getting a score aggregate");_e(Jpe);_e({scorerId:gC,scoreSource:og.optional(),groupBy:k1,aggregation:_g,filters:IP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:eme,value:hC}))});_e({scorerId:gC,scoreSource:og.optional(),interval:O1,aggregation:_g,filters:IP.optional(),groupBy:k1.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:he().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:pC,value:hC}))}))});_e({scorerId:gC,scoreSource:og.optional(),percentiles:Kpe,interval:O1,filters:IP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:tme,points:Et(_e({timestamp:pC,value:rme}))}))});var lg=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),yC=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),Dut=Hr([St(),he()]).describe("Feedback value (rating number or correction text)"),Lut=he().describe("Additional comment or context"),A4=he().describe("User who provided the feedback");function sme(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var L9=_e({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:r1().describe("When the feedback was recorded"),traceId:M9.nullish().describe("Trace that anchors the feedback target when available"),spanId:D9.nullish().describe("Span ID this feedback applies to"),feedbackSource:lg.nullish(),source:lg.nullish(),feedbackType:yC,value:Dut,comment:Lut.nullish(),feedbackUserId:A4.nullish(),...R9,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(he(),Aa()).nullish().describe("User-defined metadata")}),T2r=_e(L9.shape).describe("Feedback record as stored in the database"),N2r=_e({feedbackSource:lg.optional(),source:lg.optional(),feedbackType:yC,value:Dut,comment:Lut.optional(),feedbackUserId:A4.optional(),userId:A4.optional(),metadata:Ws(he(),Aa()).optional().describe("Additional feedback-specific metadata"),experimentId:I9.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});_e(N2r.shape).describe("User-provided feedback input");_e({feedback:tce(sme,L9)}).describe("Arguments for creating feedback");_e({feedback:L9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(tce(sme,L9))}).describe("Arguments for batch recording feedback");var $ut=_e({...P9,feedbackType:Hr([he(),Et(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:lg.optional(),source:lg.optional(),feedbackUserId:A4.optional()}),$9=_e($ut.shape).describe("Filters for querying feedback"),A2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),I2r=_e({field:A2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:tce(sme,$ut).optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:I2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:N9,feedback:Et(T2r)});_e({feedbackType:yC,feedbackSource:lg.optional(),aggregation:_g,filters:$9.optional(),comparePeriod:Xpe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(Jpe);_e({feedbackType:yC,feedbackSource:lg.optional(),groupBy:k1,aggregation:_g,filters:$9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:eme,value:hC}))});_e({feedbackType:yC,feedbackSource:lg.optional(),interval:O1,aggregation:_g,filters:$9.optional(),groupBy:k1.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:he().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:pC,value:hC}))}))});_e({feedbackType:yC,feedbackSource:lg.optional(),percentiles:Kpe,interval:O1,filters:$9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:tme,points:Et(_e({timestamp:pC,value:rme}))}))});So(["counter","gauge","histogram"]);var Fut=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),zut=St().describe("Metric value"),But=Ws(he(),he()).describe("Metric labels for dimensional filtering"),Uut=he().describe("Model provider"),Vut=he().describe("Model"),R2r=St().describe("Estimated cost"),qut=he().describe("Unit for the estimated cost (e.g., usd)"),P2r=Ws(he(),Aa()).nullish().describe("Structured costing metadata"),Hut=_e({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:r1().describe("When the metric was recorded"),name:Fut,value:zut,traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:he().nullish().describe("Execution source"),provider:Uut.nullish(),model:Vut.nullish(),estimatedCost:R2r.nullish(),costUnit:qut.nullish(),costMetadata:P2r.nullish(),labels:But.default({}),metadata:Eut.nullish()}).describe("Metric record as stored in the database");_e({name:Fut,value:zut,labels:But.optional()}).describe("User-provided metric input");var M2r=Hut;_e({metrics:Et(M2r)}).describe("Arguments for batch recording metrics");_e({type:_g,interval:O1.optional(),groupBy:k1.optional()}).describe("Metrics aggregation configuration");var RP=_e({...P9,name:Et(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:Uut.optional(),model:Vut.optional(),costUnit:qut.optional(),labels:Ws(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),D2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),L2r=_e({field:D2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:RP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:L2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");_e({pagination:N9,metrics:Et(Hut)});_e({name:Et(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:_g,filters:RP.optional(),comparePeriod:Xpe.optional()}).describe("Arguments for getting a metric aggregate");_e({...Jpe,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:St().nullable().optional().describe("Percentage change in estimated cost from comparison period")});_e({name:Et(he()).nonempty().describe("Metric name(s) to break down"),groupBy:k1,aggregation:_g,filters:RP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:eme,value:hC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(he()).nonempty().describe("Metric name(s)"),interval:O1,aggregation:_g,filters:RP.optional(),groupBy:k1.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:pC,value:hC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:he().describe("Metric name"),percentiles:Kpe,interval:O1,filters:RP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:tme,points:Et(_e({timestamp:pC,value:rme}))}))});_e({prefix:he().optional().describe("Filter metric names by prefix"),limit:St().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");_e({names:Et(he()).describe("Distinct metric names")});_e({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(he()).describe("Distinct label keys for the metric")});_e({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().optional().describe("Filter values by prefix"),limit:St().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");_e({values:Et(he()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(mC).describe("Distinct entity types")});_e({entityType:mC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(he()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(he()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(he()).describe("Distinct environments")});_e({entityType:mC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(he()).describe("Distinct tags")});const Ql={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},PP="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",$2r="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",F2r="rounded-md",ame="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",ime="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ome="disabled:opacity-50 disabled:cursor-not-allowed";function Qut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Qut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Wut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Qut(e))&&(n&&(n+=" "),n+=t);return n}const z2r=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},B2r=(e,t)=>({classGroupId:e,validator:t}),Gut=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),I4="-",UIe=[],U2r="arbitrary..",V2r=e=>{const t=H2r(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return q2r(i);const l=i.split(I4),c=l[0]===""&&l.length>1?1:0;return Zut(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?z2r(u,c):c:u||UIe}return r[i]||UIe}}},Zut=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Zut(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(I4):e.slice(t).join(I4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},q2r=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?U2r+n:void 0})(),H2r=e=>{const{theme:t,classGroups:r}=e;return Q2r(r,t)},Q2r=(e,t)=>{const r=Gut();for(const n in e){const s=e[n];lme(s,r,n,t)}return r},lme=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];W2r(i,t,r,n)}},W2r=(e,t,r,n)=>{if(typeof e=="string"){G2r(e,t,r);return}if(typeof e=="function"){Z2r(e,t,r,n);return}Y2r(e,t,r,n)},G2r=(e,t,r)=>{const n=e===""?t:Yut(t,e);n.classGroupId=r},Z2r=(e,t,r,n)=>{if(X2r(e)){lme(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(B2r(r,e))},Y2r=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];lme(c,Yut(t,l),r,n)}},Yut=(e,t)=>{let r=e;const n=t.split(I4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Gut(),r.nextPart.set(i,l)),r=l}return r},X2r=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,K2r=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},die="!",VIe=":",J2r=[],qIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),eDr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const y=s[g];if(i===0&&l===0){if(y===VIe){a.push(s.slice(c,g)),c=g+1;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(die)?(h=f.slice(0,-1),p=!0):f.startsWith(die)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return qIe(a,p,h,m)};if(t){const s=t+VIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):qIe(J2r,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},tDr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},rDr=e=>({cache:K2r(e.cacheSize),parseClassName:eDr(e),sortModifiers:tDr(e),...V2r(e)}),nDr=/\s+/,sDr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(nDr);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!g,x=n(y?m.substring(0,g):m);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+die:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,y);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},aDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Xut(r))&&(s&&(s+=" "),s+=n);return s},Xut=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Xut(e[n]))&&(r&&(r+=" "),r+=t);return r},HIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=rDr(u),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=sDr(c,r);return s(c,d),d};return a=i,(...c)=>a(aDr(...c))},iDr=[],Go=e=>{const t=r=>r[e]||iDr;return t.isThemeGetter=!0,t},Kut=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jut=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oDr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cDr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uDr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ob=e=>oDr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),lb=e=>!!e&&Number.isInteger(Number(e)),nQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),ny=e=>lDr.test(e),edt=()=>!0,hDr=e=>cDr.test(e)&&!uDr.test(e),cme=()=>!1,pDr=e=>dDr.test(e),mDr=e=>fDr.test(e),gDr=e=>!vr(e)&&!kr(e),yDr=e=>l0(e,ndt,cme),vr=e=>Kut.test(e),q0=e=>l0(e,sdt,hDr),QIe=e=>l0(e,_Dr,qn),vDr=e=>l0(e,idt,edt),bDr=e=>l0(e,adt,cme),WIe=e=>l0(e,tdt,cme),xDr=e=>l0(e,rdt,mDr),KD=e=>l0(e,odt,pDr),kr=e=>Jut.test(e),cT=e=>_1(e,sdt),wDr=e=>_1(e,adt),GIe=e=>_1(e,tdt),SDr=e=>_1(e,ndt),ODr=e=>_1(e,rdt),JD=e=>_1(e,odt,!0),kDr=e=>_1(e,idt,!0),l0=(e,t,r)=>{const n=Kut.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},_1=(e,t,r=!1)=>{const n=Jut.exec(e);return n?n[1]?t(n[1]):r:!1},tdt=e=>e==="position"||e==="percentage",rdt=e=>e==="image"||e==="url",ndt=e=>e==="length"||e==="size"||e==="bg-size",sdt=e=>e==="length",_Dr=e=>e==="number",adt=e=>e==="family-name",idt=e=>e==="number"||e==="weight",odt=e=>e==="shadow",ZIe=()=>{const e=Go("color"),t=Go("font"),r=Go("text"),n=Go("font-weight"),s=Go("tracking"),a=Go("leading"),i=Go("breakpoint"),l=Go("container"),c=Go("spacing"),u=Go("radius"),d=Go("shadow"),f=Go("inset-shadow"),h=Go("text-shadow"),p=Go("drop-shadow"),m=Go("blur"),g=Go("perspective"),y=Go("aspect"),x=Go("ease"),w=Go("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),kr,vr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,vr,c],N=()=>[ob,"full","auto",...j()],I=()=>[lb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",lb,kr,vr]},lb,kr,vr],R=()=>[lb,"auto",kr,vr],B=()=>["auto","min","max","fr",kr,vr],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[ob,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[ob,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[ob,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),GIe,WIe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",SDr,yDr,{size:[kr,vr]}],W=()=>[nQ,cT,q0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,cT,q0],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[qn,nQ,GIe,WIe],ie=()=>["","none",m,kr,vr],fe=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[ob,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ny],breakpoint:[ny],color:[edt],container:[ny],"drop-shadow":[ny],ease:["in","out","in-out"],font:[gDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ny],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ny],shadow:[ny],spacing:["px",qn],text:[ny],"text-shadow":[ny],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ob,vr,kr,y]}],container:["container"],columns:[{columns:[qn,vr,kr,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[lb,"auto",kr,vr]}],basis:[{basis:[ob,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,ob,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[lb,"first","last","none",kr,vr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,cT,q0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,kDr,vDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nQ,vr]}],"font-family":[{font:[wDr,bDr,t]}],"font-features":[{"font-features":[vr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,kr,vr]}],"line-clamp":[{"line-clamp":[qn,"none",kr,QIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,vr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,vr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[qn,"from-font","auto",kr,q0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qn,"auto",kr,vr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr,vr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kr,vr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},lb,kr,vr],radial:["",kr,vr],conic:[lb,kr,vr]},ODr,xDr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qn,kr,vr]}],"outline-w":[{outline:["",qn,cT,q0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,JD,KD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,JD,KD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qn,q0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,JD,KD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qn,kr,vr]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[kr,vr]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,vr]}],filter:[{filter:["","none",kr,vr]}],blur:[{blur:ie()}],brightness:[{brightness:[qn,kr,vr]}],contrast:[{contrast:[qn,kr,vr]}],"drop-shadow":[{"drop-shadow":["","none",p,JD,KD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qn,kr,vr]}],"hue-rotate":[{"hue-rotate":[qn,kr,vr]}],invert:[{invert:["",qn,kr,vr]}],saturate:[{saturate:[qn,kr,vr]}],sepia:[{sepia:["",qn,kr,vr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,vr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[qn,kr,vr]}],"backdrop-contrast":[{"backdrop-contrast":[qn,kr,vr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qn,kr,vr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qn,kr,vr]}],"backdrop-invert":[{"backdrop-invert":["",qn,kr,vr]}],"backdrop-opacity":[{"backdrop-opacity":[qn,kr,vr]}],"backdrop-saturate":[{"backdrop-saturate":[qn,kr,vr]}],"backdrop-sepia":[{"backdrop-sepia":["",qn,kr,vr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kr,vr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qn,"initial",kr,vr]}],ease:[{ease:["linear","initial",x,kr,vr]}],delay:[{delay:[qn,kr,vr]}],animate:[{animate:["none",w,kr,vr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,vr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[kr,vr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",kr,vr]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",kr,vr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qn,cT,q0,QIe]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},EDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(GT(e,"cacheSize",t),GT(e,"prefix",r),GT(e,"experimentalParseClassName",n),eL(e.theme,a.theme),eL(e.classGroups,a.classGroups),eL(e.conflictingClassGroups,a.conflictingClassGroups),eL(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),GT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),tL(e.theme,s.theme),tL(e.classGroups,s.classGroups),tL(e.conflictingClassGroups,s.conflictingClassGroups),tL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ldt(e,s,"orderSensitiveModifiers"),e),GT=(e,t,r)=>{r!==void 0&&(e[t]=r)},eL=(e,t)=>{if(t)for(const r in t)GT(e,r,t[r])},tL=(e,t)=>{if(t)for(const r in t)ldt(e,t,r)},ldt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},CDr=(e,...t)=>typeof e=="function"?HIe(ZIe,e,...t):HIe(()=>EDr(ZIe(),e),...t),jDr=Object.keys({...Lb,...k9t}),TDr=Object.keys(N9t),NDr=Object.keys(_9t),ADr=Object.keys(E9t),IDr=Object.keys(O9t),H0=Object.keys(T9t),RDr=Object.keys(C9t).concat(Object.keys(j9t)),PDr=CDr({extend:{theme:{color:jDr,spacing:TDr,radius:IDr,leading:ADr,shadow:RDr},classGroups:{"font-size":[{text:NDr}],h:[{h:H0}],w:[{w:H0}],size:[{size:H0}],"min-h":[{"min-h":H0}],"min-w":[{"min-w":H0}],"max-h":[{"max-h":H0}],"max-w":[{"max-w":H0}]}}});function Y(...e){return PDr(Wut(e))}const MDr={sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em] `,lg:`${Ql.lg} text-ui-lg px-[1em] `},DDr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:ame,light:"",outline:"",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},LDr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",ome,ime),$Dr={light:"default",outline:"default"};function FDr(e){return $Dr[e]??e}function vC(e){const t=FDr(e?.variant||"default"),r=e?.size||"default";return Y(LDr,MDr[r],DDr[t],e?.iconOnly&&"[&>svg]:opacity-75")}function cdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...cdt(r.props.children)):t.push(r)}),t}function zDr(e){const t=cdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}const me=je.forwardRef(({className:e,as:t,size:r="default",variant:n="default",disabled:s,children:a,...i},l)=>{const c=t||"button",u=zDr(a);return o.jsx(c,{ref:l,disabled:s,className:Y(vC({variant:n,size:r,iconOnly:u}),e),...i,children:a})});me.displayName="Button";const ld=W3t,Yr=G3t,Xr=Z3t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(Y3t,{children:o.jsxs(Nqe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n,children:[r,o.jsx(X3t,{className:"fill-surface3"})]})}));Wr.displayName=Nqe.displayName;const Cn=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Cn.displayName="ButtonWithTooltip";const BDr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},Ce=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Y("block",BDr[r],t),...n,children:e}),sn={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},c0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},udt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),R4=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",sn.colors,n),children:e}),ddt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),P4=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",sn.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),fdt=({onClick:e})=>o.jsx(me,{variant:"ghost",className:Y("shrink-0 opacity-0",sn.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ce,{children:o.jsx(Xl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),UDr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},VDr={mono:"font-mono"},pe=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(UDr[r],n&&VDr[n],t),...s}),ma=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),o.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),qDr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),o.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),ume=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),dme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),u0=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),hdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:o.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_22095",children:o.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),pdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[o.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),o.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),o.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),o.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_20513",children:o.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),HDr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),o.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),o.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),F9=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),fme=e=>o.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),QDr=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Mi=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),bC=e=>o.jsx(w9t,{...e}),Di=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),vl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),z9=e=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});function fp(e){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),o.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),o.jsx("path",{d:"M15 2v2"}),o.jsx("path",{d:"M15 20v2"}),o.jsx("path",{d:"M2 15h2"}),o.jsx("path",{d:"M2 9h2"}),o.jsx("path",{d:"M20 15h2"}),o.jsx("path",{d:"M20 9h2"}),o.jsx("path",{d:"M9 2v2"}),o.jsx("path",{d:"M9 20v2"})]})}const mdt=e=>o.jsxs("svg",{className:"h-3 w-3",width:"16",height:"16",viewBox:"0 0 181 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[o.jsx("path",{d:"M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",fill:"#FF9900"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",fill:"#FF9900"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1480_1723",children:o.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),WDr=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),GDr=e=>o.jsx("svg",{className:"h-3 w-3",fill:"white",height:"78",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"78",style:{color:"currentcolor"},...e,children:o.jsx("g",{transform:"translate(0,2)",children:o.jsx("path",{d:"M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",fill:"currentColor"})})}),gdt=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...e,children:o.jsx("path",{d:"M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",fill:"#0089D6",style:{fill:"#0089D6",fillOpacity:1}})}),ZDr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[o.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:o.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),o.jsxs("g",{mask:"url(#mask0_174_2406)",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",fill:"#39594D"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",fill:"#D18EE2"}),o.jsx("path",{d:"M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",fill:"#FF7759"})]})]}),YDr=e=>o.jsxs("svg",{className:"h-3 w-3","data-testid":"geist-icon",height:"78",strokeLinejoin:"round",viewBox:"0 0 160 59",width:"104",style:{color:"currentcolor"},...e,children:[o.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:o.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),o.jsx("g",{mask:"url(#mask0_4345_1846)",children:o.jsx("path",{d:"M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",fill:"currentColor"})})]}),XDr=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:e.fill||"currentColor"})}),KDr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"176",height:"162",viewBox:"0 0 176 162",fill:"none",...e,children:[o.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),o.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),JDr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[o.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[o.jsx("path",{d:"M34.593 94.0509H33.3844L27.3514 88.0179V86.8094L36.5743 77.5866H42.9639L43.8158 78.4385V84.8281L34.593 94.0509Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M27.3514 25.816V24.6074L33.3844 18.5744H34.593L43.8158 27.7972V34.1868L42.9639 35.0388H36.5743L27.3514 25.816Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M80.4594 74.6047H71.6824L70.9493 73.8717V53.3259C70.9493 49.6705 69.5129 46.8372 65.1046 46.7382C62.836 46.6787 60.2405 46.7382 57.4668 46.8471L57.0507 47.2731V73.8618L56.3176 74.5948H47.5406L46.8075 73.8618V38.7636L47.5406 38.0305H67.2939C74.9713 38.0305 81.1925 44.2517 81.1925 51.9291V73.8717L80.4594 74.6047Z",fill:e.fill||"#014847"}),o.jsx("path",{d:"M35.8412 61.4491H0.73307L0 60.716V51.9192L0.73307 51.1861H35.8412L36.5743 51.9192V60.716L35.8412 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M127.277 61.4491H92.1687L91.4356 60.716V51.9192L92.1687 51.1861H127.277L128.01 51.9192V60.716L127.277 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 27.0642V0.73307L59.6759 0H68.4727L69.2058 0.73307V27.0642L68.4727 27.7972H59.6759L58.9428 27.0642Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 111.902V85.5711L59.6759 84.838H68.4727L69.2058 85.5711V111.902L68.4727 112.635H59.6759L58.9428 111.902Z",fill:e.fill||"#05BDBA"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_236_138",children:o.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),YIe=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),eLr=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:"78",height:"78",style:{color:"currentcolor"},...e,children:o.jsxs("g",{children:[o.jsx("polygon",{fill:"currentColor",points:"226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"}),o.jsx("polygon",{fill:"currentColor",points:"348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"}),o.jsx("polygon",{fill:"currentColor",points:"651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"}),o.jsx("polygon",{fill:"currentColor",points:"673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"})]})}),tLr={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},rLr={warning:BE,destructive:TF,info:$R},Bl=({children:e,variant:t="destructive",className:r})=>{const n=rLr[t];return o.jsx("div",{className:Y(tLr[t],"p-3 rounded-md border shadow-sm",sn.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(Ce,{className:"mt-0.5 shrink-0",children:o.jsx(n,{})}),o.jsx("div",{className:"text-neutral4",children:e})]})})},Ul=({children:e,as:t="h5"})=>o.jsx(pe,{as:t,variant:"ui-md",className:"font-semibold",children:e}),$u=({children:e,as:t="p"})=>o.jsx(pe,{as:t,variant:"ui-sm",children:e}),nLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},ydt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(nLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",sn.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(pe,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),sLr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},aLr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},vt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",sn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":sLr[t],r),...s,children:[e&&o.jsx("span",{className:aLr[t],children:o.jsx(Ce,{children:e})}),n]}),Ya=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),jr=({className:e,as:t,isCurrent:r,action:n,...s})=>{const a=t||"span";return o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"flex h-full shrink-0 items-center gap-1",children:[o.jsx(a,{"aria-current":r?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",sn.colors,r?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),n]}),!r&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ce,{className:Y("text-neutral2",sn.colors),children:o.jsx(QDr,{})})})]})};function iLr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))n(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))n(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function oLr(e){const t=iLr(e);return ZWe({override:[lLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function lLr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const l=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,h)=>{const g=u.state.sliceDoc(h,h+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:h,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const cLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,uLr=er.mark({class:"cm-variable-highlight"}),XIe=new cWe({regexp:cLr,decoration:()=>uLr}),dLr=Oi.fromClass(class{decorations;constructor(e){this.decorations=XIe.createDeco(e)}update(e){this.decorations=XIe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),fLr=dLr,hLr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Xl,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",actionButton:"bg-white! flex items-center justify-center font-medium text-black! order-last hover:opacity-80"}};function rf(e){const{classNames:t,...r}=hLr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Y(t?.title,n?.title),toast:Y(t?.toast,n?.toast),cancelButton:Y(t?.cancelButton,n?.cancelButton),actionButton:Y(t?.actionButton,n?.actionButton),description:Y(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>vc(r,rf(t)));if(je.isValidElement(e))return vc(e,rf(t));if(typeof e=="string")return vc(e,rf(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent1 shrink-0",children:o.jsx(dzt,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.success(e,rf(r));case"object":return e.forEach(n=>vc.success(n,rf(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(jHe,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.error(e,rf(r));case"object":return e.forEach(n=>vc.error(n,rf(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(TF,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.warning(e,rf(r));case"object":return e.forEach(n=>vc.warning(n,rf(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx($R,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return vc.info(e,rf(r));case"object":return e.forEach(n=>vc.info(n,rf(r)))}};ze.custom=(e,t={})=>vc(e,rf(t));ze.dismiss=e=>{e&&vc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>vc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...rf(i)});function ff({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}function Ka({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=ff({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(fv,{}):o.jsx(NHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const pLr="mastra-theme",mLr="mastra-playground-store",fie=e=>e==="dark"||e==="light"||e==="system",gLr=e=>{try{const t=e.getItem(mLr);if(!t)return;const n=JSON.parse(t)?.state?.theme;return fie(n)?n:void 0}catch{return}},yLr=(e=pLr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(fie(t))return t;const r=gLr(window.localStorage);return r?(window.localStorage.setItem(e,r),r):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const r=n=>{if(n.key===e){if(n.newValue===null){t(null);return}fie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),vdt=b.createContext(null),bdt="(prefers-color-scheme: dark)",vLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,xdt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(bdt).matches?"dark":"light",wdt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(bdt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},bLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},Sdt=({children:e,defaultTheme:t="system",storageKey:r,target:n})=>{const s=b.useMemo(()=>yLr(r),[r]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(wdt,xdt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;vLr(()=>{const f=n??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&bLr(f,u),a.current=f},[u,n]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(vdt.Provider,{value:d,children:e})},xLr=()=>{},xC=()=>{const e=b.useContext(vdt),t=b.useSyncExternalStore(wdt,xdt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:xLr},[e,t])};function wLr(){const e=WE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)",caret:"var(--neutral6)"},styles:[{tag:[ne.className,ne.propertyName],color:"var(--neutral6)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ne.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ft.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]}function SLr(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--neutral3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:"color-mix(in srgb, var(--accent3) 22%, transparent) !important"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}}),t=$p.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ne.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:[ne.deleted],color:"var(--accent2)"},{tag:ne.invalid,color:"var(--error)"},{tag:[ne.standard(ne.tagName)],color:"var(--accent1)"}]);return[e,Yx(t)]}const kv=()=>{const e=xC().resolvedTheme==="dark";return b.useMemo(()=>e?wLr():SLr(),[e])},Xn=b.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...h},p)=>{const m=kv(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Xd):a==="markdown"&&(x.push(que({base:pS,codeLanguages:yZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(fLr),c&&a==="markdown"&&x.push(oLr(c)),f===!1&&x.push(zn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(Ka,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(xc,{ref:p,value:g,theme:m,extensions:y,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function OLr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-OuYdvUUh.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function Ja({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&o.jsx("div",{className:"mt-5",children:n})]})}const kf=({children:e,className:t,onClick:r})=>o.jsx("div",{tabIndex:r?0:void 0,onKeyDown:n=>{r&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",r&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:r,children:e}),Odt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),_f=({children:e,className:t})=>o.jsx(pe,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Ef=({children:e,className:t})=>o.jsx(pe,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),Cf=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Zs({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return o.jsx(Ja,{className:s,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(o9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function na({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=Ge(),i=b.useCallback(async()=>{try{s(!0);const{baseUrl:l="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),h=`${l}${d}/auth/sso/login?${f}`,p=await fetch(h,{credentials:"include",headers:{"Content-Type":"application/json"}});if(p.ok){const m=await p.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(Ja,{className:r,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(e9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(me,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const En=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Zu=({children:e})=>o.jsx(pe,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),pu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),kLr=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),tx=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:"currentColor"})}),_Lr={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},ELr=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Y("w-full",_Lr[r],e),style:n,children:t}),CLr=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),jLr=({className:e,children:t,...r})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),TLr=({className:e,children:t,...r})=>o.jsx("tbody",{className:Y("",e),...r,children:t}),NLr=b.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),ALr=({className:e,children:t,...r})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),KIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,JIe=Wut,wC=(e,t)=>r=>{var n;if(t?.variants==null)return JIe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],f=a?.[u];if(d===null)return null;const h=KIe(d)||KIe(f);return s[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,f,h]:u},[]);return JIe(e,i,c,r?.class,r?.className)},ILr=wC(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(ame,ime,ome),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:"px-2 py-1.5 text-ui-sm",md:"px-3 py-2 text-ui-sm",default:"px-3 py-2 text-ui-md",lg:"px-4 py-3 text-ui-sm"}},defaultVariants:{variant:"default",size:"default"}}),bc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Y(ILr({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));bc.displayName="Textarea";const RLr=cXt,PLr=uXt,kdt=dXt;function Bt({open:e,onOpenChange:t,children:r}){return o.jsx(RLr,{open:e,onOpenChange:t,children:r})}const hme=b.forwardRef(({className:e,...t},r)=>o.jsx(XYe,{className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-150",e),...t,ref:r}));hme.displayName=XYe.displayName;const _dt=b.forwardRef(({className:e,...t},r)=>o.jsxs(kdt,{children:[o.jsx(hme,{}),o.jsx(KYe,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border1 bg-surface3 p-6 shadow-dialog rounded-md","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=closed]:duration-150",e),...t})]}));_dt.displayName=KYe.displayName;const Edt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});Edt.displayName="AlertDialogHeader";const Cdt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cdt.displayName="AlertDialogFooter";const jdt=b.forwardRef(({className:e,...t},r)=>o.jsx(tXe,{ref:r,className:Y("text-lg font-semibold",e),...t}));jdt.displayName=tXe.displayName;const Tdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rXe,{ref:r,className:Y("text-sm text-neutral3",e),...t}));Tdt.displayName=rXe.displayName;const Ndt=b.forwardRef(({className:e,...t},r)=>o.jsx(JYe,{ref:r,className:Y(vC({variant:"primary",size:"default"}),e),...t}));Ndt.displayName=JYe.displayName;const Adt=b.forwardRef(({className:e,...t},r)=>o.jsx(eXe,{ref:r,className:Y(vC({variant:"default",size:"default"}),"mt-2 sm:mt-0",e),...t}));Adt.displayName=eXe.displayName;Bt.Trigger=PLr;Bt.Portal=kdt;Bt.Overlay=hme;Bt.Content=_dt;Bt.Header=Edt;Bt.Footer=Cdt;Bt.Title=jdt;Bt.Description=Tdt;Bt.Action=Ndt;Bt.Cancel=Adt;const fi=b.forwardRef(({className:e,...t},r)=>o.jsx(sde,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",sn.all,"hover:border-neutral5 hover:shadow-md",PP,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(iXe,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(fv,{className:"h-3.5 w-3.5 stroke-3"})})}));fi.displayName=sde.displayName;const Ap=bXt,jh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(ide,{ref:n,className:Y("-outline-offset-2",sn.colors,c0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));jh.displayName=ide.displayName;const Th=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(lde,{ref:n,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));Th.displayName=lde.displayName;const gn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",sn.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",sn.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",sn.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",sn.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Kl({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="inputLike",size:u="default",open:d,onOpenChange:f,container:h,error:p}){const m=e.find(y=>y.value===t)??null,g=y=>{y&&r?.(y.value)};return o.jsxs("div",{className:gn.root,children:[o.jsxs(cKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(yKe,{className:Y(vC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(YJt,{placeholder:n})]}),o.jsx(jF,{className:gn.chevron})]}),o.jsx(wKe,{container:h,children:o.jsx(kKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(_Ke,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(__,{className:gn.searchIcon}),o.jsx(gKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(NKe,{className:gn.empty,children:a}),o.jsx(bKe,{className:gn.list,children:y=>o.jsxs(TKe,{value:y,className:Y(gn.item,gn.itemSelected),children:[o.jsx("span",{className:gn.checkContainer,children:o.jsx(Ler,{children:o.jsx(fv,{className:gn.checkIcon})})}),o.jsxs("span",{className:gn.optionContent,children:[y.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:gn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:gn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}function Idt({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:h,error:p}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&r?.(x.map(w=>w.value))},y=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:gn.root,children:[o.jsxs(cKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(yKe,{className:Y(vC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&gn.placeholder),children:y}),o.jsx(jF,{className:gn.chevron})]}),o.jsx(wKe,{container:h,children:o.jsx(kKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(_Ke,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(__,{className:gn.searchIcon}),o.jsx(gKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(NKe,{className:gn.empty,children:a}),o.jsx(bKe,{className:gn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(TKe,{value:x,className:gn.item,children:[o.jsx("span",{className:Y(gn.checkbox,w?gn.checkboxSelected:gn.checkboxUnselected),children:w&&o.jsx(fv,{className:gn.checkboxIcon})}),o.jsxs("span",{className:gn.optionContent,children:[x.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:gn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:gn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}const Sn=YF,Rdt=LYe,MLr=XF,DLr=YR,Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(GR,{ref:r,className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Pdt.displayName=GR.displayName;const yn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(MLr,{children:[o.jsx(Pdt,{}),o.jsxs(ZR,{ref:n,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-bottom-4","data-[state=open]:slide-in-from-bottom-4",e),...r,children:[t,o.jsxs(YR,{className:Y("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[o.jsx(Xl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yn.displayName=ZR.displayName;const On=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});On.displayName="DialogHeader";const hf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const vn=b.forwardRef(({className:e,...t},r)=>o.jsx(KF,{ref:r,className:Y("text-ui-md font-medium",e),...t}));vn.displayName=KF.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(JF,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=JF.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(ad,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Mdt.displayName=ad.displayName;const LLr=({children:e,title:t="Command Palette",description:r="Search for commands and actions",...n})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(h=>c.includes(h))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx(Sn,{...n,children:o.jsxs(yn,{className:"overflow-hidden p-0",children:[o.jsx(vn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(Mdt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5","**:[[cmdk-input]]:h-12","**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3","[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"),children:e})]})})},Ddt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",sn.colors),"cmdk-input-wrapper":"",children:[o.jsx(__,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors)}),o.jsx(ad.Input,{ref:r,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",sn.colors,e),...t})]}));Ddt.displayName=ad.Input.displayName;const Ldt=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Ldt.displayName=ad.List.displayName;const $dt=b.forwardRef((e,t)=>o.jsx(ad.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));$dt.displayName=ad.Empty.displayName;const gb=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.Group,{ref:r,className:Y("overflow-hidden p-1 text-neutral5","**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3",e),...t}));gb.displayName=ad.Group.displayName;const cw=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));cw.displayName=ad.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(ad.Item,{ref:r,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",sn.colors,"data-[selected=true]:bg-surface5 data-[selected=true]:text-neutral5","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=ad.Item.displayName;const Fdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});Fdt.displayName="CommandShortcut";function zdt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const $Lr=Prr,FLr=Mrr,zLr=aP,BLr=$rr,ULr=Drr,pme=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Bdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(RJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Bdt.displayName=RJe.displayName;const Udt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(zJe,{ref:s,className:Y(pme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(Fce,{className:"-rotate-90 opacity-50"})})]}));Udt.displayName=zJe.displayName;const Vdt=b.forwardRef(({className:e,...t},r)=>o.jsx(aP,{children:o.jsx(fz,{ref:r,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));Vdt.displayName=fz.displayName;const qdt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(aP,{container:t,children:o.jsx(PJe,{ref:s,sideOffset:r,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...n})}));qdt.displayName=PJe.displayName;const Hdt=b.forwardRef(({className:e,...t},r)=>o.jsx(DJe,{ref:r,className:Y(pme,e),...t}));Hdt.displayName=DJe.displayName;const Qdt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(LJe,{ref:s,className:Y(pme,"w-full gap-4 px-2",e),checked:r,...n,children:[o.jsx("div",{className:"border dark:border-white/20 border-black/20 flex h-4 w-4 items-center justify-center rounded-sm",children:r&&o.jsx(fv,{})}),t]}));Qdt.displayName=LJe.displayName;const Wdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs($Je,{ref:n,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Lrr,{children:o.jsx(THe,{className:"h-2 w-2 fill-current"})})}),t]}));Wdt.displayName=$Je.displayName;const Gdt=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(MJe,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Gdt.displayName=MJe.displayName;const Zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(FJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Zdt.displayName=FJe.displayName;const Ydt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});Ydt.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx($Lr,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Bdt;yt.Content=qdt;yt.Group=FLr;yt.Portal=zLr;yt.Item=Hdt;yt.CheckboxItem=Qdt;yt.RadioItem=Wdt;yt.Label=Gdt;yt.Separator=Zdt;yt.Shortcut=Ydt;yt.Sub=BLr;yt.SubContent=Vdt;yt.SubTrigger=Udt;yt.RadioGroup=ULr;const rL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Ln({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const Xdt=({icon:e,title:t,isLoading:r,children:n})=>o.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[o.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(Ln,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(pe,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function VLr({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function qLr({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx(BE,{})," ",e]})}function HLr({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function QLr({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":n==="bigger"},s),children:[e,r&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function WLr({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":r==="horizontal"},t),style:r==="horizontal"&&n?{gridTemplateColumns:`${n} 1fr`}:void 0,children:e})}const mo=Object.assign({},{Layout:WLr,Column:VLr,Label:QLr,HelpText:HLr,ErrorMsg:qLr});function GLr({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function ZLr({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(ZLr,{Column:GLr});const YLr=wC(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(ame,ime,ome),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em]`,lg:`${Ql.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),ar=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(YLr({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));ar.displayName="Input";function Cx({name:e,value:t,label:r,labelIsHidden:n=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:h="default",testId:p,className:m,...g}){return o.jsxs(mo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(Ku,{children:r}):r})}):null,o.jsxs(mo.Column,{children:[!n&&d==="vertical"?o.jsx(mo.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(ar,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(mo.HelpText,{children:a}),i&&o.jsx(mo.ErrorMsg,{children:i})]})]})}function jx({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:h,size:p,isMinimized:m,onMinimizedChange:g}){const y=b.useRef(null);return b.useEffect(()=>{m===!1&&y.current?.focus()},[m]),m?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(__,{})})}),o.jsx(Wr,{children:i||"Search"})]}):o.jsxs(mo.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:l?o.jsx(Ku,{children:i}):i})}):null,o.jsxs(mo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(mo.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(ar,{ref:y,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Y(p==="sm"&&"pl-8 pr-8",p==="md"&&"pl-9 pr-9",(!p||p==="default")&&"pl-10 pr-10",p==="lg"&&"pl-11 pr-11")}),o.jsx(__,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",p==="sm"&&"w-3.5 h-3.5",p==="md"&&"w-4 h-4",(!p||p==="default")&&"w-[1.125rem] h-[1.125rem]",p==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(me,{variant:"ghost",size:p||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(Xl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const hi=hnr,pi=pnr,ei=b.forwardRef(({className:e,children:t,variant:r="inputLike",size:n="default",...s},a)=>o.jsxs(fet,{ref:a,className:Y(vC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(mnr,{asChild:!0,children:o.jsx(Fce,{className:Y("h-4 w-4 text-neutral3",sn.colors)})})]}));ei.displayName=fet.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(gnr,{children:o.jsx(het,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:o.jsx(ynr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=het.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(pet,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",sn.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-disabled:pointer-events-none data-disabled:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(bnr,{children:o.jsx(fv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(vnr,{children:t})]}));ss.displayName=pet.displayName;function $o({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:h="Select an option",onValueChange:p,className:m}){return o.jsxs(mo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:c?o.jsx(Ku,{children:l}):l})}):null,o.jsxs(mo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(mo.Label,{name:e,required:n,children:l}):null,o.jsxs(hi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(pi,{placeholder:h})}),o.jsx(ti,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const XLr={sm:`${Ql.sm} w-form-sm`,md:`${Ql.md} w-form-md`,lg:`${Ql.lg} w-form-lg`,default:`${Ql.default}`},KLr={sm:"sm",md:"default",lg:"lg",default:"default"},JLr={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},e$r="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",jn=je.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},l)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("button",{ref:l,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:Y(e$r,PP,JLr[s],XLr[n],a&&"active:scale-100",e),...i,children:o.jsx(Ce,{size:KLr[n],children:t})})}),o.jsx(Wr,{children:r})]}));jn.displayName="IconButton";const t$r=wC("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(get,{ref:r,className:Y(t$r(),e),...t}));xt.displayName=get.displayName;function rE({children:e}){const t=e.replace(/\\n/g,`
291
291
  `);return o.jsx(Vet,{remarkPlugins:[htt],components:n$r,className:"space-y-3",children:t})}const Kdt=je.memo(({children:e,language:t,...r})=>{const[n,s]=b.useState([]);return b.useEffect(()=>{OLr(e,t).then(a=>{a&&s(a)})},[e,t]),n.length?o.jsx("pre",{...r,children:o.jsx("code",{children:n.map((a,i)=>o.jsxs(o.Fragment,{children:[o.jsx("span",{children:a.map((l,c)=>{const u=typeof l.htmlStyle=="string"?void 0:l.htmlStyle;return o.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:l.content},c)})},i),i!==n.length-1&&`
292
292
  `]}))})}):o.jsx("pre",{...r,children:e})});Kdt.displayName="HighlightedCode";const r$r=({children:e,className:t,language:r,...n})=>{const s=typeof e=="string"?e:hie(e),a=Y("overflow-x-scroll rounded-md border bg-surface1/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return o.jsxs("div",{className:"group/code relative mb-4",children:[o.jsx(b.Suspense,{fallback:o.jsx("pre",{className:a,...n,children:e}),children:o.jsx(Kdt,{language:r,className:a,children:s})}),o.jsx("div",{className:"invisible absolute right-2 top-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100",children:o.jsx(Ka,{content:s,copyMessage:"Copied code to clipboard"})})]})};function hie(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(r=>hie(r)).join(""):hie(t)}return""}const n$r={h1:({children:e,...t})=>o.jsx("h1",{className:"text-2xl font-semibold",...t,children:e}),h2:({children:e,...t})=>o.jsx("h2",{className:"font-semibold text-xl",...t,children:e}),h3:({children:e,...t})=>o.jsx("h3",{className:"font-semibold text-lg",...t,children:e}),h4:({children:e,...t})=>o.jsx("h4",{className:"font-semibold text-base",...t,children:e}),h5:({children:e,...t})=>o.jsx("h5",{className:"font-medium",...t,children:e}),strong:({children:e,...t})=>o.jsx("strong",{className:"font-semibold",...t,children:e}),a:({children:e,...t})=>o.jsx("a",{className:"underline underline-offset-2",...t,children:e}),blockquote:({children:e,...t})=>o.jsx("blockquote",{className:"border-l-2 border-neutral6 pl-4",...t,children:e}),code:({children:e,className:t,...r})=>{const n=/language-(\w+)/.exec(t||"");return n?o.jsx(r$r,{className:t,language:n[1],...r,children:e}):o.jsx("code",{className:Y("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-surface1/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:({children:e,...t})=>o.jsx("ol",{className:"list-decimal space-y-2 pl-6",...t,children:e}),ul:({children:e,...t})=>o.jsx("ul",{className:"list-disc space-y-2 pl-6",...t,children:e}),li:({children:e,...t})=>o.jsx("li",{className:"my-1.5",...t,children:e}),table:({children:e,...t})=>o.jsx("table",{className:"w-full border-collapse overflow-y-auto rounded-md border border-neutral6/20",...t,children:e}),th:({children:e,...t})=>o.jsx("th",{className:"border border-neutral6/20 px-4 py-2 text-left font-bold [[align=center]]:text-center [[align=right]]:text-right",...t,children:e}),td:({children:e,...t})=>o.jsx("td",{className:"border border-neutral6/20 px-4 py-2 text-left [[align=center]]:text-center [[align=right]]:text-right",...t,children:e}),tr:({children:e,...t})=>o.jsx("tr",{className:"m-0 border-t p-0 even:bg-surface4",...t,children:e}),p:({children:e,...t})=>o.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",...t,children:e}),hr:({...e})=>o.jsx("hr",{className:"border-neutral6/20",...e})};function s$r({children:e,className:t}){return o.jsx("div",{className:Y("overflow-x-auto ",t),children:e})}function Jdt({children:e,className:t}){return o.jsx("p",{className:Y("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function a$r({message:e="Failed to load data",className:t}){return o.jsx("div",{className:Y("flex flex-col gap-3 items-center justify-center",t),children:o.jsx("p",{className:"text-ui-sm text-accent2",children:e})})}const i$r={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Mt({color:e,className:t,size:r="md"}){return o.jsx("svg",{className:Y("animate-spin",i$r[r],t),style:{animationDuration:"800ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}function o$r({className:e}){return o.jsx("div",{className:Y("flex items-center justify-center",e),children:o.jsx(Mt,{size:"md",color:Lb.neutral1})})}function l$r({message:e="No data yet",className:t}){return o.jsx("div",{className:Y("flex items-center justify-center h-full",t),children:o.jsx("p",{className:"text-neutral1 text-sm",children:e})})}function eRe({children:e,className:t}){return o.jsx(zdt,{className:Y("flex-1 grid grid-rows-[4rem_1fr] min-h-72 gap-2 min-w-80 md:min-w-[22rem] lg:min-w-[24rem] xl:min-w-[26rem] 2xl:min-w-[30rem]",t),children:e})}function c$r({value:e,label:t,className:r}){return o.jsxs("div",{className:Y("grid justify-end content-start text-right gap-1",r),children:[o.jsx("span",{className:"text-ui-lg font-semibold text-neutral4 leading-none",children:e}),t&&o.jsx("span",{className:"text-ui-md text-neutral2",children:t})]})}function eft({children:e,className:t,as:r="h2"}){return o.jsx(r,{className:Y("text-ui-md font-normal text-neutral4",t),children:e})}function u$r(e){if("children"in e)return o.jsx("div",{className:e.className,children:e.children});const{title:t,description:r,titleAs:n}=e;return o.jsxs("div",{className:e.className,children:[o.jsx(eft,{as:n,children:t}),r&&o.jsx(Jdt,{children:r})]})}function d$r({children:e,className:t}){return o.jsx("div",{className:Y("grid grid-cols-[1fr_auto] gap-4",t),children:e})}function f$r({changePct:e,prevValue:t,lowerIsBetter:r,className:n}){const s=r?e<0:e>=0;return o.jsxs("div",{className:Y("flex items-center gap-1 text-sm text-neutral1 flex-wrap",n),children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Y("[&>svg]:w-4 [&>svg]:h-4",s?"text-green-600":"text-red-600"),children:e>=0?o.jsx(y9t,{}):o.jsx(m9t,{})}),o.jsx("span",{className:Y(s?"text-green-600":"text-red-600"),children:`${e>=0?"+":"-"}${Math.abs(e).toFixed(1)}%`})]}),t&&o.jsxs("div",{children:["vs previous ",o.jsx("b",{className:"text-neutral2 font-semibold",children:t})]})]})}function h$r({message:e="Failed to load data",className:t}){return o.jsx("span",{className:Y("text-ui-sm text-accent2",t),children:e})}function p$r({children:e,className:t}){return o.jsx("span",{className:Y("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function m$r({className:e}){return o.jsx("span",{className:Y("text-sm",e),children:o.jsx(Mt,{size:"md",color:Lb.neutral1})})}function g$r({message:e="No previous value to compare",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function y$r({message:e="No data yet",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function v$r({children:e,className:t}){return o.jsx(zdt,{className:Y("flex-1 min-w-60",t),children:o.jsx("div",{className:"grid gap-1",children:e})})}function b$r({children:e,className:t}){return o.jsx("strong",{className:Y("text-header-lg text-neutral4 font-semibold",t),children:e})}const _n=Object.assign(v$r,{Label:p$r,Value:b$r,Change:f$r,NoChange:g$r,NoData:y$r,Error:h$r,Loading:m$r}),Qt=Object.assign(eRe,{Root:eRe,Kpi:_n,TopBar:d$r,TitleAndDescription:u$r,Title:eft,Description:Jdt,Summary:c$r,Loading:o$r,Error:a$r,Content:s$r,NoData:l$r});function pie({children:e,className:t}){return o.jsx("div",{className:Y("flex flex-wrap gap-8",t),children:e})}const jf=ccr,cd=ucr,mu=b.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(dcr,{children:o.jsx(ktt,{ref:s,align:t,sideOffset:r,className:Y("z-50 w-72 rounded-xl border-2 border-border1/50 bg-surface3 text-neutral5 shadow-md focus-visible:outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e&&/\bp[trblxy]?-\S+/.test(e)?!1:"py-3.5 px-3",e),...n})}));mu.displayName=ktt.displayName;function tft({children:e,...t}){const[r,n]=b.useState(!1),s=b.useRef(void 0),a=b.useCallback(()=>{clearTimeout(s.current),n(!0)},[]),i=b.useCallback(()=>{s.current=setTimeout(()=>n(!1),150)},[]);return b.useEffect(()=>()=>clearTimeout(s.current),[]),o.jsx(jf,{open:r,onOpenChange:n,...t,children:o.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function rft({disabled:e,onClear:t,onRemoveAll:r,onSave:n,onRemoveSaved:s}){const a=!!(r||n||s),i=!!t;return!i&&!a?null:o.jsxs("div",{className:"flex items-center gap-2",children:[i&&o.jsxs(me,{disabled:e,size:"md",onClick:()=>t(),children:[o.jsx(Xl,{}),"Clear"]}),a&&o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(me,{disabled:e,size:"md","aria-label":"More filter actions",children:o.jsx(Ezt,{})})}),o.jsxs(yt.Content,{align:"end",children:[r&&o.jsxs(yt.Item,{onSelect:()=>r(),children:[o.jsx(Xl,{}),"Remove all filters"]}),r&&(n||s)&&o.jsx(yt.Separator,{}),n&&o.jsxs(yt.Item,{onSelect:()=>n(),children:[o.jsx(IHe,{}),"Save filters for next time"]}),s&&o.jsxs(yt.Item,{onSelect:()=>s(),children:[o.jsx(RHe,{}),"Remove saved filters"]})]})]})]})}const SC=b.forwardRef(({className:e,...t},r)=>o.jsx(Ltt,{className:Y("grid gap-2",e),...t,ref:r}));SC.displayName=Ltt.displayName;const Kc=b.forwardRef(({className:e,...t},r)=>o.jsx($tt,{ref:r,className:Y("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",sn.all,"hover:border-neutral5 hover:shadow-md",PP,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:border-accent1 data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(wcr,{className:Y("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(THe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Kc.displayName=$tt.displayName;function nft({field:e,tokens:t,onChange:r}){const[n,s]=b.useState(""),a=b.useMemo(()=>{const u=n.trim().toLowerCase();return u?e.options.filter(d=>d.label.toLowerCase().includes(u)):e.options},[e.options,n]),i=b.useMemo(()=>t.find(u=>u.fieldId===e.id),[t,e.id]),l=typeof i?.value=="string"?i.value:void 0,c=b.useMemo(()=>Array.isArray(i?.value)?i.value:typeof i?.value=="string"?[i.value]:[],[i]);return o.jsxs(o.Fragment,{children:[e.searchable!==!1&&o.jsx(ar,{size:"sm",value:n,onChange:u=>s(u.target.value),placeholder:`Search ${e.label.toLowerCase()}...`,className:"mb-2",onKeyDown:u=>{if(u.key!=="ArrowDown")return;const f=u.currentTarget.closest("[data-pick-multi-panel]")?.querySelector("[data-pick-multi-item]:not([disabled])");f&&(u.preventDefault(),u.stopPropagation(),f.focus())}}),e.isLoading?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 text-ui-sm text-neutral3",children:[o.jsx(Mt,{size:"sm",className:"w-3 h-3",color:"var(--neutral3)"}),"Loading options…"]}):a.length===0?o.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:e.emptyText??"No option found."}):e.multi?o.jsx("div",{className:"max-h-[80dvh] overflow-auto",children:a.map(u=>{const d=c.includes(u.value);return o.jsxs("label",{title:u.label,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(fi,{"data-pick-multi-item":"",checked:d,onCheckedChange:f=>{const p=f===!0?c.includes(u.value)?c:[...c,u.value]:c.filter(m=>m!==u.value);r(e.id,p)},className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)})}):o.jsxs(SC,{value:l??"",onValueChange:u=>r(e.id,u),className:"max-h-[80dvh] gap-0 overflow-auto",children:[a.map(u=>o.jsxs("label",{title:u.label,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(Kc,{"data-pick-multi-item":"",value:u.value,className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)),o.jsxs("label",{title:"Any",className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(Kc,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function sft(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const mme="inline-flex",aft=`${Ql.md} border-y-2 border-border1 px-[.75em] text-neutral3 whitespace-nowrap flex items-center`,gme=`${aft} text-ui-md rounded-l-lg border-l-2 border-r-1`,yme=`${aft} text-ui-md `,vme="rounded-tl-none rounded-bl-none border-l-transparent",x$r="rounded-none",w$r="rounded-none";function S$r({field:e,value:t,onChange:r,onRemove:n,disabled:s,autoFocus:a}){const[i,l]=b.useState(t),c=b.useRef(null);return b.useEffect(()=>{i.trim()!==t&&l(t)},[t]),b.useEffect(()=>{a&&c.current?.focus()},[a]),o.jsxs("div",{className:mme,children:[o.jsx("span",{className:gme,children:e.label}),o.jsx("span",{className:yme,children:"is"}),o.jsx(ar,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,className:x$r,onChange:u=>{const d=u.target.value;l(d),d.trim()!==t&&r(d)},onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault();const d=i.trim();d!==t&&r(d)}else u.key==="Escape"&&(u.preventDefault(),l(t),u.target.blur())}}),o.jsx(me,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,className:vme,size:"md",onMouseDown:u=>u.preventDefault(),onClick:n,children:o.jsx(Xl,{})})]})}function O$r({field:e,token:t,tokens:r,onChange:n,onRemove:s,disabled:a}){const[i,l]=b.useState(!1);return o.jsxs("div",{className:mme,children:[o.jsx("span",{className:gme,children:e.label}),o.jsx("span",{className:yme,children:"is"}),o.jsxs(jf,{open:i,onOpenChange:l,children:[o.jsx(cd,{asChild:!0,children:o.jsx(me,{type:"button",disabled:a,size:"md",className:w$r,children:sft(t.value)})}),o.jsx(mu,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:o.jsx(nft,{field:e,tokens:r,onChange:n})})]}),o.jsx(me,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,className:vme,size:"md",onClick:s,children:o.jsx(Xl,{})})]})}function ift({fields:e,tokens:t,onTokensChange:r,disabled:n,autoFocusFieldId:s}){if(t.length===0)return null;const a=(l,c)=>{const u=[...t];u[l]=c,r(u)},i=l=>{r(t.filter((c,u)=>u!==l))};return o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map((l,c)=>{const u=e.find(d=>d.id===l.fieldId);return u?u.kind==="text"&&typeof l.value=="string"?o.jsx(S$r,{field:u,value:l.value,disabled:n,autoFocus:s===l.fieldId,onChange:d=>a(c,{fieldId:l.fieldId,value:d}),onRemove:()=>i(c)},`${l.fieldId}-${c}`):u.kind==="pick-multi"?o.jsx(O$r,{field:u,token:l,tokens:t,disabled:n,onChange:(d,f)=>{if(f===void 0){i(c);return}a(c,{fieldId:d,value:f})},onRemove:()=>i(c)},`${l.fieldId}-${c}`):o.jsxs("div",{className:mme,children:[o.jsx("span",{className:gme,children:u.label}),o.jsx("span",{className:yme,children:"is"}),o.jsx("span",{className:"px-2.5 py-1.5 max-w-[20rem] truncate",children:sft(l.value)}),o.jsx(me,{type:"button",disabled:n,size:"md","aria-label":`Remove ${u.label} filter`,className:vme,onClick:()=>i(c),children:o.jsx(Xl,{})})]},`${l.fieldId}-${c}`):null})})}function oft({fields:e,tokens:t,onTokensChange:r,label:n="Add Filter",disabled:s,size:a,onStartTextFilter:i}){const[l,c]=b.useState(!1),[u,d]=b.useState(),[f,h]=b.useState(""),[p,m]=b.useState([]),[g,y]=b.useState(),[x,w]=b.useState(),S=b.useRef(null),k=b.useRef(!1),_=b.useCallback(R=>{w(B=>B===R?void 0:R)},[]),E=b.useCallback(()=>w(void 0),[]);b.useEffect(()=>{l||w(void 0)},[l]);const T=b.useMemo(()=>e.find(R=>R.id===u),[e,u]),j=b.useMemo(()=>{const R=new Set;for(const B of t){const M=e.find(F=>F.id===B.fieldId);M&&M.kind!=="pick-multi"&&R.add(B.fieldId)}return R},[t,e]),N=b.useCallback(()=>{d(void 0),h(""),m([]),y(void 0)},[]);b.useEffect(()=>{l||N()},[l,N]),b.useEffect(()=>{l&&T?.kind==="text"&&S.current?.focus()},[l,T]);const I=b.useCallback((R,B)=>{const M=t.findIndex(z=>z.fieldId===R);if(B===void 0||Array.isArray(B)&&B.length===0){if(M===-1)return;r(t.filter((z,H)=>H!==M));return}if(M===-1){r([...t,{fieldId:R,value:B}]);return}const U=[...t];U[M]={fieldId:R,value:B},r(U)},[r,t]),P=b.useCallback(()=>{if(!T){y("Choose a property first.");return}if(j.has(T.id)){y(`Remove the existing ${T.label} filter before adding another.`);return}if(T.kind==="text"&&!f.trim()){y(`Enter a value for ${T.label}.`);return}if(T.kind==="multi-select"&&p.length===0){y(`Choose at least one ${T.label.toLowerCase()} value.`);return}const R=T.kind==="multi-select"?{fieldId:T.id,value:p}:{fieldId:T.id,value:f.trim()};r([...t,R]),c(!1)},[p,r,T,j,f,t]);return o.jsxs(jf,{open:l,onOpenChange:c,children:[o.jsx(cd,{asChild:!0,children:o.jsxs(me,{variant:"outline",size:a,disabled:s,children:[o.jsx(Zzt,{}),n]})}),o.jsx(mu,{align:"end",className:"p-3 w-64",onOpenAutoFocus:R=>R.preventDefault(),onCloseAutoFocus:R=>{k.current&&(k.current=!1,R.preventDefault())},children:o.jsxs("div",{className:"grid gap-3",children:[T&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button","aria-label":"Back to properties",className:"text-neutral3 hover:text-neutral6 transition-colors",onClick:()=>{d(void 0),h(""),m([]),y(void 0)},children:o.jsx(zE,{className:"h-4 w-4"})}),o.jsx(zzt,{className:"h-4 w-4 shrink-0 text-neutral3"}),o.jsx("span",{className:"text-ui-sm text-neutral3",children:`${T.label} · is`})]}),!T&&o.jsx("div",{role:"menu",className:"max-h-[80dvh] overflow-auto",onKeyDown:R=>{if(R.key!=="ArrowDown"&&R.key!=="ArrowUp"&&R.key!=="Home"&&R.key!=="End")return;const B=Array.from(R.currentTarget.querySelectorAll("[data-filter-item]:not([disabled])"));if(B.length===0)return;R.preventDefault();const M=document.activeElement,F=B.findIndex(z=>z===M);let U;R.key==="Home"?U=0:R.key==="End"?U=B.length-1:R.key==="ArrowDown"?U=F<0?0:(F+1)%B.length:U=F<=0?B.length-1:F-1,B[U]?.focus()},children:e.length>0?e.map(R=>{const B=j.has(R.id);return R.kind==="pick-multi"?o.jsx(k$r,{field:R,tokens:t,onChange:I,open:x===R.id,onToggle:_,onClose:E},R.id):o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none",B?"cursor-not-allowed text-neutral2 opacity-70":"text-neutral4 hover:bg-surface4 hover:text-neutral6"),disabled:B,onClick:()=>{if(y(void 0),R.kind==="text"){r([...t,{fieldId:R.id,value:""}]),i?.(R.id),k.current=!0,c(!1);return}d(R.id)},children:[o.jsx("span",{className:"truncate",children:R.label}),B?o.jsx("span",{className:"ml-auto text-neutral3",children:"In use"}):o.jsx(Vce,{className:"ml-auto h-4 w-4 text-neutral3 opacity-0 transition-opacity group-hover:opacity-100 group-focus:opacity-100"})]},R.id)}):o.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:"No matching property."})}),T&&T.kind==="text"&&o.jsx(ar,{ref:S,size:"md",value:f,onChange:R=>{h(R.target.value),y(void 0)},placeholder:T.placeholder??`Enter ${T.label}`,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P())}}),T&&T.kind==="multi-select"&&o.jsx(Idt,{options:T.options??[],value:p,onValueChange:R=>{m(R),y(void 0)},placeholder:T.placeholder??`Choose ${T.label}`,searchPlaceholder:`Search ${T.label.toLowerCase()}...`,emptyText:T.emptyText??"No option found.",size:"md"}),g&&o.jsx("div",{className:"text-ui-sm text-red-500",children:g}),T&&T.kind!=="pick-multi"&&o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(me,{variant:"ghost",size:"md",onClick:()=>c(!1),children:"Cancel"}),o.jsx(me,{variant:"outline",size:"md",onClick:P,children:"Add filter"})]})]})})]})}function k$r({field:e,tokens:t,onChange:r,open:n,onToggle:s,onClose:a}){const i=b.useRef(null);return o.jsxs(jf,{open:n,onOpenChange:l=>{l?s(e.id):a()},children:[o.jsx(cd,{asChild:!0,children:o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none"),onKeyDown:l=>{l.key!=="ArrowRight"&&l.key!=="ArrowLeft"||(n||s(e.id),l.preventDefault(),requestAnimationFrame(()=>{i.current?.querySelector('input, button, [tabindex]:not([tabindex="-1"])')?.focus()}))},children:[n&&o.jsx(zce,{className:"h-4 w-4 text-neutral3 shrink-0"}),o.jsx("span",{className:"truncate",children:e.label}),!n&&o.jsx(k_,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),o.jsx(mu,{ref:i,side:"right",align:"start",sideOffset:8,className:"w-64 p-2",onOpenAutoFocus:l=>l.preventDefault(),onKeyDown:l=>{if(l.key!=="ArrowDown"&&l.key!=="ArrowUp"&&l.key!=="Home"&&l.key!=="End")return;const c=Array.from(l.currentTarget.querySelectorAll("[data-pick-multi-item]:not([disabled])"));if(c.length===0)return;l.preventDefault(),l.stopPropagation();const u=document.activeElement,d=c.findIndex(h=>h===u);let f;l.key==="Home"?f=0:l.key==="End"?f=c.length-1:l.key==="ArrowDown"?f=d<0?0:(d+1)%c.length:f=d<=0?c.length-1:d-1,c[f]?.focus()},"data-pick-multi-panel":!0,children:o.jsx(nft,{field:e,tokens:t,onChange:r})})]})}const lft=(e,{enabled:t=!0})=>{const r=b.useRef(t);je.useEffect(()=>{if(!t||!e?.current)return;const n=e.current,s=new MutationObserver(()=>{r.current&&n.scrollTo({top:n.scrollHeight,behavior:"smooth"})});s.observe(n,{childList:!0,subtree:!0,characterData:!0});const a=i=>{const l=i.target,c=l.scrollTop+l.clientHeight,u=l.scrollHeight;c>=u-1?r.current=!0:r.current=!1};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a),s.disconnect()}},[t,e])},Ms=b.forwardRef(({className:e,children:t,viewPortClassName:r,maxHeight:n,autoScroll:s=!1,orientation:a="vertical",...i},l)=>{const c=b.useRef(null);return lft(c,{enabled:s}),o.jsxs(Xtt,{ref:l,className:Y("relative overflow-hidden",e),...i,children:[o.jsx(Rcr,{ref:c,className:Y("h-full w-full rounded-[inherit] [&>div]:block!",r),style:n?{maxHeight:n}:void 0,children:t}),(a==="vertical"||a==="both")&&o.jsx(mie,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&o.jsx(mie,{orientation:"horizontal"}),a==="both"&&o.jsx(Pcr,{})]})});Ms.displayName=Xtt.displayName;const mie=b.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(Kde,{ref:n,orientation:t,className:Y("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(Qtt,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));mie.displayName=Kde.displayName;const tRe={sm:Ql.sm,md:Ql.md,lg:Ql.lg,default:Ql.default},jm=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=b.useId(),i=b.useRef(null),l=m1(u=>{e(u)},n);b.useEffect(()=>()=>{l.cancel()},[l]),b.useEffect(()=>{const u=i.current;if(!u)return;const d=f=>{f.key.toLowerCase()==="f"&&f.shiftKey&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),u.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const c=u=>{l(u.target.value)};return o.jsxs("div",{className:Y("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",F2r,$2r,sn.all,"hover:border-neutral2",tRe[s]),children:[o.jsx(__,{className:Y("text-neutral3 h-4 w-4",sn.colors)}),o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{htmlFor:a,className:"sr-only",children:t}),o.jsx("input",{id:a,type:"text",placeholder:r,className:Y("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",tRe[s]),name:a,ref:i,onChange:c})]})]})},_$r=({children:e})=>o.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),M4=b.forwardRef(({className:e,...t},r)=>o.jsxs(hrt,{ref:r,className:Y("relative flex w-full touch-none select-none items-center group",e),...t,children:[o.jsx(Kcr,{className:Y("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",sn.colors),children:o.jsx(Jcr,{className:Y("absolute h-full bg-accent1",sn.all)})}),o.jsx(eur,{className:Y("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",PP,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));M4.displayName=hrt.displayName;const wc=b.forwardRef(({className:e,...t},r)=>o.jsx(brt,{className:Y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",sn.all,PP,"hover:brightness-110","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:brightness-100","data-[state=checked]:bg-accent1 data-[state=checked]:shadow-glow-accent1","data-[state=unchecked]:bg-neutral2",e),...t,ref:r,children:o.jsx(aur,{className:Y("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-md","transition-all duration-normal ease-out-custom","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0","data-[state=checked]:shadow-lg")})}));wc.displayName=brt.displayName;function E$r({children:e,untilChar:t,charCount:r,copy:n,withTooltip:s=!0,className:a,as:i="span",...l}){const c=e;let u=c,d=!1;if(t!==void 0){const h=c.indexOf(t);h!==-1&&(u=c.slice(0,h),d=!0)}else r!==void 0&&c.length>r&&(u=c.slice(0,r),d=!0);if(!d)return o.jsx(pe,{as:i,className:a,...l,children:c});const f=o.jsxs(pe,{as:"span",className:"cursor-default",variant:l.variant,font:l.font,children:[u,"..."]});return o.jsxs(pe,{as:i,className:Y("group inline-flex items-center gap-1",a),...l,children:[s?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:f}),o.jsx(Wr,{children:c})]}):f,n&&o.jsx(Ka,{content:c,className:"opacity-0 group-hover:opacity-100 transition-opacity"})]})}function ps({children:e,className:t,spacing:r="default"}){return o.jsx("div",{className:Y("flex gap-2 items-center ",{"gap-[2px] [&>*:not(:last-child)]:rounded-r-none [&>*:not(:first-child)]:rounded-l-none":r==="close"},t),children:e})}function zr({children:e,className:t,style:r}){const n=cft("MainContentLayout");return o.jsx("main",{className:Y("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...r,...n?{border:"3px dotted red"}:{}},children:e})}function pf({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=cft("MainContentContent"),l=bme({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return o.jsx("div",{className:l,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const bme=({isCentered:e,isDivided:t,hasLeftServiceColumn:r,className:n})=>Y("grid overflow-y-auto h-full ","overflow-x-auto min-w-min",{"items-start content-start":!e&&!t&&!r,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!r,"grid-cols-[12rem_1fr_1fr]":t&&r,"grid-cols-[auto_1fr]":!t&&r},n);function cft(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(n=>n.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}function C$r({children:e,className:t}){return o.jsx("div",{className:Y("grid content-start",t),children:e})}function j$r({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral3 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1 first-of-type:mt-3 ml-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function T$r({children:e,title:t,description:r,icon:n,className:s,withMargins:a=!0}){const i=t==="loading",l=r==="loading";return e?o.jsx("header",{className:Y("grid grid-cols-[1fr_auto] gap-16 w-full ",{"mt-[6vh] mb-[4vh]":a},s),children:e}):o.jsxs("header",{className:Y("grid gap-2 pt-8 pb-8 ",s),children:[o.jsx("h1",{className:Y("text-neutral6 text-xl font-normal flex items-center gap-2","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:text-neutral3",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":i}),children:i?o.jsx(o.Fragment,{children:" "}):o.jsxs(o.Fragment,{children:[n&&n," ",t]})}),r&&o.jsx("p",{className:Y("text-neutral4 text-sm m-0",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":l}),children:l?o.jsx(o.Fragment,{children:" "}):r})]})}function N$r({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":r==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}const Ir=Object.assign(T$r,{Title:N$r,Description:j$r,Column:C$r});function Tx({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-12",t),children:e})}const uft=({className:e,children:t})=>o.jsx("div",{className:Y("flex items-center text-ui-sm border border-border1 rounded-lg overflow-hidden","[&>button]:border-0 [&>button:not(:first-child)]:border-l [&>button:not(:first-child)]:border-border1","[&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg",e),children:t});function D4({className:e,classNames:t,showOutsideDays:r=!0,...n}){return o.jsx(Bhr,{showOutsideDays:r,className:Y("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0 ",month:"space-y-4 text-ui-sm ",caption:"flex justify-between pt-1 items-center pl-2",caption_label:"text-text font-medium ",nav:"flex items-center",nav_button_previous:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),dropdown_month:"w-full border-collapse space-y-1",weeknumber:"flex",day:Y("relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-surface5 [&:has([aria-selected].day-outside)]:bg-surface5/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start rounded-l-md",day_range_end:"day-range-end rounded-r-md",day_selected:Y("bg-accent1! text-white! hover:bg-accent1/80! focus:bg-accent1/80! focus:text-white!",n.mode!=="range"&&"rounded-md"),day_today:"bg-neutral6/10 text-neutral5",day_outside:"day-outside text-neutral3 opacity-50 aria-selected:bg-surface5/50 aria-selected:text-neutral3 aria-selected:opacity-30",day_disabled:"text-neutral3 opacity-50",day_range_middle:"aria-selected:bg-surface5 aria-selected:text-neutral5",day_hidden:"invisible",head_cell:"text-ui-xs text-neutral3",...t},...n})}const sQ=["12","1","2","3","4","5","6","7","8","9","10","11"],nL=["00","15","30","45","59"],sL=["AM","PM"];function gie({defaultValue:e,onValueChange:t,className:r}){const[n,s]=b.useState("12"),[a,i]=b.useState("00"),[l,c]=b.useState("AM");b.useEffect(()=>{if(e){const h=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,p=e.match(h);if(p){let m=parseInt(p[1],10);const g=parseInt(p[2],10),y=p[3]?.toUpperCase();m>=1&&m<=12&&g>=0&&g<=59&&(s(m.toString()),i(g===0?"00":g.toString()),c(y||"AM"))}}},[e]);const u=h=>{s(h),t(`${sQ[+h]}:${a} ${l}`.trim())},d=h=>{i(nL[+h]),t(`${n}:${nL[+h]} ${l}`.trim())},f=h=>{c(sL[+h]),t(`${n}:${a} ${sL[+h]}`.trim())};return o.jsxs("div",{className:Y("flex gap-2 items-center",r),children:[o.jsxs(hi,{name:"hour",value:sQ.indexOf(n).toString(),onValueChange:u,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:sQ.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),":",o.jsxs(hi,{name:"minute",value:nL.indexOf(a).toString(),onValueChange:d,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:nL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),o.jsxs(hi,{name:"period",value:sL.indexOf(l).toString(),onValueChange:f,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:sL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]})]})}const rRe=({value:e,minValue:t,maxValue:r,defaultTimeStrValue:n,onValueChange:s,children:a,className:i,placeholder:l,...c})=>{const[u,d]=b.useState(!1);return o.jsxs(jf,{open:u,onOpenChange:d,children:[o.jsx(cd,{asChild:!0,children:a||o.jsx(I$r,{value:e,placeholder:l,className:i,"data-testid":"datepicker-button"})}),o.jsx(mu,{className:"backdrop-blur-4xl w-auto p-0! bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:o.jsx(A$r,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...c})})]})};function aL({date:e,timeStr:t=""}){if(!jy(e))return null;if(t){const r=tr(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(jy(n))return n}return e}const A$r=({value:e,minValue:t,maxValue:r,onValueChange:n,setOpenPopover:s,placeholder:a,className:i,defaultTimeStrValue:l,...c})=>{const[u,d]=b.useState(null),[f,h]=b.useState(e?tr(aL({date:e,timeStr:l})||"","PP p"):""),[p,m]=b.useState(l||""),[g,y]=b.useState(e?new Date(e):void 0),x=m1(B=>{jy(B)&&(y(B),n?.(B),s?.(!1))},500),w=B=>{h(B.currentTarget.value);const M=new Date(B.currentTarget.value);x(M)},S=B=>{jy(B)?r&&B>r?(d(`The selected date should be before ${tr(r,"PP p")}`),h("")):t&&B<t?(d(`The selected date should be after ${tr(t,"PP p")}`),h("")):(h(tr(B,"PP p")),d("")):(h(""),d(""))},k=new Date(f),_=jy(k),E=_&&k.getTime()!==e?.getTime(),T=B=>{if(y(B),B){const M=aL({date:B,timeStr:p});S(M||"")}else S("")},j=B=>{if(y(B),B){const M=aL({date:B,timeStr:p});S(M||"")}else S("")},N=B=>{if(m(B),_){const M=aL({date:k,timeStr:B});S(M||"")}},I=()=>{s?.(!1)},P=()=>{jy(k)&&n(k),s?.(!1)},R=()=>{n(void 0),y(void 0),h(""),m(""),s?.(!1)};return o.jsxs("div",{"aria-label":"Choose date",className:Y("relative flex flex-col",i),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&s?.(!1)},children:[o.jsx(Cx,{name:"date-range",type:"text",value:f,onChange:w,placeholder:a,className:"m-4 mb-0 w-auto!"}),u&&o.jsxs("div",{className:Y("text-ui-md m-4 mb-0 text-neutral3","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mt-0.5 [&>svg]:text-red-500 [&>svg]:float-left [&>svg]:mr-2"),children:[o.jsx(TF,{})," ",u]}),o.jsx(D4,{mode:"single",month:g,selected:g,onMonthChange:j,onSelect:T,...c}),o.jsx(gie,{onValueChange:N,className:"m-4 mt-0 w-auto",defaultValue:e?tr(new Date(e),"hh:mm a"):l}),o.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-2 m-4 mt-0",children:[E&&o.jsx(me,{tabIndex:0,size:"md",onClick:R,type:"button",children:"Clear"}),o.jsx(me,{tabIndex:0,type:"button",size:"md",variant:E?"primary":"default",onClick:()=>{_?P():I()},children:E?"Apply":"Cancel"})]})]})},I$r=b.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>o.jsxs(me,{ref:s,className:Y("justify-start",r),variant:"inputLike",...n,children:[o.jsx(nne,{className:"h-4 w-4"}),e?o.jsx("span",{className:"text-white",children:tr(e,"PP p")}):o.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function dft({children:e}){return o.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function fft(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function hft({entry:e,isSelected:t,onClick:r,children:n,columns:s}){const a=()=>{r?.(e?.id)};return o.jsx("li",{className:Y("border-t text-neutral5 border-border1 last:border-b-0 text-ui-md","[&:last-child>button]:rounded-b-lg",sn.colors,{"bg-accent1Dark":t}),children:o.jsx("button",{onClick:a,className:Y("grid w-full px-6 gap-6 text-left items-center min-h-12",sn.colors,c0.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:fft(s)},disabled:!e,children:n})})}function R$r({children:e,isLoading:t}){return o.jsx("div",{className:"text-neutral4 text-ui-md truncate ",children:t?o.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none"}):e})}function P$r({status:e}){return o.jsxs("div",{className:Y("flex justify-center items-center w-full relative"),children:[e?o.jsx("div",{className:Y("w-[0.6rem] h-[0.6rem] rounded-full",{"bg-green-600":e==="success","bg-red-700":e==="failed"})}):o.jsx("div",{className:"text-neutral2 text-ui-sm leading-none",children:"-"}),o.jsxs(Ku,{children:["Status: ",e||"not provided"]})]})}function pft({columns:e}){return o.jsx("div",{className:Y("sticky top-0 bg-surface4 z-10 rounded-t-lg px-6"),children:o.jsx("div",{className:Y("grid gap-6 text-left uppercase py-3 text-neutral3 text-ui-sm"),style:{gridTemplateColumns:fft(e)},children:e?.map(t=>o.jsx("span",{children:t.label||t.name},t.name))})})}function M$r({children:e,message:t,className:r,type:n}){return!e&&!t?null:o.jsx("div",{className:Y("grid border-t border-border1",r),children:t?o.jsxs("p",{className:Y("text-neutral3 text-ui-md text-center grid p-8 justify-center justify-items-center gap-2","[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-75",{"[&>svg]:text-red-500":n==="error"}),children:[n==="error"?o.jsx(BE,{}):o.jsx($R,{})," ",t]}):e})}function D$r({isLoading:e,hasMore:t,setEndOfListElement:r,loadingText:n="Loading more data...",noMoreDataText:s="No more data to load"}){return r?o.jsxs("div",{ref:r,className:"text-ui-md text-neutral3 opacity-50 flex mt-8 justify-center",children:[e&&n,!t&&!e&&s]}):null}function L$r({currentPage:e,hasMore:t,onNextPage:r,onPrevPage:n}){const s=typeof e=="number"&&e>0||t;return o.jsxs("div",{className:Y("flex pt-6 items-center justify-center text-neutral3 text-ui-md gap-8"),children:[o.jsxs("span",{children:["Page ",o.jsx("b",{children:e?e+1:"1"})]}),s&&o.jsxs("div",{className:Y("flex gap-4","[&>button]:flex [&>button]:items-center [&>button]:gap-2 [&>button]:text-neutral4 [&>button:hover]:text-neutral5 [&>button]:transition-colors [&>button]:border [&>button]:border-border1 [&>button]:p-1 [&>button]:px-2 [&>button]:rounded-md","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[typeof e=="number"&&e>0&&o.jsxs("button",{onClick:n,children:[o.jsx(zE,{}),"Previous"]}),t&&o.jsxs("button",{onClick:r,children:["Next",o.jsx(Qm,{})]})]})]})}function $$r({children:e}){return o.jsx("div",{className:"grid",children:e})}function mft({children:e}){return o.jsx("div",{className:Y("rounded-lg border border-border1 overflow-clip"),children:e})}const fa=Object.assign($$r,{Header:pft,Trim:mft,Entries:dft,Entry:hft,Message:M$r,NextPageLoading:D$r,Pagination:L$r,EntryText:R$r,EntryStatus:P$r}),nRe=["75%","50%","65%","90%","60%","80%"];function F$r({columns:e,numberOfRows:t=3}){const r=(n,s)=>{const a=(n+s+(e?.length||0)+(t||0))%nRe.length;return nRe[a]};return o.jsx(dft,{children:Array.from({length:t}).map((n,s)=>o.jsx(hft,{columns:e,children:(e||[]).map((a,i)=>{const l=`${a.name}-${i}`;return o.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none",style:{width:`${r(s,i)}`}},l)})},s))})}function gft({columns:e,numberOfRows:t}){return o.jsx(fa,{children:o.jsxs(mft,{children:[o.jsx(pft,{columns:e}),o.jsx(F$r,{columns:e,numberOfRows:t})]})})}function yft({entries:e,id:t,update:r}){const n=e.findIndex(a=>a.id===t);if(n<e.length-1)return()=>{const a=e[n+1];r(a.id)}}function vft({entries:e,id:t,update:r}){const n=e.findIndex(a=>a.id===t);if(n>0)return()=>{const a=e[n-1];r(a.id)}}function bft({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,required:a,disabled:i,helpMsg:l,options:c,onValueChange:u,placeholder:d="Select an option",size:f="default"}){const h=({children:p})=>n?o.jsx(Ku,{children:p}):p;return o.jsxs("div",{className:Y("flex gap-2 items-center",{"grid-rows-[auto_1fr]":r,"grid-rows-[auto_1fr_auto]":l},s),children:[o.jsx(h,{children:o.jsxs("label",{className:Y("text-ui-sm text-neutral3 flex justify-between items-center shrink-0"),children:[r,a&&o.jsx("i",{className:"text-neutral2",children:"(required)"})]})}),o.jsxs(hi,{name:e,value:t,onValueChange:u,disabled:i,children:[o.jsx(ei,{id:`select-${e}`,size:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate w-full",children:o.jsx(pi,{placeholder:d})}),o.jsx(ti,{children:c.map(p=>o.jsx(ss,{value:p.value,disabled:p.disabled,children:o.jsxs("span",{className:"whitespace-nowrap truncate flex items-center gap-2",children:[p.icon,p.label]})},p.value))})]}),l&&o.jsx("p",{className:"text-neutral3 text-ui-sm",children:l})]})}const xft=b.createContext(null);function z$r({children:e,value:t}){return o.jsx(xft.Provider,{value:t,children:e})}function B9(){const e=b.useContext(xft);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let B$r=0;function U9(e={}){return{id:`field-${Date.now()}-${B$r++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function U$r(e){return e==="text"?"string":e}function wft(e){const t=U$r(e.type),n={type:e.nullable?[t,"null"]:t};if(e.description&&(n.description=e.description),e.type==="object"&&e.properties&&e.properties.length>0){const{properties:s,required:a}=Sft(e.properties);n.properties=s,a.length>0&&(n.required=a)}return e.type==="array"&&e.items&&(n.items=wft(e.items)),n}function Sft(e){const t={},r=[];for(const n of e)n.name.trim()&&(t[n.name]=wft(n),n.optional||r.push(n.name));return{properties:t,required:r}}function V$r(e){const{properties:t,required:r}=Sft(e),n={type:"object",properties:t};return r.length>0&&(n.required=r),n}function Oft(e){if(Array.isArray(e)){const t=e.includes("null");return{type:e.find(n=>n!=="null")||"string",nullable:t}}return{type:e||"string",nullable:!1}}function kft(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function _ft(e){const{type:t,nullable:r}=Oft(e.type);return U9({name:"",type:kft(t),description:e.description,nullable:r,optional:!1,properties:e.properties?V9({properties:e.properties,required:e.required}):void 0,items:e.items?_ft(e.items):void 0})}function V9(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([r,n])=>{const{type:s,nullable:a}=Oft(n.type);return U9({name:r,type:kft(s),description:n.description,nullable:a,optional:!t.has(r),properties:n.properties?V9({properties:n.properties,required:n.required}):void 0,items:n.items?_ft(n.items):void 0})})}function yie(e,t,r,n){if(t.length===0)return e.map(i=>i.id===r?{...i,...n}:i);const[s,...a]=t;return e.map(i=>i.id!==s?i:i.type==="object"?{...i,properties:yie(i.properties||[],a,r,n)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:yie(i.items.properties||[],a,r,n)}}:i)}function vie(e,t,r){if(t.length===0)return[...e,r];const[n,...s]=t;return e.map(a=>a.id!==n?a:a.type==="object"?{...a,properties:vie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:vie(a.items.properties||[],s,r)}}:a)}function bie(e,t,r){if(t.length===0)return e.filter(a=>a.id!==r);const[n,...s]=t;return e.map(a=>a.id!==n?a:a.type==="object"?{...a,properties:bie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:bie(a.items.properties||[],s,r)}}:a)}function q$r({onChange:e,onFieldsChange:t,defaultValue:r,maxDepth:n=5,className:s,children:a}){const[i,l]=b.useState(()=>r||[]),c=b.useRef("");b.useEffect(()=>{const p=V$r(i),m=JSON.stringify(p);m!==c.current&&(c.current=m,e?.(p))},[i,e]),b.useEffect(()=>{t?.(i)},[i,t]);const u=b.useCallback(p=>{const m=U9();l(g=>vie(g,p,m))},[]),d=b.useCallback((p,m)=>{l(g=>bie(g,p,m))},[]),f=b.useCallback((p,m,g)=>{l(y=>yie(y,p,m,g))},[]),h=b.useMemo(()=>({fields:i,addField:u,removeField:d,updateField:f,maxDepth:n}),[i,u,d,f,n]);return o.jsx(z$r,{value:h,children:o.jsx("div",{className:Y(s),children:a})})}const Eft=b.createContext(null);function H$r({children:e,value:t}){return o.jsx(Eft.Provider,{value:t,children:e})}function OC(){const e=b.useContext(Eft);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function Q$r({field:e,parentPath:t=[],depth:r=0,className:n,children:s}){const{updateField:a,removeField:i}=B9(),l=b.useCallback(d=>{a(t,e.id,d)},[a,t,e.id]),c=b.useCallback(()=>{i(t,e.id)},[i,t,e.id]),u=b.useMemo(()=>({field:e,parentPath:t,depth:r,update:l,remove:c}),[e,t,r,l,c]);return o.jsx(H$r,{value:u,children:o.jsx("div",{className:Y(n),children:s})})}const Cft=b.createContext(null);function W$r({children:e,value:t}){return o.jsx(Cft.Provider,{value:t,children:e})}function jft(){return b.useContext(Cft)}function G$r({className:e,children:t}){const{fields:r}=B9(),n=jft(),s=n?n.fields:r,a=n?n.parentPath:[],i=n?n.depth:0;return s.length===0?null:o.jsx("div",{className:e,children:s.map((l,c)=>t(l,c,{parentPath:a,depth:i}))})}function Z$r(e){const{field:t,update:r}=OC(),n=b.useCallback(s=>{r({name:s.target.value})},[r]);return o.jsx(Cx,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:n})}const Y$r=[{value:"string",label:"String",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Hce,{})})},{value:"number",label:"Number",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Bce,{})})},{value:"boolean",label:"Boolean",icon:o.jsx(Ce,{size:"sm",children:o.jsx(qce,{})})},{value:"text",label:"Text",icon:o.jsx(Ce,{size:"sm",children:o.jsx(fA,{})})},{value:"object",label:"Object",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Db,{})})},{value:"array",label:"Array",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Uce,{})})}];function X$r({className:e,...t}){const{field:r,update:n}=OC(),s=b.useCallback(a=>{n({type:a})},[n]);return o.jsx($o,{className:Y("w-28 shrink-0",e),name:`field-type-${r.id}`,label:"Select type",labelIsHidden:!0,value:r.type,onValueChange:s,options:Y$r,size:"md",...t})}function K$r({label:e="Optional",labelClassName:t,className:r,...n}){const{field:s,update:a}=OC(),i=b.useCallback(l=>{a({optional:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(fi,{...n,className:r,checked:s.optional,onCheckedChange:i}),e]})}function J$r({label:e="Nullable",labelClassName:t,className:r,...n}){const{field:s,update:a}=OC(),i=b.useCallback(l=>{a({nullable:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(fi,{...n,className:r,checked:s.nullable,onCheckedChange:i}),e]})}function e3r({children:e,tooltip:t="Remove field",...r}){const{remove:n}=OC();return o.jsx(Cn,{tooltipContent:t,onClick:n,size:"md",...r,children:e||o.jsx(RHe,{})})}function t3r({className:e,children:t}){const{maxDepth:r,updateField:n}=B9(),{field:s,parentPath:a,depth:i}=OC(),l=s.type==="object"||s.type==="array",c=i>=r;if(b.useEffect(()=>{s.type==="object"&&!s.properties&&n(a,s.id,{properties:[]}),s.type==="array"&&!s.items&&n(a,s.id,{items:U9({name:"items",type:"object",properties:[]})})},[s.type,s.properties,s.items,s.id,a,n]),!l||c)return null;const u=[...a,s.id],d=i+1,f=s.type==="object"?s.properties||[]:s.type==="array"&&s.items?s.items.properties||[]:[];return o.jsx(W$r,{value:{parentPath:u,depth:d,fields:f},children:o.jsx("div",{className:Y("pl-4 border-l border-border1 mt-2",e),children:t})})}function r3r({children:e,...t}){const{addField:r}=B9(),n=jft(),s=n?n.parentPath:[],a=b.useCallback(()=>{r(s)},[r,s]);return o.jsx(me,{type:"button",...t,onClick:a,children:e||"Add field"})}const vi={Root:q$r,Field:Q$r,FieldList:G$r,FieldName:Z$r,FieldType:X$r,FieldOptional:K$r,FieldNullable:J$r,FieldRemove:e3r,NestedFields:t3r,AddField:r3r};function E1({data:e,className:t,labelsAreHidden:r,isLoading:n,LinkComponent:s}){const a=({children:i})=>r?o.jsx(Ku,{children:i}):i;return!e||e.length===0?null:o.jsx("dl",{className:Y("grid grid-cols-[auto_1fr] gap-x-4 items-start content-start",t),children:e.map(({label:i,value:l,icon:c,separator:u},d)=>{const f=Array.isArray(l);return o.jsxs(je.Fragment,{children:[o.jsxs("dt",{className:Y("text-neutral3 text-ui-md flex items-center gap-8 justify-between min-h-9"),children:[o.jsxs("span",{className:Y("flex items-center gap-2","[&>svg]:w-[1.4em] [&>svg]:h-[1.4em] [&>svg]:text-neutral3 [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[c," ",o.jsx(a,{children:i})]}),!r&&o.jsx("span",{className:Y("text-neutral3","[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:text-neutral3"),children:u})]}),o.jsx("dd",{className:Y("flex flex-wrap gap-2 py-1 min-h-9 text-ui-md items-center text-neutral5 text-wrap","[&>a]:text-neutral5 [&>a]:max-w-full [&>a]:w-auto truncate [&>a]:bg-surface4 [&>a]:transition-colors [&>a]:flex [&>a]:items-center [&>a]:gap-2 [&>a]:pt-0.5 [&>a]:pb-0.5 [&>a]:px-2 [&>a]:rounded-md [&>a]:text-ui-md [&>a]:min-h-7 [&>a]:leading-none","[&>a:hover]:text-neutral6 [&>a:hover]:bg-surface6","[&>a>svg]:w-[1em] [&>a>svg]:h-[1em] [&>a>svg]:text-neutral3 [&>a>svg]:ml-[-0.5em]"),children:n?o.jsx("span",{className:Y("bg-surface4 rounded-e-lg w-full"),style:{width:`${Math.floor(Math.random()*61)+50}%`},children:" "}):f?l?.map(h=>h.path&&s?o.jsx(sRe,{description:h.description,children:o.jsxs(s,{href:h.path,children:[h?.name," ",o.jsx(k_,{})]})},h.id):h.path?o.jsx(sRe,{description:h.description,children:o.jsxs("a",{href:h.path,children:[h?.name," ",o.jsx(k_,{})]})},h.id):o.jsx("span",{children:h?.name},h.id)):o.jsx(o.Fragment,{children:l||o.jsx("span",{className:"text-neutral3 text-ui-sm",children:"n/a"})})})]},i+d)})})}function sRe({description:e,children:t}){return e?o.jsxs(Ofe,{openDelay:250,children:[o.jsx(kfe,{asChild:!0,children:t}),o.jsx(_fe,{children:o.jsxs(Efe,{className:"z-50 w-auto max-w-60 rounded-md bg-surface5 p-2 px-4 text-ui-sm text-neutral5 text-center",sideOffset:5,side:"top",children:[e,o.jsx(Cfe,{className:"fill-surface5"})]})})]}):t}function n3r({children:e,className:t}){return o.jsx("div",{className:Y("mt-auto",t),children:e})}function s3r({children:e,className:t}){return o.jsx("nav",{className:Y("",t),children:e})}function Tft({className:e}){return o.jsx("div",{className:Y("min-h-5 relative",'[&:after]:content-[""] [&:after]:block [&:after]:absolute [&:after]:h-0 [&:after]:border-border1 [&:after]:border-t [&:after]:top-1/2 [&:after]:left-3 [&:after]:right-3',e)})}function a3r({children:e,className:t,state:r="default",href:n,isActive:s,LinkComponent:a}){const i=r==="default",l=i?e:o.jsx(Ku,{children:e});return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr] items-center min-h-11",t),children:[o.jsx("header",{className:Y("text-ui-xs uppercase tracking-widest",{"pl-3":i,"text-black dark:text-white font-semibold":s,"text-neutral3/75":!s}),children:n&&i&&a?o.jsx(a,{href:n,className:Y("transition-colors duration-normal",{"hover:text-neutral5":!s,"text-black dark:text-white":s}),children:l}):l}),o.jsx(Tft,{})]})}function i3r({link:e,state:t="default",children:r,isActive:n,className:s,LinkComponent:a}){const i=t==="collapsed",l=e?.variant==="featured",u=e?.url?.startsWith("http")?{target:"_blank",rel:"noreferrer"}:{};return o.jsx("li",{className:Y("flex relative","[&>a]:flex [&>a]:items-center [&>a]:min-h-8 [&>a]:gap-2.5 [&>a]:text-ui-md [&>a]:text-neutral3 [&>a]:py-1.5 [&>a]:px-3 [&>a]:w-full [&>a]:rounded-lg [&>a]:justify-center","[&>a]:transition-all [&>a]:duration-normal [&>a]:ease-out-custom","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3/60 [&_svg]:transition-colors [&_svg]:duration-normal","[&>a:hover]:bg-surface4 [&>a:hover]:text-neutral5 [&>a:hover_svg]:text-neutral3",{"[&>a]:text-neutral5 [&>a]:bg-surface3":n,"[&_svg]:text-neutral5":n,"before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:w-0.5 before:h-5 before:bg-black dark:before:bg-white before:rounded-r-full before:transition-all before:duration-normal":n&&!i,"[&>a]:justify-start":!i,"[&_svg]:text-neutral3":i,"[&>a]:rounded-md [&>a]:my-2 [&>a]:bg-accent1Dark [&>a:hover]:bg-accent1Darker [&>a]:text-accent1 [&>a:hover]:text-accent1 [&>a]:border [&>a]:border-accent1/30":l,"dark:[&>a]:bg-accent1 dark:[&>a:hover]:bg-accent1/90 dark:[&>a]:text-black dark:[&>a:hover]:text-black dark:[&>a]:border-transparent":l,"[&_svg]:text-accent1 [&>a:hover_svg]:text-accent1 dark:[&_svg]:text-black/75 dark:[&>a:hover_svg]:text-black":l,"[&>a]:pl-7 [&>a]:text-ui-sm":e?.indent&&!i},s),children:e?o.jsx(o.Fragment,{children:i||e.tooltipMsg?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Ku,{children:e.name}):e.name," ",r]})}),o.jsx(Wr,{side:"right",align:"center",className:"ml-4",children:e.tooltipMsg?o.jsxs(o.Fragment,{children:[i&&`${e.name} | `," ",e.tooltipMsg]}):e.name})]}):o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Ku,{children:e.name}):e.name," ",r,e.isExperimental&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(TF,{className:"ml-auto stroke-accent5"})}),o.jsx(Wr,{side:"right",align:"center",className:"ml-4",children:"Experimental Feature"})]})]})}):r})}function o3r({children:e,className:t}){return o.jsx("ul",{className:Y("grid gap-1 items-start content-center",t),children:e})}function l3r({children:e,className:t}){return o.jsx("section",{className:Y("grid items-start content-center relative",t),children:e})}const Nft="sidebar:state",xme=je.createContext(null);function wme(){const e=je.useContext(xme);if(!e)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return e}function c3r(){return je.useContext(xme)}const u3r=e=>{window.localStorage.setItem(Nft,e.toString())};function d3r({children:e}){const[t,r]=je.useState(()=>"default");je.useLayoutEffect(()=>{const a=window.localStorage.getItem(Nft);(a==="collapsed"||a==="default")&&r(a)},[]);const n=je.useCallback(()=>{u3r(t==="default"?"collapsed":"default"),r(t==="default"?"collapsed":"default")},[t]),s=je.useMemo(()=>({state:t,toggleSidebar:n}),[t,n]);return o.jsx(xme.Provider,{value:s,children:e})}function f3r({children:e,className:t}){const{state:r,toggleSidebar:n}=wme(),s=r==="collapsed";return o.jsxs("div",{className:Y("flex flex-col h-full px-4 relative overflow-y-auto","transition-all duration-slow ease-out-custom",{"lg:min-w-52 xl:min-w-56 2xl:min-w-60 3xl:min-w-64 4xl:min-w-72":!s},t),children:[e,o.jsx("button",{onClick:n,className:Y("w-[.75rem] h-full right-0 top-0 absolute opacity-10",{"cursor-w-resize":!s,"cursor-e-resize":s}),"aria-label":"Toggle sidebar"})]})}function h3r({className:e}){const{state:t,toggleSidebar:r}=wme(),n=t==="collapsed";return b.useEffect(()=>{const s=a=>{a.ctrlKey&&a.key==="b"&&(a.preventDefault(),r())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[r]),o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("button",{onClick:r,className:Y("inline-flex w-auto items-center text-neutral3 h-8 px-3 rounded-md","hover:bg-surface4 hover:text-neutral5","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&_svg]:transition-transform [&_svg]:duration-normal",e),"aria-label":"Toggle sidebar",children:o.jsx(r9t,{className:Y({"rotate-180":n})})})}),o.jsxs(Wr,{children:["Toggle Sidebar",o.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[o.jsx(Qzt,{})," Ctrl+B"]})]})]})}const Gh=Object.assign(f3r,{Bottom:n3r,Nav:s3r,NavSection:l3r,NavLink:i3r,NavHeader:a3r,NavList:o3r,NavSeparator:Tft,Trigger:h3r});function aQ({children:e,className:t,isVisible:r,autoDismiss:n=!0,dismissTime:s=5e3,dismissible:a=!0,type:i="info"}){const[l,c]=b.useState(r),[u,d]=b.useState(!1);b.useEffect(()=>{if(a&&n&&r){const m=setTimeout(()=>{f()},s);return()=>clearTimeout(m)}},[n,r,s,a]),b.useEffect(()=>{r&&(d(!1),c(!0))},[r]);const f=()=>{d(!0),setTimeout(()=>{c(!1),d(!1)},200)};if(!l)return null;const h={info:"bg-surface4 border-border1",error:"bg-accent2Darker border-accent2/20",success:"bg-accent1Darker border-accent1/30",warning:"bg-accent6Darker border-accent6/30"},p={info:"text-accent5",error:"text-accent2",success:"text-accent1",warning:"text-accent6"};return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr_auto] gap-3 rounded-xl border py-2.5 px-3.5 text-ui-md text-neutral4 items-start","shadow-card",sn.all,u?"animate-out fade-out-0 slide-out-to-right-2 duration-200":"animate-in fade-in-0 slide-in-from-right-2 duration-300",h[i],t),children:[o.jsx("div",{className:Y("shrink-0 mt-0.5",p[i]),children:i==="error"||i==="warning"?o.jsx(BE,{className:"h-4 w-4"}):o.jsx($R,{className:"h-4 w-4"})}),o.jsx("div",{className:"flex gap-2 items-start min-w-0",children:e}),a&&o.jsxs(me,{variant:"ghost",className:Y("h-6 w-6 p-0 shrink-0",sn.colors,"hover:bg-surface5"),onClick:f,children:[o.jsx(Xl,{className:"h-4 w-4"}),o.jsx(Ku,{children:"Dismiss"})]})]})}function Aft({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral2 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function Ift({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":r==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function p3r({children:e,className:t,title:r,description:n,icon:s,isLoading:a}){const i=e===void 0&&r!==void 0;return o.jsx("header",{className:Y("w-full grid",t),children:i?o.jsxs(o.Fragment,{children:[o.jsxs(Ift,{isLoading:a,children:[s," ",r]}),n!==void 0&&o.jsx(Aft,{isLoading:a,children:n})]}):e})}const bn=Object.assign(p3r,{Title:Ift,Description:Aft});function m3r({children:e,className:t}){return o.jsx("header",{className:Y("grid items-center grid-cols-[1fr_auto]",t),children:e})}function g3r({headingLevel:e="h2",children:t,className:r}){const n=e;return o.jsx(n,{className:Y("flex items-center gap-2 text-ui-lg font-bold text-neutral4","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",r),children:t})}function Rft({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-4",t),children:e})}function C1({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-2",t),children:e})}const ml=Object.assign(Rft,{Header:m3r,Heading:g3r});function y3r(){return WE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[ne.className,ne.propertyName]}]})}function v3r(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8125rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"}}),t=$p.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"}]);return[e,Yx(t)]}const b3r=()=>{const e=xC().resolvedTheme==="dark";return b.useMemo(()=>e?y3r():v3r(),[e])};function x3r({codeStr:e="",title:t,icon:r,simplified:n=!1}){const s=b3r(),[a,i]=b.useState(!1),l=b.useMemo(()=>{try{const u=JSON.parse(e);return xie(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
293
293
  `):e;return o.jsxs(ml,{children:[o.jsxs(ml.Header,{children:[o.jsxs(ml.Heading,{children:[r,t]}),o.jsxs(ps,{children:[o.jsx(Ka,{content:e||"No content"}),l&&o.jsx(me,{onClick:()=>i(!a),children:a?o.jsx(fA,{}):o.jsx(_3,{})})]})]}),e&&o.jsx("div",{className:"dark:bg-black/20 bg-surface3 p-4 overflow-hidden rounded-xl border dark:border-white/10 border-border1 text-neutral4 text-ui-md break-all max-h-[30vh] overflow-y-auto",children:n?o.jsx("div",{className:"text-neutral4 font-mono break-all px-2",children:o.jsx("pre",{className:"text-wrap",children:e})}):o.jsx(xc,{extensions:[I_(),ft.lineWrapping],theme:s,value:c})})]})}function xie(e){if(typeof e=="string"){const t=e.indexOf(`
@@ -554,7 +554,7 @@ Token usage: ${r} input + ${n} output = ${s} total`:`The model stopped generatin
554
554
  "groundTruth": "Expected result (optional)",
555
555
  "metadata": { "key": "value" } // optional
556
556
  }
557
- ]`})]})]})}function ATn({errors:e,maxErrors:t=5}){if(e.length===0)return null;const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[o.jsx(Ce,{children:o.jsx(kh,{className:"w-4 h-4"})}),o.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),o.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:r.map((s,a)=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0",children:"•"}),o.jsx("span",{children:s.message})]},a))}),n>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",n," more error",n!==1?"s":""]})]})}function ITn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[h,p]=b.useState(!1),{parseFile:m,isParsing:g,error:y}=Ljn(),{batchInsertItems:x}=ni(),w=b.useCallback(async I=>{try{const P=await m(I);l(P),a("preview")}catch{}},[m]),S=b.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),p(!0);const{items:I}=i;u({current:0,total:I.length});try{await x.mutateAsync({datasetId:e,items:I.map(P=>({input:P.input,groundTruth:P.groundTruth,metadata:P.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),p(!1),a("complete")},[i,x,e]),k=b.useCallback(()=>{r(!1),n?.(),d&&d.success>0&&ze.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150)},[r,n,d]),_=b.useCallback(()=>{h||(r(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[h,r]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(NTn,{onFileSelect:w,isParsing:g,error:y?.message});case"preview":return i?o.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ATn,{errors:i.errors}),o.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),o.jsx(TTn,{items:i.items,maxRows:5})]})}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Mt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(me,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(me,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(me,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(me,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(Sn,{open:t,onOpenChange:_,children:o.jsxs(yn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(On,{children:[o.jsx(vn,{children:N[s]}),o.jsx(qs,{children:"Import dataset items from a JSON file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(hf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function RTn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ir,{className:c,children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{isLoading:t,children:[o.jsx(Ta,{})," ",e?.name]}),o.jsx(Ir.Description,{isLoading:t,children:e?.description}),o.jsxs(Ir.Description,{isLoading:t,children:[o.jsxs(Zn,{children:[o.jsx(v_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Qx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(me,{disabled:!0,tabIndex:-1,children:[o.jsx(mx,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(me,{onClick:l,children:[o.jsx(mx,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(me,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(gVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(cv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(ru,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(nd,{})," Delete Dataset"]})]})]})]})})]})}const $1t=e=>{const t=Ge(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-review-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="needs-review").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})},PTn=e=>{const t=Ge(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-completed-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="complete").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})};function MTn(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t)+"...":r}catch{return String(e)}}const DTn=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function PBe({className:e,children:t,...r}){return o.jsx(aP,{children:o.jsx(fz,{className:Y(DTn,e),...r,children:t})})}function LTn({datasetId:e}){const t=Ge(),{data:r}=Rg(e),{data:n,isLoading:s}=$1t(e),{data:a,isLoading:i}=PTn(e),{updateExperimentResult:l}=ni(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[y,x]=b.useState(!1),[w,S]=b.useState(!1),[k,_]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[M,F]=b.useState(null),U=M??n??[];b.useEffect(()=>{n&&M===null&&F(n)},[n]);const z=b.useMemo(()=>{const ge=new Set;if(r?.tags)for(const Ee of r.tags)ge.add(Ee);for(const Ee of U)for(const Fe of Ee.tags)ge.add(Fe);return[...ge].sort()},[r,U]),H=b.useCallback(ge=>{!r||!e||(r.tags??[]).includes(ge)},[r,e]),Q=b.useMemo(()=>d?d==="__untagged__"?U.filter(ge=>ge.tags.length===0):U.filter(ge=>ge.tags.includes(d)):U,[U,d]),L=b.useMemo(()=>{const ge=new Map;for(const Ee of U)for(const Fe of Ee.tags)ge.set(Fe,(ge.get(Fe)??0)+1);return[...ge.entries()].sort((Ee,Fe)=>Fe[1]-Ee[1])},[U]),Z=b.useMemo(()=>U.filter(ge=>ge.tags.length===0).length,[U]),V=b.useMemo(()=>{let ge=0;return d&&ge++,m&&ge++,ge},[d,m]),D=b.useCallback((ge,Ee)=>{F(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,tags:Ee}:wt));const Fe=U.find(ct=>ct.id===ge);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ee})},[U,l]),W=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&Ee!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ee==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),F(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,rating:Ee}:wt))},[U,t]),G=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ee,comment:Ee,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),F(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,comment:Ee}:wt))},[U,t]),J=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);F(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:null})},[U,l,c]),ae=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);F(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ge=m?a??[]:Q;return!m||!d?ge:d==="__untagged__"?ge.filter(Ee=>Ee.tags.length===0):ge.filter(Ee=>Ee.tags.includes(d))},[m,a,Q,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ge=>ge.id)),[te]),fe=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&fe===te.length,se=fe>0&&!X,le=b.useCallback(ge=>{p(Ee=>{const Fe=new Set(Ee);return Fe.has(ge)?Fe.delete(ge):Fe.add(ge),Fe})},[]),xe=b.useCallback(()=>{p(X?new Set:new Set(te.map(ge=>ge.id)))},[X,te]),ue=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&!Fe.tags.includes(ge)&&D(Ee,[...Fe.tags,ge])}},[U,h,D]),ce=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&Fe.tags.includes(ge)&&D(Ee,Fe.tags.filter(ct=>ct!==ge))}},[U,h,D]),ve=b.useCallback(()=>{for(const ge of h)ae(ge);p(new Set)},[h,ae]),we=b.useCallback(()=>{for(const ge of h)J(ge);p(new Set)},[h,J]),Ne=b.useCallback(()=>{_(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ge=U.filter(Fe=>h.has(Fe.id));if(ge.length===0){x(!1);return}const Ee=await t.clusterFailures({modelId:`${E}/${j}`,items:ge.map(Fe=>({id:Fe.id,input:Fe.input,output:Fe.output??void 0,error:typeof Fe.error=="string"?Fe.error:Fe.error?String(Fe.error):void 0,scores:Fe.scores,existingTags:Fe.tags.length>0?Fe.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:k||void 0});Ee.proposedTags&&Ee.proposedTags.length>0&&(P(Ee.proposedTags.map(Fe=>({...Fe,accepted:!0}))),B(!0))}catch(ge){console.error("Analysis failed:",ge)}finally{x(!1)}}},[E,j,U,h,t,z,k]),oe=b.useCallback(()=>{for(const ge of I){if(!ge.accepted)continue;const Ee=U.find(Fe=>Fe.id===ge.itemId);if(Ee){const Fe=[...new Set([...Ee.tags,...ge.tags])];D(Ee.id,Fe)}}B(!1)},[I,U,D]),be=b.useCallback(ge=>{u(Ee=>Ee===ge?null:ge)},[]),Ae=b.useMemo(()=>c?te.find(ge=>ge.id===c)??null:null,[c,te]),$e=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge<te.length-1&&u(te[ge+1].id)},[c,te]),ye=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge>0&&u(te[ge-1].id)},[c,te]),ke=Ae?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Mt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(Sn,{open:w,onOpenChange:S,children:o.jsxs(yn,{children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Analyze Items"}),o.jsx(qs,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Pg,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Mg,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(pe,{variant:"ui-xs",className:"text-neutral3",children:[h.size," item",h.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(bc,{value:k,onChange:ge=>_(ge.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(hf,{children:[o.jsx(me,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(me,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Mt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(Sn,{open:R,onOpenChange:B,children:o.jsxs(yn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Review Proposed Tags"}),o.jsxs(qs,{children:[I.filter(ge=>ge.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge.itemId);return o.jsx("div",{className:Y("p-3 border rounded-lg",!ge.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(fi,{checked:ge.accepted,onCheckedChange:ct=>P(wt=>wt.map((lr,Ve)=>Ve===Ee?{...lr,accepted:!!ct}:lr))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Fe?typeof Fe.input=="string"?Fe.input.slice(0,100):JSON.stringify(Fe.input).slice(0,100):ge.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ge.tags.map((ct,wt)=>o.jsx(N1t,{tag:ct,onRename:lr=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ee?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?lr:Le)}:qe)),onRemove:()=>P(lr=>lr.map((Ve,qe)=>qe===Ee?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ge.reason&&o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(hf,{children:[o.jsx(me,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(me,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(sf,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(mr,{children:[o.jsxs(mr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(me,{variant:"outline",size:"md",children:[o.jsx(yVe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(yt.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(PBe,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ge=>ge.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ge=>ge.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(PBe,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ge=>ge.preventDefault(),children:"All"}),Z>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ge=>ge.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ge])=>o.jsx(yt.CheckboxItem,{checked:d===ge,onCheckedChange:()=>f(d===ge?null:ge),onSelect:Ee=>Ee.preventDefault(),children:ge},ge))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(me,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T1t,{selectedCount:h.size,vocabulary:z,onApplyTag:ue,onRemoveTag:ce,onNewTag:ge=>ue(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(me,{disabled:y,children:[y?o.jsx(Mt,{className:"w-4 h-4"}):o.jsx(Ce,{size:"sm",children:o.jsx(as,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:ve,children:[o.jsx(Ce,{size:"sm",children:o.jsx(rS,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(nd,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(w_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Mt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(pe,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(Se,{columns:ke,children:[o.jsxs(Se.Top,{children:[!m&&o.jsx(Se.TopCell,{children:o.jsx(fi,{checked:X?!0:se?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Se.TopCell,{children:" "}),o.jsx(Se.TopCell,{children:"Input"}),o.jsx(Se.TopCell,{children:"Comment"}),o.jsx(Se.TopCell,{children:"Tags"}),!Ae&&o.jsx(Se.TopCell,{children:"Rating"}),!Ae&&o.jsx(Se.TopCell,{children:"Scores"})]}),o.jsx(Se.Rows,{children:te.map(ge=>{const Ee=ge.scores?Object.entries(ge.scores):[];return o.jsxs(Se.Row,{onClick:()=>be(ge.id),selected:c===ge.id,children:[o.jsx(Se.Cell,{children:m?ge.error?o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):o.jsx(fi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:MTn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Se.Cell,{children:[ge.rating==="positive"&&o.jsx(Ce,{size:"sm",className:"text-positive1",children:o.jsx(cce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(lce,{})}),!ge.rating&&o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Se.Cell,{children:Ee.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ce,{size:"sm",className:"text-neutral3",children:o.jsx(Da,{})}),o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ee[0][1].toFixed(2)}),Ee.length>1&&o.jsxs(vt,{variant:"default",children:["+",Ee.length-1]})]}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(j1t,{item:Ae,isCompleted:m,tagVocabulary:z,onRate:ge=>W(Ae.id,ge),onSetTags:ge=>{D(Ae.id,ge);for(const Ee of ge)z.includes(Ee)||H(Ee)},onComment:ge=>G(Ae.id,ge),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ae(Ae.id),onPrevious:ye,onNext:$e,onClose:()=>u(null)})]})]})}function $Tn({datasetId:e,onExperimentClick:t,onEditClick:r,onDeleteClick:n,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=or(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,y]=b.useState(!1),[x,w]=b.useState(!1),[S,k]=b.useState(!1),[_,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,M]=b.useState([]),[F,U]=b.useState(!1),[z,H]=b.useState(0),[Q,L]=b.useState(null),[Z,V]=b.useState(""),[D]=Dcr(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Rg(e),{data:ie=[],total:fe,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=jE(e,D||void 0,ae),{data:ue=[],total:ce,isLoading:ve}=jE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=wR(e,void 0,we),{data:be}=wR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=tTn({hasSearchQuery:!!D,filteredItemsLength:ie.length,unfilteredItemsTotal:ce,itemsTotal:fe}),{data:ge}=$1t(e),Ee=ge?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const $r=Ut.isCurrent?null:Ut;c?c($r):G(Ut.isCurrent?null:Ut.version)},lr=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H($r=>$r+1))},Ie=Ut=>{f(`/datasets/${e}/items?items=${Ut.join(",")}`)},Le=Ut=>{f(`/datasets/${e}/versions?ids=${Ut.join(",")}`)},Re=Ut=>{M(Ut),R(!0)},it=async()=>{await Ae.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),M([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H($r=>$r+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H($r=>$r+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",sn.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Q?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(RTn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&ue.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Tf,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Nf,{children:[o.jsxs(hs,{value:"items",children:["Items ",o.jsx(Fa,{color:"gray",children:ke})]}),o.jsxs(hs,{value:"experiments",children:["Experiments",o.jsx(Fa,{color:"gray",children:$e.length})]}),o.jsxs(hs,{value:"review",children:["Review",Ee>0&&o.jsx(Fa,{color:"orange",children:Ee})]})]}),o.jsx(Ns,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(jTn,{datasetId:e,items:ie,isLoading:X,featuredItemId:Q,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>y(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:lr,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Z,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(Ns,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(yTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(Ns,{value:"review",className:"overflow-auto mt-0",children:o.jsx(LTn,{datasetId:e})})]})})]})})}),o.jsx(cTn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(ITn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(Zjn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(Yjn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(Xjn,{open:F,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx(Bt,{open:P,onOpenChange:R,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Items"}),o.jsxs(Bt.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function FTn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function MBe({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function zTn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:h}=ni(),p=async x=>{x.preventDefault();let w;try{w=JSON.parse(s)}catch{ze.error("Input must be valid JSON");return}let S;if(i.trim())try{S=JSON.parse(i)}catch{ze.error("Ground Truth must be valid JSON");return}let k;if(c.trim())try{k=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await h.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:k}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),r(!1),n?.()}catch(_){const E=FTn(_);E?f(E):ze.error(`Failed to add item: ${_ instanceof Error?_.message:"Unknown error"}`)}},m=x=>{a(x),d?.field==="input"&&f(null)},g=x=>{l(x),d?.field==="groundTruth"&&f(null)},y=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(Sn,{open:t,onOpenChange:r,children:o.jsxs(yn,{className:"max-w-lg",children:[o.jsx(On,{children:o.jsx(vn,{children:"Add Item"})}),o.jsx(Bn,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(Xn,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(MBe,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(MBe,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(me,{type:"button",onClick:y,children:"Cancel"}),o.jsx(me,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function BTn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=fd(),i=b.useMemo(()=>s?Object.entries(s).map(([l,c])=>({value:l,label:c.scorer?.config?.name||l,description:c.scorer?.config?.description||""})):[],[s]);return o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Scorers (Optional)"}),o.jsx(Idt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const UTn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function VTn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Ng(),{data:l,isLoading:c}=d0(),{data:u,isLoading:d}=fd(),f=e==="agent"?Object.entries(a??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,y])=>({value:g,label:y.scorer?.config?.name??g})):[],h=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,p=g=>{t(g),n("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return o.jsxs("div",{className:"grid gap-6",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Target Type"}),o.jsx(Kl,{options:UTn,value:e,onValueChange:p,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:m}),o.jsx(Kl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function qTn({datasetId:e,version:t,open:r,onOpenChange:n,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:h}=ni(),p=i&&c,m=h.isPending,g=async()=>{if(p)try{const x=await h.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});vc.success("Experiment triggered successfully"),n(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";vc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(Sn,{open:r,onOpenChange:y,children:o.jsxs(yn,{ref:a,children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Run Experiment"}),o.jsx(qs,{children:t?`Execute items from ${tr(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(Bn,{className:"grid gap-6",children:[o.jsx(VTn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(BTn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(hf,{className:"px-6 pt-4",children:[o.jsx(me,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(me,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const F1t=e=>{const t=Ge();return Ot({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},DBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function HTn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=nre(e?.input),d=nre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(me,{onClick:a,disabled:!e.traceId,children:[o.jsx(oce,{}),"Show Trace"]}),o.jsx(me,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(An,{})})]})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(mx,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(hx,{})," ",e.itemId]})})]})}),c&&o.jsxs(gl,{variant:"destructive",children:[o.jsx(uDt,{}),o.jsxs(gl.Message,{children:[o.jsx("strong",{children:"Error: "}),nre(e?.error&&typeof e.error=="object"?e.error.message:e?.error)]})]}),t&&t.length>0&&o.jsxs(Pt,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Pt.Header,{columns:DBe,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Score"})]}),o.jsx(Pt.Items,{children:t.map(f=>o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:f.id},columns:DBe,isFeatured:l===f.id,onClick:i,children:[o.jsx(Pt.TextCell,{children:f.scorerId}),o.jsx(Pt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(ME,{className:"w-4 h-4"})," Review Status"]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${e.status==="needs-review"?"bg-warning/10 text-warning":e.status==="complete"?"bg-accent1/10 text-accent1":"bg-neutral3/10 text-neutral4"}`,children:e.status}),Array.isArray(e.tags)&&e.tags.length>0&&e.tags.map(f=>o.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(hx,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Zd,{}),codeStr:d}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(v_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:tr(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function nre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function QTn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(px,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Zd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(Oh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(Oh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function WTn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=$S(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(me,{onClick:s,"aria-label":"Close span details",children:o.jsx(An,{})})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(Oh,{})," Span ",nf(t)]})})}),o.jsx(QTn,{span:i})]})]})}const GTn=e=>{if(!e||e.length===0)return[];const t=e.reduce((l,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!l||u>l)?u:l},null),r=new Map,n=[];e.forEach(l=>{const c=new Date(l.startedAt),u=l.endedAt?new Date(l.endedAt):void 0,d={id:l.spanId,name:l.name,type:l.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:l.parentSpanId};r.set(l.spanId,d)}),e.forEach(l=>{const c=r.get(l.spanId);if(l?.parentSpanId==null){if(t&&c.endTime&&t>new Date(c.endTime)){c.endTime=t.toISOString();const u=new Date(t).getTime(),d=new Date(c.startTime).getTime();c.latency=u-d}n.push(c)}else{const u=r.get(l.parentSpanId);u?u.spans.push(c):n.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(n),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function z1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...z1t(r))}),t}const LBe=["agent","workflow","model","mcp","tool","workspace","other"];function B1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ma,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Di,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(Nm,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(vl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:o.jsx(z9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in r?r[t]:{typePrefix:"other"}}function ZTn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs($Be,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(iVe,{}):o.jsx(Hx,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs($Be,{onClick:()=>s?.(),children:[a," ",o.jsx(aVe,{})]})]}):null})}function $Be({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Y("h-full",r),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function YTn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:r?o.jsx(cVe,{}):o.jsx(lVe,{})})})}function XTn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u,toggleChildren:d}){return o.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${n*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(YTn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function U1t({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=z1t(e),y=g.length,x=t===0,w=B1t(e?.type),S=f?f.includes(e.id):!1,k=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{x&&h?.([e.id])},[x,e.id,h]),b.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(P=>d.includes(P.id));!S&&I&&T()},[d,e.spans,e.id,S,h,f]);const T=()=>{if(!(!h||!f))if(S){const I=[e.id,...g];h(f.filter(P=>!I.includes(P)))}else h([...f,e.id])},j=()=>{!h||!f||h([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(XTn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(ZTn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:y,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(U1t,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function KTn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Mt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(U1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function JTn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=LBe.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!LBe.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=Ktt(h=>{s?.(h)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(jx,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:h=>{l(h.target.value)},onReset:()=>l("")})}),o.jsxs(uft,{children:[c.map(h=>{const p=B1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(me,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(Ce,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(me,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(iF,{})}),"Other"]}),o.jsx(me,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(An,{})})})]})]})}function eNn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=F1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>GTn(i),[i]);b.useEffect(()=>{if(l.trim()===""){h([]);return}const S=l.toLowerCase(),k=i.filter(_=>_.name.toLowerCase().includes(S)).map(_=>_.spanId);h(k)},[l,i]),b.useEffect(()=>{c(""),d([]),h([]),m([])},[e]);const y=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(mr.Toolbar,{children:o.jsx(me,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(An,{})})}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",nf(e)]})})}),o.jsx(JTn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(KTn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function tNn({results:e,isLoading:t,featuredResultId:r,onResultClick:n,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Mt,{})})]}):e.length===0?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx(Se.NoMatch,{message:"No results yet"})]}):o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsxs(Se.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Se.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Se.Cell,{children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",h?"bg-red-700":"bg-green-600")})})}),o.jsx(Wr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:nNn(rNn(f.input),200)})}),i?.map(m=>{const y=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Se.TextCell,{children:o.jsx("span",{className:"font-mono",children:y!=null?y.score.toFixed(3):"-"})},m)})]},f.id)}),o.jsxs("div",{ref:l,className:"h-1 col-span-full",children:[c&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Mt,{})}),!u&&e.length>0&&o.jsx(pe,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function rNn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function nNn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function sNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function aNn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=sNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(me,{onClick:n,"aria-label":"Close score details",children:o.jsx(An,{})})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(Da,{})," ",e.scorerId]})})}),o.jsxs(Tx,{children:[o.jsx(Vt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(Da,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(hx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Zd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(lc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(lc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(lc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(lc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const FBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function iNn({scoresByItemId:e,experimentStatus:t}){const r=b.useMemo(()=>{if(!e)return[];const n={};for(const s of Object.values(e))for(const a of s)n[a.scorerId]||(n[a.scorerId]={sum:0,count:0}),n[a.scorerId].sum+=a.score,n[a.scorerId].count++;return Object.entries(n).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(r.length===0){const n=t==="running"||t==="pending",s=e!==void 0;let a,i;return n?(a="Experiment in progress",i="Summary metrics will appear here once the experiment completes."):s?(a="No scorers configured",i="Add scorers when triggering an experiment to evaluate results and see summary metrics here."):(a="Loading scores",i="Fetching scorer results…"),o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(Da,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:FBe,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Avg Score"}),o.jsx(Pt.HeaderCol,{children:"Items Scored"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:r.map(({scorerId:n,avg:s,count:a})=>o.jsxs(Pt.Row,{columns:FBe,children:[o.jsx(Pt.TextCell,{children:n}),o.jsx(Pt.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Pt.TextCell,{className:"font-mono",children:a})]},n))})})]})}function V1t({experimentId:e,experimentStatus:t,results:r,isLoading:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(void 0),[p,m]=b.useState(null),g=r.find(z=>z.id===l)??null,{data:y}=b1t(e,t),x=b.useMemo(()=>{if(!y)return[];const z=new Set;for(const H of Object.values(y))for(const Q of H)z.add(Q.scorerId);return[...z].sort()},[y]),{data:w}=F1t(u),S=w?.spans??[],k=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>=0&&z<S.length-1)return()=>h(S[z+1].spanId)},_=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>0)return()=>h(S[z-1].spanId)},E=z=>{c(z),d(null),h(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>=0&&z<r.length-1)return()=>E(r[z+1].id)},I=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>0)return()=>E(r[z-1].id)},P=g?y?.[g.itemId]:void 0,R=P?.find(z=>z.id===p)??null,B=z=>{m(z===p?null:z),d(null),h(void 0)},M=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},F=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(Tf,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Nf,{children:[o.jsx(hs,{value:"summary",children:"Summary"}),o.jsx(hs,{value:"results",children:"Results"})]}),o.jsx(Ns,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(iNn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(Ns,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(sf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(mr,{children:o.jsx(tNn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:y,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(D3r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(HTn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(aNn,{score:R,onNext:M(),onPrevious:F(),onClose:()=>m(null)})}),g&&u&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(eNn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(WTn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const oNn={pending:o.jsx(AE,{}),running:o.jsx(g3,{}),completed:o.jsx(ta,{}),failed:o.jsx(An,{})};function lNn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":r==="completed","bg-red-700":r==="failed","bg-cyan-600":r==="running","bg-yellow-600":r==="pending"}),children:oNn[r]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(r==="pending"||r==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:n})]})]})]})}function q1t({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Ng(),{data:a}=d0(),{data:i}=fd(),l=()=>{switch(t.targetType){case"agent":return n.agentLink(t.targetId);case"workflow":return n.workflowLink(t.targetId);case"scorer":return n.scorerLink(t.targetId);default:return"#"}},c=()=>{const u=t.targetId;if(!u)return u;switch(t.targetType){case"agent":return s?.[u]?.name??u;case"workflow":return a?.[u]?.name??u;case"scorer":return i?.[u]?.scorer?.config?.name??u;default:return u}};return o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(dVe,{}),e," ",e&&o.jsx(Ka,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(v_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(v_,{})," Completed at ",tr(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx($Mt,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(lF,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(r,{href:`${n.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):o.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),o.jsx(Ka,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(lNn,{experiment:t})})]})}function Ave({delta:e}){const t=e>0?o.jsx(Fa,{size:"small",color:"green",intensity:"muted",children:o.jsx(rce,{})}):e<0?o.jsx(Fa,{size:"small",color:"red",intensity:"muted",children:o.jsx(rVe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function zL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function cNn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(mr,{withLeftSeparator:!0,children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(me,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(An,{})})})]}),o.jsxs(mr.Content,{className:"pb-6",children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(hx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(Tx,{children:[h.length>0&&o.jsxs("div",{className:"grid gap-3",children:[o.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),o.jsx("div",{className:"grid gap-2",children:h.map(p=>{const m=c?.scores[p]??null,g=u?.scores[p]??null,y=m!=null&&g!=null?g-m:null;return o.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[o.jsx("span",{className:"text-sm text-neutral5 font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),y!=null&&o.jsx(Ave,{delta:y})]})]},p)})})]}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(Fa,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(Zd,{}),codeStr:zL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(Fa,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Zd,{}),codeStr:zL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(px,{}),codeStr:zL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(jVe,{}),codeStr:zL(e.groundTruth)})]})}):o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsx(gl.Message,{children:(()=>{const p=c?"Contender":"Baseline",m=c?s:n;return o.jsxs(o.Fragment,{children:["The ",p," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item. Comparison is not available."]})})()})]})]})]})}function uNn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(mr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(Ave,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const dNn={baseline:{label:"Baseline",color:"purple",customStyle:"items-end justify-items-end [&>div]:justify-end border-r-0 rounded-r-none"},contender:{label:"Contender",color:"cyan",customStyle:"items-start justify-items-start [&>div]:justify-start border-l-0 rounded-l-none"}};function zBe({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=dNn[r];if(!t)return null;const l=t.createdAt?new Date(t.createdAt):null;return o.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[o.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[r==="contender"&&o.jsxs(Fa,{size:"small",color:a,children:[s,o.jsx(Fw,{})]}),o.jsx(me,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs(Fa,{size:"small",color:a,children:[o.jsx(_p,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(Zn,{children:[o.jsx(jVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(vVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(nVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function fNn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=Cjn(e,t,r),{data:u}=W6(e,t),{data:d}=W6(e,r),f=u&&d&&u.datasetVersion!==d.datasetVersion,h=b.useMemo(()=>{if(!i)return[];const T=new Set;for(const j of i.items)for(const N of Object.values(j.results))if(N)for(const I of Object.keys(N.scores))T.add(I);return[...T].sort()},[i]),p=b.useMemo(()=>{if(!i||h.length===0)return[];const T=i.baselineId,j=t===T?r:t;return h.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const H=z.results[T]?.scores[N],Q=z.results[j]?.scores[N];H!=null&&(I+=H,R++),Q!=null&&(P+=Q,B++)}const M=R>0?I/R:null,F=B>0?P/B:null,U=M!=null&&F!=null?F-M:null;return{scorerId:N,avgA:M,avgB:F,delta:U}})},[i,h,t,r]),m=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"baselineAvg",label:"Baseline Avg",size:"1fr"},{name:"comparisonAvg",label:"Comparison Avg",size:"1fr"},{name:"delta",label:"Delta",size:"1fr"}],g=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:h.map(T=>({name:T,label:T,size:"1fr"}))],[h,s]),y=i?.items.find(T=>T.itemId===s)??null,x=T=>{a(T===s?null:T)},w=()=>{a(null)},S=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>=0&&T<i.items.length-1)return()=>a(i.items[T+1].itemId)},k=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Mt,{})});if(c)return o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsxs(gl.Column,{children:[o.jsx(gl.Title,{children:"Error loading comparison"}),o.jsx(gl.Message,{children:c instanceof Error?c.message:"Unknown error"})]})]});if(!i||i.items.length===0)return o.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const _=i.baselineId,E=t===_?r:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(zBe,{datasetId:e,experiment:u,type:"baseline"}),o.jsx("div",{className:"relative flex items-center justify-center px-[2vw] before:absolute before:inset-y-0 before:left-1/2 before:-translate-x-1/2 before:w-[2px] before:bg-border1",children:o.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(zBe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsxs(gl.Message,{children:[o.jsx("strong",{children:"Version mismatch!"})," These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})]}),p.length>0&&o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:m,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(oRe,{children:[o.jsx(Fa,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(Fa,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(oRe,{children:[o.jsx(Fa,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(Fa,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:p.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Pt.Row,{columns:m,children:[o.jsx(Pt.TextCell,{children:T}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Ave,{delta:I}):"-"})]},T))})})]}),o.jsxs(sf,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(uNn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx(cNn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function hNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Nve(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{r?.(x)},h=x=>s==null?x.isLatest:x.datasetVersion===s,p=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[k]=Array.from(S);return new Set([k,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},y=()=>{u.size===2&&n?.([...u])};return o.jsxs(mr,{className:"min-w-56",children:[l?o.jsx(mr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(me,{onClick:m,children:"Cancel"}),o.jsx(Cn,{variant:"primary",disabled:u.size!==2,onClick:y,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(mr.Toolbar,{children:o.jsxs(me,{onClick:g,className:"w-full",children:[o.jsx(qm,{})," Compare Ver."]})})}),i?o.jsx(pNn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Pt.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Pt.LabelCell,{children:o.jsx(fi,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:k=>{k.stopPropagation(),x.isDeleted||p(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Pt.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:h(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Pt.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function pNn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function mNn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${tr(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function gNn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=jve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${mNn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(mr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx($o,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx($o,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const yNn=[{name:"id",label:"ID",size:"1fr"},{name:"versionA",label:"Version A",size:"1fr"},{name:"versionB",label:"Version B",size:"1fr"},{name:"compare",label:"Compare",size:"10rem"}],vNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(us,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(EVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(ZMt,{}),tooltip:"Same in both versions"}};function sre({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(jPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function rw({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:r,icon:n,tooltip:s}=vNn[e];return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&o.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),o.jsx(Fa,{color:r,size:"small",children:n})]})}),o.jsx(Wr,{children:s})]})}function bNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function xNn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=or(),l=t>r;return o.jsx(Pt,{children:o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:n.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=bNn(u,d);return o.jsxs(Pt.Row,{columns:yNn,children:[o.jsx(Pt.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(rw,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(rw,{variant:"changed",version:u.datasetVersion}):o.jsx(rw,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(rw,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(rw,{variant:"changed",version:d.datasetVersion}):o.jsx(rw,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(rw,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Pt.Cell,{children:o.jsx(sre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const BBe={needsReview:"#facc15",complete:"#22c55e"},wNn=[{label:"Needs Review",color:BBe.needsReview},{label:"Reviewed",color:BBe.complete}];function SNn({reviewSummary:e,experiments:t,datasets:r,isLoading:n,isError:s}){const{data:a,maxVal:i,totalInPipeline:l}=b.useMemo(()=>{if(!e?.counts||!t)return{data:[],maxVal:0,totalInPipeline:0};const u=new Map;for(const m of t)u.set(m.id,m);const d=new Map;if(r)for(const m of r)d.set(m.id,m.name);let f=0,h=0;const p=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;h+=g,g>f&&(f=g);const y=u.get(m.experimentId),x=y?.datasetId?d.get(y.datasetId):void 0,w=x?`${x} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);p.push({name:w,values:[m.needsReview,m.complete]})}return{data:p,maxVal:f,totalInPipeline:h}},[e,t,r]),c=a.length>0;return o.jsxs(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Qt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Qt.Loading,{}):s?o.jsx(Qt.Error,{message:"Failed to load review data"}):o.jsx(Qt.Content,{children:c?o.jsx(nE,{data:a,segments:wNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Qt.NoData,{message:"No items have been sent to review yet"})})]})}function Ive(){const e=Ge();return Ot({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function H1t(e){const t=new Map;if(!e?.counts)return t;for(const r of e.counts)t.set(r.experimentId,{needsReview:r.needsReview,complete:r.complete,total:r.total});return t}function ONn(e,t){const r=new Map,n=H1t(e);if(!n.size||!t)return r;for(const s of t){const a=n.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=r.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,r.set(s.datasetId,l)}return r}function kNn(e){return e?.counts?e.counts.reduce((t,r)=>({needsReview:t.needsReview+r.needsReview,complete:t.complete+r.complete,inPipeline:t.inPipeline+r.needsReview+r.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const _Nn=10;function ENn(){const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:h,isLoading:p,error:m}=zh({page:d,perPage:_Nn}),{data:g,isLoading:y,error:x}=rB(),{data:w}=Ive(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>Hjn(S),[S]),T=b.useMemo(()=>ONn(w,_),[w,_]),j=p||y,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Q=>Q+1),[]),R=b.useCallback(()=>f(Q=>Math.max(0,Q-1)),[]),B=b.useCallback(Q=>{n(Q),f(0)},[]),M=b.useCallback(Q=>{a(Q),f(0)},[]),F=b.useCallback(Q=>{l(Q),f(0)},[]),U=b.useCallback(Q=>{u(Q),f(0)},[]);if(N&&Ps(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(na,{})});if(N&&Os(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(Zs,{resource:"datasets"})});if(N)return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(gu,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(Qjn,{onCreateClick:I})}),o.jsx(Ile,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||r!=="",H=()=>{n(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:j,children:[o.jsx(Ta,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(us,{})}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(Li,{})})]})]}),o.jsx(Gjn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:F,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(Ujn,{datasets:S,experiments:_,reviewByDataset:T,isLoading:j,search:r,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:k,onNextPage:P,onPrevPage:R}),o.jsx(Ile,{open:e,onOpenChange:t})]})}const CNn=new Set(["items","experiments","review"]);function jNn(){const{datasetId:e}=ra(),t=fu(),[r,n]=ao(),s=r.get("tab"),a=s&&CNn.has(s)?s:"items",i=E=>{n(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(!1),[g,y]=b.useState(null),{data:x,error:w}=Rg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(pf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ps(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})});if(w&&Os(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{y(E?.version??null)};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(eTn,{value:e,variant:"ghost"})})]})}),o.jsxs(pf,{className:"content-stretch",children:[o.jsx($Tn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(me,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(mx,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(qTn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(zTn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(Kjn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(Jjn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function TNn(){const{datasetId:e,experimentId:t}=ra(),{data:r}=Rg(e??""),{data:n,isLoading:s,error:a}=W6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=tB({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a||!n?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:r?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(q1t,{experimentId:t,experiment:n}),o.jsx(V1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function NNn(){const{datasetId:e}=ra(),[t,r]=ao(),{data:n,error:s}=Rg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ps(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):s&&Os(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(qm,{})}),"Compare Experiments"]})]})}),o.jsx(pf,{children:o.jsxs("div",{className:"text-neutral4 text-center py-8",children:[o.jsx("p",{children:"Select two experiments to compare."}),o.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(qm,{})}),"Experiments Comparison"]})]})}),o.jsx(pf,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(qm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(_p,{}),"Back to Dataset"]})})]}),o.jsx(fNn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function ANn(){const{datasetId:e,itemId:t}=ra(),{Link:r}=or(),n=fu(),{data:s,isLoading:a,error:i}=Nve(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Rg(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[h,p]=b.useState(null),m=b.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[y,x]=b.useState(!1),[w,S]=b.useState(m.input),[k,_]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),_(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{p(f?V:V.isLatest?null:V)},B=()=>{p(null)},M=!f&&h!=null,F=()=>{M||x(!0)},U=()=>{M||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let D;if(k.trim())try{D=JSON.parse(k)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:D,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(G){ze.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},H=()=>{d&&(S(JSON.stringify(d.input,null,2)),_(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Q=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},L=h??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&Ps(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):i&&Os(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(zr,{children:o.jsx(pf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:u?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Item"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(hx,{}),t," ",o.jsx(Ka,{content:t})]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Item of ",o.jsx(Ta,{})," ",u?.name]})}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(v_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Qx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(me,{onClick:F,disabled:M,title:M?"Return to latest version to edit":void 0,children:[o.jsx(EVe,{})," Edit"]}),o.jsxs(me,{onClick:U,disabled:M,title:M?"Return to latest version to delete":void 0,children:[o.jsx(nd,{})," Delete"]})]})})]}),o.jsxs(sf,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(mr,{withRightSeparator:!y,children:[f&&d&&o.jsxs(gl,{variant:"destructive",children:[o.jsx(kh,{}),o.jsxs(gl.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&M&&h&&o.jsx(o.Fragment,{children:o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsxs(gl.Message,{children:["Viewing version v",h.datasetVersion]}),o.jsxs(gl.Button,{onClick:B,children:[o.jsx(mw,{})," Return to the latest version"]})]})}),y?o.jsx(D1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(nB,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(mr,{children:o.jsx(hNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx(Bt,{open:I,onOpenChange:P,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsx(Bt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function UBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function INn(){const{datasetId:e}=ra(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Rg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Tle(e??"",n[0]??""),{data:d}=Tle(e??"",n[1]??"");return a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(pf,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two items to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(_p,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(qm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(dr,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(_p,{}),"Back to Dataset"]}),o.jsx(me,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(mVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(BMt,{})," Diff View"]})})]})})]}),o.jsx(sf,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(RNn,{datasetId:e,itemId:f,Link:i,idx:h,itemIds:n,showContent:!l,onItemChange:p=>{const m=[...n];m[h]=p,r({items:m.join(",")})}}),h==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(Mft,{codeA:UBe(u),codeB:UBe(d)})]})})]})}function RNn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Tle(e,t),{data:u}=jE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(mr,{children:[o.jsxs(mr.Toolbar,{className:"flex gap-4",children:[o.jsx(rge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(me,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Qx,{}),"Versions"]})]}),i&&o.jsx(mr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(L1t,{item:l}),o.jsx(nB,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function VBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function PNn(){const{datasetId:e,itemId:t}=ra(),[r,n]=ao(),[s,a]=b.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(p=>!isNaN(p)&&p>0)??[],{data:l,error:c}=Rg(e??""),{Link:u}=or(),{data:d}=Nve(e??"",t??""),{data:f}=Ple(e??"",t??"",i[0]??0,l?.version),{data:h}=Ple(e??"",t??"",i[1]??0,l?.version);return c&&Ps(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):c&&Os(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(pf,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:dr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(_p,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(qm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(dr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(_p,{}),"Back to Item"]}),o.jsx(me,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(mVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(k2t,{})," Diff View"]})})]})})]}),o.jsx(sf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(MNn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const y=[...i];y[m]=g,n({ids:y.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(Mft,{codeA:VBe(f),codeB:VBe(h)})]})})]})}function MNn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Ple(e,t,r,n),h=new Set(a.filter((g,y)=>y!==l)),p=s.map(g=>{const y=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(y,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(Fa,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(mr,{children:[o.jsxs(mr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Qx,{className:"w-6 h-6 opacity-50"}),o.jsx(rge,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(mr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(nB,{item:m,Link:i})})]})}function DNn(){const{datasetId:e}=ra(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=fu(),{data:s,error:a}=Rg(e??""),i=jE(e??"",void 0,r[0]??null),l=jE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const y of[...c,...u])g.has(y.id)||g.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...g.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=b.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),h=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Ps(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})});if(a&&Os(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(pf,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const p=(g,y,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,y)=>{n(`/datasets/${e}/versions?ids=${g},${y}`,{replace:!0})};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(dSe,{})}),"Compare Versions"]})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(dSe,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Qx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(_p,{}),"Back to Dataset"]})})]}),o.jsx(sf,{children:o.jsxs(mr,{children:[o.jsx(gNn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(xNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function LNn(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),r=Math.floor(t.length/2),n=r,s=t.length-r;if(n===0)return null;const a=(s-n)/n*100;return{changePct:Math.round(a*10)/10,prevValue:String(n)}}function $Nn({scorers:e,datasets:t,experiments:r,avgScore:n,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,h=t?.length,p=r?.length,m=n!=null&&s!=null&&s!==0?{changePct:Math.round((n-s)/s*100*10)/10,prevValue:String(s)}:null,g=LNn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Scorers"}),i?o.jsx(_n.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(f)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Datasets"}),l?o.jsx(_n.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(h)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Avg Score"}),u?o.jsx(_n.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(n)}),m?o.jsx(_n.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Experiments"}),c?o.jsx(_n.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(p)}),g?o.jsx(_n.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Needs Review"}),d?o.jsx(_n.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(a)}),a>0?o.jsx(_n.NoChange,{message:"items pending review"}):o.jsx(_n.NoChange,{message:"All caught up"})]}):o.jsx(_n.NoData,{})]})]})}const FNn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],qBe="auto 1fr auto auto auto auto auto auto auto";function zNn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const BNn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function UNn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=or(),u=b.useMemo(()=>{const h=new Map;return t?.forEach(p=>h.set(p.id,p.name)),h},[t]),d=b.useMemo(()=>[...e].sort((h,p)=>{const m=h.createdAt?new Date(h.createdAt).getTime():0;return(p.createdAt?new Date(p.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const h=s.toLowerCase();return d.filter(p=>{const m=p.datasetId?u.get(p.datasetId)??"":"",g=!h||p.id.toLowerCase().includes(h)||m.toLowerCase().includes(h)||(p.targetId??"").toLowerCase().includes(h),y=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&y&&x})},[d,s,u,a,i]);return n?o.jsx(bh,{columns:qBe}):o.jsxs(Se,{columns:qBe,children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Experiment"}),o.jsx(Se.TopCell,{children:"Dataset"}),o.jsx(Se.TopCell,{children:"Target"}),o.jsx(Se.TopCell,{children:"Status"}),o.jsx(Se.TopCell,{className:"text-center",children:"Items"}),o.jsx(Se.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Se.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Se.TopCell,{className:"text-center",children:"Review"}),o.jsx(Se.TopCell,{children:"Date"})]}),f.map(h=>{const p=h.datasetId?u.get(h.datasetId)??h.datasetId.slice(0,8):"—",m=h.status??"pending",g=h.succeededCount??0,y=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Se.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Se.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Se.TextCell,{children:p}),o.jsx(Se.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Se.Cell,{children:o.jsx(LP,{variant:BNn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Se.TextCell,{className:"text-center",children:x}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsx("span",{className:y>0?"text-accent2":"",children:y})}),o.jsx(Se.Cell,{className:"text-center",children:(()=>{const S=r?.get(h.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const k=S.needsReview+S.complete;return k===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(vt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(vt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Se.TextCell,{children:zNn(h.createdAt)})]},h.id)})]})}function VNn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const BL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},qNn=[{label:"Completed",color:BL.completed},{label:"Running",color:BL.running},{label:"Pending",color:BL.pending},{label:"Failed",color:BL.failed}];function HNn({experiments:e,datasets:t,isLoading:r,isError:n}){const{data:s,maxVal:a}=b.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const l=new Map;if(t)for(const f of t)l.set(f.id,f.name);const c=new Map;for(const f of e){const h=f.datasetId??"unknown";c.has(h)||c.set(h,{completed:0,running:0,pending:0,failed:0});const p=c.get(h),m=f.status;m in p&&p[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,h])=>{const p=h.completed+h.running+h.pending+h.failed;return p>u&&(u=p),{name:l.get(f)??f.slice(0,12),values:[h.completed,h.running,h.pending,h.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Qt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Qt.Loading,{}):n?o.jsx(Qt.Error,{message:"Failed to load experiments data"}):o.jsx(Qt.Content,{children:i?o.jsx(nE,{data:s,segments:qNn,maxVal:a,fmt:l=>String(l)}):o.jsx(Qt.NoData,{message:"No experiments have been run yet"})})]})}const QNn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(va,{})]})})})});function WNn({search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:l,hasActiveFilters:c}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Eg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...FNn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx($o,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(me,{onClick:l,size:"sm",variant:"light",children:[o.jsx(An,{className:"size-3"})," Reset"]})]})]})}function GNn(){const{data:e,isLoading:t,error:r}=fd(),{data:n,isLoading:s,error:a}=zh(),{data:i,isLoading:l,error:c}=rB(),{data:u,isLoading:d,isError:f,error:h}=eOn(),{data:p,isLoading:m,isError:g,error:y}=Ive(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>kNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Au,{}),children:o.jsx(na,{})}):k&&Os(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Au,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Au,{}),children:o.jsx(gu,{title:"Failed to load evaluation data",message:k.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(Au,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(Li,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(pie,{children:o.jsx($Nn,{scorers:e,datasets:x,experiments:w,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:S.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:l,isLoadingScores:d,isLoadingReview:m})}),o.jsx(V1n,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[o.jsx(Wjn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(HNn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(SNn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function ZNn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=zh(),{data:u,isLoading:d,error:f}=rB(),{data:h}=Ive(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>VNn(p),[p]),y=b.useMemo(()=>H1t(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(na,{})});if(f&&Os(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&Os(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(gu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(QNn,{})});const S=r!=="all"||s!=="all"||e!=="",k=()=>{t(""),n("all"),a("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:x,children:[o.jsx(Au,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Experiments documentation",children:o.jsx(Li,{})})})]}),o.jsx(WNn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(UNn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function YNn(){const{experimentId:e}=ra(),{data:t,isLoading:r}=rB(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=W6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=tB({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):l&&Ps(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):l&&Os(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):l||!a?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Au,{})}),"Experiments"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(q1t,{experimentId:e,experiment:a}),o.jsx(V1t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function Q1t({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=EC(),{mutate:i,isPending:l,error:c}=rjn(),{mutate:u,isPending:d,error:f}=njn(),{mutate:h,isPending:p}=R1t(),[m,g]=b.useState(r),[y,x]=b.useState(""),[w,S]=b.useState(""),[k,_]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},F=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:M}):u({email:w,password:k,name:y||void 0},{onSuccess:M})},U=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(tx,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),n&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:n}),j&&o.jsxs("form",{onSubmit:F,className:"space-y-4",children:[!P&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),o.jsx(ar,{id:"name",type:"text",value:y,onChange:H=>x(H.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),o.jsx(ar,{id:"email",type:"email",value:w,onChange:H=>S(H.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),o.jsx(ar,{id:"password",type:"password",value:k,onChange:H=>_(H.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(me,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(me,{onClick:U,disabled:p,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),p?"Redirecting...":N.text||"Sign in"]})]})})}function XNn(){const[e]=ao(),t=fu(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(Q1t,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function KNn(){const[e,t]=ao(),r=mzr(e,t),n=vzr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=_ht(),{data:d=[],isPending:f}=Eht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Cht(),{data:m=[],isPending:g}=jht(),y=b.useMemo(()=>lzr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:h,loading:{tags:u,entityNames:f,serviceNames:g,environments:p}}),[c,d,m,h,u,f,g,p]),x=b.useMemo(()=>fzr({rootEntityType:r.selectedEntityOption?.entityType,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,tokens:r.filterTokens}),[r.filterTokens,r.selectedDateFrom,r.selectedDateTo,r.selectedEntityOption]),{data:w=[],isLoading:S,error:k,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T}=rzr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=wzr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:M}=Rme(r.featuredTraceId??null),{data:F,isLoading:U}=$S(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(hzr(y,r.filterTokens)),[y,r]),H=b.useCallback(()=>r.handleFeaturedChange({logId:null}),[r]),Q=b.useCallback(G=>r.handleFeaturedChange({traceId:G,spanId:null}),[r]),L=b.useCallback((G,J)=>r.handleFeaturedChange({traceId:G,spanId:J}),[r]),Z=b.useCallback(()=>{r.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[r]),V=b.useCallback(()=>r.handleFeaturedChange({spanId:null}),[r]),D=b.useCallback(G=>r.handleFeaturedChange({spanId:G??null}),[r]);if(k)return o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(WFr,{error:k,resource:"logs",errorTitle:"Failed to load logs"})});const W=r.filterTokens.length>0||r.datePreset!=="last-24h"||!!r.selectedDateTo;return w.length===0&&!S&&!W?o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(KFr,{})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:S,children:[o.jsx(YL,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(sht,{preset:r.datePreset,onPresetChange:r.handleDatePresetChange,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,onDateChange:r.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(oft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/logs/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(Li,{})})]})]}),o.jsx(YFr,{isLoading:S,filterFields:y,filterTokens:r.filterTokens,onFilterTokensChange:r.handleFilterTokensChange,onClear:z,onRemoveAll:r.handleRemoveAll,onSave:n.handleSave,onRemoveSaved:n.hasSavedFilters?n.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]}),o.jsx(GFr,{logCollapsed:i,listSlot:o.jsx(ZFr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(QFr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(gFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:M,onClose:Z,onSpanSelect:D,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(mFr,{spanId:r.featuredSpanId,span:F?.span,isLoading:U,onClose:V}):null})]})}const W1t=e=>{const t=Ge();return Ot({queryKey:["mcpserver-tools",e?.id],queryFn:async()=>{const n=(await t.getMcpServerTools(e?.id)).tools,s={};return n.forEach(a=>{s[a.id]=a}),s},retry:!1,refetchOnWindowFocus:!1})};function JNn({server:e}){const{paths:t,Link:r}=or(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=W1t(e),l=Object.values(i||{}),c=l.length,u=l.filter(h=>h.toolType==="agent").length,d=l.filter(h=>h.toolType==="workflow").length,f=Nh(e.name,50);return o.jsxs(Se.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Se.NameCell,{children:f}),o.jsx(Se.DescriptionCell,{children:a}),o.jsx(Se.TextCell,{className:"text-center",children:u||""}),o.jsx(Se.TextCell,{className:"text-center",children:c||""}),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]})}function eAn({mcpServers:e,isLoading:t,search:r=""}){const n=b.useMemo(()=>{const s=r.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,r]);return t?o.jsx(bh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"URL"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ma,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Tools",short:o.jsx(Mi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Workflows",short:o.jsx(Di,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Se.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(JNn,{server:s},s.id))]})}const tAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(va,{})]})})}),rAn=()=>{const{data:e=[],isLoading:t,error:r}=dM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(na,{})}):r&&Os(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(gu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(tAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(vl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(eAn,{mcpServers:e,isLoading:t,search:n})]})},nAn=(e,t)=>{const r=new Map,n=Object.keys(t);for(const s of n){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];r.has(u.id)||r.set(u.id,{...u,agents:[]}),r.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))r.has(a.id)||r.set(a.id,{...a,agents:[]});return Array.from(r.values())};function sAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>nAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(bh,{columns:"auto 1fr auto"}):o.jsxs(Se,{columns:"auto 1fr auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ma,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Se.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=Nh(c.id,50),d=Nh(c.description??"",200),f=c.agents.length;return o.jsxs(Se.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Se.NameCell,{children:u}),o.jsx(Se.DescriptionCell,{children:d}),o.jsx(Se.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const aAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(va,{})]})})}),iAn=()=>{const e=Ge();return Kr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new y_;Object.entries(n??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:r,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},oAn=({toolId:e})=>{const{canExecute:t}=Ev(),r=t("tools"),{data:n={}}=Ng(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const y=Object.values(g.tools).find(x=>x.id===e);if(y)return y}return null},[n,e]),{data:a,isLoading:i,error:l}=_kn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=iAn(),{requestContext:h}=ks();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const p=async(g,y)=>{if(!c)return;const x={...h??{},...y??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?fg(cg(nv(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(vve,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:p,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function lAn({value:e,onValueChange:t,placeholder:r="Select a tool...",searchPlaceholder:n="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=J8(),{data:h={},isLoading:p,isError:m,error:g}=Ng(),{navigate:y,paths:x}=or();b.useEffect(()=>{if(d){const _=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${_}`)}},[d,f]),b.useEffect(()=>{if(m){const _=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${_}`)}},[m,g]);const w=new Map;Object.values(h).forEach(_=>{_.tools&&Object.values(_.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(_=>{w.has(_.id)||w.set(_.id,_)});const S=Array.from(w.values()).map(_=>({label:_.id,value:_.id})),k=_=>{t?t(_):_&&_!==e&&y(x.toolLink(_))};return o.jsx(Kl,{options:S,value:e,onValueChange:k,placeholder:u||p?"Loading tools...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||p||d||m,variant:l})}const cAn=({isLoading:e,server:t})=>{const[{sseUrl:r,httpStreamUrl:n},s]=b.useState({sseUrl:"",httpStreamUrl:""});if(b.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,l=window.MASTRA_SERVER_PORT;let c=null;i&&l&&(c=`http://${i}:${l}`);const u=c||"http://localhost:4111",d=`${u}/api/mcp/${t.id}/sse`,f=`${u}/api/mcp/${t.id}/mcp`;s({sseUrl:d,httpStreamUrl:f})},[t]),e)return null;if(!t)return o.jsx(pf,{children:o.jsx(pe,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${r}`;return o.jsxs(pf,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(pe,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(vt,{icon:o.jsx(z9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(vt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(pe,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(pe,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(Ka,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(pe,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(Ka,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(pe,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(Ka,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(uAn,{server:t})})]})},uAn=({server:e})=>{const{data:t={},isLoading:r}=W1t(e);if(r)return null;const n=Object.keys(t);return o.jsxs("div",{className:"p-5 overflow-y-scroll",children:[o.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(vl,{})}),o.jsx(pe,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:n.map(s=>{const a=t[s];return o.jsx(dAn,{tool:a,serverId:e.id},s)})})]})},dAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=MSt[e.toolType||"tool"];return o.jsxs(kf,{onClick:()=>r.current?.click(),children:[o.jsx(Odt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(Cf,{children:[o.jsx(_f,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Ef,{children:e.description})]})]})},fAn=()=>{const{serverId:e}=ra(),{data:t=[],isLoading:r}=dM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(KSt,{value:e,variant:"ghost"})})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"MCP documentation"]})})]}),o.jsx(cAn,{isLoading:r,server:n})]})},G1t=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Ot({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},hAn=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Kr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},pAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Ev(),n=r("tools"),{data:s,isLoading:a,error:i}=G1t(t,e),{mutateAsync:l,isPending:c,data:u}=hAn(t,e);b.useEffect(()=>{if(i){const h=i instanceof Error?i.message:"Failed to load tool";ze.error(`Error loading tool: ${h}`)}},[i]);const d=async h=>{if(s)return await l(h)};if(a)return o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]});if(i)return null;if(!s)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!n)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=fg(cg(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(vve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},mAn=()=>{const{data:e}=dM(),{serverId:t,toolId:r}=ra(),{data:n,isLoading:s}=G1t(t,r),a=e?.find(c=>c.id===t),i=n?.name,l=a?.name||"";return s||!n?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(jr,{as:dr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"MCP documentation"]})})]}),o.jsx(pAn,{toolId:r,serverId:t})]})};function gAn(){const{data:e,isLoading:t,isError:r}=Y6r();return o.jsx(F6r,{data:e,isLoading:t,isError:r})}function yAn(){const{data:e,isLoading:t,isError:r}=yht();return o.jsx(Y9,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function vAn(){const{data:e,isLoading:t,isError:r}=W6r();return o.jsx(Y9,{label:"Total Model Cost",value:e?.cost!=null?Qw(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Qw(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function bAn(){const{data:e,isLoading:t,isError:r}=G6r();return o.jsx(Y9,{label:"Total Tokens",value:e?.value!=null?Fm(e.value):null,prevValue:e?.previousValue!=null?Fm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function xAn(){const{data:e,isLoading:t,isError:r}=Q6r();return o.jsx(Y9,{label:"Avg Score",value:e?.value!=null?String(e.value):null,prevValue:e?.previousValue!=null?String(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function wAn(){const{data:e,isLoading:t,isError:r}=Z6r();return o.jsx(z6r,{rows:e,isLoading:t,isError:r})}function SAn(){const{data:e,isLoading:t,isError:r}=K6r();return o.jsx(B6r,{data:e,isLoading:t,isError:r})}function OAn(){const{data:e,isLoading:t,isError:r}=J6r();return o.jsx(V6r,{data:e,isLoading:t,isError:r})}function kAn(){const{data:e,isLoading:t,isError:r}=X6r();return o.jsx(q6r,{data:e,isLoading:t,isError:r})}const _An=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),are="period";function EAn(){const[e,t]=ao(),r=e.get(are),n=pht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(are):l.set(are,a),l},{replace:!0})},[t]);return o.jsx(D6r,{initialPreset:n,onPresetChange:s,children:o.jsx(CAn,{})})}function CAn(){const{error:e}=yht(),{data:t,isLoading:r}=Q8(),n=t?.observabilityStorageType,s=n?_An.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(lk,{}),children:o.jsx(na,{})}):e&&Os(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(lk,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(lk,{}),children:o.jsx(gu,{title:"Failed to load metrics",message:e.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(lk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(L6r,{}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(Li,{})})]})]})}),r?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsxs(Bl,{variant:"info",children:[o.jsx(Ul,{children:"Metrics are not persisted"}),o.jsx($u,{as:"p",children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})]}),o.jsxs(pie,{children:[o.jsx(yAn,{}),o.jsx(vAn,{}),o.jsx(bAn,{}),o.jsx(xAn,{})]}),o.jsxs(pie,{children:[o.jsx(wAn,{}),o.jsx(OAn,{}),o.jsx(SAn,{}),o.jsx(kAn,{}),o.jsx(gAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(va,{})]})})})]})}const jAn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:lk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function TAn(){return o.jsxs(bk,{children:[o.jsx(bk.Top,{children:o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{children:[o.jsx(xo,{})," Observability"]})})})}),o.jsx("div",{className:"px-6 pt-6 overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:jAn.map(e=>o.jsxs(dr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const NAn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ma,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:Yi,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Di,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:nS,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:vl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Mi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:oc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:RE,href:"/request-context"}];function AAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(A2t,{})," Primitives"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:NAn.map(e=>o.jsxs(dr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function IAn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=BSt(),{isCmsAvailable:s}=uM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(na,{})}):n&&Os(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Zs,{resource:"prompt blocks"})}):n?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(gu,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(mkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:o.jsx(Li,{})}),s&&o.jsxs(me,{as:dr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(us,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(pkn,{promptBlocks:l,isLoading:r,search:a})]})}function RAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(RE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(ISn,{children:o.jsx(bSt,{})})})]})}const PAn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:QMt,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Li,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:va,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:sA,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:pVe,href:"https://mastra.ai/cloud",external:!0},{title:"Talk to our Sales team",description:"Get a custom demo, discuss on-prem deployments, and how we can help you accelerate getting agents into production.",icon:zPt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function MAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(Li,{})," Resources"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:PAn.map(e=>o.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&o.jsx(va,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function DAn(){const{data:e={},isLoading:t,error:r}=fd(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ps(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(na,{})});if(r&&Os(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(Zs,{resource:"scorers"})});if(r)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(gu,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(H1n,{})});const l=a!=="all"||n!=="",c=()=>{s(""),i("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(Da,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})})})]}),o.jsx(W1n,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(q1n,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function LAn(){const{scorerId:e}=ra(),[t,r]=ao(),n=t.get("scoreId")??void 0,[s,a]=b.useState(n),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=B1n(e),{data:f={},isLoading:h,error:p}=Ng(),{isLoading:m,error:g}=d0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=z1n({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(L=>f[L]).map(L=>({value:L,label:f[L].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(L=>({value:L,label:L,type:"WORKFLOW"}))||[],[c?.workflowIds]),j=b.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,...T],[E,T]),N=t.get("entity")??"all",I=j.find(L=>L.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const L=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${L}`)}},[d]),b.useEffect(()=>{if(p){const L=p instanceof Error?p.message:"Failed to load agents";ze.error(`Error loading agents: ${L}`)}},[p]),b.useEffect(()=>{if(g){const L=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${L}`)}},[g]);const P=L=>{L?.value&&r(Z=>{const V=new URLSearchParams(Z);return V.set("entity",L.value),V})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}y.find(V=>V.id===L)&&a(L)},[t,y]);const R=b.useCallback(L=>{a(L||void 0),r(Z=>{const V=new URLSearchParams(Z);return L?V.set("scoreId",L):V.delete("scoreId"),V})},[r]);if(!c)return null;const B=Ps(d)||Ps(p)||Ps(g),M=d&&Os(d),F=!B&&!M&&(d||p||g),U=!x&&y.length===0,z=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Ya,{children:[o.jsx(jr,{as:dr,to:"/scorers",children:"Scorers"}),o.jsx(U1n,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(bn,{children:[o.jsxs(bn.Title,{isLoading:u,children:[o.jsx(Da,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(bn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Scorers documentation",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})}),c?.scorer?.source==="stored"&&o.jsxs(me,{variant:"light",as:dr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(cv,{})," Edit"]})]})]})]});if(B||M||F||U&&!z){const L=(d instanceof Error?d.message:void 0)??(p instanceof Error?p.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{children:H}),o.jsx(bt.MainArea,{isCentered:!0,children:B?o.jsx(na,{}):M?o.jsx(Zs,{resource:"scorers"}):F?o.jsx(gu,{title:"Failed to load scorer",message:L}):o.jsx(R1n,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(D1n,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Z=new URLSearchParams(L);return Z.set("entity","all"),Z})},isLoading:x||h||m})]}),o.jsx(I1n,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const $An=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],FAn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=ove(),{theme:n,setTheme:s}=xC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(fme,{})," Settings"]})})}),o.jsxs(bt.MainArea,{className:"grid gap-8 mt-6",children:[o.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),o.jsx(bft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:$An.map(a=>({...a}))})]})}),o.jsx(SSt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function zAn(){const[e]=ao(),t=fu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(Q1t,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function BAn(e){return e.replace(/\/$/,"").split("/").pop()}function sB({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function UAn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Y("grid gap-y-4",r),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",r),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(ma,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Mi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(SVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(fF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(vl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(hdt,{})," ",BAn(a.githubUrl)]})})]},a.slug)})})}function VAn({tagOptions:e,selectedTag:t,providerOptions:r,selectedProvider:n,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(jx,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx($o,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx($o,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(me,{onClick:c,children:["Reset ",o.jsx(An,{})]})]})}function qAn(){const{data:e,isLoading:t}=Tzr(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(""),f=[{value:"all",label:"Any tag"}];(n||[]).forEach(w=>{f.push({value:w,label:w})});const h=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{h.push({value:w,label:w})});const p=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},y=r.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||l!=="all"&&!w.supportedProviders.includes(l))),x=u||a!=="all"||l!=="all";return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Zu,{children:[o.jsx(Ce,{children:o.jsx(qb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(VAn,{selectedTag:a,onTagChange:w=>p(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>p(w,"provider"),providerOptions:h,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(UAn,{templates:y,linkComponent:dr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const HAn="1.29.0-alpha.4";function QAn({errorMsg:e,validationErrors:t}){const r=typeof e=="string"?e:e!=null?String(e):void 0,n=r?.includes("Invalid schema for function"),s=r?.includes("validation issue")||t&&t.length>0,a=()=>s?"Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.":n?"There was an issue with the AI model configuration. This may be related to the selected model or AI SDK version compatibility.":"An unexpected error occurred during template installation.",i=()=>s?{icon:o.jsx(kh,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(b2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(sB,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),r&&!s&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left",children:o.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:r})})]})]})}function WAn({providerOptions:e,selectedProvider:t,onProviderChange:r,variables:n,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(sB,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(OVe,{})]}),o.jsx($o,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:r,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(n||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Mt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(Cx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(Cx,{name:h,labelIsHidden:!0,label:"Value",value:p,onChange:i,errorMsg:s.includes(h)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},h))}),o.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[o.jsx("div",{className:"absolute w-8 h-8 rounded-full bg-surface2 top-0 left-1/2 -translate-x-1/2 -translate-y-4 text-ui-sm text-neutral3 flex items-center justify-center",children:"And"}),o.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),o.jsx("p",{className:"text-neutral3 text-ui-md mt-2 mb-8",children:"This model will be used by the workflow to process and install the template"}),o.jsx(xSt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(me,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(Fw,{})]})})]})})}function GAn({title:e,description:t,githubUrl:r,isLoading:n,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[o.jsx(qb,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":n}),children:n?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":n}),children:n?o.jsx(o.Fragment,{children:" "}):t}),!n&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(Vy,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lF,{className:"w-[1em] h-[1em] text-neutral4"}),o.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),o.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Branch name:"})," ",o.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),o.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),r&&o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(hdt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(E1,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function ZAn({name:e,streamResult:t,workflowInfo:r}){const n=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,l=s?.steps||{},c=Object.keys(l).length>0,u=m=>m==="input"||m.endsWith(".input")||m.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(m)||/[0-9a-f]{8,}/.test(m)?!1:r?.allSteps?m in r.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,h=()=>{switch(n){case"initializing":return"Preparing template installation...";case"processing":return`Installing ${e} template`;case"completed":return"Template installation completed!";case"error":return"Template installation failed";default:return"Installing template..."}},p=d.map(([m,g])=>({id:m,status:g?.status,description:g?.description,title:m.charAt(0).toUpperCase()+m.slice(1).replace(/-/g," "),isActive:a?.id===m}));return o.jsxs(sB,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:h()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(n)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(N3r,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(fDt,{}),i||"Something went wrong"]}),c&&o.jsx(T3r,{steps:p,currentStep:a,className:"pb-4"}),!c&&n==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Mt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function YAn({name:e,installedEntities:t}){return o.jsxs(sB,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(OVe,{}),o.jsx("h2",{className:"text-header-md",children:"Done!"}),o.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",o.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&o.jsx(E1,{data:t})]})}function XAn(){const{templateSlug:e}=ra(),[t,r]=ao(),[n,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,h]=b.useState([]),[p,m]=b.useState(null),[g,y]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=Nzr({repoOrSlug:e,owner:"mastra-ai"}),R=HAn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=Azr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:F,isLoading:U}=Izr(),{mutateAsync:z,isPending:H}=Rzr(),{mutateAsync:Q}=Pzr(),{streamInstall:L,streamResult:Z,isStreaming:V}=Dzr(F),{observeInstall:D,streamResult:W,isStreaming:G}=Lzr(F);b.useEffect(()=>{const se=t.get("runId");se&&!g&&!p&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:se}),w(se),Q({runId:se}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)y(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ce,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ce} validation issue${ce>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ce=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ce=="string"?ce:String(ce))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,V,G,Q]),b.useEffect(()=>{const se=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(se&&le==="true"&&xe&&!V&&!G&&!S&&!_&&F){w(se),k(!0);try{Q({runId:se}).then(ue=>{if(ue.snapshot?.status==="running")return D.mutateAsync({runId:se})}).then(()=>{r(ue=>{const ce=new URLSearchParams(ue);return ce.delete("resume"),ce})}).catch(ue=>{console.error("❌ Failed to resume template installation:",ue),ue.message?.includes("404")||ue.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(ue){console.error("❌ Auto-resume failed with error:",ue),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,S,_,F,Q,D,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(se=>se).join(", "):"n/a",icon:o.jsx(Mi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(se=>se).join(", "):"n/a",icon:o.jsx(ma,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(fF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Nm,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(ME,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(se=>se.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const se=Z||W;se?.phase==="error"&&se?.error&&m(typeof se.error=="string"?se.error:String(se.error))},[Z?.phase,Z?.error,W?.phase,W?.error]);const re=se=>{s(se)},ie=async se=>(i(se.provider),c(se.modelId),{message:"Model updated successfully"}),fe=async()=>{const se=Object.entries(u).reduce((le,[xe,ue])=>(ue===""&&le.push(xe),le),[]);if(se.length>0){h(se);return}if(N){m(null),y(!1),w(""),E(!0);try{const xe={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:ue}=await z({});w(ue),r(ce=>{const ve=new URLSearchParams(ce);return ve.set("runId",ue),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:ue})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=se=>{const{name:le,value:xe}=se.target;xe.trim()===""?h(ue=>[...ue,le]):h(ue=>ue.filter(ce=>ce!==le)),d(ue=>({...ue,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(qb,{})}),"Templates"]}),o.jsx(jr,{as:dr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(GAn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||G)&&o.jsx(ZAn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:F}),g&&o.jsx(YAn,{name:N.title,installedEntities:te,linkComponent:dr}),p&&o.jsx(QAn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(WAn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:fe,handleVariableChange:X,isLoadingEnvVars:M||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const KAn=()=>{const{toolId:e,agentId:t}=ra();return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ma,{})}),"Agents"]}),o.jsx(jr,{as:dr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:dr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(u0,{})}),"Tools documentation"]})})]}),o.jsx(xOn,{toolId:e,agentId:t})]})},JAn=()=>{const{toolId:e}=ra();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(lAn,{value:e,variant:"ghost"})})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"Tools documentation"]})})]}),o.jsx(oAn,{toolId:e})]})};function eIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function tIn({feedback:e,isOpen:t,onClose:r,onNext:n,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Vt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:r,level:3,children:[o.jsxs(Vt.Top,{children:[o.jsxs(Zn,{children:[o.jsx(sA,{})," Feedback"]}),"|",o.jsx(Vt.Nav,{onNext:n,onPrevious:s})]}),o.jsxs(Vt.Content,{children:[o.jsxs(Vt.Header,{children:[o.jsxs(Vt.Heading,{children:[o.jsx(sA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(x_,{})," ",e.traceId]})]}),o.jsxs(Tx,{children:[o.jsx(E1,{data:[{label:"Created at",value:e?.timestamp?tr(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?eIn(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(x_,{}),codeStr:a,simplified:!0})]})]})]})}const UL=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function rIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function nIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function Z1t({feedbackData:e,isLoadingFeedbackData:t,onPageChange:r}){const[n,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=h=>{i(l[h]),s(!0)};if(t)return o.jsx(gft,{columns:UL});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(fa,{children:[o.jsxs(fa.Trim,{children:[o.jsx(fa.Header,{columns:UL}),l.length>0?o.jsx(fa.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=kg(m),y={id:`${h.traceId}-${p}`,source:h.feedbackUserId||h.feedbackSource||"unknown",date:g?"Today":tr(m,"MMM dd"),time:tr(m,"h:mm:ss aaa"),value:rIn(h),comment:nIn(h)};return o.jsx(fa.Entry,{columns:UL,onClick:()=>c(p),entry:y,children:UL.map(x=>o.jsx(fa.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(fa.Message,{message:"No feedback found",type:"info"})]}),o.jsx(fa.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const h=e?.pagination?.page||0;h>0&&r?.(h-1)}})]}),o.jsx(tIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const Y1t=({traceId:e="",page:t})=>{const r=Ge(),n=t??0;return Ot({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})},HBe="auto auto auto auto 1fr";function X1t({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(Z9,{columns:HBe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Rc,{columns:HBe,className:"min-w-0",children:[o.jsxs(Rc.Top,{children:[o.jsx(Rc.TopCell,{children:"ID"}),o.jsx(Rc.TopCell,{children:"Date"}),o.jsx(Rc.TopCell,{children:"Time"}),o.jsx(Rc.TopCell,{children:"Score"}),o.jsx(Rc.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=kg(a);return o.jsxs(Rc.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Rc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:nf(s?.id)||"n/a"}),o.jsx(Rc.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Rc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Rc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Rc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Rc.NoMatch,{message:"No scores found"})]}),o.jsx(Rc.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}function sIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=BFr(e,t,{onRemoveAll:()=>n(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,h]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:p,isLoading:m}=fd(),{data:g,isLoading:y}=gve({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:k}=Y1t({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Rme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=$S(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ce=>ce.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=_ht(),{data:B=[],isPending:M}=Eht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:F=[],isPending:U}=Cht(),{data:z=[],isPending:H}=jht(),Q=b.useMemo(()=>RFr({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:F,loading:{tags:R,entityNames:M,serviceNames:H,environments:U}}),[P,B,z,F,R,M,H,U]),L=b.useMemo(()=>LFr({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:Z,isLoading:V,isFetchingNextPage:D,hasNextPage:W,setEndOfListElement:G,error:J}=EFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Tht(T,s.spanIdParam??null,ce=>s.handleSpanChange(ce)),fe=qFr(e,t),X=b.useCallback(()=>s.applyFilterTokens($Fr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=FFr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ce=T?.find(ve=>ve.parentSpanId==null);ce&&(s.handleSpanChange(ce.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(kht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const ue=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(sht,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(oft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Cn,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ce=>!ce),children:r?o.jsx(m3,{}):o.jsx(bVe,{})}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})})]})]}),o.jsx(cFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:fe.handleSave,onRemoveSaved:fe.hasSavedFilters?fe.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(yFr,{traceCollapsed:u,listSlot:o.jsx(bFr,{traces:ae,isLoading:V,isFetchingNextPage:D,hasNextPage:W,setEndOfListElement:G,filtersApplied:ue,featuredTraceId:s.traceIdParam,onTraceClick:ce=>s.handleTraceClick(s.traceIdParam===ce.traceId?"":ce.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(Sht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ce=>s.handleSpanChange(ce??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ce=>h(ce),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:E8,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(Oht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ce=>s.handleSpanTabChange(ce),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(Z1t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ce,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(_ve,{traceId:ve,isTopLevelSpan:!ce.parentSpanId,spanId:we,entityType:ce.attributes?.agentId||ce.entityType===Do.AGENT?"Agent":ce.attributes?.workflowId||ce.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(X1t,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(pve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(Eve,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function aIn(){const{traceId:e}=ra(),[t,r]=ao(),n=fu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[h,p]=b.useState(i),[m,g]=b.useState(0),[y,x]=b.useState(!1),{data:w,isLoading:S,error:k}=Rme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=$S(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=fd(),{data:P,isLoading:R}=gve({traceId:e,spanId:c??void 0,page:m}),[B,M]=b.useState(0);b.useEffect(()=>M(0),[e,c]);const{data:F,isLoading:U}=Y1t({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[fe,X]of Object.entries(re))X===null||X===""?ie.delete(fe):ie.set(fe,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,fe=ie===c;u(ie),fe||(f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Q=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),L=b.useCallback(re=>{u(re),f(void 0),p("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Z,handleNextSpan:V}=Tht(_,c,L),D=b.useCallback(re=>{const ie=re;p(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),G=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{n("/observability")},[n]),ae=b.useCallback(()=>{p("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(me,{as:E8,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(_p,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:S,children:[o.jsx(xo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(bt.Column,{children:o.jsxs(ps,{children:[o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Cn,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(p3,{}),"Evaluate"]}),o.jsxs(Cn,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(nu,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(bht,{rootSpan:E,numOfCol:3})})})]});return k?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:te}),o.jsx(bt.MainArea,{isCentered:!0,children:o.jsx(kht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(Eve,{rootSpanId:E?.spanId,traceId:e,isOpen:y,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(Sht,{traceId:e,spans:_,isLoading:S,onClose:J,onSpanSelect:H,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(Oht,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Q,onPrevious:Z,onNext:V,activeTab:h,onTabChange:D,feedbackTabBadge:F?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(Z1t,{feedbackData:F,onPageChange:M,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:fe})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(_ve,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:fe,entityType:re.attributes?.agentId||re.entityType===Do.AGENT?"Agent":re.attributes?.workflowId||re.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(X1t,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(pve,{score:d,onClose:G})]})]})]})}function iIn(){const{data:e,isLoading:t,error:r}=d0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(na,{})}):r&&Os(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Zs,{resource:"workflows"})}):r?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(gu,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Qhn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(Hhn,{workflows:e||{},isLoading:t,search:n})]})}const QBe=()=>{const{workflowId:e}=ra(),{data:t,isLoading:r,error:n}=BP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})}):n&&Os(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Twt,{workflowId:e,workflow:t??void 0,isLoading:r})};function oIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(mdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(pdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(gdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(yU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Fre,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Ta,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(oc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Fre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(yU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(yU,{className:"h-4 w-4 text-neutral4"})}}function K1t(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?oIn(s):t?o.jsx(IE,{className:"h-4 w-4 text-amber-400"}):o.jsx(oc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(hx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(_R,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(Yi,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(ace,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(nce,{className:"h-4 w-4 text-neutral4"})}}function J1t(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+J1t(-e);if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1);return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function lIn(e){if("body"in e&&e.body&&typeof e.body=="object"){const n=e.body;if(typeof n.error=="string")return n.error;if(typeof n.message=="string")return n.message}const t=e.message,r=t.lastIndexOf(" - {");if(r!==-1)try{const n=t.slice(r+3),s=JSON.parse(n);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function eOt(e){return e==="."||e===""}function cIn({path:e,onNavigate:t}){const n=eOt(e)?[]:e.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[o.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:o.jsx(IE,{className:"h-4 w-4"})}),n.map((s,a)=>{const i=n.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("button",{onClick:()=>t(i),className:"px-2 py-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors truncate max-w-[150px]",title:s,children:s})]},i)})]})}function uIn({entries:e,currentPath:t,isLoading:r,error:n,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[h,p]=b.useState(null),m=[...e].sort((w,S)=>w.type==="directory"&&S.type!=="directory"?-1:w.type!=="directory"&&S.type==="directory"?1:w.name.localeCompare(S.name)),g=eOt(t),y=w=>{const S=g?w.name:`${t}/${w.name}`;w.type==="directory"?s(S):a?.(S)},x=w=>{const S=g?w.name:`${t}/${w.name}`;p(S)};return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsx(cIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(me,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(ER,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(me,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):o.jsx(oF,{className:"h-4 w-4"})}),l&&o.jsx(me,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(dF,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Na,{className:"h-6 w-6 animate-spin text-neutral3"})}):n?o.jsxs("div",{className:"py-12 px-4 text-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:o.jsx(nA,{className:"h-6 w-6 text-red-400"})}),o.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),o.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:lIn(n)})]}):m.length===0?o.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):o.jsx(ld,{children:o.jsxs("ul",{children:[!g&&o.jsx("li",{children:o.jsxs("button",{onClick:()=>{const w=t.split("/").slice(0,-1).join("/")||".";s(w)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[o.jsx(IE,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(w=>{const S=w.mount?.displayName||w.mount?.provider,k=w.mount?.status==="error";return o.jsx("li",{className:"group",children:o.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:()=>y(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[K1t(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&k&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(nA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Wr,{className:"max-w-xs",children:[o.jsx("span",{className:"text-red-400",children:"Error:"})," ",w.mount.error||"Failed to connect to this filesystem"]})]}),w.mount&&S&&(w.mount.description?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Wr,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})),w.type==="file"&&w.size!==void 0&&o.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:J1t(w.size)})]}),u&&!w.mount&&o.jsx("button",{onClick:()=>x(w),"aria-label":`Delete ${w.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:o.jsx(nd,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx(Bt,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsxs(Bt.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{disabled:f,children:"Cancel"}),o.jsxs(Bt.Action,{disabled:f,onClick:async()=>{try{h&&u&&await u(h)}finally{p(null)}},children:[f?o.jsx(Na,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function dIn(e){return e&&{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",mdx:"mdx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",css:"css",scss:"scss",less:"less",html:"html",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte"}[e.toLowerCase()]||null}function fIn({content:e,language:t}){return o.jsx(rve,{language:t,style:nve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function hIn({path:e,content:t,isLoading:r,mimeType:n,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=n?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=dIn(i);return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[K1t({name:a,type:"file"}),o.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ka,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(me,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Na,{className:"h-6 w-6 animate-spin text-neutral3"})}):l?o.jsx("div",{className:"p-4 flex items-center justify-center",children:o.jsx("img",{src:`data:${n||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(fIn,{content:t,language:c}):o.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const pIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),mIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(TMt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),gIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(nA,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),ire={bm25:{label:"Keyword",icon:o.jsx(Yi,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:o.jsx(w_,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:o.jsx(pLt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function tOt(e){return e.id.replace(/#chunk-\d+$/,"")}function yIn({onSearch:e,isSearching:t,searchResults:r,canBM25:n,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>n&&s?"hybrid":n?"bm25":s?"vector":"bm25",[f,h]=b.useState(d()),p=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...n?["bm25"]:[],...s?["vector"]:[],...n&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:p,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(PE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(ar,{value:i,onChange:g=>l(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),o.jsx(ar,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(me,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&o.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const y=ire[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
557
+ ]`})]})]})}function ATn({errors:e,maxErrors:t=5}){if(e.length===0)return null;const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[o.jsx(Ce,{children:o.jsx(kh,{className:"w-4 h-4"})}),o.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),o.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:r.map((s,a)=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0",children:"•"}),o.jsx("span",{children:s.message})]},a))}),n>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",n," more error",n!==1?"s":""]})]})}function ITn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[h,p]=b.useState(!1),{parseFile:m,isParsing:g,error:y}=Ljn(),{batchInsertItems:x}=ni(),w=b.useCallback(async I=>{try{const P=await m(I);l(P),a("preview")}catch{}},[m]),S=b.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),p(!0);const{items:I}=i;u({current:0,total:I.length});try{await x.mutateAsync({datasetId:e,items:I.map(P=>({input:P.input,groundTruth:P.groundTruth,metadata:P.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),p(!1),a("complete")},[i,x,e]),k=b.useCallback(()=>{r(!1),n?.(),d&&d.success>0&&ze.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150)},[r,n,d]),_=b.useCallback(()=>{h||(r(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[h,r]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(NTn,{onFileSelect:w,isParsing:g,error:y?.message});case"preview":return i?o.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ATn,{errors:i.errors}),o.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),o.jsx(TTn,{items:i.items,maxRows:5})]})}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Mt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(me,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(me,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(me,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(me,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(Sn,{open:t,onOpenChange:_,children:o.jsxs(yn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(On,{children:[o.jsx(vn,{children:N[s]}),o.jsx(qs,{children:"Import dataset items from a JSON file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(hf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function RTn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ir,{className:c,children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{isLoading:t,children:[o.jsx(Ta,{})," ",e?.name]}),o.jsx(Ir.Description,{isLoading:t,children:e?.description}),o.jsxs(Ir.Description,{isLoading:t,children:[o.jsxs(Zn,{children:[o.jsx(v_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Qx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(me,{disabled:!0,tabIndex:-1,children:[o.jsx(mx,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(me,{onClick:l,children:[o.jsx(mx,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(me,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(gVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(cv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(ru,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(nd,{})," Delete Dataset"]})]})]})]})})]})}const $1t=e=>{const t=Ge(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-review-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="needs-review").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})},PTn=e=>{const t=Ge(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-completed-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="complete").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})};function MTn(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t)+"...":r}catch{return String(e)}}const DTn=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function PBe({className:e,children:t,...r}){return o.jsx(aP,{children:o.jsx(fz,{className:Y(DTn,e),...r,children:t})})}function LTn({datasetId:e}){const t=Ge(),{data:r}=Rg(e),{data:n,isLoading:s}=$1t(e),{data:a,isLoading:i}=PTn(e),{updateExperimentResult:l}=ni(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[y,x]=b.useState(!1),[w,S]=b.useState(!1),[k,_]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[M,F]=b.useState(null),U=M??n??[];b.useEffect(()=>{n&&M===null&&F(n)},[n]);const z=b.useMemo(()=>{const ge=new Set;if(r?.tags)for(const Ee of r.tags)ge.add(Ee);for(const Ee of U)for(const Fe of Ee.tags)ge.add(Fe);return[...ge].sort()},[r,U]),H=b.useCallback(ge=>{!r||!e||(r.tags??[]).includes(ge)},[r,e]),Q=b.useMemo(()=>d?d==="__untagged__"?U.filter(ge=>ge.tags.length===0):U.filter(ge=>ge.tags.includes(d)):U,[U,d]),L=b.useMemo(()=>{const ge=new Map;for(const Ee of U)for(const Fe of Ee.tags)ge.set(Fe,(ge.get(Fe)??0)+1);return[...ge.entries()].sort((Ee,Fe)=>Fe[1]-Ee[1])},[U]),Z=b.useMemo(()=>U.filter(ge=>ge.tags.length===0).length,[U]),V=b.useMemo(()=>{let ge=0;return d&&ge++,m&&ge++,ge},[d,m]),D=b.useCallback((ge,Ee)=>{F(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,tags:Ee}:wt));const Fe=U.find(ct=>ct.id===ge);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ee})},[U,l]),W=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&Ee!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ee==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),F(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,rating:Ee}:wt))},[U,t]),G=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ee,comment:Ee,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),F(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,comment:Ee}:wt))},[U,t]),J=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);F(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:null})},[U,l,c]),ae=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);F(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ge=m?a??[]:Q;return!m||!d?ge:d==="__untagged__"?ge.filter(Ee=>Ee.tags.length===0):ge.filter(Ee=>Ee.tags.includes(d))},[m,a,Q,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ge=>ge.id)),[te]),fe=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&fe===te.length,se=fe>0&&!X,le=b.useCallback(ge=>{p(Ee=>{const Fe=new Set(Ee);return Fe.has(ge)?Fe.delete(ge):Fe.add(ge),Fe})},[]),xe=b.useCallback(()=>{p(X?new Set:new Set(te.map(ge=>ge.id)))},[X,te]),ue=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&!Fe.tags.includes(ge)&&D(Ee,[...Fe.tags,ge])}},[U,h,D]),ce=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&Fe.tags.includes(ge)&&D(Ee,Fe.tags.filter(ct=>ct!==ge))}},[U,h,D]),ve=b.useCallback(()=>{for(const ge of h)ae(ge);p(new Set)},[h,ae]),we=b.useCallback(()=>{for(const ge of h)J(ge);p(new Set)},[h,J]),Ne=b.useCallback(()=>{_(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ge=U.filter(Fe=>h.has(Fe.id));if(ge.length===0){x(!1);return}const Ee=await t.clusterFailures({modelId:`${E}/${j}`,items:ge.map(Fe=>({id:Fe.id,input:Fe.input,output:Fe.output??void 0,error:typeof Fe.error=="string"?Fe.error:Fe.error?String(Fe.error):void 0,scores:Fe.scores,existingTags:Fe.tags.length>0?Fe.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:k||void 0});Ee.proposedTags&&Ee.proposedTags.length>0&&(P(Ee.proposedTags.map(Fe=>({...Fe,accepted:!0}))),B(!0))}catch(ge){console.error("Analysis failed:",ge)}finally{x(!1)}}},[E,j,U,h,t,z,k]),oe=b.useCallback(()=>{for(const ge of I){if(!ge.accepted)continue;const Ee=U.find(Fe=>Fe.id===ge.itemId);if(Ee){const Fe=[...new Set([...Ee.tags,...ge.tags])];D(Ee.id,Fe)}}B(!1)},[I,U,D]),be=b.useCallback(ge=>{u(Ee=>Ee===ge?null:ge)},[]),Ae=b.useMemo(()=>c?te.find(ge=>ge.id===c)??null:null,[c,te]),$e=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge<te.length-1&&u(te[ge+1].id)},[c,te]),ye=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge>0&&u(te[ge-1].id)},[c,te]),ke=Ae?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Mt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(Sn,{open:w,onOpenChange:S,children:o.jsxs(yn,{children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Analyze Items"}),o.jsx(qs,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Pg,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Mg,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(pe,{variant:"ui-xs",className:"text-neutral3",children:[h.size," item",h.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(bc,{value:k,onChange:ge=>_(ge.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(hf,{children:[o.jsx(me,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(me,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Mt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(Sn,{open:R,onOpenChange:B,children:o.jsxs(yn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Review Proposed Tags"}),o.jsxs(qs,{children:[I.filter(ge=>ge.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge.itemId);return o.jsx("div",{className:Y("p-3 border rounded-lg",!ge.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(fi,{checked:ge.accepted,onCheckedChange:ct=>P(wt=>wt.map((lr,Ve)=>Ve===Ee?{...lr,accepted:!!ct}:lr))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Fe?typeof Fe.input=="string"?Fe.input.slice(0,100):JSON.stringify(Fe.input).slice(0,100):ge.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ge.tags.map((ct,wt)=>o.jsx(N1t,{tag:ct,onRename:lr=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ee?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?lr:Le)}:qe)),onRemove:()=>P(lr=>lr.map((Ve,qe)=>qe===Ee?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ge.reason&&o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(hf,{children:[o.jsx(me,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(me,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(sf,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(mr,{children:[o.jsxs(mr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(me,{variant:"outline",size:"md",children:[o.jsx(yVe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(yt.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(PBe,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ge=>ge.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ge=>ge.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(PBe,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ge=>ge.preventDefault(),children:"All"}),Z>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ge=>ge.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ge])=>o.jsx(yt.CheckboxItem,{checked:d===ge,onCheckedChange:()=>f(d===ge?null:ge),onSelect:Ee=>Ee.preventDefault(),children:ge},ge))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(me,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T1t,{selectedCount:h.size,vocabulary:z,onApplyTag:ue,onRemoveTag:ce,onNewTag:ge=>ue(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(me,{disabled:y,children:[y?o.jsx(Mt,{className:"w-4 h-4"}):o.jsx(Ce,{size:"sm",children:o.jsx(as,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:ve,children:[o.jsx(Ce,{size:"sm",children:o.jsx(rS,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(nd,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(w_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Mt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(pe,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(Se,{columns:ke,children:[o.jsxs(Se.Top,{children:[!m&&o.jsx(Se.TopCell,{children:o.jsx(fi,{checked:X?!0:se?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Se.TopCell,{children:" "}),o.jsx(Se.TopCell,{children:"Input"}),o.jsx(Se.TopCell,{children:"Comment"}),o.jsx(Se.TopCell,{children:"Tags"}),!Ae&&o.jsx(Se.TopCell,{children:"Rating"}),!Ae&&o.jsx(Se.TopCell,{children:"Scores"})]}),o.jsx(Se.Rows,{children:te.map(ge=>{const Ee=ge.scores?Object.entries(ge.scores):[];return o.jsxs(Se.Row,{onClick:()=>be(ge.id),selected:c===ge.id,children:[o.jsx(Se.Cell,{children:m?ge.error?o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):o.jsx(fi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:MTn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Se.Cell,{children:[ge.rating==="positive"&&o.jsx(Ce,{size:"sm",className:"text-positive1",children:o.jsx(cce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(lce,{})}),!ge.rating&&o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Se.Cell,{children:Ee.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ce,{size:"sm",className:"text-neutral3",children:o.jsx(Da,{})}),o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ee[0][1].toFixed(2)}),Ee.length>1&&o.jsxs(vt,{variant:"default",children:["+",Ee.length-1]})]}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(j1t,{item:Ae,isCompleted:m,tagVocabulary:z,onRate:ge=>W(Ae.id,ge),onSetTags:ge=>{D(Ae.id,ge);for(const Ee of ge)z.includes(Ee)||H(Ee)},onComment:ge=>G(Ae.id,ge),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ae(Ae.id),onPrevious:ye,onNext:$e,onClose:()=>u(null)})]})]})}function $Tn({datasetId:e,onExperimentClick:t,onEditClick:r,onDeleteClick:n,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=or(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,y]=b.useState(!1),[x,w]=b.useState(!1),[S,k]=b.useState(!1),[_,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,M]=b.useState([]),[F,U]=b.useState(!1),[z,H]=b.useState(0),[Q,L]=b.useState(null),[Z,V]=b.useState(""),[D]=Dcr(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Rg(e),{data:ie=[],total:fe,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=jE(e,D||void 0,ae),{data:ue=[],total:ce,isLoading:ve}=jE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=wR(e,void 0,we),{data:be}=wR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=tTn({hasSearchQuery:!!D,filteredItemsLength:ie.length,unfilteredItemsTotal:ce,itemsTotal:fe}),{data:ge}=$1t(e),Ee=ge?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const $r=Ut.isCurrent?null:Ut;c?c($r):G(Ut.isCurrent?null:Ut.version)},lr=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H($r=>$r+1))},Ie=Ut=>{f(`/datasets/${e}/items?items=${Ut.join(",")}`)},Le=Ut=>{f(`/datasets/${e}/versions?ids=${Ut.join(",")}`)},Re=Ut=>{M(Ut),R(!0)},it=async()=>{await Ae.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),M([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H($r=>$r+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H($r=>$r+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",sn.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Q?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(RTn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&ue.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Tf,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Nf,{children:[o.jsxs(hs,{value:"items",children:["Items ",o.jsx(Fa,{color:"gray",children:ke})]}),o.jsxs(hs,{value:"experiments",children:["Experiments",o.jsx(Fa,{color:"gray",children:$e.length})]}),o.jsxs(hs,{value:"review",children:["Review",Ee>0&&o.jsx(Fa,{color:"orange",children:Ee})]})]}),o.jsx(Ns,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(jTn,{datasetId:e,items:ie,isLoading:X,featuredItemId:Q,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>y(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:lr,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Z,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(Ns,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(yTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(Ns,{value:"review",className:"overflow-auto mt-0",children:o.jsx(LTn,{datasetId:e})})]})})]})})}),o.jsx(cTn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(ITn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(Zjn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(Yjn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(Xjn,{open:F,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx(Bt,{open:P,onOpenChange:R,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Items"}),o.jsxs(Bt.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function FTn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function MBe({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function zTn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:h}=ni(),p=async x=>{x.preventDefault();let w;try{w=JSON.parse(s)}catch{ze.error("Input must be valid JSON");return}let S;if(i.trim())try{S=JSON.parse(i)}catch{ze.error("Ground Truth must be valid JSON");return}let k;if(c.trim())try{k=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await h.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:k}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),r(!1),n?.()}catch(_){const E=FTn(_);E?f(E):ze.error(`Failed to add item: ${_ instanceof Error?_.message:"Unknown error"}`)}},m=x=>{a(x),d?.field==="input"&&f(null)},g=x=>{l(x),d?.field==="groundTruth"&&f(null)},y=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(Sn,{open:t,onOpenChange:r,children:o.jsxs(yn,{className:"max-w-lg",children:[o.jsx(On,{children:o.jsx(vn,{children:"Add Item"})}),o.jsx(Bn,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(Xn,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(MBe,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(MBe,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(me,{type:"button",onClick:y,children:"Cancel"}),o.jsx(me,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function BTn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=fd(),i=b.useMemo(()=>s?Object.entries(s).map(([l,c])=>({value:l,label:c.scorer?.config?.name||l,description:c.scorer?.config?.description||""})):[],[s]);return o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Scorers (Optional)"}),o.jsx(Idt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const UTn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function VTn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Ng(),{data:l,isLoading:c}=d0(),{data:u,isLoading:d}=fd(),f=e==="agent"?Object.entries(a??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,y])=>({value:g,label:y.scorer?.config?.name??g})):[],h=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,p=g=>{t(g),n("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return o.jsxs("div",{className:"grid gap-6",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Target Type"}),o.jsx(Kl,{options:UTn,value:e,onValueChange:p,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:m}),o.jsx(Kl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function qTn({datasetId:e,version:t,open:r,onOpenChange:n,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:h}=ni(),p=i&&c,m=h.isPending,g=async()=>{if(p)try{const x=await h.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});vc.success("Experiment triggered successfully"),n(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";vc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(Sn,{open:r,onOpenChange:y,children:o.jsxs(yn,{ref:a,children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Run Experiment"}),o.jsx(qs,{children:t?`Execute items from ${tr(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(Bn,{className:"grid gap-6",children:[o.jsx(VTn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(BTn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(hf,{className:"px-6 pt-4",children:[o.jsx(me,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(me,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const F1t=e=>{const t=Ge();return Ot({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},DBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function HTn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=nre(e?.input),d=nre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(me,{onClick:a,disabled:!e.traceId,children:[o.jsx(oce,{}),"Show Trace"]}),o.jsx(me,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(An,{})})]})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(mx,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(hx,{})," ",e.itemId]})})]})}),c&&o.jsxs(gl,{variant:"destructive",children:[o.jsx(uDt,{}),o.jsxs(gl.Message,{children:[o.jsx("strong",{children:"Error: "}),nre(e?.error&&typeof e.error=="object"?e.error.message:e?.error)]})]}),t&&t.length>0&&o.jsxs(Pt,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Pt.Header,{columns:DBe,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Score"})]}),o.jsx(Pt.Items,{children:t.map(f=>o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:f.id},columns:DBe,isFeatured:l===f.id,onClick:i,children:[o.jsx(Pt.TextCell,{children:f.scorerId}),o.jsx(Pt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(ME,{className:"w-4 h-4"})," Review Status"]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${e.status==="needs-review"?"bg-warning/10 text-warning":e.status==="complete"?"bg-accent1/10 text-accent1":"bg-neutral3/10 text-neutral4"}`,children:e.status}),Array.isArray(e.tags)&&e.tags.length>0&&e.tags.map(f=>o.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(hx,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Zd,{}),codeStr:d}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(v_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:tr(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function nre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function QTn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(px,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Zd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(Oh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(Oh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function WTn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=$S(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(me,{onClick:s,"aria-label":"Close span details",children:o.jsx(An,{})})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(Oh,{})," Span ",nf(t)]})})}),o.jsx(QTn,{span:i})]})]})}const GTn=e=>{if(!e||e.length===0)return[];const t=e.reduce((l,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!l||u>l)?u:l},null),r=new Map,n=[];e.forEach(l=>{const c=new Date(l.startedAt),u=l.endedAt?new Date(l.endedAt):void 0,d={id:l.spanId,name:l.name,type:l.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:l.parentSpanId};r.set(l.spanId,d)}),e.forEach(l=>{const c=r.get(l.spanId);if(l?.parentSpanId==null){if(t&&c.endTime&&t>new Date(c.endTime)){c.endTime=t.toISOString();const u=new Date(t).getTime(),d=new Date(c.startTime).getTime();c.latency=u-d}n.push(c)}else{const u=r.get(l.parentSpanId);u?u.spans.push(c):n.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(n),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function z1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...z1t(r))}),t}const LBe=["agent","workflow","model","mcp","tool","workspace","other"];function B1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ma,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Di,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(Nm,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(vl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:o.jsx(z9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in r?r[t]:{typePrefix:"other"}}function ZTn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs($Be,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(iVe,{}):o.jsx(Hx,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs($Be,{onClick:()=>s?.(),children:[a," ",o.jsx(aVe,{})]})]}):null})}function $Be({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Y("h-full",r),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function YTn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:r?o.jsx(cVe,{}):o.jsx(lVe,{})})})}function XTn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u,toggleChildren:d}){return o.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${n*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(YTn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function U1t({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=z1t(e),y=g.length,x=t===0,w=B1t(e?.type),S=f?f.includes(e.id):!1,k=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{x&&h?.([e.id])},[x,e.id,h]),b.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(P=>d.includes(P.id));!S&&I&&T()},[d,e.spans,e.id,S,h,f]);const T=()=>{if(!(!h||!f))if(S){const I=[e.id,...g];h(f.filter(P=>!I.includes(P)))}else h([...f,e.id])},j=()=>{!h||!f||h([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(XTn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(ZTn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:y,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(U1t,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function KTn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Mt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(U1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function JTn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=LBe.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!LBe.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=Ktt(h=>{s?.(h)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(jx,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:h=>{l(h.target.value)},onReset:()=>l("")})}),o.jsxs(uft,{children:[c.map(h=>{const p=B1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(me,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(Ce,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(me,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(iF,{})}),"Other"]}),o.jsx(me,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(An,{})})})]})]})}function eNn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=F1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>GTn(i),[i]);b.useEffect(()=>{if(l.trim()===""){h([]);return}const S=l.toLowerCase(),k=i.filter(_=>_.name.toLowerCase().includes(S)).map(_=>_.spanId);h(k)},[l,i]),b.useEffect(()=>{c(""),d([]),h([]),m([])},[e]);const y=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(mr.Toolbar,{children:o.jsx(me,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(An,{})})}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",nf(e)]})})}),o.jsx(JTn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(KTn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function tNn({results:e,isLoading:t,featuredResultId:r,onResultClick:n,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Mt,{})})]}):e.length===0?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx(Se.NoMatch,{message:"No results yet"})]}):o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsxs(Se.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Se.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Se.Cell,{children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",h?"bg-red-700":"bg-green-600")})})}),o.jsx(Wr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:nNn(rNn(f.input),200)})}),i?.map(m=>{const y=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Se.TextCell,{children:o.jsx("span",{className:"font-mono",children:y!=null?y.score.toFixed(3):"-"})},m)})]},f.id)}),o.jsxs("div",{ref:l,className:"h-1 col-span-full",children:[c&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Mt,{})}),!u&&e.length>0&&o.jsx(pe,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function rNn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function nNn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function sNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function aNn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=sNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(me,{onClick:n,"aria-label":"Close score details",children:o.jsx(An,{})})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(Da,{})," ",e.scorerId]})})}),o.jsxs(Tx,{children:[o.jsx(Vt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(Da,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(hx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Zd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(lc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(lc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(lc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(lc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const FBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function iNn({scoresByItemId:e,experimentStatus:t}){const r=b.useMemo(()=>{if(!e)return[];const n={};for(const s of Object.values(e))for(const a of s)n[a.scorerId]||(n[a.scorerId]={sum:0,count:0}),n[a.scorerId].sum+=a.score,n[a.scorerId].count++;return Object.entries(n).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(r.length===0){const n=t==="running"||t==="pending",s=e!==void 0;let a,i;return n?(a="Experiment in progress",i="Summary metrics will appear here once the experiment completes."):s?(a="No scorers configured",i="Add scorers when triggering an experiment to evaluate results and see summary metrics here."):(a="Loading scores",i="Fetching scorer results…"),o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(Da,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:FBe,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Avg Score"}),o.jsx(Pt.HeaderCol,{children:"Items Scored"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:r.map(({scorerId:n,avg:s,count:a})=>o.jsxs(Pt.Row,{columns:FBe,children:[o.jsx(Pt.TextCell,{children:n}),o.jsx(Pt.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Pt.TextCell,{className:"font-mono",children:a})]},n))})})]})}function V1t({experimentId:e,experimentStatus:t,results:r,isLoading:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(void 0),[p,m]=b.useState(null),g=r.find(z=>z.id===l)??null,{data:y}=b1t(e,t),x=b.useMemo(()=>{if(!y)return[];const z=new Set;for(const H of Object.values(y))for(const Q of H)z.add(Q.scorerId);return[...z].sort()},[y]),{data:w}=F1t(u),S=w?.spans??[],k=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>=0&&z<S.length-1)return()=>h(S[z+1].spanId)},_=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>0)return()=>h(S[z-1].spanId)},E=z=>{c(z),d(null),h(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>=0&&z<r.length-1)return()=>E(r[z+1].id)},I=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>0)return()=>E(r[z-1].id)},P=g?y?.[g.itemId]:void 0,R=P?.find(z=>z.id===p)??null,B=z=>{m(z===p?null:z),d(null),h(void 0)},M=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},F=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(Tf,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Nf,{children:[o.jsx(hs,{value:"summary",children:"Summary"}),o.jsx(hs,{value:"results",children:"Results"})]}),o.jsx(Ns,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(iNn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(Ns,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(sf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(mr,{children:o.jsx(tNn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:y,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(D3r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(HTn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(aNn,{score:R,onNext:M(),onPrevious:F(),onClose:()=>m(null)})}),g&&u&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(eNn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(WTn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const oNn={pending:o.jsx(AE,{}),running:o.jsx(g3,{}),completed:o.jsx(ta,{}),failed:o.jsx(An,{})};function lNn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":r==="completed","bg-red-700":r==="failed","bg-cyan-600":r==="running","bg-yellow-600":r==="pending"}),children:oNn[r]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(r==="pending"||r==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:n})]})]})]})}function q1t({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Ng(),{data:a}=d0(),{data:i}=fd(),l=()=>{switch(t.targetType){case"agent":return n.agentLink(t.targetId);case"workflow":return n.workflowLink(t.targetId);case"scorer":return n.scorerLink(t.targetId);default:return"#"}},c=()=>{const u=t.targetId;if(!u)return u;switch(t.targetType){case"agent":return s?.[u]?.name??u;case"workflow":return a?.[u]?.name??u;case"scorer":return i?.[u]?.scorer?.config?.name??u;default:return u}};return o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(dVe,{}),e," ",e&&o.jsx(Ka,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(v_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(v_,{})," Completed at ",tr(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx($Mt,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(lF,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(r,{href:`${n.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):o.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),o.jsx(Ka,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(lNn,{experiment:t})})]})}function Ave({delta:e}){const t=e>0?o.jsx(Fa,{size:"small",color:"green",intensity:"muted",children:o.jsx(rce,{})}):e<0?o.jsx(Fa,{size:"small",color:"red",intensity:"muted",children:o.jsx(rVe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function zL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function cNn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(mr,{withLeftSeparator:!0,children:[o.jsxs(mr.Toolbar,{children:[o.jsx(_C,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(me,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(An,{})})})]}),o.jsxs(mr.Content,{className:"pb-6",children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(hx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(Tx,{children:[h.length>0&&o.jsxs("div",{className:"grid gap-3",children:[o.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),o.jsx("div",{className:"grid gap-2",children:h.map(p=>{const m=c?.scores[p]??null,g=u?.scores[p]??null,y=m!=null&&g!=null?g-m:null;return o.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[o.jsx("span",{className:"text-sm text-neutral5 font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),y!=null&&o.jsx(Ave,{delta:y})]})]},p)})})]}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(Fa,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(Zd,{}),codeStr:zL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(Fa,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Zd,{}),codeStr:zL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(px,{}),codeStr:zL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(jVe,{}),codeStr:zL(e.groundTruth)})]})}):o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsx(gl.Message,{children:(()=>{const p=c?"Contender":"Baseline",m=c?s:n;return o.jsxs(o.Fragment,{children:["The ",p," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item. Comparison is not available."]})})()})]})]})]})}function uNn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(mr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(Ave,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const dNn={baseline:{label:"Baseline",color:"purple",customStyle:"items-end justify-items-end [&>div]:justify-end border-r-0 rounded-r-none"},contender:{label:"Contender",color:"cyan",customStyle:"items-start justify-items-start [&>div]:justify-start border-l-0 rounded-l-none"}};function zBe({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=dNn[r];if(!t)return null;const l=t.createdAt?new Date(t.createdAt):null;return o.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[o.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[r==="contender"&&o.jsxs(Fa,{size:"small",color:a,children:[s,o.jsx(Fw,{})]}),o.jsx(me,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs(Fa,{size:"small",color:a,children:[o.jsx(_p,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(Zn,{children:[o.jsx(jVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(vVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(nVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function fNn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=Cjn(e,t,r),{data:u}=W6(e,t),{data:d}=W6(e,r),f=u&&d&&u.datasetVersion!==d.datasetVersion,h=b.useMemo(()=>{if(!i)return[];const T=new Set;for(const j of i.items)for(const N of Object.values(j.results))if(N)for(const I of Object.keys(N.scores))T.add(I);return[...T].sort()},[i]),p=b.useMemo(()=>{if(!i||h.length===0)return[];const T=i.baselineId,j=t===T?r:t;return h.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const H=z.results[T]?.scores[N],Q=z.results[j]?.scores[N];H!=null&&(I+=H,R++),Q!=null&&(P+=Q,B++)}const M=R>0?I/R:null,F=B>0?P/B:null,U=M!=null&&F!=null?F-M:null;return{scorerId:N,avgA:M,avgB:F,delta:U}})},[i,h,t,r]),m=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"baselineAvg",label:"Baseline Avg",size:"1fr"},{name:"comparisonAvg",label:"Comparison Avg",size:"1fr"},{name:"delta",label:"Delta",size:"1fr"}],g=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:h.map(T=>({name:T,label:T,size:"1fr"}))],[h,s]),y=i?.items.find(T=>T.itemId===s)??null,x=T=>{a(T===s?null:T)},w=()=>{a(null)},S=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>=0&&T<i.items.length-1)return()=>a(i.items[T+1].itemId)},k=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Mt,{})});if(c)return o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsxs(gl.Column,{children:[o.jsx(gl.Title,{children:"Error loading comparison"}),o.jsx(gl.Message,{children:c instanceof Error?c.message:"Unknown error"})]})]});if(!i||i.items.length===0)return o.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const _=i.baselineId,E=t===_?r:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(zBe,{datasetId:e,experiment:u,type:"baseline"}),o.jsx("div",{className:"relative flex items-center justify-center px-[2vw] before:absolute before:inset-y-0 before:left-1/2 before:-translate-x-1/2 before:w-[2px] before:bg-border1",children:o.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(zBe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsxs(gl.Message,{children:[o.jsx("strong",{children:"Version mismatch!"})," These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})]}),p.length>0&&o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:m,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(oRe,{children:[o.jsx(Fa,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(Fa,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(oRe,{children:[o.jsx(Fa,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(Fa,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:p.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Pt.Row,{columns:m,children:[o.jsx(Pt.TextCell,{children:T}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Ave,{delta:I}):"-"})]},T))})})]}),o.jsxs(sf,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(uNn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx(cNn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function hNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Nve(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{r?.(x)},h=x=>s==null?x.isLatest:x.datasetVersion===s,p=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[k]=Array.from(S);return new Set([k,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},y=()=>{u.size===2&&n?.([...u])};return o.jsxs(mr,{className:"min-w-56",children:[l?o.jsx(mr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(me,{onClick:m,children:"Cancel"}),o.jsx(Cn,{variant:"primary",disabled:u.size!==2,onClick:y,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(mr.Toolbar,{children:o.jsxs(me,{onClick:g,className:"w-full",children:[o.jsx(qm,{})," Compare Ver."]})})}),i?o.jsx(pNn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Pt.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Pt.LabelCell,{children:o.jsx(fi,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:k=>{k.stopPropagation(),x.isDeleted||p(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Pt.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:h(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Pt.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function pNn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function mNn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${tr(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function gNn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=jve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${mNn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(mr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx($o,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx($o,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const yNn=[{name:"id",label:"ID",size:"1fr"},{name:"versionA",label:"Version A",size:"1fr"},{name:"versionB",label:"Version B",size:"1fr"},{name:"compare",label:"Compare",size:"10rem"}],vNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(us,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(EVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(ZMt,{}),tooltip:"Same in both versions"}};function sre({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(jPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function rw({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:r,icon:n,tooltip:s}=vNn[e];return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&o.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),o.jsx(Fa,{color:r,size:"small",children:n})]})}),o.jsx(Wr,{children:s})]})}function bNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function xNn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=or(),l=t>r;return o.jsx(Pt,{children:o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:n.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=bNn(u,d);return o.jsxs(Pt.Row,{columns:yNn,children:[o.jsx(Pt.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(rw,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(rw,{variant:"changed",version:u.datasetVersion}):o.jsx(rw,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(rw,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(rw,{variant:"changed",version:d.datasetVersion}):o.jsx(rw,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(rw,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Pt.Cell,{children:o.jsx(sre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const BBe={needsReview:"#facc15",complete:"#22c55e"},wNn=[{label:"Needs Review",color:BBe.needsReview},{label:"Reviewed",color:BBe.complete}];function SNn({reviewSummary:e,experiments:t,datasets:r,isLoading:n,isError:s}){const{data:a,maxVal:i,totalInPipeline:l}=b.useMemo(()=>{if(!e?.counts||!t)return{data:[],maxVal:0,totalInPipeline:0};const u=new Map;for(const m of t)u.set(m.id,m);const d=new Map;if(r)for(const m of r)d.set(m.id,m.name);let f=0,h=0;const p=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;h+=g,g>f&&(f=g);const y=u.get(m.experimentId),x=y?.datasetId?d.get(y.datasetId):void 0,w=x?`${x} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);p.push({name:w,values:[m.needsReview,m.complete]})}return{data:p,maxVal:f,totalInPipeline:h}},[e,t,r]),c=a.length>0;return o.jsxs(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Qt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Qt.Loading,{}):s?o.jsx(Qt.Error,{message:"Failed to load review data"}):o.jsx(Qt.Content,{children:c?o.jsx(nE,{data:a,segments:wNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Qt.NoData,{message:"No items have been sent to review yet"})})]})}function Ive(){const e=Ge();return Ot({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function H1t(e){const t=new Map;if(!e?.counts)return t;for(const r of e.counts)t.set(r.experimentId,{needsReview:r.needsReview,complete:r.complete,total:r.total});return t}function ONn(e,t){const r=new Map,n=H1t(e);if(!n.size||!t)return r;for(const s of t){const a=n.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=r.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,r.set(s.datasetId,l)}return r}function kNn(e){return e?.counts?e.counts.reduce((t,r)=>({needsReview:t.needsReview+r.needsReview,complete:t.complete+r.complete,inPipeline:t.inPipeline+r.needsReview+r.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const _Nn=10;function ENn(){const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:h,isLoading:p,error:m}=zh({page:d,perPage:_Nn}),{data:g,isLoading:y,error:x}=rB(),{data:w}=Ive(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>Hjn(S),[S]),T=b.useMemo(()=>ONn(w,_),[w,_]),j=p||y,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Q=>Q+1),[]),R=b.useCallback(()=>f(Q=>Math.max(0,Q-1)),[]),B=b.useCallback(Q=>{n(Q),f(0)},[]),M=b.useCallback(Q=>{a(Q),f(0)},[]),F=b.useCallback(Q=>{l(Q),f(0)},[]),U=b.useCallback(Q=>{u(Q),f(0)},[]);if(N&&Ps(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(na,{})});if(N&&Os(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(Zs,{resource:"datasets"})});if(N)return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(gu,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(Jr,{title:"Datasets",icon:o.jsx(Ta,{}),children:o.jsx(Qjn,{onCreateClick:I})}),o.jsx(Ile,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||r!=="",H=()=>{n(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:j,children:[o.jsx(Ta,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(us,{})}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(Li,{})})]})]}),o.jsx(Gjn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:F,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(Ujn,{datasets:S,experiments:_,reviewByDataset:T,isLoading:j,search:r,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:k,onNextPage:P,onPrevPage:R}),o.jsx(Ile,{open:e,onOpenChange:t})]})}const CNn=new Set(["items","experiments","review"]);function jNn(){const{datasetId:e}=ra(),t=fu(),[r,n]=ao(),s=r.get("tab"),a=s&&CNn.has(s)?s:"items",i=E=>{n(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(!1),[g,y]=b.useState(null),{data:x,error:w}=Rg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(pf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ps(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})});if(w&&Os(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{y(E?.version??null)};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(eTn,{value:e,variant:"ghost"})})]})}),o.jsxs(pf,{className:"content-stretch",children:[o.jsx($Tn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(me,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(mx,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(qTn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(zTn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(Kjn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(Jjn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function TNn(){const{datasetId:e,experimentId:t}=ra(),{data:r}=Rg(e??""),{data:n,isLoading:s,error:a}=W6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=tB({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a||!n?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:r?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(q1t,{experimentId:t,experiment:n}),o.jsx(V1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function NNn(){const{datasetId:e}=ra(),[t,r]=ao(),{data:n,error:s}=Rg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ps(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):s&&Os(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(qm,{})}),"Compare Experiments"]})]})}),o.jsx(pf,{children:o.jsxs("div",{className:"text-neutral4 text-center py-8",children:[o.jsx("p",{children:"Select two experiments to compare."}),o.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(qm,{})}),"Experiments Comparison"]})]})}),o.jsx(pf,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(qm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(_p,{}),"Back to Dataset"]})})]}),o.jsx(fNn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function ANn(){const{datasetId:e,itemId:t}=ra(),{Link:r}=or(),n=fu(),{data:s,isLoading:a,error:i}=Nve(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Rg(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[h,p]=b.useState(null),m=b.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[y,x]=b.useState(!1),[w,S]=b.useState(m.input),[k,_]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),_(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{p(f?V:V.isLatest?null:V)},B=()=>{p(null)},M=!f&&h!=null,F=()=>{M||x(!0)},U=()=>{M||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let D;if(k.trim())try{D=JSON.parse(k)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:D,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(G){ze.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},H=()=>{d&&(S(JSON.stringify(d.input,null,2)),_(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Q=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},L=h??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&Ps(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):i&&Os(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(zr,{children:o.jsx(pf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:u?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Item"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(hx,{}),t," ",o.jsx(Ka,{content:t})]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Item of ",o.jsx(Ta,{})," ",u?.name]})}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(v_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Qx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(me,{onClick:F,disabled:M,title:M?"Return to latest version to edit":void 0,children:[o.jsx(EVe,{})," Edit"]}),o.jsxs(me,{onClick:U,disabled:M,title:M?"Return to latest version to delete":void 0,children:[o.jsx(nd,{})," Delete"]})]})})]}),o.jsxs(sf,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(mr,{withRightSeparator:!y,children:[f&&d&&o.jsxs(gl,{variant:"destructive",children:[o.jsx(kh,{}),o.jsxs(gl.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&M&&h&&o.jsx(o.Fragment,{children:o.jsxs(gl,{variant:"warning",children:[o.jsx(kh,{}),o.jsxs(gl.Message,{children:["Viewing version v",h.datasetVersion]}),o.jsxs(gl.Button,{onClick:B,children:[o.jsx(mw,{})," Return to the latest version"]})]})}),y?o.jsx(D1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(nB,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(mr,{children:o.jsx(hNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx(Bt,{open:I,onOpenChange:P,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsx(Bt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function UBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function INn(){const{datasetId:e}=ra(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Rg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Tle(e??"",n[0]??""),{data:d}=Tle(e??"",n[1]??"");return a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(pf,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two items to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(_p,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(qm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(dr,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(_p,{}),"Back to Dataset"]}),o.jsx(me,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(mVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(BMt,{})," Diff View"]})})]})})]}),o.jsx(sf,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(RNn,{datasetId:e,itemId:f,Link:i,idx:h,itemIds:n,showContent:!l,onItemChange:p=>{const m=[...n];m[h]=p,r({items:m.join(",")})}}),h==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(Mft,{codeA:UBe(u),codeB:UBe(d)})]})})]})}function RNn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Tle(e,t),{data:u}=jE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(mr,{children:[o.jsxs(mr.Toolbar,{className:"flex gap-4",children:[o.jsx(rge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(me,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Qx,{}),"Versions"]})]}),i&&o.jsx(mr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(L1t,{item:l}),o.jsx(nB,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function VBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function PNn(){const{datasetId:e,itemId:t}=ra(),[r,n]=ao(),[s,a]=b.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(p=>!isNaN(p)&&p>0)??[],{data:l,error:c}=Rg(e??""),{Link:u}=or(),{data:d}=Nve(e??"",t??""),{data:f}=Ple(e??"",t??"",i[0]??0,l?.version),{data:h}=Ple(e??"",t??"",i[1]??0,l?.version);return c&&Ps(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):c&&Os(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(pf,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:dr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(_p,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(qm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(dr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(_p,{}),"Back to Item"]}),o.jsx(me,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(mVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(k2t,{})," Diff View"]})})]})})]}),o.jsx(sf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(MNn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const y=[...i];y[m]=g,n({ids:y.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(Mft,{codeA:VBe(f),codeB:VBe(h)})]})})]})}function MNn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Ple(e,t,r,n),h=new Set(a.filter((g,y)=>y!==l)),p=s.map(g=>{const y=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(y,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(Fa,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(mr,{children:[o.jsxs(mr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Qx,{className:"w-6 h-6 opacity-50"}),o.jsx(rge,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(mr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(nB,{item:m,Link:i})})]})}function DNn(){const{datasetId:e}=ra(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=fu(),{data:s,error:a}=Rg(e??""),i=jE(e??"",void 0,r[0]??null),l=jE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const y of[...c,...u])g.has(y.id)||g.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...g.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=b.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),h=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Ps(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})});if(a&&Os(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(pf,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const p=(g,y,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,y)=>{n(`/datasets/${e}/versions?ids=${g},${y}`,{replace:!0})};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Ta,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(dSe,{})}),"Compare Versions"]})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(dSe,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Qx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(_p,{}),"Back to Dataset"]})})]}),o.jsx(sf,{children:o.jsxs(mr,{children:[o.jsx(gNn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(xNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function LNn(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),r=Math.floor(t.length/2),n=r,s=t.length-r;if(n===0)return null;const a=(s-n)/n*100;return{changePct:Math.round(a*10)/10,prevValue:String(n)}}function $Nn({scorers:e,datasets:t,experiments:r,avgScore:n,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,h=t?.length,p=r?.length,m=n!=null&&s!=null&&s!==0?{changePct:Math.round((n-s)/s*100*10)/10,prevValue:String(s)}:null,g=LNn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Scorers"}),i?o.jsx(_n.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(f)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Datasets"}),l?o.jsx(_n.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(h)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Avg Score"}),u?o.jsx(_n.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(n)}),m?o.jsx(_n.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Experiments"}),c?o.jsx(_n.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(p)}),g?o.jsx(_n.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Needs Review"}),d?o.jsx(_n.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(a)}),a>0?o.jsx(_n.NoChange,{message:"items pending review"}):o.jsx(_n.NoChange,{message:"All caught up"})]}):o.jsx(_n.NoData,{})]})]})}const FNn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],qBe="auto 1fr auto auto auto auto auto auto auto";function zNn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const BNn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function UNn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=or(),u=b.useMemo(()=>{const h=new Map;return t?.forEach(p=>h.set(p.id,p.name)),h},[t]),d=b.useMemo(()=>[...e].sort((h,p)=>{const m=h.createdAt?new Date(h.createdAt).getTime():0;return(p.createdAt?new Date(p.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const h=s.toLowerCase();return d.filter(p=>{const m=p.datasetId?u.get(p.datasetId)??"":"",g=!h||p.id.toLowerCase().includes(h)||m.toLowerCase().includes(h)||(p.targetId??"").toLowerCase().includes(h),y=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&y&&x})},[d,s,u,a,i]);return n?o.jsx(bh,{columns:qBe}):o.jsxs(Se,{columns:qBe,children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Experiment"}),o.jsx(Se.TopCell,{children:"Dataset"}),o.jsx(Se.TopCell,{children:"Target"}),o.jsx(Se.TopCell,{children:"Status"}),o.jsx(Se.TopCell,{className:"text-center",children:"Items"}),o.jsx(Se.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Se.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Se.TopCell,{className:"text-center",children:"Review"}),o.jsx(Se.TopCell,{children:"Date"})]}),f.map(h=>{const p=h.datasetId?u.get(h.datasetId)??h.datasetId.slice(0,8):"—",m=h.status??"pending",g=h.succeededCount??0,y=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Se.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Se.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Se.TextCell,{children:p}),o.jsx(Se.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Se.Cell,{children:o.jsx(LP,{variant:BNn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Se.TextCell,{className:"text-center",children:x}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsx("span",{className:y>0?"text-accent2":"",children:y})}),o.jsx(Se.Cell,{className:"text-center",children:(()=>{const S=r?.get(h.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const k=S.needsReview+S.complete;return k===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(vt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(vt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Se.TextCell,{children:zNn(h.createdAt)})]},h.id)})]})}function VNn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const BL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},qNn=[{label:"Completed",color:BL.completed},{label:"Running",color:BL.running},{label:"Pending",color:BL.pending},{label:"Failed",color:BL.failed}];function HNn({experiments:e,datasets:t,isLoading:r,isError:n}){const{data:s,maxVal:a}=b.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const l=new Map;if(t)for(const f of t)l.set(f.id,f.name);const c=new Map;for(const f of e){const h=f.datasetId??"unknown";c.has(h)||c.set(h,{completed:0,running:0,pending:0,failed:0});const p=c.get(h),m=f.status;m in p&&p[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,h])=>{const p=h.completed+h.running+h.pending+h.failed;return p>u&&(u=p),{name:l.get(f)??f.slice(0,12),values:[h.completed,h.running,h.pending,h.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Qt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Qt.Loading,{}):n?o.jsx(Qt.Error,{message:"Failed to load experiments data"}):o.jsx(Qt.Content,{children:i?o.jsx(nE,{data:s,segments:qNn,maxVal:a,fmt:l=>String(l)}):o.jsx(Qt.NoData,{message:"No experiments have been run yet"})})]})}const QNn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(va,{})]})})})});function WNn({search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:l,hasActiveFilters:c}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Eg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...FNn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx($o,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(me,{onClick:l,size:"sm",variant:"light",children:[o.jsx(An,{className:"size-3"})," Reset"]})]})]})}function GNn(){const{data:e,isLoading:t,error:r}=fd(),{data:n,isLoading:s,error:a}=zh(),{data:i,isLoading:l,error:c}=rB(),{data:u,isLoading:d,isError:f,error:h}=eOn(),{data:p,isLoading:m,isError:g,error:y}=Ive(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>kNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Au,{}),children:o.jsx(na,{})}):k&&Os(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Au,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Au,{}),children:o.jsx(gu,{title:"Failed to load evaluation data",message:k.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(Au,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(Li,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(pie,{children:o.jsx($Nn,{scorers:e,datasets:x,experiments:w,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:S.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:l,isLoadingScores:d,isLoadingReview:m})}),o.jsx(V1n,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[o.jsx(Wjn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(HNn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(SNn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function ZNn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=zh(),{data:u,isLoading:d,error:f}=rB(),{data:h}=Ive(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>VNn(p),[p]),y=b.useMemo(()=>H1t(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(na,{})});if(f&&Os(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&Os(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(gu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Au,{}),children:o.jsx(QNn,{})});const S=r!=="all"||s!=="all"||e!=="",k=()=>{t(""),n("all"),a("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:x,children:[o.jsx(Au,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Experiments documentation",children:o.jsx(Li,{})})})]}),o.jsx(WNn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(UNn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function YNn(){const{experimentId:e}=ra(),{data:t,isLoading:r}=rB(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=W6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=tB({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):l&&Ps(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})}):l&&Os(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):l||!a?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Au,{})}),"Experiments"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(q1t,{experimentId:e,experiment:a}),o.jsx(V1t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function Q1t({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=EC(),{mutate:i,isPending:l,error:c}=rjn(),{mutate:u,isPending:d,error:f}=njn(),{mutate:h,isPending:p}=R1t(),[m,g]=b.useState(r),[y,x]=b.useState(""),[w,S]=b.useState(""),[k,_]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},F=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:M}):u({email:w,password:k,name:y||void 0},{onSuccess:M})},U=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(tx,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),n&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:n}),j&&o.jsxs("form",{onSubmit:F,className:"space-y-4",children:[!P&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),o.jsx(ar,{id:"name",type:"text",value:y,onChange:H=>x(H.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),o.jsx(ar,{id:"email",type:"email",value:w,onChange:H=>S(H.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),o.jsx(ar,{id:"password",type:"password",value:k,onChange:H=>_(H.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(me,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(me,{onClick:U,disabled:p,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),p?"Redirecting...":N.text||"Sign in"]})]})})}function XNn(){const[e]=ao(),t=fu(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(Q1t,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function KNn(){const[e,t]=ao(),r=mzr(e,t),n=vzr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=_ht(),{data:d=[],isPending:f}=Eht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Cht(),{data:m=[],isPending:g}=jht(),y=b.useMemo(()=>lzr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:h,loading:{tags:u,entityNames:f,serviceNames:g,environments:p}}),[c,d,m,h,u,f,g,p]),x=b.useMemo(()=>fzr({rootEntityType:r.selectedEntityOption?.entityType,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,tokens:r.filterTokens}),[r.filterTokens,r.selectedDateFrom,r.selectedDateTo,r.selectedEntityOption]),{data:w=[],isLoading:S,error:k,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T}=rzr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=wzr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:M}=Rme(r.featuredTraceId??null),{data:F,isLoading:U}=$S(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(hzr(y,r.filterTokens)),[y,r]),H=b.useCallback(()=>r.handleFeaturedChange({logId:null}),[r]),Q=b.useCallback(G=>r.handleFeaturedChange({traceId:G,spanId:null}),[r]),L=b.useCallback((G,J)=>r.handleFeaturedChange({traceId:G,spanId:J}),[r]),Z=b.useCallback(()=>{r.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[r]),V=b.useCallback(()=>r.handleFeaturedChange({spanId:null}),[r]),D=b.useCallback(G=>r.handleFeaturedChange({spanId:G??null}),[r]);if(k)return o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(WFr,{error:k,resource:"logs",errorTitle:"Failed to load logs"})});const W=r.filterTokens.length>0||r.datePreset!=="last-24h"||!!r.selectedDateTo;return w.length===0&&!S&&!W?o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(KFr,{})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:S,children:[o.jsx(YL,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(sht,{preset:r.datePreset,onPresetChange:r.handleDatePresetChange,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,onDateChange:r.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(oft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/logs/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(Li,{})})]})]}),o.jsx(YFr,{isLoading:S,filterFields:y,filterTokens:r.filterTokens,onFilterTokensChange:r.handleFilterTokensChange,onClear:z,onRemoveAll:r.handleRemoveAll,onSave:n.handleSave,onRemoveSaved:n.hasSavedFilters?n.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]}),o.jsx(GFr,{logCollapsed:i,listSlot:o.jsx(ZFr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(QFr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(gFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:M,onClose:Z,onSpanSelect:D,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(mFr,{spanId:r.featuredSpanId,span:F?.span,isLoading:U,onClose:V}):null})]})}const W1t=e=>{const t=Ge();return Ot({queryKey:["mcpserver-tools",e?.id],queryFn:async()=>{const n=(await t.getMcpServerTools(e?.id)).tools,s={};return n.forEach(a=>{s[a.id]=a}),s},retry:!1,refetchOnWindowFocus:!1})};function JNn({server:e}){const{paths:t,Link:r}=or(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=W1t(e),l=Object.values(i||{}),c=l.length,u=l.filter(h=>h.toolType==="agent").length,d=l.filter(h=>h.toolType==="workflow").length,f=Nh(e.name,50);return o.jsxs(Se.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Se.NameCell,{children:f}),o.jsx(Se.DescriptionCell,{children:a}),o.jsx(Se.TextCell,{className:"text-center",children:u||""}),o.jsx(Se.TextCell,{className:"text-center",children:c||""}),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]})}function eAn({mcpServers:e,isLoading:t,search:r=""}){const n=b.useMemo(()=>{const s=r.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,r]);return t?o.jsx(bh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"URL"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ma,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Tools",short:o.jsx(Mi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Workflows",short:o.jsx(Di,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Se.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(JNn,{server:s},s.id))]})}const tAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(va,{})]})})}),rAn=()=>{const{data:e=[],isLoading:t,error:r}=dM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(na,{})}):r&&Os(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(gu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(tAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(vl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(eAn,{mcpServers:e,isLoading:t,search:n})]})},nAn=(e,t)=>{const r=new Map,n=Object.keys(t);for(const s of n){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];r.has(u.id)||r.set(u.id,{...u,agents:[]}),r.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))r.has(a.id)||r.set(a.id,{...a,agents:[]});return Array.from(r.values())};function sAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>nAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(bh,{columns:"auto 1fr auto"}):o.jsxs(Se,{columns:"auto 1fr auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ma,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Se.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=Nh(c.id,50),d=Nh(c.description??"",200),f=c.agents.length;return o.jsxs(Se.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Se.NameCell,{children:u}),o.jsx(Se.DescriptionCell,{children:d}),o.jsx(Se.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const aAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(va,{})]})})}),iAn=()=>{const e=Ge();return Kr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new y_;Object.entries(n??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:r,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},oAn=({toolId:e})=>{const{canExecute:t}=Ev(),r=t("tools"),{data:n={}}=Ng(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const y=Object.values(g.tools).find(x=>x.id===e);if(y)return y}return null},[n,e]),{data:a,isLoading:i,error:l}=_kn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=iAn(),{requestContext:h}=ks();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const p=async(g,y)=>{if(!c)return;const x={...h??{},...y??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?fg(cg(nv(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(vve,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:p,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function lAn({value:e,onValueChange:t,placeholder:r="Select a tool...",searchPlaceholder:n="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=J8(),{data:h={},isLoading:p,isError:m,error:g}=Ng(),{navigate:y,paths:x}=or();b.useEffect(()=>{if(d){const _=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${_}`)}},[d,f]),b.useEffect(()=>{if(m){const _=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${_}`)}},[m,g]);const w=new Map;Object.values(h).forEach(_=>{_.tools&&Object.values(_.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(_=>{w.has(_.id)||w.set(_.id,_)});const S=Array.from(w.values()).map(_=>({label:_.id,value:_.id})),k=_=>{t?t(_):_&&_!==e&&y(x.toolLink(_))};return o.jsx(Kl,{options:S,value:e,onValueChange:k,placeholder:u||p?"Loading tools...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||p||d||m,variant:l})}const cAn=({isLoading:e,server:t})=>{const[{sseUrl:r,httpStreamUrl:n},s]=b.useState({sseUrl:"",httpStreamUrl:""});if(b.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,l=window.MASTRA_SERVER_PORT;let c=null;i&&l&&(c=`http://${i}:${l}`);const u=c||"http://localhost:4111",d=`${u}/api/mcp/${t.id}/sse`,f=`${u}/api/mcp/${t.id}/mcp`;s({sseUrl:d,httpStreamUrl:f})},[t]),e)return null;if(!t)return o.jsx(pf,{children:o.jsx(pe,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${r}`;return o.jsxs(pf,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(pe,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(vt,{icon:o.jsx(z9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(vt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(pe,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(pe,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(Ka,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(pe,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(Ka,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(pe,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(Ka,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(uAn,{server:t})})]})},uAn=({server:e})=>{const{data:t={},isLoading:r}=W1t(e);if(r)return null;const n=Object.keys(t);return o.jsxs("div",{className:"p-5 overflow-y-scroll",children:[o.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(vl,{})}),o.jsx(pe,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:n.map(s=>{const a=t[s];return o.jsx(dAn,{tool:a,serverId:e.id},s)})})]})},dAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=MSt[e.toolType||"tool"];return o.jsxs(kf,{onClick:()=>r.current?.click(),children:[o.jsx(Odt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(Cf,{children:[o.jsx(_f,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Ef,{children:e.description})]})]})},fAn=()=>{const{serverId:e}=ra(),{data:t=[],isLoading:r}=dM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(KSt,{value:e,variant:"ghost"})})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"MCP documentation"]})})]}),o.jsx(cAn,{isLoading:r,server:n})]})},G1t=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Ot({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},hAn=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Kr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},pAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Ev(),n=r("tools"),{data:s,isLoading:a,error:i}=G1t(t,e),{mutateAsync:l,isPending:c,data:u}=hAn(t,e);b.useEffect(()=>{if(i){const h=i instanceof Error?i.message:"Failed to load tool";ze.error(`Error loading tool: ${h}`)}},[i]);const d=async h=>{if(s)return await l(h)};if(a)return o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]});if(i)return null;if(!s)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!n)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=fg(cg(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(vve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},mAn=()=>{const{data:e}=dM(),{serverId:t,toolId:r}=ra(),{data:n,isLoading:s}=G1t(t,r),a=e?.find(c=>c.id===t),i=n?.name,l=a?.name||"";return s||!n?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(jr,{as:dr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"MCP documentation"]})})]}),o.jsx(pAn,{toolId:r,serverId:t})]})};function gAn(){const{data:e,isLoading:t,isError:r}=Y6r();return o.jsx(F6r,{data:e,isLoading:t,isError:r})}function yAn(){const{data:e,isLoading:t,isError:r}=yht();return o.jsx(Y9,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function vAn(){const{data:e,isLoading:t,isError:r}=W6r();return o.jsx(Y9,{label:"Total Model Cost",value:e?.cost!=null?Qw(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Qw(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function bAn(){const{data:e,isLoading:t,isError:r}=G6r();return o.jsx(Y9,{label:"Total Tokens",value:e?.value!=null?Fm(e.value):null,prevValue:e?.previousValue!=null?Fm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function xAn(){const{data:e,isLoading:t,isError:r}=Q6r();return o.jsx(Y9,{label:"Avg Score",value:e?.value!=null?String(e.value):null,prevValue:e?.previousValue!=null?String(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function wAn(){const{data:e,isLoading:t,isError:r}=Z6r();return o.jsx(z6r,{rows:e,isLoading:t,isError:r})}function SAn(){const{data:e,isLoading:t,isError:r}=K6r();return o.jsx(B6r,{data:e,isLoading:t,isError:r})}function OAn(){const{data:e,isLoading:t,isError:r}=J6r();return o.jsx(V6r,{data:e,isLoading:t,isError:r})}function kAn(){const{data:e,isLoading:t,isError:r}=X6r();return o.jsx(q6r,{data:e,isLoading:t,isError:r})}const _An=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),are="period";function EAn(){const[e,t]=ao(),r=e.get(are),n=pht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(are):l.set(are,a),l},{replace:!0})},[t]);return o.jsx(D6r,{initialPreset:n,onPresetChange:s,children:o.jsx(CAn,{})})}function CAn(){const{error:e}=yht(),{data:t,isLoading:r}=Q8(),n=t?.observabilityStorageType,s=n?_An.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(lk,{}),children:o.jsx(na,{})}):e&&Os(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(lk,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(lk,{}),children:o.jsx(gu,{title:"Failed to load metrics",message:e.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(lk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(L6r,{}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(Li,{})})]})]})}),r?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsxs(Bl,{variant:"info",children:[o.jsx(Ul,{children:"Metrics are not persisted"}),o.jsx($u,{as:"p",children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})]}),o.jsxs(pie,{children:[o.jsx(yAn,{}),o.jsx(vAn,{}),o.jsx(bAn,{}),o.jsx(xAn,{})]}),o.jsxs(pie,{children:[o.jsx(wAn,{}),o.jsx(OAn,{}),o.jsx(SAn,{}),o.jsx(kAn,{}),o.jsx(gAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(va,{})]})})})]})}const jAn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:lk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function TAn(){return o.jsxs(bk,{children:[o.jsx(bk.Top,{children:o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{children:[o.jsx(xo,{})," Observability"]})})})}),o.jsx("div",{className:"px-6 pt-6 overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:jAn.map(e=>o.jsxs(dr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const NAn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ma,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:Yi,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Di,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:nS,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:vl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Mi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:oc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:RE,href:"/request-context"}];function AAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(A2t,{})," Primitives"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:NAn.map(e=>o.jsxs(dr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function IAn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=BSt(),{isCmsAvailable:s}=uM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(na,{})}):n&&Os(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Zs,{resource:"prompt blocks"})}):n?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(gu,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(mkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:o.jsx(Li,{})}),s&&o.jsxs(me,{as:dr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(us,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(pkn,{promptBlocks:l,isLoading:r,search:a})]})}function RAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(RE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(ISn,{children:o.jsx(bSt,{})})})]})}const PAn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:QMt,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Li,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:va,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:sA,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:pVe,href:"https://mastra.ai/cloud",external:!0},{title:"Talk to our Sales team",description:"Get a custom demo, discuss on-prem deployments, and how we can help you accelerate getting agents into production.",icon:zPt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function MAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(Li,{})," Resources"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:PAn.map(e=>o.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&o.jsx(va,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function DAn(){const{data:e={},isLoading:t,error:r}=fd(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ps(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(na,{})});if(r&&Os(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(Zs,{resource:"scorers"})});if(r)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(gu,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(Da,{}),children:o.jsx(H1n,{})});const l=a!=="all"||n!=="",c=()=>{s(""),i("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(Da,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})})})]}),o.jsx(W1n,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(q1n,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function LAn(){const{scorerId:e}=ra(),[t,r]=ao(),n=t.get("scoreId")??void 0,[s,a]=b.useState(n),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=B1n(e),{data:f={},isLoading:h,error:p}=Ng(),{isLoading:m,error:g}=d0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=z1n({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(L=>f[L]).map(L=>({value:L,label:f[L].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(L=>({value:L,label:L,type:"WORKFLOW"}))||[],[c?.workflowIds]),j=b.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,...T],[E,T]),N=t.get("entity")??"all",I=j.find(L=>L.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const L=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${L}`)}},[d]),b.useEffect(()=>{if(p){const L=p instanceof Error?p.message:"Failed to load agents";ze.error(`Error loading agents: ${L}`)}},[p]),b.useEffect(()=>{if(g){const L=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${L}`)}},[g]);const P=L=>{L?.value&&r(Z=>{const V=new URLSearchParams(Z);return V.set("entity",L.value),V})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}y.find(V=>V.id===L)&&a(L)},[t,y]);const R=b.useCallback(L=>{a(L||void 0),r(Z=>{const V=new URLSearchParams(Z);return L?V.set("scoreId",L):V.delete("scoreId"),V})},[r]);if(!c)return null;const B=Ps(d)||Ps(p)||Ps(g),M=d&&Os(d),F=!B&&!M&&(d||p||g),U=!x&&y.length===0,z=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Ya,{children:[o.jsx(jr,{as:dr,to:"/scorers",children:"Scorers"}),o.jsx(U1n,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(bn,{children:[o.jsxs(bn.Title,{isLoading:u,children:[o.jsx(Da,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(bn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Scorers documentation",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})}),c?.scorer?.source==="stored"&&o.jsxs(me,{variant:"light",as:dr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(cv,{})," Edit"]})]})]})]});if(B||M||F||U&&!z){const L=(d instanceof Error?d.message:void 0)??(p instanceof Error?p.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{children:H}),o.jsx(bt.MainArea,{isCentered:!0,children:B?o.jsx(na,{}):M?o.jsx(Zs,{resource:"scorers"}):F?o.jsx(gu,{title:"Failed to load scorer",message:L}):o.jsx(R1n,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(D1n,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Z=new URLSearchParams(L);return Z.set("entity","all"),Z})},isLoading:x||h||m})]}),o.jsx(I1n,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const $An=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],FAn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=ove(),{theme:n,setTheme:s}=xC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(fme,{})," Settings"]})})}),o.jsxs(bt.MainArea,{className:"grid gap-8 mt-6",children:[o.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),o.jsx(bft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:$An.map(a=>({...a}))})]})}),o.jsx(SSt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function zAn(){const[e]=ao(),t=fu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(Q1t,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function BAn(e){return e.replace(/\/$/,"").split("/").pop()}function sB({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function UAn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Y("grid gap-y-4",r),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",r),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(ma,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Mi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(SVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(fF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(vl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(hdt,{})," ",BAn(a.githubUrl)]})})]},a.slug)})})}function VAn({tagOptions:e,selectedTag:t,providerOptions:r,selectedProvider:n,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(jx,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx($o,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx($o,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(me,{onClick:c,children:["Reset ",o.jsx(An,{})]})]})}function qAn(){const{data:e,isLoading:t}=Tzr(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(""),f=[{value:"all",label:"Any tag"}];(n||[]).forEach(w=>{f.push({value:w,label:w})});const h=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{h.push({value:w,label:w})});const p=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},y=r.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||l!=="all"&&!w.supportedProviders.includes(l))),x=u||a!=="all"||l!=="all";return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Zu,{children:[o.jsx(Ce,{children:o.jsx(qb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(VAn,{selectedTag:a,onTagChange:w=>p(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>p(w,"provider"),providerOptions:h,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(UAn,{templates:y,linkComponent:dr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const HAn="1.29.0-alpha.5";function QAn({errorMsg:e,validationErrors:t}){const r=typeof e=="string"?e:e!=null?String(e):void 0,n=r?.includes("Invalid schema for function"),s=r?.includes("validation issue")||t&&t.length>0,a=()=>s?"Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.":n?"There was an issue with the AI model configuration. This may be related to the selected model or AI SDK version compatibility.":"An unexpected error occurred during template installation.",i=()=>s?{icon:o.jsx(kh,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(b2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(sB,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),r&&!s&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left",children:o.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:r})})]})]})}function WAn({providerOptions:e,selectedProvider:t,onProviderChange:r,variables:n,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(sB,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(OVe,{})]}),o.jsx($o,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:r,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(n||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Mt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(Cx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(Cx,{name:h,labelIsHidden:!0,label:"Value",value:p,onChange:i,errorMsg:s.includes(h)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},h))}),o.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[o.jsx("div",{className:"absolute w-8 h-8 rounded-full bg-surface2 top-0 left-1/2 -translate-x-1/2 -translate-y-4 text-ui-sm text-neutral3 flex items-center justify-center",children:"And"}),o.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),o.jsx("p",{className:"text-neutral3 text-ui-md mt-2 mb-8",children:"This model will be used by the workflow to process and install the template"}),o.jsx(xSt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(me,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(Fw,{})]})})]})})}function GAn({title:e,description:t,githubUrl:r,isLoading:n,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[o.jsx(qb,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":n}),children:n?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":n}),children:n?o.jsx(o.Fragment,{children:" "}):t}),!n&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(Vy,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lF,{className:"w-[1em] h-[1em] text-neutral4"}),o.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),o.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Branch name:"})," ",o.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),o.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),r&&o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(hdt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(E1,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function ZAn({name:e,streamResult:t,workflowInfo:r}){const n=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,l=s?.steps||{},c=Object.keys(l).length>0,u=m=>m==="input"||m.endsWith(".input")||m.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(m)||/[0-9a-f]{8,}/.test(m)?!1:r?.allSteps?m in r.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,h=()=>{switch(n){case"initializing":return"Preparing template installation...";case"processing":return`Installing ${e} template`;case"completed":return"Template installation completed!";case"error":return"Template installation failed";default:return"Installing template..."}},p=d.map(([m,g])=>({id:m,status:g?.status,description:g?.description,title:m.charAt(0).toUpperCase()+m.slice(1).replace(/-/g," "),isActive:a?.id===m}));return o.jsxs(sB,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:h()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(n)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(N3r,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(fDt,{}),i||"Something went wrong"]}),c&&o.jsx(T3r,{steps:p,currentStep:a,className:"pb-4"}),!c&&n==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Mt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function YAn({name:e,installedEntities:t}){return o.jsxs(sB,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(OVe,{}),o.jsx("h2",{className:"text-header-md",children:"Done!"}),o.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",o.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&o.jsx(E1,{data:t})]})}function XAn(){const{templateSlug:e}=ra(),[t,r]=ao(),[n,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,h]=b.useState([]),[p,m]=b.useState(null),[g,y]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=Nzr({repoOrSlug:e,owner:"mastra-ai"}),R=HAn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=Azr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:F,isLoading:U}=Izr(),{mutateAsync:z,isPending:H}=Rzr(),{mutateAsync:Q}=Pzr(),{streamInstall:L,streamResult:Z,isStreaming:V}=Dzr(F),{observeInstall:D,streamResult:W,isStreaming:G}=Lzr(F);b.useEffect(()=>{const se=t.get("runId");se&&!g&&!p&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:se}),w(se),Q({runId:se}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)y(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ce,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ce} validation issue${ce>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ce=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ce=="string"?ce:String(ce))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,V,G,Q]),b.useEffect(()=>{const se=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(se&&le==="true"&&xe&&!V&&!G&&!S&&!_&&F){w(se),k(!0);try{Q({runId:se}).then(ue=>{if(ue.snapshot?.status==="running")return D.mutateAsync({runId:se})}).then(()=>{r(ue=>{const ce=new URLSearchParams(ue);return ce.delete("resume"),ce})}).catch(ue=>{console.error("❌ Failed to resume template installation:",ue),ue.message?.includes("404")||ue.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(ue){console.error("❌ Auto-resume failed with error:",ue),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,S,_,F,Q,D,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(se=>se).join(", "):"n/a",icon:o.jsx(Mi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(se=>se).join(", "):"n/a",icon:o.jsx(ma,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(fF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Nm,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(ME,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(se=>se.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const se=Z||W;se?.phase==="error"&&se?.error&&m(typeof se.error=="string"?se.error:String(se.error))},[Z?.phase,Z?.error,W?.phase,W?.error]);const re=se=>{s(se)},ie=async se=>(i(se.provider),c(se.modelId),{message:"Model updated successfully"}),fe=async()=>{const se=Object.entries(u).reduce((le,[xe,ue])=>(ue===""&&le.push(xe),le),[]);if(se.length>0){h(se);return}if(N){m(null),y(!1),w(""),E(!0);try{const xe={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:ue}=await z({});w(ue),r(ce=>{const ve=new URLSearchParams(ce);return ve.set("runId",ue),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:ue})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=se=>{const{name:le,value:xe}=se.target;xe.trim()===""?h(ue=>[...ue,le]):h(ue=>ue.filter(ce=>ce!==le)),d(ue=>({...ue,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(qb,{})}),"Templates"]}),o.jsx(jr,{as:dr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(GAn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||G)&&o.jsx(ZAn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:F}),g&&o.jsx(YAn,{name:N.title,installedEntities:te,linkComponent:dr}),p&&o.jsx(QAn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(WAn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:fe,handleVariableChange:X,isLoadingEnvVars:M||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const KAn=()=>{const{toolId:e,agentId:t}=ra();return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ma,{})}),"Agents"]}),o.jsx(jr,{as:dr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:dr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(u0,{})}),"Tools documentation"]})})]}),o.jsx(xOn,{toolId:e,agentId:t})]})},JAn=()=>{const{toolId:e}=ra();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(lAn,{value:e,variant:"ghost"})})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"Tools documentation"]})})]}),o.jsx(oAn,{toolId:e})]})};function eIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function tIn({feedback:e,isOpen:t,onClose:r,onNext:n,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Vt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:r,level:3,children:[o.jsxs(Vt.Top,{children:[o.jsxs(Zn,{children:[o.jsx(sA,{})," Feedback"]}),"|",o.jsx(Vt.Nav,{onNext:n,onPrevious:s})]}),o.jsxs(Vt.Content,{children:[o.jsxs(Vt.Header,{children:[o.jsxs(Vt.Heading,{children:[o.jsx(sA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(x_,{})," ",e.traceId]})]}),o.jsxs(Tx,{children:[o.jsx(E1,{data:[{label:"Created at",value:e?.timestamp?tr(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?eIn(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(x_,{}),codeStr:a,simplified:!0})]})]})]})}const UL=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function rIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function nIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function Z1t({feedbackData:e,isLoadingFeedbackData:t,onPageChange:r}){const[n,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=h=>{i(l[h]),s(!0)};if(t)return o.jsx(gft,{columns:UL});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(fa,{children:[o.jsxs(fa.Trim,{children:[o.jsx(fa.Header,{columns:UL}),l.length>0?o.jsx(fa.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=kg(m),y={id:`${h.traceId}-${p}`,source:h.feedbackUserId||h.feedbackSource||"unknown",date:g?"Today":tr(m,"MMM dd"),time:tr(m,"h:mm:ss aaa"),value:rIn(h),comment:nIn(h)};return o.jsx(fa.Entry,{columns:UL,onClick:()=>c(p),entry:y,children:UL.map(x=>o.jsx(fa.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(fa.Message,{message:"No feedback found",type:"info"})]}),o.jsx(fa.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const h=e?.pagination?.page||0;h>0&&r?.(h-1)}})]}),o.jsx(tIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const Y1t=({traceId:e="",page:t})=>{const r=Ge(),n=t??0;return Ot({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})},HBe="auto auto auto auto 1fr";function X1t({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(Z9,{columns:HBe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Rc,{columns:HBe,className:"min-w-0",children:[o.jsxs(Rc.Top,{children:[o.jsx(Rc.TopCell,{children:"ID"}),o.jsx(Rc.TopCell,{children:"Date"}),o.jsx(Rc.TopCell,{children:"Time"}),o.jsx(Rc.TopCell,{children:"Score"}),o.jsx(Rc.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=kg(a);return o.jsxs(Rc.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Rc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:nf(s?.id)||"n/a"}),o.jsx(Rc.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Rc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Rc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Rc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Rc.NoMatch,{message:"No scores found"})]}),o.jsx(Rc.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}function sIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=BFr(e,t,{onRemoveAll:()=>n(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,h]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:p,isLoading:m}=fd(),{data:g,isLoading:y}=gve({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:k}=Y1t({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Rme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=$S(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ce=>ce.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=_ht(),{data:B=[],isPending:M}=Eht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:F=[],isPending:U}=Cht(),{data:z=[],isPending:H}=jht(),Q=b.useMemo(()=>RFr({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:F,loading:{tags:R,entityNames:M,serviceNames:H,environments:U}}),[P,B,z,F,R,M,H,U]),L=b.useMemo(()=>LFr({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:Z,isLoading:V,isFetchingNextPage:D,hasNextPage:W,setEndOfListElement:G,error:J}=EFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Tht(T,s.spanIdParam??null,ce=>s.handleSpanChange(ce)),fe=qFr(e,t),X=b.useCallback(()=>s.applyFilterTokens($Fr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=FFr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ce=T?.find(ve=>ve.parentSpanId==null);ce&&(s.handleSpanChange(ce.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(kht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const ue=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(sht,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(oft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Cn,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ce=>!ce),children:r?o.jsx(m3,{}):o.jsx(bVe,{})}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})})]})]}),o.jsx(cFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:fe.handleSave,onRemoveSaved:fe.hasSavedFilters?fe.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(yFr,{traceCollapsed:u,listSlot:o.jsx(bFr,{traces:ae,isLoading:V,isFetchingNextPage:D,hasNextPage:W,setEndOfListElement:G,filtersApplied:ue,featuredTraceId:s.traceIdParam,onTraceClick:ce=>s.handleTraceClick(s.traceIdParam===ce.traceId?"":ce.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(Sht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ce=>s.handleSpanChange(ce??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ce=>h(ce),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:E8,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(Oht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ce=>s.handleSpanTabChange(ce),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(Z1t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ce,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(_ve,{traceId:ve,isTopLevelSpan:!ce.parentSpanId,spanId:we,entityType:ce.attributes?.agentId||ce.entityType===Do.AGENT?"Agent":ce.attributes?.workflowId||ce.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(X1t,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(pve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(Eve,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function aIn(){const{traceId:e}=ra(),[t,r]=ao(),n=fu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[h,p]=b.useState(i),[m,g]=b.useState(0),[y,x]=b.useState(!1),{data:w,isLoading:S,error:k}=Rme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=$S(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=fd(),{data:P,isLoading:R}=gve({traceId:e,spanId:c??void 0,page:m}),[B,M]=b.useState(0);b.useEffect(()=>M(0),[e,c]);const{data:F,isLoading:U}=Y1t({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[fe,X]of Object.entries(re))X===null||X===""?ie.delete(fe):ie.set(fe,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,fe=ie===c;u(ie),fe||(f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Q=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),L=b.useCallback(re=>{u(re),f(void 0),p("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Z,handleNextSpan:V}=Tht(_,c,L),D=b.useCallback(re=>{const ie=re;p(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),G=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{n("/observability")},[n]),ae=b.useCallback(()=>{p("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(me,{as:E8,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(_p,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:S,children:[o.jsx(xo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(bt.Column,{children:o.jsxs(ps,{children:[o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Cn,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(p3,{}),"Evaluate"]}),o.jsxs(Cn,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(nu,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(bht,{rootSpan:E,numOfCol:3})})})]});return k?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:te}),o.jsx(bt.MainArea,{isCentered:!0,children:o.jsx(kht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(Eve,{rootSpanId:E?.spanId,traceId:e,isOpen:y,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(Sht,{traceId:e,spans:_,isLoading:S,onClose:J,onSpanSelect:H,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(Oht,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Q,onPrevious:Z,onNext:V,activeTab:h,onTabChange:D,feedbackTabBadge:F?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(Z1t,{feedbackData:F,onPageChange:M,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:fe})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(_ve,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:fe,entityType:re.attributes?.agentId||re.entityType===Do.AGENT?"Agent":re.attributes?.workflowId||re.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(X1t,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(pve,{score:d,onClose:G})]})]})]})}function iIn(){const{data:e,isLoading:t,error:r}=d0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(na,{})}):r&&Os(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Zs,{resource:"workflows"})}):r?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(gu,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Qhn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(Hhn,{workflows:e||{},isLoading:t,search:n})]})}const QBe=()=>{const{workflowId:e}=ra(),{data:t,isLoading:r,error:n}=BP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})}):n&&Os(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Twt,{workflowId:e,workflow:t??void 0,isLoading:r})};function oIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(mdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(pdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(gdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(yU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Fre,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Ta,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(oc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Fre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(yU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(yU,{className:"h-4 w-4 text-neutral4"})}}function K1t(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?oIn(s):t?o.jsx(IE,{className:"h-4 w-4 text-amber-400"}):o.jsx(oc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(hx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(_R,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(Yi,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(ace,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(nce,{className:"h-4 w-4 text-neutral4"})}}function J1t(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+J1t(-e);if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1);return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function lIn(e){if("body"in e&&e.body&&typeof e.body=="object"){const n=e.body;if(typeof n.error=="string")return n.error;if(typeof n.message=="string")return n.message}const t=e.message,r=t.lastIndexOf(" - {");if(r!==-1)try{const n=t.slice(r+3),s=JSON.parse(n);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function eOt(e){return e==="."||e===""}function cIn({path:e,onNavigate:t}){const n=eOt(e)?[]:e.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[o.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:o.jsx(IE,{className:"h-4 w-4"})}),n.map((s,a)=>{const i=n.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("button",{onClick:()=>t(i),className:"px-2 py-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors truncate max-w-[150px]",title:s,children:s})]},i)})]})}function uIn({entries:e,currentPath:t,isLoading:r,error:n,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[h,p]=b.useState(null),m=[...e].sort((w,S)=>w.type==="directory"&&S.type!=="directory"?-1:w.type!=="directory"&&S.type==="directory"?1:w.name.localeCompare(S.name)),g=eOt(t),y=w=>{const S=g?w.name:`${t}/${w.name}`;w.type==="directory"?s(S):a?.(S)},x=w=>{const S=g?w.name:`${t}/${w.name}`;p(S)};return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsx(cIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(me,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(ER,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(me,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):o.jsx(oF,{className:"h-4 w-4"})}),l&&o.jsx(me,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(dF,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Na,{className:"h-6 w-6 animate-spin text-neutral3"})}):n?o.jsxs("div",{className:"py-12 px-4 text-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:o.jsx(nA,{className:"h-6 w-6 text-red-400"})}),o.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),o.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:lIn(n)})]}):m.length===0?o.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):o.jsx(ld,{children:o.jsxs("ul",{children:[!g&&o.jsx("li",{children:o.jsxs("button",{onClick:()=>{const w=t.split("/").slice(0,-1).join("/")||".";s(w)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[o.jsx(IE,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(w=>{const S=w.mount?.displayName||w.mount?.provider,k=w.mount?.status==="error";return o.jsx("li",{className:"group",children:o.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:()=>y(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[K1t(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&k&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(nA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Wr,{className:"max-w-xs",children:[o.jsx("span",{className:"text-red-400",children:"Error:"})," ",w.mount.error||"Failed to connect to this filesystem"]})]}),w.mount&&S&&(w.mount.description?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Wr,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})),w.type==="file"&&w.size!==void 0&&o.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:J1t(w.size)})]}),u&&!w.mount&&o.jsx("button",{onClick:()=>x(w),"aria-label":`Delete ${w.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:o.jsx(nd,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx(Bt,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsxs(Bt.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{disabled:f,children:"Cancel"}),o.jsxs(Bt.Action,{disabled:f,onClick:async()=>{try{h&&u&&await u(h)}finally{p(null)}},children:[f?o.jsx(Na,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function dIn(e){return e&&{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",mdx:"mdx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",css:"css",scss:"scss",less:"less",html:"html",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte"}[e.toLowerCase()]||null}function fIn({content:e,language:t}){return o.jsx(rve,{language:t,style:nve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function hIn({path:e,content:t,isLoading:r,mimeType:n,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=n?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=dIn(i);return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[K1t({name:a,type:"file"}),o.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ka,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(me,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Na,{className:"h-6 w-6 animate-spin text-neutral3"})}):l?o.jsx("div",{className:"p-4 flex items-center justify-center",children:o.jsx("img",{src:`data:${n||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(fIn,{content:t,language:c}):o.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const pIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),mIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(TMt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),gIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(nA,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),ire={bm25:{label:"Keyword",icon:o.jsx(Yi,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:o.jsx(w_,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:o.jsx(pLt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function tOt(e){return e.id.replace(/#chunk-\d+$/,"")}function yIn({onSearch:e,isSearching:t,searchResults:r,canBM25:n,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>n&&s?"hybrid":n?"bm25":s?"vector":"bm25",[f,h]=b.useState(d()),p=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...n?["bm25"]:[],...s?["vector"]:[],...n&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:p,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(PE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(ar,{value:i,onChange:g=>l(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),o.jsx(ar,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(me,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&o.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const y=ire[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
558
558
  inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors
559
559
  ${x?y.color:"bg-surface2 text-neutral4 border-transparent hover:bg-surface3"}
560
560
  `,children:[y.icon,y.label]},g)})})]}),r&&o.jsxs("div",{className:"border-t border-border1",children:[o.jsxs("div",{className:"px-4 py-2 flex items-center justify-between text-xs",children:[o.jsxs("span",{className:"text-neutral4",children:[r.results.length," result",r.results.length!==1?"s":"",' for "',o.jsx("span",{className:"text-neutral6",children:r.query}),'"']}),o.jsx("span",{className:`px-1.5 py-0.5 rounded ${ire[r.mode].color}`,children:ire[r.mode].label})]}),r.results.length===0?o.jsx("div",{className:"px-4 py-8 text-center text-neutral4 text-sm",children:"No results found. Try a different query."}):o.jsx("ul",{className:"max-h-[320px] overflow-auto",children:r.results.map((g,y)=>o.jsx(vIn,{result:g,rank:y+1,onClick:()=>a?.(tOt(g))},`${g.id}-${y}`))})]})]})}function vIn({result:e,rank:t,onClick:r}){const n=Math.min(100,Math.max(0,e.score*100)),s=tOt(e);return o.jsx("li",{className:"border-t border-border1 first:border-t-0",children:o.jsxs("button",{onClick:r,className:"w-full px-4 py-3 text-left hover:bg-surface5 transition-colors flex gap-3",children:[o.jsx("span",{className:"text-xs text-neutral3 tabular-nums w-4 shrink-0",children:t}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(IE,{className:"h-3.5 w-3.5 text-neutral4 shrink-0"}),o.jsx("span",{className:"font-mono text-sm text-neutral6 truncate",children:s}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.jsx("div",{className:"w-12 h-1 rounded-full bg-surface2 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full bg-accent1",style:{width:`${n}%`}})}),o.jsx("span",{className:"text-ui-xs text-neutral3 tabular-nums",children:e.score.toFixed(2)})]})]}),o.jsx("p",{className:"text-xs text-neutral4 line-clamp-2",children:e.content}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-1",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function bIn({onSearch:e,results:t,isSearching:r,onResultClick:n}){const[s,a]=b.useState(""),[i,l]=b.useState(5),[c,u]=b.useState(!0),d=f=>{f.preventDefault(),s.trim()&&e({query:s.trim(),topK:i,includeReferences:c})};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("form",{onSubmit:d,className:"space-y-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(PE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx("input",{type:"text",value:s,onChange:f=>a(f.target.value),placeholder:"Search across skills...",className:"w-full pl-10 pr-4 py-2 rounded-lg bg-surface3 border border-border1 text-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(me,{type:"submit",disabled:!s.trim()||r,children:r?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):"Search"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[o.jsxs("label",{className:"flex items-center gap-2 text-neutral4",children:[o.jsx("span",{children:"Results:"}),o.jsxs("select",{value:i,onChange:f=>l(Number(f.target.value)),className:"px-2 py-1 rounded bg-surface3 border border-border1 text-neutral5",children:[o.jsx("option",{value:3,children:"3"}),o.jsx("option",{value:5,children:"5"}),o.jsx("option",{value:10,children:"10"}),o.jsx("option",{value:20,children:"20"})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-neutral4 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:c,onChange:f=>u(f.target.checked),className:"rounded border-border1 bg-surface3"}),o.jsx("span",{children:"Include references"})]})]})]}),t.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5",children:["Found ",t.length," result",t.length!==1?"s":""]}),o.jsx("div",{className:"space-y-2",children:t.map((f,h)=>o.jsx(xIn,{result:f,onClick:()=>n?.(f)},`${f.skillName}-${f.source}-${h}`))})]})]})}function xIn({result:e,onClick:t}){const r=e.source!=="SKILL.md";return o.jsx("button",{onClick:t,className:"w-full p-4 rounded-lg bg-surface3 border border-border1 hover:border-accent1/50 text-left transition-colors",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5 shrink-0 mt-0.5",children:r?o.jsx(Yi,{className:"h-3.5 w-3.5 text-neutral4"}):o.jsx(bC,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"font-medium text-neutral6",children:e.skillName}),o.jsx("span",{className:"text-xs text-neutral3",children:e.source}),o.jsxs("span",{className:"ml-auto text-xs text-neutral3",children:["Score: ",e.score.toFixed(3)]})]}),o.jsxs("p",{className:"text-sm text-neutral4 line-clamp-3 whitespace-pre-wrap",children:[e.content.slice(0,300),e.content.length>300&&"..."]}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-2",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function wIn({skillName:e,onUpdate:t,isUpdating:r}){return o.jsx(jn,{variant:"light",size:"sm",disabled:r,tooltip:`Update ${e}`,onClick:t,children:r?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):o.jsx(Pk,{className:"h-4 w-4"})})}function SIn({skillName:e,onRemove:t,isRemoving:r}){return o.jsxs(Bt,{children:[o.jsx(Bt.Trigger,{asChild:!0,children:o.jsx(jn,{variant:"light",size:"sm",disabled:r,tooltip:`Remove ${e}`,children:r?o.jsx(Na,{className:"h-4 w-4 animate-spin"}):o.jsx(nd,{className:"h-4 w-4"})})}),o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Remove Skill"}),o.jsxs(Bt.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:t,children:"Remove"})]})]})]})}const OIn=".agents/skills/",Rve=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],rOt=[...Rve,{name:"actions",label:"",size:"48px"}];function kIn(e,t){if(!e||!t||t.length===0)return null;for(const r of t)if(e.startsWith(r+"/")||e===r)return r;return null}function _In({skills:e,isLoading:t,isSkillsConfigured:r=!0,hasUndiscoveredAgentSkills:n=!1,basePath:s="/workspace/skills",onAddSkill:a,onUpdateSkill:i,onRemoveSkill:l,updatingSkillName:c,removingSkillName:u,mountPaths:d}){const{navigate:f}=or(),h=d&&d.length>0,p=w=>w.path?.includes(OIn)??!1,m=e.some(p),g=!!l||!!i,y=g&&m,x=y?rOt:Rve;return!r&&!t?o.jsx(CIn,{onAddSkill:a}):t?o.jsx(EIn,{hasRowActions:g}):o.jsxs("div",{className:"space-y-4",children:[a&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(me,{variant:"default",size:"sm",onClick:a,children:[o.jsx(Ce,{children:o.jsx(us,{className:"h-4 w-4"})}),"Add Skill"]})}),n&&o.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[o.jsx(kh,{className:"h-5 w-5 text-amber-500 shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"font-medium text-amber-500",children:"Skills installed but not discovered"}),o.jsxs("p",{className:"text-neutral4 mt-1",children:["You have skills in ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4 text-xs",children:".agents/skills"})," that aren't being discovered. Add this path to your workspace skills configuration to see them."]})]})]}),o.jsx(fa,{children:o.jsxs(fa.Trim,{children:[o.jsx(fa.Header,{columns:x}),e.length>0?o.jsx(fa.Entries,{children:e.map(w=>{const S={id:w.path,name:w.name,description:w.description||"—"},k=h?kIn(w.path,d):null;return o.jsxs(fa.Entry,{entry:S,columns:x,onClick:()=>{const _=`${s}/${encodeURIComponent(w.name)}?path=${encodeURIComponent(w.path)}`;f(_)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(bC,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"font-medium text-neutral6",children:w.name}),w.path&&o.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[k&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral3 shrink-0",children:k}),o.jsx("span",{className:"text-[11px] text-neutral3 truncate",title:w.path,children:w.path})]})]})]}),o.jsx(fa.EntryText,{children:w.description||"—"}),y&&o.jsx("div",{className:"flex justify-end gap-1",onClick:_=>_.stopPropagation(),children:p(w)&&o.jsxs(o.Fragment,{children:[i&&o.jsx(wIn,{skillName:w.name,onUpdate:()=>i(w.name),isUpdating:c===w.name}),l&&o.jsx(SIn,{skillName:w.name,onRemove:()=>l(w.name),isRemoving:u===w.name})]})})]},w.path)})}):o.jsx(fa.Message,{message:a?'No skills discovered. Click "Add Skill" to install from skills.sh.':"No skills discovered. Add SKILL.md files to your skills directory."})]})})]})}function EIn({hasRowActions:e}){const t=e?rOt:Rve;return o.jsx(fa,{children:o.jsxs(fa.Trim,{children:[o.jsx(fa.Header,{columns:t}),o.jsx(fa.Entries,{children:Array.from({length:3}).map((r,n)=>o.jsxs(fa.Entry,{columns:t,isLoading:!0,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-7 w-7 rounded bg-surface4 animate-pulse"}),o.jsxs("div",{children:[o.jsx("div",{className:"h-4 w-32 rounded bg-surface4 animate-pulse"}),o.jsx("div",{className:"h-3 w-40 rounded bg-surface4 animate-pulse mt-1"})]})]}),o.jsx("div",{className:"h-4 w-48 rounded bg-surface4 animate-pulse"}),e&&o.jsx("div",{className:"h-4 w-6 rounded bg-surface4 animate-pulse"})]},n))})]})})}function CIn({onAddSkill:e}){return o.jsx("div",{className:"grid place-items-center py-16",children:o.jsxs("div",{className:"flex flex-col items-center text-center max-w-md",children:[o.jsx("div",{className:"p-4 rounded-full bg-surface4 mb-4",children:o.jsx(bC,{className:"h-8 w-8 text-neutral3"})}),o.jsx("h2",{className:"text-lg font-medium text-neutral6 mb-2",children:"Skills Not Configured"}),o.jsx("p",{className:"text-sm text-neutral4 mb-6",children:"No skills are configured in the workspace. Add SKILL.md files to your skills directory to discover and manage agent skills."}),o.jsxs("div",{className:"flex gap-3",children:[e&&o.jsxs(me,{size:"lg",variant:"default",onClick:e,children:[o.jsx(Ce,{children:o.jsx(us,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),o.jsxs(me,{size:"lg",variant:"light",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(NPt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function jIn(e){switch(e.type){case"external":return{icon:o.jsx(qb,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:o.jsx(L2t,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:o.jsx(XL,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function TIn({skill:e,rawSkillMd:t,onReferenceClick:r}){const[n,s]=b.useState(new Set(["instructions"])),[a,i]=b.useState(!1),l=jIn(e.source),c=u=>{s(d=>{const f=new Set(d);return f.has(u)?f.delete(u):f.add(u),f})};return o.jsxs("div",{className:"space-y-6 min-w-0 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"p-3 rounded-lg bg-surface5",children:o.jsx(bC,{className:"h-6 w-6 text-neutral4"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:e.name}),o.jsx("p",{className:"text-sm text-neutral4 mt-1",children:e.description})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[o.jsx(TT,{label:"Source",value:l.label,icon:l.icon}),o.jsx(TT,{label:"Path",value:e.path,icon:o.jsx(IE,{className:"h-3.5 w-3.5"})}),e.license&&o.jsx(TT,{label:"License",value:e.license}),e.compatibility!=null&&o.jsx(TT,{label:"Compatibility",value:e.compatibility}),o.jsx(TT,{label:"References",value:`${e.references.length} files`,icon:o.jsx(Yi,{className:"h-3.5 w-3.5"})})]}),o.jsx(VL,{title:"Instructions",isExpanded:n.has("instructions"),onToggle:()=>c("instructions"),headerAction:o.jsxs("button",{onClick:u=>{u.stopPropagation(),i(!a)},className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs text-neutral4 hover:text-neutral5 hover:bg-surface4 transition-colors",title:a?"Show rendered":"Show source",children:[a?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(t2t,{className:"h-3.5 w-3.5"}),a?"Rendered":"Source"]}),children:a?o.jsx("div",{style:{backgroundColor:"black"},className:"rounded-lg overflow-x-auto w-0 min-w-full",children:o.jsx(rve,{language:"markdown",style:nve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):o.jsx(rE,{children:e.instructions})}),e.references.length>0&&o.jsx(VL,{title:`References (${e.references.length})`,isExpanded:n.has("references"),onToggle:()=>c("references"),children:o.jsx("div",{className:"space-y-1",children:e.references.map(u=>o.jsxs("button",{onClick:()=>r?.(u),className:"flex items-center gap-2 w-full px-3 py-2 rounded hover:bg-surface4 text-left transition-colors",children:[o.jsx(Yi,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.scripts.length>0&&o.jsx(VL,{title:`Scripts (${e.scripts.length})`,isExpanded:n.has("scripts"),onToggle:()=>c("scripts"),children:o.jsx("div",{className:"space-y-1",children:e.scripts.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(CMt,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&o.jsx(VL,{title:`Assets (${e.assets.length})`,isExpanded:n.has("assets"),onToggle:()=>c("assets"),children:o.jsx("div",{className:"space-y-1",children:e.assets.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(ace,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),o.jsx("div",{className:"pt-4 border-t border-border1",children:o.jsxs("p",{className:"text-xs text-neutral3",children:["Path: ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4",children:e.path})]})})]})}function nOt(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(t=>typeof t=="string"?t:JSON.stringify(t)).join(", ");if(typeof e=="object"&&e!==null){const t=Object.keys(e);if(t.length===0)return"{}";if(t.length===1){const r=t[0],n=e[r];return Array.isArray(n)?`${r}: ${n.join(", ")}`:`${r}: ${nOt(n)}`}return`{${t.join(", ")}}`}return String(e)}function TT({label:e,value:t,icon:r}){const n=nOt(t);return o.jsxs("div",{className:"p-3 rounded-lg bg-surface3",children:[o.jsx("p",{className:"text-xs text-neutral3 mb-1",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[r&&o.jsx("span",{className:"text-neutral4",children:r}),o.jsx("p",{className:"text-sm font-medium text-neutral5 truncate",title:n,children:n})]})]})}function VL({title:e,isExpanded:t,onToggle:r,headerAction:n,children:s}){return o.jsxs("div",{className:"border border-border1 rounded-lg overflow-hidden min-w-0",children:[o.jsxs("div",{className:"flex items-center bg-surface3 hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:r,className:"flex items-center gap-2 flex-1 px-4 py-3",children:[t?o.jsx(as,{className:"h-4 w-4 text-neutral3"}):o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm font-medium text-neutral5",children:e})]}),n&&o.jsx("div",{className:"pr-3",children:n})]}),t&&o.jsx("div",{className:"p-4 bg-surface2 overflow-x-auto w-0 min-w-full",children:s})]})}function NIn({open:e,onOpenChange:t,skillName:r,referencePath:n,content:s,isLoading:a,error:i}){const{isCopied:l,copyToClipboard:c}=$8({copiedDuration:2e3});if(!e)return null;const u=()=>{s&&c(s)};return o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),o.jsxs("div",{className:"relative w-full max-w-4xl max-h-[85vh] mx-4 bg-surface2 rounded-xl border border-border1 shadow-2xl flex flex-col overflow-hidden",role:"dialog","aria-modal":"true","aria-labelledby":"reference-viewer-title",onKeyDown:d=>{d.key==="Escape"&&t(!1)},children:[o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border1 bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(Yi,{className:"h-4 w-4 text-neutral4"})}),o.jsxs("div",{children:[o.jsx("h2",{id:"reference-viewer-title",className:"text-base font-medium text-neutral6",children:n}),o.jsxs("p",{className:"text-xs text-neutral3",children:["from ",r]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(me,{size:"md",variant:"light",onClick:u,disabled:!s||a,children:[o.jsx(Ce,{children:l?o.jsx(ta,{className:"h-3.5 w-3.5 text-green-400"}):o.jsx(ru,{className:"h-3.5 w-3.5"})}),l?"Copied!":"Copy"]}),o.jsx("button",{onClick:()=>t(!1),"aria-label":"Close reference viewer",className:"p-2 rounded-lg hover:bg-surface4 text-neutral3 hover:text-neutral5 transition-colors",children:o.jsx(An,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto p-6",children:a?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})}):i?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load reference"}),o.jsx("p",{className:"text-sm text-neutral3",children:i})]}):s?o.jsx("pre",{className:"whitespace-pre-wrap text-sm text-neutral5 font-mono bg-surface3 p-4 rounded-lg overflow-auto",children:s}):o.jsx("div",{className:"flex items-center justify-center py-12 text-neutral3",children:"No content available"})})]})]})}function WBe(e){return`${e.topSource}/${e.name}`}function GBe(e){const t=u1t(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function AIn({open:e,onOpenChange:t,workspaceId:r,onInstall:n,isInstalling:s,installedSkillIds:a=[],installedSkillNames:i=[],writableMounts:l,installedSkillPaths:c}){const[u,d]=b.useState(""),[f,h]=b.useState(null),[p,m]=b.useState(l&&l.length>0?l[0]?.path:void 0),{data:g,isLoading:y}=R_n(r),x=I_n(r),w=b.useMemo(()=>f?.topSource?u1t(f.topSource,f.name):null,[f]),S=b.useMemo(()=>!w||!f?null:`https://skills.sh/${w.owner}/${w.repo}/${f.name}`,[w,f]),{data:k,isLoading:_}=P_n(r,w?.owner,w?.repo,f?.name,{enabled:!!w&&!!f}),E=m1(M=>{M.trim().length>=2&&x.mutate(M)},300),T=b.useCallback(M=>{d(M),E(M)},[E]),j=b.useMemo(()=>u.trim().length>=2?x.data?.skills??[]:g?.skills??[],[u,x.data,g]),N=x.isPending,I=u.trim().length>=2,P=b.useMemo(()=>{if(!f)return!1;const M=GBe(f);return!!(M&&a.includes(M)||i.includes(f.name))},[f,a,i]),R=b.useCallback(()=>{!f||!w||n({repository:`${w.owner}/${w.repo}`,skillName:f.name,mount:l&&l.length>1?p:void 0})},[f,w,n,l,p]),B=b.useCallback(M=>{M||(d(""),h(null),m(l?.[0]?.path)),t(M)},[t,l]);return o.jsx(Sn,{open:e,onOpenChange:B,children:o.jsxs(yn,{className:"max-w-4xl h-[80vh] flex flex-col",children:[o.jsxs(On,{children:[o.jsx(vn,{children:"Add Skill"}),o.jsx(qs,{children:"Search and install skills from the community registry"})]}),o.jsxs(Bn,{className:"flex-1 flex flex-col gap-4 overflow-hidden max-h-none",children:[o.jsxs("div",{className:"relative",children:[o.jsx(PE,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral3"}),o.jsx(ar,{placeholder:"Search skills...",value:u,onChange:M=>T(M.target.value),className:"pl-9"})]}),o.jsxs("div",{className:"flex flex-1 gap-4 min-h-0",children:[o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:I?"Search Results":"Popular Skills"}),o.jsx(Ms,{className:"flex-1 border border-border1 rounded-lg",children:y||N?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Na,{className:"h-6 w-6 animate-spin text-neutral3"})}):j.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral4",children:[o.jsx(qb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:I?"No skills found":"No skills available"})]}):o.jsx("div",{className:"p-2 space-y-1",children:j.map(M=>{const F=WBe(M),U=GBe(M),z=U&&a.includes(U)||i.includes(M.name),H=f?WBe(f):null;return o.jsx("button",{onClick:()=>h(M),className:Y("w-full text-left px-3 py-2 rounded-md transition-colors","hover:bg-surface4",H===F&&"bg-surface5 border border-accent1"),children:o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium text-sm text-neutral6 truncate",children:M.name}),z&&o.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-accent1/20 text-accent1",children:[o.jsx(ta,{className:"h-2.5 w-2.5"}),"Installed"]})]}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:M.topSource})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral3 shrink-0",children:[o.jsx(Pk,{className:"h-3 w-3"}),o.jsx("span",{children:M.installs.toLocaleString()})]})]})},F)})})})]}),o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:"Preview"}),o.jsx("div",{className:"flex-1 border border-border1 rounded-lg overflow-hidden flex flex-col",children:f?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-4 border-b border-border1 bg-surface3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-surface5",children:o.jsx(bC,{className:"h-5 w-5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-neutral6 truncate",children:f.name}),o.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-neutral4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(C2t,{className:"h-3 w-3"}),f.topSource]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Pk,{className:"h-3 w-3"}),f.installs.toLocaleString()," installs"]})]})]}),w&&o.jsx("a",{href:`https://github.com/${w.owner}/${w.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-neutral4 hover:text-neutral5 transition-colors",title:"View on GitHub",children:o.jsx(va,{className:"h-4 w-4"})})]})}),_?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Na,{className:"h-6 w-6 animate-spin text-neutral3"})}):k?o.jsx(Ms,{className:"flex-1",children:o.jsx("div",{className:"p-4",children:o.jsx(rE,{children:k})})}):o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[o.jsx(qb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Preview unavailable"}),S&&o.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs mt-2 text-accent1 hover:underline flex items-center gap-1",children:["View on skills.sh ",o.jsx(va,{className:"h-3 w-3"})]})]})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[o.jsx(qb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Select a skill to preview"})]})})]})]}),f&&o.jsxs("div",{className:"flex flex-col gap-3 pt-4 border-t border-border1",children:[l&&l.length>1&&o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface3 border border-border1",children:[o.jsx(oc,{className:"h-4 w-4 text-icon4 shrink-0"}),o.jsx("label",{htmlFor:"mount-select",className:"text-sm text-icon5 whitespace-nowrap font-medium",children:"Install to"}),o.jsx("select",{id:"mount-select",value:p??"",onChange:M=>m(M.target.value),className:"flex-1 text-sm px-3 py-1.5 rounded-md border border-border1 bg-surface2 text-icon6",children:l.map(M=>{const F=M.displayName??M.name??M.provider??"unknown";return o.jsxs("option",{value:M.path,children:[F," (",M.path,")"]},M.path)})})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[P&&l&&l.length>1&&f&&c?.[f.name]&&(()=>{const M=c[f.name],F=l.find(U=>M.startsWith(U.path+"/")||M===U.path);return F?o.jsxs("span",{className:"text-xs text-icon4",children:["Installed at ",F.path]}):null})(),o.jsx(me,{variant:"light",onClick:()=>B(!1),children:"Cancel"}),o.jsx(me,{variant:"primary",onClick:R,disabled:!w||s||P,"data-testid":"install-skill-button",children:s?o.jsxs(o.Fragment,{children:[o.jsx(Na,{className:"h-4 w-4 mr-2 animate-spin"}),"Installing..."]}):P?o.jsxs(o.Fragment,{children:[o.jsx(ta,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):o.jsxs(o.Fragment,{children:[o.jsx(Pk,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function ZBe(){const{workspaceId:e}=ra(),[t,r]=ao(),n=fu(),[s,a]=b.useState(!1),[i,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(null),[h,p]=b.useState(null),[m,g]=b.useState(!1),y=t.get("file"),x=t.get("tab"),{data:w,error:S,isLoading:k}=l1t(),_=w?.workspaces??[],E=e??_[0]?.id,{data:T,isLoading:j,error:N}=S_n(E),I=Ps(S)||Ps(N),P=Os(S)||Os(N),R=t.get("path")||".",B=_le(S)||_le(N),M=E?_.find(Re=>Re.id===E):void 0,F=Re=>{const it=new URLSearchParams(t);for(const[rt,ht]of Object.entries(Re))ht===null?it.delete(rt):it.set(rt,ht);r(it)},U=Re=>{g(!1),a(!1),n(`/workspaces/${Re}`)},z=Re=>{F({path:Re==="."||Re===""?null:Re,file:null})},H=Re=>{F({file:Re})},Q=Re=>{F({tab:Re})},L=R,Z=y,{data:V,isLoading:D,error:W,refetch:G}=O_n(L,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:E}),J=__n(),ae=E_n(),{data:te,isLoading:re}=c1t(Z??"",{enabled:!!Z,workspaceId:E}),{data:ie,isLoading:fe,refetch:X}=j_n({workspaceId:E}),se=M_n(),le=D_n(),xe=L_n(),ue=T?.isWorkspaceConfigured??!1,ce=T?.capabilities?.hasFilesystem??!1,ve=T?.capabilities?.hasSkills??!1,we=T?.capabilities?.canBM25??!1,Ne=T?.capabilities?.canVector??!1,K=M?.safety?.readOnly??!1,oe=ce&&!K,be=T?.mounts,Ae=be?.filter(Re=>!Re.readOnly).map(Re=>({path:Re.path,displayName:Re.displayName,icon:Re.icon,provider:Re.provider,name:Re.name})),$e=be&&be.length>1?be.map(Re=>Re.path):void 0,ye=b.useCallback(Re=>{E&&se.mutate({...Re,workspaceId:E},{onSuccess:async it=>{if(it.success){u(!1);const{data:rt,error:ht}=await X();if(ht||!rt){ze.success(`Skill "${it.skillName}" installed successfully (${it.filesWritten} files)`);return}rt.skills.some($r=>$r.name===it.skillName)?ze.success(`Skill "${it.skillName}" installed successfully (${it.filesWritten} files)`):(g(!0),ze.warning(`Skill "${it.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else ze.error("Failed to install skill")},onError:it=>{ze.error(`Failed to install skill: ${it instanceof Error?it.message:"Unknown error"}`)}})},[E,se,X]),ke=b.useCallback(Re=>{E&&(p(Re),le.mutate({workspaceId:E,skillName:Re},{onSuccess:it=>{if(p(null),it.updated.length>0){const rt=it.updated[0];rt.success?(ze.success(`Skill "${Re}" updated successfully (${rt.filesWritten} files)`),X()):ze.error(`Failed to update skill: ${rt.error??"Unknown error"}`)}else ze.error("Failed to update skill: No update result returned")},onError:it=>{p(null),ze.error(`Failed to update skill: ${it instanceof Error?it.message:"Unknown error"}`)}}))},[E,le,X]),ge=b.useCallback(Re=>{E&&(f(Re),xe.mutate({workspaceId:E,skillName:Re},{onSuccess:it=>{f(null),it.success?(ze.success(`Skill "${it.skillName}" removed successfully`),X()):ze.error(`Failed to remove skill "${it.skillName}"`)},onError:it=>{f(null),ze.error(`Failed to remove skill: ${it instanceof Error?it.message:"Unknown error"}`)}}))},[E,xe,X]),Fe=x==="files"&&ce?"files":x==="skills"&&ve?"skills":ce?"files":ve?"skills":"files",ct=ie?.skills??[],wt=ie?.isSkillsConfigured??!1,lr=V?.entries??[],Ve=ce&&(we||Ne),qe=ve&&wt&&ct.length>0,Ie=Ve||qe;if(k)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(Mt,{})});if(I)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(na,{})});if(P)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(Zs,{resource:"workspaces"})});if(B)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(gIn,{})});const Le=S||N;return Le?o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(gu,{title:"Failed to load workspace",message:Le.message})}):!k&&_.length===0?o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(pIn,{})}):!j&&!k&&!ue?o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(mIn,{})}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsxs(bn,{children:[o.jsxs(bn.Title,{children:[o.jsx(oc,{})," Workspace"]}),o.jsx(bn.Description,{children:"Manage files, skills, and search your workspace"})]})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[Ie&&o.jsx(Cn,{onClick:()=>a(!s),tooltipContent:"Search workspace","aria-label":"Search workspace",children:o.jsx(PE,{})}),o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workspaces documentation","aria-label":"Workspaces documentation",children:o.jsx(Li,{})})]})]})}),o.jsxs(bt.MainArea,{className:"grid content-start gap-6",children:[_.length>1&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>l(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[M?.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1"}):o.jsx(XL,{className:"h-4 w-4 text-neutral4"}),o.jsxs("span",{className:"flex-1 text-left truncate",children:[M?.name??"Select workspace",M?.source==="agent"&&M.agentName&&o.jsxs("span",{className:"text-neutral4 ml-1",children:["(",M.agentName,")"]})]}),o.jsx(as,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&o.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:_.map(Re=>o.jsxs("button",{onClick:()=>{U(Re.id),l(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${M?.id===Re.id?"bg-surface3":""}`,children:[Re.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1 shrink-0"}):o.jsx(XL,{className:"h-4 w-4 text-neutral4 shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Re.name}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:Re.source==="agent"?`Agent: ${Re.agentName}`:"Global workspace"})]}),o.jsxs("div",{className:"flex gap-1 shrink-0",children:[Re.safety?.readOnly&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Re.capabilities.hasFilesystem&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Re.capabilities.hasSandbox&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Re.capabilities.hasSkills&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Re.id))})]}),_.length===1&&M&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[M.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1"}):o.jsx(XL,{className:"h-4 w-4"}),o.jsx("span",{children:M.name}),M.source==="agent"&&M.agentName&&o.jsxs("span",{className:"text-neutral3",children:["(",M.agentName,")"]}),K&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&Ie&&E&&o.jsx(IIn,{workspaceId:E,canSearchFiles:Ve,canSearchSkills:qe,canBM25:we,canVector:Ne,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Re=>{F({file:Re,tab:"files"})},onViewSkillResult:(Re,it)=>{E&&n(`/workspaces/${E}/skills/${encodeURIComponent(Re)}?path=${encodeURIComponent(it)}`)}},E),o.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ce&&o.jsxs("button",{onClick:()=>Q("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Fe==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[o.jsx(Yi,{className:"h-4 w-4"}),"Files"]}),ve&&o.jsxs("button",{onClick:()=>Q("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Fe==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[o.jsx(y3,{className:"h-4 w-4"}),"Skills",wt&&ct.length>0&&o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ct.length})]})]}),o.jsxs("div",{className:"pb-8",children:[Fe==="files"&&ce&&o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[o.jsx(uIn,{entries:lr,currentPath:L,isLoading:D,error:W,onNavigate:z,onFileSelect:H,onRefresh:()=>G(),onCreateDirectory:K?void 0:Re=>ae.mutate({path:Re,workspaceId:E}),onDelete:K?void 0:Re=>J.mutate({path:Re,recursive:!0,force:!0,workspaceId:E})}),Z&&o.jsx(hIn,{path:Z,content:te?.content??"",isLoading:re,mimeType:te?.mimeType,onClose:()=>H(null)})]})}),Fe==="skills"&&ve&&o.jsx(_In,{skills:ct,isLoading:fe,isSkillsConfigured:wt,hasUndiscoveredAgentSkills:m,basePath:E?`/workspaces/${E}/skills`:"/workspaces",onAddSkill:oe?()=>u(!0):void 0,onUpdateSkill:oe?ke:void 0,onRemoveSkill:oe?ge:void 0,updatingSkillName:h??void 0,removingSkillName:d??void 0,mountPaths:$e}),!ce&&!ve&&!j&&o.jsx("div",{className:"py-12 text-center text-neutral4",children:o.jsx("p",{children:"No workspace capabilities are configured."})})]})]}),E&&oe&&o.jsx(AIn,{open:c,onOpenChange:u,workspaceId:E,onInstall:ye,isInstalling:se.isPending,installedSkillIds:ct.filter(Re=>Re.skillsShSource).map(Re=>`${Re.skillsShSource.owner}/${Re.skillsShSource.repo}/${Re.name}`),installedSkillNames:ct.filter(Re=>!Re.skillsShSource).map(Re=>Re.name),writableMounts:Ae,installedSkillPaths:Object.fromEntries(ct.filter(Re=>Re.path).map(Re=>[Re.name,Re.path]))})]})}function IIn({workspaceId:e,canSearchFiles:t,canSearchSkills:r,canBM25:n,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:l}){const c=C_n(),u=A_n();return o.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(Yi,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&o.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",o.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",o.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),o.jsx(yIn,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:n,canVector:s,onViewResult:i})]}),r&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(y3,{className:"h-4 w-4"}),"Search Skills"]}),o.jsx(bIn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>l(d.skillName,d.skillPath)})]})]})}function RIn(e,t){return e==null||t==null?null:e in t?e:null}function PIn(){const{skillName:e,workspaceId:t}=ra(),[r]=ao(),n=xa(),s=e?decodeURIComponent(e):"",a=r.get("path"),i=a?decodeURIComponent(a):void 0,l=r.get("agentId"),c=l?decodeURIComponent(l):null,d=n.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=RIn(c,d),h=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[p,m]=b.useState(null),{data:g,isLoading:y,error:x}=T_n(s,{workspaceId:t,path:i}),{data:w}=c1t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:S,isLoading:k}=N_n(s,p??"",{enabled:!!p,workspaceId:t,path:i}),_=E=>f?o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:h,children:[o.jsx(Ce,{children:o.jsx(ZL,{className:"h-4 w-4"})}),f]}),o.jsxs(jr,{as:"span",to:"",isCurrent:!0,children:[o.jsx(Ce,{children:o.jsx(y3,{className:"h-4 w-4"})}),E]})]}):o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:h,children:[o.jsx(Ce,{children:o.jsx(oc,{className:"h-4 w-4"})}),"Workspace"]}),o.jsxs(jr,{as:dr,to:h,children:[o.jsx(Ce,{children:o.jsx(y3,{className:"h-4 w-4"})}),"Skills"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:E})]});return y?o.jsxs(zr,{children:[o.jsx(En,{children:_("Loading...")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):x&&Ps(x)?o.jsxs(zr,{children:[o.jsx(En,{children:_("Session Expired")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})]}):x&&Os(x)?o.jsxs(zr,{children:[o.jsx(En,{children:_("Permission Denied")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workspaces"})})]}):x||!g?o.jsxs(zr,{children:[o.jsx(En,{children:_("Error")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),o.jsx("p",{className:"text-sm text-neutral3",children:x?.message??"Skill not found"})]})})]}):o.jsxs(zr,{children:[o.jsxs(En,{children:[_(g.name),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(u0,{})}),"Documentation"]})})]}),o.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:o.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:o.jsx(TIn,{skill:g,rawSkillMd:w?.content,onReferenceClick:m})})}),o.jsx(NIn,{open:!!p,onOpenChange:E=>!E&&m(null),skillName:g.name,referencePath:p??"",content:S?.content,isLoading:k})]})}const sOt=()=>{const e=window.MASTRA_CLOUD_API_ENDPOINT;return{isMastraPlatform:!!e,mastraPlatformEndpoint:e}},MIn=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:o.jsx(ma,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:o.jsx(Yi,{}),isOnMastraPlatform:!0,indent:!0},{name:"Workflows",url:"/workflows",icon:o.jsx(Di,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:o.jsx(nS,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:o.jsx(vl,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:o.jsx(Mi,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",icon:o.jsx(oc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:o.jsx(RE,{}),isOnMastraPlatform:!0,indent:!0}]},{key:"evaluation",title:"Evaluation",href:"/evaluation",links:[{name:"Scorers",url:"/scorers",icon:o.jsx(Da,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/datasets",icon:o.jsx(Ta,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/experiments",icon:o.jsx(Au,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:o.jsx(lk,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Traces",url:"/observability",activePaths:["/traces"],icon:o.jsx(xo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Logs",url:"/logs",icon:o.jsx(YL,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:o.jsx(fme,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:o.jsx(Li,{}),isOnMastraPlatform:!0}]}];function YBe(e,t){const r=n=>t===n||t.startsWith(n+"/");return r(e.url)?!0:e.activePaths?.some(r)??!1}function DIn(){const{Link:e}=or(),{state:t}=wme(),n=_c().pathname,{isMastraPlatform:s}=sOt(),{data:a}=EC(),{isCmsAvailable:i,isLoading:l}=uM(),{hasPermission:c,hasAnyPermission:u,rbacEnabled:d,isAuthenticated:f,isLoading:h}=Ev(),p=a&&QP(a),m=new Set(["/prompts"]),g=y=>m.has(y.url)&&!i&&!l||s&&!y.isOnMastraPlatform?!1:d&&f&&h?!0:!(y.requiredPermission&&!c(y.requiredPermission)||y.requiredAnyPermission&&!u(y.requiredAnyPermission));return o.jsxs(Gh,{children:[o.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:t==="collapsed"?o.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[o.jsx(tx,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),p&&o.jsx(Rle,{})]}):p?o.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(tx,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),o.jsx(Rle,{})]}):o.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[o.jsx(tx,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),o.jsx(Gh.Nav,{children:MIn.map(y=>{const x=y.links.filter(g),w=x.length>0&&y?.separator,S=x.some(_=>YBe(_,n)),k=!!(y.href&&n===y.href&&!S);return o.jsxs(Gh.NavSection,{children:[y?.title?o.jsx(Gh.NavHeader,{LinkComponent:e,state:t,href:y.href,isActive:k,children:y.title}):o.jsx(o.Fragment,{children:w&&o.jsx(Gh.NavSeparator,{})}),o.jsx(Gh.NavList,{children:x.map(_=>{const E=YBe(_,n);return o.jsx(Gh.NavLink,{LinkComponent:e,state:t,link:_,isActive:E},_.name)})})]},y.key)})}),o.jsxs(Gh.Bottom,{children:[t!=="collapsed"&&o.jsxs(o.Fragment,{children:[o.jsx(Gh.NavSeparator,{}),o.jsx(O1n,{collapsed:!1})]}),o.jsx(Gh.NavSeparator,{}),o.jsx("div",{className:"flex justify-end pb-3",children:o.jsx(Gh.Trigger,{})})]})]})}function aOt({children:e,loginUrl:t="/login",signupUrl:r="/signup"}){const{data:n,isLoading:s}=EC();if(s)return o.jsx(o.Fragment,{children:e});if(!n?.enabled)return o.jsx(o.Fragment,{children:e});if(QP(n))return o.jsx(o.Fragment,{children:e});const a=typeof window<"u"?window.location.href:void 0;if(!n.login)return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(tx,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Authentication Required"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"This page requires authentication, but no login method is configured. Please contact your administrator."})]})]})});const i=()=>{const l=new URL(r,window.location.origin);a&&l.searchParams.set("redirect",a),window.location.href=l.toString()};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(tx,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Sign in to continue"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"You need to sign in to access this page."})]}),o.jsx(P1t,{config:n.login,redirectUri:a,loginUrl:t}),(n.login.type==="credentials"||n.login.type==="both")&&n.login.signUpEnabled!==!1&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"text-neutral3",children:"Don't have an account? "}),o.jsx("button",{type:"button",onClick:i,className:"text-neutral6 hover:underline",children:"Sign up"})]})]})})}const iOt="experimental-ui:",oOt="current",LIn=je.createContext(null);function $In(e,t){const r=window.localStorage.getItem(iOt+e);return r&&t.has(r)?r:oOt}function FIn({experiments:e,children:t}){const r=je.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[n,s]=je.useState({});je.useLayoutEffect(()=>{const c={};for(const u of e){const d=r.get(u.key);c[u.key]=$In(u.key,d)}s(c)},[e,r]);const a=je.useCallback(c=>n[c]??oOt,[n]),i=je.useCallback((c,u)=>{window.localStorage.setItem(iOt+c,u),s(d=>({...d,[c]:u}))},[]),l=je.useMemo(()=>({experiments:e,getVariant:a,setVariant:i}),[e,a,i]);return o.jsx(LIn.Provider,{value:l,children:t})}const zIn=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],BIn=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),UIn=()=>{const[e,t]=b.useState(!1),r=b.useCallback(()=>{t(n=>!n)},[]);return b.useEffect(()=>{const n=s=>{s.key==="k"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),r())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r]),{open:e,setOpen:t,toggle:r}},Pve=()=>{const{requestContext:e}=ks(),t=Ge();return Ot({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},lOt=(e,t)=>{const r=Ge(),{requestContext:n}=ks();return Ot({queryKey:["processor",e],queryFn:()=>r.getProcessor(e).details(n),enabled:!!e})},VIn=()=>{const e=Ge(),{requestContext:t}=ks();return Kr({mutationFn:async({processorId:r,phase:n,messages:s,agentId:a})=>e.getProcessor(r).execute({phase:n,messages:s,agentId:a,requestContext:t})})},qIn=()=>{const{open:e,setOpen:t}=UIn(),{navigate:r,paths:n}=or(),{isMastraPlatform:s}=sOt(),a=c3r(),{data:i={}}=Ng(),{data:l={}}=d0(),{data:c={}}=J8(),{data:u={}}=Pve(),{data:d=[]}=dM(),{data:f={}}=fd(),h=w=>{r(w),t(!1)},p=Object.entries(i),m=Object.entries(l),g=Object.entries(c),y=Object.values(u).filter(w=>w.phases&&w.phases.length>0),x=Object.entries(f);return o.jsxs(LLr,{open:e,onOpenChange:t,title:"Navigation",description:"Search and navigate to any entity",children:[o.jsx(Ddt,{placeholder:"Search or navigate..."}),o.jsxs(Ldt,{children:[o.jsx($dt,{children:"No results found."}),o.jsxs(gb,{heading:"Navigation",children:[a&&o.jsxs(Zo,{value:"toggle sidebar collapse expand",onSelect:()=>{a.toggleSidebar(),t(!1)},children:[o.jsx(kVe,{className:"text-neutral3"}),o.jsx("span",{children:"Toggle Sidebar"}),o.jsx(Fdt,{children:"Ctrl+B"})]}),o.jsxs(Zo,{value:"all agents",onSelect:()=>h("/agents"),children:[o.jsx(ma,{className:"text-neutral3"}),o.jsx("span",{children:"All Agents"})]}),o.jsxs(Zo,{value:"all workflows",onSelect:()=>h("/workflows"),children:[o.jsx(Di,{className:"text-neutral3"}),o.jsx("span",{children:"All Workflows"})]}),o.jsxs(Zo,{value:"all tools",onSelect:()=>h("/tools"),children:[o.jsx(Mi,{className:"text-neutral3"}),o.jsx("span",{children:"All Tools"})]}),o.jsxs(Zo,{value:"all scorers",onSelect:()=>h("/scorers"),children:[o.jsx(Da,{className:"text-neutral3"}),o.jsx("span",{children:"All Scorers"})]}),o.jsxs(Zo,{value:"all processors",onSelect:()=>h("/processors"),children:[o.jsx(nS,{className:"text-neutral3"}),o.jsx("span",{children:"All Processors"})]}),o.jsxs(Zo,{value:"all mcp servers",onSelect:()=>h("/mcps"),children:[o.jsx(vl,{className:"text-neutral3"}),o.jsx("span",{children:"All MCP Servers"})]}),o.jsxs(Zo,{value:"observability traces",onSelect:()=>h("/observability"),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsx("span",{children:"Observability"})]}),!s&&o.jsxs(o.Fragment,{children:[o.jsxs(Zo,{value:"settings",onSelect:()=>h("/settings"),children:[o.jsx(fme,{className:"text-neutral3"}),o.jsx("span",{children:"Settings"})]}),o.jsxs(Zo,{value:"templates",onSelect:()=>h("/templates"),children:[o.jsx(qb,{className:"text-neutral3"}),o.jsx("span",{children:"Templates"})]})]})]}),p.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(cw,{}),o.jsx(gb,{heading:"Agents",children:p.map(([w,S])=>o.jsxs(je.Fragment,{children:[o.jsxs(Zo,{value:`${S.name} chat agent`,onSelect:()=>h(n.agentLink(w)),children:[o.jsx(ma,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Chat"]})]}),o.jsxs(Zo,{value:`${S.name} traces agent observability`,onSelect:()=>h(`/observability?entity=${w}`),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),m.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(cw,{}),o.jsx(gb,{heading:"Workflows",children:m.map(([w,S])=>o.jsxs(je.Fragment,{children:[o.jsxs(Zo,{value:`${S.name} graph workflow view`,onSelect:()=>h(n.workflowLink(w)),children:[o.jsx(Di,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Graph"]})]}),o.jsxs(Zo,{value:`${S.name} traces workflow observability`,onSelect:()=>h(`/observability?entity=${S.name}`),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),g.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(cw,{}),o.jsx(gb,{heading:"Tools",children:g.map(([w,S])=>o.jsxs(Zo,{value:`tool ${S.id}`,onSelect:()=>h(n.toolLink(w)),children:[o.jsx(Mi,{className:"text-neutral3"}),o.jsx("span",{children:S.id})]},w))})]}),x.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(cw,{}),o.jsx(gb,{heading:"Scorers",children:x.map(([w,S])=>{const k=S.scorer?.config?.name||S.scorer?.config?.id||w;return o.jsxs(Zo,{value:`scorer ${k}`,onSelect:()=>h(n.scorerLink(w)),children:[o.jsx(Da,{className:"text-neutral3"}),o.jsx("span",{children:k})]},w)})})]}),y.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(cw,{}),o.jsx(gb,{heading:"Processors",children:y.map(w=>{const S=w.name||w.id,k=w.isWorkflow?n.workflowLink(w.id)+"/graph":n.processorLink(w.id);return o.jsxs(Zo,{value:`processor ${S}`,onSelect:()=>h(k),children:[o.jsx(nS,{className:"text-neutral3"}),o.jsx("span",{children:S})]},w.id)})})]}),d.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(cw,{}),o.jsx(gb,{heading:"MCP Servers",children:d.map(w=>o.jsxs(Zo,{value:`mcp server ${w.name}`,onSelect:()=>h(n.mcpServerLink(w.id)),children:[o.jsx(vl,{className:"text-neutral3"}),o.jsx("span",{children:w.name})]},w.id))})]})]})]})};function HIn({children:e}){const{data:t,isFetched:r}=EC(),{pathname:n}=_c(),s=r&&t?.enabled&&!QP(t),a=r&&!s;return o.jsxs(o.Fragment,{children:[o.jsx(qIn,{}),o.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&o.jsx(DIn,{}),o.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":s}),children:o.jsx(aOt,{children:o.jsx(c4r,{resetKeys:[n],children:e})})})]})]})}const QIn=({children:e})=>{const{experimentalUIEnabled:t}=BIn();return o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(uYe,{position:"bottom-right"}),o.jsx(Sdt,{defaultTheme:"dark",children:o.jsx(ld,{delayDuration:0,children:o.jsx(FIn,{experiments:t?zIn:[],children:o.jsx(d3r,{children:o.jsx(HIn,{children:e})})})})})]})},WIn=({children:e})=>o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(uYe,{position:"bottom-right"}),o.jsx(Sdt,{defaultTheme:"dark",children:o.jsx(ld,{delayDuration:0,children:o.jsx("div",{className:"h-full overflow-y-auto",children:o.jsx(aOt,{children:e})})})})]});function GIn({agentId:e}){return o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ma,{})}),"Agents"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(pOn,{value:e,variant:"ghost"})})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"Agents documentation"]})})]})}const ZIn=({children:e})=>{const{agentId:t}=ra(),r=_c(),{isCmsAvailable:n}=uM(),{hasObservability:s}=C1n(),a=Mle.has("datasets"),i=n&&a,l=s&&a,{data:c}=Rf(t),u=eu(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,h=r.pathname.includes("/editor")?"versions":r.pathname.includes("/evaluate")?"evaluate":r.pathname.includes("/review")?"review":r.pathname.includes("/traces")?"traces":"chat",p=(h==="versions"||h==="evaluate"||h==="review")&&(i||l),m=o.jsxs(zr,{className:"grid-rows-[auto_auto_1fr]",children:[o.jsx(GIn,{agentId:t}),o.jsx(gCn,{agentId:t,activeTab:h,showPlayground:i,showObservability:l,rightSlot:p?o.jsx(yCn,{requestContextSchema:f}):void 0}),e]});return o.jsx(zP,{children:o.jsx(_Sn,{defaultProvider:u,defaultModel:d,children:o.jsx(nCn,{children:o.jsx(ESn,{children:m})})})})},YIn=({children:e,options:t})=>{const r=new c2r({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:d6r,...t?.defaultOptions?.queries}}});return o.jsx(u2r,{client:r,children:e})},XIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(xf,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",o.jsx(va,{})]})})}),KIn=["input","inputStep","outputStep","outputStream","outputResult"];function JIn({processors:e,isLoading:t,search:r=""}){const{paths:n,Link:s}=or(),a=b.useMemo(()=>Object.values(e??{}).filter(l=>l.phases&&l.phases.length>0),[e]),i=b.useMemo(()=>{const l=r.toLowerCase();return a.filter(c=>c.id.toLowerCase().includes(l)||(c.name||"").toLowerCase().includes(l))},[a,r]);return t?o.jsx(bh,{columns:"auto 1fr auto auto auto auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Input",short:"Input",tooltip:"Contains Input phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Input Step",short:o.jsxs(o.Fragment,{children:[o.jsx(px,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Step",short:o.jsxs(o.Fragment,{children:[o.jsx(Zd,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Stream",short:o.jsxs(o.Fragment,{children:[o.jsx(Zd,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Result",short:o.jsxs(o.Fragment,{children:[o.jsx(Zd,{})," Result"]}),tooltip:"Contains Output Result phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{short:"Used by",long:"Used by Agents",className:"text-center"})]}),i.length===0&&r?o.jsx(Se.NoMatch,{message:"No Processors match your search"}):null,i.map(l=>{const c=Nh(l.name||l.id,50),u=Nh(l.description??"",200),d=l.agentIds?.length??0,f=new Set(l.phases||[]),h=l.isWorkflow?n.workflowLink(l.id)+"/graph":n.processorLink(l.id);return o.jsxs(Se.RowLink,{to:h,LinkComponent:s,children:[o.jsx(Se.NameCell,{children:c}),o.jsx(Se.DescriptionCell,{children:u}),KIn.map(p=>o.jsx(Se.TextCell,{className:"text-center",children:f.has(p)&&o.jsx(ta,{className:"size-4 mx-auto"})},p)),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]},l.id)})]})}function eRn(){const{data:e={},isLoading:t,error:r}=Pve(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(fp,{}),children:o.jsx(na,{})}):r&&Os(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(fp,{}),children:o.jsx(Zs,{resource:"processors"})}):r?o.jsx(Jr,{title:"Processors",icon:o.jsx(fp,{}),children:o.jsx(gu,{title:"Failed to load processors",message:r.message})}):Object.keys(e).length===0&&!t?o.jsx(Jr,{title:"Processors",icon:o.jsx(fp,{}),children:o.jsx(XIn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(fp,{})," Processors"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),o.jsx(JIn,{processors:e,isLoading:t,search:n})]})}function tRn({value:e,onValueChange:t,placeholder:r="Select a processor...",searchPlaceholder:n="Search processors...",emptyText:s="No processors found.",className:a,disabled:i=!1,variant:l="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=Pve(),{navigate:h,paths:p}=or();b.useEffect(()=>{if(d){const y=f instanceof Error?f.message:"Failed to load processors";ze.error(`Error loading processors: ${y}`)}},[d,f]);const m=Object.keys(c).filter(y=>{const x=c[y];return x?.phases&&x.phases.length>0}).map(y=>({label:c[y]?.name||y,value:y})),g=y=>{t?t(y):y&&y!==e&&(c[y]?.isWorkflow?h(p.workflowLink(y)+"/graph"):h(p.processorLink(y)))};return o.jsx(Kl,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||d,variant:l})}const rRn={input:"Input - Process input messages before LLM (once at start)",inputStep:"Input Step - Process at each agentic loop step",outputStream:"Output Stream - Process streaming chunks",outputResult:"Output Result - Process complete output after streaming",outputStep:"Output Step - Process after each LLM response (before tools)"};function nRn({processorId:e}){const{data:t,isLoading:r,error:n}=lOt(e);return b.useEffect(()=>{if(n){const s=n instanceof Error?n.message:"Failed to load processor";ze.error(`Error loading processor: ${s}`)}},[n]),r?o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]}):n?null:t?o.jsx(sRn,{processor:t}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function sRn({processor:e}){const t=kv(),r=b.useId(),[n,s]=b.useState(e.phases[0]||"input"),[a,i]=b.useState(e.configurations[0]?.agentId||""),[l,c]=b.useState("Hello, this is a test message."),[u,d]=b.useState(null),[f,h]=b.useState(),p=VIn(),m=async()=>{h(void 0),d(null);const x=n==="outputStep"||n==="outputResult"?"assistant":"user",w=[{id:crypto.randomUUID(),role:x,createdAt:new Date,content:{format:2,parts:[{type:"text",text:l}]}}];try{const S=await p.mutateAsync({processorId:e.id,phase:n,messages:w,agentId:a||void 0});d(S),!S.success&&S.error&&h(S.error)}catch(S){h(S.message||"An error occurred")}},g=u?JSON.stringify(u,null,2):"{}";return o.jsxs(pf,{hasLeftServiceColumn:!0,className:"relative",children:[o.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[o.jsx(aRn,{processor:e}),o.jsxs("div",{className:"p-5 space-y-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),o.jsxs(hi,{value:n,onValueChange:y=>s(y),children:[o.jsx(ei,{className:"w-full",children:o.jsx(pi,{placeholder:"Select phase"})}),o.jsx(ti,{children:e.phases.map(y=>o.jsx(ss,{value:y,children:y},y))})]}),o.jsx(pe,{variant:"ui-xs",className:"text-neutral4",children:rRn[n]})]}),e.configurations.length>1&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),o.jsxs(hi,{value:a,onValueChange:i,children:[o.jsx(ei,{className:"w-full",children:o.jsx(pi,{placeholder:"Select agent"})}),o.jsx(ti,{children:e.configurations.map(y=>o.jsxs(ss,{value:y.agentId,children:[y.agentName," (",y.type,")"]},y.agentId))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"label",htmlFor:r,variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),o.jsx("textarea",{id:r,value:l,onChange:y=>c(y.target.value),placeholder:"Enter a test message...",rows:4,className:"w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(me,{onClick:m,disabled:p.isPending||n==="outputStream",className:"w-full",children:p.isPending?"Running...":"Run Processor"}),n==="outputStream"&&o.jsx(pe,{variant:"ui-xs",className:"text-accent6",children:"Output Stream phase cannot be executed directly. Use streaming instead."}),u&&o.jsxs("div",{className:"space-y-2 pt-4 border-t border-border1",children:[o.jsx(pe,{variant:"ui-sm",className:"text-neutral3",children:"Status"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(vt,{variant:u.success?"success":"error",children:u.success?"Success":"Failed"}),u.tripwire?.triggered&&o.jsx(vt,{variant:"info",children:"Tripwire Triggered"})]}),u.tripwire?.triggered&&u.tripwire.reason&&o.jsxs("div",{className:"mt-2 p-3 bg-accent6Dark rounded-md border border-accent6/20",children:[o.jsx(pe,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),o.jsx(pe,{variant:"ui-sm",className:"text-neutral3 mt-1",children:u.tripwire.reason})]})]})]})]}),o.jsx("div",{className:"absolute top-4 right-4 z-10",children:o.jsx(Ka,{content:g,tooltip:"Copy JSON result to clipboard"})}),o.jsx("div",{className:"p-5 h-full relative overflow-x-auto overflow-y-auto",children:o.jsx(xc,{value:f||g,editable:!0,theme:t,extensions:[Xd]})})]})}function aRn({processor:e}){return o.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[o.jsx(pe,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&o.jsx(pe,{variant:"ui-sm",className:"text-neutral4 mb-3",children:e.id}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:e.phases.map(t=>o.jsx(vt,{variant:"default",children:t},t))}),o.jsx("div",{className:"mt-3",children:o.jsxs(pe,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function iRn(){const{processorId:e}=ra(),{data:t,isLoading:r,error:n}=lOt(e);return n&&Ps(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(fp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(na,{})})]}):n&&Os(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(fp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"processors"})})]}):!r&&t?.isWorkflow?o.jsx(Z6t,{to:`/workflows/${e}/graph`,replace:!0}):r?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(En,{children:o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(fp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(Ln,{className:"h-6 w-32"})})]})}),o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]})]}):o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Ya,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(fp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(tRn,{value:e,variant:"ghost"})})]}),o.jsx(pu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[o.jsx(u0,{}),"Processors documentation"]})})]}),o.jsx(nRn,{processorId:e})]})}function oRn(){const{data:e={},isLoading:t,error:r}=Ng(),{data:n={},isLoading:s,error:a}=J8(),[i,l]=b.useState(""),c=t||s,u=a||r;return u&&Ps(u)?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(na,{})}):u&&Os(u)?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(Zs,{resource:"tools"})}):u?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(gu,{title:"Failed to load tools",message:u.message})}):Object.keys(n).length===0&&!c?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(aAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:c,children:[o.jsx(Mi,{})," Tools"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:l,label:"Filter tools",placeholder:"Filter by name"})})]}),o.jsx(sAn,{tools:n,agents:e,isLoading:c,search:i})]})}const cOt={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,r,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${r?`&path=${encodeURIComponent(r)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,r)=>r?`/agents/${e}/chat/${t}?messageId=${r}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Ki()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`,experimentLink:e=>`/experiments/${e}`},lRn=()=>{const e=fu(),t=r=>e(r,{viewTransition:!0});return o.jsx(Iht,{Link:E8,navigate:t,paths:cOt,children:o.jsx(QIn,{children:o.jsx(O_,{})})})},cRn=()=>{const e=fu(),t=r=>e(r,{viewTransition:!0});return o.jsx(Iht,{Link:E8,navigate:t,paths:cOt,children:o.jsx(WIn,{children:o.jsx(O_,{})})})},uRn=!!window.MASTRA_CLOUD_API_ENDPOINT,XBe=Mle.has("datasets"),KBe=[{index:!0,element:o.jsx(hjn,{})},{path:"instruction-blocks",element:o.jsx(pjn,{})},{path:"tools",element:o.jsx(vjn,{})},{path:"agents",element:o.jsx(ujn,{})},{path:"scorers",element:o.jsx(gjn,{})},{path:"workflows",element:o.jsx(xjn,{})},{path:"skills",element:o.jsx(yjn,{})},{path:"memory",element:o.jsx(mjn,{})},{path:"variables",element:o.jsx(bjn,{})}],dRn=[{path:"/login",element:o.jsx(XNn,{})},{path:"/signup",element:o.jsx(zAn,{})},{element:o.jsx(cRn,{}),children:[{path:"/agents/:agentId/session",element:o.jsx(xBe,{})},{path:"/agents/:agentId/session/:threadId",element:o.jsx(xBe,{})}]},{element:o.jsx(lRn,{}),children:[...uRn?[]:[{path:"/settings",element:o.jsx(FAn,{})},{path:"/templates",element:o.jsx(qAn,{})},{path:"/templates/:templateSlug",element:o.jsx(XAn,{})}],{path:"/logs",element:o.jsx(KNn,{})},{path:"/primitives",element:o.jsx(AAn,{})},{path:"/evaluation",element:o.jsx(GNn,{})},{path:"/scorers",element:o.jsx(DAn,{})},{path:"/scorers/:scorerId",element:o.jsx(LAn,{})},{path:"/metrics",element:o.jsx(EAn,{})},{path:"/observability-overview",element:o.jsx(TAn,{})},{path:"/observability",element:o.jsx(sIn,{})},{path:"/traces/:traceId",element:o.jsx(aIn,{})},{path:"/resources",element:o.jsx(MAn,{})},{path:"/agents",element:o.jsx(vKr,{})},{path:"/cms/agents/create",element:o.jsx(djn,{}),children:KBe},{path:"/cms/agents/:agentId/edit",element:o.jsx(fjn,{}),children:KBe},{path:"/cms/scorers/create",element:o.jsx(kjn,{})},{path:"/cms/scorers/:scorerId/edit",element:o.jsx(Ejn,{})},{path:"/prompts",element:o.jsx(IAn,{})},{path:"/cms/prompts/create",element:o.jsx(wjn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:o.jsx(Ojn,{})},{path:"/agents/:agentId/tools/:toolId",element:o.jsx(KAn,{})},{path:"/agents/:agentId",element:o.jsx(ZIn,{children:o.jsx(O_,{})}),children:[{index:!0,loader:({params:e})=>TU(`/agents/${e.agentId}/chat`)},{path:"chat",element:o.jsx(vBe,{})},{path:"chat/:threadId",element:o.jsx(vBe,{})},...XBe?[{path:"editor",element:o.jsx(ojn,{})},{path:"evaluate",element:o.jsx(ijn,{})},{path:"review",element:o.jsx(ljn,{})}]:[],{path:"traces",element:o.jsx(cjn,{})}]},{path:"/tools",element:o.jsx(oRn,{})},{path:"/tools/:toolId",element:o.jsx(JAn,{})},{path:"/processors",element:o.jsx(eRn,{})},{path:"/processors/:processorId",element:o.jsx(iRn,{})},{path:"/mcps",element:o.jsx(rAn,{})},{path:"/mcps/:serverId",element:o.jsx(fAn,{})},{path:"/mcps/:serverId/tools/:toolId",element:o.jsx(mAn,{})},{path:"/workspaces",element:o.jsx(ZBe,{})},{path:"/workspaces/:workspaceId",element:o.jsx(ZBe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:o.jsx(PIn,{})},{path:"/workflows",element:o.jsx(iIn,{})},{path:"/workflows/:workflowId",element:o.jsx(eYr,{children:o.jsx(O_,{})}),children:[{index:!0,loader:({params:e})=>TU(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:o.jsx(QBe,{})},{path:"graph/:runId",element:o.jsx(QBe,{})}]},...XBe?[{path:"/datasets",element:o.jsx(ENn,{})},{path:"/datasets/:datasetId",element:o.jsx(jNn,{})},{path:"/datasets/:datasetId/items/:itemId",element:o.jsx(ANn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:o.jsx(PNn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:o.jsx(TNn,{})},{path:"/experiments",element:o.jsx(ZNn,{})},{path:"/experiments/:experimentId",element:o.jsx(YNn,{})},{path:"/datasets/:datasetId/experiments",element:o.jsx(NNn,{})},{path:"/datasets/:datasetId/items",element:o.jsx(INn,{})},{path:"/datasets/:datasetId/versions",element:o.jsx(DNn,{})}]:[],{index:!0,loader:()=>TU("/agents")},{path:"/request-context",element:o.jsx(RAn,{})}]}];function fRn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=ove(),a=b.useMemo(()=>t?KCn(t,n):void 0,[t,n]);if(s)return null;if(!t)return o.jsx(E1n,{});const i=wFt(dRn,{basename:e});return o.jsx(Q5t,{baseUrl:t,headers:r,apiPrefix:n,customFetch:a,children:o.jsx(uKr,{children:o.jsx(Q6t,{router:i})})})}function hRn(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",r=window.MASTRA_SERVER_PORT||4111,n=window.MASTRA_API_PREFIX||"/api",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",i=s||(a?window.location.origin:`${e}://${t}:${r}`);return o.jsx(YIn,{children:o.jsx(HSn,{endpoint:i,defaultApiPrefix:n,children:o.jsx(fRn,{})})})}x_t.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(hRn,{})}));const fMn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{FHe as A,PGe as B,BHe as C,RWe as D,Sf as E,gh as F,fMn as G,Js as I,cS as L,$He as N,K3t as a,p5t as b,dMn as c,BSe as d,dS as e,u5t as f,qk as g,h5t as h,u1 as i,d1 as j,c1 as k,hVt as l,zWe as m,aS as n,Ia as o,jUt as p,CUt as q,gue as r,kce as s,ne as t,T3 as u,Eu as v,n5t as w,ft as x,nt as y,nZe as z};