acp-devtools 0.1.0 → 0.2.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function Qd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cy={exports:{}},fl={},dy={exports:{}},ge={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var $s=Symbol.for("react.element"),Rx=Symbol.for("react.portal"),Ax=Symbol.for("react.fragment"),Mx=Symbol.for("react.strict_mode"),qx=Symbol.for("react.profiler"),Ux=Symbol.for("react.provider"),Lx=Symbol.for("react.context"),Dx=Symbol.for("react.forward_ref"),zx=Symbol.for("react.suspense"),Fx=Symbol.for("react.memo"),Bx=Symbol.for("react.lazy"),Sf=Symbol.iterator;function Hx(e){return e===null||typeof e!="object"?null:(e=Sf&&e[Sf]||e["@@iterator"],typeof e=="function"?e:null)}var uy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},py=Object.assign,fy={};function Gr(e,t,n){this.props=e,this.context=t,this.refs=fy,this.updater=n||uy}Gr.prototype.isReactComponent={};Gr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Gr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function my(){}my.prototype=Gr.prototype;function Yd(e,t,n){this.props=e,this.context=t,this.refs=fy,this.updater=n||uy}var Xd=Yd.prototype=new my;Xd.constructor=Yd;py(Xd,Gr.prototype);Xd.isPureReactComponent=!0;var $f=Array.isArray,hy=Object.prototype.hasOwnProperty,Zd={current:null},yy={key:!0,ref:!0,__self:!0,__source:!0};function gy(e,t,n){var o,r={},i=null,s=null;if(t!=null)for(o in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)hy.call(t,o)&&!yy.hasOwnProperty(o)&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return{$$typeof:$s,type:e,key:i,ref:s,props:r,_owner:Zd.current}}function Vx(e,t){return{$$typeof:$s,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function eu(e){return typeof e=="object"&&e!==null&&e.$$typeof===$s}function Wx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var kf=/\/+/g;function Vl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wx(""+e.key):t.toString(36)}function sa(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case $s:case Rx:s=!0}}if(s)return s=e,r=r(s),e=o===""?"."+Vl(s,0):o,$f(r)?(n="",e!=null&&(n=e.replace(kf,"$&/")+"/"),sa(r,t,n,"",function(c){return c})):r!=null&&(eu(r)&&(r=Vx(r,n+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(kf,"$&/")+"/")+e)),t.push(r)),1;if(s=0,o=o===""?".":o+":",$f(e))for(var a=0;a<e.length;a++){i=e[a];var l=o+Vl(i,a);s+=sa(i,t,n,l,r)}else if(l=Hx(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=o+Vl(i,a++),s+=sa(i,t,n,l,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Rs(e,t,n){if(e==null)return e;var o=[],r=0;return sa(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Kx(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var St={current:null},aa={transition:null},Gx={ReactCurrentDispatcher:St,ReactCurrentBatchConfig:aa,ReactCurrentOwner:Zd};function vy(){throw Error("act(...) is not supported in production builds of React.")}ge.Children={map:Rs,forEach:function(e,t,n){Rs(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Rs(e,function(){t++}),t},toArray:function(e){return Rs(e,function(t){return t})||[]},only:function(e){if(!eu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Component=Gr;ge.Fragment=Ax;ge.Profiler=qx;ge.PureComponent=Yd;ge.StrictMode=Mx;ge.Suspense=zx;ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gx;ge.act=vy;ge.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=py({},e.props),r=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Zd.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)hy.call(t,l)&&!yy.hasOwnProperty(l)&&(o[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];o.children=a}return{$$typeof:$s,type:e.type,key:r,ref:i,props:o,_owner:s}};ge.createContext=function(e){return e={$$typeof:Lx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ux,_context:e},e.Consumer=e};ge.createElement=gy;ge.createFactory=function(e){var t=gy.bind(null,e);return t.type=e,t};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:Dx,render:e}};ge.isValidElement=eu;ge.lazy=function(e){return{$$typeof:Bx,_payload:{_status:-1,_result:e},_init:Kx}};ge.memo=function(e,t){return{$$typeof:Fx,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=aa.transition;aa.transition={};try{e()}finally{aa.transition=t}};ge.unstable_act=vy;ge.useCallback=function(e,t){return St.current.useCallback(e,t)};ge.useContext=function(e){return St.current.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e){return St.current.useDeferredValue(e)};ge.useEffect=function(e,t){return St.current.useEffect(e,t)};ge.useId=function(){return St.current.useId()};ge.useImperativeHandle=function(e,t,n){return St.current.useImperativeHandle(e,t,n)};ge.useInsertionEffect=function(e,t){return St.current.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return St.current.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return St.current.useMemo(e,t)};ge.useReducer=function(e,t,n){return St.current.useReducer(e,t,n)};ge.useRef=function(e){return St.current.useRef(e)};ge.useState=function(e){return St.current.useState(e)};ge.useSyncExternalStore=function(e,t,n){return St.current.useSyncExternalStore(e,t,n)};ge.useTransition=function(){return St.current.useTransition()};ge.version="18.3.1";dy.exports=ge;var P=dy.exports;const te=Qd(P);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Jx=P,Qx=Symbol.for("react.element"),Yx=Symbol.for("react.fragment"),Xx=Object.prototype.hasOwnProperty,Zx=Jx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,e0={key:!0,ref:!0,__self:!0,__source:!0};function by(e,t,n){var o,r={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(o in t)Xx.call(t,o)&&!e0.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)r[o]===void 0&&(r[o]=t[o]);return{$$typeof:Qx,type:e,key:i,ref:s,props:r,_owner:Zx.current}}fl.Fragment=Yx;fl.jsx=by;fl.jsxs=by;cy.exports=fl;var d=cy.exports,Oc={},xy={exports:{}},Ut={},wy={exports:{}},Sy={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(q,G){var
|
|
25
|
+
*/(function(e){function t(q,G){var I=q.length;q.push(G);e:for(;0<I;){var _=I-1>>>1,A=q[_];if(0<r(A,G))q[_]=G,q[I]=A,I=_;else break e}}function n(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var G=q[0],I=q.pop();if(I!==G){q[0]=I;e:for(var _=0,A=q.length,E=A>>>1;_<E;){var w=2*(_+1)-1,k=q[w],N=w+1,B=q[N];if(0>r(k,I))N<A&&0>r(B,k)?(q[_]=B,q[N]=I,_=N):(q[_]=k,q[w]=I,_=w);else if(N<A&&0>r(B,I))q[_]=B,q[N]=I,_=N;else break e}}return G}function r(q,G){var I=q.sortIndex-G.sortIndex;return I!==0?I:q.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],f=1,m=null,h=3,y=!1,g=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(q){for(var G=n(c);G!==null;){if(G.callback===null)o(c);else if(G.startTime<=q)o(c),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(c)}}function S(q){if(b=!1,x(q),!g)if(n(l)!==null)g=!0,Q(T);else{var G=n(c);G!==null&&ee(S,G.startTime-q)}}function T(q,G){g=!1,b&&(b=!1,u(j),j=-1),y=!0;var I=h;try{for(x(G),m=n(l);m!==null&&(!(m.expirationTime>G)||q&&!F());){var _=m.callback;if(typeof _=="function"){m.callback=null,h=m.priorityLevel;var A=_(m.expirationTime<=G);G=e.unstable_now(),typeof A=="function"?m.callback=A:m===n(l)&&o(l),x(G)}else o(l);m=n(l)}if(m!==null)var E=!0;else{var w=n(c);w!==null&&ee(S,w.startTime-G),E=!1}return E}finally{m=null,h=I,y=!1}}var C=!1,$=null,j=-1,R=5,M=-1;function F(){return!(e.unstable_now()-M<R)}function V(){if($!==null){var q=e.unstable_now();M=q;var G=!0;try{G=$(!0,q)}finally{G?L():(C=!1,$=null)}}else C=!1}var L;if(typeof p=="function")L=function(){p(V)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=V,L=function(){D.postMessage(null)}}else L=function(){v(V,0)};function Q(q){$=q,C||(C=!0,L())}function ee(q,G){j=v(function(){q(e.unstable_now())},G)}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(q){q.callback=null},e.unstable_continueExecution=function(){g||y||(g=!0,Q(T))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(q){switch(h){case 1:case 2:case 3:var G=3;break;default:G=h}var I=h;h=G;try{return q()}finally{h=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,G){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var I=h;h=q;try{return G()}finally{h=I}},e.unstable_scheduleCallback=function(q,G,I){var _=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?_+I:_):I=_,q){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=I+A,q={id:f++,callback:G,priorityLevel:q,startTime:I,expirationTime:A,sortIndex:-1},I>_?(q.sortIndex=I,t(c,q),n(l)===null&&q===n(c)&&(b?(u(j),j=-1):b=!0,ee(S,I-_))):(q.sortIndex=A,t(l,q),g||y||(g=!0,Q(T))),q},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(q){var G=h;return function(){var I=h;h=G;try{return q.apply(this,arguments)}finally{h=I}}}})(Sy);wy.exports=Sy;var t0=wy.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
34
|
-
`+
|
|
33
|
+
*/var n0=P,qt=t0;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var $y=new Set,Vi={};function Yo(e,t){Ur(e,t),Ur(e+"Capture",t)}function Ur(e,t){for(Vi[e]=t,e=0;e<t.length;e++)$y.add(t[e])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=Object.prototype.hasOwnProperty,o0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Tf={},_f={};function r0(e){return Rc.call(_f,e)?!0:Rc.call(Tf,e)?!1:o0.test(e)?_f[e]=!0:(Tf[e]=!0,!1)}function i0(e,t,n,o){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function s0(e,t,n,o){if(t===null||typeof t>"u"||i0(e,t,n,o))return!0;if(o)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $t(e,t,n,o,r,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ct[e]=new $t(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ct[t]=new $t(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ct[e]=new $t(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ct[e]=new $t(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ct[e]=new $t(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ct[e]=new $t(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ct[e]=new $t(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ct[e]=new $t(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ct[e]=new $t(e,5,!1,e.toLowerCase(),null,!1,!1)});var tu=/[\-:]([a-z])/g;function nu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(tu,nu);ct[t]=new $t(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(tu,nu);ct[t]=new $t(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(tu,nu);ct[t]=new $t(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ct[e]=new $t(e,1,!1,e.toLowerCase(),null,!1,!1)});ct.xlinkHref=new $t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ct[e]=new $t(e,1,!1,e.toLowerCase(),null,!0,!0)});function ou(e,t,n,o){var r=ct.hasOwnProperty(t)?ct[t]:null;(r!==null?r.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(s0(t,n,r,o)&&(n=null),o||r===null?r0(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,o=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,o?e.setAttributeNS(o,t,n):e.setAttribute(t,n))))}var Fn=n0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,As=Symbol.for("react.element"),pr=Symbol.for("react.portal"),fr=Symbol.for("react.fragment"),ru=Symbol.for("react.strict_mode"),Ac=Symbol.for("react.profiler"),ky=Symbol.for("react.provider"),Ty=Symbol.for("react.context"),iu=Symbol.for("react.forward_ref"),Mc=Symbol.for("react.suspense"),qc=Symbol.for("react.suspense_list"),su=Symbol.for("react.memo"),Zn=Symbol.for("react.lazy"),_y=Symbol.for("react.offscreen"),jf=Symbol.iterator;function ai(e){return e===null||typeof e!="object"?null:(e=jf&&e[jf]||e["@@iterator"],typeof e=="function"?e:null)}var He=Object.assign,Wl;function Si(e){if(Wl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Wl=t&&t[1]||""}return`
|
|
34
|
+
`+Wl+e}var Kl=!1;function Gl(e,t){if(!e||Kl)return"";Kl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var o=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){o=c}e.call(t.prototype)}else{try{throw Error()}catch(c){o=c}e()}}catch(c){if(c&&o&&typeof c.stack=="string"){for(var r=c.stack.split(`
|
|
35
35
|
`),i=o.stack.split(`
|
|
36
36
|
`),s=r.length-1,a=i.length-1;1<=s&&0<=a&&r[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||r[s]!==i[a]){var l=`
|
|
37
|
-
`+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Bl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?xi(e):""}function Zx(e){switch(e.tag){case 5:return xi(e.type);case 16:return xi("Lazy");case 13:return xi("Suspense");case 19:return xi("SuspenseList");case 0:case 2:case 15:return e=Hl(e.type,!1),e;case 11:return e=Hl(e.type.render,!1),e;case 1:return e=Hl(e.type,!0),e;default:return""}}function Rc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ur:return"Fragment";case dr:return"Portal";case Pc:return"Profiler";case Xd:return"StrictMode";case Ic:return"Suspense";case Oc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case vy:return(e.displayName||"Context")+".Consumer";case gy:return(e._context.displayName||"Context")+".Provider";case Zd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eu:return t=e.displayName||null,t!==null?t:Rc(e.type)||"Memo";case Xn:t=e._payload,e=e._init;try{return Rc(e(t))}catch{}}return null}function e0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Rc(t);case 8:return t===Xd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function yo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function t0(e){var t=xy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(s){o=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(s){o=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){e._valueTracker||(e._valueTracker=t0(e))}function wy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=xy(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function _a(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ac(e,t){var n=t.checked;return He({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wf(e,t){var n=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;n=yo(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Sy(e,t){t=t.checked,t!=null&&Yd(e,"checked",t,!1)}function Mc(e,t){Sy(e,t);var n=yo(t.value),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qc(e,t.type,n):t.hasOwnProperty("defaultValue")&&qc(e,t.type,yo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function qc(e,t,n){(t!=="number"||_a(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wi=Array.isArray;function $r(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+yo(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Uc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return He({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $f(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(wi(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:yo(n)}}function $y(e,t){var n=yo(t.value),o=yo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),o!=null&&(e.defaultValue=""+o)}function kf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ky(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Lc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ky(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var As,Ty=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,o,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,o,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(As=As||document.createElement("div"),As.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=As.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _i={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},n0=["Webkit","ms","Moz","O"];Object.keys(_i).forEach(function(e){n0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_i[t]=_i[e]})});function _y(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_i.hasOwnProperty(e)&&_i[e]?(""+t).trim():t+"px"}function jy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=_y(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var o0=He({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dc(e,t){if(t){if(o0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function zc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fc=null;function tu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bc=null,kr=null,Tr=null;function Tf(e){if(e=ks(e)){if(typeof Bc!="function")throw Error(B(280));var t=e.stateNode;t&&(t=ml(t),Bc(e.stateNode,e.type,t))}}function Cy(e){kr?Tr?Tr.push(e):Tr=[e]:kr=e}function Ny(){if(kr){var e=kr,t=Tr;if(Tr=kr=null,Tf(e),t)for(e=0;e<t.length;e++)Tf(t[e])}}function Ey(e,t){return e(t)}function Py(){}var Vl=!1;function Iy(e,t,n){if(Vl)return e(t,n);Vl=!0;try{return Ey(e,t,n)}finally{Vl=!1,(kr!==null||Tr!==null)&&(Py(),Ny())}}function Vi(e,t){var n=e.stateNode;if(n===null)return null;var o=ml(n);if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Hc=!1;if(Mn)try{var si={};Object.defineProperty(si,"passive",{get:function(){Hc=!0}}),window.addEventListener("test",si,si),window.removeEventListener("test",si,si)}catch{Hc=!1}function r0(e,t,n,o,r,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var ji=!1,ja=null,Ca=!1,Vc=null,i0={onError:function(e){ji=!0,ja=e}};function s0(e,t,n,o,r,i,s,a,l){ji=!1,ja=null,r0.apply(i0,arguments)}function a0(e,t,n,o,r,i,s,a,l){if(s0.apply(this,arguments),ji){if(ji){var c=ja;ji=!1,ja=null}else throw Error(B(198));Ca||(Ca=!0,Vc=c)}}function Yo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Oy(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _f(e){if(Yo(e)!==e)throw Error(B(188))}function l0(e){var t=e.alternate;if(!t){if(t=Yo(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return _f(r),e;if(i===o)return _f(r),t;i=i.sibling}throw Error(B(188))}if(n.return!==o.return)n=r,o=i;else{for(var s=!1,a=r.child;a;){if(a===n){s=!0,n=r,o=i;break}if(a===o){s=!0,o=r,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,o=r;break}if(a===o){s=!0,o=i,n=r;break}a=a.sibling}if(!s)throw Error(B(189))}}if(n.alternate!==o)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function Ry(e){return e=l0(e),e!==null?Ay(e):null}function Ay(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ay(e);if(t!==null)return t;e=e.sibling}return null}var My=Mt.unstable_scheduleCallback,jf=Mt.unstable_cancelCallback,c0=Mt.unstable_shouldYield,d0=Mt.unstable_requestPaint,Ke=Mt.unstable_now,u0=Mt.unstable_getCurrentPriorityLevel,nu=Mt.unstable_ImmediatePriority,qy=Mt.unstable_UserBlockingPriority,Na=Mt.unstable_NormalPriority,p0=Mt.unstable_LowPriority,Uy=Mt.unstable_IdlePriority,dl=null,Sn=null;function f0(e){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(dl,e,void 0,(e.current.flags&128)===128)}catch{}}var rn=Math.clz32?Math.clz32:y0,m0=Math.log,h0=Math.LN2;function y0(e){return e>>>=0,e===0?32:31-(m0(e)/h0|0)|0}var Ms=64,qs=4194304;function Si(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ea(e,t){var n=e.pendingLanes;if(n===0)return 0;var o=0,r=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~r;a!==0?o=Si(a):(i&=s,i!==0&&(o=Si(i)))}else s=n&~r,s!==0?o=Si(s):i!==0&&(o=Si(i));if(o===0)return 0;if(t!==0&&t!==o&&!(t&r)&&(r=o&-o,i=t&-t,r>=i||r===16&&(i&4194240)!==0))return t;if(o&4&&(o|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)n=31-rn(t),r=1<<n,o|=e[n],t&=~r;return o}function g0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function v0(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-rn(i),a=1<<s,l=r[s];l===-1?(!(a&n)||a&o)&&(r[s]=g0(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Wc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ly(){var e=Ms;return Ms<<=1,!(Ms&4194240)&&(Ms=64),e}function Wl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ss(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=n}function b0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-rn(n),i=1<<r;t[r]=0,o[r]=-1,e[r]=-1,n&=~i}}function ou(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-rn(n),r=1<<o;r&t|e[o]&t&&(e[o]|=t),n&=~r}}var ke=0;function Dy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zy,ru,Fy,By,Hy,Kc=!1,Us=[],so=null,ao=null,lo=null,Wi=new Map,Ki=new Map,eo=[],x0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Cf(e,t){switch(e){case"focusin":case"focusout":so=null;break;case"dragenter":case"dragleave":ao=null;break;case"mouseover":case"mouseout":lo=null;break;case"pointerover":case"pointerout":Wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ki.delete(t.pointerId)}}function ai(e,t,n,o,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:i,targetContainers:[r]},t!==null&&(t=ks(t),t!==null&&ru(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function w0(e,t,n,o,r){switch(t){case"focusin":return so=ai(so,e,t,n,o,r),!0;case"dragenter":return ao=ai(ao,e,t,n,o,r),!0;case"mouseover":return lo=ai(lo,e,t,n,o,r),!0;case"pointerover":var i=r.pointerId;return Wi.set(i,ai(Wi.get(i)||null,e,t,n,o,r)),!0;case"gotpointercapture":return i=r.pointerId,Ki.set(i,ai(Ki.get(i)||null,e,t,n,o,r)),!0}return!1}function Vy(e){var t=Ao(e.target);if(t!==null){var n=Yo(t);if(n!==null){if(t=n.tag,t===13){if(t=Oy(n),t!==null){e.blockedOn=t,Hy(e.priority,function(){Fy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Fc=o,n.target.dispatchEvent(o),Fc=null}else return t=ks(n),t!==null&&ru(t),e.blockedOn=n,!1;t.shift()}return!0}function Nf(e,t,n){sa(e)&&n.delete(t)}function S0(){Kc=!1,so!==null&&sa(so)&&(so=null),ao!==null&&sa(ao)&&(ao=null),lo!==null&&sa(lo)&&(lo=null),Wi.forEach(Nf),Ki.forEach(Nf)}function li(e,t){e.blockedOn===t&&(e.blockedOn=null,Kc||(Kc=!0,Mt.unstable_scheduleCallback(Mt.unstable_NormalPriority,S0)))}function Gi(e){function t(r){return li(r,e)}if(0<Us.length){li(Us[0],e);for(var n=1;n<Us.length;n++){var o=Us[n];o.blockedOn===e&&(o.blockedOn=null)}}for(so!==null&&li(so,e),ao!==null&&li(ao,e),lo!==null&&li(lo,e),Wi.forEach(t),Ki.forEach(t),n=0;n<eo.length;n++)o=eo[n],o.blockedOn===e&&(o.blockedOn=null);for(;0<eo.length&&(n=eo[0],n.blockedOn===null);)Vy(n),n.blockedOn===null&&eo.shift()}var _r=zn.ReactCurrentBatchConfig,Pa=!0;function $0(e,t,n,o){var r=ke,i=_r.transition;_r.transition=null;try{ke=1,iu(e,t,n,o)}finally{ke=r,_r.transition=i}}function k0(e,t,n,o){var r=ke,i=_r.transition;_r.transition=null;try{ke=4,iu(e,t,n,o)}finally{ke=r,_r.transition=i}}function iu(e,t,n,o){if(Pa){var r=Gc(e,t,n,o);if(r===null)nc(e,t,o,Ia,n),Cf(e,o);else if(w0(r,e,t,n,o))o.stopPropagation();else if(Cf(e,o),t&4&&-1<x0.indexOf(e)){for(;r!==null;){var i=ks(r);if(i!==null&&zy(i),i=Gc(e,t,n,o),i===null&&nc(e,t,o,Ia,n),i===r)break;r=i}r!==null&&o.stopPropagation()}else nc(e,t,o,null,n)}}var Ia=null;function Gc(e,t,n,o){if(Ia=null,e=tu(o),e=Ao(e),e!==null)if(t=Yo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Oy(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ia=e,null}function Wy(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(u0()){case nu:return 1;case qy:return 4;case Na:case p0:return 16;case Uy:return 536870912;default:return 16}default:return 16}}var oo=null,su=null,aa=null;function Ky(){if(aa)return aa;var e,t=su,n=t.length,o,r="value"in oo?oo.value:oo.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var s=n-e;for(o=1;o<=s&&t[n-o]===r[i-o];o++);return aa=r.slice(e,1<o?1-o:void 0)}function la(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ls(){return!0}function Ef(){return!1}function Ut(e){function t(n,o,r,i,s){this._reactName=n,this._targetInst=r,this.type=o,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ls:Ef,this.isPropagationStopped=Ef,this}return He(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ls)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ls)},persist:function(){},isPersistent:Ls}),t}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},au=Ut(Kr),$s=He({},Kr,{view:0,detail:0}),T0=Ut($s),Kl,Gl,ci,ul=He({},$s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ci&&(ci&&e.type==="mousemove"?(Kl=e.screenX-ci.screenX,Gl=e.screenY-ci.screenY):Gl=Kl=0,ci=e),Kl)},movementY:function(e){return"movementY"in e?e.movementY:Gl}}),Pf=Ut(ul),_0=He({},ul,{dataTransfer:0}),j0=Ut(_0),C0=He({},$s,{relatedTarget:0}),Jl=Ut(C0),N0=He({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),E0=Ut(N0),P0=He({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),I0=Ut(P0),O0=He({},Kr,{data:0}),If=Ut(O0),R0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},M0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=M0[e])?!!t[e]:!1}function lu(){return q0}var U0=He({},$s,{key:function(e){if(e.key){var t=R0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=la(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?A0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lu,charCode:function(e){return e.type==="keypress"?la(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?la(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),L0=Ut(U0),D0=He({},ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Of=Ut(D0),z0=He({},$s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lu}),F0=Ut(z0),B0=He({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),H0=Ut(B0),V0=He({},ul,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),W0=Ut(V0),K0=[9,13,27,32],cu=Mn&&"CompositionEvent"in window,Ci=null;Mn&&"documentMode"in document&&(Ci=document.documentMode);var G0=Mn&&"TextEvent"in window&&!Ci,Gy=Mn&&(!cu||Ci&&8<Ci&&11>=Ci),Rf=" ",Af=!1;function Jy(e,t){switch(e){case"keyup":return K0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pr=!1;function J0(e,t){switch(e){case"compositionend":return Qy(t);case"keypress":return t.which!==32?null:(Af=!0,Rf);case"textInput":return e=t.data,e===Rf&&Af?null:e;default:return null}}function Q0(e,t){if(pr)return e==="compositionend"||!cu&&Jy(e,t)?(e=Ky(),aa=su=oo=null,pr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gy&&t.locale!=="ko"?null:t.data;default:return null}}var Y0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Mf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Y0[e.type]:t==="textarea"}function Yy(e,t,n,o){Cy(o),t=Oa(t,"onChange"),0<t.length&&(n=new au("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Ni=null,Ji=null;function X0(e){lg(e,0)}function pl(e){var t=hr(e);if(wy(t))return e}function Z0(e,t){if(e==="change")return t}var Xy=!1;if(Mn){var Ql;if(Mn){var Yl="oninput"in document;if(!Yl){var qf=document.createElement("div");qf.setAttribute("oninput","return;"),Yl=typeof qf.oninput=="function"}Ql=Yl}else Ql=!1;Xy=Ql&&(!document.documentMode||9<document.documentMode)}function Uf(){Ni&&(Ni.detachEvent("onpropertychange",Zy),Ji=Ni=null)}function Zy(e){if(e.propertyName==="value"&&pl(Ji)){var t=[];Yy(t,Ji,e,tu(e)),Iy(X0,t)}}function ew(e,t,n){e==="focusin"?(Uf(),Ni=t,Ji=n,Ni.attachEvent("onpropertychange",Zy)):e==="focusout"&&Uf()}function tw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pl(Ji)}function nw(e,t){if(e==="click")return pl(t)}function ow(e,t){if(e==="input"||e==="change")return pl(t)}function rw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:rw;function Qi(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var r=n[o];if(!Ec.call(t,r)||!cn(e[r],t[r]))return!1}return!0}function Lf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Df(e,t){var n=Lf(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Lf(n)}}function eg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?eg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tg(){for(var e=window,t=_a();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_a(e.document)}return t}function du(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function iw(e){var t=tg(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&eg(n.ownerDocument.documentElement,n)){if(o!==null&&du(n)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!e.extend&&i>o&&(r=o,o=i,i=r),r=Df(n,i);var s=Df(n,o);r&&s&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sw=Mn&&"documentMode"in document&&11>=document.documentMode,fr=null,Jc=null,Ei=null,Qc=!1;function zf(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qc||fr==null||fr!==_a(o)||(o=fr,"selectionStart"in o&&du(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ei&&Qi(Ei,o)||(Ei=o,o=Oa(Jc,"onSelect"),0<o.length&&(t=new au("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=fr)))}function Ds(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionend:Ds("Transition","TransitionEnd")},Xl={},ng={};Mn&&(ng=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);function fl(e){if(Xl[e])return Xl[e];if(!mr[e])return e;var t=mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ng)return Xl[e]=t[n];return e}var og=fl("animationend"),rg=fl("animationiteration"),ig=fl("animationstart"),sg=fl("transitionend"),ag=new Map,Ff="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function bo(e,t){ag.set(e,t),Qo(t,[e])}for(var Zl=0;Zl<Ff.length;Zl++){var ec=Ff[Zl],aw=ec.toLowerCase(),lw=ec[0].toUpperCase()+ec.slice(1);bo(aw,"on"+lw)}bo(og,"onAnimationEnd");bo(rg,"onAnimationIteration");bo(ig,"onAnimationStart");bo("dblclick","onDoubleClick");bo("focusin","onFocus");bo("focusout","onBlur");bo(sg,"onTransitionEnd");Mr("onMouseEnter",["mouseout","mouseover"]);Mr("onMouseLeave",["mouseout","mouseover"]);Mr("onPointerEnter",["pointerout","pointerover"]);Mr("onPointerLeave",["pointerout","pointerover"]);Qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $i="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cw=new Set("cancel close invalid load scroll toggle".split(" ").concat($i));function Bf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,a0(o,t,void 0,e),e.currentTarget=null}function lg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],r=o.event;o=o.listeners;e:{var i=void 0;if(t)for(var s=o.length-1;0<=s;s--){var a=o[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&r.isPropagationStopped())break e;Bf(r,a,c),i=l}else for(s=0;s<o.length;s++){if(a=o[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&r.isPropagationStopped())break e;Bf(r,a,c),i=l}}}if(Ca)throw e=Vc,Ca=!1,Vc=null,e}function Oe(e,t){var n=t[td];n===void 0&&(n=t[td]=new Set);var o=e+"__bubble";n.has(o)||(cg(t,e,2,!1),n.add(o))}function tc(e,t,n){var o=0;t&&(o|=4),cg(n,e,o,t)}var zs="_reactListening"+Math.random().toString(36).slice(2);function Yi(e){if(!e[zs]){e[zs]=!0,yy.forEach(function(n){n!=="selectionchange"&&(cw.has(n)||tc(n,!1,e),tc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zs]||(t[zs]=!0,tc("selectionchange",!1,t))}}function cg(e,t,n,o){switch(Wy(t)){case 1:var r=$0;break;case 4:r=k0;break;default:r=iu}n=r.bind(null,t,n,e),r=void 0,!Hc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),o?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function nc(e,t,n,o,r){var i=o;if(!(t&1)&&!(t&2)&&o!==null)e:for(;;){if(o===null)return;var s=o.tag;if(s===3||s===4){var a=o.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=o.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=Ao(a),s===null)return;if(l=s.tag,l===5||l===6){o=i=s;continue e}a=a.parentNode}}o=o.return}Iy(function(){var c=i,f=tu(n),m=[];e:{var h=ag.get(e);if(h!==void 0){var y=au,g=e;switch(e){case"keypress":if(la(n)===0)break e;case"keydown":case"keyup":y=L0;break;case"focusin":g="focus",y=Jl;break;case"focusout":g="blur",y=Jl;break;case"beforeblur":case"afterblur":y=Jl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Pf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=j0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=F0;break;case og:case rg:case ig:y=E0;break;case sg:y=H0;break;case"scroll":y=T0;break;case"wheel":y=W0;break;case"copy":case"cut":case"paste":y=I0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Of}var b=(t&4)!==0,v=!b&&e==="scroll",p=b?h!==null?h+"Capture":null:h;b=[];for(var u=c,x;u!==null;){x=u;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,p!==null&&(S=Vi(u,p),S!=null&&b.push(Xi(u,S,x)))),v)break;u=u.return}0<b.length&&(h=new y(h,g,null,n,f),m.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",h&&n!==Fc&&(g=n.relatedTarget||n.fromElement)&&(Ao(g)||g[qn]))break e;if((y||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,y?(g=n.relatedTarget||n.toElement,y=c,g=g?Ao(g):null,g!==null&&(v=Yo(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(y=null,g=c),y!==g)){if(b=Pf,S="onMouseLeave",p="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(b=Of,S="onPointerLeave",p="onPointerEnter",u="pointer"),v=y==null?h:hr(y),x=g==null?h:hr(g),h=new b(S,u+"leave",y,n,f),h.target=v,h.relatedTarget=x,S=null,Ao(f)===c&&(b=new b(p,u+"enter",g,n,f),b.target=x,b.relatedTarget=v,S=b),v=S,y&&g)t:{for(b=y,p=g,u=0,x=b;x;x=nr(x))u++;for(x=0,S=p;S;S=nr(S))x++;for(;0<u-x;)b=nr(b),u--;for(;0<x-u;)p=nr(p),x--;for(;u--;){if(b===p||p!==null&&b===p.alternate)break t;b=nr(b),p=nr(p)}b=null}else b=null;y!==null&&Hf(m,h,y,b,!1),g!==null&&v!==null&&Hf(m,v,g,b,!0)}}e:{if(h=c?hr(c):window,y=h.nodeName&&h.nodeName.toLowerCase(),y==="select"||y==="input"&&h.type==="file")var T=Z0;else if(Mf(h))if(Xy)T=ow;else{T=tw;var N=ew}else(y=h.nodeName)&&y.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(T=nw);if(T&&(T=T(e,c))){Yy(m,T,n,f);break e}N&&N(e,h,c),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&qc(h,"number",h.value)}switch(N=c?hr(c):window,e){case"focusin":(Mf(N)||N.contentEditable==="true")&&(fr=N,Jc=c,Ei=null);break;case"focusout":Ei=Jc=fr=null;break;case"mousedown":Qc=!0;break;case"contextmenu":case"mouseup":case"dragend":Qc=!1,zf(m,n,f);break;case"selectionchange":if(sw)break;case"keydown":case"keyup":zf(m,n,f)}var $;if(cu)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else pr?Jy(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Gy&&n.locale!=="ko"&&(pr||C!=="onCompositionStart"?C==="onCompositionEnd"&&pr&&($=Ky()):(oo=f,su="value"in oo?oo.value:oo.textContent,pr=!0)),N=Oa(c,C),0<N.length&&(C=new If(C,e,null,n,f),m.push({event:C,listeners:N}),$?C.data=$:($=Qy(n),$!==null&&(C.data=$)))),($=G0?J0(e,n):Q0(e,n))&&(c=Oa(c,"onBeforeInput"),0<c.length&&(f=new If("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:c}),f.data=$))}lg(m,t)})}function Xi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oa(e,t){for(var n=t+"Capture",o=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Vi(e,n),i!=null&&o.unshift(Xi(e,i,r)),i=Vi(e,t),i!=null&&o.push(Xi(e,i,r))),e=e.return}return o}function nr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Hf(e,t,n,o,r){for(var i=t._reactName,s=[];n!==null&&n!==o;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===o)break;a.tag===5&&c!==null&&(a=c,r?(l=Vi(n,i),l!=null&&s.unshift(Xi(n,l,a))):r||(l=Vi(n,i),l!=null&&s.push(Xi(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var dw=/\r\n?/g,uw=/\u0000|\uFFFD/g;function Vf(e){return(typeof e=="string"?e:""+e).replace(dw,`
|
|
38
|
-
`).replace(uw,"")}function Fs(e,t,n){if(t=Vf(t),Vf(e)!==t&&n)throw Error(B(425))}function Ra(){}var Yc=null,Xc=null;function Zc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ed=typeof setTimeout=="function"?setTimeout:void 0,pw=typeof clearTimeout=="function"?clearTimeout:void 0,Wf=typeof Promise=="function"?Promise:void 0,fw=typeof queueMicrotask=="function"?queueMicrotask:typeof Wf<"u"?function(e){return Wf.resolve(null).then(e).catch(mw)}:ed;function mw(e){setTimeout(function(){throw e})}function oc(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(o===0){e.removeChild(r),Gi(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);Gi(t)}function co(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Kf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Gr=Math.random().toString(36).slice(2),yn="__reactFiber$"+Gr,Zi="__reactProps$"+Gr,qn="__reactContainer$"+Gr,td="__reactEvents$"+Gr,hw="__reactListeners$"+Gr,yw="__reactHandles$"+Gr;function Ao(e){var t=e[yn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qn]||n[yn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Kf(e);e!==null;){if(n=e[yn])return n;e=Kf(e)}return t}e=n,n=e.parentNode}return null}function ks(e){return e=e[yn]||e[qn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function hr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function ml(e){return e[Zi]||null}var nd=[],yr=-1;function xo(e){return{current:e}}function qe(e){0>yr||(e.current=nd[yr],nd[yr]=null,yr--)}function Ne(e,t){yr++,nd[yr]=e.current,e.current=t}var go={},yt=xo(go),jt=xo(!1),Fo=go;function qr(e,t){var n=e.type.contextTypes;if(!n)return go;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Ct(e){return e=e.childContextTypes,e!=null}function Aa(){qe(jt),qe(yt)}function Gf(e,t,n){if(yt.current!==go)throw Error(B(168));Ne(yt,t),Ne(jt,n)}function dg(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in t))throw Error(B(108,e0(e)||"Unknown",r));return He({},n,o)}function Ma(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||go,Fo=yt.current,Ne(yt,e),Ne(jt,jt.current),!0}function Jf(e,t,n){var o=e.stateNode;if(!o)throw Error(B(169));n?(e=dg(e,t,Fo),o.__reactInternalMemoizedMergedChildContext=e,qe(jt),qe(yt),Ne(yt,e)):qe(jt),Ne(jt,n)}var Cn=null,hl=!1,rc=!1;function ug(e){Cn===null?Cn=[e]:Cn.push(e)}function gw(e){hl=!0,ug(e)}function wo(){if(!rc&&Cn!==null){rc=!0;var e=0,t=ke;try{var n=Cn;for(ke=1;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}Cn=null,hl=!1}catch(r){throw Cn!==null&&(Cn=Cn.slice(e+1)),My(nu,wo),r}finally{ke=t,rc=!1}}return null}var gr=[],vr=0,qa=null,Ua=0,zt=[],Ft=0,Bo=null,En=1,Pn="";function Co(e,t){gr[vr++]=Ua,gr[vr++]=qa,qa=e,Ua=t}function pg(e,t,n){zt[Ft++]=En,zt[Ft++]=Pn,zt[Ft++]=Bo,Bo=e;var o=En;e=Pn;var r=32-rn(o)-1;o&=~(1<<r),n+=1;var i=32-rn(t)+r;if(30<i){var s=r-r%5;i=(o&(1<<s)-1).toString(32),o>>=s,r-=s,En=1<<32-rn(t)+r|n<<r|o,Pn=i+e}else En=1<<i|n<<r|o,Pn=e}function uu(e){e.return!==null&&(Co(e,1),pg(e,1,0))}function pu(e){for(;e===qa;)qa=gr[--vr],gr[vr]=null,Ua=gr[--vr],gr[vr]=null;for(;e===Bo;)Bo=zt[--Ft],zt[Ft]=null,Pn=zt[--Ft],zt[Ft]=null,En=zt[--Ft],zt[Ft]=null}var Rt=null,It=null,De=!1,nn=null;function fg(e,t){var n=Bt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Qf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Rt=e,It=co(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rt=e,It=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Bo!==null?{id:En,overflow:Pn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Bt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Rt=e,It=null,!0):!1;default:return!1}}function od(e){return(e.mode&1)!==0&&(e.flags&128)===0}function rd(e){if(De){var t=It;if(t){var n=t;if(!Qf(e,t)){if(od(e))throw Error(B(418));t=co(n.nextSibling);var o=Rt;t&&Qf(e,t)?fg(o,n):(e.flags=e.flags&-4097|2,De=!1,Rt=e)}}else{if(od(e))throw Error(B(418));e.flags=e.flags&-4097|2,De=!1,Rt=e}}}function Yf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rt=e}function Bs(e){if(e!==Rt)return!1;if(!De)return Yf(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Zc(e.type,e.memoizedProps)),t&&(t=It)){if(od(e))throw mg(),Error(B(418));for(;t;)fg(e,t),t=co(t.nextSibling)}if(Yf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){It=co(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}It=null}}else It=Rt?co(e.stateNode.nextSibling):null;return!0}function mg(){for(var e=It;e;)e=co(e.nextSibling)}function Ur(){It=Rt=null,De=!1}function fu(e){nn===null?nn=[e]:nn.push(e)}var vw=zn.ReactCurrentBatchConfig;function di(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var o=n.stateNode}if(!o)throw Error(B(147,e));var r=o,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=r.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function Hs(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Xf(e){var t=e._init;return t(e._payload)}function hg(e){function t(p,u){if(e){var x=p.deletions;x===null?(p.deletions=[u],p.flags|=16):x.push(u)}}function n(p,u){if(!e)return null;for(;u!==null;)t(p,u),u=u.sibling;return null}function o(p,u){for(p=new Map;u!==null;)u.key!==null?p.set(u.key,u):p.set(u.index,u),u=u.sibling;return p}function r(p,u){return p=mo(p,u),p.index=0,p.sibling=null,p}function i(p,u,x){return p.index=x,e?(x=p.alternate,x!==null?(x=x.index,x<u?(p.flags|=2,u):x):(p.flags|=2,u)):(p.flags|=1048576,u)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,u,x,S){return u===null||u.tag!==6?(u=uc(x,p.mode,S),u.return=p,u):(u=r(u,x),u.return=p,u)}function l(p,u,x,S){var T=x.type;return T===ur?f(p,u,x.props.children,S,x.key):u!==null&&(u.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Xn&&Xf(T)===u.type)?(S=r(u,x.props),S.ref=di(p,u,x),S.return=p,S):(S=ha(x.type,x.key,x.props,null,p.mode,S),S.ref=di(p,u,x),S.return=p,S)}function c(p,u,x,S){return u===null||u.tag!==4||u.stateNode.containerInfo!==x.containerInfo||u.stateNode.implementation!==x.implementation?(u=pc(x,p.mode,S),u.return=p,u):(u=r(u,x.children||[]),u.return=p,u)}function f(p,u,x,S,T){return u===null||u.tag!==7?(u=zo(x,p.mode,S,T),u.return=p,u):(u=r(u,x),u.return=p,u)}function m(p,u,x){if(typeof u=="string"&&u!==""||typeof u=="number")return u=uc(""+u,p.mode,x),u.return=p,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Os:return x=ha(u.type,u.key,u.props,null,p.mode,x),x.ref=di(p,null,u),x.return=p,x;case dr:return u=pc(u,p.mode,x),u.return=p,u;case Xn:var S=u._init;return m(p,S(u._payload),x)}if(wi(u)||ii(u))return u=zo(u,p.mode,x,null),u.return=p,u;Hs(p,u)}return null}function h(p,u,x,S){var T=u!==null?u.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return T!==null?null:a(p,u,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Os:return x.key===T?l(p,u,x,S):null;case dr:return x.key===T?c(p,u,x,S):null;case Xn:return T=x._init,h(p,u,T(x._payload),S)}if(wi(x)||ii(x))return T!==null?null:f(p,u,x,S,null);Hs(p,x)}return null}function y(p,u,x,S,T){if(typeof S=="string"&&S!==""||typeof S=="number")return p=p.get(x)||null,a(u,p,""+S,T);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Os:return p=p.get(S.key===null?x:S.key)||null,l(u,p,S,T);case dr:return p=p.get(S.key===null?x:S.key)||null,c(u,p,S,T);case Xn:var N=S._init;return y(p,u,x,N(S._payload),T)}if(wi(S)||ii(S))return p=p.get(x)||null,f(u,p,S,T,null);Hs(u,S)}return null}function g(p,u,x,S){for(var T=null,N=null,$=u,C=u=0,R=null;$!==null&&C<x.length;C++){$.index>C?(R=$,$=null):R=$.sibling;var M=h(p,$,x[C],S);if(M===null){$===null&&($=R);break}e&&$&&M.alternate===null&&t(p,$),u=i(M,u,C),N===null?T=M:N.sibling=M,N=M,$=R}if(C===x.length)return n(p,$),De&&Co(p,C),T;if($===null){for(;C<x.length;C++)$=m(p,x[C],S),$!==null&&(u=i($,u,C),N===null?T=$:N.sibling=$,N=$);return De&&Co(p,C),T}for($=o(p,$);C<x.length;C++)R=y($,p,C,x[C],S),R!==null&&(e&&R.alternate!==null&&$.delete(R.key===null?C:R.key),u=i(R,u,C),N===null?T=R:N.sibling=R,N=R);return e&&$.forEach(function(F){return t(p,F)}),De&&Co(p,C),T}function b(p,u,x,S){var T=ii(x);if(typeof T!="function")throw Error(B(150));if(x=T.call(x),x==null)throw Error(B(151));for(var N=T=null,$=u,C=u=0,R=null,M=x.next();$!==null&&!M.done;C++,M=x.next()){$.index>C?(R=$,$=null):R=$.sibling;var F=h(p,$,M.value,S);if(F===null){$===null&&($=R);break}e&&$&&F.alternate===null&&t(p,$),u=i(F,u,C),N===null?T=F:N.sibling=F,N=F,$=R}if(M.done)return n(p,$),De&&Co(p,C),T;if($===null){for(;!M.done;C++,M=x.next())M=m(p,M.value,S),M!==null&&(u=i(M,u,C),N===null?T=M:N.sibling=M,N=M);return De&&Co(p,C),T}for($=o(p,$);!M.done;C++,M=x.next())M=y($,p,C,M.value,S),M!==null&&(e&&M.alternate!==null&&$.delete(M.key===null?C:M.key),u=i(M,u,C),N===null?T=M:N.sibling=M,N=M);return e&&$.forEach(function(H){return t(p,H)}),De&&Co(p,C),T}function v(p,u,x,S){if(typeof x=="object"&&x!==null&&x.type===ur&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Os:e:{for(var T=x.key,N=u;N!==null;){if(N.key===T){if(T=x.type,T===ur){if(N.tag===7){n(p,N.sibling),u=r(N,x.props.children),u.return=p,p=u;break e}}else if(N.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Xn&&Xf(T)===N.type){n(p,N.sibling),u=r(N,x.props),u.ref=di(p,N,x),u.return=p,p=u;break e}n(p,N);break}else t(p,N);N=N.sibling}x.type===ur?(u=zo(x.props.children,p.mode,S,x.key),u.return=p,p=u):(S=ha(x.type,x.key,x.props,null,p.mode,S),S.ref=di(p,u,x),S.return=p,p=S)}return s(p);case dr:e:{for(N=x.key;u!==null;){if(u.key===N)if(u.tag===4&&u.stateNode.containerInfo===x.containerInfo&&u.stateNode.implementation===x.implementation){n(p,u.sibling),u=r(u,x.children||[]),u.return=p,p=u;break e}else{n(p,u);break}else t(p,u);u=u.sibling}u=pc(x,p.mode,S),u.return=p,p=u}return s(p);case Xn:return N=x._init,v(p,u,N(x._payload),S)}if(wi(x))return g(p,u,x,S);if(ii(x))return b(p,u,x,S);Hs(p,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,u!==null&&u.tag===6?(n(p,u.sibling),u=r(u,x),u.return=p,p=u):(n(p,u),u=uc(x,p.mode,S),u.return=p,p=u),s(p)):n(p,u)}return v}var Lr=hg(!0),yg=hg(!1),La=xo(null),Da=null,br=null,mu=null;function hu(){mu=br=Da=null}function yu(e){var t=La.current;qe(La),e._currentValue=t}function id(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function jr(e,t){Da=e,mu=br=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function Gt(e){var t=e._currentValue;if(mu!==e)if(e={context:e,memoizedValue:t,next:null},br===null){if(Da===null)throw Error(B(308));br=e,Da.dependencies={lanes:0,firstContext:e}}else br=br.next=e;return t}var Mo=null;function gu(e){Mo===null?Mo=[e]:Mo.push(e)}function gg(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,gu(t)):(n.next=r.next,r.next=n),t.interleaved=n,Un(e,o)}function Un(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Zn=!1;function vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function On(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,be&2){var r=o.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),o.pending=t,Un(e,n)}return r=o.interleaved,r===null?(t.next=t,gu(o)):(t.next=r.next,r.next=t),o.interleaved=t,Un(e,n)}function ca(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,ou(e,n)}}function Zf(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:o.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function za(e,t,n,o){var r=e.updateQueue;Zn=!1;var i=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(i!==null){var m=r.baseState;s=0,f=c=l=null,a=i;do{var h=a.lane,y=a.eventTime;if((o&h)===h){f!==null&&(f=f.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,b=a;switch(h=t,y=n,b.tag){case 1:if(g=b.payload,typeof g=="function"){m=g.call(y,m,h);break e}m=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(y,m,h):g,h==null)break e;m=He({},m,h);break e;case 2:Zn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else y={eventTime:y,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=y,l=m):f=f.next=y,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(f===null&&(l=m),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=f,t=r.shared.interleaved,t!==null){r=t;do s|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);Vo|=s,e.lanes=s,e.memoizedState=m}}function em(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],r=o.callback;if(r!==null){if(o.callback=null,o=n,typeof r!="function")throw Error(B(191,r));r.call(o)}}}var Ts={},$n=xo(Ts),es=xo(Ts),ts=xo(Ts);function qo(e){if(e===Ts)throw Error(B(174));return e}function bu(e,t){switch(Ne(ts,t),Ne(es,e),Ne($n,Ts),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lc(t,e)}qe($n),Ne($n,t)}function Dr(){qe($n),qe(es),qe(ts)}function bg(e){qo(ts.current);var t=qo($n.current),n=Lc(t,e.type);t!==n&&(Ne(es,e),Ne($n,n))}function xu(e){es.current===e&&(qe($n),qe(es))}var Fe=xo(0);function Fa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ic=[];function wu(){for(var e=0;e<ic.length;e++)ic[e]._workInProgressVersionPrimary=null;ic.length=0}var da=zn.ReactCurrentDispatcher,sc=zn.ReactCurrentBatchConfig,Ho=0,Be=null,Ye=null,nt=null,Ba=!1,Pi=!1,ns=0,bw=0;function ct(){throw Error(B(321))}function Su(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cn(e[n],t[n]))return!1;return!0}function $u(e,t,n,o,r,i){if(Ho=i,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,da.current=e===null||e.memoizedState===null?$w:kw,e=n(o,r),Pi){i=0;do{if(Pi=!1,ns=0,25<=i)throw Error(B(301));i+=1,nt=Ye=null,t.updateQueue=null,da.current=Tw,e=n(o,r)}while(Pi)}if(da.current=Ha,t=Ye!==null&&Ye.next!==null,Ho=0,nt=Ye=Be=null,Ba=!1,t)throw Error(B(300));return e}function ku(){var e=ns!==0;return ns=0,e}function mn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Be.memoizedState=nt=e:nt=nt.next=e,nt}function Jt(){if(Ye===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=nt===null?Be.memoizedState:nt.next;if(t!==null)nt=t,Ye=e;else{if(e===null)throw Error(B(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},nt===null?Be.memoizedState=nt=e:nt=nt.next=e}return nt}function os(e,t){return typeof t=="function"?t(e):t}function ac(e){var t=Jt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var o=Ye,r=o.baseQueue,i=n.pending;if(i!==null){if(r!==null){var s=r.next;r.next=i.next,i.next=s}o.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,o=o.baseState;var a=s=null,l=null,c=i;do{var f=c.lane;if((Ho&f)===f)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var m={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=m,s=o):l=l.next=m,Be.lanes|=f,Vo|=f}c=c.next}while(c!==null&&c!==i);l===null?s=o:l.next=a,cn(o,t.memoizedState)||(_t=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=l,n.lastRenderedState=o}if(e=n.interleaved,e!==null){r=e;do i=r.lane,Be.lanes|=i,Vo|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function lc(e){var t=Jt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var o=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do i=e(i,s.action),s=s.next;while(s!==r);cn(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,o]}function xg(){}function wg(e,t){var n=Be,o=Jt(),r=t(),i=!cn(o.memoizedState,r);if(i&&(o.memoizedState=r,_t=!0),o=o.queue,Tu(kg.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,rs(9,$g.bind(null,n,o,r,t),void 0,null),ot===null)throw Error(B(349));Ho&30||Sg(n,t,r)}return r}function Sg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $g(e,t,n,o){t.value=n,t.getSnapshot=o,Tg(t)&&_g(e)}function kg(e,t,n){return n(function(){Tg(t)&&_g(e)})}function Tg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cn(e,n)}catch{return!0}}function _g(e){var t=Un(e,1);t!==null&&sn(t,e,1,-1)}function tm(e){var t=mn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:e},t.queue=e,e=e.dispatch=Sw.bind(null,Be,e),[t.memoizedState,e]}function rs(e,t,n,o){return e={tag:e,create:t,destroy:n,deps:o,next:null},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e)),e}function jg(){return Jt().memoizedState}function ua(e,t,n,o){var r=mn();Be.flags|=e,r.memoizedState=rs(1|t,n,void 0,o===void 0?null:o)}function yl(e,t,n,o){var r=Jt();o=o===void 0?null:o;var i=void 0;if(Ye!==null){var s=Ye.memoizedState;if(i=s.destroy,o!==null&&Su(o,s.deps)){r.memoizedState=rs(t,n,i,o);return}}Be.flags|=e,r.memoizedState=rs(1|t,n,i,o)}function nm(e,t){return ua(8390656,8,e,t)}function Tu(e,t){return yl(2048,8,e,t)}function Cg(e,t){return yl(4,2,e,t)}function Ng(e,t){return yl(4,4,e,t)}function Eg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Pg(e,t,n){return n=n!=null?n.concat([e]):null,yl(4,4,Eg.bind(null,t,e),n)}function _u(){}function Ig(e,t){var n=Jt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Su(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function Og(e,t){var n=Jt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Su(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function Rg(e,t,n){return Ho&21?(cn(n,t)||(n=Ly(),Be.lanes|=n,Vo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=n)}function xw(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var o=sc.transition;sc.transition={};try{e(!1),t()}finally{ke=n,sc.transition=o}}function Ag(){return Jt().memoizedState}function ww(e,t,n){var o=fo(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},Mg(e))qg(t,n);else if(n=gg(e,t,n,o),n!==null){var r=xt();sn(n,e,o,r),Ug(n,t,o)}}function Sw(e,t,n){var o=fo(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(Mg(e))qg(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(r.hasEagerState=!0,r.eagerState=a,cn(a,s)){var l=t.interleaved;l===null?(r.next=r,gu(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=gg(e,t,r,o),n!==null&&(r=xt(),sn(n,e,o,r),Ug(n,t,o))}}function Mg(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function qg(e,t){Pi=Ba=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ug(e,t,n){if(n&4194240){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,ou(e,n)}}var Ha={readContext:Gt,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},$w={readContext:Gt,useCallback:function(e,t){return mn().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:nm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ua(4194308,4,Eg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ua(4194308,4,e,t)},useInsertionEffect:function(e,t){return ua(4,2,e,t)},useMemo:function(e,t){var n=mn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var o=mn();return t=n!==void 0?n(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=ww.bind(null,Be,e),[o.memoizedState,e]},useRef:function(e){var t=mn();return e={current:e},t.memoizedState=e},useState:tm,useDebugValue:_u,useDeferredValue:function(e){return mn().memoizedState=e},useTransition:function(){var e=tm(!1),t=e[0];return e=xw.bind(null,e[1]),mn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=Be,r=mn();if(De){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),ot===null)throw Error(B(349));Ho&30||Sg(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,nm(kg.bind(null,o,i,e),[e]),o.flags|=2048,rs(9,$g.bind(null,o,i,n,t),void 0,null),n},useId:function(){var e=mn(),t=ot.identifierPrefix;if(De){var n=Pn,o=En;n=(o&~(1<<32-rn(o)-1)).toString(32)+n,t=":"+t+"R"+n,n=ns++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=bw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kw={readContext:Gt,useCallback:Ig,useContext:Gt,useEffect:Tu,useImperativeHandle:Pg,useInsertionEffect:Cg,useLayoutEffect:Ng,useMemo:Og,useReducer:ac,useRef:jg,useState:function(){return ac(os)},useDebugValue:_u,useDeferredValue:function(e){var t=Jt();return Rg(t,Ye.memoizedState,e)},useTransition:function(){var e=ac(os)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:xg,useSyncExternalStore:wg,useId:Ag,unstable_isNewReconciler:!1},Tw={readContext:Gt,useCallback:Ig,useContext:Gt,useEffect:Tu,useImperativeHandle:Pg,useInsertionEffect:Cg,useLayoutEffect:Ng,useMemo:Og,useReducer:lc,useRef:jg,useState:function(){return lc(os)},useDebugValue:_u,useDeferredValue:function(e){var t=Jt();return Ye===null?t.memoizedState=e:Rg(t,Ye.memoizedState,e)},useTransition:function(){var e=lc(os)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:xg,useSyncExternalStore:wg,useId:Ag,unstable_isNewReconciler:!1};function en(e,t){if(e&&e.defaultProps){t=He({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sd(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:He({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gl={isMounted:function(e){return(e=e._reactInternals)?Yo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var o=xt(),r=fo(e),i=On(o,r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(sn(t,e,r,o),ca(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=xt(),r=fo(e),i=On(o,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(sn(t,e,r,o),ca(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xt(),o=fo(e),r=On(n,o);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,o),t!==null&&(sn(t,e,o,n),ca(t,e,o))}};function om(e,t,n,o,r,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,i,s):t.prototype&&t.prototype.isPureReactComponent?!Qi(n,o)||!Qi(r,i):!0}function Lg(e,t,n){var o=!1,r=go,i=t.contextType;return typeof i=="object"&&i!==null?i=Gt(i):(r=Ct(t)?Fo:yt.current,o=t.contextTypes,i=(o=o!=null)?qr(e,r):go),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gl,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function rm(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&gl.enqueueReplaceState(t,t.state,null)}function ad(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},vu(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Gt(i):(i=Ct(t)?Fo:yt.current,r.context=qr(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(sd(e,t,i,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&gl.enqueueReplaceState(r,r.state,null),za(e,n,r,o),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function zr(e,t){try{var n="",o=t;do n+=Zx(o),o=o.return;while(o);var r=n}catch(i){r=`
|
|
37
|
+
`+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Kl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Si(e):""}function a0(e){switch(e.tag){case 5:return Si(e.type);case 16:return Si("Lazy");case 13:return Si("Suspense");case 19:return Si("SuspenseList");case 0:case 2:case 15:return e=Gl(e.type,!1),e;case 11:return e=Gl(e.type.render,!1),e;case 1:return e=Gl(e.type,!0),e;default:return""}}function Uc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case fr:return"Fragment";case pr:return"Portal";case Ac:return"Profiler";case ru:return"StrictMode";case Mc:return"Suspense";case qc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ty:return(e.displayName||"Context")+".Consumer";case ky:return(e._context.displayName||"Context")+".Provider";case iu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case su:return t=e.displayName||null,t!==null?t:Uc(e.type)||"Memo";case Zn:t=e._payload,e=e._init;try{return Uc(e(t))}catch{}}return null}function l0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Uc(t);case 8:return t===ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function go(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c0(e){var t=jy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(s){o=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(s){o=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ms(e){e._valueTracker||(e._valueTracker=c0(e))}function Ny(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=jy(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function Ea(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Lc(e,t){var n=t.checked;return He({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Nf(e,t){var n=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;n=go(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Cy(e,t){t=t.checked,t!=null&&ou(e,"checked",t,!1)}function Dc(e,t){Cy(e,t);var n=go(t.value),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zc(e,t.type,n):t.hasOwnProperty("defaultValue")&&zc(e,t.type,go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zc(e,t,n){(t!=="number"||Ea(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $i=Array.isArray;function Tr(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+go(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Fc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return He({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ef(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if($i(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:go(n)}}function Ey(e,t){var n=go(t.value),o=go(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),o!=null&&(e.defaultValue=""+o)}function Pf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Py(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Bc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Py(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qs,Iy=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,o,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,o,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(qs=qs||document.createElement("div"),qs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=qs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ni={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},d0=["Webkit","ms","Moz","O"];Object.keys(Ni).forEach(function(e){d0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ni[t]=Ni[e]})});function Oy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ni.hasOwnProperty(e)&&Ni[e]?(""+t).trim():t+"px"}function Ry(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=Oy(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var u0=He({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hc(e,t){if(t){if(u0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Vc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wc=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kc=null,_r=null,jr=null;function If(e){if(e=_s(e)){if(typeof Kc!="function")throw Error(H(280));var t=e.stateNode;t&&(t=vl(t),Kc(e.stateNode,e.type,t))}}function Ay(e){_r?jr?jr.push(e):jr=[e]:_r=e}function My(){if(_r){var e=_r,t=jr;if(jr=_r=null,If(e),t)for(e=0;e<t.length;e++)If(t[e])}}function qy(e,t){return e(t)}function Uy(){}var Jl=!1;function Ly(e,t,n){if(Jl)return e(t,n);Jl=!0;try{return qy(e,t,n)}finally{Jl=!1,(_r!==null||jr!==null)&&(Uy(),My())}}function Ki(e,t){var n=e.stateNode;if(n===null)return null;var o=vl(n);if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var Gc=!1;if(qn)try{var li={};Object.defineProperty(li,"passive",{get:function(){Gc=!0}}),window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{Gc=!1}function p0(e,t,n,o,r,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var Ci=!1,Pa=null,Ia=!1,Jc=null,f0={onError:function(e){Ci=!0,Pa=e}};function m0(e,t,n,o,r,i,s,a,l){Ci=!1,Pa=null,p0.apply(f0,arguments)}function h0(e,t,n,o,r,i,s,a,l){if(m0.apply(this,arguments),Ci){if(Ci){var c=Pa;Ci=!1,Pa=null}else throw Error(H(198));Ia||(Ia=!0,Jc=c)}}function Xo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Dy(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Of(e){if(Xo(e)!==e)throw Error(H(188))}function y0(e){var t=e.alternate;if(!t){if(t=Xo(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return Of(r),e;if(i===o)return Of(r),t;i=i.sibling}throw Error(H(188))}if(n.return!==o.return)n=r,o=i;else{for(var s=!1,a=r.child;a;){if(a===n){s=!0,n=r,o=i;break}if(a===o){s=!0,o=r,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,o=r;break}if(a===o){s=!0,o=i,n=r;break}a=a.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==o)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function zy(e){return e=y0(e),e!==null?Fy(e):null}function Fy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Fy(e);if(t!==null)return t;e=e.sibling}return null}var By=qt.unstable_scheduleCallback,Rf=qt.unstable_cancelCallback,g0=qt.unstable_shouldYield,v0=qt.unstable_requestPaint,Ge=qt.unstable_now,b0=qt.unstable_getCurrentPriorityLevel,lu=qt.unstable_ImmediatePriority,Hy=qt.unstable_UserBlockingPriority,Oa=qt.unstable_NormalPriority,x0=qt.unstable_LowPriority,Vy=qt.unstable_IdlePriority,ml=null,$n=null;function w0(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(ml,e,void 0,(e.current.flags&128)===128)}catch{}}var sn=Math.clz32?Math.clz32:k0,S0=Math.log,$0=Math.LN2;function k0(e){return e>>>=0,e===0?32:31-(S0(e)/$0|0)|0}var Us=64,Ls=4194304;function ki(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ra(e,t){var n=e.pendingLanes;if(n===0)return 0;var o=0,r=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~r;a!==0?o=ki(a):(i&=s,i!==0&&(o=ki(i)))}else s=n&~r,s!==0?o=ki(s):i!==0&&(o=ki(i));if(o===0)return 0;if(t!==0&&t!==o&&!(t&r)&&(r=o&-o,i=t&-t,r>=i||r===16&&(i&4194240)!==0))return t;if(o&4&&(o|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)n=31-sn(t),r=1<<n,o|=e[n],t&=~r;return o}function T0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _0(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-sn(i),a=1<<s,l=r[s];l===-1?(!(a&n)||a&o)&&(r[s]=T0(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Qc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wy(){var e=Us;return Us<<=1,!(Us&4194240)&&(Us=64),e}function Ql(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ks(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-sn(t),e[t]=n}function j0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-sn(n),i=1<<r;t[r]=0,o[r]=-1,e[r]=-1,n&=~i}}function cu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-sn(n),r=1<<o;r&t|e[o]&t&&(e[o]|=t),n&=~r}}var ke=0;function Ky(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Gy,du,Jy,Qy,Yy,Yc=!1,Ds=[],ao=null,lo=null,co=null,Gi=new Map,Ji=new Map,to=[],N0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Af(e,t){switch(e){case"focusin":case"focusout":ao=null;break;case"dragenter":case"dragleave":lo=null;break;case"mouseover":case"mouseout":co=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ji.delete(t.pointerId)}}function ci(e,t,n,o,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:i,targetContainers:[r]},t!==null&&(t=_s(t),t!==null&&du(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function C0(e,t,n,o,r){switch(t){case"focusin":return ao=ci(ao,e,t,n,o,r),!0;case"dragenter":return lo=ci(lo,e,t,n,o,r),!0;case"mouseover":return co=ci(co,e,t,n,o,r),!0;case"pointerover":var i=r.pointerId;return Gi.set(i,ci(Gi.get(i)||null,e,t,n,o,r)),!0;case"gotpointercapture":return i=r.pointerId,Ji.set(i,ci(Ji.get(i)||null,e,t,n,o,r)),!0}return!1}function Xy(e){var t=Mo(e.target);if(t!==null){var n=Xo(t);if(n!==null){if(t=n.tag,t===13){if(t=Dy(n),t!==null){e.blockedOn=t,Yy(e.priority,function(){Jy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function la(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Wc=o,n.target.dispatchEvent(o),Wc=null}else return t=_s(n),t!==null&&du(t),e.blockedOn=n,!1;t.shift()}return!0}function Mf(e,t,n){la(e)&&n.delete(t)}function E0(){Yc=!1,ao!==null&&la(ao)&&(ao=null),lo!==null&&la(lo)&&(lo=null),co!==null&&la(co)&&(co=null),Gi.forEach(Mf),Ji.forEach(Mf)}function di(e,t){e.blockedOn===t&&(e.blockedOn=null,Yc||(Yc=!0,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,E0)))}function Qi(e){function t(r){return di(r,e)}if(0<Ds.length){di(Ds[0],e);for(var n=1;n<Ds.length;n++){var o=Ds[n];o.blockedOn===e&&(o.blockedOn=null)}}for(ao!==null&&di(ao,e),lo!==null&&di(lo,e),co!==null&&di(co,e),Gi.forEach(t),Ji.forEach(t),n=0;n<to.length;n++)o=to[n],o.blockedOn===e&&(o.blockedOn=null);for(;0<to.length&&(n=to[0],n.blockedOn===null);)Xy(n),n.blockedOn===null&&to.shift()}var Nr=Fn.ReactCurrentBatchConfig,Aa=!0;function P0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=1,uu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function I0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=4,uu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function uu(e,t,n,o){if(Aa){var r=Xc(e,t,n,o);if(r===null)sc(e,t,o,Ma,n),Af(e,o);else if(C0(r,e,t,n,o))o.stopPropagation();else if(Af(e,o),t&4&&-1<N0.indexOf(e)){for(;r!==null;){var i=_s(r);if(i!==null&&Gy(i),i=Xc(e,t,n,o),i===null&&sc(e,t,o,Ma,n),i===r)break;r=i}r!==null&&o.stopPropagation()}else sc(e,t,o,null,n)}}var Ma=null;function Xc(e,t,n,o){if(Ma=null,e=au(o),e=Mo(e),e!==null)if(t=Xo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Dy(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ma=e,null}function Zy(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(b0()){case lu:return 1;case Hy:return 4;case Oa:case x0:return 16;case Vy:return 536870912;default:return 16}default:return 16}}var ro=null,pu=null,ca=null;function eg(){if(ca)return ca;var e,t=pu,n=t.length,o,r="value"in ro?ro.value:ro.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var s=n-e;for(o=1;o<=s&&t[n-o]===r[i-o];o++);return ca=r.slice(e,1<o?1-o:void 0)}function da(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zs(){return!0}function qf(){return!1}function Lt(e){function t(n,o,r,i,s){this._reactName=n,this._targetInst=r,this.type=o,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?zs:qf,this.isPropagationStopped=qf,this}return He(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zs)},persist:function(){},isPersistent:zs}),t}var Jr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fu=Lt(Jr),Ts=He({},Jr,{view:0,detail:0}),O0=Lt(Ts),Yl,Xl,ui,hl=He({},Ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ui&&(ui&&e.type==="mousemove"?(Yl=e.screenX-ui.screenX,Xl=e.screenY-ui.screenY):Xl=Yl=0,ui=e),Yl)},movementY:function(e){return"movementY"in e?e.movementY:Xl}}),Uf=Lt(hl),R0=He({},hl,{dataTransfer:0}),A0=Lt(R0),M0=He({},Ts,{relatedTarget:0}),Zl=Lt(M0),q0=He({},Jr,{animationName:0,elapsedTime:0,pseudoElement:0}),U0=Lt(q0),L0=He({},Jr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),D0=Lt(L0),z0=He({},Jr,{data:0}),Lf=Lt(z0),F0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},B0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},H0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function V0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=H0[e])?!!t[e]:!1}function mu(){return V0}var W0=He({},Ts,{key:function(e){if(e.key){var t=F0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=da(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?B0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mu,charCode:function(e){return e.type==="keypress"?da(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?da(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),K0=Lt(W0),G0=He({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Df=Lt(G0),J0=He({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mu}),Q0=Lt(J0),Y0=He({},Jr,{propertyName:0,elapsedTime:0,pseudoElement:0}),X0=Lt(Y0),Z0=He({},hl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ew=Lt(Z0),tw=[9,13,27,32],hu=qn&&"CompositionEvent"in window,Ei=null;qn&&"documentMode"in document&&(Ei=document.documentMode);var nw=qn&&"TextEvent"in window&&!Ei,tg=qn&&(!hu||Ei&&8<Ei&&11>=Ei),zf=" ",Ff=!1;function ng(e,t){switch(e){case"keyup":return tw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function ow(e,t){switch(e){case"compositionend":return og(t);case"keypress":return t.which!==32?null:(Ff=!0,zf);case"textInput":return e=t.data,e===zf&&Ff?null:e;default:return null}}function rw(e,t){if(mr)return e==="compositionend"||!hu&&ng(e,t)?(e=eg(),ca=pu=ro=null,mr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return tg&&t.locale!=="ko"?null:t.data;default:return null}}var iw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iw[e.type]:t==="textarea"}function rg(e,t,n,o){Ay(o),t=qa(t,"onChange"),0<t.length&&(n=new fu("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Pi=null,Yi=null;function sw(e){hg(e,0)}function yl(e){var t=gr(e);if(Ny(t))return e}function aw(e,t){if(e==="change")return t}var ig=!1;if(qn){var ec;if(qn){var tc="oninput"in document;if(!tc){var Hf=document.createElement("div");Hf.setAttribute("oninput","return;"),tc=typeof Hf.oninput=="function"}ec=tc}else ec=!1;ig=ec&&(!document.documentMode||9<document.documentMode)}function Vf(){Pi&&(Pi.detachEvent("onpropertychange",sg),Yi=Pi=null)}function sg(e){if(e.propertyName==="value"&&yl(Yi)){var t=[];rg(t,Yi,e,au(e)),Ly(sw,t)}}function lw(e,t,n){e==="focusin"?(Vf(),Pi=t,Yi=n,Pi.attachEvent("onpropertychange",sg)):e==="focusout"&&Vf()}function cw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yl(Yi)}function dw(e,t){if(e==="click")return yl(t)}function uw(e,t){if(e==="input"||e==="change")return yl(t)}function pw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:pw;function Xi(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var r=n[o];if(!Rc.call(t,r)||!dn(e[r],t[r]))return!1}return!0}function Wf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kf(e,t){var n=Wf(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wf(n)}}function ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lg(){for(var e=window,t=Ea();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ea(e.document)}return t}function yu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function fw(e){var t=lg(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ag(n.ownerDocument.documentElement,n)){if(o!==null&&yu(n)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!e.extend&&i>o&&(r=o,o=i,i=r),r=Kf(n,i);var s=Kf(n,o);r&&s&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mw=qn&&"documentMode"in document&&11>=document.documentMode,hr=null,Zc=null,Ii=null,ed=!1;function Gf(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ed||hr==null||hr!==Ea(o)||(o=hr,"selectionStart"in o&&yu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ii&&Xi(Ii,o)||(Ii=o,o=qa(Zc,"onSelect"),0<o.length&&(t=new fu("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=hr)))}function Fs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yr={animationend:Fs("Animation","AnimationEnd"),animationiteration:Fs("Animation","AnimationIteration"),animationstart:Fs("Animation","AnimationStart"),transitionend:Fs("Transition","TransitionEnd")},nc={},cg={};qn&&(cg=document.createElement("div").style,"AnimationEvent"in window||(delete yr.animationend.animation,delete yr.animationiteration.animation,delete yr.animationstart.animation),"TransitionEvent"in window||delete yr.transitionend.transition);function gl(e){if(nc[e])return nc[e];if(!yr[e])return e;var t=yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cg)return nc[e]=t[n];return e}var dg=gl("animationend"),ug=gl("animationiteration"),pg=gl("animationstart"),fg=gl("transitionend"),mg=new Map,Jf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xo(e,t){mg.set(e,t),Yo(t,[e])}for(var oc=0;oc<Jf.length;oc++){var rc=Jf[oc],hw=rc.toLowerCase(),yw=rc[0].toUpperCase()+rc.slice(1);xo(hw,"on"+yw)}xo(dg,"onAnimationEnd");xo(ug,"onAnimationIteration");xo(pg,"onAnimationStart");xo("dblclick","onDoubleClick");xo("focusin","onFocus");xo("focusout","onBlur");xo(fg,"onTransitionEnd");Ur("onMouseEnter",["mouseout","mouseover"]);Ur("onMouseLeave",["mouseout","mouseover"]);Ur("onPointerEnter",["pointerout","pointerover"]);Ur("onPointerLeave",["pointerout","pointerover"]);Yo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Yo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Yo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Yo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Yo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Yo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ti="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ti));function Qf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,h0(o,t,void 0,e),e.currentTarget=null}function hg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],r=o.event;o=o.listeners;e:{var i=void 0;if(t)for(var s=o.length-1;0<=s;s--){var a=o[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&r.isPropagationStopped())break e;Qf(r,a,c),i=l}else for(s=0;s<o.length;s++){if(a=o[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&r.isPropagationStopped())break e;Qf(r,a,c),i=l}}}if(Ia)throw e=Jc,Ia=!1,Jc=null,e}function Oe(e,t){var n=t[id];n===void 0&&(n=t[id]=new Set);var o=e+"__bubble";n.has(o)||(yg(t,e,2,!1),n.add(o))}function ic(e,t,n){var o=0;t&&(o|=4),yg(n,e,o,t)}var Bs="_reactListening"+Math.random().toString(36).slice(2);function Zi(e){if(!e[Bs]){e[Bs]=!0,$y.forEach(function(n){n!=="selectionchange"&&(gw.has(n)||ic(n,!1,e),ic(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bs]||(t[Bs]=!0,ic("selectionchange",!1,t))}}function yg(e,t,n,o){switch(Zy(t)){case 1:var r=P0;break;case 4:r=I0;break;default:r=uu}n=r.bind(null,t,n,e),r=void 0,!Gc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),o?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function sc(e,t,n,o,r){var i=o;if(!(t&1)&&!(t&2)&&o!==null)e:for(;;){if(o===null)return;var s=o.tag;if(s===3||s===4){var a=o.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=o.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=Mo(a),s===null)return;if(l=s.tag,l===5||l===6){o=i=s;continue e}a=a.parentNode}}o=o.return}Ly(function(){var c=i,f=au(n),m=[];e:{var h=mg.get(e);if(h!==void 0){var y=fu,g=e;switch(e){case"keypress":if(da(n)===0)break e;case"keydown":case"keyup":y=K0;break;case"focusin":g="focus",y=Zl;break;case"focusout":g="blur",y=Zl;break;case"beforeblur":case"afterblur":y=Zl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=A0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Q0;break;case dg:case ug:case pg:y=U0;break;case fg:y=X0;break;case"scroll":y=O0;break;case"wheel":y=ew;break;case"copy":case"cut":case"paste":y=D0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Df}var b=(t&4)!==0,v=!b&&e==="scroll",u=b?h!==null?h+"Capture":null:h;b=[];for(var p=c,x;p!==null;){x=p;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,u!==null&&(S=Ki(p,u),S!=null&&b.push(es(p,S,x)))),v)break;p=p.return}0<b.length&&(h=new y(h,g,null,n,f),m.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",h&&n!==Wc&&(g=n.relatedTarget||n.fromElement)&&(Mo(g)||g[Un]))break e;if((y||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,y?(g=n.relatedTarget||n.toElement,y=c,g=g?Mo(g):null,g!==null&&(v=Xo(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(y=null,g=c),y!==g)){if(b=Uf,S="onMouseLeave",u="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(b=Df,S="onPointerLeave",u="onPointerEnter",p="pointer"),v=y==null?h:gr(y),x=g==null?h:gr(g),h=new b(S,p+"leave",y,n,f),h.target=v,h.relatedTarget=x,S=null,Mo(f)===c&&(b=new b(u,p+"enter",g,n,f),b.target=x,b.relatedTarget=v,S=b),v=S,y&&g)t:{for(b=y,u=g,p=0,x=b;x;x=or(x))p++;for(x=0,S=u;S;S=or(S))x++;for(;0<p-x;)b=or(b),p--;for(;0<x-p;)u=or(u),x--;for(;p--;){if(b===u||u!==null&&b===u.alternate)break t;b=or(b),u=or(u)}b=null}else b=null;y!==null&&Yf(m,h,y,b,!1),g!==null&&v!==null&&Yf(m,v,g,b,!0)}}e:{if(h=c?gr(c):window,y=h.nodeName&&h.nodeName.toLowerCase(),y==="select"||y==="input"&&h.type==="file")var T=aw;else if(Bf(h))if(ig)T=uw;else{T=cw;var C=lw}else(y=h.nodeName)&&y.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(T=dw);if(T&&(T=T(e,c))){rg(m,T,n,f);break e}C&&C(e,h,c),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&zc(h,"number",h.value)}switch(C=c?gr(c):window,e){case"focusin":(Bf(C)||C.contentEditable==="true")&&(hr=C,Zc=c,Ii=null);break;case"focusout":Ii=Zc=hr=null;break;case"mousedown":ed=!0;break;case"contextmenu":case"mouseup":case"dragend":ed=!1,Gf(m,n,f);break;case"selectionchange":if(mw)break;case"keydown":case"keyup":Gf(m,n,f)}var $;if(hu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else mr?ng(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(tg&&n.locale!=="ko"&&(mr||j!=="onCompositionStart"?j==="onCompositionEnd"&&mr&&($=eg()):(ro=f,pu="value"in ro?ro.value:ro.textContent,mr=!0)),C=qa(c,j),0<C.length&&(j=new Lf(j,e,null,n,f),m.push({event:j,listeners:C}),$?j.data=$:($=og(n),$!==null&&(j.data=$)))),($=nw?ow(e,n):rw(e,n))&&(c=qa(c,"onBeforeInput"),0<c.length&&(f=new Lf("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:c}),f.data=$))}hg(m,t)})}function es(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qa(e,t){for(var n=t+"Capture",o=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Ki(e,n),i!=null&&o.unshift(es(e,i,r)),i=Ki(e,t),i!=null&&o.push(es(e,i,r))),e=e.return}return o}function or(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Yf(e,t,n,o,r){for(var i=t._reactName,s=[];n!==null&&n!==o;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===o)break;a.tag===5&&c!==null&&(a=c,r?(l=Ki(n,i),l!=null&&s.unshift(es(n,l,a))):r||(l=Ki(n,i),l!=null&&s.push(es(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var vw=/\r\n?/g,bw=/\u0000|\uFFFD/g;function Xf(e){return(typeof e=="string"?e:""+e).replace(vw,`
|
|
38
|
+
`).replace(bw,"")}function Hs(e,t,n){if(t=Xf(t),Xf(e)!==t&&n)throw Error(H(425))}function Ua(){}var td=null,nd=null;function od(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var rd=typeof setTimeout=="function"?setTimeout:void 0,xw=typeof clearTimeout=="function"?clearTimeout:void 0,Zf=typeof Promise=="function"?Promise:void 0,ww=typeof queueMicrotask=="function"?queueMicrotask:typeof Zf<"u"?function(e){return Zf.resolve(null).then(e).catch(Sw)}:rd;function Sw(e){setTimeout(function(){throw e})}function ac(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(o===0){e.removeChild(r),Qi(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);Qi(t)}function uo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function em(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Qr=Math.random().toString(36).slice(2),gn="__reactFiber$"+Qr,ts="__reactProps$"+Qr,Un="__reactContainer$"+Qr,id="__reactEvents$"+Qr,$w="__reactListeners$"+Qr,kw="__reactHandles$"+Qr;function Mo(e){var t=e[gn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Un]||n[gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=em(e);e!==null;){if(n=e[gn])return n;e=em(e)}return t}e=n,n=e.parentNode}return null}function _s(e){return e=e[gn]||e[Un],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function gr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function vl(e){return e[ts]||null}var sd=[],vr=-1;function wo(e){return{current:e}}function qe(e){0>vr||(e.current=sd[vr],sd[vr]=null,vr--)}function Ce(e,t){vr++,sd[vr]=e.current,e.current=t}var vo={},gt=wo(vo),Nt=wo(!1),Bo=vo;function Lr(e,t){var n=e.type.contextTypes;if(!n)return vo;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Ct(e){return e=e.childContextTypes,e!=null}function La(){qe(Nt),qe(gt)}function tm(e,t,n){if(gt.current!==vo)throw Error(H(168));Ce(gt,t),Ce(Nt,n)}function gg(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in t))throw Error(H(108,l0(e)||"Unknown",r));return He({},n,o)}function Da(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vo,Bo=gt.current,Ce(gt,e),Ce(Nt,Nt.current),!0}function nm(e,t,n){var o=e.stateNode;if(!o)throw Error(H(169));n?(e=gg(e,t,Bo),o.__reactInternalMemoizedMergedChildContext=e,qe(Nt),qe(gt),Ce(gt,e)):qe(Nt),Ce(Nt,n)}var Cn=null,bl=!1,lc=!1;function vg(e){Cn===null?Cn=[e]:Cn.push(e)}function Tw(e){bl=!0,vg(e)}function So(){if(!lc&&Cn!==null){lc=!0;var e=0,t=ke;try{var n=Cn;for(ke=1;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}Cn=null,bl=!1}catch(r){throw Cn!==null&&(Cn=Cn.slice(e+1)),By(lu,So),r}finally{ke=t,lc=!1}}return null}var br=[],xr=0,za=null,Fa=0,Ft=[],Bt=0,Ho=null,Pn=1,In="";function Co(e,t){br[xr++]=Fa,br[xr++]=za,za=e,Fa=t}function bg(e,t,n){Ft[Bt++]=Pn,Ft[Bt++]=In,Ft[Bt++]=Ho,Ho=e;var o=Pn;e=In;var r=32-sn(o)-1;o&=~(1<<r),n+=1;var i=32-sn(t)+r;if(30<i){var s=r-r%5;i=(o&(1<<s)-1).toString(32),o>>=s,r-=s,Pn=1<<32-sn(t)+r|n<<r|o,In=i+e}else Pn=1<<i|n<<r|o,In=e}function gu(e){e.return!==null&&(Co(e,1),bg(e,1,0))}function vu(e){for(;e===za;)za=br[--xr],br[xr]=null,Fa=br[--xr],br[xr]=null;for(;e===Ho;)Ho=Ft[--Bt],Ft[Bt]=null,In=Ft[--Bt],Ft[Bt]=null,Pn=Ft[--Bt],Ft[Bt]=null}var At=null,Ot=null,De=!1,on=null;function xg(e,t){var n=Ht(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function om(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,At=e,Ot=uo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,At=e,Ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ho!==null?{id:Pn,overflow:In}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ht(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,At=e,Ot=null,!0):!1;default:return!1}}function ad(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ld(e){if(De){var t=Ot;if(t){var n=t;if(!om(e,t)){if(ad(e))throw Error(H(418));t=uo(n.nextSibling);var o=At;t&&om(e,t)?xg(o,n):(e.flags=e.flags&-4097|2,De=!1,At=e)}}else{if(ad(e))throw Error(H(418));e.flags=e.flags&-4097|2,De=!1,At=e}}}function rm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;At=e}function Vs(e){if(e!==At)return!1;if(!De)return rm(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!od(e.type,e.memoizedProps)),t&&(t=Ot)){if(ad(e))throw wg(),Error(H(418));for(;t;)xg(e,t),t=uo(t.nextSibling)}if(rm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ot=uo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ot=null}}else Ot=At?uo(e.stateNode.nextSibling):null;return!0}function wg(){for(var e=Ot;e;)e=uo(e.nextSibling)}function Dr(){Ot=At=null,De=!1}function bu(e){on===null?on=[e]:on.push(e)}var _w=Fn.ReactCurrentBatchConfig;function pi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var o=n.stateNode}if(!o)throw Error(H(147,e));var r=o,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=r.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function Ws(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function im(e){var t=e._init;return t(e._payload)}function Sg(e){function t(u,p){if(e){var x=u.deletions;x===null?(u.deletions=[p],u.flags|=16):x.push(p)}}function n(u,p){if(!e)return null;for(;p!==null;)t(u,p),p=p.sibling;return null}function o(u,p){for(u=new Map;p!==null;)p.key!==null?u.set(p.key,p):u.set(p.index,p),p=p.sibling;return u}function r(u,p){return u=ho(u,p),u.index=0,u.sibling=null,u}function i(u,p,x){return u.index=x,e?(x=u.alternate,x!==null?(x=x.index,x<p?(u.flags|=2,p):x):(u.flags|=2,p)):(u.flags|=1048576,p)}function s(u){return e&&u.alternate===null&&(u.flags|=2),u}function a(u,p,x,S){return p===null||p.tag!==6?(p=hc(x,u.mode,S),p.return=u,p):(p=r(p,x),p.return=u,p)}function l(u,p,x,S){var T=x.type;return T===fr?f(u,p,x.props.children,S,x.key):p!==null&&(p.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&im(T)===p.type)?(S=r(p,x.props),S.ref=pi(u,p,x),S.return=u,S):(S=ga(x.type,x.key,x.props,null,u.mode,S),S.ref=pi(u,p,x),S.return=u,S)}function c(u,p,x,S){return p===null||p.tag!==4||p.stateNode.containerInfo!==x.containerInfo||p.stateNode.implementation!==x.implementation?(p=yc(x,u.mode,S),p.return=u,p):(p=r(p,x.children||[]),p.return=u,p)}function f(u,p,x,S,T){return p===null||p.tag!==7?(p=Fo(x,u.mode,S,T),p.return=u,p):(p=r(p,x),p.return=u,p)}function m(u,p,x){if(typeof p=="string"&&p!==""||typeof p=="number")return p=hc(""+p,u.mode,x),p.return=u,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case As:return x=ga(p.type,p.key,p.props,null,u.mode,x),x.ref=pi(u,null,p),x.return=u,x;case pr:return p=yc(p,u.mode,x),p.return=u,p;case Zn:var S=p._init;return m(u,S(p._payload),x)}if($i(p)||ai(p))return p=Fo(p,u.mode,x,null),p.return=u,p;Ws(u,p)}return null}function h(u,p,x,S){var T=p!==null?p.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return T!==null?null:a(u,p,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case As:return x.key===T?l(u,p,x,S):null;case pr:return x.key===T?c(u,p,x,S):null;case Zn:return T=x._init,h(u,p,T(x._payload),S)}if($i(x)||ai(x))return T!==null?null:f(u,p,x,S,null);Ws(u,x)}return null}function y(u,p,x,S,T){if(typeof S=="string"&&S!==""||typeof S=="number")return u=u.get(x)||null,a(p,u,""+S,T);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case As:return u=u.get(S.key===null?x:S.key)||null,l(p,u,S,T);case pr:return u=u.get(S.key===null?x:S.key)||null,c(p,u,S,T);case Zn:var C=S._init;return y(u,p,x,C(S._payload),T)}if($i(S)||ai(S))return u=u.get(x)||null,f(p,u,S,T,null);Ws(p,S)}return null}function g(u,p,x,S){for(var T=null,C=null,$=p,j=p=0,R=null;$!==null&&j<x.length;j++){$.index>j?(R=$,$=null):R=$.sibling;var M=h(u,$,x[j],S);if(M===null){$===null&&($=R);break}e&&$&&M.alternate===null&&t(u,$),p=i(M,p,j),C===null?T=M:C.sibling=M,C=M,$=R}if(j===x.length)return n(u,$),De&&Co(u,j),T;if($===null){for(;j<x.length;j++)$=m(u,x[j],S),$!==null&&(p=i($,p,j),C===null?T=$:C.sibling=$,C=$);return De&&Co(u,j),T}for($=o(u,$);j<x.length;j++)R=y($,u,j,x[j],S),R!==null&&(e&&R.alternate!==null&&$.delete(R.key===null?j:R.key),p=i(R,p,j),C===null?T=R:C.sibling=R,C=R);return e&&$.forEach(function(F){return t(u,F)}),De&&Co(u,j),T}function b(u,p,x,S){var T=ai(x);if(typeof T!="function")throw Error(H(150));if(x=T.call(x),x==null)throw Error(H(151));for(var C=T=null,$=p,j=p=0,R=null,M=x.next();$!==null&&!M.done;j++,M=x.next()){$.index>j?(R=$,$=null):R=$.sibling;var F=h(u,$,M.value,S);if(F===null){$===null&&($=R);break}e&&$&&F.alternate===null&&t(u,$),p=i(F,p,j),C===null?T=F:C.sibling=F,C=F,$=R}if(M.done)return n(u,$),De&&Co(u,j),T;if($===null){for(;!M.done;j++,M=x.next())M=m(u,M.value,S),M!==null&&(p=i(M,p,j),C===null?T=M:C.sibling=M,C=M);return De&&Co(u,j),T}for($=o(u,$);!M.done;j++,M=x.next())M=y($,u,j,M.value,S),M!==null&&(e&&M.alternate!==null&&$.delete(M.key===null?j:M.key),p=i(M,p,j),C===null?T=M:C.sibling=M,C=M);return e&&$.forEach(function(V){return t(u,V)}),De&&Co(u,j),T}function v(u,p,x,S){if(typeof x=="object"&&x!==null&&x.type===fr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case As:e:{for(var T=x.key,C=p;C!==null;){if(C.key===T){if(T=x.type,T===fr){if(C.tag===7){n(u,C.sibling),p=r(C,x.props.children),p.return=u,u=p;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&im(T)===C.type){n(u,C.sibling),p=r(C,x.props),p.ref=pi(u,C,x),p.return=u,u=p;break e}n(u,C);break}else t(u,C);C=C.sibling}x.type===fr?(p=Fo(x.props.children,u.mode,S,x.key),p.return=u,u=p):(S=ga(x.type,x.key,x.props,null,u.mode,S),S.ref=pi(u,p,x),S.return=u,u=S)}return s(u);case pr:e:{for(C=x.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===x.containerInfo&&p.stateNode.implementation===x.implementation){n(u,p.sibling),p=r(p,x.children||[]),p.return=u,u=p;break e}else{n(u,p);break}else t(u,p);p=p.sibling}p=yc(x,u.mode,S),p.return=u,u=p}return s(u);case Zn:return C=x._init,v(u,p,C(x._payload),S)}if($i(x))return g(u,p,x,S);if(ai(x))return b(u,p,x,S);Ws(u,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,p!==null&&p.tag===6?(n(u,p.sibling),p=r(p,x),p.return=u,u=p):(n(u,p),p=hc(x,u.mode,S),p.return=u,u=p),s(u)):n(u,p)}return v}var zr=Sg(!0),$g=Sg(!1),Ba=wo(null),Ha=null,wr=null,xu=null;function wu(){xu=wr=Ha=null}function Su(e){var t=Ba.current;qe(Ba),e._currentValue=t}function cd(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function Cr(e,t){Ha=e,xu=wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(jt=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(xu!==e)if(e={context:e,memoizedValue:t,next:null},wr===null){if(Ha===null)throw Error(H(308));wr=e,Ha.dependencies={lanes:0,firstContext:e}}else wr=wr.next=e;return t}var qo=null;function $u(e){qo===null?qo=[e]:qo.push(e)}function kg(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,$u(t)):(n.next=r.next,r.next=n),t.interleaved=n,Ln(e,o)}function Ln(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var eo=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,be&2){var r=o.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),o.pending=t,Ln(e,n)}return r=o.interleaved,r===null?(t.next=t,$u(o)):(t.next=r.next,r.next=t),o.interleaved=t,Ln(e,n)}function ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,cu(e,n)}}function sm(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:o.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Va(e,t,n,o){var r=e.updateQueue;eo=!1;var i=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(i!==null){var m=r.baseState;s=0,f=c=l=null,a=i;do{var h=a.lane,y=a.eventTime;if((o&h)===h){f!==null&&(f=f.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,b=a;switch(h=t,y=n,b.tag){case 1:if(g=b.payload,typeof g=="function"){m=g.call(y,m,h);break e}m=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(y,m,h):g,h==null)break e;m=He({},m,h);break e;case 2:eo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else y={eventTime:y,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=y,l=m):f=f.next=y,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(f===null&&(l=m),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=f,t=r.shared.interleaved,t!==null){r=t;do s|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);Wo|=s,e.lanes=s,e.memoizedState=m}}function am(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],r=o.callback;if(r!==null){if(o.callback=null,o=n,typeof r!="function")throw Error(H(191,r));r.call(o)}}}var js={},kn=wo(js),ns=wo(js),os=wo(js);function Uo(e){if(e===js)throw Error(H(174));return e}function Tu(e,t){switch(Ce(os,t),Ce(ns,e),Ce(kn,js),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bc(t,e)}qe(kn),Ce(kn,t)}function Fr(){qe(kn),qe(ns),qe(os)}function _g(e){Uo(os.current);var t=Uo(kn.current),n=Bc(t,e.type);t!==n&&(Ce(ns,e),Ce(kn,n))}function _u(e){ns.current===e&&(qe(kn),qe(ns))}var Fe=wo(0);function Wa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cc=[];function ju(){for(var e=0;e<cc.length;e++)cc[e]._workInProgressVersionPrimary=null;cc.length=0}var pa=Fn.ReactCurrentDispatcher,dc=Fn.ReactCurrentBatchConfig,Vo=0,Be=null,Xe=null,ot=null,Ka=!1,Oi=!1,rs=0,jw=0;function dt(){throw Error(H(321))}function Nu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dn(e[n],t[n]))return!1;return!0}function Cu(e,t,n,o,r,i){if(Vo=i,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,pa.current=e===null||e.memoizedState===null?Pw:Iw,e=n(o,r),Oi){i=0;do{if(Oi=!1,rs=0,25<=i)throw Error(H(301));i+=1,ot=Xe=null,t.updateQueue=null,pa.current=Ow,e=n(o,r)}while(Oi)}if(pa.current=Ga,t=Xe!==null&&Xe.next!==null,Vo=0,ot=Xe=Be=null,Ka=!1,t)throw Error(H(300));return e}function Eu(){var e=rs!==0;return rs=0,e}function hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Be.memoizedState=ot=e:ot=ot.next=e,ot}function Qt(){if(Xe===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=ot===null?Be.memoizedState:ot.next;if(t!==null)ot=t,Xe=e;else{if(e===null)throw Error(H(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},ot===null?Be.memoizedState=ot=e:ot=ot.next=e}return ot}function is(e,t){return typeof t=="function"?t(e):t}function uc(e){var t=Qt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var o=Xe,r=o.baseQueue,i=n.pending;if(i!==null){if(r!==null){var s=r.next;r.next=i.next,i.next=s}o.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,o=o.baseState;var a=s=null,l=null,c=i;do{var f=c.lane;if((Vo&f)===f)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var m={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=m,s=o):l=l.next=m,Be.lanes|=f,Wo|=f}c=c.next}while(c!==null&&c!==i);l===null?s=o:l.next=a,dn(o,t.memoizedState)||(jt=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=l,n.lastRenderedState=o}if(e=n.interleaved,e!==null){r=e;do i=r.lane,Be.lanes|=i,Wo|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function pc(e){var t=Qt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var o=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do i=e(i,s.action),s=s.next;while(s!==r);dn(i,t.memoizedState)||(jt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,o]}function jg(){}function Ng(e,t){var n=Be,o=Qt(),r=t(),i=!dn(o.memoizedState,r);if(i&&(o.memoizedState=r,jt=!0),o=o.queue,Pu(Pg.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||ot!==null&&ot.memoizedState.tag&1){if(n.flags|=2048,ss(9,Eg.bind(null,n,o,r,t),void 0,null),rt===null)throw Error(H(349));Vo&30||Cg(n,t,r)}return r}function Cg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Eg(e,t,n,o){t.value=n,t.getSnapshot=o,Ig(t)&&Og(e)}function Pg(e,t,n){return n(function(){Ig(t)&&Og(e)})}function Ig(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function Og(e){var t=Ln(e,1);t!==null&&an(t,e,1,-1)}function lm(e){var t=hn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t.queue=e,e=e.dispatch=Ew.bind(null,Be,e),[t.memoizedState,e]}function ss(e,t,n,o){return e={tag:e,create:t,destroy:n,deps:o,next:null},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e)),e}function Rg(){return Qt().memoizedState}function fa(e,t,n,o){var r=hn();Be.flags|=e,r.memoizedState=ss(1|t,n,void 0,o===void 0?null:o)}function xl(e,t,n,o){var r=Qt();o=o===void 0?null:o;var i=void 0;if(Xe!==null){var s=Xe.memoizedState;if(i=s.destroy,o!==null&&Nu(o,s.deps)){r.memoizedState=ss(t,n,i,o);return}}Be.flags|=e,r.memoizedState=ss(1|t,n,i,o)}function cm(e,t){return fa(8390656,8,e,t)}function Pu(e,t){return xl(2048,8,e,t)}function Ag(e,t){return xl(4,2,e,t)}function Mg(e,t){return xl(4,4,e,t)}function qg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ug(e,t,n){return n=n!=null?n.concat([e]):null,xl(4,4,qg.bind(null,t,e),n)}function Iu(){}function Lg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Nu(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function Dg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Nu(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function zg(e,t,n){return Vo&21?(dn(n,t)||(n=Wy(),Be.lanes|=n,Wo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=n)}function Nw(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var o=dc.transition;dc.transition={};try{e(!1),t()}finally{ke=n,dc.transition=o}}function Fg(){return Qt().memoizedState}function Cw(e,t,n){var o=mo(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},Bg(e))Hg(t,n);else if(n=kg(e,t,n,o),n!==null){var r=wt();an(n,e,o,r),Vg(n,t,o)}}function Ew(e,t,n){var o=mo(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bg(e))Hg(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(r.hasEagerState=!0,r.eagerState=a,dn(a,s)){var l=t.interleaved;l===null?(r.next=r,$u(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=kg(e,t,r,o),n!==null&&(r=wt(),an(n,e,o,r),Vg(n,t,o))}}function Bg(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Hg(e,t){Oi=Ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vg(e,t,n){if(n&4194240){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,cu(e,n)}}var Ga={readContext:Jt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},Pw={readContext:Jt,useCallback:function(e,t){return hn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:cm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fa(4194308,4,qg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fa(4194308,4,e,t)},useInsertionEffect:function(e,t){return fa(4,2,e,t)},useMemo:function(e,t){var n=hn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var o=hn();return t=n!==void 0?n(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=Cw.bind(null,Be,e),[o.memoizedState,e]},useRef:function(e){var t=hn();return e={current:e},t.memoizedState=e},useState:lm,useDebugValue:Iu,useDeferredValue:function(e){return hn().memoizedState=e},useTransition:function(){var e=lm(!1),t=e[0];return e=Nw.bind(null,e[1]),hn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=Be,r=hn();if(De){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),rt===null)throw Error(H(349));Vo&30||Cg(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,cm(Pg.bind(null,o,i,e),[e]),o.flags|=2048,ss(9,Eg.bind(null,o,i,n,t),void 0,null),n},useId:function(){var e=hn(),t=rt.identifierPrefix;if(De){var n=In,o=Pn;n=(o&~(1<<32-sn(o)-1)).toString(32)+n,t=":"+t+"R"+n,n=rs++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=jw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Iw={readContext:Jt,useCallback:Lg,useContext:Jt,useEffect:Pu,useImperativeHandle:Ug,useInsertionEffect:Ag,useLayoutEffect:Mg,useMemo:Dg,useReducer:uc,useRef:Rg,useState:function(){return uc(is)},useDebugValue:Iu,useDeferredValue:function(e){var t=Qt();return zg(t,Xe.memoizedState,e)},useTransition:function(){var e=uc(is)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:jg,useSyncExternalStore:Ng,useId:Fg,unstable_isNewReconciler:!1},Ow={readContext:Jt,useCallback:Lg,useContext:Jt,useEffect:Pu,useImperativeHandle:Ug,useInsertionEffect:Ag,useLayoutEffect:Mg,useMemo:Dg,useReducer:pc,useRef:Rg,useState:function(){return pc(is)},useDebugValue:Iu,useDeferredValue:function(e){var t=Qt();return Xe===null?t.memoizedState=e:zg(t,Xe.memoizedState,e)},useTransition:function(){var e=pc(is)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:jg,useSyncExternalStore:Ng,useId:Fg,unstable_isNewReconciler:!1};function tn(e,t){if(e&&e.defaultProps){t=He({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function dd(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:He({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wl={isMounted:function(e){return(e=e._reactInternals)?Xo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var o=wt(),r=mo(e),i=Rn(o,r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(an(t,e,r,o),ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=wt(),r=mo(e),i=Rn(o,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(an(t,e,r,o),ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),o=mo(e),r=Rn(n,o);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,o),t!==null&&(an(t,e,o,n),ua(t,e,o))}};function dm(e,t,n,o,r,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,i,s):t.prototype&&t.prototype.isPureReactComponent?!Xi(n,o)||!Xi(r,i):!0}function Wg(e,t,n){var o=!1,r=vo,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(r=Ct(t)?Bo:gt.current,o=t.contextTypes,i=(o=o!=null)?Lr(e,r):vo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wl,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function um(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&wl.enqueueReplaceState(t,t.state,null)}function ud(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},ku(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Jt(i):(i=Ct(t)?Bo:gt.current,r.context=Lr(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(dd(e,t,i,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&wl.enqueueReplaceState(r,r.state,null),Va(e,n,r,o),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function Br(e,t){try{var n="",o=t;do n+=a0(o),o=o.return;while(o);var r=n}catch(i){r=`
|
|
39
39
|
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:r,digest:null}}function cc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ld(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _w=typeof WeakMap=="function"?WeakMap:Map;function Dg(e,t,n){n=On(-1,n),n.tag=3,n.payload={element:null};var o=t.value;return n.callback=function(){Wa||(Wa=!0,vd=o),ld(e,t)},n}function zg(e,t,n){n=On(-1,n),n.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var r=t.value;n.payload=function(){return o(r)},n.callback=function(){ld(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ld(e,t),typeof o!="function"&&(po===null?po=new Set([this]):po.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function im(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new _w;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(r.add(n),e=Dw.bind(null,e,t,n),t.then(e,e))}function sm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function am(e,t,n,o,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=On(-1,1),t.tag=2,uo(n,t,1))),n.lanes|=1),e)}var jw=zn.ReactCurrentOwner,_t=!1;function gt(e,t,n,o){t.child=e===null?yg(t,null,n,o):Lr(t,e.child,n,o)}function lm(e,t,n,o,r){n=n.render;var i=t.ref;return jr(t,r),o=$u(e,t,n,o,i,r),n=ku(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ln(e,t,r)):(De&&n&&uu(t),t.flags|=1,gt(e,t,o,r),t.child)}function cm(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!Ru(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Fg(e,t,i,o,r)):(e=ha(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&r)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Qi,n(s,o)&&e.ref===t.ref)return Ln(e,t,r)}return t.flags|=1,e=mo(i,o),e.ref=t.ref,e.return=t,t.child=e}function Fg(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(Qi(i,o)&&e.ref===t.ref)if(_t=!1,t.pendingProps=o=i,(e.lanes&r)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,Ln(e,t,r)}return cd(e,t,n,o,r)}function Bg(e,t,n){var o=t.pendingProps,r=o.children,i=e!==null?e.memoizedState:null;if(o.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(wr,Et),Et|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(wr,Et),Et|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Ne(wr,Et),Et|=o}else i!==null?(o=i.baseLanes|n,t.memoizedState=null):o=n,Ne(wr,Et),Et|=o;return gt(e,t,r,n),t.child}function Hg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cd(e,t,n,o,r){var i=Ct(n)?Fo:yt.current;return i=qr(t,i),jr(t,r),n=$u(e,t,n,o,i,r),o=ku(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ln(e,t,r)):(De&&o&&uu(t),t.flags|=1,gt(e,t,n,r),t.child)}function dm(e,t,n,o,r){if(Ct(n)){var i=!0;Ma(t)}else i=!1;if(jr(t,r),t.stateNode===null)pa(e,t),Lg(t,n,o),ad(t,n,o,r),o=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Gt(c):(c=Ct(n)?Fo:yt.current,c=qr(t,c));var f=n.getDerivedStateFromProps,m=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==o||l!==c)&&rm(t,s,o,c),Zn=!1;var h=t.memoizedState;s.state=h,za(t,o,s,r),l=t.memoizedState,a!==o||h!==l||jt.current||Zn?(typeof f=="function"&&(sd(t,n,f,o),l=t.memoizedState),(a=Zn||om(t,n,a,o,h,l,c))?(m||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=l),s.props=o,s.state=l,s.context=c,o=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{s=t.stateNode,vg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:en(t.type,a),s.props=c,m=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Gt(l):(l=Ct(n)?Fo:yt.current,l=qr(t,l));var y=n.getDerivedStateFromProps;(f=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==m||h!==l)&&rm(t,s,o,l),Zn=!1,h=t.memoizedState,s.state=h,za(t,o,s,r);var g=t.memoizedState;a!==m||h!==g||jt.current||Zn?(typeof y=="function"&&(sd(t,n,y,o),g=t.memoizedState),(c=Zn||om(t,n,c,o,h,g,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(o,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(o,g,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=g),s.props=o,s.state=g,s.context=l,o=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),o=!1)}return dd(e,t,n,o,i,r)}function dd(e,t,n,o,r,i){Hg(e,t);var s=(t.flags&128)!==0;if(!o&&!s)return r&&Jf(t,n,!1),Ln(e,t,i);o=t.stateNode,jw.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&s?(t.child=Lr(t,e.child,null,i),t.child=Lr(t,null,a,i)):gt(e,t,a,i),t.memoizedState=o.state,r&&Jf(t,n,!0),t.child}function Vg(e){var t=e.stateNode;t.pendingContext?Gf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Gf(e,t.context,!1),bu(e,t.containerInfo)}function um(e,t,n,o,r){return Ur(),fu(r),t.flags|=256,gt(e,t,n,o),t.child}var ud={dehydrated:null,treeContext:null,retryLane:0};function pd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Wg(e,t,n){var o=t.pendingProps,r=Fe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Ne(Fe,r&1),e===null)return rd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=o.children,e=o.fallback,i?(o=t.mode,i=t.child,s={mode:"hidden",children:s},!(o&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=xl(s,o,0,null),e=zo(e,o,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=pd(n),t.memoizedState=ud,e):ju(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Cw(e,t,s,o,a,r,n);if(i){i=o.fallback,s=t.mode,r=e.child,a=r.sibling;var l={mode:"hidden",children:o.children};return!(s&1)&&t.child!==r?(o=t.child,o.childLanes=0,o.pendingProps=l,t.deletions=null):(o=mo(r,l),o.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=mo(a,i):(i=zo(i,s,n,null),i.flags|=2),i.return=t,o.return=t,o.sibling=i,t.child=o,o=i,i=t.child,s=e.child.memoizedState,s=s===null?pd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=ud,o}return i=e.child,e=i.sibling,o=mo(i,{mode:"visible",children:o.children}),!(t.mode&1)&&(o.lanes=n),o.return=t,o.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ju(e,t){return t=xl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vs(e,t,n,o){return o!==null&&fu(o),Lr(t,e.child,null,n),e=ju(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cw(e,t,n,o,r,i,s){if(n)return t.flags&256?(t.flags&=-257,o=cc(Error(B(422))),Vs(e,t,s,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=o.fallback,r=t.mode,o=xl({mode:"visible",children:o.children},r,0,null),i=zo(i,r,s,null),i.flags|=2,o.return=t,i.return=t,o.sibling=i,t.child=o,t.mode&1&&Lr(t,e.child,null,s),t.child.memoizedState=pd(s),t.memoizedState=ud,i);if(!(t.mode&1))return Vs(e,t,s,null);if(r.data==="$!"){if(o=r.nextSibling&&r.nextSibling.dataset,o)var a=o.dgst;return o=a,i=Error(B(419)),o=cc(i,o,void 0),Vs(e,t,s,o)}if(a=(s&e.childLanes)!==0,_t||a){if(o=ot,o!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(o.suspendedLanes|s)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Un(e,r),sn(o,e,r,-1))}return Ou(),o=cc(Error(B(421))),Vs(e,t,s,o)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=zw.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,It=co(r.nextSibling),Rt=t,De=!0,nn=null,e!==null&&(zt[Ft++]=En,zt[Ft++]=Pn,zt[Ft++]=Bo,En=e.id,Pn=e.overflow,Bo=t),t=ju(t,o.children),t.flags|=4096,t)}function pm(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),id(e.return,t,n)}function dc(e,t,n,o,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r)}function Kg(e,t,n){var o=t.pendingProps,r=o.revealOrder,i=o.tail;if(gt(e,t,o.children,n),o=Fe.current,o&2)o=o&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pm(e,n,t);else if(e.tag===19)pm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(Ne(Fe,o),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Fa(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),dc(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Fa(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}dc(t,!0,n,null,i);break;case"together":dc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=mo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=mo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nw(e,t,n){switch(t.tag){case 3:Vg(t),Ur();break;case 5:bg(t);break;case 1:Ct(t.type)&&Ma(t);break;case 4:bu(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,r=t.memoizedProps.value;Ne(La,o._currentValue),o._currentValue=r;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Ne(Fe,Fe.current&1),t.flags|=128,null):n&t.child.childLanes?Wg(e,t,n):(Ne(Fe,Fe.current&1),e=Ln(e,t,n),e!==null?e.sibling:null);Ne(Fe,Fe.current&1);break;case 19:if(o=(n&t.childLanes)!==0,e.flags&128){if(o)return Kg(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ne(Fe,Fe.current),o)break;return null;case 22:case 23:return t.lanes=0,Bg(e,t,n)}return Ln(e,t,n)}var Gg,fd,Jg,Qg;Gg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};fd=function(){};Jg=function(e,t,n,o){var r=e.memoizedProps;if(r!==o){e=t.stateNode,qo($n.current);var i=null;switch(n){case"input":r=Ac(e,r),o=Ac(e,o),i=[];break;case"select":r=He({},r,{value:void 0}),o=He({},o,{value:void 0}),i=[];break;case"textarea":r=Uc(e,r),o=Uc(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=Ra)}Dc(n,o);var s;n=null;for(c in r)if(!o.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Bi.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in o){var l=o[c];if(a=r!=null?r[c]:void 0,o.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Bi.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Oe("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Qg=function(e,t,n,o){n!==o&&(t.flags|=4)};function ui(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&14680064,o|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function Ew(e,t,n){var o=t.pendingProps;switch(pu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return Ct(t.type)&&Aa(),dt(t),null;case 3:return o=t.stateNode,Dr(),qe(jt),qe(yt),wu(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Bs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nn!==null&&(wd(nn),nn=null))),fd(e,t),dt(t),null;case 5:xu(t);var r=qo(ts.current);if(n=t.type,e!==null&&t.stateNode!=null)Jg(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(B(166));return dt(t),null}if(e=qo($n.current),Bs(t)){o=t.stateNode,n=t.type;var i=t.memoizedProps;switch(o[yn]=t,o[Zi]=i,e=(t.mode&1)!==0,n){case"dialog":Oe("cancel",o),Oe("close",o);break;case"iframe":case"object":case"embed":Oe("load",o);break;case"video":case"audio":for(r=0;r<$i.length;r++)Oe($i[r],o);break;case"source":Oe("error",o);break;case"img":case"image":case"link":Oe("error",o),Oe("load",o);break;case"details":Oe("toggle",o);break;case"input":wf(o,i),Oe("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",o);break;case"textarea":$f(o,i),Oe("invalid",o)}Dc(n,i),r=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?o.textContent!==a&&(i.suppressHydrationWarning!==!0&&Fs(o.textContent,a,e),r=["children",a]):typeof a=="number"&&o.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Fs(o.textContent,a,e),r=["children",""+a]):Bi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Oe("scroll",o)}switch(n){case"input":Rs(o),Sf(o,i,!0);break;case"textarea":Rs(o),kf(o);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(o.onclick=Ra)}o=r,t.updateQueue=o,o!==null&&(t.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ky(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=s.createElement(n,{is:o.is}):(e=s.createElement(n),n==="select"&&(s=e,o.multiple?s.multiple=!0:o.size&&(s.size=o.size))):e=s.createElementNS(e,n),e[yn]=t,e[Zi]=o,Gg(e,t,!1,!1),t.stateNode=e;e:{switch(s=zc(n,o),n){case"dialog":Oe("cancel",e),Oe("close",e),r=o;break;case"iframe":case"object":case"embed":Oe("load",e),r=o;break;case"video":case"audio":for(r=0;r<$i.length;r++)Oe($i[r],e);r=o;break;case"source":Oe("error",e),r=o;break;case"img":case"image":case"link":Oe("error",e),Oe("load",e),r=o;break;case"details":Oe("toggle",e),r=o;break;case"input":wf(e,o),r=Ac(e,o),Oe("invalid",e);break;case"option":r=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},r=He({},o,{value:void 0}),Oe("invalid",e);break;case"textarea":$f(e,o),r=Uc(e,o),Oe("invalid",e);break;default:r=o}Dc(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?jy(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ty(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Hi(e,l):typeof l=="number"&&Hi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Bi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Oe("scroll",e):l!=null&&Yd(e,i,l,s))}switch(n){case"input":Rs(e),Sf(e,o,!1);break;case"textarea":Rs(e),kf(e);break;case"option":o.value!=null&&e.setAttribute("value",""+yo(o.value));break;case"select":e.multiple=!!o.multiple,i=o.value,i!=null?$r(e,!!o.multiple,i,!1):o.defaultValue!=null&&$r(e,!!o.multiple,o.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Ra)}switch(n){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return dt(t),null;case 6:if(e&&t.stateNode!=null)Qg(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(B(166));if(n=qo(ts.current),qo($n.current),Bs(t)){if(o=t.stateNode,n=t.memoizedProps,o[yn]=t,(i=o.nodeValue!==n)&&(e=Rt,e!==null))switch(e.tag){case 3:Fs(o.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fs(o.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else o=(n.nodeType===9?n:n.ownerDocument).createTextNode(o),o[yn]=t,t.stateNode=o}return dt(t),null;case 13:if(qe(Fe),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&It!==null&&t.mode&1&&!(t.flags&128))mg(),Ur(),t.flags|=98560,i=!1;else if(i=Bs(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[yn]=t}else Ur(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dt(t),i=!1}else nn!==null&&(wd(nn),nn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,t.mode&1&&(e===null||Fe.current&1?et===0&&(et=3):Ou())),t.updateQueue!==null&&(t.flags|=4),dt(t),null);case 4:return Dr(),fd(e,t),e===null&&Yi(t.stateNode.containerInfo),dt(t),null;case 10:return yu(t.type._context),dt(t),null;case 17:return Ct(t.type)&&Aa(),dt(t),null;case 19:if(qe(Fe),i=t.memoizedState,i===null)return dt(t),null;if(o=(t.flags&128)!==0,s=i.rendering,s===null)if(o)ui(i,!1);else{if(et!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Fa(e),s!==null){for(t.flags|=128,ui(i,!1),o=s.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=n,n=t.child;n!==null;)i=n,e=o,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ne(Fe,Fe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ke()>Fr&&(t.flags|=128,o=!0,ui(i,!1),t.lanes=4194304)}else{if(!o)if(e=Fa(s),e!==null){if(t.flags|=128,o=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ui(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!De)return dt(t),null}else 2*Ke()-i.renderingStartTime>Fr&&n!==1073741824&&(t.flags|=128,o=!0,ui(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ke(),t.sibling=null,n=Fe.current,Ne(Fe,o?n&1|2:n&1),t):(dt(t),null);case 22:case 23:return Iu(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?Et&1073741824&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Pw(e,t){switch(pu(t),t.tag){case 1:return Ct(t.type)&&Aa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dr(),qe(jt),qe(yt),wu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xu(t),null;case 13:if(qe(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Fe),null;case 4:return Dr(),null;case 10:return yu(t.type._context),null;case 22:case 23:return Iu(),null;case 24:return null;default:return null}}var Ws=!1,ft=!1,Iw=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Ve(e,t,o)}else n.current=null}function md(e,t,n){try{n()}catch(o){Ve(e,t,o)}}var fm=!1;function Ow(e,t){if(Yc=Pa,e=tg(),du(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,f=0,m=e,h=null;t:for(;;){for(var y;m!==n||r!==0&&m.nodeType!==3||(a=s+r),m!==i||o!==0&&m.nodeType!==3||(l=s+o),m.nodeType===3&&(s+=m.nodeValue.length),(y=m.firstChild)!==null;)h=m,m=y;for(;;){if(m===e)break t;if(h===n&&++c===r&&(a=s),h===i&&++f===o&&(l=s),(y=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xc={focusedElem:e,selectionRange:n},Pa=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,v=g.memoizedState,p=t.stateNode,u=p.getSnapshotBeforeUpdate(t.elementType===t.type?b:en(t.type,b),v);p.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(S){Ve(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return g=fm,fm=!1,g}function Ii(e,t,n){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&e)===e){var i=r.destroy;r.destroy=void 0,i!==void 0&&md(t,n,i)}r=r.next}while(r!==o)}}function vl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var o=n.create;n.destroy=o()}n=n.next}while(n!==t)}}function hd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Yg(e){var t=e.alternate;t!==null&&(e.alternate=null,Yg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yn],delete t[Zi],delete t[td],delete t[hw],delete t[yw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Xg(e){return e.tag===5||e.tag===3||e.tag===4}function mm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ra));else if(o!==4&&(e=e.child,e!==null))for(yd(e,t,n),e=e.sibling;e!==null;)yd(e,t,n),e=e.sibling}function gd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(gd(e,t,n),e=e.sibling;e!==null;)gd(e,t,n),e=e.sibling}var it=null,tn=!1;function Vn(e,t,n){for(n=n.child;n!==null;)Zg(e,t,n),n=n.sibling}function Zg(e,t,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(dl,n)}catch{}switch(n.tag){case 5:ft||xr(n,t);case 6:var o=it,r=tn;it=null,Vn(e,t,n),it=o,tn=r,it!==null&&(tn?(e=it,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):it.removeChild(n.stateNode));break;case 18:it!==null&&(tn?(e=it,n=n.stateNode,e.nodeType===8?oc(e.parentNode,n):e.nodeType===1&&oc(e,n),Gi(e)):oc(it,n.stateNode));break;case 4:o=it,r=tn,it=n.stateNode.containerInfo,tn=!0,Vn(e,t,n),it=o,tn=r;break;case 0:case 11:case 14:case 15:if(!ft&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&md(n,t,s),r=r.next}while(r!==o)}Vn(e,t,n);break;case 1:if(!ft&&(xr(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(a){Ve(n,t,a)}Vn(e,t,n);break;case 21:Vn(e,t,n);break;case 22:n.mode&1?(ft=(o=ft)||n.memoizedState!==null,Vn(e,t,n),ft=o):Vn(e,t,n);break;default:Vn(e,t,n)}}function hm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Iw),t.forEach(function(o){var r=Fw.bind(null,e,o);n.has(o)||(n.add(o),o.then(r,r))})}}function Yt(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var r=n[o];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:it=a.stateNode,tn=!1;break e;case 3:it=a.stateNode.containerInfo,tn=!0;break e;case 4:it=a.stateNode.containerInfo,tn=!0;break e}a=a.return}if(it===null)throw Error(B(160));Zg(i,s,r),it=null,tn=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){Ve(r,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ev(t,e),t=t.sibling}function ev(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yt(t,e),pn(e),o&4){try{Ii(3,e,e.return),vl(3,e)}catch(b){Ve(e,e.return,b)}try{Ii(5,e,e.return)}catch(b){Ve(e,e.return,b)}}break;case 1:Yt(t,e),pn(e),o&512&&n!==null&&xr(n,n.return);break;case 5:if(Yt(t,e),pn(e),o&512&&n!==null&&xr(n,n.return),e.flags&32){var r=e.stateNode;try{Hi(r,"")}catch(b){Ve(e,e.return,b)}}if(o&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Sy(r,i),zc(a,s);var c=zc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],m=l[s+1];f==="style"?jy(r,m):f==="dangerouslySetInnerHTML"?Ty(r,m):f==="children"?Hi(r,m):Yd(r,f,m,c)}switch(a){case"input":Mc(r,i);break;case"textarea":$y(r,i);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?$r(r,!!i.multiple,y,!1):h!==!!i.multiple&&(i.defaultValue!=null?$r(r,!!i.multiple,i.defaultValue,!0):$r(r,!!i.multiple,i.multiple?[]:"",!1))}r[Zi]=i}catch(b){Ve(e,e.return,b)}}break;case 6:if(Yt(t,e),pn(e),o&4){if(e.stateNode===null)throw Error(B(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(b){Ve(e,e.return,b)}}break;case 3:if(Yt(t,e),pn(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Gi(t.containerInfo)}catch(b){Ve(e,e.return,b)}break;case 4:Yt(t,e),pn(e);break;case 13:Yt(t,e),pn(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Eu=Ke())),o&4&&hm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ft=(c=ft)||f,Yt(t,e),ft=c):Yt(t,e),pn(e),o&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(Z=e,f=e.child;f!==null;){for(m=Z=f;Z!==null;){switch(h=Z,y=h.child,h.tag){case 0:case 11:case 14:case 15:Ii(4,h,h.return);break;case 1:xr(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){o=h,n=h.return;try{t=o,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(b){Ve(o,n,b)}}break;case 5:xr(h,h.return);break;case 22:if(h.memoizedState!==null){gm(m);continue}}y!==null?(y.return=h,Z=y):gm(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{r=m.stateNode,c?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=m.stateNode,l=m.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=_y("display",s))}catch(b){Ve(e,e.return,b)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=c?"":m.memoizedProps}catch(b){Ve(e,e.return,b)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Yt(t,e),pn(e),o&4&&hm(e);break;case 21:break;default:Yt(t,e),pn(e)}}function pn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Xg(n)){var o=n;break e}n=n.return}throw Error(B(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(Hi(r,""),o.flags&=-33);var i=mm(e);gd(e,i,r);break;case 3:case 4:var s=o.stateNode.containerInfo,a=mm(e);yd(e,a,s);break;default:throw Error(B(161))}}catch(l){Ve(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rw(e,t,n){Z=e,tv(e)}function tv(e,t,n){for(var o=(e.mode&1)!==0;Z!==null;){var r=Z,i=r.child;if(r.tag===22&&o){var s=r.memoizedState!==null||Ws;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||ft;a=Ws;var c=ft;if(Ws=s,(ft=l)&&!c)for(Z=r;Z!==null;)s=Z,l=s.child,s.tag===22&&s.memoizedState!==null?vm(r):l!==null?(l.return=s,Z=l):vm(r);for(;i!==null;)Z=i,tv(i),i=i.sibling;Z=r,Ws=a,ft=c}ym(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,Z=i):ym(e)}}function ym(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ft||vl(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!ft)if(n===null)o.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:en(t.type,n.memoizedProps);o.componentDidUpdate(r,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&em(t,i,o);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}em(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Gi(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}ft||t.flags&512&&hd(t)}catch(h){Ve(t,t.return,h)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function gm(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function vm(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{vl(4,t)}catch(l){Ve(t,n,l)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var r=t.return;try{o.componentDidMount()}catch(l){Ve(t,r,l)}}var i=t.return;try{hd(t)}catch(l){Ve(t,i,l)}break;case 5:var s=t.return;try{hd(t)}catch(l){Ve(t,s,l)}}}catch(l){Ve(t,t.return,l)}if(t===e){Z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Z=a;break}Z=t.return}}var Aw=Math.ceil,Va=zn.ReactCurrentDispatcher,Cu=zn.ReactCurrentOwner,Kt=zn.ReactCurrentBatchConfig,be=0,ot=null,Ge=null,at=0,Et=0,wr=xo(0),et=0,is=null,Vo=0,bl=0,Nu=0,Oi=null,Tt=null,Eu=0,Fr=1/0,jn=null,Wa=!1,vd=null,po=null,Ks=!1,ro=null,Ka=0,Ri=0,bd=null,fa=-1,ma=0;function xt(){return be&6?Ke():fa!==-1?fa:fa=Ke()}function fo(e){return e.mode&1?be&2&&at!==0?at&-at:vw.transition!==null?(ma===0&&(ma=Ly()),ma):(e=ke,e!==0||(e=window.event,e=e===void 0?16:Wy(e.type)),e):1}function sn(e,t,n,o){if(50<Ri)throw Ri=0,bd=null,Error(B(185));Ss(e,n,o),(!(be&2)||e!==ot)&&(e===ot&&(!(be&2)&&(bl|=n),et===4&&to(e,at)),Nt(e,o),n===1&&be===0&&!(t.mode&1)&&(Fr=Ke()+500,hl&&wo()))}function Nt(e,t){var n=e.callbackNode;v0(e,t);var o=Ea(e,e===ot?at:0);if(o===0)n!==null&&jf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&jf(n),t===1)e.tag===0?gw(bm.bind(null,e)):ug(bm.bind(null,e)),fw(function(){!(be&6)&&wo()}),n=null;else{switch(Dy(o)){case 1:n=nu;break;case 4:n=qy;break;case 16:n=Na;break;case 536870912:n=Uy;break;default:n=Na}n=cv(n,nv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function nv(e,t){if(fa=-1,ma=0,be&6)throw Error(B(327));var n=e.callbackNode;if(Cr()&&e.callbackNode!==n)return null;var o=Ea(e,e===ot?at:0);if(o===0)return null;if(o&30||o&e.expiredLanes||t)t=Ga(e,o);else{t=o;var r=be;be|=2;var i=rv();(ot!==e||at!==t)&&(jn=null,Fr=Ke()+500,Do(e,t));do try{Uw();break}catch(a){ov(e,a)}while(!0);hu(),Va.current=i,be=r,Ge!==null?t=0:(ot=null,at=0,t=et)}if(t!==0){if(t===2&&(r=Wc(e),r!==0&&(o=r,t=xd(e,r))),t===1)throw n=is,Do(e,0),to(e,o),Nt(e,Ke()),n;if(t===6)to(e,o);else{if(r=e.current.alternate,!(o&30)&&!Mw(r)&&(t=Ga(e,o),t===2&&(i=Wc(e),i!==0&&(o=i,t=xd(e,i))),t===1))throw n=is,Do(e,0),to(e,o),Nt(e,Ke()),n;switch(e.finishedWork=r,e.finishedLanes=o,t){case 0:case 1:throw Error(B(345));case 2:No(e,Tt,jn);break;case 3:if(to(e,o),(o&130023424)===o&&(t=Eu+500-Ke(),10<t)){if(Ea(e,0)!==0)break;if(r=e.suspendedLanes,(r&o)!==o){xt(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=ed(No.bind(null,e,Tt,jn),t);break}No(e,Tt,jn);break;case 4:if(to(e,o),(o&4194240)===o)break;for(t=e.eventTimes,r=-1;0<o;){var s=31-rn(o);i=1<<s,s=t[s],s>r&&(r=s),o&=~i}if(o=r,o=Ke()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Aw(o/1960))-o,10<o){e.timeoutHandle=ed(No.bind(null,e,Tt,jn),o);break}No(e,Tt,jn);break;case 5:No(e,Tt,jn);break;default:throw Error(B(329))}}}return Nt(e,Ke()),e.callbackNode===n?nv.bind(null,e):null}function xd(e,t){var n=Oi;return e.current.memoizedState.isDehydrated&&(Do(e,t).flags|=256),e=Ga(e,t),e!==2&&(t=Tt,Tt=n,t!==null&&wd(t)),e}function wd(e){Tt===null?Tt=e:Tt.push.apply(Tt,e)}function Mw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var o=0;o<n.length;o++){var r=n[o],i=r.getSnapshot;r=r.value;try{if(!cn(i(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function to(e,t){for(t&=~Nu,t&=~bl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rn(t),o=1<<n;e[n]=-1,t&=~o}}function bm(e){if(be&6)throw Error(B(327));Cr();var t=Ea(e,0);if(!(t&1))return Nt(e,Ke()),null;var n=Ga(e,t);if(e.tag!==0&&n===2){var o=Wc(e);o!==0&&(t=o,n=xd(e,o))}if(n===1)throw n=is,Do(e,0),to(e,t),Nt(e,Ke()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,No(e,Tt,jn),Nt(e,Ke()),null}function Pu(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Fr=Ke()+500,hl&&wo())}}function Wo(e){ro!==null&&ro.tag===0&&!(be&6)&&Cr();var t=be;be|=1;var n=Kt.transition,o=ke;try{if(Kt.transition=null,ke=1,e)return e()}finally{ke=o,Kt.transition=n,be=t,!(be&6)&&wo()}}function Iu(){Et=wr.current,qe(wr)}function Do(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,pw(n)),Ge!==null)for(n=Ge.return;n!==null;){var o=n;switch(pu(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&Aa();break;case 3:Dr(),qe(jt),qe(yt),wu();break;case 5:xu(o);break;case 4:Dr();break;case 13:qe(Fe);break;case 19:qe(Fe);break;case 10:yu(o.type._context);break;case 22:case 23:Iu()}n=n.return}if(ot=e,Ge=e=mo(e.current,null),at=Et=t,et=0,is=null,Nu=bl=Vo=0,Tt=Oi=null,Mo!==null){for(t=0;t<Mo.length;t++)if(n=Mo[t],o=n.interleaved,o!==null){n.interleaved=null;var r=o.next,i=n.pending;if(i!==null){var s=i.next;i.next=r,o.next=s}n.pending=o}Mo=null}return e}function ov(e,t){do{var n=Ge;try{if(hu(),da.current=Ha,Ba){for(var o=Be.memoizedState;o!==null;){var r=o.queue;r!==null&&(r.pending=null),o=o.next}Ba=!1}if(Ho=0,nt=Ye=Be=null,Pi=!1,ns=0,Cu.current=null,n===null||n.return===null){et=1,is=t,Ge=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=at,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,f=a,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var y=sm(s);if(y!==null){y.flags&=-257,am(y,s,a,i,t),y.mode&1&&im(i,c,t),t=y,l=c;var g=t.updateQueue;if(g===null){var b=new Set;b.add(l),t.updateQueue=b}else g.add(l);break e}else{if(!(t&1)){im(i,c,t),Ou();break e}l=Error(B(426))}}else if(De&&a.mode&1){var v=sm(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),am(v,s,a,i,t),fu(zr(l,a));break e}}i=l=zr(l,a),et!==4&&(et=2),Oi===null?Oi=[i]:Oi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=Dg(i,l,t);Zf(i,p);break e;case 1:a=l;var u=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof u.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(po===null||!po.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=zg(i,a,t);Zf(i,S);break e}}i=i.return}while(i!==null)}sv(n)}catch(T){t=T,Ge===n&&n!==null&&(Ge=n=n.return);continue}break}while(!0)}function rv(){var e=Va.current;return Va.current=Ha,e===null?Ha:e}function Ou(){(et===0||et===3||et===2)&&(et=4),ot===null||!(Vo&268435455)&&!(bl&268435455)||to(ot,at)}function Ga(e,t){var n=be;be|=2;var o=rv();(ot!==e||at!==t)&&(jn=null,Do(e,t));do try{qw();break}catch(r){ov(e,r)}while(!0);if(hu(),be=n,Va.current=o,Ge!==null)throw Error(B(261));return ot=null,at=0,et}function qw(){for(;Ge!==null;)iv(Ge)}function Uw(){for(;Ge!==null&&!c0();)iv(Ge)}function iv(e){var t=lv(e.alternate,e,Et);e.memoizedProps=e.pendingProps,t===null?sv(e):Ge=t,Cu.current=null}function sv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Pw(n,t),n!==null){n.flags&=32767,Ge=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{et=6,Ge=null;return}}else if(n=Ew(n,t,Et),n!==null){Ge=n;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);et===0&&(et=5)}function No(e,t,n){var o=ke,r=Kt.transition;try{Kt.transition=null,ke=1,Lw(e,t,n,o)}finally{Kt.transition=r,ke=o}return null}function Lw(e,t,n,o){do Cr();while(ro!==null);if(be&6)throw Error(B(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(b0(e,i),e===ot&&(Ge=ot=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ks||(Ks=!0,cv(Na,function(){return Cr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Kt.transition,Kt.transition=null;var s=ke;ke=1;var a=be;be|=4,Cu.current=null,Ow(e,n),ev(n,e),iw(Xc),Pa=!!Yc,Xc=Yc=null,e.current=n,Rw(n),d0(),be=a,ke=s,Kt.transition=i}else e.current=n;if(Ks&&(Ks=!1,ro=e,Ka=r),i=e.pendingLanes,i===0&&(po=null),f0(n.stateNode),Nt(e,Ke()),t!==null)for(o=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],o(r.value,{componentStack:r.stack,digest:r.digest});if(Wa)throw Wa=!1,e=vd,vd=null,e;return Ka&1&&e.tag!==0&&Cr(),i=e.pendingLanes,i&1?e===bd?Ri++:(Ri=0,bd=e):Ri=0,wo(),null}function Cr(){if(ro!==null){var e=Dy(Ka),t=Kt.transition,n=ke;try{if(Kt.transition=null,ke=16>e?16:e,ro===null)var o=!1;else{if(e=ro,ro=null,Ka=0,be&6)throw Error(B(331));var r=be;for(be|=4,Z=e.current;Z!==null;){var i=Z,s=i.child;if(Z.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Z=c;Z!==null;){var f=Z;switch(f.tag){case 0:case 11:case 15:Ii(8,f,i)}var m=f.child;if(m!==null)m.return=f,Z=m;else for(;Z!==null;){f=Z;var h=f.sibling,y=f.return;if(Yg(f),f===c){Z=null;break}if(h!==null){h.return=y,Z=h;break}Z=y}}}var g=i.alternate;if(g!==null){var b=g.child;if(b!==null){g.child=null;do{var v=b.sibling;b.sibling=null,b=v}while(b!==null)}}Z=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Z=s;else e:for(;Z!==null;){if(i=Z,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ii(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,Z=p;break e}Z=i.return}}var u=e.current;for(Z=u;Z!==null;){s=Z;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,Z=x;else e:for(s=u;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:vl(9,a)}}catch(T){Ve(a,a.return,T)}if(a===s){Z=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Z=S;break e}Z=a.return}}if(be=r,wo(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(dl,e)}catch{}o=!0}return o}finally{ke=n,Kt.transition=t}}return!1}function xm(e,t,n){t=zr(n,t),t=Dg(e,t,1),e=uo(e,t,1),t=xt(),e!==null&&(Ss(e,1,t),Nt(e,t))}function Ve(e,t,n){if(e.tag===3)xm(e,e,n);else for(;t!==null;){if(t.tag===3){xm(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(po===null||!po.has(o))){e=zr(n,e),e=zg(t,e,1),t=uo(t,e,1),e=xt(),t!==null&&(Ss(t,1,e),Nt(t,e));break}}t=t.return}}function Dw(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=xt(),e.pingedLanes|=e.suspendedLanes&n,ot===e&&(at&n)===n&&(et===4||et===3&&(at&130023424)===at&&500>Ke()-Eu?Do(e,0):Nu|=n),Nt(e,t)}function av(e,t){t===0&&(e.mode&1?(t=qs,qs<<=1,!(qs&130023424)&&(qs=4194304)):t=1);var n=xt();e=Un(e,t),e!==null&&(Ss(e,t,n),Nt(e,n))}function zw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),av(e,n)}function Fw(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(B(314))}o!==null&&o.delete(t),av(e,n)}var lv;lv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)_t=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _t=!1,Nw(e,t,n);_t=!!(e.flags&131072)}else _t=!1,De&&t.flags&1048576&&pg(t,Ua,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;pa(e,t),e=t.pendingProps;var r=qr(t,yt.current);jr(t,n),r=$u(null,t,o,e,r,n);var i=ku();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ct(o)?(i=!0,Ma(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,vu(t),r.updater=gl,t.stateNode=r,r._reactInternals=t,ad(t,o,e,n),t=dd(null,t,o,!0,i,n)):(t.tag=0,De&&i&&uu(t),gt(null,t,r,n),t=t.child),t;case 16:o=t.elementType;e:{switch(pa(e,t),e=t.pendingProps,r=o._init,o=r(o._payload),t.type=o,r=t.tag=Hw(o),e=en(o,e),r){case 0:t=cd(null,t,o,e,n);break e;case 1:t=dm(null,t,o,e,n);break e;case 11:t=lm(null,t,o,e,n);break e;case 14:t=cm(null,t,o,en(o.type,e),n);break e}throw Error(B(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:en(o,r),cd(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:en(o,r),dm(e,t,o,r,n);case 3:e:{if(Vg(t),e===null)throw Error(B(387));o=t.pendingProps,i=t.memoizedState,r=i.element,vg(e,t),za(t,o,null,n);var s=t.memoizedState;if(o=s.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=zr(Error(B(423)),t),t=um(e,t,o,n,r);break e}else if(o!==r){r=zr(Error(B(424)),t),t=um(e,t,o,n,r);break e}else for(It=co(t.stateNode.containerInfo.firstChild),Rt=t,De=!0,nn=null,n=yg(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ur(),o===r){t=Ln(e,t,n);break e}gt(e,t,o,n)}t=t.child}return t;case 5:return bg(t),e===null&&rd(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,s=r.children,Zc(o,r)?s=null:i!==null&&Zc(o,i)&&(t.flags|=32),Hg(e,t),gt(e,t,s,n),t.child;case 6:return e===null&&rd(t),null;case 13:return Wg(e,t,n);case 4:return bu(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Lr(t,null,o,n):gt(e,t,o,n),t.child;case 11:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:en(o,r),lm(e,t,o,r,n);case 7:return gt(e,t,t.pendingProps,n),t.child;case 8:return gt(e,t,t.pendingProps.children,n),t.child;case 12:return gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,r=t.pendingProps,i=t.memoizedProps,s=r.value,Ne(La,o._currentValue),o._currentValue=s,i!==null)if(cn(i.value,s)){if(i.children===r.children&&!jt.current){t=Ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===o){if(i.tag===1){l=On(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),id(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(B(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),id(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}gt(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,o=t.pendingProps.children,jr(t,n),r=Gt(r),o=o(r),t.flags|=1,gt(e,t,o,n),t.child;case 14:return o=t.type,r=en(o,t.pendingProps),r=en(o.type,r),cm(e,t,o,r,n);case 15:return Fg(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:en(o,r),pa(e,t),t.tag=1,Ct(o)?(e=!0,Ma(t)):e=!1,jr(t,n),Lg(t,o,r),ad(t,o,r,n),dd(null,t,o,!0,e,n);case 19:return Kg(e,t,n);case 22:return Bg(e,t,n)}throw Error(B(156,t.tag))};function cv(e,t){return My(e,t)}function Bw(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bt(e,t,n,o){return new Bw(e,t,n,o)}function Ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hw(e){if(typeof e=="function")return Ru(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zd)return 11;if(e===eu)return 14}return 2}function mo(e,t){var n=e.alternate;return n===null?(n=Bt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ha(e,t,n,o,r,i){var s=2;if(o=e,typeof e=="function")Ru(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ur:return zo(n.children,r,i,t);case Xd:s=8,r|=8;break;case Pc:return e=Bt(12,n,t,r|2),e.elementType=Pc,e.lanes=i,e;case Ic:return e=Bt(13,n,t,r),e.elementType=Ic,e.lanes=i,e;case Oc:return e=Bt(19,n,t,r),e.elementType=Oc,e.lanes=i,e;case by:return xl(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gy:s=10;break e;case vy:s=9;break e;case Zd:s=11;break e;case eu:s=14;break e;case Xn:s=16,o=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=Bt(s,n,t,r),t.elementType=e,t.type=o,t.lanes=i,t}function zo(e,t,n,o){return e=Bt(7,e,o,t),e.lanes=n,e}function xl(e,t,n,o){return e=Bt(22,e,o,t),e.elementType=by,e.lanes=n,e.stateNode={isHidden:!1},e}function uc(e,t,n){return e=Bt(6,e,null,t),e.lanes=n,e}function pc(e,t,n){return t=Bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vw(e,t,n,o,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wl(0),this.expirationTimes=Wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wl(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Au(e,t,n,o,r,i,s,a,l){return e=new Vw(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Bt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vu(i),e}function Ww(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dr,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}function dv(e){if(!e)return go;e=e._reactInternals;e:{if(Yo(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(Ct(n))return dg(e,n,t)}return t}function uv(e,t,n,o,r,i,s,a,l){return e=Au(n,o,!0,e,r,i,s,a,l),e.context=dv(null),n=e.current,o=xt(),r=fo(n),i=On(o,r),i.callback=t??null,uo(n,i,r),e.current.lanes=r,Ss(e,r,o),Nt(e,o),e}function wl(e,t,n,o){var r=t.current,i=xt(),s=fo(r);return n=dv(n),t.context===null?t.context=n:t.pendingContext=n,t=On(i,s),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=uo(r,t,s),e!==null&&(sn(e,r,s,i),ca(e,r,s)),s}function Ja(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function wm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Mu(e,t){wm(e,t),(e=e.alternate)&&wm(e,t)}function Kw(){return null}var pv=typeof reportError=="function"?reportError:function(e){console.error(e)};function qu(e){this._internalRoot=e}Sl.prototype.render=qu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));wl(e,t,null,null)};Sl.prototype.unmount=qu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wo(function(){wl(null,e,null,null)}),t[qn]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var t=By();e={blockedOn:null,target:e,priority:t};for(var n=0;n<eo.length&&t!==0&&t<eo[n].priority;n++);eo.splice(n,0,e),n===0&&Vy(e)}};function Uu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Sm(){}function Gw(e,t,n,o,r){if(r){if(typeof o=="function"){var i=o;o=function(){var c=Ja(s);i.call(c)}}var s=uv(t,o,e,0,null,!1,!1,"",Sm);return e._reactRootContainer=s,e[qn]=s.current,Yi(e.nodeType===8?e.parentNode:e),Wo(),s}for(;r=e.lastChild;)e.removeChild(r);if(typeof o=="function"){var a=o;o=function(){var c=Ja(l);a.call(c)}}var l=Au(e,0,!1,null,null,!1,!1,"",Sm);return e._reactRootContainer=l,e[qn]=l.current,Yi(e.nodeType===8?e.parentNode:e),Wo(function(){wl(t,l,n,o)}),l}function kl(e,t,n,o,r){var i=n._reactRootContainer;if(i){var s=i;if(typeof r=="function"){var a=r;r=function(){var l=Ja(s);a.call(l)}}wl(t,s,e,r)}else s=Gw(n,t,e,r,o);return Ja(s)}zy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Si(t.pendingLanes);n!==0&&(ou(t,n|1),Nt(t,Ke()),!(be&6)&&(Fr=Ke()+500,wo()))}break;case 13:Wo(function(){var o=Un(e,1);if(o!==null){var r=xt();sn(o,e,1,r)}}),Mu(e,1)}};ru=function(e){if(e.tag===13){var t=Un(e,134217728);if(t!==null){var n=xt();sn(t,e,134217728,n)}Mu(e,134217728)}};Fy=function(e){if(e.tag===13){var t=fo(e),n=Un(e,t);if(n!==null){var o=xt();sn(n,e,t,o)}Mu(e,t)}};By=function(){return ke};Hy=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};Bc=function(e,t,n){switch(t){case"input":if(Mc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var r=ml(o);if(!r)throw Error(B(90));wy(o),Mc(o,r)}}}break;case"textarea":$y(e,n);break;case"select":t=n.value,t!=null&&$r(e,!!n.multiple,t,!1)}};Ey=Pu;Py=Wo;var Jw={usingClientEntryPoint:!1,Events:[ks,hr,ml,Cy,Ny,Pu]},pi={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qw={bundleType:pi.bundleType,version:pi.version,rendererPackageName:pi.rendererPackageName,rendererConfig:pi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:zn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ry(e),e===null?null:e.stateNode},findFiberByHostInstance:pi.findFiberByHostInstance||Kw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{dl=Gs.inject(Qw),Sn=Gs}catch{}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jw;qt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uu(t))throw Error(B(200));return Ww(e,t,null,n)};qt.createRoot=function(e,t){if(!Uu(e))throw Error(B(299));var n=!1,o="",r=pv;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Au(e,1,!1,null,null,n,!1,o,r),e[qn]=t.current,Yi(e.nodeType===8?e.parentNode:e),new qu(t)};qt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=Ry(t),e=e===null?null:e.stateNode,e};qt.flushSync=function(e){return Wo(e)};qt.hydrate=function(e,t,n){if(!$l(t))throw Error(B(200));return kl(null,e,t,!0,n)};qt.hydrateRoot=function(e,t,n){if(!Uu(e))throw Error(B(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",s=pv;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uv(t,null,e,1,n??null,r,!1,i,s),e[qn]=t.current,Yi(e),o)for(e=0;e<o.length;e++)n=o[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Sl(t)};qt.render=function(e,t,n){if(!$l(t))throw Error(B(200));return kl(null,e,t,!1,n)};qt.unmountComponentAtNode=function(e){if(!$l(e))throw Error(B(40));return e._reactRootContainer?(Wo(function(){kl(null,null,e,!1,function(){e._reactRootContainer=null,e[qn]=null})}),!0):!1};qt.unstable_batchedUpdates=Pu;qt.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!$l(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return kl(e,t,n,!1,o)};qt.version="18.3.1-next-f1338f8080-20240426";function fv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fv)}catch(e){console.error(e)}}fv(),fy.exports=qt;var Lu=fy.exports;const Yw=Hd(Lu);var $m=Lu;Nc.createRoot=$m.createRoot,Nc.hydrateRoot=$m.hydrateRoot;const km=e=>{let t;const n=new Set,o=(c,f)=>{const m=typeof c=="function"?c(t):c;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,h))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(o,r,a);return a},Xw=e=>e?km(e):km,Zw=e=>e;function eS(e,t=Zw){const n=te.useSyncExternalStore(e.subscribe,te.useCallback(()=>t(e.getState()),[e,t]),te.useCallback(()=>t(e.getInitialState()),[e,t]));return te.useDebugValue(n),n}const Tm=e=>{const t=Xw(e),n=o=>eS(t,o);return Object.assign(n,t),n},Du=e=>e?Tm(e):Tm;function tS(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const s=l=>l===null?null:JSON.parse(l,void 0),a=(i=n.getItem(r))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const Sd=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return Sd(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return Sd(o)(n)}}}},nS=(e,t)=>(n,o,r)=>{let i={storage:tS(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,p)=>({...p,...v}),...t},s=!1,a=0;const l=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},o,r);const m=()=>{const v=i.partialize({...o()});return f.setItem(i.name,{state:v,version:i.version})},h=r.setState;r.setState=(v,p)=>(h(v,p),m());const y=e((...v)=>(n(...v),m()),o,r);r.getInitialState=()=>y;let g;const b=()=>{var v,p;if(!f)return;const u=++a;s=!1,l.forEach(S=>{var T;return S((T=o())!=null?T:y)});const x=((p=i.onRehydrateStorage)==null?void 0:p.call(i,(v=o())!=null?v:y))||void 0;return Sd(f.getItem.bind(f))(i.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==i.version){if(i.migrate){const T=i.migrate(S.state,S.version);return T instanceof Promise?T.then(N=>[!0,N]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var T;if(u!==a)return;const[N,$]=S;if(g=i.merge($,(T=o())!=null?T:y),n(g,!0),N)return m()}).then(()=>{u===a&&(x==null||x(o(),void 0),g=o(),s=!0,c.forEach(S=>S(g)))}).catch(S=>{u===a&&(x==null||x(void 0,S))})};return r.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:v=>(l.add(v),()=>{l.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||b(),g||y},oS=nS,ss=["editor-to-agent","agent-to-editor"],as=["request","response","notification","error","unknown"],rS={directions:new Set(ss),kinds:new Set(as),search:"",showStreams:!0};function iS(e){var n,o;if(e.kind!=="notification"||e.method!=="session/update")return!1;const t=(n=e.payload)==null?void 0:n.params;return((o=t==null?void 0:t.update)==null?void 0:o.sessionUpdate)==="agent_message_chunk"}const ne=Du()(oS(e=>({session:null,messages:[],connection:"idle",lastError:null,selectedSeq:null,replayDone:!1,filters:rS,playback:{cap:null,playing:!1,speed:1},detailTab:"tree",clearedUpToSeq:null,handleEvent:t=>{switch(t.type){case"session.start":e(n=>{const o=n.session!==null&&n.session.id===t.session.id,r=n.session===null,i=o||r;return{session:t.session,messages:[],selectedSeq:i?n.selectedSeq:null,replayDone:!1,clearedUpToSeq:i?n.clearedUpToSeq:null,playback:i?n.playback:{...n.playback,cap:null,playing:!1}}});return;case"message":e(n=>n.clearedUpToSeq!==null&&t.message.seq<=n.clearedUpToSeq?{}:{messages:[...n.messages,t.message]});return;case"replay.done":e({replayDone:!0});return;case"session.end":e({session:t.session});return}},setConnection:(t,n=null)=>e({connection:t,lastError:n}),select:t=>e({selectedSeq:t}),setSearch:t=>e(n=>({filters:{...n.filters,search:t}})),toggleDirection:t=>e(n=>{const o=new Set(n.filters.directions);return o.has(t)?o.delete(t):o.add(t),{filters:{...n.filters,directions:o}}}),toggleKind:t=>e(n=>{const o=new Set(n.filters.kinds);return o.has(t)?o.delete(t):o.add(t),{filters:{...n.filters,kinds:o}}}),toggleStreams:()=>e(t=>({filters:{...t.filters,showStreams:!t.filters.showStreams}})),setPlaybackCap:t=>e(n=>({playback:{...n.playback,cap:t}})),setPlaying:t=>e(n=>({playback:{...n.playback,playing:t}})),setPlaybackSpeed:t=>e(n=>({playback:{...n.playback,speed:t}})),setDetailTab:t=>e({detailTab:t}),appendMessages:t=>{t.length!==0&&e(n=>{const o=n.clearedUpToSeq!==null?t.filter(r=>r.seq>n.clearedUpToSeq):t;return o.length===0?n:{messages:[...n.messages,...o]}})},clear:()=>e(t=>{const n=t.messages.length>0?t.messages[t.messages.length-1].seq:t.clearedUpToSeq;return{messages:[],selectedSeq:null,clearedUpToSeq:n}})}),{name:"acp.messages.v1",partialize:e=>({filters:{directions:[...e.filters.directions],kinds:[...e.filters.kinds],showStreams:e.filters.showStreams}}),merge:(e,t)=>{const n=e;return n!=null&&n.filters?{...t,filters:{...t.filters,directions:new Set(n.filters.directions),kinds:new Set(n.filters.kinds),showStreams:n.filters.showStreams}}:t}}));function sS(e,t,n=null){const o=t.search.trim().toLowerCase();return e.filter(r=>{if(n!==null&&r.seq>n||!t.directions.has(r.direction))return!1;if(iS(r)){if(!t.showStreams)return!1}else if(!t.kinds.has(r.kind))return!1;return!(o&&!r.raw.toLowerCase().includes(o))})}function aS(e,t){return t===null?null:e.find(n=>n.seq===t)??null}function Tl(e){const t=new Map,n=new Map;for(const o of e){if(o.rpcId===void 0||o.rpcId===null)continue;const r=String(o.rpcId);if(o.kind==="request")t.set(r,o.seq);else if(o.kind==="response"||o.kind==="error"){const i=t.get(r);i!==void 0&&n.set(o.seq,i)}}return n}const mv="ws://127.0.0.1:3737",lS=1500,cS=12e3;let Nn=null,Ai=null,Qa=0,ls=!1,zu=mv,_m=!1,Nr=[],$d=!1;function kd(){if($d=!1,Nr.length===0)return;const e=Nr;Nr=[],ne.getState().appendMessages(e)}function dS(){$d||($d=!0,typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(kd):Promise.resolve().then(kd))}function jm(){if(ls)return;const e=Math.min(cS,lS*Math.pow(1.6,Qa));Qa+=1,Ai=setTimeout(()=>{Ai=null,Fu(zu)},e)}function Fu(e=mv){if(Nn){try{Nn.close()}catch{}Nn=null}Nr=[],ls=!1,zu=e;const t=ne.getState();t.connection!=="connecting"&&t.setConnection("connecting");let n;try{n=new WebSocket(e)}catch(o){const r=o instanceof Error?o.message:String(o);t.setConnection("connecting",r),jm();return}Nn=n,n.addEventListener("open",()=>{Qa=0,_m=!0,ne.getState().setConnection("open")}),n.addEventListener("message",o=>{try{const r=JSON.parse(o.data);if(r.type==="message"){Nr.push(r.message),dS();return}Nr.length>0&&kd(),ne.getState().handleEvent(r)}catch(r){console.warn("acp-devtools: invalid WS frame",r)}}),n.addEventListener("error",()=>{}),n.addEventListener("close",()=>{if(Nn===n&&(Nn=null),ls){ne.getState().setConnection("closed");return}const o=ne.getState();if(_m&&o.replayDone){o.setConnection("idle");return}o.setConnection("connecting"),jm()})}function hv(){if(ls=!0,Ai&&(clearTimeout(Ai),Ai=null),Nn){try{Nn.close()}catch{}Nn=null}ne.getState().setConnection("idle")}function uS(){hv(),ls=!1,Qa=0,Fu(zu)}async function pS(e){const t=await fetch(`/api/sessions/${e}/messages`,{headers:{accept:"application/json"}});if(!t.ok){const n=await Bu(t);throw new Error(n)}return await t.json()}async function yv(){const e=await fetch("/api/sessions",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`sessions: HTTP ${e.status}`);return(await e.json()).sessions??[]}async function gv(e){const t=await e.text(),n=await fetch("/api/import",{method:"POST",headers:{"content-type":"application/json","x-acp-source-filename":yS(e.name)},body:t});if(!n.ok){const o=await Bu(n);throw new Error(o)}return await n.json()}async function fS(e){const t=await fetch(`/api/sessions/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404){const n=await Bu(t);throw new Error(n)}}function Ya(e){return`ws://${window.location.host}/replay/${e}`}function mS(e){return e!==null&&/\/replay\/\d+$/.test(e)}function hS(e){const t=e.match(/\/replay\/(\d+)$/);return t?Number(t[1]):null}async function Bu(e){try{const t=await e.json();if(t.error)return t.error}catch{}return`HTTP ${e.status} ${e.statusText}`}function yS(e){return e.replace(/[^\x20-\x7E]/g,"?").slice(0,200)}const Td="acp.discovery.selectedUrl";function gS(){try{return localStorage.getItem(Td)}catch{return null}}function vS(e){try{e?localStorage.setItem(Td,e):localStorage.removeItem(Td)}catch{}}const pt=Du(e=>({captures:[],savedSessions:[],selectedUrl:gS(),lastFetchAt:null,lastError:null,setCaptures:t=>e({captures:t,lastFetchAt:Date.now(),lastError:null}),setSavedSessions:t=>e({savedSessions:t}),setSelected:t=>{vS(t),e({selectedUrl:t})},setError:t=>e({lastError:t})})),bS=2500;let or=null;async function xS(){const e=await fetch("/api/active",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`discovery: HTTP ${e.status}`);return(await e.json()).captures??[]}async function Cm(){const e=pt.getState();try{const[t,n]=await Promise.all([xS(),yv().catch(()=>e.savedSessions)]);e.setCaptures(t),e.setSavedSessions(n)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}function wS(){return Cm(),or&&clearInterval(or),or=setInterval(()=>{Cm()},bS),()=>{or&&(clearInterval(or),or=null)}}async function Hu(){const e=pt.getState();try{const t=await yv();e.setSavedSessions(t)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}const vv="acp.theme.v1";function SS(){try{const e=localStorage.getItem(vv);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function $S(){return typeof window>"u"||!window.matchMedia?!0:window.matchMedia("(prefers-color-scheme: dark)").matches}function bv(e){return e==="system"?$S()?"dark":"light":e}function xv(e){if(typeof document>"u")return;const t=document.documentElement;t.classList.toggle("light",e==="light"),t.classList.toggle("dark",e==="dark")}const wv=typeof window<"u"?SS():"system",Sv=bv(wv);typeof window<"u"&&xv(Sv);const _d=Du(e=>({mode:wv,resolved:Sv,setMode:t=>{try{localStorage.setItem(vv,t)}catch{}const n=bv(t);xv(n),e({mode:t,resolved:n})}}));function kS(){if(typeof window>"u"||!window.matchMedia)return()=>{};const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{mode:n,setMode:o}=_d.getState();n==="system"&&o("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}const TS={AcceptNesNotification:{description:"Notification sent when a suggestion is accepted.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:r,digest:null}}function fc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function pd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Rw=typeof WeakMap=="function"?WeakMap:Map;function Kg(e,t,n){n=Rn(-1,n),n.tag=3,n.payload={element:null};var o=t.value;return n.callback=function(){Qa||(Qa=!0,Sd=o),pd(e,t)},n}function Gg(e,t,n){n=Rn(-1,n),n.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var r=t.value;n.payload=function(){return o(r)},n.callback=function(){pd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){pd(e,t),typeof o!="function"&&(fo===null?fo=new Set([this]):fo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function pm(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new Rw;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(r.add(n),e=Gw.bind(null,e,t,n),t.then(e,e))}function fm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mm(e,t,n,o,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Rn(-1,1),t.tag=2,po(n,t,1))),n.lanes|=1),e)}var Aw=Fn.ReactCurrentOwner,jt=!1;function vt(e,t,n,o){t.child=e===null?$g(t,null,n,o):zr(t,e.child,n,o)}function hm(e,t,n,o,r){n=n.render;var i=t.ref;return Cr(t,r),o=Cu(e,t,n,o,i,r),n=Eu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&n&&gu(t),t.flags|=1,vt(e,t,o,r),t.child)}function ym(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!Du(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Jg(e,t,i,o,r)):(e=ga(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&r)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Xi,n(s,o)&&e.ref===t.ref)return Dn(e,t,r)}return t.flags|=1,e=ho(i,o),e.ref=t.ref,e.return=t,t.child=e}function Jg(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(Xi(i,o)&&e.ref===t.ref)if(jt=!1,t.pendingProps=o=i,(e.lanes&r)!==0)e.flags&131072&&(jt=!0);else return t.lanes=e.lanes,Dn(e,t,r)}return fd(e,t,n,o,r)}function Qg(e,t,n){var o=t.pendingProps,r=o.children,i=e!==null?e.memoizedState:null;if(o.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce($r,Pt),Pt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ce($r,Pt),Pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Ce($r,Pt),Pt|=o}else i!==null?(o=i.baseLanes|n,t.memoizedState=null):o=n,Ce($r,Pt),Pt|=o;return vt(e,t,r,n),t.child}function Yg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fd(e,t,n,o,r){var i=Ct(n)?Bo:gt.current;return i=Lr(t,i),Cr(t,r),n=Cu(e,t,n,o,i,r),o=Eu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&o&&gu(t),t.flags|=1,vt(e,t,n,r),t.child)}function gm(e,t,n,o,r){if(Ct(n)){var i=!0;Da(t)}else i=!1;if(Cr(t,r),t.stateNode===null)ma(e,t),Wg(t,n,o),ud(t,n,o,r),o=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Jt(c):(c=Ct(n)?Bo:gt.current,c=Lr(t,c));var f=n.getDerivedStateFromProps,m=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==o||l!==c)&&um(t,s,o,c),eo=!1;var h=t.memoizedState;s.state=h,Va(t,o,s,r),l=t.memoizedState,a!==o||h!==l||Nt.current||eo?(typeof f=="function"&&(dd(t,n,f,o),l=t.memoizedState),(a=eo||dm(t,n,a,o,h,l,c))?(m||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=l),s.props=o,s.state=l,s.context=c,o=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{s=t.stateNode,Tg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:tn(t.type,a),s.props=c,m=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ct(n)?Bo:gt.current,l=Lr(t,l));var y=n.getDerivedStateFromProps;(f=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==m||h!==l)&&um(t,s,o,l),eo=!1,h=t.memoizedState,s.state=h,Va(t,o,s,r);var g=t.memoizedState;a!==m||h!==g||Nt.current||eo?(typeof y=="function"&&(dd(t,n,y,o),g=t.memoizedState),(c=eo||dm(t,n,c,o,h,g,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(o,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(o,g,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=g),s.props=o,s.state=g,s.context=l,o=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),o=!1)}return md(e,t,n,o,i,r)}function md(e,t,n,o,r,i){Yg(e,t);var s=(t.flags&128)!==0;if(!o&&!s)return r&&nm(t,n,!1),Dn(e,t,i);o=t.stateNode,Aw.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&s?(t.child=zr(t,e.child,null,i),t.child=zr(t,null,a,i)):vt(e,t,a,i),t.memoizedState=o.state,r&&nm(t,n,!0),t.child}function Xg(e){var t=e.stateNode;t.pendingContext?tm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tm(e,t.context,!1),Tu(e,t.containerInfo)}function vm(e,t,n,o,r){return Dr(),bu(r),t.flags|=256,vt(e,t,n,o),t.child}var hd={dehydrated:null,treeContext:null,retryLane:0};function yd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Zg(e,t,n){var o=t.pendingProps,r=Fe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Ce(Fe,r&1),e===null)return ld(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=o.children,e=o.fallback,i?(o=t.mode,i=t.child,s={mode:"hidden",children:s},!(o&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=kl(s,o,0,null),e=Fo(e,o,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=yd(n),t.memoizedState=hd,e):Ou(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Mw(e,t,s,o,a,r,n);if(i){i=o.fallback,s=t.mode,r=e.child,a=r.sibling;var l={mode:"hidden",children:o.children};return!(s&1)&&t.child!==r?(o=t.child,o.childLanes=0,o.pendingProps=l,t.deletions=null):(o=ho(r,l),o.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=ho(a,i):(i=Fo(i,s,n,null),i.flags|=2),i.return=t,o.return=t,o.sibling=i,t.child=o,o=i,i=t.child,s=e.child.memoizedState,s=s===null?yd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=hd,o}return i=e.child,e=i.sibling,o=ho(i,{mode:"visible",children:o.children}),!(t.mode&1)&&(o.lanes=n),o.return=t,o.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Ou(e,t){return t=kl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ks(e,t,n,o){return o!==null&&bu(o),zr(t,e.child,null,n),e=Ou(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mw(e,t,n,o,r,i,s){if(n)return t.flags&256?(t.flags&=-257,o=fc(Error(H(422))),Ks(e,t,s,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=o.fallback,r=t.mode,o=kl({mode:"visible",children:o.children},r,0,null),i=Fo(i,r,s,null),i.flags|=2,o.return=t,i.return=t,o.sibling=i,t.child=o,t.mode&1&&zr(t,e.child,null,s),t.child.memoizedState=yd(s),t.memoizedState=hd,i);if(!(t.mode&1))return Ks(e,t,s,null);if(r.data==="$!"){if(o=r.nextSibling&&r.nextSibling.dataset,o)var a=o.dgst;return o=a,i=Error(H(419)),o=fc(i,o,void 0),Ks(e,t,s,o)}if(a=(s&e.childLanes)!==0,jt||a){if(o=rt,o!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(o.suspendedLanes|s)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Ln(e,r),an(o,e,r,-1))}return Lu(),o=fc(Error(H(421))),Ks(e,t,s,o)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Jw.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,Ot=uo(r.nextSibling),At=t,De=!0,on=null,e!==null&&(Ft[Bt++]=Pn,Ft[Bt++]=In,Ft[Bt++]=Ho,Pn=e.id,In=e.overflow,Ho=t),t=Ou(t,o.children),t.flags|=4096,t)}function bm(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),cd(e.return,t,n)}function mc(e,t,n,o,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r)}function ev(e,t,n){var o=t.pendingProps,r=o.revealOrder,i=o.tail;if(vt(e,t,o.children,n),o=Fe.current,o&2)o=o&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bm(e,n,t);else if(e.tag===19)bm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(Ce(Fe,o),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Wa(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),mc(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Wa(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}mc(t,!0,n,null,i);break;case"together":mc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ma(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=ho(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ho(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function qw(e,t,n){switch(t.tag){case 3:Xg(t),Dr();break;case 5:_g(t);break;case 1:Ct(t.type)&&Da(t);break;case 4:Tu(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,r=t.memoizedProps.value;Ce(Ba,o._currentValue),o._currentValue=r;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Ce(Fe,Fe.current&1),t.flags|=128,null):n&t.child.childLanes?Zg(e,t,n):(Ce(Fe,Fe.current&1),e=Dn(e,t,n),e!==null?e.sibling:null);Ce(Fe,Fe.current&1);break;case 19:if(o=(n&t.childLanes)!==0,e.flags&128){if(o)return ev(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ce(Fe,Fe.current),o)break;return null;case 22:case 23:return t.lanes=0,Qg(e,t,n)}return Dn(e,t,n)}var tv,gd,nv,ov;tv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gd=function(){};nv=function(e,t,n,o){var r=e.memoizedProps;if(r!==o){e=t.stateNode,Uo(kn.current);var i=null;switch(n){case"input":r=Lc(e,r),o=Lc(e,o),i=[];break;case"select":r=He({},r,{value:void 0}),o=He({},o,{value:void 0}),i=[];break;case"textarea":r=Fc(e,r),o=Fc(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=Ua)}Hc(n,o);var s;n=null;for(c in r)if(!o.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Vi.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in o){var l=o[c];if(a=r!=null?r[c]:void 0,o.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Vi.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Oe("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};ov=function(e,t,n,o){n!==o&&(t.flags|=4)};function fi(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&14680064,o|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function Uw(e,t,n){var o=t.pendingProps;switch(vu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return Ct(t.type)&&La(),ut(t),null;case 3:return o=t.stateNode,Fr(),qe(Nt),qe(gt),ju(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Vs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,on!==null&&(Td(on),on=null))),gd(e,t),ut(t),null;case 5:_u(t);var r=Uo(os.current);if(n=t.type,e!==null&&t.stateNode!=null)nv(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(H(166));return ut(t),null}if(e=Uo(kn.current),Vs(t)){o=t.stateNode,n=t.type;var i=t.memoizedProps;switch(o[gn]=t,o[ts]=i,e=(t.mode&1)!==0,n){case"dialog":Oe("cancel",o),Oe("close",o);break;case"iframe":case"object":case"embed":Oe("load",o);break;case"video":case"audio":for(r=0;r<Ti.length;r++)Oe(Ti[r],o);break;case"source":Oe("error",o);break;case"img":case"image":case"link":Oe("error",o),Oe("load",o);break;case"details":Oe("toggle",o);break;case"input":Nf(o,i),Oe("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",o);break;case"textarea":Ef(o,i),Oe("invalid",o)}Hc(n,i),r=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?o.textContent!==a&&(i.suppressHydrationWarning!==!0&&Hs(o.textContent,a,e),r=["children",a]):typeof a=="number"&&o.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Hs(o.textContent,a,e),r=["children",""+a]):Vi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Oe("scroll",o)}switch(n){case"input":Ms(o),Cf(o,i,!0);break;case"textarea":Ms(o),Pf(o);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(o.onclick=Ua)}o=r,t.updateQueue=o,o!==null&&(t.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Py(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=s.createElement(n,{is:o.is}):(e=s.createElement(n),n==="select"&&(s=e,o.multiple?s.multiple=!0:o.size&&(s.size=o.size))):e=s.createElementNS(e,n),e[gn]=t,e[ts]=o,tv(e,t,!1,!1),t.stateNode=e;e:{switch(s=Vc(n,o),n){case"dialog":Oe("cancel",e),Oe("close",e),r=o;break;case"iframe":case"object":case"embed":Oe("load",e),r=o;break;case"video":case"audio":for(r=0;r<Ti.length;r++)Oe(Ti[r],e);r=o;break;case"source":Oe("error",e),r=o;break;case"img":case"image":case"link":Oe("error",e),Oe("load",e),r=o;break;case"details":Oe("toggle",e),r=o;break;case"input":Nf(e,o),r=Lc(e,o),Oe("invalid",e);break;case"option":r=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},r=He({},o,{value:void 0}),Oe("invalid",e);break;case"textarea":Ef(e,o),r=Fc(e,o),Oe("invalid",e);break;default:r=o}Hc(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Ry(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Iy(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Wi(e,l):typeof l=="number"&&Wi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Vi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Oe("scroll",e):l!=null&&ou(e,i,l,s))}switch(n){case"input":Ms(e),Cf(e,o,!1);break;case"textarea":Ms(e),Pf(e);break;case"option":o.value!=null&&e.setAttribute("value",""+go(o.value));break;case"select":e.multiple=!!o.multiple,i=o.value,i!=null?Tr(e,!!o.multiple,i,!1):o.defaultValue!=null&&Tr(e,!!o.multiple,o.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Ua)}switch(n){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ut(t),null;case 6:if(e&&t.stateNode!=null)ov(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(H(166));if(n=Uo(os.current),Uo(kn.current),Vs(t)){if(o=t.stateNode,n=t.memoizedProps,o[gn]=t,(i=o.nodeValue!==n)&&(e=At,e!==null))switch(e.tag){case 3:Hs(o.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Hs(o.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else o=(n.nodeType===9?n:n.ownerDocument).createTextNode(o),o[gn]=t,t.stateNode=o}return ut(t),null;case 13:if(qe(Fe),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&Ot!==null&&t.mode&1&&!(t.flags&128))wg(),Dr(),t.flags|=98560,i=!1;else if(i=Vs(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[gn]=t}else Dr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),i=!1}else on!==null&&(Td(on),on=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,t.mode&1&&(e===null||Fe.current&1?tt===0&&(tt=3):Lu())),t.updateQueue!==null&&(t.flags|=4),ut(t),null);case 4:return Fr(),gd(e,t),e===null&&Zi(t.stateNode.containerInfo),ut(t),null;case 10:return Su(t.type._context),ut(t),null;case 17:return Ct(t.type)&&La(),ut(t),null;case 19:if(qe(Fe),i=t.memoizedState,i===null)return ut(t),null;if(o=(t.flags&128)!==0,s=i.rendering,s===null)if(o)fi(i,!1);else{if(tt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Wa(e),s!==null){for(t.flags|=128,fi(i,!1),o=s.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=n,n=t.child;n!==null;)i=n,e=o,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ce(Fe,Fe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ge()>Hr&&(t.flags|=128,o=!0,fi(i,!1),t.lanes=4194304)}else{if(!o)if(e=Wa(s),e!==null){if(t.flags|=128,o=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!De)return ut(t),null}else 2*Ge()-i.renderingStartTime>Hr&&n!==1073741824&&(t.flags|=128,o=!0,fi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ge(),t.sibling=null,n=Fe.current,Ce(Fe,o?n&1|2:n&1),t):(ut(t),null);case 22:case 23:return Uu(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?Pt&1073741824&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function Lw(e,t){switch(vu(t),t.tag){case 1:return Ct(t.type)&&La(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fr(),qe(Nt),qe(gt),ju(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _u(t),null;case 13:if(qe(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Dr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Fe),null;case 4:return Fr(),null;case 10:return Su(t.type._context),null;case 22:case 23:return Uu(),null;case 24:return null;default:return null}}var Gs=!1,mt=!1,Dw=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Sr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Ve(e,t,o)}else n.current=null}function vd(e,t,n){try{n()}catch(o){Ve(e,t,o)}}var xm=!1;function zw(e,t){if(td=Aa,e=lg(),yu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,f=0,m=e,h=null;t:for(;;){for(var y;m!==n||r!==0&&m.nodeType!==3||(a=s+r),m!==i||o!==0&&m.nodeType!==3||(l=s+o),m.nodeType===3&&(s+=m.nodeValue.length),(y=m.firstChild)!==null;)h=m,m=y;for(;;){if(m===e)break t;if(h===n&&++c===r&&(a=s),h===i&&++f===o&&(l=s),(y=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(nd={focusedElem:e,selectionRange:n},Aa=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,v=g.memoizedState,u=t.stateNode,p=u.getSnapshotBeforeUpdate(t.elementType===t.type?b:tn(t.type,b),v);u.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Ve(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return g=xm,xm=!1,g}function Ri(e,t,n){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&e)===e){var i=r.destroy;r.destroy=void 0,i!==void 0&&vd(t,n,i)}r=r.next}while(r!==o)}}function Sl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var o=n.create;n.destroy=o()}n=n.next}while(n!==t)}}function bd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function rv(e){var t=e.alternate;t!==null&&(e.alternate=null,rv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gn],delete t[ts],delete t[id],delete t[$w],delete t[kw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function iv(e){return e.tag===5||e.tag===3||e.tag===4}function wm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||iv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ua));else if(o!==4&&(e=e.child,e!==null))for(xd(e,t,n),e=e.sibling;e!==null;)xd(e,t,n),e=e.sibling}function wd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(wd(e,t,n),e=e.sibling;e!==null;)wd(e,t,n),e=e.sibling}var st=null,nn=!1;function Wn(e,t,n){for(n=n.child;n!==null;)sv(e,t,n),n=n.sibling}function sv(e,t,n){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(ml,n)}catch{}switch(n.tag){case 5:mt||Sr(n,t);case 6:var o=st,r=nn;st=null,Wn(e,t,n),st=o,nn=r,st!==null&&(nn?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(nn?(e=st,n=n.stateNode,e.nodeType===8?ac(e.parentNode,n):e.nodeType===1&&ac(e,n),Qi(e)):ac(st,n.stateNode));break;case 4:o=st,r=nn,st=n.stateNode.containerInfo,nn=!0,Wn(e,t,n),st=o,nn=r;break;case 0:case 11:case 14:case 15:if(!mt&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&vd(n,t,s),r=r.next}while(r!==o)}Wn(e,t,n);break;case 1:if(!mt&&(Sr(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(a){Ve(n,t,a)}Wn(e,t,n);break;case 21:Wn(e,t,n);break;case 22:n.mode&1?(mt=(o=mt)||n.memoizedState!==null,Wn(e,t,n),mt=o):Wn(e,t,n);break;default:Wn(e,t,n)}}function Sm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Dw),t.forEach(function(o){var r=Qw.bind(null,e,o);n.has(o)||(n.add(o),o.then(r,r))})}}function Xt(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var r=n[o];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:st=a.stateNode,nn=!1;break e;case 3:st=a.stateNode.containerInfo,nn=!0;break e;case 4:st=a.stateNode.containerInfo,nn=!0;break e}a=a.return}if(st===null)throw Error(H(160));sv(i,s,r),st=null,nn=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){Ve(r,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)av(t,e),t=t.sibling}function av(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Xt(t,e),fn(e),o&4){try{Ri(3,e,e.return),Sl(3,e)}catch(b){Ve(e,e.return,b)}try{Ri(5,e,e.return)}catch(b){Ve(e,e.return,b)}}break;case 1:Xt(t,e),fn(e),o&512&&n!==null&&Sr(n,n.return);break;case 5:if(Xt(t,e),fn(e),o&512&&n!==null&&Sr(n,n.return),e.flags&32){var r=e.stateNode;try{Wi(r,"")}catch(b){Ve(e,e.return,b)}}if(o&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Cy(r,i),Vc(a,s);var c=Vc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],m=l[s+1];f==="style"?Ry(r,m):f==="dangerouslySetInnerHTML"?Iy(r,m):f==="children"?Wi(r,m):ou(r,f,m,c)}switch(a){case"input":Dc(r,i);break;case"textarea":Ey(r,i);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Tr(r,!!i.multiple,y,!1):h!==!!i.multiple&&(i.defaultValue!=null?Tr(r,!!i.multiple,i.defaultValue,!0):Tr(r,!!i.multiple,i.multiple?[]:"",!1))}r[ts]=i}catch(b){Ve(e,e.return,b)}}break;case 6:if(Xt(t,e),fn(e),o&4){if(e.stateNode===null)throw Error(H(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(b){Ve(e,e.return,b)}}break;case 3:if(Xt(t,e),fn(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(b){Ve(e,e.return,b)}break;case 4:Xt(t,e),fn(e);break;case 13:Xt(t,e),fn(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Mu=Ge())),o&4&&Sm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(mt=(c=mt)||f,Xt(t,e),mt=c):Xt(t,e),fn(e),o&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(Z=e,f=e.child;f!==null;){for(m=Z=f;Z!==null;){switch(h=Z,y=h.child,h.tag){case 0:case 11:case 14:case 15:Ri(4,h,h.return);break;case 1:Sr(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){o=h,n=h.return;try{t=o,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(b){Ve(o,n,b)}}break;case 5:Sr(h,h.return);break;case 22:if(h.memoizedState!==null){km(m);continue}}y!==null?(y.return=h,Z=y):km(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{r=m.stateNode,c?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=m.stateNode,l=m.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Oy("display",s))}catch(b){Ve(e,e.return,b)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=c?"":m.memoizedProps}catch(b){Ve(e,e.return,b)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Xt(t,e),fn(e),o&4&&Sm(e);break;case 21:break;default:Xt(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(iv(n)){var o=n;break e}n=n.return}throw Error(H(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(Wi(r,""),o.flags&=-33);var i=wm(e);wd(e,i,r);break;case 3:case 4:var s=o.stateNode.containerInfo,a=wm(e);xd(e,a,s);break;default:throw Error(H(161))}}catch(l){Ve(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fw(e,t,n){Z=e,lv(e)}function lv(e,t,n){for(var o=(e.mode&1)!==0;Z!==null;){var r=Z,i=r.child;if(r.tag===22&&o){var s=r.memoizedState!==null||Gs;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||mt;a=Gs;var c=mt;if(Gs=s,(mt=l)&&!c)for(Z=r;Z!==null;)s=Z,l=s.child,s.tag===22&&s.memoizedState!==null?Tm(r):l!==null?(l.return=s,Z=l):Tm(r);for(;i!==null;)Z=i,lv(i),i=i.sibling;Z=r,Gs=a,mt=c}$m(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,Z=i):$m(e)}}function $m(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mt||Sl(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!mt)if(n===null)o.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:tn(t.type,n.memoizedProps);o.componentDidUpdate(r,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&am(t,i,o);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}am(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Qi(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}mt||t.flags&512&&bd(t)}catch(h){Ve(t,t.return,h)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function km(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Tm(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sl(4,t)}catch(l){Ve(t,n,l)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var r=t.return;try{o.componentDidMount()}catch(l){Ve(t,r,l)}}var i=t.return;try{bd(t)}catch(l){Ve(t,i,l)}break;case 5:var s=t.return;try{bd(t)}catch(l){Ve(t,s,l)}}}catch(l){Ve(t,t.return,l)}if(t===e){Z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Z=a;break}Z=t.return}}var Bw=Math.ceil,Ja=Fn.ReactCurrentDispatcher,Ru=Fn.ReactCurrentOwner,Gt=Fn.ReactCurrentBatchConfig,be=0,rt=null,Je=null,lt=0,Pt=0,$r=wo(0),tt=0,as=null,Wo=0,$l=0,Au=0,Ai=null,_t=null,Mu=0,Hr=1/0,Nn=null,Qa=!1,Sd=null,fo=null,Js=!1,io=null,Ya=0,Mi=0,$d=null,ha=-1,ya=0;function wt(){return be&6?Ge():ha!==-1?ha:ha=Ge()}function mo(e){return e.mode&1?be&2&<!==0?lt&-lt:_w.transition!==null?(ya===0&&(ya=Wy()),ya):(e=ke,e!==0||(e=window.event,e=e===void 0?16:Zy(e.type)),e):1}function an(e,t,n,o){if(50<Mi)throw Mi=0,$d=null,Error(H(185));ks(e,n,o),(!(be&2)||e!==rt)&&(e===rt&&(!(be&2)&&($l|=n),tt===4&&no(e,lt)),Et(e,o),n===1&&be===0&&!(t.mode&1)&&(Hr=Ge()+500,bl&&So()))}function Et(e,t){var n=e.callbackNode;_0(e,t);var o=Ra(e,e===rt?lt:0);if(o===0)n!==null&&Rf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&Rf(n),t===1)e.tag===0?Tw(_m.bind(null,e)):vg(_m.bind(null,e)),ww(function(){!(be&6)&&So()}),n=null;else{switch(Ky(o)){case 1:n=lu;break;case 4:n=Hy;break;case 16:n=Oa;break;case 536870912:n=Vy;break;default:n=Oa}n=yv(n,cv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cv(e,t){if(ha=-1,ya=0,be&6)throw Error(H(327));var n=e.callbackNode;if(Er()&&e.callbackNode!==n)return null;var o=Ra(e,e===rt?lt:0);if(o===0)return null;if(o&30||o&e.expiredLanes||t)t=Xa(e,o);else{t=o;var r=be;be|=2;var i=uv();(rt!==e||lt!==t)&&(Nn=null,Hr=Ge()+500,zo(e,t));do try{Ww();break}catch(a){dv(e,a)}while(!0);wu(),Ja.current=i,be=r,Je!==null?t=0:(rt=null,lt=0,t=tt)}if(t!==0){if(t===2&&(r=Qc(e),r!==0&&(o=r,t=kd(e,r))),t===1)throw n=as,zo(e,0),no(e,o),Et(e,Ge()),n;if(t===6)no(e,o);else{if(r=e.current.alternate,!(o&30)&&!Hw(r)&&(t=Xa(e,o),t===2&&(i=Qc(e),i!==0&&(o=i,t=kd(e,i))),t===1))throw n=as,zo(e,0),no(e,o),Et(e,Ge()),n;switch(e.finishedWork=r,e.finishedLanes=o,t){case 0:case 1:throw Error(H(345));case 2:Eo(e,_t,Nn);break;case 3:if(no(e,o),(o&130023424)===o&&(t=Mu+500-Ge(),10<t)){if(Ra(e,0)!==0)break;if(r=e.suspendedLanes,(r&o)!==o){wt(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=rd(Eo.bind(null,e,_t,Nn),t);break}Eo(e,_t,Nn);break;case 4:if(no(e,o),(o&4194240)===o)break;for(t=e.eventTimes,r=-1;0<o;){var s=31-sn(o);i=1<<s,s=t[s],s>r&&(r=s),o&=~i}if(o=r,o=Ge()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Bw(o/1960))-o,10<o){e.timeoutHandle=rd(Eo.bind(null,e,_t,Nn),o);break}Eo(e,_t,Nn);break;case 5:Eo(e,_t,Nn);break;default:throw Error(H(329))}}}return Et(e,Ge()),e.callbackNode===n?cv.bind(null,e):null}function kd(e,t){var n=Ai;return e.current.memoizedState.isDehydrated&&(zo(e,t).flags|=256),e=Xa(e,t),e!==2&&(t=_t,_t=n,t!==null&&Td(t)),e}function Td(e){_t===null?_t=e:_t.push.apply(_t,e)}function Hw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var o=0;o<n.length;o++){var r=n[o],i=r.getSnapshot;r=r.value;try{if(!dn(i(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function no(e,t){for(t&=~Au,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-sn(t),o=1<<n;e[n]=-1,t&=~o}}function _m(e){if(be&6)throw Error(H(327));Er();var t=Ra(e,0);if(!(t&1))return Et(e,Ge()),null;var n=Xa(e,t);if(e.tag!==0&&n===2){var o=Qc(e);o!==0&&(t=o,n=kd(e,o))}if(n===1)throw n=as,zo(e,0),no(e,t),Et(e,Ge()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eo(e,_t,Nn),Et(e,Ge()),null}function qu(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Hr=Ge()+500,bl&&So())}}function Ko(e){io!==null&&io.tag===0&&!(be&6)&&Er();var t=be;be|=1;var n=Gt.transition,o=ke;try{if(Gt.transition=null,ke=1,e)return e()}finally{ke=o,Gt.transition=n,be=t,!(be&6)&&So()}}function Uu(){Pt=$r.current,qe($r)}function zo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xw(n)),Je!==null)for(n=Je.return;n!==null;){var o=n;switch(vu(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&La();break;case 3:Fr(),qe(Nt),qe(gt),ju();break;case 5:_u(o);break;case 4:Fr();break;case 13:qe(Fe);break;case 19:qe(Fe);break;case 10:Su(o.type._context);break;case 22:case 23:Uu()}n=n.return}if(rt=e,Je=e=ho(e.current,null),lt=Pt=t,tt=0,as=null,Au=$l=Wo=0,_t=Ai=null,qo!==null){for(t=0;t<qo.length;t++)if(n=qo[t],o=n.interleaved,o!==null){n.interleaved=null;var r=o.next,i=n.pending;if(i!==null){var s=i.next;i.next=r,o.next=s}n.pending=o}qo=null}return e}function dv(e,t){do{var n=Je;try{if(wu(),pa.current=Ga,Ka){for(var o=Be.memoizedState;o!==null;){var r=o.queue;r!==null&&(r.pending=null),o=o.next}Ka=!1}if(Vo=0,ot=Xe=Be=null,Oi=!1,rs=0,Ru.current=null,n===null||n.return===null){tt=1,as=t,Je=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=lt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,f=a,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var y=fm(s);if(y!==null){y.flags&=-257,mm(y,s,a,i,t),y.mode&1&&pm(i,c,t),t=y,l=c;var g=t.updateQueue;if(g===null){var b=new Set;b.add(l),t.updateQueue=b}else g.add(l);break e}else{if(!(t&1)){pm(i,c,t),Lu();break e}l=Error(H(426))}}else if(De&&a.mode&1){var v=fm(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),mm(v,s,a,i,t),bu(Br(l,a));break e}}i=l=Br(l,a),tt!==4&&(tt=2),Ai===null?Ai=[i]:Ai.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var u=Kg(i,l,t);sm(i,u);break e;case 1:a=l;var p=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(fo===null||!fo.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Gg(i,a,t);sm(i,S);break e}}i=i.return}while(i!==null)}fv(n)}catch(T){t=T,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function uv(){var e=Ja.current;return Ja.current=Ga,e===null?Ga:e}function Lu(){(tt===0||tt===3||tt===2)&&(tt=4),rt===null||!(Wo&268435455)&&!($l&268435455)||no(rt,lt)}function Xa(e,t){var n=be;be|=2;var o=uv();(rt!==e||lt!==t)&&(Nn=null,zo(e,t));do try{Vw();break}catch(r){dv(e,r)}while(!0);if(wu(),be=n,Ja.current=o,Je!==null)throw Error(H(261));return rt=null,lt=0,tt}function Vw(){for(;Je!==null;)pv(Je)}function Ww(){for(;Je!==null&&!g0();)pv(Je)}function pv(e){var t=hv(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?fv(e):Je=t,Ru.current=null}function fv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Lw(n,t),n!==null){n.flags&=32767,Je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tt=6,Je=null;return}}else if(n=Uw(n,t,Pt),n!==null){Je=n;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);tt===0&&(tt=5)}function Eo(e,t,n){var o=ke,r=Gt.transition;try{Gt.transition=null,ke=1,Kw(e,t,n,o)}finally{Gt.transition=r,ke=o}return null}function Kw(e,t,n,o){do Er();while(io!==null);if(be&6)throw Error(H(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(j0(e,i),e===rt&&(Je=rt=null,lt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Js||(Js=!0,yv(Oa,function(){return Er(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Gt.transition,Gt.transition=null;var s=ke;ke=1;var a=be;be|=4,Ru.current=null,zw(e,n),av(n,e),fw(nd),Aa=!!td,nd=td=null,e.current=n,Fw(n),v0(),be=a,ke=s,Gt.transition=i}else e.current=n;if(Js&&(Js=!1,io=e,Ya=r),i=e.pendingLanes,i===0&&(fo=null),w0(n.stateNode),Et(e,Ge()),t!==null)for(o=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],o(r.value,{componentStack:r.stack,digest:r.digest});if(Qa)throw Qa=!1,e=Sd,Sd=null,e;return Ya&1&&e.tag!==0&&Er(),i=e.pendingLanes,i&1?e===$d?Mi++:(Mi=0,$d=e):Mi=0,So(),null}function Er(){if(io!==null){var e=Ky(Ya),t=Gt.transition,n=ke;try{if(Gt.transition=null,ke=16>e?16:e,io===null)var o=!1;else{if(e=io,io=null,Ya=0,be&6)throw Error(H(331));var r=be;for(be|=4,Z=e.current;Z!==null;){var i=Z,s=i.child;if(Z.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Z=c;Z!==null;){var f=Z;switch(f.tag){case 0:case 11:case 15:Ri(8,f,i)}var m=f.child;if(m!==null)m.return=f,Z=m;else for(;Z!==null;){f=Z;var h=f.sibling,y=f.return;if(rv(f),f===c){Z=null;break}if(h!==null){h.return=y,Z=h;break}Z=y}}}var g=i.alternate;if(g!==null){var b=g.child;if(b!==null){g.child=null;do{var v=b.sibling;b.sibling=null,b=v}while(b!==null)}}Z=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Z=s;else e:for(;Z!==null;){if(i=Z,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ri(9,i,i.return)}var u=i.sibling;if(u!==null){u.return=i.return,Z=u;break e}Z=i.return}}var p=e.current;for(Z=p;Z!==null;){s=Z;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,Z=x;else e:for(s=p;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Sl(9,a)}}catch(T){Ve(a,a.return,T)}if(a===s){Z=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Z=S;break e}Z=a.return}}if(be=r,So(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(ml,e)}catch{}o=!0}return o}finally{ke=n,Gt.transition=t}}return!1}function jm(e,t,n){t=Br(n,t),t=Kg(e,t,1),e=po(e,t,1),t=wt(),e!==null&&(ks(e,1,t),Et(e,t))}function Ve(e,t,n){if(e.tag===3)jm(e,e,n);else for(;t!==null;){if(t.tag===3){jm(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fo===null||!fo.has(o))){e=Br(n,e),e=Gg(t,e,1),t=po(t,e,1),e=wt(),t!==null&&(ks(t,1,e),Et(t,e));break}}t=t.return}}function Gw(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(lt&n)===n&&(tt===4||tt===3&&(lt&130023424)===lt&&500>Ge()-Mu?zo(e,0):Au|=n),Et(e,t)}function mv(e,t){t===0&&(e.mode&1?(t=Ls,Ls<<=1,!(Ls&130023424)&&(Ls=4194304)):t=1);var n=wt();e=Ln(e,t),e!==null&&(ks(e,t,n),Et(e,n))}function Jw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mv(e,n)}function Qw(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(H(314))}o!==null&&o.delete(t),mv(e,n)}var hv;hv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)jt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return jt=!1,qw(e,t,n);jt=!!(e.flags&131072)}else jt=!1,De&&t.flags&1048576&&bg(t,Fa,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;ma(e,t),e=t.pendingProps;var r=Lr(t,gt.current);Cr(t,n),r=Cu(null,t,o,e,r,n);var i=Eu();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ct(o)?(i=!0,Da(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,ku(t),r.updater=wl,t.stateNode=r,r._reactInternals=t,ud(t,o,e,n),t=md(null,t,o,!0,i,n)):(t.tag=0,De&&i&&gu(t),vt(null,t,r,n),t=t.child),t;case 16:o=t.elementType;e:{switch(ma(e,t),e=t.pendingProps,r=o._init,o=r(o._payload),t.type=o,r=t.tag=Xw(o),e=tn(o,e),r){case 0:t=fd(null,t,o,e,n);break e;case 1:t=gm(null,t,o,e,n);break e;case 11:t=hm(null,t,o,e,n);break e;case 14:t=ym(null,t,o,tn(o.type,e),n);break e}throw Error(H(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),fd(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),gm(e,t,o,r,n);case 3:e:{if(Xg(t),e===null)throw Error(H(387));o=t.pendingProps,i=t.memoizedState,r=i.element,Tg(e,t),Va(t,o,null,n);var s=t.memoizedState;if(o=s.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=Br(Error(H(423)),t),t=vm(e,t,o,n,r);break e}else if(o!==r){r=Br(Error(H(424)),t),t=vm(e,t,o,n,r);break e}else for(Ot=uo(t.stateNode.containerInfo.firstChild),At=t,De=!0,on=null,n=$g(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dr(),o===r){t=Dn(e,t,n);break e}vt(e,t,o,n)}t=t.child}return t;case 5:return _g(t),e===null&&ld(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,s=r.children,od(o,r)?s=null:i!==null&&od(o,i)&&(t.flags|=32),Yg(e,t),vt(e,t,s,n),t.child;case 6:return e===null&&ld(t),null;case 13:return Zg(e,t,n);case 4:return Tu(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=zr(t,null,o,n):vt(e,t,o,n),t.child;case 11:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),hm(e,t,o,r,n);case 7:return vt(e,t,t.pendingProps,n),t.child;case 8:return vt(e,t,t.pendingProps.children,n),t.child;case 12:return vt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,r=t.pendingProps,i=t.memoizedProps,s=r.value,Ce(Ba,o._currentValue),o._currentValue=s,i!==null)if(dn(i.value,s)){if(i.children===r.children&&!Nt.current){t=Dn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===o){if(i.tag===1){l=Rn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),cd(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),cd(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}vt(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,o=t.pendingProps.children,Cr(t,n),r=Jt(r),o=o(r),t.flags|=1,vt(e,t,o,n),t.child;case 14:return o=t.type,r=tn(o,t.pendingProps),r=tn(o.type,r),ym(e,t,o,r,n);case 15:return Jg(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),ma(e,t),t.tag=1,Ct(o)?(e=!0,Da(t)):e=!1,Cr(t,n),Wg(t,o,r),ud(t,o,r,n),md(null,t,o,!0,e,n);case 19:return ev(e,t,n);case 22:return Qg(e,t,n)}throw Error(H(156,t.tag))};function yv(e,t){return By(e,t)}function Yw(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,n,o){return new Yw(e,t,n,o)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xw(e){if(typeof e=="function")return Du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===iu)return 11;if(e===su)return 14}return 2}function ho(e,t){var n=e.alternate;return n===null?(n=Ht(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ga(e,t,n,o,r,i){var s=2;if(o=e,typeof e=="function")Du(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case fr:return Fo(n.children,r,i,t);case ru:s=8,r|=8;break;case Ac:return e=Ht(12,n,t,r|2),e.elementType=Ac,e.lanes=i,e;case Mc:return e=Ht(13,n,t,r),e.elementType=Mc,e.lanes=i,e;case qc:return e=Ht(19,n,t,r),e.elementType=qc,e.lanes=i,e;case _y:return kl(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ky:s=10;break e;case Ty:s=9;break e;case iu:s=11;break e;case su:s=14;break e;case Zn:s=16,o=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Ht(s,n,t,r),t.elementType=e,t.type=o,t.lanes=i,t}function Fo(e,t,n,o){return e=Ht(7,e,o,t),e.lanes=n,e}function kl(e,t,n,o){return e=Ht(22,e,o,t),e.elementType=_y,e.lanes=n,e.stateNode={isHidden:!1},e}function hc(e,t,n){return e=Ht(6,e,null,t),e.lanes=n,e}function yc(e,t,n){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zw(e,t,n,o,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function zu(e,t,n,o,r,i,s,a,l){return e=new Zw(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ht(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ku(i),e}function eS(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pr,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}function gv(e){if(!e)return vo;e=e._reactInternals;e:{if(Xo(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(Ct(n))return gg(e,n,t)}return t}function vv(e,t,n,o,r,i,s,a,l){return e=zu(n,o,!0,e,r,i,s,a,l),e.context=gv(null),n=e.current,o=wt(),r=mo(n),i=Rn(o,r),i.callback=t??null,po(n,i,r),e.current.lanes=r,ks(e,r,o),Et(e,o),e}function Tl(e,t,n,o){var r=t.current,i=wt(),s=mo(r);return n=gv(n),t.context===null?t.context=n:t.pendingContext=n,t=Rn(i,s),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=po(r,t,s),e!==null&&(an(e,r,s,i),ua(e,r,s)),s}function Za(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Nm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fu(e,t){Nm(e,t),(e=e.alternate)&&Nm(e,t)}function tS(){return null}var bv=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bu(e){this._internalRoot=e}_l.prototype.render=Bu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Tl(e,t,null,null)};_l.prototype.unmount=Bu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ko(function(){Tl(null,e,null,null)}),t[Un]=null}};function _l(e){this._internalRoot=e}_l.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<to.length&&t!==0&&t<to[n].priority;n++);to.splice(n,0,e),n===0&&Xy(e)}};function Hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cm(){}function nS(e,t,n,o,r){if(r){if(typeof o=="function"){var i=o;o=function(){var c=Za(s);i.call(c)}}var s=vv(t,o,e,0,null,!1,!1,"",Cm);return e._reactRootContainer=s,e[Un]=s.current,Zi(e.nodeType===8?e.parentNode:e),Ko(),s}for(;r=e.lastChild;)e.removeChild(r);if(typeof o=="function"){var a=o;o=function(){var c=Za(l);a.call(c)}}var l=zu(e,0,!1,null,null,!1,!1,"",Cm);return e._reactRootContainer=l,e[Un]=l.current,Zi(e.nodeType===8?e.parentNode:e),Ko(function(){Tl(t,l,n,o)}),l}function Nl(e,t,n,o,r){var i=n._reactRootContainer;if(i){var s=i;if(typeof r=="function"){var a=r;r=function(){var l=Za(s);a.call(l)}}Tl(t,s,e,r)}else s=nS(n,t,e,r,o);return Za(s)}Gy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ki(t.pendingLanes);n!==0&&(cu(t,n|1),Et(t,Ge()),!(be&6)&&(Hr=Ge()+500,So()))}break;case 13:Ko(function(){var o=Ln(e,1);if(o!==null){var r=wt();an(o,e,1,r)}}),Fu(e,1)}};du=function(e){if(e.tag===13){var t=Ln(e,134217728);if(t!==null){var n=wt();an(t,e,134217728,n)}Fu(e,134217728)}};Jy=function(e){if(e.tag===13){var t=mo(e),n=Ln(e,t);if(n!==null){var o=wt();an(n,e,t,o)}Fu(e,t)}};Qy=function(){return ke};Yy=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};Kc=function(e,t,n){switch(t){case"input":if(Dc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var r=vl(o);if(!r)throw Error(H(90));Ny(o),Dc(o,r)}}}break;case"textarea":Ey(e,n);break;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}};qy=qu;Uy=Ko;var oS={usingClientEntryPoint:!1,Events:[_s,gr,vl,Ay,My,qu]},mi={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rS={bundleType:mi.bundleType,version:mi.version,rendererPackageName:mi.rendererPackageName,rendererConfig:mi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=zy(e),e===null?null:e.stateNode},findFiberByHostInstance:mi.findFiberByHostInstance||tS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qs.isDisabled&&Qs.supportsFiber)try{ml=Qs.inject(rS),$n=Qs}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oS;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hu(t))throw Error(H(200));return eS(e,t,null,n)};Ut.createRoot=function(e,t){if(!Hu(e))throw Error(H(299));var n=!1,o="",r=bv;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=zu(e,1,!1,null,null,n,!1,o,r),e[Un]=t.current,Zi(e.nodeType===8?e.parentNode:e),new Bu(t)};Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=zy(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e){return Ko(e)};Ut.hydrate=function(e,t,n){if(!jl(t))throw Error(H(200));return Nl(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!Hu(e))throw Error(H(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",s=bv;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=vv(t,null,e,1,n??null,r,!1,i,s),e[Un]=t.current,Zi(e),o)for(e=0;e<o.length;e++)n=o[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new _l(t)};Ut.render=function(e,t,n){if(!jl(t))throw Error(H(200));return Nl(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!jl(e))throw Error(H(40));return e._reactRootContainer?(Ko(function(){Nl(null,null,e,!1,function(){e._reactRootContainer=null,e[Un]=null})}),!0):!1};Ut.unstable_batchedUpdates=qu;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!jl(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Nl(e,t,n,!1,o)};Ut.version="18.3.1-next-f1338f8080-20240426";function xv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xv)}catch(e){console.error(e)}}xv(),xy.exports=Ut;var Vu=xy.exports;const iS=Qd(Vu);var Em=Vu;Oc.createRoot=Em.createRoot,Oc.hydrateRoot=Em.hydrateRoot;const Pm=e=>{let t;const n=new Set,o=(c,f)=>{const m=typeof c=="function"?c(t):c;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,h))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(o,r,a);return a},sS=e=>e?Pm(e):Pm,aS=e=>e;function lS(e,t=aS){const n=te.useSyncExternalStore(e.subscribe,te.useCallback(()=>t(e.getState()),[e,t]),te.useCallback(()=>t(e.getInitialState()),[e,t]));return te.useDebugValue(n),n}const Im=e=>{const t=sS(e),n=o=>lS(t,o);return Object.assign(n,t),n},Wu=e=>e?Im(e):Im;function cS(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const s=l=>l===null?null:JSON.parse(l,void 0),a=(i=n.getItem(r))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const _d=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return _d(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return _d(o)(n)}}}},dS=(e,t)=>(n,o,r)=>{let i={storage:cS(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,u)=>({...u,...v}),...t},s=!1,a=0;const l=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},o,r);const m=()=>{const v=i.partialize({...o()});return f.setItem(i.name,{state:v,version:i.version})},h=r.setState;r.setState=(v,u)=>(h(v,u),m());const y=e((...v)=>(n(...v),m()),o,r);r.getInitialState=()=>y;let g;const b=()=>{var v,u;if(!f)return;const p=++a;s=!1,l.forEach(S=>{var T;return S((T=o())!=null?T:y)});const x=((u=i.onRehydrateStorage)==null?void 0:u.call(i,(v=o())!=null?v:y))||void 0;return _d(f.getItem.bind(f))(i.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==i.version){if(i.migrate){const T=i.migrate(S.state,S.version);return T instanceof Promise?T.then(C=>[!0,C]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var T;if(p!==a)return;const[C,$]=S;if(g=i.merge($,(T=o())!=null?T:y),n(g,!0),C)return m()}).then(()=>{p===a&&(x==null||x(o(),void 0),g=o(),s=!0,c.forEach(S=>S(g)))}).catch(S=>{p===a&&(x==null||x(void 0,S))})};return r.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:v=>(l.add(v),()=>{l.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||b(),g||y},uS=dS,ls=["editor-to-agent","agent-to-editor"],cs=["request","response","notification","error","unknown"],pS={directions:new Set(ls),kinds:new Set(cs),search:"",showStreams:!0};function fS(e){var n,o;if(e.kind!=="notification"||e.method!=="session/update")return!1;const t=(n=e.payload)==null?void 0:n.params;return((o=t==null?void 0:t.update)==null?void 0:o.sessionUpdate)==="agent_message_chunk"}const ne=Wu()(uS(e=>({session:null,messages:[],connection:"idle",lastError:null,selectedSeq:null,replayDone:!1,filters:pS,playback:{cap:null,playing:!1,speed:1},detailTab:"tree",clearedUpToSeq:null,handleEvent:t=>{switch(t.type){case"session.start":e(n=>{const o=n.session!==null&&n.session.id===t.session.id,r=n.session===null,i=o||r;return{session:t.session,messages:[],selectedSeq:i?n.selectedSeq:null,replayDone:!1,clearedUpToSeq:i?n.clearedUpToSeq:null,playback:i?n.playback:{...n.playback,cap:null,playing:!1}}});return;case"message":e(n=>n.clearedUpToSeq!==null&&t.message.seq<=n.clearedUpToSeq?{}:{messages:[...n.messages,t.message]});return;case"replay.done":e({replayDone:!0});return;case"session.end":e({session:t.session});return}},setConnection:(t,n=null)=>e({connection:t,lastError:n}),select:t=>e({selectedSeq:t}),setSearch:t=>e(n=>({filters:{...n.filters,search:t}})),toggleDirection:t=>e(n=>{const o=new Set(n.filters.directions);return o.has(t)?o.delete(t):o.add(t),{filters:{...n.filters,directions:o}}}),toggleKind:t=>e(n=>{const o=new Set(n.filters.kinds);return o.has(t)?o.delete(t):o.add(t),{filters:{...n.filters,kinds:o}}}),toggleStreams:()=>e(t=>({filters:{...t.filters,showStreams:!t.filters.showStreams}})),setPlaybackCap:t=>e(n=>({playback:{...n.playback,cap:t}})),setPlaying:t=>e(n=>({playback:{...n.playback,playing:t}})),setPlaybackSpeed:t=>e(n=>({playback:{...n.playback,speed:t}})),setDetailTab:t=>e({detailTab:t}),appendMessages:t=>{t.length!==0&&e(n=>{const o=n.clearedUpToSeq!==null?t.filter(r=>r.seq>n.clearedUpToSeq):t;return o.length===0?n:{messages:[...n.messages,...o]}})},loadFromExport:t=>{e({session:{id:t.session.id,name:t.session.name,agentCommand:t.session.agentCommand,startedAt:t.session.startedAt,endedAt:t.session.endedAt,clientName:t.session.clientName,importedAt:t.exportedAt,clientVersion:null,clientPlatform:null,agentName:null,agentVersion:null,protocolVersion:null,currentMode:null,currentModel:null,agentCapabilitiesJson:null},messages:t.messages,selectedSeq:null,replayDone:!0,clearedUpToSeq:null,playback:{cap:null,playing:!1,speed:1},connection:"idle",lastError:null})},clear:()=>e(t=>{const n=t.messages.length>0?t.messages[t.messages.length-1].seq:t.clearedUpToSeq;return{messages:[],selectedSeq:null,clearedUpToSeq:n}})}),{name:"acp.messages.v1",partialize:e=>({filters:{directions:[...e.filters.directions],kinds:[...e.filters.kinds],showStreams:e.filters.showStreams}}),merge:(e,t)=>{const n=e;return n!=null&&n.filters?{...t,filters:{...t.filters,directions:new Set(n.filters.directions),kinds:new Set(n.filters.kinds),showStreams:n.filters.showStreams}}:t}}));function mS(e,t,n=null){const o=t.search.trim().toLowerCase();return e.filter(r=>{if(n!==null&&r.seq>n||!t.directions.has(r.direction))return!1;if(fS(r)){if(!t.showStreams)return!1}else if(!t.kinds.has(r.kind))return!1;return!(o&&!r.raw.toLowerCase().includes(o))})}function hS(e,t){return t===null?null:e.find(n=>n.seq===t)??null}function Cl(e){const t=new Map,n=new Map;for(const o of e){if(o.rpcId===void 0||o.rpcId===null)continue;const r=String(o.rpcId);if(o.kind==="request")t.set(r,o.seq);else if(o.kind==="response"||o.kind==="error"){const i=t.get(r);i!==void 0&&n.set(o.seq,i)}}return n}const wv="ws://127.0.0.1:3737",yS=1500,gS=12e3;let En=null,qi=null,el=0,ds=!1,Ku=wv,Om=!1,Pr=[],jd=!1;function Nd(){if(jd=!1,Pr.length===0)return;const e=Pr;Pr=[],ne.getState().appendMessages(e)}function vS(){jd||(jd=!0,typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Nd):Promise.resolve().then(Nd))}function Rm(){if(ds)return;const e=Math.min(gS,yS*Math.pow(1.6,el));el+=1,qi=setTimeout(()=>{qi=null,Gu(Ku)},e)}function Gu(e=wv){if(En){try{En.close()}catch{}En=null}Pr=[],ds=!1,Ku=e;const t=ne.getState();t.connection!=="connecting"&&t.setConnection("connecting");let n;try{n=new WebSocket(e)}catch(o){const r=o instanceof Error?o.message:String(o);t.setConnection("connecting",r),Rm();return}En=n,n.addEventListener("open",()=>{el=0,Om=!0,ne.getState().setConnection("open")}),n.addEventListener("message",o=>{try{const r=JSON.parse(o.data);if(r.type==="message"){Pr.push(r.message),vS();return}Pr.length>0&&Nd(),ne.getState().handleEvent(r)}catch(r){console.warn("acp-devtools: invalid WS frame",r)}}),n.addEventListener("error",()=>{}),n.addEventListener("close",()=>{if(En===n&&(En=null),ds){ne.getState().setConnection("closed");return}const o=ne.getState();if(Om&&o.replayDone){o.setConnection("idle");return}o.setConnection("connecting"),Rm()})}function Cd(){if(ds=!0,qi&&(clearTimeout(qi),qi=null),En){try{En.close()}catch{}En=null}ne.getState().setConnection("idle")}function bS(){Cd(),ds=!1,el=0,Gu(Ku)}async function xS(e){const t=await fetch(`/api/sessions/${e}/messages`,{headers:{accept:"application/json"}});if(!t.ok){const n=await Ju(t);throw new Error(n)}return await t.json()}async function Sv(){const e=await fetch("/api/sessions",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`sessions: HTTP ${e.status}`);return(await e.json()).sessions??[]}async function $v(e){const t=await e.text(),n=await fetch("/api/import",{method:"POST",headers:{"content-type":"application/json","x-acp-source-filename":kS(e.name)},body:t});if(!n.ok){const o=await Ju(n);throw new Error(o)}return await n.json()}async function wS(e){const t=await fetch(`/api/sessions/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404){const n=await Ju(t);throw new Error(n)}}function tl(e){return`ws://${window.location.host}/replay/${e}`}function SS(e){return e!==null&&/\/replay\/\d+$/.test(e)}function $S(e){const t=e.match(/\/replay\/(\d+)$/);return t?Number(t[1]):null}async function Ju(e){try{const t=await e.json();if(t.error)return t.error}catch{}return`HTTP ${e.status} ${e.statusText}`}function kS(e){return e.replace(/[^\x20-\x7E]/g,"?").slice(0,200)}const Ed="acp.discovery.selectedUrl";function TS(){try{return localStorage.getItem(Ed)}catch{return null}}function _S(e){try{e?localStorage.setItem(Ed,e):localStorage.removeItem(Ed)}catch{}}const ft=Wu(e=>({captures:[],savedSessions:[],selectedUrl:TS(),lastFetchAt:null,lastError:null,setCaptures:t=>e({captures:t,lastFetchAt:Date.now(),lastError:null}),setSavedSessions:t=>e({savedSessions:t}),setSelected:t=>{_S(t),e({selectedUrl:t})},setError:t=>e({lastError:t})})),jS=2500;let rr=null;async function NS(){const e=await fetch("/api/active",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`discovery: HTTP ${e.status}`);return(await e.json()).captures??[]}async function Am(){const e=ft.getState();try{const[t,n]=await Promise.all([NS(),Sv().catch(()=>e.savedSessions)]);e.setCaptures(t),e.setSavedSessions(n)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}function CS(){return Am(),rr&&clearInterval(rr),rr=setInterval(()=>{Am()},jS),()=>{rr&&(clearInterval(rr),rr=null)}}async function Qu(){const e=ft.getState();try{const t=await Sv();e.setSavedSessions(t)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}const kv="acp.theme.v1";function ES(){try{const e=localStorage.getItem(kv);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function PS(){return typeof window>"u"||!window.matchMedia?!0:window.matchMedia("(prefers-color-scheme: dark)").matches}function Tv(e){return e==="system"?PS()?"dark":"light":e}function _v(e){if(typeof document>"u")return;const t=document.documentElement;t.classList.toggle("light",e==="light"),t.classList.toggle("dark",e==="dark")}const jv=typeof window<"u"?ES():"system",Nv=Tv(jv);typeof window<"u"&&_v(Nv);const Pd=Wu(e=>({mode:jv,resolved:Nv,setMode:t=>{try{localStorage.setItem(kv,t)}catch{}const n=Tv(t);_v(n),e({mode:t,resolved:n})}}));function IS(){if(typeof window>"u"||!window.matchMedia)return()=>{};const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{mode:n,setMode:o}=Pd.getState();n==="system"&&o("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}const OS={AcceptNesNotification:{description:"Notification sent when a suggestion is accepted.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
41
41
|
metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
42
42
|
these keys.
|
|
43
43
|
|
|
@@ -1722,7 +1722,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
|
|
|
1722
1722
|
metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1723
1723
|
these keys.
|
|
1724
1724
|
|
|
1725
|
-
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"fs/write_text_file","x-side":"client"}},
|
|
1725
|
+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"fs/write_text_file","x-side":"client"}},RS="https://json-schema.org/draft/2020-12/schema",AS=[{anyOf:[{allOf:[{$ref:"#/$defs/AgentRequest"}],title:"Request"},{allOf:[{$ref:"#/$defs/AgentResponse"}],title:"Response"},{allOf:[{$ref:"#/$defs/AgentNotification"}],title:"Notification"}],description:`A message (request, response, or notification) with \`"jsonrpc": "2.0"\` specified as
|
|
1726
1726
|
[required by JSON-RPC 2.0 Specification][1].
|
|
1727
1727
|
|
|
1728
1728
|
[1]: https://www.jsonrpc.org/specification#compatibility`,properties:{jsonrpc:{enum:["2.0"],type:"string"}},required:["jsonrpc"],title:"Agent",type:"object"},{anyOf:[{allOf:[{$ref:"#/$defs/ClientRequest"}],title:"Request"},{allOf:[{$ref:"#/$defs/ClientResponse"}],title:"Response"},{allOf:[{$ref:"#/$defs/ClientNotification"}],title:"Notification"}],description:`A message (request, response, or notification) with \`"jsonrpc": "2.0"\` specified as
|
|
@@ -1755,14 +1755,14 @@ synchronous programming language then there is little it can do to react to
|
|
|
1755
1755
|
a \`$/cancel_request\` notification. If an agent or client receives
|
|
1756
1756
|
notifications starting with '$/' it is free to ignore the notification.
|
|
1757
1757
|
|
|
1758
|
-
Notifications do not expect a response.`,title:"ProtocolLevel"}],CS="Agent Client Protocol",$v={$defs:TS,$schema:_S,anyOf:jS,title:CS};var jd={exports:{}},kv={},an={},Br={},_s={},ue={},cs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(u){if(super(),!e.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class o extends t{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((x,S)=>`${x}${S}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((x,S)=>(S instanceof n&&(x[S.str]=(x[S.str]||0)+1),x),{})}}e._Code=o,e.nil=new o("");function r(p,...u){const x=[p[0]];let S=0;for(;S<u.length;)a(x,u[S]),x.push(p[++S]);return new o(x)}e._=r;const i=new o("+");function s(p,...u){const x=[y(p[0])];let S=0;for(;S<u.length;)x.push(i),a(x,u[S]),x.push(i,y(p[++S]));return l(x),new o(x)}e.str=s;function a(p,u){u instanceof o?p.push(...u._items):u instanceof n?p.push(u):p.push(m(u))}e.addCodeArg=a;function l(p){let u=1;for(;u<p.length-1;){if(p[u]===i){const x=c(p[u-1],p[u+1]);if(x!==void 0){p.splice(u-1,3,x);continue}p[u++]="+"}u++}}function c(p,u){if(u==='""')return p;if(p==='""')return u;if(typeof p=="string")return u instanceof n||p[p.length-1]!=='"'?void 0:typeof u!="string"?`${p.slice(0,-1)}${u}"`:u[0]==='"'?p.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(p instanceof n))return`"${p}${u.slice(1)}`}function f(p,u){return u.emptyStr()?p:p.emptyStr()?u:s`${p}${u}`}e.strConcat=f;function m(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:y(Array.isArray(p)?p.join(","):p)}function h(p){return new o(y(p))}e.stringify=h;function y(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function g(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new o(`.${p}`):r`[${p}]`}e.getProperty=g;function b(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new o(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=b;function v(p){return new o(p.toString())}e.regexpCode=v})(cs);var Cd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=cs;class n extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var o;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class r{constructor({prefixes:c,parent:f}={}){this._names={},this._prefixes=c,this._parent=f}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const f=this._names[c]||this._nameGroup(c);return`${c}${f.index++}`}_nameGroup(c){var f,m;if(!((m=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||m===void 0)&&m.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=r;class i extends t.Name{constructor(c,f){super(f),this.prefix=c}setValue(c,{property:f,itemIndex:m}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(f)}[${m}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends r{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?s:t.nil}}get(){return this._scope}name(c){return new i(c,this._newName(c))}value(c,f){var m;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(c),{prefix:y}=h,g=(m=f.key)!==null&&m!==void 0?m:f.ref;let b=this._values[y];if(b){const u=b.get(g);if(u)return u}else b=this._values[y]=new Map;b.set(g,h);const v=this._scope[y]||(this._scope[y]=[]),p=v.length;return v[p]=f.ref,h.setValue(f,{property:y,itemIndex:p}),h}getValue(c,f){const m=this._values[c];if(m)return m.get(f)}scopeRefs(c,f=this._values){return this._reduceValues(f,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${c}${m.scopePath}`})}scopeCode(c=this._values,f,m){return this._reduceValues(c,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},f,m)}_reduceValues(c,f,m={},h){let y=t.nil;for(const g in c){const b=c[g];if(!b)continue;const v=m[g]=m[g]||new Map;b.forEach(p=>{if(v.has(p))return;v.set(p,o.Started);let u=f(p);if(u){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${x} ${p} = ${u};${this.opts._n}`}else if(u=h==null?void 0:h(p))y=(0,t._)`${y}${u}${this.opts._n}`;else throw new n(p);v.set(p,o.Completed)})}return y}}e.ValueScope=a})(Cd);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=cs,n=Cd;var o=cs;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var r=Cd;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(w,k){return this}}class s extends i{constructor(w,k,E){super(),this.varKind=w,this.name=k,this.rhs=E}render({es5:w,_n:k}){const E=w?n.varKinds.var:this.varKind,K=this.rhs===void 0?"":` = ${this.rhs}`;return`${E} ${this.name}${K};`+k}optimizeNames(w,k){if(w[this.name.str])return this.rhs&&(this.rhs=U(this.rhs,w,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(w,k,E){super(),this.lhs=w,this.rhs=k,this.sideEffects=E}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,k){if(!(this.lhs instanceof t.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=U(this.rhs,w,k),this}get names(){const w=this.lhs instanceof t.Name?{}:{...this.lhs.names};return L(w,this.rhs)}}class l extends a{constructor(w,k,E,K){super(w,E,K),this.op=k}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}}class c extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class f extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}}class m extends i{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}}class h extends i{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code};`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,k){return this.code=U(this.code,w,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends i{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((k,E)=>k+E.render(w),"")}optimizeNodes(){const{nodes:w}=this;let k=w.length;for(;k--;){const E=w[k].optimizeNodes();Array.isArray(E)?w.splice(k,1,...E):E?w[k]=E:w.splice(k,1)}return w.length>0?this:void 0}optimizeNames(w,k){const{nodes:E}=this;let K=E.length;for(;K--;){const O=E[K];O.optimizeNames(w,k)||(D(w,O.names),E.splice(K,1))}return E.length>0?this:void 0}get names(){return this.nodes.reduce((w,k)=>H(w,k.names),{})}}class g extends y{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class b extends y{}class v extends g{}v.kind="else";class p extends g{constructor(w,k){super(k),this.condition=w}render(w){let k=`if(${this.condition})`+super.render(w);return this.else&&(k+="else "+this.else.render(w)),k}optimizeNodes(){super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let k=this.else;if(k){const E=k.optimizeNodes();k=this.else=Array.isArray(E)?new v(E):E}if(k)return w===!1?k instanceof p?k:k.nodes:this.nodes.length?this:new p(Q(w),k instanceof p?[k]:k.nodes);if(!(w===!1||!this.nodes.length))return this}optimizeNames(w,k){var E;if(this.else=(E=this.else)===null||E===void 0?void 0:E.optimizeNames(w,k),!!(super.optimizeNames(w,k)||this.else))return this.condition=U(this.condition,w,k),this}get names(){const w=super.names;return L(w,this.condition),this.else&&H(w,this.else.names),w}}p.kind="if";class u extends g{}u.kind="for";class x extends u{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iteration=U(this.iteration,w,k),this}get names(){return H(super.names,this.iteration.names)}}class S extends u{constructor(w,k,E,K){super(),this.varKind=w,this.name=k,this.from=E,this.to=K}render(w){const k=w.es5?n.varKinds.var:this.varKind,{name:E,from:K,to:O}=this;return`for(${k} ${E}=${K}; ${E}<${O}; ${E}++)`+super.render(w)}get names(){const w=L(super.names,this.from);return L(w,this.to)}}class T extends u{constructor(w,k,E,K){super(),this.loop=w,this.varKind=k,this.name=E,this.iterable=K}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iterable=U(this.iterable,w,k),this}get names(){return H(super.names,this.iterable.names)}}class N extends g{constructor(w,k,E){super(),this.name=w,this.args=k,this.async=E}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}}N.kind="func";class $ extends y{render(w){return"return "+super.render(w)}}$.kind="return";class C extends g{render(w){let k="try"+super.render(w);return this.catch&&(k+=this.catch.render(w)),this.finally&&(k+=this.finally.render(w)),k}optimizeNodes(){var w,k;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(w,k){var E,K;return super.optimizeNames(w,k),(E=this.catch)===null||E===void 0||E.optimizeNames(w,k),(K=this.finally)===null||K===void 0||K.optimizeNames(w,k),this}get names(){const w=super.names;return this.catch&&H(w,this.catch.names),this.finally&&H(w,this.finally.names),w}}class R extends g{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}}R.kind="catch";class M extends g{render(w){return"finally"+super.render(w)}}M.kind="finally";class F{constructor(w,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
1759
|
-
`:""},this._extScope=w,this._scope=new n.Scope({parent:w}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,k){const E=this._extScope.value(w,k);return(this._values[E.prefix]||(this._values[E.prefix]=new Set)).add(E),E}getScopeValue(w,k){return this._extScope.getValue(w,k)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,k,E,K){const O=this._scope.toName(k);return E!==void 0&&K&&(this._constants[O.str]=E),this._leafNode(new s(w,O,E)),O}const(w,k,E){return this._def(n.varKinds.const,w,k,E)}let(w,k,E){return this._def(n.varKinds.let,w,k,E)}var(w,k,E){return this._def(n.varKinds.var,w,k,E)}assign(w,k,E){return this._leafNode(new a(w,k,E))}add(w,k){return this._leafNode(new l(w,e.operators.ADD,k))}code(w){return typeof w=="function"?w():w!==t.nil&&this._leafNode(new h(w)),this}object(...w){const k=["{"];for(const[E,K]of w)k.length>1&&k.push(","),k.push(E),(E!==K||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,K));return k.push("}"),new t._Code(k)}if(w,k,E){if(this._blockNode(new p(w)),k&&E)this.code(k).else().code(E).endIf();else if(k)this.code(k).endIf();else if(E)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new p(w))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(p,v)}_for(w,k){return this._blockNode(w),k&&this.code(k).endFor(),this}for(w,k){return this._for(new x(w),k)}forRange(w,k,E,K,O=this.opts.es5?n.varKinds.var:n.varKinds.let){const X=this._scope.toName(w);return this._for(new S(O,X,k,E),()=>K(X))}forOf(w,k,E,K=n.varKinds.const){const O=this._scope.toName(w);if(this.opts.es5){const X=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${X}.length`,ie=>{this.var(O,(0,t._)`${X}[${ie}]`),E(O)})}return this._for(new T("of",K,O,k),()=>E(O))}forIn(w,k,E,K=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${k})`,E);const O=this._scope.toName(w);return this._for(new T("in",K,O,k),()=>E(O))}endFor(){return this._endBlockNode(u)}label(w){return this._leafNode(new c(w))}break(w){return this._leafNode(new f(w))}return(w){const k=new $;if(this._blockNode(k),this.code(w),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(w,k,E){if(!k&&!E)throw new Error('CodeGen: "try" without "catch" and "finally"');const K=new C;if(this._blockNode(K),this.code(w),k){const O=this.name("e");this._currNode=K.catch=new R(O),k(O)}return E&&(this._currNode=K.finally=new M,this.code(E)),this._endBlockNode(R,M)}throw(w){return this._leafNode(new m(w))}block(w,k){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(k),this}endBlock(w){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const E=this._nodes.length-k;if(E<0||w!==void 0&&E!==w)throw new Error(`CodeGen: wrong number of nodes: ${E} vs ${w} expected`);return this._nodes.length=k,this}func(w,k=t.nil,E,K){return this._blockNode(new N(w,k,E)),K&&this.code(K).endFunc(),this}endFunc(){return this._endBlockNode(N)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,k){const E=this._currNode;if(E instanceof w||k&&E instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${w.kind}/${k.kind}`:w.kind}"`)}_elseNode(w){const k=this._currNode;if(!(k instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=w,this}get _root(){return this._nodes[0]}get _currNode(){const w=this._nodes;return w[w.length-1]}set _currNode(w){const k=this._nodes;k[k.length-1]=w}}e.CodeGen=F;function H(_,w){for(const k in w)_[k]=(_[k]||0)+(w[k]||0);return _}function L(_,w){return w instanceof t._CodeOrName?H(_,w.names):_}function U(_,w,k){if(_ instanceof t.Name)return E(_);if(!K(_))return _;return new t._Code(_._items.reduce((O,X)=>(X instanceof t.Name&&(X=E(X)),X instanceof t._Code?O.push(...X._items):O.push(X),O),[]));function E(O){const X=k[O.str];return X===void 0||w[O.str]!==1?O:(delete w[O.str],X)}function K(O){return O instanceof t._Code&&O._items.some(X=>X instanceof t.Name&&w[X.str]===1&&k[X.str]!==void 0)}}function D(_,w){for(const k in w)_[k]=(_[k]||0)-(w[k]||0)}function Q(_){return typeof _=="boolean"||typeof _=="number"||_===null?!_:(0,t._)`!${A(_)}`}e.not=Q;const ee=j(e.operators.AND);function q(..._){return _.reduce(ee)}e.and=q;const G=j(e.operators.OR);function P(..._){return _.reduce(G)}e.or=P;function j(_){return(w,k)=>w===t.nil?k:k===t.nil?w:(0,t._)`${A(w)} ${_} ${A(k)}`}function A(_){return _ instanceof t.Name?_:(0,t._)`(${_})`}})(ue);var J={};Object.defineProperty(J,"__esModule",{value:!0});J.checkStrictMode=J.getErrorPath=J.Type=J.useFunc=J.setEvaluated=J.evaluatedPropsToName=J.mergeEvaluated=J.eachItem=J.unescapeJsonPointer=J.escapeJsonPointer=J.escapeFragment=J.unescapeFragment=J.schemaRefOrVal=J.schemaHasRulesButRef=J.schemaHasRules=J.checkUnknownRules=J.alwaysValidSchema=J.toHash=void 0;const je=ue,NS=cs;function ES(e){const t={};for(const n of e)t[n]=!0;return t}J.toHash=ES;function PS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Tv(e,t),!_v(t,e.self.RULES.all))}J.alwaysValidSchema=PS;function Tv(e,t=e.schema){const{opts:n,self:o}=e;if(!n.strictSchema||typeof t=="boolean")return;const r=o.RULES.keywords;for(const i in t)r[i]||Nv(e,`unknown keyword: "${i}"`)}J.checkUnknownRules=Tv;function _v(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}J.schemaHasRules=_v;function IS(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}J.schemaHasRulesButRef=IS;function OS({topSchemaRef:e,schemaPath:t},n,o,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,je._)`${n}`}return(0,je._)`${e}${t}${(0,je.getProperty)(o)}`}J.schemaRefOrVal=OS;function RS(e){return jv(decodeURIComponent(e))}J.unescapeFragment=RS;function AS(e){return encodeURIComponent(Vu(e))}J.escapeFragment=AS;function Vu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}J.escapeJsonPointer=Vu;function jv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}J.unescapeJsonPointer=jv;function MS(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}J.eachItem=MS;function Nm({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(r,i,s,a)=>{const l=s===void 0?i:s instanceof je.Name?(i instanceof je.Name?e(r,i,s):t(r,i,s),s):i instanceof je.Name?(t(r,s,i),i):n(i,s);return a===je.Name&&!(l instanceof je.Name)?o(r,l):l}}J.mergeEvaluated={props:Nm({mergeNames:(e,t,n)=>e.if((0,je._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,je._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,je._)`${n} || {}`).code((0,je._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,je._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,je._)`${n} || {}`),Wu(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Cv}),items:Nm({mergeNames:(e,t,n)=>e.if((0,je._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,je._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,je._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,je._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Cv(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,je._)`{}`);return t!==void 0&&Wu(e,n,t),n}J.evaluatedPropsToName=Cv;function Wu(e,t,n){Object.keys(n).forEach(o=>e.assign((0,je._)`${t}${(0,je.getProperty)(o)}`,!0))}J.setEvaluated=Wu;const Em={};function qS(e,t){return e.scopeValue("func",{ref:t,code:Em[t.code]||(Em[t.code]=new NS._Code(t.code))})}J.useFunc=qS;var Nd;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Nd||(J.Type=Nd={}));function US(e,t,n){if(e instanceof je.Name){const o=t===Nd.Num;return n?o?(0,je._)`"[" + ${e} + "]"`:(0,je._)`"['" + ${e} + "']"`:o?(0,je._)`"/" + ${e}`:(0,je._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,je.getProperty)(e).toString():"/"+Vu(e)}J.getErrorPath=US;function Nv(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}J.checkStrictMode=Nv;var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});const ut=ue,LS={data:new ut.Name("data"),valCxt:new ut.Name("valCxt"),instancePath:new ut.Name("instancePath"),parentData:new ut.Name("parentData"),parentDataProperty:new ut.Name("parentDataProperty"),rootData:new ut.Name("rootData"),dynamicAnchors:new ut.Name("dynamicAnchors"),vErrors:new ut.Name("vErrors"),errors:new ut.Name("errors"),this:new ut.Name("this"),self:new ut.Name("self"),scope:new ut.Name("scope"),json:new ut.Name("json"),jsonPos:new ut.Name("jsonPos"),jsonLen:new ut.Name("jsonLen"),jsonPart:new ut.Name("jsonPart")};Lt.default=LS;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ue,n=J,o=Lt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:p})=>p?(0,t.str)`"${v}" keyword must be ${p} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function r(v,p=e.keywordError,u,x){const{it:S}=v,{gen:T,compositeRule:N,allErrors:$}=S,C=m(v,p,u);x??(N||$)?l(T,C):c(S,(0,t._)`[${C}]`)}e.reportError=r;function i(v,p=e.keywordError,u){const{it:x}=v,{gen:S,compositeRule:T,allErrors:N}=x,$=m(v,p,u);l(S,$),T||N||c(x,o.default.vErrors)}e.reportExtraError=i;function s(v,p){v.assign(o.default.errors,p),v.if((0,t._)`${o.default.vErrors} !== null`,()=>v.if(p,()=>v.assign((0,t._)`${o.default.vErrors}.length`,p),()=>v.assign(o.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:v,keyword:p,schemaValue:u,data:x,errsCount:S,it:T}){if(S===void 0)throw new Error("ajv implementation error");const N=v.name("err");v.forRange("i",S,o.default.errors,$=>{v.const(N,(0,t._)`${o.default.vErrors}[${$}]`),v.if((0,t._)`${N}.instancePath === undefined`,()=>v.assign((0,t._)`${N}.instancePath`,(0,t.strConcat)(o.default.instancePath,T.errorPath))),v.assign((0,t._)`${N}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${p}`),T.opts.verbose&&(v.assign((0,t._)`${N}.schema`,u),v.assign((0,t._)`${N}.data`,x))})}e.extendErrors=a;function l(v,p){const u=v.const("err",p);v.if((0,t._)`${o.default.vErrors} === null`,()=>v.assign(o.default.vErrors,(0,t._)`[${u}]`),(0,t._)`${o.default.vErrors}.push(${u})`),v.code((0,t._)`${o.default.errors}++`)}function c(v,p){const{gen:u,validateName:x,schemaEnv:S}=v;S.$async?u.throw((0,t._)`new ${v.ValidationError}(${p})`):(u.assign((0,t._)`${x}.errors`,p),u.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(v,p,u){const{createErrors:x}=v.it;return x===!1?(0,t._)`{}`:h(v,p,u)}function h(v,p,u={}){const{gen:x,it:S}=v,T=[y(S,u),g(v,u)];return b(v,p,T),x.object(...T)}function y({errorPath:v},{instancePath:p}){const u=p?(0,t.str)`${v}${(0,n.getErrorPath)(p,n.Type.Str)}`:v;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,u)]}function g({keyword:v,it:{errSchemaPath:p}},{schemaPath:u,parentSchema:x}){let S=x?p:(0,t.str)`${p}/${v}`;return u&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(u,n.Type.Str)}`),[f.schemaPath,S]}function b(v,{params:p,message:u},x){const{keyword:S,data:T,schemaValue:N,it:$}=v,{opts:C,propertyName:R,topSchemaRef:M,schemaPath:F}=$;x.push([f.keyword,S],[f.params,typeof p=="function"?p(v):p||(0,t._)`{}`]),C.messages&&x.push([f.message,typeof u=="function"?u(v):u]),C.verbose&&x.push([f.schema,N],[f.parentSchema,(0,t._)`${M}${F}`],[o.default.data,T]),R&&x.push([f.propertyName,R])}})(_s);Object.defineProperty(Br,"__esModule",{value:!0});Br.boolOrEmptySchema=Br.topBoolOrEmptySchema=void 0;const DS=_s,zS=ue,FS=Lt,BS={message:"boolean schema is false"};function HS(e){const{gen:t,schema:n,validateName:o}=e;n===!1?Ev(e,!1):typeof n=="object"&&n.$async===!0?t.return(FS.default.data):(t.assign((0,zS._)`${o}.errors`,null),t.return(!0))}Br.topBoolOrEmptySchema=HS;function VS(e,t){const{gen:n,schema:o}=e;o===!1?(n.var(t,!1),Ev(e)):n.var(t,!0)}Br.boolOrEmptySchema=VS;function Ev(e,t){const{gen:n,data:o}=e,r={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,DS.reportError)(r,BS,void 0,t)}var Ze={},Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.getRules=Ko.isJSONType=void 0;const WS=["string","number","integer","boolean","null","object","array"],KS=new Set(WS);function GS(e){return typeof e=="string"&&KS.has(e)}Ko.isJSONType=GS;function JS(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ko.getRules=JS;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.shouldUseRule=Rn.shouldUseGroup=Rn.schemaHasRulesForType=void 0;function QS({schema:e,self:t},n){const o=t.RULES.types[n];return o&&o!==!0&&Pv(e,o)}Rn.schemaHasRulesForType=QS;function Pv(e,t){return t.rules.some(n=>Iv(e,n))}Rn.shouldUseGroup=Pv;function Iv(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(o=>e[o]!==void 0))}Rn.shouldUseRule=Iv;Object.defineProperty(Ze,"__esModule",{value:!0});Ze.reportTypeError=Ze.checkDataTypes=Ze.checkDataType=Ze.coerceAndCheckDataType=Ze.getJSONTypes=Ze.getSchemaTypes=Ze.DataType=void 0;const YS=Ko,XS=Rn,ZS=_s,fe=ue,Ov=J;var Er;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Er||(Ze.DataType=Er={}));function e$(e){const t=Rv(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Ze.getSchemaTypes=e$;function Rv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(YS.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ze.getJSONTypes=Rv;function t$(e,t){const{gen:n,data:o,opts:r}=e,i=n$(t,r.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,XS.schemaHasRulesForType)(e,t[0]));if(s){const a=Ku(t,o,r.strictNumbers,Er.Wrong);n.if(a,()=>{i.length?o$(e,t,i):Gu(e)})}return s}Ze.coerceAndCheckDataType=t$;const Av=new Set(["string","number","integer","boolean","null"]);function n$(e,t){return t?e.filter(n=>Av.has(n)||t==="array"&&n==="array"):[]}function o$(e,t,n){const{gen:o,data:r,opts:i}=e,s=o.let("dataType",(0,fe._)`typeof ${r}`),a=o.let("coerced",(0,fe._)`undefined`);i.coerceTypes==="array"&&o.if((0,fe._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>o.assign(r,(0,fe._)`${r}[0]`).assign(s,(0,fe._)`typeof ${r}`).if(Ku(t,r,i.strictNumbers),()=>o.assign(a,r))),o.if((0,fe._)`${a} !== undefined`);for(const c of n)(Av.has(c)||c==="array"&&i.coerceTypes==="array")&&l(c);o.else(),Gu(e),o.endIf(),o.if((0,fe._)`${a} !== undefined`,()=>{o.assign(r,a),r$(e,a)});function l(c){switch(c){case"string":o.elseIf((0,fe._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,fe._)`"" + ${r}`).elseIf((0,fe._)`${r} === null`).assign(a,(0,fe._)`""`);return;case"number":o.elseIf((0,fe._)`${s} == "boolean" || ${r} === null
|
|
1758
|
+
Notifications do not expect a response.`,title:"ProtocolLevel"}],MS="Agent Client Protocol",Cv={$defs:OS,$schema:RS,anyOf:AS,title:MS};var Id={exports:{}},Ev={},ln={},Vr={},Ns={},ue={},us={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(p){if(super(),!e.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class o extends t{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((x,S)=>`${x}${S}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((x,S)=>(S instanceof n&&(x[S.str]=(x[S.str]||0)+1),x),{})}}e._Code=o,e.nil=new o("");function r(u,...p){const x=[u[0]];let S=0;for(;S<p.length;)a(x,p[S]),x.push(u[++S]);return new o(x)}e._=r;const i=new o("+");function s(u,...p){const x=[y(u[0])];let S=0;for(;S<p.length;)x.push(i),a(x,p[S]),x.push(i,y(u[++S]));return l(x),new o(x)}e.str=s;function a(u,p){p instanceof o?u.push(...p._items):p instanceof n?u.push(p):u.push(m(p))}e.addCodeArg=a;function l(u){let p=1;for(;p<u.length-1;){if(u[p]===i){const x=c(u[p-1],u[p+1]);if(x!==void 0){u.splice(p-1,3,x);continue}u[p++]="+"}p++}}function c(u,p){if(p==='""')return u;if(u==='""')return p;if(typeof u=="string")return p instanceof n||u[u.length-1]!=='"'?void 0:typeof p!="string"?`${u.slice(0,-1)}${p}"`:p[0]==='"'?u.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(u instanceof n))return`"${u}${p.slice(1)}`}function f(u,p){return p.emptyStr()?u:u.emptyStr()?p:s`${u}${p}`}e.strConcat=f;function m(u){return typeof u=="number"||typeof u=="boolean"||u===null?u:y(Array.isArray(u)?u.join(","):u)}function h(u){return new o(y(u))}e.stringify=h;function y(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function g(u){return typeof u=="string"&&e.IDENTIFIER.test(u)?new o(`.${u}`):r`[${u}]`}e.getProperty=g;function b(u){if(typeof u=="string"&&e.IDENTIFIER.test(u))return new o(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)}e.getEsmExportName=b;function v(u){return new o(u.toString())}e.regexpCode=v})(us);var Od={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=us;class n extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var o;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class r{constructor({prefixes:c,parent:f}={}){this._names={},this._prefixes=c,this._parent=f}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const f=this._names[c]||this._nameGroup(c);return`${c}${f.index++}`}_nameGroup(c){var f,m;if(!((m=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||m===void 0)&&m.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=r;class i extends t.Name{constructor(c,f){super(f),this.prefix=c}setValue(c,{property:f,itemIndex:m}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(f)}[${m}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends r{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?s:t.nil}}get(){return this._scope}name(c){return new i(c,this._newName(c))}value(c,f){var m;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(c),{prefix:y}=h,g=(m=f.key)!==null&&m!==void 0?m:f.ref;let b=this._values[y];if(b){const p=b.get(g);if(p)return p}else b=this._values[y]=new Map;b.set(g,h);const v=this._scope[y]||(this._scope[y]=[]),u=v.length;return v[u]=f.ref,h.setValue(f,{property:y,itemIndex:u}),h}getValue(c,f){const m=this._values[c];if(m)return m.get(f)}scopeRefs(c,f=this._values){return this._reduceValues(f,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${c}${m.scopePath}`})}scopeCode(c=this._values,f,m){return this._reduceValues(c,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},f,m)}_reduceValues(c,f,m={},h){let y=t.nil;for(const g in c){const b=c[g];if(!b)continue;const v=m[g]=m[g]||new Map;b.forEach(u=>{if(v.has(u))return;v.set(u,o.Started);let p=f(u);if(p){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${x} ${u} = ${p};${this.opts._n}`}else if(p=h==null?void 0:h(u))y=(0,t._)`${y}${p}${this.opts._n}`;else throw new n(u);v.set(u,o.Completed)})}return y}}e.ValueScope=a})(Od);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=us,n=Od;var o=us;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var r=Od;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(w,k){return this}}class s extends i{constructor(w,k,N){super(),this.varKind=w,this.name=k,this.rhs=N}render({es5:w,_n:k}){const N=w?n.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${B};`+k}optimizeNames(w,k){if(w[this.name.str])return this.rhs&&(this.rhs=U(this.rhs,w,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(w,k,N){super(),this.lhs=w,this.rhs=k,this.sideEffects=N}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,k){if(!(this.lhs instanceof t.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=U(this.rhs,w,k),this}get names(){const w=this.lhs instanceof t.Name?{}:{...this.lhs.names};return L(w,this.rhs)}}class l extends a{constructor(w,k,N,B){super(w,N,B),this.op=k}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}}class c extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class f extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}}class m extends i{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}}class h extends i{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code};`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,k){return this.code=U(this.code,w,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends i{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((k,N)=>k+N.render(w),"")}optimizeNodes(){const{nodes:w}=this;let k=w.length;for(;k--;){const N=w[k].optimizeNodes();Array.isArray(N)?w.splice(k,1,...N):N?w[k]=N:w.splice(k,1)}return w.length>0?this:void 0}optimizeNames(w,k){const{nodes:N}=this;let B=N.length;for(;B--;){const O=N[B];O.optimizeNames(w,k)||(D(w,O.names),N.splice(B,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((w,k)=>V(w,k.names),{})}}class g extends y{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class b extends y{}class v extends g{}v.kind="else";class u extends g{constructor(w,k){super(k),this.condition=w}render(w){let k=`if(${this.condition})`+super.render(w);return this.else&&(k+="else "+this.else.render(w)),k}optimizeNodes(){super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let k=this.else;if(k){const N=k.optimizeNodes();k=this.else=Array.isArray(N)?new v(N):N}if(k)return w===!1?k instanceof u?k:k.nodes:this.nodes.length?this:new u(Q(w),k instanceof u?[k]:k.nodes);if(!(w===!1||!this.nodes.length))return this}optimizeNames(w,k){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(w,k),!!(super.optimizeNames(w,k)||this.else))return this.condition=U(this.condition,w,k),this}get names(){const w=super.names;return L(w,this.condition),this.else&&V(w,this.else.names),w}}u.kind="if";class p extends g{}p.kind="for";class x extends p{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iteration=U(this.iteration,w,k),this}get names(){return V(super.names,this.iteration.names)}}class S extends p{constructor(w,k,N,B){super(),this.varKind=w,this.name=k,this.from=N,this.to=B}render(w){const k=w.es5?n.varKinds.var:this.varKind,{name:N,from:B,to:O}=this;return`for(${k} ${N}=${B}; ${N}<${O}; ${N}++)`+super.render(w)}get names(){const w=L(super.names,this.from);return L(w,this.to)}}class T extends p{constructor(w,k,N,B){super(),this.loop=w,this.varKind=k,this.name=N,this.iterable=B}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iterable=U(this.iterable,w,k),this}get names(){return V(super.names,this.iterable.names)}}class C extends g{constructor(w,k,N){super(),this.name=w,this.args=k,this.async=N}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}}C.kind="func";class $ extends y{render(w){return"return "+super.render(w)}}$.kind="return";class j extends g{render(w){let k="try"+super.render(w);return this.catch&&(k+=this.catch.render(w)),this.finally&&(k+=this.finally.render(w)),k}optimizeNodes(){var w,k;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(w,k){var N,B;return super.optimizeNames(w,k),(N=this.catch)===null||N===void 0||N.optimizeNames(w,k),(B=this.finally)===null||B===void 0||B.optimizeNames(w,k),this}get names(){const w=super.names;return this.catch&&V(w,this.catch.names),this.finally&&V(w,this.finally.names),w}}class R extends g{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}}R.kind="catch";class M extends g{render(w){return"finally"+super.render(w)}}M.kind="finally";class F{constructor(w,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
1759
|
+
`:""},this._extScope=w,this._scope=new n.Scope({parent:w}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,k){const N=this._extScope.value(w,k);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(w,k){return this._extScope.getValue(w,k)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,k,N,B){const O=this._scope.toName(k);return N!==void 0&&B&&(this._constants[O.str]=N),this._leafNode(new s(w,O,N)),O}const(w,k,N){return this._def(n.varKinds.const,w,k,N)}let(w,k,N){return this._def(n.varKinds.let,w,k,N)}var(w,k,N){return this._def(n.varKinds.var,w,k,N)}assign(w,k,N){return this._leafNode(new a(w,k,N))}add(w,k){return this._leafNode(new l(w,e.operators.ADD,k))}code(w){return typeof w=="function"?w():w!==t.nil&&this._leafNode(new h(w)),this}object(...w){const k=["{"];for(const[N,B]of w)k.length>1&&k.push(","),k.push(N),(N!==B||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,B));return k.push("}"),new t._Code(k)}if(w,k,N){if(this._blockNode(new u(w)),k&&N)this.code(k).else().code(N).endIf();else if(k)this.code(k).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new u(w))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(u,v)}_for(w,k){return this._blockNode(w),k&&this.code(k).endFor(),this}for(w,k){return this._for(new x(w),k)}forRange(w,k,N,B,O=this.opts.es5?n.varKinds.var:n.varKinds.let){const Y=this._scope.toName(w);return this._for(new S(O,Y,k,N),()=>B(Y))}forOf(w,k,N,B=n.varKinds.const){const O=this._scope.toName(w);if(this.opts.es5){const Y=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${Y}.length`,ie=>{this.var(O,(0,t._)`${Y}[${ie}]`),N(O)})}return this._for(new T("of",B,O,k),()=>N(O))}forIn(w,k,N,B=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${k})`,N);const O=this._scope.toName(w);return this._for(new T("in",B,O,k),()=>N(O))}endFor(){return this._endBlockNode(p)}label(w){return this._leafNode(new c(w))}break(w){return this._leafNode(new f(w))}return(w){const k=new $;if(this._blockNode(k),this.code(w),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(w,k,N){if(!k&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new j;if(this._blockNode(B),this.code(w),k){const O=this.name("e");this._currNode=B.catch=new R(O),k(O)}return N&&(this._currNode=B.finally=new M,this.code(N)),this._endBlockNode(R,M)}throw(w){return this._leafNode(new m(w))}block(w,k){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(k),this}endBlock(w){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-k;if(N<0||w!==void 0&&N!==w)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${w} expected`);return this._nodes.length=k,this}func(w,k=t.nil,N,B){return this._blockNode(new C(w,k,N)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,k){const N=this._currNode;if(N instanceof w||k&&N instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${w.kind}/${k.kind}`:w.kind}"`)}_elseNode(w){const k=this._currNode;if(!(k instanceof u))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=w,this}get _root(){return this._nodes[0]}get _currNode(){const w=this._nodes;return w[w.length-1]}set _currNode(w){const k=this._nodes;k[k.length-1]=w}}e.CodeGen=F;function V(E,w){for(const k in w)E[k]=(E[k]||0)+(w[k]||0);return E}function L(E,w){return w instanceof t._CodeOrName?V(E,w.names):E}function U(E,w,k){if(E instanceof t.Name)return N(E);if(!B(E))return E;return new t._Code(E._items.reduce((O,Y)=>(Y instanceof t.Name&&(Y=N(Y)),Y instanceof t._Code?O.push(...Y._items):O.push(Y),O),[]));function N(O){const Y=k[O.str];return Y===void 0||w[O.str]!==1?O:(delete w[O.str],Y)}function B(O){return O instanceof t._Code&&O._items.some(Y=>Y instanceof t.Name&&w[Y.str]===1&&k[Y.str]!==void 0)}}function D(E,w){for(const k in w)E[k]=(E[k]||0)-(w[k]||0)}function Q(E){return typeof E=="boolean"||typeof E=="number"||E===null?!E:(0,t._)`!${A(E)}`}e.not=Q;const ee=_(e.operators.AND);function q(...E){return E.reduce(ee)}e.and=q;const G=_(e.operators.OR);function I(...E){return E.reduce(G)}e.or=I;function _(E){return(w,k)=>w===t.nil?k:k===t.nil?w:(0,t._)`${A(w)} ${E} ${A(k)}`}function A(E){return E instanceof t.Name?E:(0,t._)`(${E})`}})(ue);var J={};Object.defineProperty(J,"__esModule",{value:!0});J.checkStrictMode=J.getErrorPath=J.Type=J.useFunc=J.setEvaluated=J.evaluatedPropsToName=J.mergeEvaluated=J.eachItem=J.unescapeJsonPointer=J.escapeJsonPointer=J.escapeFragment=J.unescapeFragment=J.schemaRefOrVal=J.schemaHasRulesButRef=J.schemaHasRules=J.checkUnknownRules=J.alwaysValidSchema=J.toHash=void 0;const je=ue,qS=us;function US(e){const t={};for(const n of e)t[n]=!0;return t}J.toHash=US;function LS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Pv(e,t),!Iv(t,e.self.RULES.all))}J.alwaysValidSchema=LS;function Pv(e,t=e.schema){const{opts:n,self:o}=e;if(!n.strictSchema||typeof t=="boolean")return;const r=o.RULES.keywords;for(const i in t)r[i]||Av(e,`unknown keyword: "${i}"`)}J.checkUnknownRules=Pv;function Iv(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}J.schemaHasRules=Iv;function DS(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}J.schemaHasRulesButRef=DS;function zS({topSchemaRef:e,schemaPath:t},n,o,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,je._)`${n}`}return(0,je._)`${e}${t}${(0,je.getProperty)(o)}`}J.schemaRefOrVal=zS;function FS(e){return Ov(decodeURIComponent(e))}J.unescapeFragment=FS;function BS(e){return encodeURIComponent(Yu(e))}J.escapeFragment=BS;function Yu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}J.escapeJsonPointer=Yu;function Ov(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}J.unescapeJsonPointer=Ov;function HS(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}J.eachItem=HS;function Mm({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(r,i,s,a)=>{const l=s===void 0?i:s instanceof je.Name?(i instanceof je.Name?e(r,i,s):t(r,i,s),s):i instanceof je.Name?(t(r,s,i),i):n(i,s);return a===je.Name&&!(l instanceof je.Name)?o(r,l):l}}J.mergeEvaluated={props:Mm({mergeNames:(e,t,n)=>e.if((0,je._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,je._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,je._)`${n} || {}`).code((0,je._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,je._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,je._)`${n} || {}`),Xu(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Rv}),items:Mm({mergeNames:(e,t,n)=>e.if((0,je._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,je._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,je._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,je._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Rv(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,je._)`{}`);return t!==void 0&&Xu(e,n,t),n}J.evaluatedPropsToName=Rv;function Xu(e,t,n){Object.keys(n).forEach(o=>e.assign((0,je._)`${t}${(0,je.getProperty)(o)}`,!0))}J.setEvaluated=Xu;const qm={};function VS(e,t){return e.scopeValue("func",{ref:t,code:qm[t.code]||(qm[t.code]=new qS._Code(t.code))})}J.useFunc=VS;var Rd;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Rd||(J.Type=Rd={}));function WS(e,t,n){if(e instanceof je.Name){const o=t===Rd.Num;return n?o?(0,je._)`"[" + ${e} + "]"`:(0,je._)`"['" + ${e} + "']"`:o?(0,je._)`"/" + ${e}`:(0,je._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,je.getProperty)(e).toString():"/"+Yu(e)}J.getErrorPath=WS;function Av(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}J.checkStrictMode=Av;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});const pt=ue,KS={data:new pt.Name("data"),valCxt:new pt.Name("valCxt"),instancePath:new pt.Name("instancePath"),parentData:new pt.Name("parentData"),parentDataProperty:new pt.Name("parentDataProperty"),rootData:new pt.Name("rootData"),dynamicAnchors:new pt.Name("dynamicAnchors"),vErrors:new pt.Name("vErrors"),errors:new pt.Name("errors"),this:new pt.Name("this"),self:new pt.Name("self"),scope:new pt.Name("scope"),json:new pt.Name("json"),jsonPos:new pt.Name("jsonPos"),jsonLen:new pt.Name("jsonLen"),jsonPart:new pt.Name("jsonPart")};Dt.default=KS;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ue,n=J,o=Dt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:u})=>u?(0,t.str)`"${v}" keyword must be ${u} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function r(v,u=e.keywordError,p,x){const{it:S}=v,{gen:T,compositeRule:C,allErrors:$}=S,j=m(v,u,p);x??(C||$)?l(T,j):c(S,(0,t._)`[${j}]`)}e.reportError=r;function i(v,u=e.keywordError,p){const{it:x}=v,{gen:S,compositeRule:T,allErrors:C}=x,$=m(v,u,p);l(S,$),T||C||c(x,o.default.vErrors)}e.reportExtraError=i;function s(v,u){v.assign(o.default.errors,u),v.if((0,t._)`${o.default.vErrors} !== null`,()=>v.if(u,()=>v.assign((0,t._)`${o.default.vErrors}.length`,u),()=>v.assign(o.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:v,keyword:u,schemaValue:p,data:x,errsCount:S,it:T}){if(S===void 0)throw new Error("ajv implementation error");const C=v.name("err");v.forRange("i",S,o.default.errors,$=>{v.const(C,(0,t._)`${o.default.vErrors}[${$}]`),v.if((0,t._)`${C}.instancePath === undefined`,()=>v.assign((0,t._)`${C}.instancePath`,(0,t.strConcat)(o.default.instancePath,T.errorPath))),v.assign((0,t._)`${C}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${u}`),T.opts.verbose&&(v.assign((0,t._)`${C}.schema`,p),v.assign((0,t._)`${C}.data`,x))})}e.extendErrors=a;function l(v,u){const p=v.const("err",u);v.if((0,t._)`${o.default.vErrors} === null`,()=>v.assign(o.default.vErrors,(0,t._)`[${p}]`),(0,t._)`${o.default.vErrors}.push(${p})`),v.code((0,t._)`${o.default.errors}++`)}function c(v,u){const{gen:p,validateName:x,schemaEnv:S}=v;S.$async?p.throw((0,t._)`new ${v.ValidationError}(${u})`):(p.assign((0,t._)`${x}.errors`,u),p.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(v,u,p){const{createErrors:x}=v.it;return x===!1?(0,t._)`{}`:h(v,u,p)}function h(v,u,p={}){const{gen:x,it:S}=v,T=[y(S,p),g(v,p)];return b(v,u,T),x.object(...T)}function y({errorPath:v},{instancePath:u}){const p=u?(0,t.str)`${v}${(0,n.getErrorPath)(u,n.Type.Str)}`:v;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,p)]}function g({keyword:v,it:{errSchemaPath:u}},{schemaPath:p,parentSchema:x}){let S=x?u:(0,t.str)`${u}/${v}`;return p&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(p,n.Type.Str)}`),[f.schemaPath,S]}function b(v,{params:u,message:p},x){const{keyword:S,data:T,schemaValue:C,it:$}=v,{opts:j,propertyName:R,topSchemaRef:M,schemaPath:F}=$;x.push([f.keyword,S],[f.params,typeof u=="function"?u(v):u||(0,t._)`{}`]),j.messages&&x.push([f.message,typeof p=="function"?p(v):p]),j.verbose&&x.push([f.schema,C],[f.parentSchema,(0,t._)`${M}${F}`],[o.default.data,T]),R&&x.push([f.propertyName,R])}})(Ns);Object.defineProperty(Vr,"__esModule",{value:!0});Vr.boolOrEmptySchema=Vr.topBoolOrEmptySchema=void 0;const GS=Ns,JS=ue,QS=Dt,YS={message:"boolean schema is false"};function XS(e){const{gen:t,schema:n,validateName:o}=e;n===!1?Mv(e,!1):typeof n=="object"&&n.$async===!0?t.return(QS.default.data):(t.assign((0,JS._)`${o}.errors`,null),t.return(!0))}Vr.topBoolOrEmptySchema=XS;function ZS(e,t){const{gen:n,schema:o}=e;o===!1?(n.var(t,!1),Mv(e)):n.var(t,!0)}Vr.boolOrEmptySchema=ZS;function Mv(e,t){const{gen:n,data:o}=e,r={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,GS.reportError)(r,YS,void 0,t)}var et={},Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.getRules=Go.isJSONType=void 0;const e$=["string","number","integer","boolean","null","object","array"],t$=new Set(e$);function n$(e){return typeof e=="string"&&t$.has(e)}Go.isJSONType=n$;function o$(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Go.getRules=o$;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.shouldUseRule=An.shouldUseGroup=An.schemaHasRulesForType=void 0;function r$({schema:e,self:t},n){const o=t.RULES.types[n];return o&&o!==!0&&qv(e,o)}An.schemaHasRulesForType=r$;function qv(e,t){return t.rules.some(n=>Uv(e,n))}An.shouldUseGroup=qv;function Uv(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(o=>e[o]!==void 0))}An.shouldUseRule=Uv;Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;const i$=Go,s$=An,a$=Ns,fe=ue,Lv=J;var Ir;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ir||(et.DataType=Ir={}));function l$(e){const t=Dv(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}et.getSchemaTypes=l$;function Dv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i$.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}et.getJSONTypes=Dv;function c$(e,t){const{gen:n,data:o,opts:r}=e,i=d$(t,r.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,s$.schemaHasRulesForType)(e,t[0]));if(s){const a=Zu(t,o,r.strictNumbers,Ir.Wrong);n.if(a,()=>{i.length?u$(e,t,i):ep(e)})}return s}et.coerceAndCheckDataType=c$;const zv=new Set(["string","number","integer","boolean","null"]);function d$(e,t){return t?e.filter(n=>zv.has(n)||t==="array"&&n==="array"):[]}function u$(e,t,n){const{gen:o,data:r,opts:i}=e,s=o.let("dataType",(0,fe._)`typeof ${r}`),a=o.let("coerced",(0,fe._)`undefined`);i.coerceTypes==="array"&&o.if((0,fe._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>o.assign(r,(0,fe._)`${r}[0]`).assign(s,(0,fe._)`typeof ${r}`).if(Zu(t,r,i.strictNumbers),()=>o.assign(a,r))),o.if((0,fe._)`${a} !== undefined`);for(const c of n)(zv.has(c)||c==="array"&&i.coerceTypes==="array")&&l(c);o.else(),ep(e),o.endIf(),o.if((0,fe._)`${a} !== undefined`,()=>{o.assign(r,a),p$(e,a)});function l(c){switch(c){case"string":o.elseIf((0,fe._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,fe._)`"" + ${r}`).elseIf((0,fe._)`${r} === null`).assign(a,(0,fe._)`""`);return;case"number":o.elseIf((0,fe._)`${s} == "boolean" || ${r} === null
|
|
1760
1760
|
|| (${s} == "string" && ${r} && ${r} == +${r})`).assign(a,(0,fe._)`+${r}`);return;case"integer":o.elseIf((0,fe._)`${s} === "boolean" || ${r} === null
|
|
1761
1761
|
|| (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(a,(0,fe._)`+${r}`);return;case"boolean":o.elseIf((0,fe._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(a,!1).elseIf((0,fe._)`${r} === "true" || ${r} === 1`).assign(a,!0);return;case"null":o.elseIf((0,fe._)`${r} === "" || ${r} === 0 || ${r} === false`),o.assign(a,null);return;case"array":o.elseIf((0,fe._)`${s} === "string" || ${s} === "number"
|
|
1762
|
-
|| ${s} === "boolean" || ${r} === null`).assign(a,(0,fe._)`[${r}]`)}}}function r$({gen:e,parentData:t,parentDataProperty:n},o){e.if((0,fe._)`${t} !== undefined`,()=>e.assign((0,fe._)`${t}[${n}]`,o))}function Ed(e,t,n,o=Er.Correct){const r=o===Er.Correct?fe.operators.EQ:fe.operators.NEQ;let i;switch(e){case"null":return(0,fe._)`${t} ${r} null`;case"array":i=(0,fe._)`Array.isArray(${t})`;break;case"object":i=(0,fe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,fe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,fe._)`typeof ${t} ${r} ${e}`}return o===Er.Correct?i:(0,fe.not)(i);function s(a=fe.nil){return(0,fe.and)((0,fe._)`typeof ${t} == "number"`,a,n?(0,fe._)`isFinite(${t})`:fe.nil)}}Ze.checkDataType=Ed;function Ku(e,t,n,o){if(e.length===1)return Ed(e[0],t,n,o);let r;const i=(0,Ov.toHash)(e);if(i.array&&i.object){const s=(0,fe._)`typeof ${t} != "object"`;r=i.null?s:(0,fe._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else r=fe.nil;i.number&&delete i.integer;for(const s in i)r=(0,fe.and)(r,Ed(s,t,n,o));return r}Ze.checkDataTypes=Ku;const i$={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,fe._)`{type: ${e}}`:(0,fe._)`{type: ${t}}`};function Gu(e){const t=s$(e);(0,ZS.reportError)(t,i$)}Ze.reportTypeError=Gu;function s$(e){const{gen:t,data:n,schema:o}=e,r=(0,Ov.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:n,schema:o.type,schemaCode:r,schemaValue:r,parentSchema:o,params:{},it:e}}var _l={};Object.defineProperty(_l,"__esModule",{value:!0});_l.assignDefaults=void 0;const rr=ue,a$=J;function l$(e,t){const{properties:n,items:o}=e.schema;if(t==="object"&&n)for(const r in n)Pm(e,r,n[r].default);else t==="array"&&Array.isArray(o)&&o.forEach((r,i)=>Pm(e,i,r.default))}_l.assignDefaults=l$;function Pm(e,t,n){const{gen:o,compositeRule:r,data:i,opts:s}=e;if(n===void 0)return;const a=(0,rr._)`${i}${(0,rr.getProperty)(t)}`;if(r){(0,a$.checkStrictMode)(e,`default is ignored for: ${a}`);return}let l=(0,rr._)`${a} === undefined`;s.useDefaults==="empty"&&(l=(0,rr._)`${l} || ${a} === null || ${a} === ""`),o.if(l,(0,rr._)`${a} = ${(0,rr.stringify)(n)}`)}var vn={},ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;const Ae=ue,Ju=J,Wn=Lt,c$=J;function d$(e,t){const{gen:n,data:o,it:r}=e;n.if(Yu(n,o,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ae._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=d$;function u$({gen:e,data:t,it:{opts:n}},o,r){return(0,Ae.or)(...o.map(i=>(0,Ae.and)(Yu(e,t,i,n.ownProperties),(0,Ae._)`${r} = ${i}`)))}ye.checkMissingProp=u$;function p$(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=p$;function Mv(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ae._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=Mv;function Qu(e,t,n){return(0,Ae._)`${Mv(e)}.call(${t}, ${n})`}ye.isOwnProperty=Qu;function f$(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} !== undefined`;return o?(0,Ae._)`${r} && ${Qu(e,t,n)}`:r}ye.propertyInData=f$;function Yu(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} === undefined`;return o?(0,Ae.or)(r,(0,Ae.not)(Qu(e,t,n))):r}ye.noPropertyInData=Yu;function qv(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=qv;function m$(e,t){return qv(t).filter(n=>!(0,Ju.alwaysValidSchema)(e,t[n]))}ye.schemaProperties=m$;function h$({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:r,errorPath:i},it:s},a,l,c){const f=c?(0,Ae._)`${e}, ${t}, ${o}${r}`:t,m=[[Wn.default.instancePath,(0,Ae.strConcat)(Wn.default.instancePath,i)],[Wn.default.parentData,s.parentData],[Wn.default.parentDataProperty,s.parentDataProperty],[Wn.default.rootData,Wn.default.rootData]];s.opts.dynamicRef&&m.push([Wn.default.dynamicAnchors,Wn.default.dynamicAnchors]);const h=(0,Ae._)`${f}, ${n.object(...m)}`;return l!==Ae.nil?(0,Ae._)`${a}.call(${l}, ${h})`:(0,Ae._)`${a}(${h})`}ye.callValidateCode=h$;const y$=(0,Ae._)`new RegExp`;function g$({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"",{regExp:r}=t.code,i=r(n,o);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Ae._)`${r.code==="new RegExp"?y$:(0,c$.useFunc)(e,r)}(${n}, ${o})`})}ye.usePattern=g$;function v$(e){const{gen:t,data:n,keyword:o,it:r}=e,i=t.name("valid");if(r.allErrors){const a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){const l=t.const("len",(0,Ae._)`${n}.length`);t.forRange("i",0,l,c=>{e.subschema({keyword:o,dataProp:c,dataPropType:Ju.Type.Num},i),t.if((0,Ae.not)(i),a)})}}ye.validateArray=v$;function b$(e){const{gen:t,schema:n,keyword:o,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,Ju.alwaysValidSchema)(r,l))&&!r.opts.unevaluated)return;const s=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,c)=>{const f=e.subschema({keyword:o,schemaProp:c,compositeRule:!0},a);t.assign(s,(0,Ae._)`${s} || ${a}`),e.mergeValidEvaluated(f,a)||t.if((0,Ae.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ye.validateUnion=b$;Object.defineProperty(vn,"__esModule",{value:!0});vn.validateKeywordUsage=vn.validSchemaType=vn.funcKeywordCode=vn.macroKeywordCode=void 0;const vt=ue,Eo=Lt,x$=ye,w$=_s;function S$(e,t){const{gen:n,keyword:o,schema:r,parentSchema:i,it:s}=e,a=t.macro.call(s.self,r,i,s),l=Uv(n,o,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const c=n.name("valid");e.subschema({schema:a,schemaPath:vt.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:l,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}vn.macroKeywordCode=S$;function $$(e,t){var n;const{gen:o,keyword:r,schema:i,parentSchema:s,$data:a,it:l}=e;T$(l,t);const c=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,f=Uv(o,r,c),m=o.let("valid");e.block$data(m,h),e.ok((n=t.valid)!==null&&n!==void 0?n:m);function h(){if(t.errors===!1)b(),t.modifying&&Im(e),v(()=>e.error());else{const p=t.async?y():g();t.modifying&&Im(e),v(()=>k$(e,p))}}function y(){const p=o.let("ruleErrs",null);return o.try(()=>b((0,vt._)`await `),u=>o.assign(m,!1).if((0,vt._)`${u} instanceof ${l.ValidationError}`,()=>o.assign(p,(0,vt._)`${u}.errors`),()=>o.throw(u))),p}function g(){const p=(0,vt._)`${f}.errors`;return o.assign(p,null),b(vt.nil),p}function b(p=t.async?(0,vt._)`await `:vt.nil){const u=l.opts.passContext?Eo.default.this:Eo.default.self,x=!("compile"in t&&!a||t.schema===!1);o.assign(m,(0,vt._)`${p}${(0,x$.callValidateCode)(e,f,u,x)}`,t.modifying)}function v(p){var u;o.if((0,vt.not)((u=t.valid)!==null&&u!==void 0?u:m),p)}}vn.funcKeywordCode=$$;function Im(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,()=>t.assign(n,(0,vt._)`${o.parentData}[${o.parentDataProperty}]`))}function k$(e,t){const{gen:n}=e;n.if((0,vt._)`Array.isArray(${t})`,()=>{n.assign(Eo.default.vErrors,(0,vt._)`${Eo.default.vErrors} === null ? ${t} : ${Eo.default.vErrors}.concat(${t})`).assign(Eo.default.errors,(0,vt._)`${Eo.default.vErrors}.length`),(0,w$.extendErrors)(e)},()=>e.error())}function T$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Uv(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,vt.stringify)(n)})}function _$(e,t,n=!1){return!t.length||t.some(o=>o==="array"?Array.isArray(e):o==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==o||n&&typeof e>"u")}vn.validSchemaType=_$;function j$({schema:e,opts:t,self:n,errSchemaPath:o},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");const s=r.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[i])){const l=`keyword "${i}" value is invalid at path "${o}": `+n.errorsText(r.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(l);else throw new Error(l)}}vn.validateKeywordUsage=j$;var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.extendSubschemaMode=ho.extendSubschemaData=ho.getSubschema=void 0;const gn=ue,Lv=J;function C$(e,{keyword:t,schemaProp:n,schema:o,schemaPath:r,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return n===void 0?{schema:a,schemaPath:(0,gn._)`${e.schemaPath}${(0,gn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:(0,gn._)`${e.schemaPath}${(0,gn.getProperty)(t)}${(0,gn.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Lv.escapeFragment)(n)}`}}if(o!==void 0){if(r===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:r,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}ho.getSubschema=C$;function N$(e,t,{dataProp:n,dataPropType:o,data:r,dataTypes:i,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(n!==void 0){const{errorPath:c,dataPathArr:f,opts:m}=t,h=a.let("data",(0,gn._)`${t.data}${(0,gn.getProperty)(n)}`,!0);l(h),e.errorPath=(0,gn.str)`${c}${(0,Lv.getErrorPath)(n,o,m.jsPropertySyntax)}`,e.parentDataProperty=(0,gn._)`${n}`,e.dataPathArr=[...f,e.parentDataProperty]}if(r!==void 0){const c=r instanceof gn.Name?r:a.let("data",r,!0);l(c),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}ho.extendSubschemaData=N$;function E$(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:o,createErrors:r,allErrors:i}){o!==void 0&&(e.compositeRule=o),r!==void 0&&(e.createErrors=r),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}ho.extendSubschemaMode=E$;var st={},Dv=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},zv={exports:{}},io=zv.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var o=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};ya(t,o,r,e,"",e)};io.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};io.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};io.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};io.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ya(e,t,n,o,r,i,s,a,l,c){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,r,i,s,a,l,c);for(var f in o){var m=o[f];if(Array.isArray(m)){if(f in io.arrayKeywords)for(var h=0;h<m.length;h++)ya(e,t,n,m[h],r+"/"+f+"/"+h,i,r,f,o,h)}else if(f in io.propsKeywords){if(m&&typeof m=="object")for(var y in m)ya(e,t,n,m[y],r+"/"+f+"/"+P$(y),i,r,f,o,y)}else(f in io.keywords||e.allKeys&&!(f in io.skipKeywords))&&ya(e,t,n,m,r+"/"+f,i,r,f,o)}n(o,r,i,s,a,l,c)}}function P$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var I$=zv.exports;Object.defineProperty(st,"__esModule",{value:!0});st.getSchemaRefs=st.resolveUrl=st.normalizeId=st._getFullPath=st.getFullPath=st.inlineRef=void 0;const O$=J,R$=Dv,A$=I$,M$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function q$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Pd(e):t?Fv(e)<=t:!1}st.inlineRef=q$;const U$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Pd(e){for(const t in e){if(U$.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(Pd)||typeof n=="object"&&Pd(n))return!0}return!1}function Fv(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!M$.has(n)&&(typeof e[n]=="object"&&(0,O$.eachItem)(e[n],o=>t+=Fv(o)),t===1/0))return 1/0}return t}function Bv(e,t="",n){n!==!1&&(t=Pr(t));const o=e.parse(t);return Hv(e,o)}st.getFullPath=Bv;function Hv(e,t){return e.serialize(t).split("#")[0]+"#"}st._getFullPath=Hv;const L$=/#\/?$/;function Pr(e){return e?e.replace(L$,""):""}st.normalizeId=Pr;function D$(e,t,n){return n=Pr(n),e.resolve(t,n)}st.resolveUrl=D$;const z$=/^[a-z_][-a-z0-9._]*$/i;function F$(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:o}=this.opts,r=Pr(e[n]||t),i={"":r},s=Bv(o,r,!1),a={},l=new Set;return A$(e,{allKeys:!0},(m,h,y,g)=>{if(g===void 0)return;const b=s+h;let v=i[g];typeof m[n]=="string"&&(v=p.call(this,m[n])),u.call(this,m.$anchor),u.call(this,m.$dynamicAnchor),i[h]=v;function p(x){const S=this.opts.uriResolver.resolve;if(x=Pr(v?S(v,x):x),l.has(x))throw f(x);l.add(x);let T=this.refs[x];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?c(m,T.schema,x):x!==Pr(b)&&(x[0]==="#"?(c(m,a[x],x),a[x]=m):this.refs[x]=b),x}function u(x){if(typeof x=="string"){if(!z$.test(x))throw new Error(`invalid anchor "${x}"`);p.call(this,`#${x}`)}}}),a;function c(m,h,y){if(h!==void 0&&!R$(m,h))throw f(y)}function f(m){return new Error(`reference "${m}" resolves to more than one schema`)}}st.getSchemaRefs=F$;Object.defineProperty(an,"__esModule",{value:!0});an.getData=an.KeywordCxt=an.validateFunctionCode=void 0;const Vv=Br,Om=Ze,Xu=Rn,Xa=Ze,B$=_l,Mi=vn,fc=ho,re=ue,le=Lt,H$=st,An=J,fi=_s;function V$(e){if(Gv(e)&&(Jv(e),Kv(e))){G$(e);return}Wv(e,()=>(0,Vv.topBoolOrEmptySchema)(e))}an.validateFunctionCode=V$;function Wv({gen:e,validateName:t,schema:n,schemaEnv:o,opts:r},i){r.code.es5?e.func(t,(0,re._)`${le.default.data}, ${le.default.valCxt}`,o.$async,()=>{e.code((0,re._)`"use strict"; ${Rm(n,r)}`),K$(e,r),e.code(i)}):e.func(t,(0,re._)`${le.default.data}, ${W$(r)}`,o.$async,()=>e.code(Rm(n,r)).code(i))}function W$(e){return(0,re._)`{${le.default.instancePath}="", ${le.default.parentData}, ${le.default.parentDataProperty}, ${le.default.rootData}=${le.default.data}${e.dynamicRef?(0,re._)`, ${le.default.dynamicAnchors}={}`:re.nil}}={}`}function K$(e,t){e.if(le.default.valCxt,()=>{e.var(le.default.instancePath,(0,re._)`${le.default.valCxt}.${le.default.instancePath}`),e.var(le.default.parentData,(0,re._)`${le.default.valCxt}.${le.default.parentData}`),e.var(le.default.parentDataProperty,(0,re._)`${le.default.valCxt}.${le.default.parentDataProperty}`),e.var(le.default.rootData,(0,re._)`${le.default.valCxt}.${le.default.rootData}`),t.dynamicRef&&e.var(le.default.dynamicAnchors,(0,re._)`${le.default.valCxt}.${le.default.dynamicAnchors}`)},()=>{e.var(le.default.instancePath,(0,re._)`""`),e.var(le.default.parentData,(0,re._)`undefined`),e.var(le.default.parentDataProperty,(0,re._)`undefined`),e.var(le.default.rootData,le.default.data),t.dynamicRef&&e.var(le.default.dynamicAnchors,(0,re._)`{}`)})}function G$(e){const{schema:t,opts:n,gen:o}=e;Wv(e,()=>{n.$comment&&t.$comment&&Yv(e),Z$(e),o.let(le.default.vErrors,null),o.let(le.default.errors,0),n.unevaluated&&J$(e),Qv(e),nk(e)})}function J$(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,re._)`${n}.evaluated`),t.if((0,re._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,re._)`${e.evaluated}.props`,(0,re._)`undefined`)),t.if((0,re._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,re._)`${e.evaluated}.items`,(0,re._)`undefined`))}function Rm(e,t){const n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,re._)`/*# sourceURL=${n} */`:re.nil}function Q$(e,t){if(Gv(e)&&(Jv(e),Kv(e))){Y$(e,t);return}(0,Vv.boolOrEmptySchema)(e,t)}function Kv({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function Gv(e){return typeof e.schema!="boolean"}function Y$(e,t){const{schema:n,gen:o,opts:r}=e;r.$comment&&n.$comment&&Yv(e),ek(e),tk(e);const i=o.const("_errs",le.default.errors);Qv(e,i),o.var(t,(0,re._)`${i} === ${le.default.errors}`)}function Jv(e){(0,An.checkUnknownRules)(e),X$(e)}function Qv(e,t){if(e.opts.jtd)return Am(e,[],!1,t);const n=(0,Om.getSchemaTypes)(e.schema),o=(0,Om.coerceAndCheckDataType)(e,n);Am(e,n,!o,t)}function X$(e){const{schema:t,errSchemaPath:n,opts:o,self:r}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,An.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function Z$(e){const{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,An.checkStrictMode)(e,"default is ignored in the schema root")}function ek(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,H$.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function tk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Yv({gen:e,schemaEnv:t,schema:n,errSchemaPath:o,opts:r}){const i=n.$comment;if(r.$comment===!0)e.code((0,re._)`${le.default.self}.logger.log(${i})`);else if(typeof r.$comment=="function"){const s=(0,re.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,re._)`${le.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function nk(e){const{gen:t,schemaEnv:n,validateName:o,ValidationError:r,opts:i}=e;n.$async?t.if((0,re._)`${le.default.errors} === 0`,()=>t.return(le.default.data),()=>t.throw((0,re._)`new ${r}(${le.default.vErrors})`)):(t.assign((0,re._)`${o}.errors`,le.default.vErrors),i.unevaluated&&ok(e),t.return((0,re._)`${le.default.errors} === 0`))}function ok({gen:e,evaluated:t,props:n,items:o}){n instanceof re.Name&&e.assign((0,re._)`${t}.props`,n),o instanceof re.Name&&e.assign((0,re._)`${t}.items`,o)}function Am(e,t,n,o){const{gen:r,schema:i,data:s,allErrors:a,opts:l,self:c}=e,{RULES:f}=c;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,An.schemaHasRulesButRef)(i,f))){r.block(()=>eb(e,"$ref",f.all.$ref.definition));return}l.jtd||rk(e,t),r.block(()=>{for(const h of f.rules)m(h);m(f.post)});function m(h){(0,Xu.shouldUseGroup)(i,h)&&(h.type?(r.if((0,Xa.checkDataType)(h.type,s,l.strictNumbers)),Mm(e,h),t.length===1&&t[0]===h.type&&n&&(r.else(),(0,Xa.reportTypeError)(e)),r.endIf()):Mm(e,h),a||r.if((0,re._)`${le.default.errors} === ${o||0}`))}}function Mm(e,t){const{gen:n,schema:o,opts:{useDefaults:r}}=e;r&&(0,B$.assignDefaults)(e,t.type),n.block(()=>{for(const i of t.rules)(0,Xu.shouldUseRule)(o,i)&&eb(e,i.keyword,i.definition,t.type)})}function rk(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ik(e,t),e.opts.allowUnionTypes||sk(e,t),ak(e,e.dataTypes))}function ik(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{Xv(e.dataTypes,n)||Zu(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),ck(e,t)}}function sk(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Zu(e,"use allowUnionTypes to allow union type keyword")}function ak(e,t){const n=e.self.RULES.all;for(const o in n){const r=n[o];if(typeof r=="object"&&(0,Xu.shouldUseRule)(e.schema,r)){const{type:i}=r.definition;i.length&&!i.some(s=>lk(t,s))&&Zu(e,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function lk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Xv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function ck(e,t){const n=[];for(const o of e.dataTypes)Xv(t,o)?n.push(o):t.includes("integer")&&o==="number"&&n.push("integer");e.dataTypes=n}function Zu(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,An.checkStrictMode)(e,t,e.opts.strictTypes)}class Zv{constructor(t,n,o){if((0,Mi.validateKeywordUsage)(t,n,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,An.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",tb(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Mi.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",le.default.errors))}result(t,n,o){this.failResult((0,re.not)(t),n,o)}failResult(t,n,o){this.gen.if(t),o?o():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,re.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:n}=this;this.fail((0,re._)`${n} !== undefined && (${(0,re.or)(this.invalid$data(),t)})`)}error(t,n,o){if(n){this.setParams(n),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,n){(t?fi.reportExtraError:fi.reportError)(this,this.def.error,n)}$dataError(){(0,fi.reportError)(this,this.def.$dataError||fi.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,fi.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,o=re.nil){this.gen.block(()=>{this.check$data(t,o),n()})}check$data(t=re.nil,n=re.nil){if(!this.$data)return;const{gen:o,schemaCode:r,schemaType:i,def:s}=this;o.if((0,re.or)((0,re._)`${r} === undefined`,n)),t!==re.nil&&o.assign(t,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),t!==re.nil&&o.assign(t,!1)),o.else()}invalid$data(){const{gen:t,schemaCode:n,schemaType:o,def:r,it:i}=this;return(0,re.or)(s(),a());function s(){if(o.length){if(!(n instanceof re.Name))throw new Error("ajv implementation error");const l=Array.isArray(o)?o:[o];return(0,re._)`${(0,Xa.checkDataTypes)(l,n,i.opts.strictNumbers,Xa.DataType.Wrong)}`}return re.nil}function a(){if(r.validateSchema){const l=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,re._)`!${l}(${n})`}return re.nil}}subschema(t,n){const o=(0,fc.getSubschema)(this.it,t);(0,fc.extendSubschemaData)(o,this.it,t),(0,fc.extendSubschemaMode)(o,t);const r={...this.it,...o,items:void 0,props:void 0};return Q$(r,n),r}mergeEvaluated(t,n){const{it:o,gen:r}=this;o.opts.unevaluated&&(o.props!==!0&&t.props!==void 0&&(o.props=An.mergeEvaluated.props(r,t.props,o.props,n)),o.items!==!0&&t.items!==void 0&&(o.items=An.mergeEvaluated.items(r,t.items,o.items,n)))}mergeValidEvaluated(t,n){const{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(n,()=>this.mergeEvaluated(t,re.Name)),!0}}an.KeywordCxt=Zv;function eb(e,t,n,o){const r=new Zv(e,n,t);"code"in n?n.code(r,o):r.$data&&n.validate?(0,Mi.funcKeywordCode)(r,n):"macro"in n?(0,Mi.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Mi.funcKeywordCode)(r,n)}const dk=/^\/(?:[^~]|~0|~1)*$/,uk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function tb(e,{dataLevel:t,dataNames:n,dataPathArr:o}){let r,i;if(e==="")return le.default.rootData;if(e[0]==="/"){if(!dk.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,i=le.default.rootData}else{const c=uk.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);const f=+c[1];if(r=c[2],r==="#"){if(f>=t)throw new Error(l("property/index",f));return o[t-f]}if(f>t)throw new Error(l("data",f));if(i=n[t-f],!r)return i}let s=i;const a=r.split("/");for(const c of a)c&&(i=(0,re._)`${i}${(0,re.getProperty)((0,An.unescapeJsonPointer)(c))}`,s=(0,re._)`${s} && ${i}`);return s;function l(c,f){return`Cannot access ${c} ${f} levels up, current level is ${t}`}}an.getData=tb;var js={};Object.defineProperty(js,"__esModule",{value:!0});class pk extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}js.default=pk;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});const mc=st;class fk extends Error{constructor(t,n,o,r){super(r||`can't resolve reference ${o} from id ${n}`),this.missingRef=(0,mc.resolveUrl)(t,n,o),this.missingSchema=(0,mc.normalizeId)((0,mc.getFullPath)(t,this.missingRef))}}Jr.default=fk;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.resolveSchema=bt.getCompilingSchema=bt.resolveRef=bt.compileSchema=bt.SchemaEnv=void 0;const Xt=ue,mk=js,_o=Lt,on=st,qm=J,hk=an;class jl{constructor(t){var n;this.refs={},this.dynamicAnchors={};let o;typeof t.schema=="object"&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,on.normalizeId)(o==null?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o==null?void 0:o.$async,this.refs={}}}bt.SchemaEnv=jl;function ep(e){const t=nb.call(this,e);if(t)return t;const n=(0,on.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:o,lines:r}=this.opts.code,{ownProperties:i}=this.opts,s=new Xt.CodeGen(this.scope,{es5:o,lines:r,ownProperties:i});let a;e.$async&&(a=s.scopeValue("Error",{ref:mk.default,code:(0,Xt._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const c={gen:s,allErrors:this.opts.allErrors,data:_o.default.data,parentData:_o.default.parentData,parentDataProperty:_o.default.parentDataProperty,dataNames:[_o.default.data],dataPathArr:[Xt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Xt.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Xt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xt._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,hk.validateFunctionCode)(c),s.optimize(this.opts.code.optimize);const m=s.toString();f=`${s.scopeRefs(_o.default.scope)}return ${m}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const y=new Function(`${_o.default.self}`,`${_o.default.scope}`,f)(this,this.scope.get());if(this.scope.value(l,{ref:y}),y.errors=null,y.schema=e.schema,y.schemaEnv=e,e.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:l,validateCode:m,scopeValues:s._values}),this.opts.unevaluated){const{props:g,items:b}=c;y.evaluated={props:g instanceof Xt.Name?void 0:g,items:b instanceof Xt.Name?void 0:b,dynamicProps:g instanceof Xt.Name,dynamicItems:b instanceof Xt.Name},y.source&&(y.source.evaluated=(0,Xt.stringify)(y.evaluated))}return e.validate=y,e}catch(m){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),m}finally{this._compilations.delete(e)}}bt.compileSchema=ep;function yk(e,t,n){var o;n=(0,on.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let i=bk.call(this,e,n);if(i===void 0){const s=(o=e.localRefs)===null||o===void 0?void 0:o[n],{schemaId:a}=this.opts;s&&(i=new jl({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=gk.call(this,i)}bt.resolveRef=yk;function gk(e){return(0,on.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:ep.call(this,e)}function nb(e){for(const t of this._compilations)if(vk(t,e))return t}bt.getCompilingSchema=nb;function vk(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function bk(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Cl.call(this,e,t)}function Cl(e,t){const n=this.opts.uriResolver.parse(t),o=(0,on._getFullPath)(this.opts.uriResolver,n);let r=(0,on.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===r)return hc.call(this,n,e);const i=(0,on.normalizeId)(o),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=Cl.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:hc.call(this,n,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||ep.call(this,s),i===(0,on.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,c=a[l];return c&&(r=(0,on.resolveUrl)(this.opts.uriResolver,r,c)),new jl({schema:a,schemaId:l,root:e,baseId:r})}return hc.call(this,n,s)}}bt.resolveSchema=Cl;const xk=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function hc(e,{baseId:t,schema:n,root:o}){var r;if(((r=e.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,qm.unescapeFragment)(a)];if(l===void 0)return;n=l;const c=typeof n=="object"&&n[this.opts.schemaId];!xk.has(a)&&c&&(t=(0,on.resolveUrl)(this.opts.uriResolver,t,c))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,qm.schemaHasRulesButRef)(n,this.RULES)){const a=(0,on.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Cl.call(this,o,a)}const{schemaId:s}=this.opts;if(i=i||new jl({schema:n,schemaId:s,root:o,baseId:t}),i.schema!==i.root.schema)return i}const wk="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Sk="Meta-schema for $data reference (JSON AnySchema extension proposal)",$k="object",kk=["$data"],Tk={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},_k=!1,jk={$id:wk,description:Sk,type:$k,required:kk,properties:Tk,additionalProperties:_k};var tp={},Nl={exports:{}};const Ck=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ob=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),np=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),rb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Nk=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ib(e){let t="",n=0,o=0;for(o=0;o<e.length;o++)if(n=e[o].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(n=e[o].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[o]}return t}const Ek=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Um(e){return e.length=0,!0}function Pk(e,t,n){if(e.length){const o=ib(e);if(o!=="")t.push(o);else return n.error=!0,!1;e.length=0}return!0}function Ik(e){let t=0;const n={error:!1,address:"",zone:""},o=[],r=[];let i=!1,s=!1,a=Pk;for(let l=0;l<e.length;l++){const c=e[l];if(!(c==="["||c==="]"))if(c===":"){if(i===!0&&(s=!0),!a(r,o,n))break;if(++t>7){n.error=!0;break}l>0&&e[l-1]===":"&&(i=!0),o.push(":");continue}else if(c==="%"){if(!a(r,o,n))break;a=Um}else{r.push(c);continue}}return r.length&&(a===Um?n.zone=r.join(""):s?o.push(r.join("")):o.push(ib(r))),n.address=o.join(""),n}function sb(e){if(Ok(e,":")<2)return{host:e,isIPV6:!1};const t=Ik(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,o=t.address;return t.zone&&(n+="%"+t.zone,o+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:o}}}function Ok(e,t){let n=0;for(let o=0;o<e.length;o++)e[o]===t&&n++;return n}function Rk(e){let t=e;const n=[];let o=-1,r=0;for(;r=t.length;){if(r===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(r===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(r===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((o=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,o)),t=t.slice(o)}return n.join("")}const Ak={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Mk=/[@/?#:]/g,qk=/[@/?#]/g;function ab(e,t){const n=t?qk:Mk;return n.lastIndex=0,e.replace(n,o=>Ak[o])}function Uk(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let o=0;o<e.length;o++){if(e[o]==="%"&&o+2<e.length){const r=e.slice(o+1,o+3);if(np(r)){const i=r.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&rb(s)?n+=s:n+="%"+i,o+=2;continue}}n+=e[o]}return n}function Lk(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(np(o)){const r=o.toUpperCase(),i=String.fromCharCode(parseInt(r,16));i!=="."&&rb(i)?t+=i:t+="%"+r,n+=2;continue}}Nk(e[n])?t+=e[n]:t+=escape(e[n])}return t}function Dk(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(np(o)){t+="%"+o.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function zk(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!ob(n)){const o=sb(n);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=ab(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var lb={nonSimpleDomain:Ek,recomposeAuthority:zk,reescapeHostDelimiters:ab,normalizePercentEncoding:Uk,normalizePathEncoding:Lk,escapePreservingEscapes:Dk,removeDotSegments:Rk,isIPv4:ob,isUUID:Ck,normalizeIPv6:sb};const{isUUID:Fk}=lb,Bk=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function cb(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function db(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function ub(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Hk(e){return e.secure=cb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Vk(e){if((e.port===(cb(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function Wk(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(Bk);if(n){const o=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const r=`${o}:${t.nid||e.nid}`,i=op(r);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Kk(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),r=`${n}:${t.nid||o}`,i=op(r);i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${o||t.nid}:${a}`,t.skipEscape=!0,s}function Gk(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Fk(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function Jk(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const pb={scheme:"http",domainHost:!0,parse:db,serialize:ub},Qk={scheme:"https",domainHost:pb.domainHost,parse:db,serialize:ub},ga={scheme:"ws",domainHost:!0,parse:Hk,serialize:Vk},Yk={scheme:"wss",domainHost:ga.domainHost,parse:ga.parse,serialize:ga.serialize},Xk={scheme:"urn",parse:Wk,serialize:Kk,skipNormalize:!0},Zk={scheme:"urn:uuid",parse:Gk,serialize:Jk,skipNormalize:!0},Za={http:pb,https:Qk,ws:ga,wss:Yk,urn:Xk,"urn:uuid":Zk};Object.setPrototypeOf(Za,null);function op(e){return e&&(Za[e]||Za[e.toLowerCase()])||void 0}var eT={SCHEMES:Za,getSchemeHandler:op};const{normalizeIPv6:tT,removeDotSegments:ki,recomposeAuthority:nT,normalizePercentEncoding:oT,normalizePathEncoding:rT,escapePreservingEscapes:iT,reescapeHostDelimiters:sT,isIPv4:aT,nonSimpleDomain:lT}=lb,{SCHEMES:cT,getSchemeHandler:fb}=eT;function dT(e,t){return typeof e=="string"?e=hT(e,t):typeof e=="object"&&(e=Hr(Go(e,t),t)),e}function uT(e,t,n){const o=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=mb(Hr(e,o),Hr(t,o),o,!0);return o.skipEscape=!0,Go(r,o)}function mb(e,t,n,o){const r={};return o||(e=Hr(Go(e,n),n),t=Hr(Go(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=ki(t.path||""),r.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=ki(t.path||""),r.query=t.query):(t.path?(t.path[0]==="/"?r.path=ki(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?r.path="/"+t.path:e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path,r.path=ki(r.path)),r.query=t.query):(r.path=e.path,t.query!==void 0?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function pT(e,t,n){const o=Lm(e,n),r=Lm(t,n);return o!==void 0&&r!==void 0&&o.toLowerCase()===r.toLowerCase()}function Go(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},o=Object.assign({},t),r=[],i=fb(o.scheme||n.scheme);i&&i.serialize&&i.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=oT(n.path):(n.path=iT(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),o.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");const s=nT(n);if(s!==void 0&&(o.reference!=="suffix"&&r.push("//"),r.push(s),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let a=n.path;!o.absolutePath&&(!i||!i.absolutePath)&&(a=ki(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),r.push(a)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}const fT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function mT(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function hb(e,t){const n=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let r=!1,i=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const s=e.match(fT);if(s){o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]);const a=mT(o,s);if(a!==void 0&&(o.error=o.error||a,r=!0),o.host)if(aT(o.host)===!1){const f=tT(o.host);o.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==o.reference&&(o.error=o.error||"URI is not a "+n.reference+" reference.");const l=fb(n.scheme||o.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&o.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&lT(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(c){o.error=o.error||"Host's domain name can not be converted to ASCII: "+c}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=sT(unescape(o.host),i))),o.path&&(o.path=rT(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}l&&l.parse&&l.parse(o,n)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:r}}function Hr(e,t){return hb(e,t).parsed}function hT(e,t){return yb(e,t).normalized}function yb(e,t){const{parsed:n,malformedAuthorityOrPort:o}=hb(e,t);return{normalized:o?e:Go(n,t),malformedAuthorityOrPort:o}}function Lm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:o}=yb(e,t);return o?void 0:n}if(typeof e=="object")return Go(e,t)}const rp={SCHEMES:cT,normalize:dT,resolve:uT,resolveComponent:mb,equal:pT,serialize:Go,parse:Hr};Nl.exports=rp;Nl.exports.default=rp;Nl.exports.fastUri=rp;var yT=Nl.exports;Object.defineProperty(tp,"__esModule",{value:!0});const gb=yT;gb.code='require("ajv/dist/runtime/uri").default';tp.default=gb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=an;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=ue;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const o=js,r=Jr,i=Ko,s=bt,a=ue,l=st,c=Ze,f=J,m=jk,h=tp,y=(P,j)=>new RegExp(P,j);y.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},u=200;function x(P){var j,A,_,w,k,E,K,O,X,ie,de,we,ze,Ee,Se,_e,Qe,Pe,Tn,Fn,To,er,Bn,un,Qt;const Hn=P.strict,tr=(j=P.code)===null||j===void 0?void 0:j.optimize,oi=tr===!0||tr===void 0?1:tr||0,ri=(_=(A=P.code)===null||A===void 0?void 0:A.regExp)!==null&&_!==void 0?_:y,Dl=(w=P.uriResolver)!==null&&w!==void 0?w:h.default;return{strictSchema:(E=(k=P.strictSchema)!==null&&k!==void 0?k:Hn)!==null&&E!==void 0?E:!0,strictNumbers:(O=(K=P.strictNumbers)!==null&&K!==void 0?K:Hn)!==null&&O!==void 0?O:!0,strictTypes:(ie=(X=P.strictTypes)!==null&&X!==void 0?X:Hn)!==null&&ie!==void 0?ie:"log",strictTuples:(we=(de=P.strictTuples)!==null&&de!==void 0?de:Hn)!==null&&we!==void 0?we:"log",strictRequired:(Ee=(ze=P.strictRequired)!==null&&ze!==void 0?ze:Hn)!==null&&Ee!==void 0?Ee:!1,code:P.code?{...P.code,optimize:oi,regExp:ri}:{optimize:oi,regExp:ri},loopRequired:(Se=P.loopRequired)!==null&&Se!==void 0?Se:u,loopEnum:(_e=P.loopEnum)!==null&&_e!==void 0?_e:u,meta:(Qe=P.meta)!==null&&Qe!==void 0?Qe:!0,messages:(Pe=P.messages)!==null&&Pe!==void 0?Pe:!0,inlineRefs:(Tn=P.inlineRefs)!==null&&Tn!==void 0?Tn:!0,schemaId:(Fn=P.schemaId)!==null&&Fn!==void 0?Fn:"$id",addUsedSchema:(To=P.addUsedSchema)!==null&&To!==void 0?To:!0,validateSchema:(er=P.validateSchema)!==null&&er!==void 0?er:!0,validateFormats:(Bn=P.validateFormats)!==null&&Bn!==void 0?Bn:!0,unicodeRegExp:(un=P.unicodeRegExp)!==null&&un!==void 0?un:!0,int32range:(Qt=P.int32range)!==null&&Qt!==void 0?Qt:!0,uriResolver:Dl}}class S{constructor(j={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...x(j)};const{es5:A,lines:_}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:b,es5:A,lines:_}),this.logger=H(j.logger);const w=j.validateFormats;j.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,v,j,"NOT SUPPORTED"),T.call(this,p,j,"DEPRECATED","warn"),this._metaOpts=M.call(this),j.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&R.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),$.call(this),j.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:A,schemaId:_}=this.opts;let w=m;_==="id"&&(w={...m},w.id=w.$id,delete w.$id),A&&j&&this.addMetaSchema(w,w[_],!1)}defaultMeta(){const{meta:j,schemaId:A}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[A]||j:void 0}validate(j,A){let _;if(typeof j=="string"){if(_=this.getSchema(j),!_)throw new Error(`no schema with key or ref "${j}"`)}else _=this.compile(j);const w=_(A);return"$async"in _||(this.errors=_.errors),w}compile(j,A){const _=this._addSchema(j,A);return _.validate||this._compileSchemaEnv(_)}compileAsync(j,A){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:_}=this.opts;return w.call(this,j,A);async function w(ie,de){await k.call(this,ie.$schema);const we=this._addSchema(ie,de);return we.validate||E.call(this,we)}async function k(ie){ie&&!this.getSchema(ie)&&await w.call(this,{$ref:ie},!0)}async function E(ie){try{return this._compileSchemaEnv(ie)}catch(de){if(!(de instanceof r.default))throw de;return K.call(this,de),await O.call(this,de.missingSchema),E.call(this,ie)}}function K({missingSchema:ie,missingRef:de}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${de} cannot be resolved`)}async function O(ie){const de=await X.call(this,ie);this.refs[ie]||await k.call(this,de.$schema),this.refs[ie]||this.addSchema(de,ie,A)}async function X(ie){const de=this._loading[ie];if(de)return de;try{return await(this._loading[ie]=_(ie))}finally{delete this._loading[ie]}}}addSchema(j,A,_,w=this.opts.validateSchema){if(Array.isArray(j)){for(const E of j)this.addSchema(E,void 0,_,w);return this}let k;if(typeof j=="object"){const{schemaId:E}=this.opts;if(k=j[E],k!==void 0&&typeof k!="string")throw new Error(`schema ${E} must be string`)}return A=(0,l.normalizeId)(A||k),this._checkUnique(A),this.schemas[A]=this._addSchema(j,_,A,w,!0),this}addMetaSchema(j,A,_=this.opts.validateSchema){return this.addSchema(j,A,!0,_),this}validateSchema(j,A){if(typeof j=="boolean")return!0;let _;if(_=j.$schema,_!==void 0&&typeof _!="string")throw new Error("$schema must be a string");if(_=_||this.opts.defaultMeta||this.defaultMeta(),!_)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(_,j);if(!w&&A){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return w}getSchema(j){let A;for(;typeof(A=N.call(this,j))=="string";)j=A;if(A===void 0){const{schemaId:_}=this.opts,w=new s.SchemaEnv({schema:{},schemaId:_});if(A=s.resolveSchema.call(this,w,j),!A)return;this.refs[j]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const A=N.call(this,j);return typeof A=="object"&&this._cache.delete(A.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const A=j;this._cache.delete(A);let _=j[this.opts.schemaId];return _&&(_=(0,l.normalizeId)(_),delete this.schemas[_],delete this.refs[_]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const A of j)this.addKeyword(A);return this}addKeyword(j,A){let _;if(typeof j=="string")_=j,typeof A=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=_);else if(typeof j=="object"&&A===void 0){if(A=j,_=A.keyword,Array.isArray(_)&&!_.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(U.call(this,_,A),!A)return(0,f.eachItem)(_,k=>D.call(this,k)),this;ee.call(this,A);const w={...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)};return(0,f.eachItem)(_,w.type.length===0?k=>D.call(this,k,w):k=>w.type.forEach(E=>D.call(this,k,w,E))),this}getKeyword(j){const A=this.RULES.all[j];return typeof A=="object"?A.definition:!!A}removeKeyword(j){const{RULES:A}=this;delete A.keywords[j],delete A.all[j];for(const _ of A.rules){const w=_.rules.findIndex(k=>k.keyword===j);w>=0&&_.rules.splice(w,1)}return this}addFormat(j,A){return typeof A=="string"&&(A=new RegExp(A)),this.formats[j]=A,this}errorsText(j=this.errors,{separator:A=", ",dataVar:_="data"}={}){return!j||j.length===0?"No errors":j.map(w=>`${_}${w.instancePath} ${w.message}`).reduce((w,k)=>w+A+k)}$dataMetaSchema(j,A){const _=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const w of A){const k=w.split("/").slice(1);let E=j;for(const K of k)E=E[K];for(const K in _){const O=_[K];if(typeof O!="object")continue;const{$data:X}=O.definition,ie=E[K];X&&ie&&(E[K]=G(ie))}}return j}_removeAllSchemas(j,A){for(const _ in j){const w=j[_];(!A||A.test(_))&&(typeof w=="string"?delete j[_]:w&&!w.meta&&(this._cache.delete(w.schema),delete j[_]))}}_addSchema(j,A,_,w=this.opts.validateSchema,k=this.opts.addUsedSchema){let E;const{schemaId:K}=this.opts;if(typeof j=="object")E=j[K];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let O=this._cache.get(j);if(O!==void 0)return O;_=(0,l.normalizeId)(E||_);const X=l.getSchemaRefs.call(this,j,_);return O=new s.SchemaEnv({schema:j,schemaId:K,meta:A,baseId:_,localRefs:X}),this._cache.set(O.schema,O),k&&!_.startsWith("#")&&(_&&this._checkUnique(_),this.refs[_]=O),w&&this.validateSchema(j,!0),O}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):s.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const A=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,j)}finally{this.opts=A}}}S.ValidationError=o.default,S.MissingRefError=r.default,e.default=S;function T(P,j,A,_="error"){for(const w in P){const k=w;k in j&&this.logger[_](`${A}: option ${w}. ${P[k]}`)}}function N(P){return P=(0,l.normalizeId)(P),this.schemas[P]||this.refs[P]}function $(){const P=this.opts.schemas;if(P)if(Array.isArray(P))this.addSchema(P);else for(const j in P)this.addSchema(P[j],j)}function C(){for(const P in this.opts.formats){const j=this.opts.formats[P];j&&this.addFormat(P,j)}}function R(P){if(Array.isArray(P)){this.addVocabulary(P);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in P){const A=P[j];A.keyword||(A.keyword=j),this.addKeyword(A)}}function M(){const P={...this.opts};for(const j of g)delete P[j];return P}const F={log(){},warn(){},error(){}};function H(P){if(P===!1)return F;if(P===void 0)return console;if(P.log&&P.warn&&P.error)return P;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function U(P,j){const{RULES:A}=this;if((0,f.eachItem)(P,_=>{if(A.keywords[_])throw new Error(`Keyword ${_} is already defined`);if(!L.test(_))throw new Error(`Keyword ${_} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function D(P,j,A){var _;const w=j==null?void 0:j.post;if(A&&w)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let E=w?k.post:k.rules.find(({type:O})=>O===A);if(E||(E={type:A,rules:[]},k.rules.push(E)),k.keywords[P]=!0,!j)return;const K={keyword:P,definition:{...j,type:(0,c.getJSONTypes)(j.type),schemaType:(0,c.getJSONTypes)(j.schemaType)}};j.before?Q.call(this,E,K,j.before):E.rules.push(K),k.all[P]=K,(_=j.implements)===null||_===void 0||_.forEach(O=>this.addKeyword(O))}function Q(P,j,A){const _=P.rules.findIndex(w=>w.keyword===A);_>=0?P.rules.splice(_,0,j):(P.rules.push(j),this.logger.warn(`rule ${A} is not defined`))}function ee(P){let{metaSchema:j}=P;j!==void 0&&(P.$data&&this.opts.$data&&(j=G(j)),P.validateSchema=this.compile(j,!0))}const q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function G(P){return{anyOf:[P,q]}}})(kv);var ip={},sp={},ap={};Object.defineProperty(ap,"__esModule",{value:!0});const gT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ap.default=gT;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.callRef=Dn.getValidate=void 0;const vT=Jr,Dm=ye,kt=ue,ir=Lt,zm=bt,Js=J,bT={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:r,schemaEnv:i,validateName:s,opts:a,self:l}=o,{root:c}=i;if((n==="#"||n==="#/")&&r===c.baseId)return m();const f=zm.resolveRef.call(l,c,r,n);if(f===void 0)throw new vT.default(o.opts.uriResolver,r,n);if(f instanceof zm.SchemaEnv)return h(f);return y(f);function m(){if(i===c)return va(e,s,i,i.$async);const g=t.scopeValue("root",{ref:c});return va(e,(0,kt._)`${g}.validate`,c,c.$async)}function h(g){const b=vb(e,g);va(e,b,g,g.$async)}function y(g){const b=t.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,kt.stringify)(g)}:{ref:g}),v=t.name("valid"),p=e.subschema({schema:g,dataTypes:[],schemaPath:kt.nil,topSchemaRef:b,errSchemaPath:n},v);e.mergeEvaluated(p),e.ok(v)}}};function vb(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,kt._)`${n.scopeValue("wrapper",{ref:t})}.validate`}Dn.getValidate=vb;function va(e,t,n,o){const{gen:r,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,c=l.passContext?ir.default.this:kt.nil;o?f():m();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");const g=r.let("valid");r.try(()=>{r.code((0,kt._)`await ${(0,Dm.callValidateCode)(e,t,c)}`),y(t),s||r.assign(g,!0)},b=>{r.if((0,kt._)`!(${b} instanceof ${i.ValidationError})`,()=>r.throw(b)),h(b),s||r.assign(g,!1)}),e.ok(g)}function m(){e.result((0,Dm.callValidateCode)(e,t,c),()=>y(t),()=>h(t))}function h(g){const b=(0,kt._)`${g}.errors`;r.assign(ir.default.vErrors,(0,kt._)`${ir.default.vErrors} === null ? ${b} : ${ir.default.vErrors}.concat(${b})`),r.assign(ir.default.errors,(0,kt._)`${ir.default.vErrors}.length`)}function y(g){var b;if(!i.opts.unevaluated)return;const v=(b=n==null?void 0:n.validate)===null||b===void 0?void 0:b.evaluated;if(i.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(i.props=Js.mergeEvaluated.props(r,v.props,i.props));else{const p=r.var("props",(0,kt._)`${g}.evaluated.props`);i.props=Js.mergeEvaluated.props(r,p,i.props,kt.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=Js.mergeEvaluated.items(r,v.items,i.items));else{const p=r.var("items",(0,kt._)`${g}.evaluated.items`);i.items=Js.mergeEvaluated.items(r,p,i.items,kt.Name)}}}Dn.callRef=va;Dn.default=bT;Object.defineProperty(sp,"__esModule",{value:!0});const xT=ap,wT=Dn,ST=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xT.default,wT.default];sp.default=ST;var lp={},cp={};Object.defineProperty(cp,"__esModule",{value:!0});const el=ue,Kn=el.operators,tl={maximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},minimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},exclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},exclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},$T={message:({keyword:e,schemaCode:t})=>(0,el.str)`must be ${tl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,el._)`{comparison: ${tl[e].okStr}, limit: ${t}}`},kT={keyword:Object.keys(tl),type:"number",schemaType:"number",$data:!0,error:$T,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data((0,el._)`${n} ${tl[t].fail} ${o} || isNaN(${n})`)}};cp.default=kT;var dp={};Object.defineProperty(dp,"__esModule",{value:!0});const qi=ue,TT={message:({schemaCode:e})=>(0,qi.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,qi._)`{multipleOf: ${e}}`},_T={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:TT,code(e){const{gen:t,data:n,schemaCode:o,it:r}=e,i=r.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,qi._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,qi._)`${s} !== parseInt(${s})`;e.fail$data((0,qi._)`(${o} === 0 || (${s} = ${n}/${o}, ${a}))`)}};dp.default=_T;var up={},pp={};Object.defineProperty(pp,"__esModule",{value:!0});function bb(e){const t=e.length;let n=0,o=0,r;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),(r&64512)===56320&&o++);return n}pp.default=bb;bb.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(up,"__esModule",{value:!0});const Po=ue,jT=J,CT=pp,NT={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,Po.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,Po._)`{limit: ${e}}`},ET={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:NT,code(e){const{keyword:t,data:n,schemaCode:o,it:r}=e,i=t==="maxLength"?Po.operators.GT:Po.operators.LT,s=r.opts.unicode===!1?(0,Po._)`${n}.length`:(0,Po._)`${(0,jT.useFunc)(e.gen,CT.default)}(${n})`;e.fail$data((0,Po._)`${s} ${i} ${o}`)}};up.default=ET;var fp={};Object.defineProperty(fp,"__esModule",{value:!0});const PT=ye,IT=J,Sr=ue,OT={message:({schemaCode:e})=>(0,Sr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Sr._)`{pattern: ${e}}`},RT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:OT,code(e){const{gen:t,data:n,$data:o,schema:r,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(o){const{regExp:l}=s.opts.code,c=l.code==="new RegExp"?(0,Sr._)`new RegExp`:(0,IT.useFunc)(t,l),f=t.let("valid");t.try(()=>t.assign(f,(0,Sr._)`${c}(${i}, ${a}).test(${n})`),()=>t.assign(f,!1)),e.fail$data((0,Sr._)`!${f}`)}else{const l=(0,PT.usePattern)(e,r);e.fail$data((0,Sr._)`!${l}.test(${n})`)}}};fp.default=RT;var mp={};Object.defineProperty(mp,"__esModule",{value:!0});const Ui=ue,AT={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,Ui.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,Ui._)`{limit: ${e}}`},MT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:AT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxProperties"?Ui.operators.GT:Ui.operators.LT;e.fail$data((0,Ui._)`Object.keys(${n}).length ${r} ${o}`)}};mp.default=MT;var hp={};Object.defineProperty(hp,"__esModule",{value:!0});const mi=ye,Li=ue,qT=J,UT={message:({params:{missingProperty:e}})=>(0,Li.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Li._)`{missingProperty: ${e}}`},LT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:UT,code(e){const{gen:t,schema:n,schemaCode:o,data:r,$data:i,it:s}=e,{opts:a}=s;if(!i&&n.length===0)return;const l=n.length>=a.loopRequired;if(s.allErrors?c():f(),a.strictRequired){const y=e.parentSchema.properties,{definedProperties:g}=e.it;for(const b of n)if((y==null?void 0:y[b])===void 0&&!g.has(b)){const v=s.schemaEnv.baseId+s.errSchemaPath,p=`required property "${b}" is not defined at "${v}" (strictRequired)`;(0,qT.checkStrictMode)(s,p,s.opts.strictRequired)}}function c(){if(l||i)e.block$data(Li.nil,m);else for(const y of n)(0,mi.checkReportMissingProp)(e,y)}function f(){const y=t.let("missing");if(l||i){const g=t.let("valid",!0);e.block$data(g,()=>h(y,g)),e.ok(g)}else t.if((0,mi.checkMissingProp)(e,n,y)),(0,mi.reportMissingProp)(e,y),t.else()}function m(){t.forOf("prop",o,y=>{e.setParams({missingProperty:y}),t.if((0,mi.noPropertyInData)(t,r,y,a.ownProperties),()=>e.error())})}function h(y,g){e.setParams({missingProperty:y}),t.forOf(y,o,()=>{t.assign(g,(0,mi.propertyInData)(t,r,y,a.ownProperties)),t.if((0,Li.not)(g),()=>{e.error(),t.break()})},Li.nil)}}};hp.default=LT;var yp={};Object.defineProperty(yp,"__esModule",{value:!0});const Di=ue,DT={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,Di.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,Di._)`{limit: ${e}}`},zT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:DT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxItems"?Di.operators.GT:Di.operators.LT;e.fail$data((0,Di._)`${n}.length ${r} ${o}`)}};yp.default=zT;var gp={},Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});const xb=Dv;xb.code='require("ajv/dist/runtime/equal").default';Cs.default=xb;Object.defineProperty(gp,"__esModule",{value:!0});const yc=Ze,rt=ue,FT=J,BT=Cs,HT={message:({params:{i:e,j:t}})=>(0,rt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,rt._)`{i: ${e}, j: ${t}}`},VT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:HT,code(e){const{gen:t,data:n,$data:o,schema:r,parentSchema:i,schemaCode:s,it:a}=e;if(!o&&!r)return;const l=t.let("valid"),c=i.items?(0,yc.getSchemaTypes)(i.items):[];e.block$data(l,f,(0,rt._)`${s} === false`),e.ok(l);function f(){const g=t.let("i",(0,rt._)`${n}.length`),b=t.let("j");e.setParams({i:g,j:b}),t.assign(l,!0),t.if((0,rt._)`${g} > 1`,()=>(m()?h:y)(g,b))}function m(){return c.length>0&&!c.some(g=>g==="object"||g==="array")}function h(g,b){const v=t.name("item"),p=(0,yc.checkDataTypes)(c,v,a.opts.strictNumbers,yc.DataType.Wrong),u=t.const("indices",(0,rt._)`{}`);t.for((0,rt._)`;${g}--;`,()=>{t.let(v,(0,rt._)`${n}[${g}]`),t.if(p,(0,rt._)`continue`),c.length>1&&t.if((0,rt._)`typeof ${v} == "string"`,(0,rt._)`${v} += "_"`),t.if((0,rt._)`typeof ${u}[${v}] == "number"`,()=>{t.assign(b,(0,rt._)`${u}[${v}]`),e.error(),t.assign(l,!1).break()}).code((0,rt._)`${u}[${v}] = ${g}`)})}function y(g,b){const v=(0,FT.useFunc)(t,BT.default),p=t.name("outer");t.label(p).for((0,rt._)`;${g}--;`,()=>t.for((0,rt._)`${b} = ${g}; ${b}--;`,()=>t.if((0,rt._)`${v}(${n}[${g}], ${n}[${b}])`,()=>{e.error(),t.assign(l,!1).break(p)})))}}};gp.default=VT;var vp={};Object.defineProperty(vp,"__esModule",{value:!0});const Id=ue,WT=J,KT=Cs,GT={message:"must be equal to constant",params:({schemaCode:e})=>(0,Id._)`{allowedValue: ${e}}`},JT={keyword:"const",$data:!0,error:GT,code(e){const{gen:t,data:n,$data:o,schemaCode:r,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,Id._)`!${(0,WT.useFunc)(t,KT.default)}(${n}, ${r})`):e.fail((0,Id._)`${i} !== ${n}`)}};vp.default=JT;var bp={};Object.defineProperty(bp,"__esModule",{value:!0});const Ti=ue,QT=J,YT=Cs,XT={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Ti._)`{allowedValues: ${e}}`},ZT={keyword:"enum",schemaType:"array",$data:!0,error:XT,code(e){const{gen:t,data:n,$data:o,schema:r,schemaCode:i,it:s}=e;if(!o&&r.length===0)throw new Error("enum must have non-empty array");const a=r.length>=s.opts.loopEnum;let l;const c=()=>l??(l=(0,QT.useFunc)(t,YT.default));let f;if(a||o)f=t.let("valid"),e.block$data(f,m);else{if(!Array.isArray(r))throw new Error("ajv implementation error");const y=t.const("vSchema",i);f=(0,Ti.or)(...r.map((g,b)=>h(y,b)))}e.pass(f);function m(){t.assign(f,!1),t.forOf("v",i,y=>t.if((0,Ti._)`${c()}(${n}, ${y})`,()=>t.assign(f,!0).break()))}function h(y,g){const b=r[g];return typeof b=="object"&&b!==null?(0,Ti._)`${c()}(${n}, ${y}[${g}])`:(0,Ti._)`${n} === ${b}`}}};bp.default=ZT;Object.defineProperty(lp,"__esModule",{value:!0});const e1=cp,t1=dp,n1=up,o1=fp,r1=mp,i1=hp,s1=yp,a1=gp,l1=vp,c1=bp,d1=[e1.default,t1.default,n1.default,o1.default,r1.default,i1.default,s1.default,a1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l1.default,c1.default];lp.default=d1;var xp={},Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateAdditionalItems=void 0;const Io=ue,Od=J,u1={message:({params:{len:e}})=>(0,Io.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Io._)`{limit: ${e}}`},p1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:u1,code(e){const{parentSchema:t,it:n}=e,{items:o}=t;if(!Array.isArray(o)){(0,Od.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}wb(e,o)}};function wb(e,t){const{gen:n,schema:o,data:r,keyword:i,it:s}=e;s.items=!0;const a=n.const("len",(0,Io._)`${r}.length`);if(o===!1)e.setParams({len:t.length}),e.pass((0,Io._)`${a} <= ${t.length}`);else if(typeof o=="object"&&!(0,Od.alwaysValidSchema)(s,o)){const c=n.var("valid",(0,Io._)`${a} <= ${t.length}`);n.if((0,Io.not)(c),()=>l(c)),e.ok(c)}function l(c){n.forRange("i",t.length,a,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:Od.Type.Num},c),s.allErrors||n.if((0,Io.not)(c),()=>n.break())})}}Qr.validateAdditionalItems=wb;Qr.default=p1;var wp={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.validateTuple=void 0;const Fm=ue,ba=J,f1=ye,m1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return Sb(e,"additionalItems",t);n.items=!0,!(0,ba.alwaysValidSchema)(n,t)&&e.ok((0,f1.validateArray)(e))}};function Sb(e,t,n=e.schema){const{gen:o,parentSchema:r,data:i,keyword:s,it:a}=e;f(r),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=ba.mergeEvaluated.items(o,n.length,a.items));const l=o.name("valid"),c=o.const("len",(0,Fm._)`${i}.length`);n.forEach((m,h)=>{(0,ba.alwaysValidSchema)(a,m)||(o.if((0,Fm._)`${c} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function f(m){const{opts:h,errSchemaPath:y}=a,g=n.length,b=g===m.minItems&&(g===m.maxItems||m[t]===!1);if(h.strictTuples&&!b){const v=`"${s}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${y}"`;(0,ba.checkStrictMode)(a,v,h.strictTuples)}}}Yr.validateTuple=Sb;Yr.default=m1;Object.defineProperty(wp,"__esModule",{value:!0});const h1=Yr,y1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,h1.validateTuple)(e,"items")};wp.default=y1;var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});const Bm=ue,g1=J,v1=ye,b1=Qr,x1={message:({params:{len:e}})=>(0,Bm.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Bm._)`{limit: ${e}}`},w1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:x1,code(e){const{schema:t,parentSchema:n,it:o}=e,{prefixItems:r}=n;o.items=!0,!(0,g1.alwaysValidSchema)(o,t)&&(r?(0,b1.validateAdditionalItems)(e,r):e.ok((0,v1.validateArray)(e)))}};Sp.default=w1;var $p={};Object.defineProperty($p,"__esModule",{value:!0});const Dt=ue,Qs=J,S1={message:({params:{min:e,max:t}})=>t===void 0?(0,Dt.str)`must contain at least ${e} valid item(s)`:(0,Dt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Dt._)`{minContains: ${e}}`:(0,Dt._)`{minContains: ${e}, maxContains: ${t}}`},$1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:S1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;let s,a;const{minContains:l,maxContains:c}=o;i.opts.next?(s=l===void 0?1:l,a=c):s=1;const f=t.const("len",(0,Dt._)`${r}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Qs.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Qs.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Qs.alwaysValidSchema)(i,n)){let b=(0,Dt._)`${f} >= ${s}`;a!==void 0&&(b=(0,Dt._)`${b} && ${f} <= ${a}`),e.pass(b);return}i.items=!0;const m=t.name("valid");a===void 0&&s===1?y(m,()=>t.if(m,()=>t.break())):s===0?(t.let(m,!0),a!==void 0&&t.if((0,Dt._)`${r}.length > 0`,h)):(t.let(m,!1),h()),e.result(m,()=>e.reset());function h(){const b=t.name("_valid"),v=t.let("count",0);y(b,()=>t.if(b,()=>g(v)))}function y(b,v){t.forRange("i",0,f,p=>{e.subschema({keyword:"contains",dataProp:p,dataPropType:Qs.Type.Num,compositeRule:!0},b),v()})}function g(b){t.code((0,Dt._)`${b}++`),a===void 0?t.if((0,Dt._)`${b} >= ${s}`,()=>t.assign(m,!0).break()):(t.if((0,Dt._)`${b} > ${a}`,()=>t.assign(m,!1).break()),s===1?t.assign(m,!0):t.if((0,Dt._)`${b} >= ${s}`,()=>t.assign(m,!0)))}}};$p.default=$1;var El={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ue,n=J,o=ye;e.error={message:({params:{property:l,depsCount:c,deps:f}})=>{const m=c===1?"property":"properties";return(0,t.str)`must have ${m} ${f} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:f,missingProperty:m}})=>(0,t._)`{property: ${l},
|
|
1762
|
+
|| ${s} === "boolean" || ${r} === null`).assign(a,(0,fe._)`[${r}]`)}}}function p$({gen:e,parentData:t,parentDataProperty:n},o){e.if((0,fe._)`${t} !== undefined`,()=>e.assign((0,fe._)`${t}[${n}]`,o))}function Ad(e,t,n,o=Ir.Correct){const r=o===Ir.Correct?fe.operators.EQ:fe.operators.NEQ;let i;switch(e){case"null":return(0,fe._)`${t} ${r} null`;case"array":i=(0,fe._)`Array.isArray(${t})`;break;case"object":i=(0,fe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,fe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,fe._)`typeof ${t} ${r} ${e}`}return o===Ir.Correct?i:(0,fe.not)(i);function s(a=fe.nil){return(0,fe.and)((0,fe._)`typeof ${t} == "number"`,a,n?(0,fe._)`isFinite(${t})`:fe.nil)}}et.checkDataType=Ad;function Zu(e,t,n,o){if(e.length===1)return Ad(e[0],t,n,o);let r;const i=(0,Lv.toHash)(e);if(i.array&&i.object){const s=(0,fe._)`typeof ${t} != "object"`;r=i.null?s:(0,fe._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else r=fe.nil;i.number&&delete i.integer;for(const s in i)r=(0,fe.and)(r,Ad(s,t,n,o));return r}et.checkDataTypes=Zu;const f$={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,fe._)`{type: ${e}}`:(0,fe._)`{type: ${t}}`};function ep(e){const t=m$(e);(0,a$.reportError)(t,f$)}et.reportTypeError=ep;function m$(e){const{gen:t,data:n,schema:o}=e,r=(0,Lv.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:n,schema:o.type,schemaCode:r,schemaValue:r,parentSchema:o,params:{},it:e}}var El={};Object.defineProperty(El,"__esModule",{value:!0});El.assignDefaults=void 0;const ir=ue,h$=J;function y$(e,t){const{properties:n,items:o}=e.schema;if(t==="object"&&n)for(const r in n)Um(e,r,n[r].default);else t==="array"&&Array.isArray(o)&&o.forEach((r,i)=>Um(e,i,r.default))}El.assignDefaults=y$;function Um(e,t,n){const{gen:o,compositeRule:r,data:i,opts:s}=e;if(n===void 0)return;const a=(0,ir._)`${i}${(0,ir.getProperty)(t)}`;if(r){(0,h$.checkStrictMode)(e,`default is ignored for: ${a}`);return}let l=(0,ir._)`${a} === undefined`;s.useDefaults==="empty"&&(l=(0,ir._)`${l} || ${a} === null || ${a} === ""`),o.if(l,(0,ir._)`${a} = ${(0,ir.stringify)(n)}`)}var bn={},ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;const Ae=ue,tp=J,Kn=Dt,g$=J;function v$(e,t){const{gen:n,data:o,it:r}=e;n.if(op(n,o,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ae._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=v$;function b$({gen:e,data:t,it:{opts:n}},o,r){return(0,Ae.or)(...o.map(i=>(0,Ae.and)(op(e,t,i,n.ownProperties),(0,Ae._)`${r} = ${i}`)))}ye.checkMissingProp=b$;function x$(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=x$;function Fv(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ae._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=Fv;function np(e,t,n){return(0,Ae._)`${Fv(e)}.call(${t}, ${n})`}ye.isOwnProperty=np;function w$(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} !== undefined`;return o?(0,Ae._)`${r} && ${np(e,t,n)}`:r}ye.propertyInData=w$;function op(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} === undefined`;return o?(0,Ae.or)(r,(0,Ae.not)(np(e,t,n))):r}ye.noPropertyInData=op;function Bv(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=Bv;function S$(e,t){return Bv(t).filter(n=>!(0,tp.alwaysValidSchema)(e,t[n]))}ye.schemaProperties=S$;function $$({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:r,errorPath:i},it:s},a,l,c){const f=c?(0,Ae._)`${e}, ${t}, ${o}${r}`:t,m=[[Kn.default.instancePath,(0,Ae.strConcat)(Kn.default.instancePath,i)],[Kn.default.parentData,s.parentData],[Kn.default.parentDataProperty,s.parentDataProperty],[Kn.default.rootData,Kn.default.rootData]];s.opts.dynamicRef&&m.push([Kn.default.dynamicAnchors,Kn.default.dynamicAnchors]);const h=(0,Ae._)`${f}, ${n.object(...m)}`;return l!==Ae.nil?(0,Ae._)`${a}.call(${l}, ${h})`:(0,Ae._)`${a}(${h})`}ye.callValidateCode=$$;const k$=(0,Ae._)`new RegExp`;function T$({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"",{regExp:r}=t.code,i=r(n,o);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Ae._)`${r.code==="new RegExp"?k$:(0,g$.useFunc)(e,r)}(${n}, ${o})`})}ye.usePattern=T$;function _$(e){const{gen:t,data:n,keyword:o,it:r}=e,i=t.name("valid");if(r.allErrors){const a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){const l=t.const("len",(0,Ae._)`${n}.length`);t.forRange("i",0,l,c=>{e.subschema({keyword:o,dataProp:c,dataPropType:tp.Type.Num},i),t.if((0,Ae.not)(i),a)})}}ye.validateArray=_$;function j$(e){const{gen:t,schema:n,keyword:o,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,tp.alwaysValidSchema)(r,l))&&!r.opts.unevaluated)return;const s=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,c)=>{const f=e.subschema({keyword:o,schemaProp:c,compositeRule:!0},a);t.assign(s,(0,Ae._)`${s} || ${a}`),e.mergeValidEvaluated(f,a)||t.if((0,Ae.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ye.validateUnion=j$;Object.defineProperty(bn,"__esModule",{value:!0});bn.validateKeywordUsage=bn.validSchemaType=bn.funcKeywordCode=bn.macroKeywordCode=void 0;const bt=ue,Po=Dt,N$=ye,C$=Ns;function E$(e,t){const{gen:n,keyword:o,schema:r,parentSchema:i,it:s}=e,a=t.macro.call(s.self,r,i,s),l=Hv(n,o,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const c=n.name("valid");e.subschema({schema:a,schemaPath:bt.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:l,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}bn.macroKeywordCode=E$;function P$(e,t){var n;const{gen:o,keyword:r,schema:i,parentSchema:s,$data:a,it:l}=e;O$(l,t);const c=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,f=Hv(o,r,c),m=o.let("valid");e.block$data(m,h),e.ok((n=t.valid)!==null&&n!==void 0?n:m);function h(){if(t.errors===!1)b(),t.modifying&&Lm(e),v(()=>e.error());else{const u=t.async?y():g();t.modifying&&Lm(e),v(()=>I$(e,u))}}function y(){const u=o.let("ruleErrs",null);return o.try(()=>b((0,bt._)`await `),p=>o.assign(m,!1).if((0,bt._)`${p} instanceof ${l.ValidationError}`,()=>o.assign(u,(0,bt._)`${p}.errors`),()=>o.throw(p))),u}function g(){const u=(0,bt._)`${f}.errors`;return o.assign(u,null),b(bt.nil),u}function b(u=t.async?(0,bt._)`await `:bt.nil){const p=l.opts.passContext?Po.default.this:Po.default.self,x=!("compile"in t&&!a||t.schema===!1);o.assign(m,(0,bt._)`${u}${(0,N$.callValidateCode)(e,f,p,x)}`,t.modifying)}function v(u){var p;o.if((0,bt.not)((p=t.valid)!==null&&p!==void 0?p:m),u)}}bn.funcKeywordCode=P$;function Lm(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,()=>t.assign(n,(0,bt._)`${o.parentData}[${o.parentDataProperty}]`))}function I$(e,t){const{gen:n}=e;n.if((0,bt._)`Array.isArray(${t})`,()=>{n.assign(Po.default.vErrors,(0,bt._)`${Po.default.vErrors} === null ? ${t} : ${Po.default.vErrors}.concat(${t})`).assign(Po.default.errors,(0,bt._)`${Po.default.vErrors}.length`),(0,C$.extendErrors)(e)},()=>e.error())}function O$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Hv(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,bt.stringify)(n)})}function R$(e,t,n=!1){return!t.length||t.some(o=>o==="array"?Array.isArray(e):o==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==o||n&&typeof e>"u")}bn.validSchemaType=R$;function A$({schema:e,opts:t,self:n,errSchemaPath:o},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");const s=r.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[i])){const l=`keyword "${i}" value is invalid at path "${o}": `+n.errorsText(r.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(l);else throw new Error(l)}}bn.validateKeywordUsage=A$;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.extendSubschemaMode=yo.extendSubschemaData=yo.getSubschema=void 0;const vn=ue,Vv=J;function M$(e,{keyword:t,schemaProp:n,schema:o,schemaPath:r,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return n===void 0?{schema:a,schemaPath:(0,vn._)`${e.schemaPath}${(0,vn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:(0,vn._)`${e.schemaPath}${(0,vn.getProperty)(t)}${(0,vn.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Vv.escapeFragment)(n)}`}}if(o!==void 0){if(r===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:r,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}yo.getSubschema=M$;function q$(e,t,{dataProp:n,dataPropType:o,data:r,dataTypes:i,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(n!==void 0){const{errorPath:c,dataPathArr:f,opts:m}=t,h=a.let("data",(0,vn._)`${t.data}${(0,vn.getProperty)(n)}`,!0);l(h),e.errorPath=(0,vn.str)`${c}${(0,Vv.getErrorPath)(n,o,m.jsPropertySyntax)}`,e.parentDataProperty=(0,vn._)`${n}`,e.dataPathArr=[...f,e.parentDataProperty]}if(r!==void 0){const c=r instanceof vn.Name?r:a.let("data",r,!0);l(c),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}yo.extendSubschemaData=q$;function U$(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:o,createErrors:r,allErrors:i}){o!==void 0&&(e.compositeRule=o),r!==void 0&&(e.createErrors=r),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}yo.extendSubschemaMode=U$;var at={},Wv=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},Kv={exports:{}},so=Kv.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var o=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};va(t,o,r,e,"",e)};so.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};so.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};so.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};so.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function va(e,t,n,o,r,i,s,a,l,c){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,r,i,s,a,l,c);for(var f in o){var m=o[f];if(Array.isArray(m)){if(f in so.arrayKeywords)for(var h=0;h<m.length;h++)va(e,t,n,m[h],r+"/"+f+"/"+h,i,r,f,o,h)}else if(f in so.propsKeywords){if(m&&typeof m=="object")for(var y in m)va(e,t,n,m[y],r+"/"+f+"/"+L$(y),i,r,f,o,y)}else(f in so.keywords||e.allKeys&&!(f in so.skipKeywords))&&va(e,t,n,m,r+"/"+f,i,r,f,o)}n(o,r,i,s,a,l,c)}}function L$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var D$=Kv.exports;Object.defineProperty(at,"__esModule",{value:!0});at.getSchemaRefs=at.resolveUrl=at.normalizeId=at._getFullPath=at.getFullPath=at.inlineRef=void 0;const z$=J,F$=Wv,B$=D$,H$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function V$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Md(e):t?Gv(e)<=t:!1}at.inlineRef=V$;const W$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Md(e){for(const t in e){if(W$.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(Md)||typeof n=="object"&&Md(n))return!0}return!1}function Gv(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!H$.has(n)&&(typeof e[n]=="object"&&(0,z$.eachItem)(e[n],o=>t+=Gv(o)),t===1/0))return 1/0}return t}function Jv(e,t="",n){n!==!1&&(t=Or(t));const o=e.parse(t);return Qv(e,o)}at.getFullPath=Jv;function Qv(e,t){return e.serialize(t).split("#")[0]+"#"}at._getFullPath=Qv;const K$=/#\/?$/;function Or(e){return e?e.replace(K$,""):""}at.normalizeId=Or;function G$(e,t,n){return n=Or(n),e.resolve(t,n)}at.resolveUrl=G$;const J$=/^[a-z_][-a-z0-9._]*$/i;function Q$(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:o}=this.opts,r=Or(e[n]||t),i={"":r},s=Jv(o,r,!1),a={},l=new Set;return B$(e,{allKeys:!0},(m,h,y,g)=>{if(g===void 0)return;const b=s+h;let v=i[g];typeof m[n]=="string"&&(v=u.call(this,m[n])),p.call(this,m.$anchor),p.call(this,m.$dynamicAnchor),i[h]=v;function u(x){const S=this.opts.uriResolver.resolve;if(x=Or(v?S(v,x):x),l.has(x))throw f(x);l.add(x);let T=this.refs[x];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?c(m,T.schema,x):x!==Or(b)&&(x[0]==="#"?(c(m,a[x],x),a[x]=m):this.refs[x]=b),x}function p(x){if(typeof x=="string"){if(!J$.test(x))throw new Error(`invalid anchor "${x}"`);u.call(this,`#${x}`)}}}),a;function c(m,h,y){if(h!==void 0&&!F$(m,h))throw f(y)}function f(m){return new Error(`reference "${m}" resolves to more than one schema`)}}at.getSchemaRefs=Q$;Object.defineProperty(ln,"__esModule",{value:!0});ln.getData=ln.KeywordCxt=ln.validateFunctionCode=void 0;const Yv=Vr,Dm=et,rp=An,nl=et,Y$=El,Ui=bn,gc=yo,re=ue,le=Dt,X$=at,Mn=J,hi=Ns;function Z$(e){if(eb(e)&&(tb(e),Zv(e))){nk(e);return}Xv(e,()=>(0,Yv.topBoolOrEmptySchema)(e))}ln.validateFunctionCode=Z$;function Xv({gen:e,validateName:t,schema:n,schemaEnv:o,opts:r},i){r.code.es5?e.func(t,(0,re._)`${le.default.data}, ${le.default.valCxt}`,o.$async,()=>{e.code((0,re._)`"use strict"; ${zm(n,r)}`),tk(e,r),e.code(i)}):e.func(t,(0,re._)`${le.default.data}, ${ek(r)}`,o.$async,()=>e.code(zm(n,r)).code(i))}function ek(e){return(0,re._)`{${le.default.instancePath}="", ${le.default.parentData}, ${le.default.parentDataProperty}, ${le.default.rootData}=${le.default.data}${e.dynamicRef?(0,re._)`, ${le.default.dynamicAnchors}={}`:re.nil}}={}`}function tk(e,t){e.if(le.default.valCxt,()=>{e.var(le.default.instancePath,(0,re._)`${le.default.valCxt}.${le.default.instancePath}`),e.var(le.default.parentData,(0,re._)`${le.default.valCxt}.${le.default.parentData}`),e.var(le.default.parentDataProperty,(0,re._)`${le.default.valCxt}.${le.default.parentDataProperty}`),e.var(le.default.rootData,(0,re._)`${le.default.valCxt}.${le.default.rootData}`),t.dynamicRef&&e.var(le.default.dynamicAnchors,(0,re._)`${le.default.valCxt}.${le.default.dynamicAnchors}`)},()=>{e.var(le.default.instancePath,(0,re._)`""`),e.var(le.default.parentData,(0,re._)`undefined`),e.var(le.default.parentDataProperty,(0,re._)`undefined`),e.var(le.default.rootData,le.default.data),t.dynamicRef&&e.var(le.default.dynamicAnchors,(0,re._)`{}`)})}function nk(e){const{schema:t,opts:n,gen:o}=e;Xv(e,()=>{n.$comment&&t.$comment&&ob(e),ak(e),o.let(le.default.vErrors,null),o.let(le.default.errors,0),n.unevaluated&&ok(e),nb(e),dk(e)})}function ok(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,re._)`${n}.evaluated`),t.if((0,re._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,re._)`${e.evaluated}.props`,(0,re._)`undefined`)),t.if((0,re._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,re._)`${e.evaluated}.items`,(0,re._)`undefined`))}function zm(e,t){const n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,re._)`/*# sourceURL=${n} */`:re.nil}function rk(e,t){if(eb(e)&&(tb(e),Zv(e))){ik(e,t);return}(0,Yv.boolOrEmptySchema)(e,t)}function Zv({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function eb(e){return typeof e.schema!="boolean"}function ik(e,t){const{schema:n,gen:o,opts:r}=e;r.$comment&&n.$comment&&ob(e),lk(e),ck(e);const i=o.const("_errs",le.default.errors);nb(e,i),o.var(t,(0,re._)`${i} === ${le.default.errors}`)}function tb(e){(0,Mn.checkUnknownRules)(e),sk(e)}function nb(e,t){if(e.opts.jtd)return Fm(e,[],!1,t);const n=(0,Dm.getSchemaTypes)(e.schema),o=(0,Dm.coerceAndCheckDataType)(e,n);Fm(e,n,!o,t)}function sk(e){const{schema:t,errSchemaPath:n,opts:o,self:r}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,Mn.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function ak(e){const{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,Mn.checkStrictMode)(e,"default is ignored in the schema root")}function lk(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,X$.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function ck(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function ob({gen:e,schemaEnv:t,schema:n,errSchemaPath:o,opts:r}){const i=n.$comment;if(r.$comment===!0)e.code((0,re._)`${le.default.self}.logger.log(${i})`);else if(typeof r.$comment=="function"){const s=(0,re.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,re._)`${le.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function dk(e){const{gen:t,schemaEnv:n,validateName:o,ValidationError:r,opts:i}=e;n.$async?t.if((0,re._)`${le.default.errors} === 0`,()=>t.return(le.default.data),()=>t.throw((0,re._)`new ${r}(${le.default.vErrors})`)):(t.assign((0,re._)`${o}.errors`,le.default.vErrors),i.unevaluated&&uk(e),t.return((0,re._)`${le.default.errors} === 0`))}function uk({gen:e,evaluated:t,props:n,items:o}){n instanceof re.Name&&e.assign((0,re._)`${t}.props`,n),o instanceof re.Name&&e.assign((0,re._)`${t}.items`,o)}function Fm(e,t,n,o){const{gen:r,schema:i,data:s,allErrors:a,opts:l,self:c}=e,{RULES:f}=c;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,Mn.schemaHasRulesButRef)(i,f))){r.block(()=>sb(e,"$ref",f.all.$ref.definition));return}l.jtd||pk(e,t),r.block(()=>{for(const h of f.rules)m(h);m(f.post)});function m(h){(0,rp.shouldUseGroup)(i,h)&&(h.type?(r.if((0,nl.checkDataType)(h.type,s,l.strictNumbers)),Bm(e,h),t.length===1&&t[0]===h.type&&n&&(r.else(),(0,nl.reportTypeError)(e)),r.endIf()):Bm(e,h),a||r.if((0,re._)`${le.default.errors} === ${o||0}`))}}function Bm(e,t){const{gen:n,schema:o,opts:{useDefaults:r}}=e;r&&(0,Y$.assignDefaults)(e,t.type),n.block(()=>{for(const i of t.rules)(0,rp.shouldUseRule)(o,i)&&sb(e,i.keyword,i.definition,t.type)})}function pk(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(fk(e,t),e.opts.allowUnionTypes||mk(e,t),hk(e,e.dataTypes))}function fk(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{rb(e.dataTypes,n)||ip(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),gk(e,t)}}function mk(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&ip(e,"use allowUnionTypes to allow union type keyword")}function hk(e,t){const n=e.self.RULES.all;for(const o in n){const r=n[o];if(typeof r=="object"&&(0,rp.shouldUseRule)(e.schema,r)){const{type:i}=r.definition;i.length&&!i.some(s=>yk(t,s))&&ip(e,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function yk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function rb(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function gk(e,t){const n=[];for(const o of e.dataTypes)rb(t,o)?n.push(o):t.includes("integer")&&o==="number"&&n.push("integer");e.dataTypes=n}function ip(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Mn.checkStrictMode)(e,t,e.opts.strictTypes)}class ib{constructor(t,n,o){if((0,Ui.validateKeywordUsage)(t,n,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Mn.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",ab(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ui.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",le.default.errors))}result(t,n,o){this.failResult((0,re.not)(t),n,o)}failResult(t,n,o){this.gen.if(t),o?o():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,re.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:n}=this;this.fail((0,re._)`${n} !== undefined && (${(0,re.or)(this.invalid$data(),t)})`)}error(t,n,o){if(n){this.setParams(n),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,n){(t?hi.reportExtraError:hi.reportError)(this,this.def.error,n)}$dataError(){(0,hi.reportError)(this,this.def.$dataError||hi.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,hi.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,o=re.nil){this.gen.block(()=>{this.check$data(t,o),n()})}check$data(t=re.nil,n=re.nil){if(!this.$data)return;const{gen:o,schemaCode:r,schemaType:i,def:s}=this;o.if((0,re.or)((0,re._)`${r} === undefined`,n)),t!==re.nil&&o.assign(t,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),t!==re.nil&&o.assign(t,!1)),o.else()}invalid$data(){const{gen:t,schemaCode:n,schemaType:o,def:r,it:i}=this;return(0,re.or)(s(),a());function s(){if(o.length){if(!(n instanceof re.Name))throw new Error("ajv implementation error");const l=Array.isArray(o)?o:[o];return(0,re._)`${(0,nl.checkDataTypes)(l,n,i.opts.strictNumbers,nl.DataType.Wrong)}`}return re.nil}function a(){if(r.validateSchema){const l=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,re._)`!${l}(${n})`}return re.nil}}subschema(t,n){const o=(0,gc.getSubschema)(this.it,t);(0,gc.extendSubschemaData)(o,this.it,t),(0,gc.extendSubschemaMode)(o,t);const r={...this.it,...o,items:void 0,props:void 0};return rk(r,n),r}mergeEvaluated(t,n){const{it:o,gen:r}=this;o.opts.unevaluated&&(o.props!==!0&&t.props!==void 0&&(o.props=Mn.mergeEvaluated.props(r,t.props,o.props,n)),o.items!==!0&&t.items!==void 0&&(o.items=Mn.mergeEvaluated.items(r,t.items,o.items,n)))}mergeValidEvaluated(t,n){const{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(n,()=>this.mergeEvaluated(t,re.Name)),!0}}ln.KeywordCxt=ib;function sb(e,t,n,o){const r=new ib(e,n,t);"code"in n?n.code(r,o):r.$data&&n.validate?(0,Ui.funcKeywordCode)(r,n):"macro"in n?(0,Ui.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Ui.funcKeywordCode)(r,n)}const vk=/^\/(?:[^~]|~0|~1)*$/,bk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ab(e,{dataLevel:t,dataNames:n,dataPathArr:o}){let r,i;if(e==="")return le.default.rootData;if(e[0]==="/"){if(!vk.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,i=le.default.rootData}else{const c=bk.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);const f=+c[1];if(r=c[2],r==="#"){if(f>=t)throw new Error(l("property/index",f));return o[t-f]}if(f>t)throw new Error(l("data",f));if(i=n[t-f],!r)return i}let s=i;const a=r.split("/");for(const c of a)c&&(i=(0,re._)`${i}${(0,re.getProperty)((0,Mn.unescapeJsonPointer)(c))}`,s=(0,re._)`${s} && ${i}`);return s;function l(c,f){return`Cannot access ${c} ${f} levels up, current level is ${t}`}}ln.getData=ab;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});class xk extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Cs.default=xk;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});const vc=at;class wk extends Error{constructor(t,n,o,r){super(r||`can't resolve reference ${o} from id ${n}`),this.missingRef=(0,vc.resolveUrl)(t,n,o),this.missingSchema=(0,vc.normalizeId)((0,vc.getFullPath)(t,this.missingRef))}}Yr.default=wk;var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.resolveSchema=xt.getCompilingSchema=xt.resolveRef=xt.compileSchema=xt.SchemaEnv=void 0;const Zt=ue,Sk=Cs,jo=Dt,rn=at,Hm=J,$k=ln;class Pl{constructor(t){var n;this.refs={},this.dynamicAnchors={};let o;typeof t.schema=="object"&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,rn.normalizeId)(o==null?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o==null?void 0:o.$async,this.refs={}}}xt.SchemaEnv=Pl;function sp(e){const t=lb.call(this,e);if(t)return t;const n=(0,rn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:o,lines:r}=this.opts.code,{ownProperties:i}=this.opts,s=new Zt.CodeGen(this.scope,{es5:o,lines:r,ownProperties:i});let a;e.$async&&(a=s.scopeValue("Error",{ref:Sk.default,code:(0,Zt._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const c={gen:s,allErrors:this.opts.allErrors,data:jo.default.data,parentData:jo.default.parentData,parentDataProperty:jo.default.parentDataProperty,dataNames:[jo.default.data],dataPathArr:[Zt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Zt.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Zt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Zt._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,$k.validateFunctionCode)(c),s.optimize(this.opts.code.optimize);const m=s.toString();f=`${s.scopeRefs(jo.default.scope)}return ${m}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const y=new Function(`${jo.default.self}`,`${jo.default.scope}`,f)(this,this.scope.get());if(this.scope.value(l,{ref:y}),y.errors=null,y.schema=e.schema,y.schemaEnv=e,e.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:l,validateCode:m,scopeValues:s._values}),this.opts.unevaluated){const{props:g,items:b}=c;y.evaluated={props:g instanceof Zt.Name?void 0:g,items:b instanceof Zt.Name?void 0:b,dynamicProps:g instanceof Zt.Name,dynamicItems:b instanceof Zt.Name},y.source&&(y.source.evaluated=(0,Zt.stringify)(y.evaluated))}return e.validate=y,e}catch(m){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),m}finally{this._compilations.delete(e)}}xt.compileSchema=sp;function kk(e,t,n){var o;n=(0,rn.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let i=jk.call(this,e,n);if(i===void 0){const s=(o=e.localRefs)===null||o===void 0?void 0:o[n],{schemaId:a}=this.opts;s&&(i=new Pl({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=Tk.call(this,i)}xt.resolveRef=kk;function Tk(e){return(0,rn.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:sp.call(this,e)}function lb(e){for(const t of this._compilations)if(_k(t,e))return t}xt.getCompilingSchema=lb;function _k(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function jk(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Il.call(this,e,t)}function Il(e,t){const n=this.opts.uriResolver.parse(t),o=(0,rn._getFullPath)(this.opts.uriResolver,n);let r=(0,rn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===r)return bc.call(this,n,e);const i=(0,rn.normalizeId)(o),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=Il.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:bc.call(this,n,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||sp.call(this,s),i===(0,rn.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,c=a[l];return c&&(r=(0,rn.resolveUrl)(this.opts.uriResolver,r,c)),new Pl({schema:a,schemaId:l,root:e,baseId:r})}return bc.call(this,n,s)}}xt.resolveSchema=Il;const Nk=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bc(e,{baseId:t,schema:n,root:o}){var r;if(((r=e.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,Hm.unescapeFragment)(a)];if(l===void 0)return;n=l;const c=typeof n=="object"&&n[this.opts.schemaId];!Nk.has(a)&&c&&(t=(0,rn.resolveUrl)(this.opts.uriResolver,t,c))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,Hm.schemaHasRulesButRef)(n,this.RULES)){const a=(0,rn.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Il.call(this,o,a)}const{schemaId:s}=this.opts;if(i=i||new Pl({schema:n,schemaId:s,root:o,baseId:t}),i.schema!==i.root.schema)return i}const Ck="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ek="Meta-schema for $data reference (JSON AnySchema extension proposal)",Pk="object",Ik=["$data"],Ok={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Rk=!1,Ak={$id:Ck,description:Ek,type:Pk,required:Ik,properties:Ok,additionalProperties:Rk};var ap={},Ol={exports:{}};const Mk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),cb=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),lp=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),db=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),qk=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ub(e){let t="",n=0,o=0;for(o=0;o<e.length;o++)if(n=e[o].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(n=e[o].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[o]}return t}const Uk=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Vm(e){return e.length=0,!0}function Lk(e,t,n){if(e.length){const o=ub(e);if(o!=="")t.push(o);else return n.error=!0,!1;e.length=0}return!0}function Dk(e){let t=0;const n={error:!1,address:"",zone:""},o=[],r=[];let i=!1,s=!1,a=Lk;for(let l=0;l<e.length;l++){const c=e[l];if(!(c==="["||c==="]"))if(c===":"){if(i===!0&&(s=!0),!a(r,o,n))break;if(++t>7){n.error=!0;break}l>0&&e[l-1]===":"&&(i=!0),o.push(":");continue}else if(c==="%"){if(!a(r,o,n))break;a=Vm}else{r.push(c);continue}}return r.length&&(a===Vm?n.zone=r.join(""):s?o.push(r.join("")):o.push(ub(r))),n.address=o.join(""),n}function pb(e){if(zk(e,":")<2)return{host:e,isIPV6:!1};const t=Dk(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,o=t.address;return t.zone&&(n+="%"+t.zone,o+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:o}}}function zk(e,t){let n=0;for(let o=0;o<e.length;o++)e[o]===t&&n++;return n}function Fk(e){let t=e;const n=[];let o=-1,r=0;for(;r=t.length;){if(r===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(r===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(r===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((o=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,o)),t=t.slice(o)}return n.join("")}const Bk={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Hk=/[@/?#:]/g,Vk=/[@/?#]/g;function fb(e,t){const n=t?Vk:Hk;return n.lastIndex=0,e.replace(n,o=>Bk[o])}function Wk(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let o=0;o<e.length;o++){if(e[o]==="%"&&o+2<e.length){const r=e.slice(o+1,o+3);if(lp(r)){const i=r.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&db(s)?n+=s:n+="%"+i,o+=2;continue}}n+=e[o]}return n}function Kk(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(lp(o)){const r=o.toUpperCase(),i=String.fromCharCode(parseInt(r,16));i!=="."&&db(i)?t+=i:t+="%"+r,n+=2;continue}}qk(e[n])?t+=e[n]:t+=escape(e[n])}return t}function Gk(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(lp(o)){t+="%"+o.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function Jk(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!cb(n)){const o=pb(n);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=fb(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var mb={nonSimpleDomain:Uk,recomposeAuthority:Jk,reescapeHostDelimiters:fb,normalizePercentEncoding:Wk,normalizePathEncoding:Kk,escapePreservingEscapes:Gk,removeDotSegments:Fk,isIPv4:cb,isUUID:Mk,normalizeIPv6:pb};const{isUUID:Qk}=mb,Yk=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function hb(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function yb(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function gb(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Xk(e){return e.secure=hb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Zk(e){if((e.port===(hb(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function eT(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(Yk);if(n){const o=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const r=`${o}:${t.nid||e.nid}`,i=cp(r);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function tT(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),r=`${n}:${t.nid||o}`,i=cp(r);i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${o||t.nid}:${a}`,t.skipEscape=!0,s}function nT(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Qk(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function oT(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const vb={scheme:"http",domainHost:!0,parse:yb,serialize:gb},rT={scheme:"https",domainHost:vb.domainHost,parse:yb,serialize:gb},ba={scheme:"ws",domainHost:!0,parse:Xk,serialize:Zk},iT={scheme:"wss",domainHost:ba.domainHost,parse:ba.parse,serialize:ba.serialize},sT={scheme:"urn",parse:eT,serialize:tT,skipNormalize:!0},aT={scheme:"urn:uuid",parse:nT,serialize:oT,skipNormalize:!0},ol={http:vb,https:rT,ws:ba,wss:iT,urn:sT,"urn:uuid":aT};Object.setPrototypeOf(ol,null);function cp(e){return e&&(ol[e]||ol[e.toLowerCase()])||void 0}var lT={SCHEMES:ol,getSchemeHandler:cp};const{normalizeIPv6:cT,removeDotSegments:_i,recomposeAuthority:dT,normalizePercentEncoding:uT,normalizePathEncoding:pT,escapePreservingEscapes:fT,reescapeHostDelimiters:mT,isIPv4:hT,nonSimpleDomain:yT}=mb,{SCHEMES:gT,getSchemeHandler:bb}=lT;function vT(e,t){return typeof e=="string"?e=$T(e,t):typeof e=="object"&&(e=Wr(Jo(e,t),t)),e}function bT(e,t,n){const o=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=xb(Wr(e,o),Wr(t,o),o,!0);return o.skipEscape=!0,Jo(r,o)}function xb(e,t,n,o){const r={};return o||(e=Wr(Jo(e,n),n),t=Wr(Jo(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=_i(t.path||""),r.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=_i(t.path||""),r.query=t.query):(t.path?(t.path[0]==="/"?r.path=_i(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?r.path="/"+t.path:e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path,r.path=_i(r.path)),r.query=t.query):(r.path=e.path,t.query!==void 0?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function xT(e,t,n){const o=Wm(e,n),r=Wm(t,n);return o!==void 0&&r!==void 0&&o.toLowerCase()===r.toLowerCase()}function Jo(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},o=Object.assign({},t),r=[],i=bb(o.scheme||n.scheme);i&&i.serialize&&i.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=uT(n.path):(n.path=fT(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),o.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");const s=dT(n);if(s!==void 0&&(o.reference!=="suffix"&&r.push("//"),r.push(s),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let a=n.path;!o.absolutePath&&(!i||!i.absolutePath)&&(a=_i(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),r.push(a)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}const wT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ST(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function wb(e,t){const n=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let r=!1,i=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const s=e.match(wT);if(s){o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]);const a=ST(o,s);if(a!==void 0&&(o.error=o.error||a,r=!0),o.host)if(hT(o.host)===!1){const f=cT(o.host);o.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==o.reference&&(o.error=o.error||"URI is not a "+n.reference+" reference.");const l=bb(n.scheme||o.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&o.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&yT(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(c){o.error=o.error||"Host's domain name can not be converted to ASCII: "+c}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=mT(unescape(o.host),i))),o.path&&(o.path=pT(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}l&&l.parse&&l.parse(o,n)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:r}}function Wr(e,t){return wb(e,t).parsed}function $T(e,t){return Sb(e,t).normalized}function Sb(e,t){const{parsed:n,malformedAuthorityOrPort:o}=wb(e,t);return{normalized:o?e:Jo(n,t),malformedAuthorityOrPort:o}}function Wm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:o}=Sb(e,t);return o?void 0:n}if(typeof e=="object")return Jo(e,t)}const dp={SCHEMES:gT,normalize:vT,resolve:bT,resolveComponent:xb,equal:xT,serialize:Jo,parse:Wr};Ol.exports=dp;Ol.exports.default=dp;Ol.exports.fastUri=dp;var kT=Ol.exports;Object.defineProperty(ap,"__esModule",{value:!0});const $b=kT;$b.code='require("ajv/dist/runtime/uri").default';ap.default=$b;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ln;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=ue;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const o=Cs,r=Yr,i=Go,s=xt,a=ue,l=at,c=et,f=J,m=Ak,h=ap,y=(I,_)=>new RegExp(I,_);y.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},u={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function x(I){var _,A,E,w,k,N,B,O,Y,ie,de,we,ze,Ee,Se,_e,Ye,Pe,_n,Bn,_o,tr,Hn,pn,Yt;const Vn=I.strict,nr=(_=I.code)===null||_===void 0?void 0:_.optimize,ii=nr===!0||nr===void 0?1:nr||0,si=(E=(A=I.code)===null||A===void 0?void 0:A.regExp)!==null&&E!==void 0?E:y,Hl=(w=I.uriResolver)!==null&&w!==void 0?w:h.default;return{strictSchema:(N=(k=I.strictSchema)!==null&&k!==void 0?k:Vn)!==null&&N!==void 0?N:!0,strictNumbers:(O=(B=I.strictNumbers)!==null&&B!==void 0?B:Vn)!==null&&O!==void 0?O:!0,strictTypes:(ie=(Y=I.strictTypes)!==null&&Y!==void 0?Y:Vn)!==null&&ie!==void 0?ie:"log",strictTuples:(we=(de=I.strictTuples)!==null&&de!==void 0?de:Vn)!==null&&we!==void 0?we:"log",strictRequired:(Ee=(ze=I.strictRequired)!==null&&ze!==void 0?ze:Vn)!==null&&Ee!==void 0?Ee:!1,code:I.code?{...I.code,optimize:ii,regExp:si}:{optimize:ii,regExp:si},loopRequired:(Se=I.loopRequired)!==null&&Se!==void 0?Se:p,loopEnum:(_e=I.loopEnum)!==null&&_e!==void 0?_e:p,meta:(Ye=I.meta)!==null&&Ye!==void 0?Ye:!0,messages:(Pe=I.messages)!==null&&Pe!==void 0?Pe:!0,inlineRefs:(_n=I.inlineRefs)!==null&&_n!==void 0?_n:!0,schemaId:(Bn=I.schemaId)!==null&&Bn!==void 0?Bn:"$id",addUsedSchema:(_o=I.addUsedSchema)!==null&&_o!==void 0?_o:!0,validateSchema:(tr=I.validateSchema)!==null&&tr!==void 0?tr:!0,validateFormats:(Hn=I.validateFormats)!==null&&Hn!==void 0?Hn:!0,unicodeRegExp:(pn=I.unicodeRegExp)!==null&&pn!==void 0?pn:!0,int32range:(Yt=I.int32range)!==null&&Yt!==void 0?Yt:!0,uriResolver:Hl}}class S{constructor(_={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,_=this.opts={..._,...x(_)};const{es5:A,lines:E}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:b,es5:A,lines:E}),this.logger=V(_.logger);const w=_.validateFormats;_.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,v,_,"NOT SUPPORTED"),T.call(this,u,_,"DEPRECATED","warn"),this._metaOpts=M.call(this),_.formats&&j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),_.keywords&&R.call(this,_.keywords),typeof _.meta=="object"&&this.addMetaSchema(_.meta),$.call(this),_.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:_,meta:A,schemaId:E}=this.opts;let w=m;E==="id"&&(w={...m},w.id=w.$id,delete w.$id),A&&_&&this.addMetaSchema(w,w[E],!1)}defaultMeta(){const{meta:_,schemaId:A}=this.opts;return this.opts.defaultMeta=typeof _=="object"?_[A]||_:void 0}validate(_,A){let E;if(typeof _=="string"){if(E=this.getSchema(_),!E)throw new Error(`no schema with key or ref "${_}"`)}else E=this.compile(_);const w=E(A);return"$async"in E||(this.errors=E.errors),w}compile(_,A){const E=this._addSchema(_,A);return E.validate||this._compileSchemaEnv(E)}compileAsync(_,A){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:E}=this.opts;return w.call(this,_,A);async function w(ie,de){await k.call(this,ie.$schema);const we=this._addSchema(ie,de);return we.validate||N.call(this,we)}async function k(ie){ie&&!this.getSchema(ie)&&await w.call(this,{$ref:ie},!0)}async function N(ie){try{return this._compileSchemaEnv(ie)}catch(de){if(!(de instanceof r.default))throw de;return B.call(this,de),await O.call(this,de.missingSchema),N.call(this,ie)}}function B({missingSchema:ie,missingRef:de}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${de} cannot be resolved`)}async function O(ie){const de=await Y.call(this,ie);this.refs[ie]||await k.call(this,de.$schema),this.refs[ie]||this.addSchema(de,ie,A)}async function Y(ie){const de=this._loading[ie];if(de)return de;try{return await(this._loading[ie]=E(ie))}finally{delete this._loading[ie]}}}addSchema(_,A,E,w=this.opts.validateSchema){if(Array.isArray(_)){for(const N of _)this.addSchema(N,void 0,E,w);return this}let k;if(typeof _=="object"){const{schemaId:N}=this.opts;if(k=_[N],k!==void 0&&typeof k!="string")throw new Error(`schema ${N} must be string`)}return A=(0,l.normalizeId)(A||k),this._checkUnique(A),this.schemas[A]=this._addSchema(_,E,A,w,!0),this}addMetaSchema(_,A,E=this.opts.validateSchema){return this.addSchema(_,A,!0,E),this}validateSchema(_,A){if(typeof _=="boolean")return!0;let E;if(E=_.$schema,E!==void 0&&typeof E!="string")throw new Error("$schema must be a string");if(E=E||this.opts.defaultMeta||this.defaultMeta(),!E)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(E,_);if(!w&&A){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return w}getSchema(_){let A;for(;typeof(A=C.call(this,_))=="string";)_=A;if(A===void 0){const{schemaId:E}=this.opts,w=new s.SchemaEnv({schema:{},schemaId:E});if(A=s.resolveSchema.call(this,w,_),!A)return;this.refs[_]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(_){if(_ instanceof RegExp)return this._removeAllSchemas(this.schemas,_),this._removeAllSchemas(this.refs,_),this;switch(typeof _){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const A=C.call(this,_);return typeof A=="object"&&this._cache.delete(A.schema),delete this.schemas[_],delete this.refs[_],this}case"object":{const A=_;this._cache.delete(A);let E=_[this.opts.schemaId];return E&&(E=(0,l.normalizeId)(E),delete this.schemas[E],delete this.refs[E]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(_){for(const A of _)this.addKeyword(A);return this}addKeyword(_,A){let E;if(typeof _=="string")E=_,typeof A=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=E);else if(typeof _=="object"&&A===void 0){if(A=_,E=A.keyword,Array.isArray(E)&&!E.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(U.call(this,E,A),!A)return(0,f.eachItem)(E,k=>D.call(this,k)),this;ee.call(this,A);const w={...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)};return(0,f.eachItem)(E,w.type.length===0?k=>D.call(this,k,w):k=>w.type.forEach(N=>D.call(this,k,w,N))),this}getKeyword(_){const A=this.RULES.all[_];return typeof A=="object"?A.definition:!!A}removeKeyword(_){const{RULES:A}=this;delete A.keywords[_],delete A.all[_];for(const E of A.rules){const w=E.rules.findIndex(k=>k.keyword===_);w>=0&&E.rules.splice(w,1)}return this}addFormat(_,A){return typeof A=="string"&&(A=new RegExp(A)),this.formats[_]=A,this}errorsText(_=this.errors,{separator:A=", ",dataVar:E="data"}={}){return!_||_.length===0?"No errors":_.map(w=>`${E}${w.instancePath} ${w.message}`).reduce((w,k)=>w+A+k)}$dataMetaSchema(_,A){const E=this.RULES.all;_=JSON.parse(JSON.stringify(_));for(const w of A){const k=w.split("/").slice(1);let N=_;for(const B of k)N=N[B];for(const B in E){const O=E[B];if(typeof O!="object")continue;const{$data:Y}=O.definition,ie=N[B];Y&&ie&&(N[B]=G(ie))}}return _}_removeAllSchemas(_,A){for(const E in _){const w=_[E];(!A||A.test(E))&&(typeof w=="string"?delete _[E]:w&&!w.meta&&(this._cache.delete(w.schema),delete _[E]))}}_addSchema(_,A,E,w=this.opts.validateSchema,k=this.opts.addUsedSchema){let N;const{schemaId:B}=this.opts;if(typeof _=="object")N=_[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof _!="boolean")throw new Error("schema must be object or boolean")}let O=this._cache.get(_);if(O!==void 0)return O;E=(0,l.normalizeId)(N||E);const Y=l.getSchemaRefs.call(this,_,E);return O=new s.SchemaEnv({schema:_,schemaId:B,meta:A,baseId:E,localRefs:Y}),this._cache.set(O.schema,O),k&&!E.startsWith("#")&&(E&&this._checkUnique(E),this.refs[E]=O),w&&this.validateSchema(_,!0),O}_checkUnique(_){if(this.schemas[_]||this.refs[_])throw new Error(`schema with key or id "${_}" already exists`)}_compileSchemaEnv(_){if(_.meta?this._compileMetaSchema(_):s.compileSchema.call(this,_),!_.validate)throw new Error("ajv implementation error");return _.validate}_compileMetaSchema(_){const A=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,_)}finally{this.opts=A}}}S.ValidationError=o.default,S.MissingRefError=r.default,e.default=S;function T(I,_,A,E="error"){for(const w in I){const k=w;k in _&&this.logger[E](`${A}: option ${w}. ${I[k]}`)}}function C(I){return I=(0,l.normalizeId)(I),this.schemas[I]||this.refs[I]}function $(){const I=this.opts.schemas;if(I)if(Array.isArray(I))this.addSchema(I);else for(const _ in I)this.addSchema(I[_],_)}function j(){for(const I in this.opts.formats){const _=this.opts.formats[I];_&&this.addFormat(I,_)}}function R(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const _ in I){const A=I[_];A.keyword||(A.keyword=_),this.addKeyword(A)}}function M(){const I={...this.opts};for(const _ of g)delete I[_];return I}const F={log(){},warn(){},error(){}};function V(I){if(I===!1)return F;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function U(I,_){const{RULES:A}=this;if((0,f.eachItem)(I,E=>{if(A.keywords[E])throw new Error(`Keyword ${E} is already defined`);if(!L.test(E))throw new Error(`Keyword ${E} has invalid name`)}),!!_&&_.$data&&!("code"in _||"validate"in _))throw new Error('$data keyword must have "code" or "validate" function')}function D(I,_,A){var E;const w=_==null?void 0:_.post;if(A&&w)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let N=w?k.post:k.rules.find(({type:O})=>O===A);if(N||(N={type:A,rules:[]},k.rules.push(N)),k.keywords[I]=!0,!_)return;const B={keyword:I,definition:{..._,type:(0,c.getJSONTypes)(_.type),schemaType:(0,c.getJSONTypes)(_.schemaType)}};_.before?Q.call(this,N,B,_.before):N.rules.push(B),k.all[I]=B,(E=_.implements)===null||E===void 0||E.forEach(O=>this.addKeyword(O))}function Q(I,_,A){const E=I.rules.findIndex(w=>w.keyword===A);E>=0?I.rules.splice(E,0,_):(I.rules.push(_),this.logger.warn(`rule ${A} is not defined`))}function ee(I){let{metaSchema:_}=I;_!==void 0&&(I.$data&&this.opts.$data&&(_=G(_)),I.validateSchema=this.compile(_,!0))}const q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function G(I){return{anyOf:[I,q]}}})(Ev);var up={},pp={},fp={};Object.defineProperty(fp,"__esModule",{value:!0});const TT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fp.default=TT;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.callRef=zn.getValidate=void 0;const _T=Yr,Km=ye,Tt=ue,sr=Dt,Gm=xt,Ys=J,jT={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:r,schemaEnv:i,validateName:s,opts:a,self:l}=o,{root:c}=i;if((n==="#"||n==="#/")&&r===c.baseId)return m();const f=Gm.resolveRef.call(l,c,r,n);if(f===void 0)throw new _T.default(o.opts.uriResolver,r,n);if(f instanceof Gm.SchemaEnv)return h(f);return y(f);function m(){if(i===c)return xa(e,s,i,i.$async);const g=t.scopeValue("root",{ref:c});return xa(e,(0,Tt._)`${g}.validate`,c,c.$async)}function h(g){const b=kb(e,g);xa(e,b,g,g.$async)}function y(g){const b=t.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,Tt.stringify)(g)}:{ref:g}),v=t.name("valid"),u=e.subschema({schema:g,dataTypes:[],schemaPath:Tt.nil,topSchemaRef:b,errSchemaPath:n},v);e.mergeEvaluated(u),e.ok(v)}}};function kb(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,Tt._)`${n.scopeValue("wrapper",{ref:t})}.validate`}zn.getValidate=kb;function xa(e,t,n,o){const{gen:r,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,c=l.passContext?sr.default.this:Tt.nil;o?f():m();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");const g=r.let("valid");r.try(()=>{r.code((0,Tt._)`await ${(0,Km.callValidateCode)(e,t,c)}`),y(t),s||r.assign(g,!0)},b=>{r.if((0,Tt._)`!(${b} instanceof ${i.ValidationError})`,()=>r.throw(b)),h(b),s||r.assign(g,!1)}),e.ok(g)}function m(){e.result((0,Km.callValidateCode)(e,t,c),()=>y(t),()=>h(t))}function h(g){const b=(0,Tt._)`${g}.errors`;r.assign(sr.default.vErrors,(0,Tt._)`${sr.default.vErrors} === null ? ${b} : ${sr.default.vErrors}.concat(${b})`),r.assign(sr.default.errors,(0,Tt._)`${sr.default.vErrors}.length`)}function y(g){var b;if(!i.opts.unevaluated)return;const v=(b=n==null?void 0:n.validate)===null||b===void 0?void 0:b.evaluated;if(i.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(i.props=Ys.mergeEvaluated.props(r,v.props,i.props));else{const u=r.var("props",(0,Tt._)`${g}.evaluated.props`);i.props=Ys.mergeEvaluated.props(r,u,i.props,Tt.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=Ys.mergeEvaluated.items(r,v.items,i.items));else{const u=r.var("items",(0,Tt._)`${g}.evaluated.items`);i.items=Ys.mergeEvaluated.items(r,u,i.items,Tt.Name)}}}zn.callRef=xa;zn.default=jT;Object.defineProperty(pp,"__esModule",{value:!0});const NT=fp,CT=zn,ET=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",NT.default,CT.default];pp.default=ET;var mp={},hp={};Object.defineProperty(hp,"__esModule",{value:!0});const rl=ue,Gn=rl.operators,il={maximum:{okStr:"<=",ok:Gn.LTE,fail:Gn.GT},minimum:{okStr:">=",ok:Gn.GTE,fail:Gn.LT},exclusiveMaximum:{okStr:"<",ok:Gn.LT,fail:Gn.GTE},exclusiveMinimum:{okStr:">",ok:Gn.GT,fail:Gn.LTE}},PT={message:({keyword:e,schemaCode:t})=>(0,rl.str)`must be ${il[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,rl._)`{comparison: ${il[e].okStr}, limit: ${t}}`},IT={keyword:Object.keys(il),type:"number",schemaType:"number",$data:!0,error:PT,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data((0,rl._)`${n} ${il[t].fail} ${o} || isNaN(${n})`)}};hp.default=IT;var yp={};Object.defineProperty(yp,"__esModule",{value:!0});const Li=ue,OT={message:({schemaCode:e})=>(0,Li.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Li._)`{multipleOf: ${e}}`},RT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:OT,code(e){const{gen:t,data:n,schemaCode:o,it:r}=e,i=r.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Li._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Li._)`${s} !== parseInt(${s})`;e.fail$data((0,Li._)`(${o} === 0 || (${s} = ${n}/${o}, ${a}))`)}};yp.default=RT;var gp={},vp={};Object.defineProperty(vp,"__esModule",{value:!0});function Tb(e){const t=e.length;let n=0,o=0,r;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),(r&64512)===56320&&o++);return n}vp.default=Tb;Tb.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(gp,"__esModule",{value:!0});const Io=ue,AT=J,MT=vp,qT={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,Io.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,Io._)`{limit: ${e}}`},UT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qT,code(e){const{keyword:t,data:n,schemaCode:o,it:r}=e,i=t==="maxLength"?Io.operators.GT:Io.operators.LT,s=r.opts.unicode===!1?(0,Io._)`${n}.length`:(0,Io._)`${(0,AT.useFunc)(e.gen,MT.default)}(${n})`;e.fail$data((0,Io._)`${s} ${i} ${o}`)}};gp.default=UT;var bp={};Object.defineProperty(bp,"__esModule",{value:!0});const LT=ye,DT=J,kr=ue,zT={message:({schemaCode:e})=>(0,kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,kr._)`{pattern: ${e}}`},FT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:zT,code(e){const{gen:t,data:n,$data:o,schema:r,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(o){const{regExp:l}=s.opts.code,c=l.code==="new RegExp"?(0,kr._)`new RegExp`:(0,DT.useFunc)(t,l),f=t.let("valid");t.try(()=>t.assign(f,(0,kr._)`${c}(${i}, ${a}).test(${n})`),()=>t.assign(f,!1)),e.fail$data((0,kr._)`!${f}`)}else{const l=(0,LT.usePattern)(e,r);e.fail$data((0,kr._)`!${l}.test(${n})`)}}};bp.default=FT;var xp={};Object.defineProperty(xp,"__esModule",{value:!0});const Di=ue,BT={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,Di.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,Di._)`{limit: ${e}}`},HT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:BT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxProperties"?Di.operators.GT:Di.operators.LT;e.fail$data((0,Di._)`Object.keys(${n}).length ${r} ${o}`)}};xp.default=HT;var wp={};Object.defineProperty(wp,"__esModule",{value:!0});const yi=ye,zi=ue,VT=J,WT={message:({params:{missingProperty:e}})=>(0,zi.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,zi._)`{missingProperty: ${e}}`},KT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:WT,code(e){const{gen:t,schema:n,schemaCode:o,data:r,$data:i,it:s}=e,{opts:a}=s;if(!i&&n.length===0)return;const l=n.length>=a.loopRequired;if(s.allErrors?c():f(),a.strictRequired){const y=e.parentSchema.properties,{definedProperties:g}=e.it;for(const b of n)if((y==null?void 0:y[b])===void 0&&!g.has(b)){const v=s.schemaEnv.baseId+s.errSchemaPath,u=`required property "${b}" is not defined at "${v}" (strictRequired)`;(0,VT.checkStrictMode)(s,u,s.opts.strictRequired)}}function c(){if(l||i)e.block$data(zi.nil,m);else for(const y of n)(0,yi.checkReportMissingProp)(e,y)}function f(){const y=t.let("missing");if(l||i){const g=t.let("valid",!0);e.block$data(g,()=>h(y,g)),e.ok(g)}else t.if((0,yi.checkMissingProp)(e,n,y)),(0,yi.reportMissingProp)(e,y),t.else()}function m(){t.forOf("prop",o,y=>{e.setParams({missingProperty:y}),t.if((0,yi.noPropertyInData)(t,r,y,a.ownProperties),()=>e.error())})}function h(y,g){e.setParams({missingProperty:y}),t.forOf(y,o,()=>{t.assign(g,(0,yi.propertyInData)(t,r,y,a.ownProperties)),t.if((0,zi.not)(g),()=>{e.error(),t.break()})},zi.nil)}}};wp.default=KT;var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});const Fi=ue,GT={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,Fi.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,Fi._)`{limit: ${e}}`},JT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:GT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxItems"?Fi.operators.GT:Fi.operators.LT;e.fail$data((0,Fi._)`${n}.length ${r} ${o}`)}};Sp.default=JT;var $p={},Es={};Object.defineProperty(Es,"__esModule",{value:!0});const _b=Wv;_b.code='require("ajv/dist/runtime/equal").default';Es.default=_b;Object.defineProperty($p,"__esModule",{value:!0});const xc=et,it=ue,QT=J,YT=Es,XT={message:({params:{i:e,j:t}})=>(0,it.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,it._)`{i: ${e}, j: ${t}}`},ZT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:XT,code(e){const{gen:t,data:n,$data:o,schema:r,parentSchema:i,schemaCode:s,it:a}=e;if(!o&&!r)return;const l=t.let("valid"),c=i.items?(0,xc.getSchemaTypes)(i.items):[];e.block$data(l,f,(0,it._)`${s} === false`),e.ok(l);function f(){const g=t.let("i",(0,it._)`${n}.length`),b=t.let("j");e.setParams({i:g,j:b}),t.assign(l,!0),t.if((0,it._)`${g} > 1`,()=>(m()?h:y)(g,b))}function m(){return c.length>0&&!c.some(g=>g==="object"||g==="array")}function h(g,b){const v=t.name("item"),u=(0,xc.checkDataTypes)(c,v,a.opts.strictNumbers,xc.DataType.Wrong),p=t.const("indices",(0,it._)`{}`);t.for((0,it._)`;${g}--;`,()=>{t.let(v,(0,it._)`${n}[${g}]`),t.if(u,(0,it._)`continue`),c.length>1&&t.if((0,it._)`typeof ${v} == "string"`,(0,it._)`${v} += "_"`),t.if((0,it._)`typeof ${p}[${v}] == "number"`,()=>{t.assign(b,(0,it._)`${p}[${v}]`),e.error(),t.assign(l,!1).break()}).code((0,it._)`${p}[${v}] = ${g}`)})}function y(g,b){const v=(0,QT.useFunc)(t,YT.default),u=t.name("outer");t.label(u).for((0,it._)`;${g}--;`,()=>t.for((0,it._)`${b} = ${g}; ${b}--;`,()=>t.if((0,it._)`${v}(${n}[${g}], ${n}[${b}])`,()=>{e.error(),t.assign(l,!1).break(u)})))}}};$p.default=ZT;var kp={};Object.defineProperty(kp,"__esModule",{value:!0});const qd=ue,e1=J,t1=Es,n1={message:"must be equal to constant",params:({schemaCode:e})=>(0,qd._)`{allowedValue: ${e}}`},o1={keyword:"const",$data:!0,error:n1,code(e){const{gen:t,data:n,$data:o,schemaCode:r,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,qd._)`!${(0,e1.useFunc)(t,t1.default)}(${n}, ${r})`):e.fail((0,qd._)`${i} !== ${n}`)}};kp.default=o1;var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});const ji=ue,r1=J,i1=Es,s1={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ji._)`{allowedValues: ${e}}`},a1={keyword:"enum",schemaType:"array",$data:!0,error:s1,code(e){const{gen:t,data:n,$data:o,schema:r,schemaCode:i,it:s}=e;if(!o&&r.length===0)throw new Error("enum must have non-empty array");const a=r.length>=s.opts.loopEnum;let l;const c=()=>l??(l=(0,r1.useFunc)(t,i1.default));let f;if(a||o)f=t.let("valid"),e.block$data(f,m);else{if(!Array.isArray(r))throw new Error("ajv implementation error");const y=t.const("vSchema",i);f=(0,ji.or)(...r.map((g,b)=>h(y,b)))}e.pass(f);function m(){t.assign(f,!1),t.forOf("v",i,y=>t.if((0,ji._)`${c()}(${n}, ${y})`,()=>t.assign(f,!0).break()))}function h(y,g){const b=r[g];return typeof b=="object"&&b!==null?(0,ji._)`${c()}(${n}, ${y}[${g}])`:(0,ji._)`${n} === ${b}`}}};Tp.default=a1;Object.defineProperty(mp,"__esModule",{value:!0});const l1=hp,c1=yp,d1=gp,u1=bp,p1=xp,f1=wp,m1=Sp,h1=$p,y1=kp,g1=Tp,v1=[l1.default,c1.default,d1.default,u1.default,p1.default,f1.default,m1.default,h1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},y1.default,g1.default];mp.default=v1;var _p={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.validateAdditionalItems=void 0;const Oo=ue,Ud=J,b1={message:({params:{len:e}})=>(0,Oo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Oo._)`{limit: ${e}}`},x1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:b1,code(e){const{parentSchema:t,it:n}=e,{items:o}=t;if(!Array.isArray(o)){(0,Ud.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}jb(e,o)}};function jb(e,t){const{gen:n,schema:o,data:r,keyword:i,it:s}=e;s.items=!0;const a=n.const("len",(0,Oo._)`${r}.length`);if(o===!1)e.setParams({len:t.length}),e.pass((0,Oo._)`${a} <= ${t.length}`);else if(typeof o=="object"&&!(0,Ud.alwaysValidSchema)(s,o)){const c=n.var("valid",(0,Oo._)`${a} <= ${t.length}`);n.if((0,Oo.not)(c),()=>l(c)),e.ok(c)}function l(c){n.forRange("i",t.length,a,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:Ud.Type.Num},c),s.allErrors||n.if((0,Oo.not)(c),()=>n.break())})}}Xr.validateAdditionalItems=jb;Xr.default=x1;var jp={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateTuple=void 0;const Jm=ue,wa=J,w1=ye,S1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return Nb(e,"additionalItems",t);n.items=!0,!(0,wa.alwaysValidSchema)(n,t)&&e.ok((0,w1.validateArray)(e))}};function Nb(e,t,n=e.schema){const{gen:o,parentSchema:r,data:i,keyword:s,it:a}=e;f(r),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=wa.mergeEvaluated.items(o,n.length,a.items));const l=o.name("valid"),c=o.const("len",(0,Jm._)`${i}.length`);n.forEach((m,h)=>{(0,wa.alwaysValidSchema)(a,m)||(o.if((0,Jm._)`${c} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function f(m){const{opts:h,errSchemaPath:y}=a,g=n.length,b=g===m.minItems&&(g===m.maxItems||m[t]===!1);if(h.strictTuples&&!b){const v=`"${s}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${y}"`;(0,wa.checkStrictMode)(a,v,h.strictTuples)}}}Zr.validateTuple=Nb;Zr.default=S1;Object.defineProperty(jp,"__esModule",{value:!0});const $1=Zr,k1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,$1.validateTuple)(e,"items")};jp.default=k1;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});const Qm=ue,T1=J,_1=ye,j1=Xr,N1={message:({params:{len:e}})=>(0,Qm.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Qm._)`{limit: ${e}}`},C1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:N1,code(e){const{schema:t,parentSchema:n,it:o}=e,{prefixItems:r}=n;o.items=!0,!(0,T1.alwaysValidSchema)(o,t)&&(r?(0,j1.validateAdditionalItems)(e,r):e.ok((0,_1.validateArray)(e)))}};Np.default=C1;var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});const zt=ue,Xs=J,E1={message:({params:{min:e,max:t}})=>t===void 0?(0,zt.str)`must contain at least ${e} valid item(s)`:(0,zt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,zt._)`{minContains: ${e}}`:(0,zt._)`{minContains: ${e}, maxContains: ${t}}`},P1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:E1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;let s,a;const{minContains:l,maxContains:c}=o;i.opts.next?(s=l===void 0?1:l,a=c):s=1;const f=t.const("len",(0,zt._)`${r}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Xs.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Xs.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Xs.alwaysValidSchema)(i,n)){let b=(0,zt._)`${f} >= ${s}`;a!==void 0&&(b=(0,zt._)`${b} && ${f} <= ${a}`),e.pass(b);return}i.items=!0;const m=t.name("valid");a===void 0&&s===1?y(m,()=>t.if(m,()=>t.break())):s===0?(t.let(m,!0),a!==void 0&&t.if((0,zt._)`${r}.length > 0`,h)):(t.let(m,!1),h()),e.result(m,()=>e.reset());function h(){const b=t.name("_valid"),v=t.let("count",0);y(b,()=>t.if(b,()=>g(v)))}function y(b,v){t.forRange("i",0,f,u=>{e.subschema({keyword:"contains",dataProp:u,dataPropType:Xs.Type.Num,compositeRule:!0},b),v()})}function g(b){t.code((0,zt._)`${b}++`),a===void 0?t.if((0,zt._)`${b} >= ${s}`,()=>t.assign(m,!0).break()):(t.if((0,zt._)`${b} > ${a}`,()=>t.assign(m,!1).break()),s===1?t.assign(m,!0):t.if((0,zt._)`${b} >= ${s}`,()=>t.assign(m,!0)))}}};Cp.default=P1;var Rl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ue,n=J,o=ye;e.error={message:({params:{property:l,depsCount:c,deps:f}})=>{const m=c===1?"property":"properties";return(0,t.str)`must have ${m} ${f} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:f,missingProperty:m}})=>(0,t._)`{property: ${l},
|
|
1763
1763
|
missingProperty: ${m},
|
|
1764
1764
|
depsCount: ${c},
|
|
1765
|
-
deps: ${f}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[c,f]=i(l);s(l,c),a(l,f)}};function i({schema:l}){const c={},f={};for(const m in l){if(m==="__proto__")continue;const h=Array.isArray(l[m])?c:f;h[m]=l[m]}return[c,f]}function s(l,c=l.schema){const{gen:f,data:m,it:h}=l;if(Object.keys(c).length===0)return;const y=f.let("missing");for(const g in c){const b=c[g];if(b.length===0)continue;const v=(0,o.propertyInData)(f,m,g,h.opts.ownProperties);l.setParams({property:g,depsCount:b.length,deps:b.join(", ")}),h.allErrors?f.if(v,()=>{for(const p of b)(0,o.checkReportMissingProp)(l,p)}):(f.if((0,t._)`${v} && (${(0,o.checkMissingProp)(l,b,y)})`),(0,o.reportMissingProp)(l,y),f.else())}}e.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:f,data:m,keyword:h,it:y}=l,g=f.name("valid");for(const b in c)(0,n.alwaysValidSchema)(y,c[b])||(f.if((0,o.propertyInData)(f,m,b,y.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:b},g);l.mergeValidEvaluated(v,g)},()=>f.var(g,!0)),l.ok(g))}e.validateSchemaDeps=a,e.default=r})(El);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});const $b=ue,k1=J,T1={message:"property name must be valid",params:({params:e})=>(0,$b._)`{propertyName: ${e.propertyName}}`},_1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:T1,code(e){const{gen:t,schema:n,data:o,it:r}=e;if((0,k1.alwaysValidSchema)(r,n))return;const i=t.name("valid");t.forIn("key",o,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,$b.not)(i),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(i)}};kp.default=_1;var Pl={};Object.defineProperty(Pl,"__esModule",{value:!0});const Ys=ye,Zt=ue,j1=Lt,Xs=J,C1={message:"must NOT have additional properties",params:({params:e})=>(0,Zt._)`{additionalProperty: ${e.additionalProperty}}`},N1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:C1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,Xs.alwaysValidSchema)(s,n))return;const c=(0,Ys.allSchemaProperties)(o.properties),f=(0,Ys.allSchemaProperties)(o.patternProperties);m(),e.ok((0,Zt._)`${i} === ${j1.default.errors}`);function m(){t.forIn("key",r,v=>{!c.length&&!f.length?g(v):t.if(h(v),()=>g(v))})}function h(v){let p;if(c.length>8){const u=(0,Xs.schemaRefOrVal)(s,o.properties,"properties");p=(0,Ys.isOwnProperty)(t,u,v)}else c.length?p=(0,Zt.or)(...c.map(u=>(0,Zt._)`${v} === ${u}`)):p=Zt.nil;return f.length&&(p=(0,Zt.or)(p,...f.map(u=>(0,Zt._)`${(0,Ys.usePattern)(e,u)}.test(${v})`))),(0,Zt.not)(p)}function y(v){t.code((0,Zt._)`delete ${r}[${v}]`)}function g(v){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){y(v);return}if(n===!1){e.setParams({additionalProperty:v}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,Xs.alwaysValidSchema)(s,n)){const p=t.name("valid");l.removeAdditional==="failing"?(b(v,p,!1),t.if((0,Zt.not)(p),()=>{e.reset(),y(v)})):(b(v,p),a||t.if((0,Zt.not)(p),()=>t.break()))}}function b(v,p,u){const x={keyword:"additionalProperties",dataProp:v,dataPropType:Xs.Type.Str};u===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,p)}}};Pl.default=N1;var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});const E1=an,Hm=ye,gc=J,Vm=Pl,P1={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&Vm.default.code(new E1.KeywordCxt(i,Vm.default,"additionalProperties"));const s=(0,Hm.allSchemaProperties)(n);for(const m of s)i.definedProperties.add(m);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=gc.mergeEvaluated.props(t,(0,gc.toHash)(s),i.props));const a=s.filter(m=>!(0,gc.alwaysValidSchema)(i,n[m]));if(a.length===0)return;const l=t.name("valid");for(const m of a)c(m)?f(m):(t.if((0,Hm.propertyInData)(t,r,m,i.opts.ownProperties)),f(m),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(l);function c(m){return i.opts.useDefaults&&!i.compositeRule&&n[m].default!==void 0}function f(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},l)}}};Tp.default=P1;var _p={};Object.defineProperty(_p,"__esModule",{value:!0});const Wm=ye,Zs=ue,Km=J,Gm=J,I1={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:o,parentSchema:r,it:i}=e,{opts:s}=i,a=(0,Wm.allSchemaProperties)(n),l=a.filter(b=>(0,Km.alwaysValidSchema)(i,n[b]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const c=s.strictSchema&&!s.allowMatchingProperties&&r.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof Zs.Name)&&(i.props=(0,Gm.evaluatedPropsToName)(t,i.props));const{props:m}=i;h();function h(){for(const b of a)c&&y(b),i.allErrors?g(b):(t.var(f,!0),g(b),t.if(f))}function y(b){for(const v in c)new RegExp(b).test(v)&&(0,Km.checkStrictMode)(i,`property ${v} matches pattern ${b} (use allowMatchingProperties)`)}function g(b){t.forIn("key",o,v=>{t.if((0,Zs._)`${(0,Wm.usePattern)(e,b)}.test(${v})`,()=>{const p=l.includes(b);p||e.subschema({keyword:"patternProperties",schemaProp:b,dataProp:v,dataPropType:Gm.Type.Str},f),i.opts.unevaluated&&m!==!0?t.assign((0,Zs._)`${m}[${v}]`,!0):!p&&!i.allErrors&&t.if((0,Zs.not)(f),()=>t.break())})})}}};_p.default=I1;var jp={};Object.defineProperty(jp,"__esModule",{value:!0});const O1=J,R1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,O1.alwaysValidSchema)(o,n)){e.fail();return}const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};jp.default=R1;var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});const A1=ye,M1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:A1.validateUnion,error:{message:"must match a schema in anyOf"}};Cp.default=M1;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});const xa=ue,q1=J,U1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,xa._)`{passingSchemas: ${e.passing}}`},L1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:U1,code(e){const{gen:t,schema:n,parentSchema:o,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&o.discriminator)return;const i=n,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(s,()=>e.reset(),()=>e.error(!0));function c(){i.forEach((f,m)=>{let h;(0,q1.alwaysValidSchema)(r,f)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},l),m>0&&t.if((0,xa._)`${l} && ${s}`).assign(s,!1).assign(a,(0,xa._)`[${a}, ${m}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,m),h&&e.mergeEvaluated(h,xa.Name)})})}}};Np.default=L1;var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});const D1=J,z1={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach((i,s)=>{if((0,D1.alwaysValidSchema)(o,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},r);e.ok(r),e.mergeEvaluated(a)})}};Ep.default=z1;var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});const nl=ue,kb=J,F1={message:({params:e})=>(0,nl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,nl._)`{failingKeyword: ${e.ifClause}}`},B1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:F1,code(e){const{gen:t,parentSchema:n,it:o}=e;n.then===void 0&&n.else===void 0&&(0,kb.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const r=Jm(o,"then"),i=Jm(o,"else");if(!r&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),r&&i){const f=t.let("ifClause");e.setParams({ifClause:f}),t.if(a,c("then",f),c("else",f))}else r?t.if(a,c("then")):t.if((0,nl.not)(a),c("else"));e.pass(s,()=>e.error(!0));function l(){const f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(f)}function c(f,m){return()=>{const h=e.subschema({keyword:f},a);t.assign(s,a),e.mergeValidEvaluated(h,s),m?t.assign(m,(0,nl._)`${f}`):e.setParams({ifClause:f})}}}};function Jm(e,t){const n=e.schema[t];return n!==void 0&&!(0,kb.alwaysValidSchema)(e,n)}Pp.default=B1;var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});const H1=J,V1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,H1.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Ip.default=V1;Object.defineProperty(xp,"__esModule",{value:!0});const W1=Qr,K1=wp,G1=Yr,J1=Sp,Q1=$p,Y1=El,X1=kp,Z1=Pl,e_=Tp,t_=_p,n_=jp,o_=Cp,r_=Np,i_=Ep,s_=Pp,a_=Ip;function l_(e=!1){const t=[n_.default,o_.default,r_.default,i_.default,s_.default,a_.default,X1.default,Z1.default,Y1.default,e_.default,t_.default];return e?t.push(K1.default,J1.default):t.push(W1.default,G1.default),t.push(Q1.default),t}xp.default=l_;var Op={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.dynamicAnchor=void 0;const vc=ue,c_=Lt,Qm=bt,d_=Dn,u_={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Tb(e,e.schema)};function Tb(e,t){const{gen:n,it:o}=e;o.schemaEnv.root.dynamicAnchors[t]=!0;const r=(0,vc._)`${c_.default.dynamicAnchors}${(0,vc.getProperty)(t)}`,i=o.errSchemaPath==="#"?o.validateName:p_(e);n.if((0,vc._)`!${r}`,()=>n.assign(r,i))}Xr.dynamicAnchor=Tb;function p_(e){const{schemaEnv:t,schema:n,self:o}=e.it,{root:r,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=o.opts,c=new Qm.SchemaEnv({schema:n,schemaId:l,root:r,baseId:i,localRefs:s,meta:a});return Qm.compileSchema.call(o,c),(0,d_.getValidate)(e,c)}Xr.default=u_;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.dynamicRef=void 0;const Ym=ue,f_=Lt,Xm=Dn,m_={keyword:"$dynamicRef",schemaType:"string",code:e=>_b(e,e.schema)};function _b(e,t){const{gen:n,keyword:o,it:r}=e;if(t[0]!=="#")throw new Error(`"${o}" only supports hash fragment reference`);const i=t.slice(1);if(r.allErrors)s();else{const l=n.let("valid",!1);s(l),e.ok(l)}function s(l){if(r.schemaEnv.root.dynamicAnchors[i]){const c=n.let("_v",(0,Ym._)`${f_.default.dynamicAnchors}${(0,Ym.getProperty)(i)}`);n.if(c,a(c,l),a(r.validateName,l))}else a(r.validateName,l)()}function a(l,c){return c?()=>n.block(()=>{(0,Xm.callRef)(e,l),n.let(c,!0)}):()=>(0,Xm.callRef)(e,l)}}Zr.dynamicRef=_b;Zr.default=m_;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});const h_=Xr,y_=J,g_={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,h_.dynamicAnchor)(e,""):(0,y_.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Rp.default=g_;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});const v_=Zr,b_={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,v_.dynamicRef)(e,e.schema)};Ap.default=b_;Object.defineProperty(Op,"__esModule",{value:!0});const x_=Xr,w_=Zr,S_=Rp,$_=Ap,k_=[x_.default,w_.default,S_.default,$_.default];Op.default=k_;var Mp={},qp={};Object.defineProperty(qp,"__esModule",{value:!0});const Zm=El,T_={keyword:"dependentRequired",type:"object",schemaType:"object",error:Zm.error,code:e=>(0,Zm.validatePropertyDeps)(e)};qp.default=T_;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});const __=El,j_={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,__.validateSchemaDeps)(e)};Up.default=j_;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});const C_=J,N_={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,C_.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Lp.default=N_;Object.defineProperty(Mp,"__esModule",{value:!0});const E_=qp,P_=Up,I_=Lp,O_=[E_.default,P_.default,I_.default];Mp.default=O_;var Dp={},zp={};Object.defineProperty(zp,"__esModule",{value:!0});const Yn=ue,eh=J,R_=Lt,A_={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Yn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},M_={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:A_,code(e){const{gen:t,schema:n,data:o,errsCount:r,it:i}=e;if(!r)throw new Error("ajv implementation error");const{allErrors:s,props:a}=i;a instanceof Yn.Name?t.if((0,Yn._)`${a} !== true`,()=>t.forIn("key",o,m=>t.if(c(a,m),()=>l(m)))):a!==!0&&t.forIn("key",o,m=>a===void 0?l(m):t.if(f(a,m),()=>l(m))),i.props=!0,e.ok((0,Yn._)`${r} === ${R_.default.errors}`);function l(m){if(n===!1){e.setParams({unevaluatedProperty:m}),e.error(),s||t.break();return}if(!(0,eh.alwaysValidSchema)(i,n)){const h=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:eh.Type.Str},h),s||t.if((0,Yn.not)(h),()=>t.break())}}function c(m,h){return(0,Yn._)`!${m} || !${m}[${h}]`}function f(m,h){const y=[];for(const g in m)m[g]===!0&&y.push((0,Yn._)`${h} !== ${g}`);return(0,Yn.and)(...y)}}};zp.default=M_;var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});const Oo=ue,th=J,q_={message:({params:{len:e}})=>(0,Oo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Oo._)`{limit: ${e}}`},U_={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:q_,code(e){const{gen:t,schema:n,data:o,it:r}=e,i=r.items||0;if(i===!0)return;const s=t.const("len",(0,Oo._)`${o}.length`);if(n===!1)e.setParams({len:i}),e.fail((0,Oo._)`${s} > ${i}`);else if(typeof n=="object"&&!(0,th.alwaysValidSchema)(r,n)){const l=t.var("valid",(0,Oo._)`${s} <= ${i}`);t.if((0,Oo.not)(l),()=>a(l,i)),e.ok(l)}r.items=!0;function a(l,c){t.forRange("i",c,s,f=>{e.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:th.Type.Num},l),r.allErrors||t.if((0,Oo.not)(l),()=>t.break())})}}};Fp.default=U_;Object.defineProperty(Dp,"__esModule",{value:!0});const L_=zp,D_=Fp,z_=[L_.default,D_.default];Dp.default=z_;var Bp={},Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});const We=ue,F_={message:({schemaCode:e})=>(0,We.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,We._)`{format: ${e}}`},B_={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:F_,code(e,t){const{gen:n,data:o,$data:r,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:c,schemaEnv:f,self:m}=a;if(!l.validateFormats)return;r?h():y();function h(){const g=n.scopeValue("formats",{ref:m.formats,code:l.code.formats}),b=n.const("fDef",(0,We._)`${g}[${s}]`),v=n.let("fType"),p=n.let("format");n.if((0,We._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>n.assign(v,(0,We._)`${b}.type || "string"`).assign(p,(0,We._)`${b}.validate`),()=>n.assign(v,(0,We._)`"string"`).assign(p,b)),e.fail$data((0,We.or)(u(),x()));function u(){return l.strictSchema===!1?We.nil:(0,We._)`${s} && !${p}`}function x(){const S=f.$async?(0,We._)`(${b}.async ? await ${p}(${o}) : ${p}(${o}))`:(0,We._)`${p}(${o})`,T=(0,We._)`(typeof ${p} == "function" ? ${S} : ${p}.test(${o}))`;return(0,We._)`${p} && ${p} !== true && ${v} === ${t} && !${T}`}}function y(){const g=m.formats[i];if(!g){u();return}if(g===!0)return;const[b,v,p]=x(g);b===t&&e.pass(S());function u(){if(l.strictSchema===!1){m.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${c}"`}}function x(T){const N=T instanceof RegExp?(0,We.regexpCode)(T):l.code.formats?(0,We._)`${l.code.formats}${(0,We.getProperty)(i)}`:void 0,$=n.scopeValue("formats",{key:i,ref:T,code:N});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,We._)`${$}.validate`]:["string",T,$]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!f.$async)throw new Error("async format in sync schema");return(0,We._)`await ${p}(${o})`}return typeof v=="function"?(0,We._)`${p}(${o})`:(0,We._)`${p}.test(${o})`}}}};Hp.default=B_;Object.defineProperty(Bp,"__esModule",{value:!0});const H_=Hp,V_=[H_.default];Bp.default=V_;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.contentVocabulary=Vr.metadataVocabulary=void 0;Vr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(ip,"__esModule",{value:!0});const W_=sp,K_=lp,G_=xp,J_=Op,Q_=Mp,Y_=Dp,X_=Bp,nh=Vr,Z_=[J_.default,W_.default,K_.default,(0,G_.default)(!0),X_.default,nh.metadataVocabulary,nh.contentVocabulary,Q_.default,Y_.default];ip.default=Z_;var Vp={},Il={};Object.defineProperty(Il,"__esModule",{value:!0});Il.DiscrError=void 0;var oh;(function(e){e.Tag="tag",e.Mapping="mapping"})(oh||(Il.DiscrError=oh={}));Object.defineProperty(Vp,"__esModule",{value:!0});const cr=ue,Rd=Il,rh=bt,ej=Jr,tj=J,nj={message:({params:{discrError:e,tagName:t}})=>e===Rd.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,cr._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},oj={keyword:"discriminator",type:"object",schemaType:"object",error:nj,code(e){const{gen:t,data:n,schema:o,parentSchema:r,it:i}=e,{oneOf:s}=r;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),c=t.const("tag",(0,cr._)`${n}${(0,cr.getProperty)(a)}`);t.if((0,cr._)`typeof ${c} == "string"`,()=>f(),()=>e.error(!1,{discrError:Rd.DiscrError.Tag,tag:c,tagName:a})),e.ok(l);function f(){const y=h();t.if(!1);for(const g in y)t.elseIf((0,cr._)`${c} === ${g}`),t.assign(l,m(y[g]));t.else(),e.error(!1,{discrError:Rd.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function m(y){const g=t.name("valid"),b=e.subschema({keyword:"oneOf",schemaProp:y},g);return e.mergeEvaluated(b,cr.Name),g}function h(){var y;const g={},b=p(r);let v=!0;for(let S=0;S<s.length;S++){let T=s[S];if(T!=null&&T.$ref&&!(0,tj.schemaHasRulesButRef)(T,i.self.RULES)){const $=T.$ref;if(T=rh.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,$),T instanceof rh.SchemaEnv&&(T=T.schema),T===void 0)throw new ej.default(i.opts.uriResolver,i.baseId,$)}const N=(y=T==null?void 0:T.properties)===null||y===void 0?void 0:y[a];if(typeof N!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(b||p(T)),u(N,S)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return g;function p({required:S}){return Array.isArray(S)&&S.includes(a)}function u(S,T){if(S.const)x(S.const,T);else if(S.enum)for(const N of S.enum)x(N,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(S,T){if(typeof S!="string"||S in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[S]=T}}}};Vp.default=oj;var Wp={};const rj="https://json-schema.org/draft/2020-12/schema",ij="https://json-schema.org/draft/2020-12/schema",sj={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},aj="meta",lj="Core and Validation specifications meta-schema",cj=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],dj=["object","boolean"],uj="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",pj={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},fj={$schema:rj,$id:ij,$vocabulary:sj,$dynamicAnchor:aj,title:lj,allOf:cj,type:dj,$comment:uj,properties:pj},mj="https://json-schema.org/draft/2020-12/schema",hj="https://json-schema.org/draft/2020-12/meta/applicator",yj={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},gj="meta",vj="Applicator vocabulary meta-schema",bj=["object","boolean"],xj={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},wj={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Sj={$schema:mj,$id:hj,$vocabulary:yj,$dynamicAnchor:gj,title:vj,type:bj,properties:xj,$defs:wj},$j="https://json-schema.org/draft/2020-12/schema",kj="https://json-schema.org/draft/2020-12/meta/unevaluated",Tj={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},_j="meta",jj="Unevaluated applicator vocabulary meta-schema",Cj=["object","boolean"],Nj={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},Ej={$schema:$j,$id:kj,$vocabulary:Tj,$dynamicAnchor:_j,title:jj,type:Cj,properties:Nj},Pj="https://json-schema.org/draft/2020-12/schema",Ij="https://json-schema.org/draft/2020-12/meta/content",Oj={"https://json-schema.org/draft/2020-12/vocab/content":!0},Rj="meta",Aj="Content vocabulary meta-schema",Mj=["object","boolean"],qj={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Uj={$schema:Pj,$id:Ij,$vocabulary:Oj,$dynamicAnchor:Rj,title:Aj,type:Mj,properties:qj},Lj="https://json-schema.org/draft/2020-12/schema",Dj="https://json-schema.org/draft/2020-12/meta/core",zj={"https://json-schema.org/draft/2020-12/vocab/core":!0},Fj="meta",Bj="Core vocabulary meta-schema",Hj=["object","boolean"],Vj={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Wj={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},Kj={$schema:Lj,$id:Dj,$vocabulary:zj,$dynamicAnchor:Fj,title:Bj,type:Hj,properties:Vj,$defs:Wj},Gj="https://json-schema.org/draft/2020-12/schema",Jj="https://json-schema.org/draft/2020-12/meta/format-annotation",Qj={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Yj="meta",Xj="Format vocabulary meta-schema for annotation results",Zj=["object","boolean"],eC={format:{type:"string"}},tC={$schema:Gj,$id:Jj,$vocabulary:Qj,$dynamicAnchor:Yj,title:Xj,type:Zj,properties:eC},nC="https://json-schema.org/draft/2020-12/schema",oC="https://json-schema.org/draft/2020-12/meta/meta-data",rC={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},iC="meta",sC="Meta-data vocabulary meta-schema",aC=["object","boolean"],lC={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},cC={$schema:nC,$id:oC,$vocabulary:rC,$dynamicAnchor:iC,title:sC,type:aC,properties:lC},dC="https://json-schema.org/draft/2020-12/schema",uC="https://json-schema.org/draft/2020-12/meta/validation",pC={"https://json-schema.org/draft/2020-12/vocab/validation":!0},fC="meta",mC="Validation vocabulary meta-schema",hC=["object","boolean"],yC={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},gC={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},vC={$schema:dC,$id:uC,$vocabulary:pC,$dynamicAnchor:fC,title:mC,type:hC,properties:yC,$defs:gC};Object.defineProperty(Wp,"__esModule",{value:!0});const bC=fj,xC=Sj,wC=Ej,SC=Uj,$C=Kj,kC=tC,TC=cC,_C=vC,jC=["/properties"];function CC(e){return[bC,xC,wC,SC,$C,t(this,kC),TC,t(this,_C)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,o){return e?n.$dataMetaSchema(o,jC):o}}Wp.default=CC;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=kv,o=ip,r=Vp,i=Wp,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(y={}){super({...y,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:y,meta:g}=this.opts;g&&(i.default.call(this,y),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var l=an;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=js;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=Jr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(jd,jd.exports);var NC=jd.exports;const EC=Hd(NC),ih=EC,PC=ih.default??ih,sh="acp";function IC(e){const t={path:e.instancePath||"/",message:e.message??"validation failed"};return e.keyword&&(t.keyword=e.keyword),t}function OC(e){const t=new PC({strict:!1,allErrors:!0,validateFormats:!1});t.addSchema(e,sh);const n=new Map,o=e.$defs??{};for(const[l,c]of Object.entries(o)){const f=c["x-method"];if(typeof f!="string")continue;let m=n.get(f);m||(m={},n.set(f,m)),l.endsWith("Request")?m.requestDef=l:l.endsWith("Response")?m.responseDef=l:l.endsWith("Notification")&&(m.notificationDef=l)}const r=new Map,i=l=>{const c=r.get(l);if(c)return c;const f=t.compile({$ref:`${sh}#/$defs/${l}`});return r.set(l,f),f};function s(l,c={}){if(!l.payload)return{valid:!0,errors:[],skipped:"parse-error"};if(l.kind==="unknown")return{valid:!0,errors:[],skipped:"wrong-kind"};const f=l.method??c.pairedMethod;if(!f)return{valid:!0,errors:[],skipped:"no-method"};const m=n.get(f);if(!m)return{valid:!0,errors:[],skipped:"unknown-method"};let h,y;const g=l.payload;if(l.kind==="request")h=m.requestDef,y=g.params;else if(l.kind==="notification")h=m.notificationDef,y=g.params;else if(l.kind==="response")h=m.responseDef,y=g.result;else return{valid:!0,errors:[],skipped:"wrong-kind"};if(!h)return{valid:!0,errors:[],skipped:"no-schema-for-kind"};const b=i(h);return b(y)?{valid:!0,errors:[],schemaName:h}:{valid:!1,errors:(b.errors??[]).map(IC),schemaName:h}}function a(){return[...n.keys()].sort()}return{validateAcpMessage:s,knownAcpMethods:a}}const RC=OC($v),AC=RC.validateAcpMessage;function Kp(e){const t=Tl(e),n=new Map;for(const r of e)r.method&&n.set(r.seq,r.method);const o=new Map;for(const r of e){const i=t.get(r.seq),s=i!==void 0?n.get(i):void 0,a={};s!==void 0&&(a.pairedMethod=s),o.set(r.seq,AC(r,a))}return o}function MC(e){let t=0,n=0,o=0;const r=new Set;for(const[,i]of e)if(!i.skipped&&(t+=1,!i.valid&&(n+=1,o+=i.errors.length,i.schemaName))){const s=i.schemaName.replace(/(Request|Response|Notification)$/,"");r.add(s)}return{checked:t,invalidFrames:n,totalErrors:o,affectedMethods:[...r].sort()}}const qC={"claude-code":{shortName:"claude-code",displayName:"Claude Code",description:"Anthropic Claude Code via @agentclientprotocol/claude-agent-acp",command:"npx",args:["-y","@agentclientprotocol/claude-agent-acp"],aliases:[["npx","-y","@zed-industries/claude-code-acp"]]},codex:{shortName:"codex",displayName:"Codex",description:"OpenAI Codex via @zed-industries/codex-acp",command:"npx",args:["-y","@zed-industries/codex-acp"]},goose:{shortName:"goose",displayName:"Goose",description:"Block Goose — install separately, then this runs `goose acp`",command:"goose",args:["acp"],requiresExternalInstall:!0},opencode:{shortName:"opencode",displayName:"OpenCode",description:"SST OpenCode — install via opencode.ai/install, then `opencode acp`",command:"opencode",args:["acp"],requiresExternalInstall:!0}};function UC(e){const t=e.trim();if(t.length===0)return null;for(const n of Object.values(qC)){const o=[[n.command,...n.args],...n.aliases??[]];for(const r of o){const i=r.join(" ");if(t===i||t.startsWith(i+" "))return n}}return null}function Ot(e){const t=UC(e);if(t)return t.displayName;const n=e.trim().split(/\s+/).filter(Boolean);if(n.length===0)return e;if(n[0]==="npx")for(let o=1;o<n.length;o++){const r=n[o];if(!r.startsWith("-"))return r}return n[0]==="node"&&n[1]?n[1].split("/").pop()??n[1]:n[0]}function Gp(e){const t=e.sessionDbId!==null?`#${e.sessionDbId}`:`pid ${e.pid}`;if(e.sessionName)return`${t} · ${e.sessionName}`;const n=Ot(e.agentCommand);return e.clientName?`${t} · ${e.clientName} · ${n}`:`${t} · ${n}`}function Ol(e){const t=e.id>0?`#${e.id}`:"ephemeral";if(e.name)return{primary:t,secondary:e.name};const n=Ot(e.agentCommand??""),o=e.clientName?`${e.clientName} · ${n}`:n;return{primary:t,secondary:o}}const LC={"editor-to-agent":"out","agent-to-editor":"in"},DC={out:"editor-to-agent",in:"agent-to-editor"},zC={request:"req",response:"rsp",notification:"ntf",error:"err",unknown:"unk"},FC={req:"request",rsp:"response",ntf:"notification",err:"error",unk:"unknown"},BC=["tree","raw","meta"];function ah(e){const t=new URLSearchParams(e),n={},o=t.get("dir");if(o!==null){const g=o.split(",").map(b=>b.trim()).filter(Boolean).map(b=>DC[b]).filter(b=>b!==void 0);g.length>0&&(n.directions=new Set(g))}const r=t.get("kind");if(r!==null){const g=r.split(",").map(b=>b.trim()).filter(Boolean).map(b=>FC[b]).filter(b=>b!==void 0);g.length>0&&(n.kinds=new Set(g))}t.get("streams")==="0"&&(n.showStreams=!1);const i=t.get("q");i!==null&&(n.search=i);const s=t.get("seq"),a=s!==null&&/^\d+$/.test(s)?Number(s):null,l=t.get("tab"),c=l!==null&&BC.includes(l)?l:null,f=t.get("play"),m=f!==null&&/^\d+$/.test(f)?Number(f):null,h=t.get("ws");return{filters:n,selectedSeq:a,detailTab:c,playbackCap:m,captureUrl:h}}const HC=["ws","dir","kind","streams","q","seq","tab","play"];function VC(e){const t=new URLSearchParams(window.location.search);for(const r of HC)t.delete(r);e.captureUrl&&t.set("ws",e.captureUrl),e.filters.directions.size<ss.length&&t.set("dir",[...e.filters.directions].map(r=>LC[r]).filter(Boolean).join(",")),e.filters.kinds.size<as.length&&t.set("kind",[...e.filters.kinds].map(r=>zC[r]).filter(Boolean).join(",")),e.filters.showStreams||t.set("streams","0"),e.filters.search&&t.set("q",e.filters.search),e.selectedSeq!==null&&t.set("seq",String(e.selectedSeq)),e.detailTab!=="tree"&&t.set("tab",e.detailTab),e.playbackCap!==null&&t.set("play",String(e.playbackCap));const n=t.toString(),o=`${window.location.pathname}${n?`?${n}`:""}${window.location.hash}`;o!==window.location.pathname+window.location.search+window.location.hash&&window.history.replaceState(window.history.state,"",o)}function jb(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=jb(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function WC(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=jb(e))&&(o&&(o+=" "),o+=t);return o}const Jp="-",KC=e=>{const t=JC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(Jp);return a[0]===""&&a.length!==1&&a.shift(),Cb(a,t)||GC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&o[s]?[...l,...o[s]]:l}}},Cb=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Cb(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Jp);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},lh=/^\[(.+)\]$/,GC=e=>{if(lh.test(e)){const t=lh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},JC=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return YC(Object.entries(e.classGroups),n).forEach(([i,s])=>{Ad(s,o,i,t)}),o},Ad=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:ch(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(QC(r)){Ad(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{Ad(s,ch(t,i),n,o)})})},ch=(e,t)=>{let n=e;return t.split(Jp).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},QC=e=>e.isThemeGetter,YC=(e,t)=>t?e.map(([n,o])=>{const r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,r]}):e,XC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},Nb="!",ZC=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,s=a=>{const l=[];let c=0,f=0,m;for(let v=0;v<a.length;v++){let p=a[v];if(c===0){if(p===r&&(o||a.slice(v,v+i)===t)){l.push(a.slice(f,v)),f=v+i;continue}if(p==="/"){m=v;continue}}p==="["?c++:p==="]"&&c--}const h=l.length===0?a:a.substring(f),y=h.startsWith(Nb),g=y?h.substring(1):h,b=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},eN=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},tN=e=>({cache:XC(e.cacheSize),parseClassName:ZC(e),...KC(e)}),nN=/\s+/,oN=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(nN);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:f,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:y}=n(c);let g=!!y,b=o(g?h.substring(0,y):h);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=o(h),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const v=eN(f).join(":"),p=m?v+Nb:v,u=p+b;if(i.includes(u))continue;i.push(u);const x=r(b,g);for(let S=0;S<x.length;++S){const T=x[S];i.push(p+T)}a=c+(a.length>0?" "+a:a)}return a};function rN(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Eb(t))&&(o&&(o+=" "),o+=n);return o}const Eb=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Eb(e[o]))&&(n&&(n+=" "),n+=t);return n};function iN(e,...t){let n,o,r,i=s;function s(l){const c=t.reduce((f,m)=>m(f),e());return n=tN(c),o=n.cache.get,r=n.cache.set,i=a,a(l)}function a(l){const c=o(l);if(c)return c;const f=oN(l,n);return r(l,f),f}return function(){return i(rN.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pb=/^\[(?:([a-z-]+):)?(.+)\]$/i,sN=/^\d+\/\d+$/,aN=new Set(["px","full","screen"]),lN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cN=/\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$/,dN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_n=e=>Ir(e)||aN.has(e)||sN.test(e),Gn=e=>ei(e,"length",xN),Ir=e=>!!e&&!Number.isNaN(Number(e)),bc=e=>ei(e,"number",Ir),hi=e=>!!e&&Number.isInteger(Number(e)),fN=e=>e.endsWith("%")&&Ir(e.slice(0,-1)),pe=e=>Pb.test(e),Jn=e=>lN.test(e),mN=new Set(["length","size","percentage"]),hN=e=>ei(e,mN,Ib),yN=e=>ei(e,"position",Ib),gN=new Set(["image","url"]),vN=e=>ei(e,gN,SN),bN=e=>ei(e,"",wN),yi=()=>!0,ei=(e,t,n)=>{const o=Pb.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},xN=e=>cN.test(e)&&!dN.test(e),Ib=()=>!1,wN=e=>uN.test(e),SN=e=>pN.test(e),$N=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),o=Ie("brightness"),r=Ie("borderColor"),i=Ie("borderRadius"),s=Ie("borderSpacing"),a=Ie("borderWidth"),l=Ie("contrast"),c=Ie("grayscale"),f=Ie("hueRotate"),m=Ie("invert"),h=Ie("gap"),y=Ie("gradientColorStops"),g=Ie("gradientColorStopPositions"),b=Ie("inset"),v=Ie("margin"),p=Ie("opacity"),u=Ie("padding"),x=Ie("saturate"),S=Ie("scale"),T=Ie("sepia"),N=Ie("skew"),$=Ie("space"),C=Ie("translate"),R=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",pe,t],H=()=>[pe,t],L=()=>["",_n,Gn],U=()=>["auto",Ir,pe],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",pe],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Ir,pe];return{cacheSize:500,separator:":",theme:{colors:[yi],spacing:[_n,Gn],blur:["none","",Jn,pe],brightness:j(),borderColor:[e],borderRadius:["none","","full",Jn,pe],borderSpacing:H(),borderWidth:L(),contrast:j(),grayscale:G(),hueRotate:j(),invert:G(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[fN,Gn],inset:F(),margin:F(),opacity:j(),padding:H(),saturate:j(),scale:j(),sepia:G(),skew:j(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[Jn]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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"],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:[...D(),pe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hi,pe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",hi,pe]}],"grid-cols":[{"grid-cols":[yi]}],"col-start-end":[{col:["auto",{span:["full",hi,pe]},pe]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[yi]}],"row-start-end":[{row:["auto",{span:[hi,pe]},pe]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[u]}],px:[{px:[u]}],py:[{py:[u]}],ps:[{ps:[u]}],pe:[{pe:[u]}],pt:[{pt:[u]}],pr:[{pr:[u]}],pb:[{pb:[u]}],pl:[{pl:[u]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[Jn]},Jn]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jn,Gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bc]}],"font-family":[{font:[yi]}],"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:["tighter","tight","normal","wide","wider","widest",pe]}],"line-clamp":[{"line-clamp":["none",Ir,bc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_n,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_n,Gn]}],"underline-offset":[{"underline-offset":["auto",_n,pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),yN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:Q()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[_n,pe]}],"outline-w":[{outline:[_n,Gn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[_n,Gn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jn,bN]}],"shadow-color":[{shadow:[yi]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Jn,pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[m]}],saturate:[{saturate:[x]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pe]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[hi,pe]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_n,Gn,bc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},kN=iN($N);function W(...e){return kN(WC(e))}const TN=1;function _N(e,t,n){return{version:TN,exportedAt:n.exportedAt??Date.now(),tool:{name:n.tool.name,version:n.tool.version},session:{id:e.id,name:e.name,agentCommand:e.agentCommand,clientName:e.clientName,startedAt:e.startedAt,endedAt:e.endedAt},messages:[...t]}}function jN(e,t=4){return JSON.stringify(e,null,t)+`
|
|
1766
|
-
`}const CN={name:"acp-devtools-ui",version:"0.1.0"};function NN(e,t=Date.now()){const n=e.id>0?String(e.id):"live",o=new Date(t).toISOString().slice(0,19).replace(/[:T]/g,"-");return`acp-session-${n}-${o}.json`}function EN(e,t,n=Date.now()){const o=_N(e,t,{tool:CN,exportedAt:n});return jN(o)}function Ob(e,t,n=Date.now()){const o=EN(e,t,n),r=new Blob([o],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=NN(e,n),s.rel="noopener",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function PN({open:e,onClose:t}){const[n,o]=I.useState(""),[r,i]=I.useState(0),s=I.useRef(null);I.useEffect(()=>{if(!e)return;o(""),i(0);const c=setTimeout(()=>{var f;return(f=s.current)==null?void 0:f.focus()},0);return()=>clearTimeout(c)},[e]);const a=I.useMemo(()=>IN(),[t,e]),l=I.useMemo(()=>ON(a,n),[a,n]);return I.useEffect(()=>{r>=l.length&&i(0)},[l.length,r]),I.useEffect(()=>{if(!e)return;const c=f=>{if(f.key==="Escape"){f.preventDefault(),t();return}if(f.key==="ArrowDown"){f.preventDefault(),i(m=>l.length===0?0:(m+1)%l.length);return}if(f.key==="ArrowUp"){f.preventDefault(),i(m=>l.length===0?0:(m-1+l.length)%l.length);return}if(f.key==="Enter"){f.preventDefault();const m=l[r];m&&(m.run(),t())}};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[e,l,r,t]),e?d.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] flex items-start justify-center bg-black/60 pt-[8vh] backdrop-blur-sm",onMouseDown:c=>{c.target===c.currentTarget&&t()},children:d.jsxs("div",{className:"w-[min(620px,92vw)] overflow-hidden rounded-md border border-line-strong bg-surface-elev shadow-2xl",children:[d.jsx("div",{className:"border-b border-line bg-surface-base/60",children:d.jsx("input",{ref:s,value:n,onChange:c=>{o(c.target.value),i(0)},placeholder:"type a command… esc closes ↑↓ navigate ↵ run",className:"w-full bg-transparent px-4 py-3 font-mono text-[13px] text-ink-primary placeholder-ink-muted outline-none"})}),d.jsxs("ul",{className:"max-h-[60vh] overflow-y-auto py-1",children:[l.length===0&&d.jsx("li",{className:"px-4 py-3 text-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no match"}),l.map((c,f)=>{const m=f===r,h=l[f-1],y=!h||h.section!==c.section;return d.jsxs("li",{children:[y&&d.jsx("div",{className:"px-4 pt-2 pb-1 font-mono text-[9px] uppercase tracking-widest text-ink-muted",children:c.section}),d.jsxs("button",{type:"button",onClick:()=>{c.run(),t()},onMouseEnter:()=>i(f),className:W("flex w-full items-center justify-between px-4 py-1.5 text-left font-mono text-[12px] transition-colors",m?"bg-accent-out/10 text-ink-primary":"text-ink-secondary hover:bg-surface-rowHover hover:text-ink-primary"),children:[d.jsx("span",{className:"truncate",children:c.label}),c.hint&&d.jsx("span",{className:"ml-3 shrink-0 rounded-sm border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-widest text-ink-muted",children:c.hint})]})]},c.id)})]})]})}):null}function IN(e){const t=ne.getState(),n=pt.getState(),o=[];o.push({id:"session.import",label:"Import session JSON from disk…",section:"session",run:()=>{const r=document.createElement("input");r.type="file",r.accept="application/json,.json",r.addEventListener("change",()=>{var s;const i=(s=r.files)==null?void 0:s[0];i&&(async()=>{try{const a=await gv(i);await Hu(),n.setSelected(Ya(a.id))}catch(a){const l=a instanceof Error?a.message:String(a);window.alert(`Import failed: ${l}`)}})()}),r.click()}}),t.session!==null&&t.messages.length>0&&o.push({id:"session.export",label:"Export current session as JSON",section:"session",run:()=>Ob(t.session,t.messages)}),o.push({id:"view.deselect",label:"Deselect message",hint:"esc",section:"view",run:()=>t.select(null)}),o.push({id:"view.toggle-streams",label:t.filters.showStreams?"Hide streaming chunks":"Show streaming chunks",section:"filter",run:()=>t.toggleStreams()}),o.push({id:"filter.reset",label:"Reset all filters",section:"filter",run:()=>{const r={directions:new Set(ss),kinds:new Set(as),showStreams:!0,search:""};ne.setState({filters:r})}});for(const r of ss){const i=t.filters.directions.has(r);o.push({id:`filter.dir.${r}`,label:`${i?"Hide":"Show"} ${r==="editor-to-agent"?"editor → agent":"agent → editor"} messages`,section:"filter",run:()=>t.toggleDirection(r)})}for(const r of as){const i=t.filters.kinds.has(r);o.push({id:`filter.kind.${r}`,label:`${i?"Hide":"Show"} ${r} kind`,section:"filter",run:()=>t.toggleKind(r)})}if(t.selectedSeq!==null){const r=t.messages.find(i=>i.seq===t.selectedSeq);r&&(o.push({id:"copy.raw",label:`Copy selected message raw line (seq ${r.seq})`,section:"copy",run:()=>{navigator.clipboard.writeText(r.raw)}}),r.payload&&o.push({id:"copy.payload",label:`Copy selected payload as JSON (seq ${r.seq})`,section:"copy",run:()=>{navigator.clipboard.writeText(JSON.stringify(r.payload,null,2))}}))}for(const r of n.captures)o.push({id:`switch.live.${r.url}`,label:`Switch to live: ${Gp(r)}`,section:"switch",run:()=>n.setSelected(r.url)});for(const r of n.savedSessions.slice(0,25)){const i=Ot(r.agent_command??""),s=r.name??(r.client_name?`${r.client_name} · ${i}`:i);o.push({id:`switch.saved.${r.id}`,label:`Open saved #${r.id} · ${s} (${r.message_count} msg)`,section:"switch",run:()=>n.setSelected(Ya(r.id))})}return o}function ON(e,t){const n=t.trim().toLowerCase();if(n==="")return e;const o=n.split(/\s+/);return e.filter(r=>{const i=r.label.toLowerCase();return o.every(s=>i.includes(s))})}const RN={idle:"idle",connecting:"connecting",open:"restoring view",closed:"disconnected",error:"connection error"};function AN({status:e,url:t,lastError:n}){const o=RN[e],r=e==="connecting"||e==="open";return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-surface-base",children:d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:[d.jsx("span",{"aria-hidden":!0,className:W("inline-block h-2 w-2 rounded-full",r?"animate-pulse-soft bg-accent-out":"bg-ink-dim",e==="error"&&"bg-accent-error")}),d.jsx("span",{children:o}),d.jsx("span",{className:"text-ink-dim",children:"·"}),d.jsx("span",{className:"lowercase tracking-normal text-ink-secondary",children:t}),n&&e==="error"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-dim",children:"·"}),d.jsx("span",{className:"lowercase tracking-normal text-accent-error",children:n})]})]})})}function MN(e){const t=e.$defs??{},n=new Map;for(const[g,b]of Object.entries(t)){const v=b["x-method"];if(typeof v!="string")continue;let p=n.get(v);p||(p={},n.set(v,p)),g.endsWith("Request")?p.requestDef=g:g.endsWith("Response")?p.responseDef=g:g.endsWith("Notification")&&(p.notificationDef=g)}function o(g,b){var v,p,u;switch(g.kind){case"request":{const x=g.method;return x?((v=n.get(x))==null?void 0:v.requestDef)??null:null}case"notification":{const x=g.method;return x?((p=n.get(x))==null?void 0:p.notificationDef)??null:null}case"response":case"error":return b?((u=n.get(b))==null?void 0:u.responseDef)??null:null;default:return null}}function r(g){return g==="request"||g==="notification"?"params":g==="response"?"result":g==="error"?"error":null}function i(g){return typeof g=="object"&&g!==null&&!Array.isArray(g)}function s(g,b){const v=g.properties;if(!v)return!0;for(const[p,u]of Object.entries(v))if(!(!u||typeof u!="object")){if("const"in u){if(b[p]!==u.const)return!1}else if(Array.isArray(u.enum)&&!u.enum.includes(b[p]))return!1}return!0}function a(g,b){const v=g.type;if(typeof v=="string"){if(v==="null")return b===null;if(v==="string")return typeof b=="string";if(v==="boolean")return typeof b=="boolean";if(v==="number"||v==="integer")return typeof b=="number";if(v==="array")return Array.isArray(b);if(v==="object")return i(b)&&s(g,b)}return g.$ref||g.properties||g.allOf?i(b)&&s(g,b):!1}function l(g,b=void 0){if(!g)return null;if(g.$ref){const v=g.$ref.replace(/^#\/\$defs\//,""),p=t[v];return p?l(p,b):null}if(g.allOf&&g.allOf.length>0){const v={properties:{}};for(const p of g.allOf){const u=l(p,b);u!=null&&u.properties&&(v.properties={...v.properties,...u.properties}),u!=null&&u.type&&!v.type&&(v.type=u.type),u!=null&&u.items&&!v.items&&(v.items=u.items)}return g.description&&!v.description&&(v.description=g.description),v}if(g.anyOf||g.oneOf){const v=g.anyOf??g.oneOf;if(b!==void 0){for(const p of v)if(p.type!=="null"&&a(p,b))return l(p,b)}for(const p of v){if(p.type==="null")continue;const u=l(p,b);if(u)return u}return null}return g}function c(g,b){let v=g;for(const p of b){if(v==null)return;if(Array.isArray(v)&&/^\d+$/.test(p))v=v[Number(p)];else if(typeof v=="object")v=v[p];else return}return v}function f(g){if(!g)return;if(g.$ref)return g.$ref.replace(/^#\/\$defs\//,"");const b=g.type;if(typeof b=="string")return b;if(Array.isArray(b))return b.find(p=>p!=="null")}function m(g,b){const v=t[g];return{typeName:g,typeDescription:(v==null?void 0:v.description)??null,resolve(p){var R;if(p.length===0)return{inSpec:!0,isExtension:!1,description:v==null?void 0:v.description,type:g};const u=p.slice(1);if(u.length===0)return null;let x=!1,S=v??null;for(let M=0;M<u.length;M++){const F=u[M];F==="_meta"&&(x=!0);const H=/^\d+$/.test(F),L=c(b,p.slice(0,M+1));if(S=l(S,L),!S)return null;if(H){const D=c(b,p.slice(0,M+2));S=l(S.items,D);continue}if(x&&F!=="_meta")return{inSpec:!1,isExtension:!0};const U=(R=S.properties)==null?void 0:R[F];if(!U)return{inSpec:!1,isExtension:x};S=U}const T=c(b,p),N=l(S,T),$={inSpec:!0,isExtension:x};S!=null&&S.description?$.description=S.description:N!=null&&N.description&&($.description=N.description);const C=f(S??null)??f(N);return C&&($.type=C),N!=null&&N.enum&&($.enumValues=N.enum),$}}}function h(g,b={}){const v=o(g,b.pairedMethod);return!v||!r(g.kind)?null:m(v,g.payload)}function y(){return[...n.keys()].sort()}return{resolveForMessage:h,knownMethods:y}}const qN=MN($v),UN=qN.resolveForMessage,LN={info:"border-line bg-surface-base text-ink-primary",warn:"border-accent-warn/40 bg-accent-warn/10 text-ink-primary",error:"border-accent-error/40 bg-accent-error/10 text-ink-primary"};function ds({label:e,children:t,delay:n=60,tone:o="info",className:r,focusable:i=!1}){const s=I.useRef(null),a=I.useRef(null),[l,c]=I.useState(null),f=l!==null,m=()=>{const g=s.current;if(!g)return null;const b=g.getBoundingClientRect(),p=window.innerHeight-b.bottom<120;return{top:p?b.top-8:b.bottom+8,left:Math.min(b.left,window.innerWidth-380),flipUp:p}},h=()=>{a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>{const g=m();g&&c(g)},n)},y=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),c(null)};return I.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),I.useEffect(()=>{if(!f)return;const g=()=>y();return window.addEventListener("scroll",g,!0),()=>window.removeEventListener("scroll",g,!0)},[f]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:s,className:W("cursor-help",r),onMouseEnter:h,onMouseLeave:y,...i?{onFocus:h,onBlur:y,tabIndex:0}:{},children:t}),l&&Lu.createPortal(d.jsx("div",{role:"tooltip",className:W("pointer-events-none fixed z-[200] max-w-[360px] rounded-sm border px-3 py-2 font-mono text-[11px] leading-snug shadow-lg backdrop-blur-sm",LN[o]),style:{top:l.flipUp?void 0:l.top,bottom:l.flipUp?window.innerHeight-l.top:void 0,left:l.left},children:e}),document.body)]})}const DN=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function wa(e){return DN.format(e)}function us(e){const t=e%1e3;return`${wa(e)}.${String(t).padStart(3,"0")}`}const zN=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function FN(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Sa(e,t=Date.now()){const n=new Date(e),o=new Date(t);if(FN(n,o))return wa(e);if(n.getFullYear()===o.getFullYear())return`${zN[n.getMonth()]} ${n.getDate()} ${wa(e)}`;const r=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getDate()).padStart(2,"0");return`${n.getFullYear()}-${r}-${i} ${wa(e)}`}function Rl(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Ht(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function BN(e){return e<250?"ok":e<1500?"warn":"error"}function Rb(e){return e==="editor-to-agent"?"OUT":"IN"}function Ab(e){return e==="editor-to-agent"?"→":"←"}const HN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function VN(e){const t=String(e);return HN.test(t)?t.slice(0,8)+"…":t.length>12?t.slice(0,10)+"…":t}function Or(e,t=Date.now()){const n=Math.max(0,Math.round((t-e)/1e3));if(n<60)return`${n}s`;const o=Math.floor(n/60);if(o<60)return`${o}m`;const r=Math.floor(o/60);if(r<24){const a=o%60;return`${r}h${String(a).padStart(2,"0")}m`}const i=Math.floor(r/24),s=r%24;return`${i}d${String(s).padStart(2,"0")}h`}function dh(e,t){if(e.length===0)return 0;const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n),i=e[o],s=e[r];return i===void 0||s===void 0?i??0:o===r?i:i+(s-i)*(n-o)}const WN=6;function uh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function KN(e){if(e===null)return"text-accent-error";switch(typeof e){case"string":return"text-accent-out";case"number":return"text-accent-in";case"boolean":return"text-accent-note";default:return"text-ink-secondary"}}function GN(e){return e===null?"null":typeof e=="string"?JSON.stringify(e):String(e)}function ol({value:e,name:t,depth:n=0,defaultExpanded:o,path:r=[],getSpec:i}){const s=uh(e)||Array.isArray(e),a=uh(e)?Object.keys(e).length:Array.isArray(e)?e.length:0,l=o??(n<2&&a<=WN),[c,f]=I.useState(l),m=t!==void 0&&i?i(r):null,h=t!==void 0?d.jsx(JN,{name:t,spec:m}):null;if(!s)return d.jsxs("div",{className:"flex items-baseline gap-2 font-mono text-xs leading-relaxed",children:[h,d.jsx("span",{className:W("whitespace-pre-wrap break-all",KN(e)),children:GN(e)})]});const y=Array.isArray(e),g=y?"[":"{",b=y?"]":"}";return d.jsxs("div",{className:"font-mono text-xs leading-relaxed",children:[d.jsxs("button",{type:"button",onClick:()=>f(v=>!v),className:"group/expand flex items-baseline gap-2 text-left hover:text-ink-primary",children:[d.jsx("span",{"aria-hidden":!0,className:W("inline-block w-3 text-ink-muted transition-transform",c?"rotate-90":""),children:"▸"}),h,d.jsx("span",{className:"text-ink-secondary",children:g}),!c&&d.jsxs("span",{className:"text-ink-muted",children:[a," ",y?"items":"keys"]}),!c&&d.jsx("span",{className:"text-ink-secondary",children:b})]}),c&&d.jsxs("div",{className:"ml-3 border-l border-line-grid pl-3",children:[y?e.map((v,p)=>d.jsx(ol,{value:v,name:String(p),depth:n+1,path:[...r,String(p)],...i?{getSpec:i}:{}},p)):Object.entries(e).map(([v,p])=>d.jsx(ol,{value:p,name:v,depth:n+1,path:[...r,v],...i?{getSpec:i}:{}},v)),d.jsx("div",{className:"text-ink-secondary",children:b})]})]})}function JN({name:e,spec:t}){const n=/^\d+$/.test(e),o=(t==null?void 0:t.description)??null;return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:W(n?"text-ink-muted":"text-ink-secondary"),children:n?`${e}:`:`"${e}":`}),t&&!t.inSpec&&d.jsx(ph,{tone:t.isExtension?"extension":"unknown",explanation:t.isExtension?"Extension — not declared in the ACP spec; contents are implementation-defined.":"Unknown — this field is not declared in the ACP schema for this message."}),(t==null?void 0:t.inSpec)&&t.isExtension&&d.jsx(ph,{tone:"extension",explanation:"Extension — _meta payload is implementation-defined per ACP spec."}),o&&d.jsx(ds,{label:d.jsx(QN,{text:o,type:t==null?void 0:t.type,enumValues:t==null?void 0:t.enumValues}),tone:"info",className:"text-ink-muted hover:text-ink-primary",focusable:!0,children:d.jsx("span",{"aria-label":`spec: ${o.split(`
|
|
1767
|
-
`)[0]}`,children:"ⓘ"})})]})}function QN({text:e,type:t,enumValues:n}){return d.jsxs("div",{className:"space-y-1.5",children:[t&&d.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:d.jsx("span",{className:"text-accent-info",children:t})}),d.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:e}),n&&n.length>0&&d.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["enum: ",n.map(o=>JSON.stringify(o)).join(" · ")]})]})}function ph({tone:e,explanation:t}){const n=e==="extension"?"border-accent-warn/40 bg-accent-warn/10 text-accent-warn":"border-accent-error/40 bg-accent-error/10 text-accent-error";return d.jsx(ds,{label:d.jsx("span",{className:"font-sans",children:t}),tone:e==="extension"?"warn":"error",focusable:!0,children:d.jsx("span",{className:W("inline-flex items-center rounded-sm border px-1 font-mono text-[9px] uppercase tracking-widest",n),children:e==="extension"?"⚠ ext":"⚠ unknown"})})}function YN({message:e,latencyMs:t,pairedRequest:n,onJumpToPaired:o,validation:r}){const i=ne(c=>c.detailTab),s=ne(c=>c.setDetailTab),a=I.useMemo(()=>{if(!e)return null;const c=(n==null?void 0:n.method)??void 0;return UN(e,c?{pairedMethod:c}:void 0)},[e,n]);if(!e)return d.jsx("div",{className:"flex h-full items-center justify-center bg-surface-elev/40",children:d.jsx("div",{className:"text-center font-mono text-xs uppercase tracking-widest text-ink-muted",children:"select a message to inspect"})});const l=e.direction==="editor-to-agent";return d.jsxs("div",{className:"flex h-full flex-col bg-surface-elev/30",children:[d.jsxs("header",{className:"border-b border-line bg-surface-elev px-5 py-3",children:[d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsxs("span",{className:W("font-mono text-[11px] font-semibold tracking-widest",l?"text-accent-out":"text-accent-in"),children:[Ab(e.direction)," ",Rb(e.direction)]}),d.jsxs("span",{className:"font-mono text-xs text-ink-muted",children:["seq ",e.seq]}),d.jsx("span",{className:"font-mono text-xs text-ink-muted",children:us(e.timestamp)})]}),d.jsx("h2",{className:"mt-1 truncate font-display text-lg uppercase tracking-tight text-ink-primary",children:e.method??e.kind}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[11px] text-ink-secondary",children:[d.jsx(nE,{message:e,resolver:a}),e.rpcId!==void 0&&e.rpcId!==null&&d.jsx($a,{label:"id",value:String(e.rpcId)}),d.jsx($a,{label:"bytes",value:Rl(e.raw.length)}),t!==void 0&&d.jsx($a,{label:"latency",value:`+${Ht(t)}`,accent:!0}),n&&d.jsxs("button",{type:"button",onClick:o?()=>o(n.seq):void 0,className:"inline-flex items-baseline gap-1 transition-colors hover:text-ink-primary",title:"jump to paired message",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:"paired"}),d.jsxs("span",{className:"text-ink-primary underline decoration-line-strong decoration-dotted underline-offset-4",children:["seq ",n.seq," ",n.method??""]})]})]})]}),d.jsxs("nav",{className:"flex gap-1 border-b border-line bg-surface-elev/70 px-4",children:[d.jsx(ea,{active:i==="tree",onClick:()=>s("tree"),children:"Tree"}),d.jsx(ea,{active:i==="raw",onClick:()=>s("raw"),children:"Raw"}),d.jsx(ea,{active:i==="meta",onClick:()=>s("meta"),children:"Meta"}),d.jsx(ea,{active:i==="spec",onClick:()=>s("spec"),badge:r&&!r.skipped&&!r.valid?r.errors.length:void 0,children:"Spec"})]}),d.jsxs("div",{className:"flex-1 overflow-auto px-5 py-4",children:[i==="tree"&&d.jsx(ZN,{message:e,resolver:a}),i==="raw"&&d.jsx(eE,{raw:e.raw}),i==="meta"&&d.jsx(tE,{message:e}),i==="spec"&&d.jsx(XN,{validation:r})]})]})}function XN({validation:e}){if(!e)return d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"no validation result yet"});if(e.skipped){const t={"parse-error":"this frame failed to parse as JSON-RPC — already surfaced in the Tree tab as a parse error","no-method":"no method available for validation (e.g. response without a paired request)","unknown-method":"the ACP spec has no schema for this method — likely an extension or a future addition","no-schema-for-kind":"the spec has no schema for this kind of frame for this method (e.g. notification-only method)","wrong-kind":"no per-method ACP schema applies (e.g. JSON-RPC error envelope, parse failure)"};return d.jsxs("div",{className:"space-y-2 font-mono text-[11px]",children:[d.jsx("div",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:"not validated"}),d.jsx("div",{className:"text-ink-secondary",children:t[e.skipped]})]})}return e.valid?d.jsx("div",{className:"space-y-2 font-mono text-[11px]",children:d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsx("span",{className:"rounded-sm border border-accent-ok/40 bg-accent-ok/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-ok",children:"✓ conforms"}),d.jsxs("span",{className:"text-ink-muted",children:["matched ",d.jsx("span",{className:"text-ink-secondary",children:e.schemaName})," ","from the ACP schema"]})]})}):d.jsxs("div",{className:"space-y-3 font-mono text-[11px]",children:[d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsxs("span",{className:"rounded-sm border border-accent-error/40 bg-accent-error/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-error",children:["⚠ ",e.errors.length," violation",e.errors.length===1?"":"s"]}),d.jsxs("span",{className:"text-ink-muted",children:["against ",d.jsx("span",{className:"text-ink-secondary",children:e.schemaName})]})]}),d.jsx("ul",{className:"space-y-1.5",children:e.errors.map((t,n)=>d.jsxs("li",{className:"rounded-sm border border-accent-error/25 bg-accent-error/[0.04] px-2 py-1.5",children:[d.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:[t.keyword??"error"," · ",t.path==="/"?"(root)":t.path]}),d.jsx("div",{className:"mt-0.5 text-ink-primary",children:t.message})]},`${t.path}-${t.keyword}-${n}`))})]})}function ZN({message:e,resolver:t}){const n=I.useMemo(()=>{if(t)return o=>t.resolve(o)},[t]);return e.payload===null?d.jsxs("div",{className:"space-y-2 font-mono text-xs",children:[d.jsxs("div",{className:"text-accent-error",children:["parse error: ",e.parseError??"unknown"]}),d.jsx("pre",{className:"whitespace-pre-wrap break-all text-ink-secondary",children:e.raw})]}):d.jsx(ol,{value:e.payload,defaultExpanded:!0,...n?{getSpec:n}:{}})}function eE({raw:e}){const[t,n]=I.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return d.jsxs("div",{className:"group relative",children:[d.jsx("button",{type:"button",onClick:o,"aria-label":"Copy raw frame to clipboard",title:"Copy raw frame to clipboard",className:W("absolute right-0 top-0 inline-flex h-6 items-center rounded-sm border bg-surface-elev/70 px-2 font-mono text-[10px] uppercase tracking-widest opacity-0 transition-[opacity,background-color,border-color,color] duration-150","group-hover:opacity-100 focus-visible:opacity-100",t?"border-accent-ok/60 bg-surface-elev text-accent-ok opacity-100":"border-line text-ink-secondary hover:border-accent-info/70 hover:bg-surface-rowHover hover:text-accent-info"),children:t?"✓ copied":"copy"}),d.jsx("pre",{className:"whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-ink-primary",children:e})]})}function tE({message:e}){const t=[["seq",String(e.seq)],["direction",e.direction],["kind",e.kind],["method",e.method??"(none)"],["rpcId",String(e.rpcId??"(none)")],["timestamp",`${us(e.timestamp)} (${e.timestamp})`],["raw size",Rl(e.raw.length)],["parse error",e.parseError??"(none)"]];return d.jsx("dl",{className:"grid grid-cols-[110px_1fr] gap-x-4 gap-y-1 font-mono text-[12px]",children:t.map(([n,o])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:n}),d.jsx("dd",{className:"text-ink-primary",children:o})]},n))})}function nE({message:e,resolver:t}){const n=d.jsx($a,{label:"kind",value:e.kind});return t!=null&&t.typeDescription?d.jsx(ds,{label:d.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:t.typeDescription}),tone:"info",children:n}):n}function $a({label:e,value:t,accent:n}){return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:W(n?"text-accent-warn":"text-ink-primary"),children:t})]})}function ea({children:e,active:t,onClick:n,badge:o,tab:r}){return d.jsxs("button",{type:"button",onClick:n,className:W("relative flex items-baseline gap-1.5 px-4 py-2 font-mono text-[11px] uppercase tracking-widest transition-colors",t?"text-ink-primary":"text-ink-muted hover:text-ink-secondary"),children:[d.jsx("span",{children:e}),o!==void 0&&d.jsx("span",{className:"rounded-sm border border-accent-error/40 bg-accent-error/10 px-1 text-[9px] font-semibold text-accent-error",children:o}),t&&d.jsx("span",{className:"absolute inset-x-2 -bottom-px h-px bg-accent-out","aria-hidden":!0})]})}function Qp(e){const t=new Map,n=new Map;for(const o of e){if(o.rpcId===void 0||o.rpcId===null)continue;const r=String(o.rpcId);if(o.kind==="request")t.set(r,o);else if(o.kind==="response"||o.kind==="error"){const i=t.get(r);if(!i)continue;const s=Math.max(0,o.timestamp-i.timestamp);n.set(i.seq,{pairSeq:o.seq,latencyMs:s}),n.set(o.seq,{pairSeq:i.seq,latencyMs:s})}}return n}function Md(e){const t=Qp(e),n=new Map,o=new Map;for(const i of e)if(i.method){if(i.kind==="request"){let s=n.get(i.method);s||(s={count:0,latencies:[]},n.set(i.method,s)),s.count+=1;const a=t.get(i.seq);a&&s.latencies.push(a.latencyMs)}else if(i.kind==="notification"){let s=o.get(i.method);s||(s={count:0,latencies:[]},o.set(i.method,s)),s.count+=1}}const r=[];for(const[i,s]of n)s.latencies.sort((a,l)=>a-l),r.push({method:i,kind:"request",count:s.count,sampleSize:s.latencies.length,p50:s.latencies.length?fh(s.latencies,50):null,p99:s.latencies.length?fh(s.latencies,99):null,max:s.latencies.length?s.latencies[s.latencies.length-1]:null,totalLatencyMs:s.latencies.length?s.latencies.reduce((a,l)=>a+l,0):null,latencies:s.latencies});for(const[i,s]of o)r.push({method:i,kind:"notification",count:s.count,sampleSize:0,p50:null,p99:null,max:null,totalLatencyMs:null,latencies:[]});return r.sort((i,s)=>s.count-i.count||(i.kind==="request"?-1:1)),r}function fh(e,t){if(e.length===0)return 0;const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n),i=e[o],s=e[r];return i===void 0||s===void 0?i??0:o===r?i:i+(s-i)*(n-o)}const Mb=100;function oE(e,t,n={}){const o=n.maxChangesPerRow??Mb,r=mh(e),i=mh(t),s=rE(r,i),a=[],l={equal:0,changed:0,added:0,removed:0,total:0};for(const c of s)if(c.kind==="match"){const f=e[c.i],m=t[c.j],h=iE(f,m,o),y=h.length===0?"equal":"changed";a.push({op:y,a:f,b:m,signature:r[c.i],changes:h}),y==="equal"?l.equal+=1:l.changed+=1}else if(c.kind==="removed"){const f=e[c.i];a.push({op:"removed",a:f,b:null,signature:r[c.i],changes:[]}),l.removed+=1}else{const f=t[c.j];a.push({op:"added",a:null,b:f,signature:i[c.j],changes:[]}),l.added+=1}return l.total=a.length,{rows:a,summary:l}}function mh(e){const t=Qp(e),n=new Map;for(const o of e)o.method&&n.set(o.seq,o.method);return e.map(o=>{let r=o.method??"";if(!r&&(o.kind==="response"||o.kind==="error")){const i=t.get(o.seq);i&&(r=n.get(i.pairSeq)??"")}return`${o.direction}|${o.kind}|${r}`})}function rE(e,t){const n=e.length,o=t.length,r=o+1,i=new Uint32Array((n+1)*r);for(let c=n-1;c>=0;c--)for(let f=o-1;f>=0;f--){const m=c*r+f;if(e[c]===t[f])i[m]=i[(c+1)*r+(f+1)]+1;else{const h=i[(c+1)*r+f],y=i[c*r+(f+1)];i[m]=h>=y?h:y}}const s=[];let a=0,l=0;for(;a<n&&l<o;)e[a]===t[l]?(s.push({kind:"match",i:a,j:l}),a++,l++):i[(a+1)*r+l]>=i[a*r+(l+1)]?(s.push({kind:"removed",i:a}),a++):(s.push({kind:"added",j:l}),l++);for(;a<n;)s.push({kind:"removed",i:a}),a++;for(;l<o;)s.push({kind:"added",j:l}),l++;return s}function hh(e){const t=e.payload;if(t===null||typeof t!="object")return{raw:e.raw,parseError:e.parseError??null};const n=t,o={};return"method"in n&&(o.method=n.method),"params"in n&&(o.params=n.params),"result"in n&&(o.result=n.result),"error"in n&&(o.error=n.error),o}function iE(e,t,n){const o=[];return rl(hh(e),hh(t),"",o,n),o}function sE(e,t,n=Mb){const o=[];return rl(e,t,"",o,n),o}function yh(e){return Array.isArray(e)?"array":e!==null&&typeof e=="object"?"object":"leaf"}function rl(e,t,n,o,r){if(o.length>=r||Object.is(e,t))return;const i=yh(e),s=yh(t);if(i!==s||i==="leaf"){if(aE(e,t))return;o.push({path:n||"$",kind:"change",a:e,b:t});return}if(i==="array"){const f=e,m=t,h=Math.max(f.length,m.length);for(let y=0;y<h;y++){if(o.length>=r)return;const g=`${n}[${y}]`,b=y<f.length,v=y<m.length;b&&v?rl(f[y],m[y],g,o,r):v?o.push({path:g,kind:"add",b:m[y]}):o.push({path:g,kind:"remove",a:f[y]})}return}const a=e,l=t,c=[...new Set([...Object.keys(a),...Object.keys(l)])].sort();for(const f of c){if(o.length>=r)return;const m=n?`${n}.${f}`:f,h=f in a,y=f in l;h&&y?rl(a[f],l[f],m,o,r):y?o.push({path:m,kind:"add",b:l[f]}):o.push({path:m,kind:"remove",a:a[f]})}}function aE(e,t){return Object.is(e,t)}function Ce(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function bn(e){return typeof e=="string"&&e.length>0?e:null}function Ro(e){return e===!0}function lE(e){for(const t of e)if(t.kind==="request"&&t.method==="initialize"&&t.direction==="editor-to-agent")return t;return null}function cE(e,t){if(t==null)return null;for(const n of e)if(n.kind==="response"&&n.direction==="agent-to-editor"&&n.rpcId===t)return n;return null}function dE(e){var r,i;const t={name:null,title:null,version:null,platform:null};if(!e)return t;const n=Ce((r=Ce(e.payload))==null?void 0:r.params),o=Ce(n==null?void 0:n.clientInfo);return o?{name:bn(o.name),title:bn(o.title),version:bn(o.version),platform:bn((i=Ce(o._meta))==null?void 0:i.platform)}:t}function uE(e){var s,a;const t={fsReadTextFile:!1,fsWriteTextFile:!1,terminal:!1,authTerminal:!1,authGateway:!1};if(!e)return t;const n=Ce((s=Ce(e.payload))==null?void 0:s.params),o=Ce(n==null?void 0:n.clientCapabilities);if(!o)return t;const r=Ce(o.fs),i=Ce(o.auth);return{fsReadTextFile:Ro(r==null?void 0:r.readTextFile),fsWriteTextFile:Ro(r==null?void 0:r.writeTextFile),terminal:Ro(o.terminal),authTerminal:Ro(i==null?void 0:i.terminal),authGateway:Ro((a=Ce(i==null?void 0:i._meta))==null?void 0:a.gateway)}}function pE(e){var i;const t={name:null,version:null,authMethods:0};if(!e)return t;const n=Ce((i=Ce(e.payload))==null?void 0:i.result);if(!n)return t;const o=Ce(n.agentInfo),r=n.authMethods;return{name:bn(o==null?void 0:o.name),version:bn(o==null?void 0:o.version),authMethods:Array.isArray(r)?r.length:0}}function fE(e){var r;const t={prompt:!1,loadSession:!1};if(!e)return t;const n=Ce((r=Ce(e.payload))==null?void 0:r.result),o=Ce(n==null?void 0:n.agentCapabilities);return o?{prompt:Ro(o.promptCapabilities)||o.promptCapabilities!==void 0,loadSession:Ro(o.loadSession)}:t}function mE(e,t){const n=t??e;if(!n)return null;const o=Ce(n.payload),r=Ce(o==null?void 0:o.result)??Ce(o==null?void 0:o.params),i=r==null?void 0:r.protocolVersion;return typeof i=="number"?i:null}function hE(e){var s,a;let t=null,n=0,o=null,r=0,i=[];for(const l of e){l.direction!=="editor-to-agent"&&l.kind;const c=Ce((s=Ce(l.payload))==null?void 0:s.params);if(c){if(l.method==="session/set_mode"){const f=bn(c.modeId);f!==null&&(t!==null&&t!==f&&(n+=1),t=f)}else if(l.method==="session/set_model"){const f=bn(c.modelId);f!==null&&(o!==null&&o!==f&&(r+=1),o=f)}else if(l.method==="session/update"){const f=Ce(c.update);if((f==null?void 0:f.sessionUpdate)==="available_commands_update"){const m=f.availableCommands;if(Array.isArray(m)){const h=[];for(const y of m){const g=bn((a=Ce(y))==null?void 0:a.name);g!==null&&h.push(g)}h.length>0&&(i=h)}}else if((f==null?void 0:f.sessionUpdate)==="current_mode_update"){const m=bn(f.currentModeId);m!==null&&(t!==null&&t!==m&&(n+=1),t=m)}}}}return{currentMode:t,modeChanges:n,currentModel:o,modelChanges:r,availableCommands:i}}function yE(e){if(!e)return{jetbrainsProxyConfig:null};const t=Ce(e.payload),n=Ce(t==null?void 0:t.params),o=Ce(n==null?void 0:n._meta);return{jetbrainsProxyConfig:(o==null?void 0:o.proxyConfig)??null}}function il(e){const t=lE(e),n=cE(e,t==null?void 0:t.rpcId);return{protocolVersion:mE(t,n),client:dE(t),agent:pE(n),clientCapabilities:uE(t),agentCapabilities:fE(n),runtime:hE(e),extensions:yE(t)}}function gh(e){return{protocolVersion:e.protocolVersion,client:e.client,agent:e.agent,clientCapabilities:e.clientCapabilities,agentCapabilities:e.agentCapabilities,runtime:e.runtime}}function gE(e,t){const n=il(e),o=il(t);return{a:n,b:o,changes:sE(gh(n),gh(o))}}function vE(e,t){const n=Md(e),o=Md(t),r=l=>`${l.kind}:${l.method}`,i=new Map(n.map(l=>[r(l),l])),s=new Map(o.map(l=>[r(l),l])),a=[];for(const l of new Set([...i.keys(),...s.keys()])){const c=i.get(l)??null,f=s.get(l)??null,m=c??f;a.push({method:m.method,kind:m.kind,a:c,b:f,countDelta:((f==null?void 0:f.count)??0)-((c==null?void 0:c.count)??0),p50Delta:xc(c==null?void 0:c.p50,f==null?void 0:f.p50),p99Delta:xc(c==null?void 0:c.p99,f==null?void 0:f.p99),maxDelta:xc(c==null?void 0:c.max,f==null?void 0:f.max)})}return a.sort((l,c)=>Math.abs(c.p99Delta??0)-Math.abs(l.p99Delta??0)||Math.abs(c.countDelta)-Math.abs(l.countDelta)||l.method.localeCompare(c.method)),a}function xc(e,t){return e==null||t===null||t===void 0?null:t-e}function Yp(e,t=200){const[n,o]=I.useState(e),[r,i]=I.useState(!1);return I.useEffect(()=>{if(e){o(!0);let a=null;const l=requestAnimationFrame(()=>{a=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(l),a!==null&&cancelAnimationFrame(a)}}i(!1);const s=setTimeout(()=>o(!1),t);return()=>clearTimeout(s)},[e,t]),{rendered:n,visible:r}}const Xp="flex h-9 items-center gap-4 border-b border-line bg-surface-base px-5",bE={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"UNK"};function xE(e){return e.direction==="editor-to-agent"?"→A":"A←"}function qb(e){if(e.name)return`#${e.id} · ${e.name}`;const t=e.agent_command?Ot(e.agent_command):"agent";return e.client_name?`#${e.id} · ${e.client_name} · ${t}`:`#${e.id} · ${t}`}const vh={messages:null,loading:!1,error:null};function bh(e){const[t,n]=I.useState(vh);return I.useEffect(()=>{if(e===null){n(vh);return}let o=!1;return n({messages:null,loading:!0,error:null}),pS(e).then(r=>{o||n({messages:r.messages,loading:!1,error:null})}).catch(r=>{o||n({messages:null,loading:!1,error:r instanceof Error?r.message:String(r)})}),()=>{o=!0}},[e]),t}function wE({open:e,onClose:t}){const n=ne(D=>D.messages),o=ne(D=>D.session),r=pt(D=>D.savedSessions),i=(o==null?void 0:o.id)??null,[s,a]=I.useState(null),[l,c]=I.useState(null),[f,m]=I.useState("frames"),[h,y]=I.useState(!0),[g,b]=I.useState(null),{rendered:v,visible:p}=Yp(e);I.useEffect(()=>{if(!e)return;const D=Q=>{Q.key==="Escape"&&(Q.preventDefault(),t())};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[e,t]),I.useEffect(()=>{e&&(a(i),c(null),b(null))},[e,i]),I.useEffect(()=>b(null),[s,l]);const u=bh(s!==null&&s!==i?s:null),x=bh(l!==null&&l!==i?l:null),S=s===null?null:s===i?n:u.messages,T=l===null?null:l===i?n:x.messages,N=u.loading||x.loading,$=u.error??x.error,C=I.useMemo(()=>S===null||T===null?null:oE(S,T),[S,T]),R=I.useMemo(()=>{if(!C)return[];const D=[];return C.rows.forEach((Q,ee)=>{h&&Q.op==="equal"||D.push({row:Q,index:ee})}),D},[C,h]),M=I.useMemo(()=>{const D=r.find(Q=>Q.id===l);return D?qb(D):null},[r,l]),F=I.useMemo(()=>S&&T?gE(S,T):null,[S,T]),H=I.useMemo(()=>S&&T?vE(S,T):null,[S,T]);if(!v)return null;const L=r.filter(D=>D.id!==l),U=r.filter(D=>D.id!==s);return d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Session diff",className:W("fixed inset-0 z-[100] flex flex-col bg-surface-base/95 backdrop-blur-sm transition-opacity duration-200 ease-out",p?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:W("flex h-full w-full flex-col transition-transform duration-200 ease-out",p?"translate-y-0":"-translate-y-2"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Diff — compare two sessions"}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close diff panel",children:"close"})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line bg-surface-elev px-5 py-2.5",children:[d.jsx("span",{className:"font-mono text-[11px] text-accent-out",title:"baseline (left)",children:"A"}),d.jsx($h,{ariaLabel:"Baseline session",sessions:L,selectedId:s,onSelect:a}),d.jsx("span",{className:"text-ink-muted",children:"→"}),d.jsx("span",{className:"font-mono text-[11px] text-ink-secondary",title:"comparison (right)",children:"B"}),d.jsx($h,{ariaLabel:"Comparison session",sessions:U,selectedId:l,onSelect:c})]}),s===null?d.jsx(gi,{children:"Pick a baseline session (A) to compare from."}):l===null?d.jsx(gi,{children:"Pick a session in the B selector above to compare against A."}):N?d.jsx(gi,{children:"Loading sessions…"}):$?d.jsxs(gi,{tone:"error",children:["Could not load a session: ",$]}):!C||!F||!H?d.jsx(gi,{children:"No data."}):d.jsxs(d.Fragment,{children:[d.jsx(SE,{tab:f,onTab:m,summary:C.summary,infoCount:F.changes.length}),d.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[f==="frames"&&d.jsx($E,{diff:C,bLabel:M,hideEqual:h,onHideEqual:y,visibleRows:R,expanded:g,onToggleExpand:D=>b(Q=>Q===D?null:D)}),f==="info"&&d.jsx(kE,{meta:F}),f==="perf"&&d.jsx(_E,{perf:H})]})]})]})})}function SE({tab:e,onTab:t,summary:n,infoCount:o}){const i=[{id:"frames",label:"frames",badge:n.changed+n.added+n.removed},{id:"info",label:"info",badge:o},{id:"perf",label:"perf",badge:0}];return d.jsx("div",{className:"flex items-center gap-1 border-b border-line bg-surface-elev px-5 py-1.5",children:i.map(s=>d.jsxs("button",{type:"button",onClick:()=>t(s.id),className:W("inline-flex items-center gap-1.5 rounded-sm px-3 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors",e===s.id?"bg-surface-rowHover text-ink-primary":"text-ink-muted hover:text-ink-secondary"),children:[s.label,s.badge>0&&d.jsx("span",{className:"rounded-sm border border-line px-1 text-[9px] text-ink-secondary",children:s.badge})]},s.id))})}function $E({diff:e,bLabel:t,hideEqual:n,onHideEqual:o,visibleRows:r,expanded:i,onToggleExpand:s}){const a=e.summary.changed===0&&e.summary.added===0&&e.summary.removed===0;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:W(Xp,"font-mono text-[11px]"),children:[d.jsxs("span",{className:"text-ink-muted",children:[e.summary.equal," same"]}),d.jsxs("span",{className:"text-accent-warn",children:[e.summary.changed," differs"]}),d.jsxs("span",{className:"text-accent-error",children:[e.summary.removed," only in A"]}),d.jsxs("span",{className:"text-accent-ok",children:[e.summary.added," only in B"]}),d.jsxs("label",{className:"ml-auto flex cursor-pointer select-none items-center gap-2 text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx("input",{type:"checkbox",checked:n,onChange:l=>o(l.target.checked),className:"accent-accent-info"}),"hide unchanged"]})]}),a?d.jsxs(ps,{tone:"ok",children:["Sessions are identical",t?` — every frame in B (${t}) matches A`:"","."]}):r.length===0?d.jsx(ps,{children:"Only unchanged frames — toggle “hide unchanged” to see them."}):d.jsxs("table",{className:"w-full table-fixed border-collapse font-mono text-[11px]",children:[d.jsxs("colgroup",{children:[d.jsx("col",{className:"w-[24px]"}),d.jsx("col",{className:"w-1/2"}),d.jsx("col",{className:"w-1/2"})]}),d.jsx("tbody",{children:r.map(({row:l,index:c})=>d.jsx(NE,{row:l,expanded:i===c,onToggle:()=>s(c)},c))})]})]})}function Ub(){return d.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-warn",children:"~"})," changed"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-ok",children:"+"})," only in B"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-error",children:"−"})," only in A"]})]})}function kE({meta:e}){return e.changes.length===0?d.jsx(ps,{tone:"ok",children:"Metadata identical — same client, agent, capabilities, protocol and runtime."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Xp,children:d.jsx(Ub,{})}),d.jsx("ul",{className:"space-y-1 px-5 py-3 font-mono text-[11px]",children:e.changes.map((t,n)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Lb,{change:t})},n))})]})}function xh(e){return e==null?"—":Ht(e)}function TE(e){return e===null?{text:"—",tone:"text-ink-dim"}:e===0?{text:"0",tone:"text-ink-muted"}:{text:(e>0?"+":"−")+Ht(Math.abs(e)),tone:e>0?"text-accent-error":"text-accent-ok"}}function _E({perf:e}){return e.length===0?d.jsx(ps,{children:"No methods to compare."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:W(Xp,"font-mono text-[10px] uppercase tracking-widest text-ink-muted"),children:[d.jsx("span",{children:"Δ = B − A · sorted by |Δ p99|"}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-error",children:"+"})," slower in B"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-ok",children:"−"})," faster in B"]})]}),d.jsxs("table",{className:"w-full text-[11px]",children:[d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:d.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx("th",{className:"py-2 pl-5 pr-3",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"A p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"B p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"Δ p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"count"})]})}),d.jsx("tbody",{className:"font-mono",children:e.map(t=>{var o,r,i,s;const n=TE(t.p99Delta);return d.jsxs("tr",{className:"border-b border-line/40 hover:bg-surface-rowHover/50",children:[d.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:t.method,children:t.method}),d.jsx("td",{className:"px-3 py-1.5 text-[10px] uppercase tracking-widest text-ink-muted",children:t.kind==="request"?"req":"ntf"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:xh(((o=t.a)==null?void 0:o.p99)??null)}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:xh(((r=t.b)==null?void 0:r.p99)??null)}),d.jsx("td",{className:W("px-3 py-1.5 text-right",n.tone),children:n.text}),d.jsxs("td",{className:"px-3 py-1.5 text-right text-ink-muted",children:[((i=t.a)==null?void 0:i.count)??0,"→",((s=t.b)==null?void 0:s.count)??0]})]},`${t.kind}:${t.method}`)})})]})]})}function gi({children:e,tone:t}){return d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d.jsx(ps,{...t?{tone:t}:{},children:e})})}const jE={equal:"",changed:"bg-accent-warn/5",added:"bg-accent-ok/5",removed:"bg-accent-error/5"},CE={equal:{glyph:"=",tone:"text-ink-dim"},changed:{glyph:"≠",tone:"text-accent-warn"},added:{glyph:"▸",tone:"text-accent-ok"},removed:{glyph:"◂",tone:"text-accent-error"}};function NE({row:e,expanded:t,onToggle:n}){const o=CE[e.op],r=e.op==="changed"&&e.changes.length>0;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:W("border-b border-line/40 align-top",jE[e.op],r&&"cursor-pointer hover:bg-accent-warn/10"),onClick:r?n:void 0,children:[d.jsx("td",{className:W("py-1.5 pl-5 text-center",o.tone),children:o.glyph}),d.jsx("td",{className:"px-3 py-1.5",children:d.jsx(wh,{frame:e.a,muted:e.op==="added"})}),d.jsxs("td",{className:"px-3 py-1.5",children:[d.jsx(wh,{frame:e.b,muted:e.op==="removed"}),r&&d.jsxs("span",{className:"ml-2 text-[10px] text-accent-warn",children:[t?"▾":"▸"," ",e.changes.length," field",e.changes.length===1?"":"s"]})]})]}),r&&t&&d.jsxs("tr",{className:"border-b border-line/40 bg-surface-elev",children:[d.jsx("td",{}),d.jsxs("td",{colSpan:2,className:"px-5 py-2",children:[d.jsx("div",{className:"mb-1.5",children:d.jsx(Ub,{})}),d.jsx("ul",{className:"space-y-1",children:e.changes.map((i,s)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Lb,{change:i})},s))})]})]})]})}function wh({frame:e,muted:t}){if(e===null)return d.jsx("span",{className:"text-ink-dim",children:"—"});const n=e.method??(e.parseError?`! ${e.parseError}`:"—");return d.jsxs("span",{className:W("inline-flex items-baseline gap-2",t&&"opacity-60"),children:[d.jsx("span",{className:"text-ink-dim",children:xE(e)}),d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:bE[e.kind]}),d.jsx("span",{className:"truncate text-ink-primary",title:n,children:n}),d.jsxs("span",{className:"text-ink-dim",children:["#",e.seq]})]})}const Sh=80;function ta(e){let t;try{t=JSON.stringify(e)}catch{t=String(e)}return t===void 0&&(t="undefined"),t.length>Sh&&(t=t.slice(0,Sh-1)+"…"),t}function Lb({change:e}){return e.kind==="add"?d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-ok",children:"+ "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-ok",children:ta(e.b)})]}):e.kind==="remove"?d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-error",children:"− "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-error line-through",children:ta(e.a)})]}):d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-warn",children:"~ "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-error line-through",children:ta(e.a)}),d.jsx("span",{className:"text-ink-muted",children:" → "}),d.jsx("span",{className:"text-accent-ok",children:ta(e.b)})]})}function ps({children:e,tone:t="muted"}){const n=t==="error"?"text-accent-error":t==="ok"?"text-accent-ok":"text-ink-muted";return d.jsx("div",{className:W("px-5 py-8 text-center font-mono text-[12px]",n),children:e})}function $h({ariaLabel:e,sessions:t,selectedId:n,onSelect:o}){const[r,i]=I.useState(!1),s=I.useRef(null);I.useEffect(()=>{if(!r)return;const m=h=>{s.current&&!s.current.contains(h.target)&&i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const a=t.filter(m=>m.imported_at===null),l=t.filter(m=>m.imported_at!==null),c=n!==null?t.find(m=>m.id===n)??null:null,f=c?qb(c):n!==null?`#${n}`:"select a session…";return d.jsxs("div",{ref:s,className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>i(m=>!m),"aria-label":e,"aria-haspopup":"listbox","aria-expanded":r,className:W("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] uppercase tracking-widest transition-colors","border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",r?"border-line-strong text-ink-primary":""),title:`${e} — pick which session to compare`,children:[d.jsx("span",{className:"inline-block w-[240px] truncate text-left",children:f}),d.jsx("span",{"aria-hidden":!0,className:W("transition-transform",r?"rotate-180":""),children:"▾"})]}),r&&d.jsxs("div",{className:"absolute left-0 top-[calc(100%+6px)] z-50 w-[460px] rounded-md border border-line bg-surface-elev shadow-xl",children:[d.jsxs(kh,{children:["saved · ",a.length," session",a.length===1?"":"s"]}),a.length===0&&d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no other saved sessions to compare"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:a.map(m=>d.jsx(Th,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))}),l.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs(kh,{children:["imported · ",l.length," file",l.length===1?"":"s"]}),d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:l.map(m=>d.jsx(Th,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))})]})]})]})}function kh({children:e}){return d.jsx("div",{className:"border-b border-line bg-surface-base/50 px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e})}function Th({s:e,active:t,onPick:n}){return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:n,title:`session #${e.id} · ${e.agent_command??""} · ${e.message_count} messages`,className:W("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:W("h-2 w-2 shrink-0 rounded-full",t?"bg-accent-note animate-pulse-soft":"bg-ink-dim")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),d.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Ot(e.agent_command??"")}`:Ot(e.agent_command??""))]}),d.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[e.message_count,"msg · ",Or(e.started_at)]})]})})}let wc=null,vi=null;async function EE(){if(wc)return wc;if(vi)return vi;vi=(async()=>{const e=await fetch("/api/info",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`info: HTTP ${e.status}`);const t=await e.json();return wc=t,t})();try{return await vi}finally{vi=null}}const PE=[{id:"zed",label:"Zed"},{id:"jetbrains",label:"JetBrains"}],IE="/absolute/path/to/acp-devtools";function OE(e){return JSON.stringify({agent_servers:{"Claude Code (via ACP Devtools)":{type:"custom",command:e}}},null,4)}function Db({text:e,label:t="Copy"}){const[n,o]=I.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1400)}catch{o(!1)}};return d.jsx("button",{type:"button",onClick:r,className:W("rounded border border-line px-2 py-0.5 font-mono text-[10px] uppercase tracking-widest transition-colors",n?"border-accent-out text-accent-out":"text-ink-secondary hover:border-ink-secondary hover:text-ink-primary"),children:n?"Copied":t})}function RE(){const[e,t]=I.useState("zed"),[n,o]=I.useState(null);I.useEffect(()=>{let a=!0;return EE().then(l=>{a&&o(l.binaryPath)}).catch(()=>{}),()=>{a=!1}},[]);const r=n??IE,i=n===null,s=I.useMemo(()=>({zed:OE(r),jetbrainsName:"Claude Code (via ACP Devtools)"}),[r]);return d.jsxs("div",{className:"rounded border border-line bg-surface-base",children:[d.jsx("div",{className:"flex items-center gap-1 border-b border-line px-3 py-2",children:PE.map(a=>d.jsx("button",{type:"button",onClick:()=>t(a.id),className:W("rounded px-2 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors",e===a.id?"bg-surface-elev text-ink-primary":"text-ink-secondary hover:text-ink-primary"),children:a.label},a.id))}),e==="zed"&&d.jsxs("div",{className:"px-3 py-3",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"~/.config/zed/settings.json"}),d.jsx(Db,{text:s.zed})]}),d.jsx("pre",{className:"overflow-x-auto rounded border border-line bg-surface-elev/60 px-3 py-2 font-mono text-[11px] leading-relaxed text-ink-primary",children:s.zed}),d.jsxs("p",{className:"mt-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Open Zed, paste into ",d.jsx("span",{className:"font-mono",children:"settings.json"})," ","(Cmd+,), pick the new agent in the right-side panel, send a prompt. The CLI auto-proxies ",d.jsx("span",{className:"font-mono",children:"@zed-industries/claude-code-acp"})," ","when launched with no args."]}),d.jsx(_h,{isPlaceholder:i})]}),e==="jetbrains"&&d.jsxs("div",{className:"px-3 py-3",children:[d.jsxs("p",{className:"mb-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Settings (Cmd+,) → search ",d.jsx("span",{className:"font-mono",children:"agent"})," → open the AI Assistant / Junie agent-servers page → add a new entry with these fields (no arguments needed):"]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(jh,{label:"Name",value:s.jetbrainsName}),d.jsx(jh,{label:"Command",value:r})]}),d.jsxs("p",{className:"mt-3 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["JetBrains IDEs require an absolute ",d.jsx("span",{className:"font-mono",children:"command"}),". See ",d.jsx("span",{className:"font-mono",children:"examples/jetbrains-config.md"})," if the agent-servers page is not where the search suggests."]}),d.jsx(_h,{isPlaceholder:i})]})]})}function _h({isPlaceholder:e}){return e?d.jsxs("div",{className:"mt-3 rounded border border-line border-dashed bg-surface-elev/40 px-3 py-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["You're viewing the UI through a development server, so the absolute binary path couldn't be auto-detected. After running"," ",d.jsx("span",{className:"font-mono",children:"npm run build:full"})," in the repo and"," ",d.jsx("span",{className:"font-mono",children:"npm link"})," inside"," ",d.jsx("span",{className:"font-mono",children:"packages/cli/"}),", find the path with"," ",d.jsx("span",{className:"font-mono",children:"which acp-devtools"})," and replace the placeholder above."]}):d.jsxs("p",{className:"mt-3 font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:["path auto-resolved · verify with ",d.jsx("span",{className:"text-ink-secondary",children:"which acp-devtools"})]})}function jh({label:e,value:t}){return d.jsxs("div",{className:"flex items-center gap-2 rounded border border-line bg-surface-elev/60 px-3 py-1.5",children:[d.jsx("span",{className:"w-20 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:"flex-1 truncate font-mono text-[11px] text-ink-primary",children:t}),d.jsx(Db,{text:t})]})}function AE({status:e,lastError:t,url:n,captureCount:o}){const r=e==="open"?"Awaiting messages":e==="connecting"?"Connecting":e==="closed"?"Disconnected":e==="error"?"Connection error":"No live capture",i=e==="open"?"text-accent-out":e==="error"?"text-accent-error":"text-ink-secondary";return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:d.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[d.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.1.0 / pre-alpha"})]}),d.jsx("h2",{className:W("font-display text-2xl uppercase tracking-tight",i),children:r}),d.jsx("p",{className:"mt-2 font-sans text-sm leading-relaxed text-ink-secondary",children:"Connect an IDE to start streaming ACP frames. Pick yours below — the snippet plugs acp-devtools between editor and agent so every message is captured live."}),o>0&&d.jsxs("p",{className:"mt-2 font-mono text-[11px] uppercase tracking-widest text-accent-out",children:[o," live capture",o===1?"":"s"," discovered — pick one in the picker above"]}),d.jsx("div",{className:"mt-4",children:d.jsx(RE,{})}),d.jsxs("div",{className:"mt-4 flex items-center gap-3 font-mono text-[11px]",children:[d.jsx(ME,{status:e}),d.jsx("span",{className:"text-ink-secondary",children:n}),t&&d.jsx("span",{className:"text-accent-error",children:t})]})]})})}function ME({status:e}){const t=e==="open"?"bg-accent-out":e==="connecting"?"bg-accent-warn animate-pulse-soft":e==="error"?"bg-accent-error":"bg-ink-dim";return d.jsx("span",{className:W("h-2 w-2 rounded-full",t),"aria-hidden":!0})}function qE(){const e=ne(i=>i.filters),t=ne(i=>i.toggleDirection),n=ne(i=>i.toggleKind),o=ne(i=>i.toggleStreams),r=ne(i=>i.setSearch);return d.jsxs("div",{className:"flex items-center gap-3 border-b border-line bg-surface-elev/70 px-4 py-2",children:[d.jsx("div",{className:"flex items-center gap-1",children:ss.map(i=>d.jsx(DE,{dir:i,active:e.directions.has(i),onClick:()=>t(i)},i))}),d.jsx(BE,{}),d.jsxs("div",{className:"flex items-center gap-1",children:[as.map(i=>d.jsx(zE,{kind:i,active:e.kinds.has(i),onClick:()=>n(i)},i)),d.jsx(FE,{active:e.showStreams,onClick:o})]}),d.jsx("div",{className:"ml-auto",children:d.jsx("input",{type:"search",placeholder:"search payload…",value:e.search,onChange:i=>r(i.target.value),className:W("h-7 w-64 rounded border border-line bg-surface-base px-2 font-mono text-[11px] text-ink-primary placeholder-ink-muted","focus:border-accent-out focus:outline-none")})})]})}const UE={"editor-to-agent":"editor → agent (toggle to filter messages flowing from your IDE to the AI)","agent-to-editor":"agent → editor (toggle to filter messages coming back from the AI)"},LE={request:"request — expects a response",response:"response — answer to a previous request",notification:"notification — one-way event, no response",error:"error — response carrying an error object",unknown:"unknown — frames that could not be classified as JSON-RPC"};function DE({dir:e,active:t,onClick:n}){const o=e==="editor-to-agent",r=o?"→ OUT":"← IN",i=o?"text-accent-out":"text-accent-in";return d.jsx("button",{type:"button",onClick:n,title:UE[e],className:W("inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold tracking-widest transition-colors",t?W(i,o?"border-accent-out/50 bg-accent-out/10":"border-accent-in/50 bg-accent-in/10"):"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:r})}function zE({kind:e,active:t,onClick:n}){const r={request:{color:"text-accent-out",border:"border-accent-out/50",bg:"bg-accent-out/10"},response:{color:"text-accent-in",border:"border-accent-in/50",bg:"bg-accent-in/10"},notification:{color:"text-accent-note",border:"border-accent-note/50",bg:"bg-accent-note/10"},error:{color:"text-accent-error",border:"border-accent-error/50",bg:"bg-accent-error/10"},unknown:{color:"text-ink-muted",border:"border-line",bg:"bg-surface-row"}}[e];return d.jsx("button",{type:"button",onClick:n,title:LE[e],className:W("rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",t?W(r.color,r.border,r.bg):"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:e})}function FE({active:e,onClick:t}){return d.jsx("button",{type:"button",onClick:t,title:"stream — collapse runs of agent_message_chunk notifications into a single row",className:W("rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",e?"border-accent-note/50 bg-accent-note/10 text-accent-note":"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:"stream"})}function BE(){return d.jsx("span",{"aria-hidden":!0,className:"h-5 w-px bg-line"})}const HE={minSamplesForTail:3,longTailRatio:5,minBusiestCount:50,minBusiestRatio:2.5,minHotspotShare:.4,minSamplesForOutlier:5,outlierRatio:3};function VE(e,t,n={}){const o={...HE,...n},r=[],i=t.reduce((y,g)=>y+(g.totalLatencyMs??0),0);if(i>0){const g=t.filter(b=>b.totalLatencyMs!==null&&b.totalLatencyMs>0).sort((b,v)=>(v.totalLatencyMs??0)-(b.totalLatencyMs??0))[0];if(g&&g.totalLatencyMs!==null){const b=g.totalLatencyMs/i;b>=o.minHotspotShare&&r.push({kind:"hotspot",summary:`${g.method} consumed ${sr(g.totalLatencyMs)} of total wall time`,detail:`${Math.round(b*100)}% of ${sr(i)} sampled latency`,methods:[g.method]})}}const a=t.filter(y=>y.sampleSize>=o.minSamplesForTail&&y.p50!==null&&y.p99!==null&&y.p50>0&&y.p99/y.p50>=o.longTailRatio).sort((y,g)=>(g.p99??0)/(g.p50??1)-(y.p99??0)/(y.p50??1))[0];if(a&&a.p99!==null&&a.p50!==null){const y=Math.round(a.p99/a.p50);r.push({kind:"long-tail",summary:`${a.method} has a long tail — p99 is ${y}× the p50`,detail:`p50 ${sr(a.p50)} · p99 ${sr(a.p99)} · ${a.sampleSize} samples`,methods:[a.method]})}const l=[...t].filter(y=>y.sampleSize>=o.minSamplesForOutlier&&y.p99!==null&&y.max!==null&&y.p99>0&&y.max/y.p99>=o.outlierRatio).sort((y,g)=>(g.max??0)-(y.max??0))[0];if(l&&l.max!==null&&l.p99!==null){const y=Math.round(l.max/l.p99);r.push({kind:"outlier",summary:`${l.method} had one ${sr(l.max)} call — ${y}× its p99`,detail:`p99 ${sr(l.p99)} · ${l.sampleSize} samples`,methods:[l.method]})}const c=[...t].sort((y,g)=>g.count-y.count),f=c[0],m=c[1];if(f&&f.count>=o.minBusiestCount){const y=m&&m.count>0?f.count/m.count:1/0;if(y>=o.minBusiestRatio){const g=f.kind==="notification"?"notifications":"calls";r.push({kind:"busiest",summary:`${f.method} sent ${f.count} ${g}`,detail:m?`${y.toFixed(1)}× the next-busiest method (${m.method} · ${m.count})`:"no other methods to compare against",methods:[f.method]})}}const h=WE(e);if(h.length>0){const y=h.slice(0,3),g=h.length>3?` (+${h.length-3} more)`:"";r.push({kind:"errors",summary:`${h.length} method${h.length===1?"":"s"} returned an error`,detail:y.join(", ")+g,methods:h})}return r}function WE(e){const t=new Map,n=new Set;for(const o of e){const r=o.rpcId===void 0||o.rpcId===null?null:String(o.rpcId);if(o.kind==="request"&&o.method&&r!==null)t.set(r,o.method);else if(o.kind==="error"&&r!==null){const i=t.get(r);i&&n.add(i)}}return[...n].sort()}function sr(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<1e4)return`${(e/1e3).toFixed(2)}s`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return`${t}m${n}s`}function KE(e,t){if(e.length<=t)return e;const n=[];for(let o=0;o<t;o++){const r=Math.round(o*(e.length-1)/(t-1));n.push(e[r])}return n}function GE({values:e,width:t=64,height:n=14,className:o,title:r}){if(e.length===0)return null;const i=e[e.length-1]??0;if(i===0)return null;const s=Math.max(1,Math.floor(t/4)),a=KE(e,s),l=1,c=(t-l*(a.length-1))/a.length;return d.jsx("svg",{viewBox:`0 0 ${t} ${n}`,width:t,height:n,className:W("inline-block align-middle",o),role:"img","aria-label":r??`latency distribution, ${e.length} samples`,children:a.map((f,m)=>{const h=Math.max(1,f/i*n);return d.jsx("rect",{x:m*(c+l),y:n-h,width:c,height:h,fill:"currentColor",opacity:.4+f/i*.6},m)})})}function JE(e){const t={events:[],startTs:0,endTs:0,durationMs:0,laneCounts:{"editor-req":0,"agent-req":0,notification:0}};if(e.length===0)return t;const n=Qp(e),o=new Map;for(const l of e)o.set(l.seq,l);let r=1/0,i=-1/0;const s=[],a={"editor-req":0,"agent-req":0,notification:0};for(const l of e)if(l.timestamp<r&&(r=l.timestamp),l.timestamp>i&&(i=l.timestamp),l.kind==="request"){const c=l.direction==="editor-to-agent"?"editor-req":"agent-req",f=n.get(l.seq),m=f?o.get(f.pairSeq):void 0,h=(m==null?void 0:m.kind)==="error",y=m?m.timestamp:l.timestamp;y>i&&(i=y),s.push({seq:l.seq,startTs:l.timestamp,endTs:y,lane:c,method:l.method??null,kind:l.kind,erroredOut:h,pairedSeq:m?m.seq:null}),a[c]+=1}else l.kind==="notification"&&(s.push({seq:l.seq,startTs:l.timestamp,endTs:l.timestamp,lane:"notification",method:l.method??null,kind:l.kind,erroredOut:!1,pairedSeq:null}),a.notification+=1);return!Number.isFinite(r)||!Number.isFinite(i)?t:{events:s,startTs:r,endTs:i,durationMs:Math.max(0,i-r),laneCounts:a}}const sl=["editor-req","agent-req","notification"],QE={"editor-req":"editor → agent","agent-req":"agent → editor",notification:"notifications"},no=48,Zp=6,Al=24,xn=132,fs=20,Ml=8,YE=20,Ch=3e4,Nh=50;function XE(e,t,n,o,r,i){if(e.length===0||n<=t)return{segments:[{kind:"active",tStart:t,tEnd:n,pxStart:0,pxEnd:o*r}],tsToX:()=>xn-i,totalActiveMs:0};const s=[...e].sort((u,x)=>u.startTs-x.startTs),a=[];let l=t,c=t;for(const u of s)u.startTs-c>Ch&&(c>l&&a.push({kind:"active",tStart:l,tEnd:c}),a.push({kind:"gap",tStart:c,tEnd:u.startTs}),l=u.startTs),c=Math.max(c,u.endTs);c>l&&a.push({kind:"active",tStart:l,tEnd:c}),n>c+Ch?a.push({kind:"gap",tStart:c,tEnd:n}):n>c&&a.length>0&&(a[a.length-1].tEnd=n);const f=a.filter(u=>u.kind==="gap").length,m=a.filter(u=>u.kind==="active").reduce((u,x)=>u+(x.tEnd-x.tStart),0),h=o*r,y=Math.max(50,h-f*Nh),g=m>0?y/m:0;let b=0;const v=[];for(const u of a){const x=u.kind==="gap"?Nh:(u.tEnd-u.tStart)*g;v.push({...u,pxStart:b,pxEnd:b+x}),b+=x}return{segments:v,tsToX:u=>{if(u<=v[0].tStart)return xn+v[0].pxStart-i;for(const S of v)if(u>=S.tStart&&u<=S.tEnd){const T=S.tEnd>S.tStart?(u-S.tStart)/(S.tEnd-S.tStart):0,N=S.pxStart+T*(S.pxEnd-S.pxStart);return xn+N-i}const x=v[v.length-1];return xn+x.pxEnd-i},totalActiveMs:m}}function ZE({messages:e,onSelectSeq:t,height:n=220,controlsRef:o,onZoomChange:r}){const i=I.useMemo(()=>JE(e),[e]),s=I.useRef(null),a=I.useRef(null),[l,c]=I.useState({width:800,height:n}),[f,m]=I.useState(1),[h,y]=I.useState(0),[g,b]=I.useState(null),[v,p]=I.useState({x:0,y:0}),u=I.useRef(null);I.useEffect(()=>{const L=s.current;if(!L||typeof ResizeObserver>"u")return;const U=new ResizeObserver(D=>{const Q=D[0];if(!Q)return;const ee=Q.contentRect;c({width:Math.max(320,ee.width),height:Math.max(120,ee.height)})});return U.observe(L),()=>U.disconnect()},[]),I.useEffect(()=>{m(1),y(0),b(null)},[i.startTs,i.endTs]);const x=I.useMemo(()=>{const L=Math.max(50,l.width-xn-fs);return XE(i.events,i.startTs,i.endTs,L,f,h)},[i,l.width,f,h]),S=I.useMemo(()=>{if(i.events.length===0)return[];const L=[];for(const U of i.events){const D=x.tsToX(U.startTs),Q=x.tsToX(U.endTs),ee=Math.max(2,Q-D),q=sl.indexOf(U.lane),G=Ml+Al+q*(no+Zp)+no/2-9;L.push({...U,x:D,y:G,width:ee,height:18})}return L},[i,x]);I.useEffect(()=>{const L=a.current;if(!L)return;const U=window.devicePixelRatio||1;L.width=l.width*U,L.height=l.height*U,L.style.width=`${l.width}px`,L.style.height=`${l.height}px`;const D=L.getContext("2d");if(!D)return;D.setTransform(U,0,0,U,0,0);const Q=getComputedStyle(document.documentElement),ee=G=>`rgb(${Q.getPropertyValue(`--${G}`).trim()})`,q=(G,P)=>`rgba(${Q.getPropertyValue(`--${G}`).trim()} / ${P})`;D.clearRect(0,0,l.width,l.height),eP(D,l,ee),nP(D,x,l,ee,q),tP(D,l,x,ee),iP(D,S,g,ee,q)},[S,x,l,g]);const T=(L,U)=>{for(const D of S){const Q=Math.max(D.width,6);if(L>=D.x&&L<=D.x+Q&&U>=D.y&&U<=D.y+D.height)return D}return null},N=L=>{const U=L.currentTarget.getBoundingClientRect(),D=L.clientX-U.left,Q=L.clientY-U.top;if(u.current){const q=D-u.current.startX;y(Math.max(0,u.current.startPan-q));return}const ee=T(D,Q);b(ee),p({x:L.clientX,y:L.clientY})},$=L=>{const U=L.currentTarget.getBoundingClientRect(),D=L.clientX-U.left,Q=L.clientY-U.top,ee=T(D,Q);if(ee&&t){t(ee.seq);return}u.current={startX:D,startPan:h}},C=()=>{u.current=null},R=L=>{if(!L.metaKey&&!L.ctrlKey)return;L.preventDefault();const U=L.deltaY<0?1.15:1/1.15;m(D=>Math.min(50,Math.max(.3,D*U)))},M=()=>m(L=>Math.min(50,L*1.5)),F=()=>m(L=>Math.max(.3,L/1.5)),H=()=>{m(1),y(0)};return I.useEffect(()=>{if(o)return o.current={zoomIn:M,zoomOut:F,reset:H,getZoom:()=>f},()=>{o.current&&(o.current=null)}}),I.useEffect(()=>{r==null||r(f)},[f,r]),i.events.length===0?d.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no messages — capture or load a session first"}):d.jsxs("div",{ref:s,className:"relative h-full w-full",style:{minHeight:0},children:[d.jsx("canvas",{ref:a,className:W("block h-full w-full",u.current?"cursor-grabbing":g?"cursor-pointer":"cursor-grab"),onMouseMove:N,onMouseDown:$,onMouseUp:C,onMouseLeave:()=>{b(null),u.current=null},onWheel:R}),g&&d.jsxs("div",{role:"tooltip",className:"pointer-events-none fixed z-[150] rounded-sm border border-line bg-surface-base px-3 py-2 font-mono text-[11px] shadow-lg",style:{left:Math.min(window.innerWidth-280,v.x+12),top:v.y+12,maxWidth:280},children:[d.jsxs("div",{className:"text-ink-primary",children:[d.jsxs("span",{className:"text-ink-muted",children:["seq ",g.seq]})," · ",g.method??g.kind]}),d.jsx("div",{className:"text-ink-muted",children:g.endTs>g.startTs?`${Ht(g.endTs-g.startTs)}${g.erroredOut?" · error":""}`:g.lane==="notification"?"notification":"pending"}),t&&d.jsx("div",{className:"mt-1 text-[10px] text-ink-dim",children:"click to inspect"})]})]})}function eP(e,t,n){e.font="10px monospace",e.textBaseline="middle",e.textAlign="start";for(let o=0;o<sl.length;o++){const r=sl[o],i=Ml+Al+o*(no+Zp);e.fillStyle=n("surface-elev"),e.fillRect(xn,i,t.width-xn-fs,no),e.fillStyle=n("ink-muted"),e.fillText(QE[r],YE,i+no/2),e.strokeStyle=n("line"),e.lineWidth=1,e.beginPath(),e.moveTo(xn,i+no),e.lineTo(t.width-fs,i+no),e.stroke()}}function tP(e,t,n,o){var g;const r=Ml+Al-4;e.strokeStyle=o("line"),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="bottom",e.textAlign="center",e.lineWidth=1;const i=n.segments.filter(b=>b.kind==="active").reduce((b,v)=>Math.max(b,v.tEnd-v.tStart),0),s=n.segments.reduce((b,v)=>b+(v.kind==="active"?v.pxEnd-v.pxStart:0),0),l=(i>0?s/n.totalActiveMs:0)*1e3,c=[.1,.25,.5,1,2,5,10,30,60,120,300],f=80;let m=c[c.length-1];for(const b of c)if(b*l>=f){m=b;break}const h=m*1e3,y=((g=n.segments[0])==null?void 0:g.tStart)??0;for(const b of n.segments){if(b.kind!=="active")continue;const v=Math.ceil((b.tStart-y)/h)*h+y;for(let p=v;p<=b.tEnd;p+=h){const u=n.tsToX(p);u<xn||u>t.width-fs||(e.beginPath(),e.moveTo(u,r),e.lineTo(u,r+4),e.stroke(),e.fillText(rP(p-y),u,r-2))}}}function nP(e,t,n,o,r){const i=Ml+Al,s=i+sl.length*(no+Zp);for(const a of t.segments){if(a.kind!=="gap")continue;const l=t.tsToX(a.tStart),f=t.tsToX(a.tEnd)-l;if(l>n.width-fs||l+f<xn)continue;e.fillStyle=r("ink-muted",.06),e.fillRect(l,i,f,s-i),e.strokeStyle=o("line"),e.setLineDash([3,3]),e.lineWidth=1,e.beginPath(),e.moveTo(l+.5,i),e.lineTo(l+.5,s),e.moveTo(l+f-.5,i),e.lineTo(l+f-.5,s),e.stroke(),e.setLineDash([]),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="middle",e.textAlign="center";const m=l+f/2,h=i+(s-i)/2;e.fillText(oP(a.tEnd-a.tStart),m,h)}}function oP(e){if(e<6e4)return`${Math.round(e/1e3)}s idle`;if(e<36e5)return`${Math.round(e/6e4)}m idle`;const t=Math.floor(e/36e5),n=Math.round(e%36e5/6e4);return n>0?`${t}h${n}m idle`:`${t}h idle`}function rP(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(e<1e4?1:0)}s`;const t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return`${t}m${n}s`}function iP(e,t,n,o,r){for(const i of t){const s=(n==null?void 0:n.seq)===i.seq,a=i.erroredOut?r("accent-error",.6):i.kind==="notification"?r("accent-note",.7):i.lane==="editor-req"?r("accent-out",.7):r("accent-in",.7);e.fillStyle=s?a.replace(/0\.\d+/,"0.95"):a,e.fillRect(i.x,i.y,Math.max(i.width,2),i.height),s&&(e.strokeStyle=o("ink-primary"),e.lineWidth=1,e.strokeRect(i.x-.5,i.y-.5,Math.max(i.width,2)+1,i.height+1))}}function sP({open:e,onClose:t,onNavigateToSeq:n}){const o=ne(S=>S.messages),r=ne(S=>S.session),i=ne(S=>S.select),s=I.useRef(null),[a,l]=I.useState(1),c=I.useMemo(()=>Md(o),[o]),f=I.useMemo(()=>VE(o,c),[o,c]),m=I.useMemo(()=>c.reduce((S,T)=>Math.max(S,T.count),0),[c]),[h,y]=I.useState("count"),[g,b]=I.useState("desc"),{rendered:v,visible:p}=Yp(e);I.useEffect(()=>{if(!e)return;const S=T=>{T.key==="Escape"&&(T.preventDefault(),t())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[e,t]);const u=I.useMemo(()=>mP(c,h,g),[c,h,g]),x=I.useMemo(()=>fP(c),[c]);return v?d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Performance dashboard",className:W("fixed inset-0 z-[100] flex flex-col bg-surface-base/95 backdrop-blur-sm transition-opacity duration-200 ease-out",p?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:W("flex h-full w-full flex-col transition-transform duration-200 ease-out",p?"translate-y-0":"-translate-y-2"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsxs("div",{className:"flex min-w-0 items-baseline gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Performance — per-method latency"}),r&&d.jsx("span",{className:"truncate font-mono text-[11px] text-ink-secondary",children:(()=>{const S=Ol(r);let T=S.secondary;if(!r.clientName){const N=il(o),$=N.client.title??N.client.name??null;if($){const C=S.secondary;T=C?`${$} · ${C}`:$}}return T?`${S.primary} · ${T}`:S.primary})()})]}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close performance panel",children:"close"})]}),f.length>0&&d.jsx(dP,{insights:f}),d.jsx("div",{className:"border-b border-line bg-surface-elev px-5 py-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:c.length===0?d.jsx("span",{children:"no messages — capture or load a session first"}):d.jsxs("span",{children:[x.methods," methods · ",x.requests," requests ·"," ",x.notifications," notifications · ",x.samples," latency samples"]})}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsx("div",{className:"flex-1 overflow-y-auto",children:u.length===0?null:d.jsxs("table",{className:"w-full table-fixed text-[11px]",children:[d.jsxs("colgroup",{children:[d.jsx("col",{}),d.jsx("col",{className:"w-[64px]"}),d.jsx("col",{className:"w-[88px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[120px]"})]}),d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:d.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx(lr,{sk:"method",current:h,dir:g,onSort:ar(y,b,g),className:"!pl-5",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx(lr,{sk:"count",current:h,dir:g,onSort:ar(y,b,g),align:"right",children:"count"}),d.jsx(lr,{sk:"p50",current:h,dir:g,onSort:ar(y,b,g),align:"right",children:"p50"}),d.jsx(lr,{sk:"p99",current:h,dir:g,onSort:ar(y,b,g),align:"right",children:"p99"}),d.jsx(lr,{sk:"max",current:h,dir:g,onSort:ar(y,b,g),align:"right",children:"max"}),d.jsx(lr,{sk:"total",current:h,dir:g,onSort:ar(y,b,g),align:"right",children:"total"}),d.jsx("th",{className:"py-2 pl-3 pr-5 text-right",children:"dist"})]})}),d.jsx("tbody",{className:"font-mono",children:u.map(S=>d.jsxs("tr",{className:"border-b border-line/40 transition-colors hover:bg-surface-rowHover/50",children:[d.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:S.method,children:S.method}),d.jsx("td",{className:"px-3 py-1.5 text-ink-muted",children:d.jsx(pP,{kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-primary",children:d.jsx(uP,{count:S.count,max:m,kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p50!==null?Ht(S.p50):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p99!==null?Ht(S.p99):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.max!==null?Ht(S.max):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.totalLatencyMs!==null?Ht(S.totalLatencyMs):"—"}),d.jsx("td",{className:"py-1.5 pl-3 pr-5 text-right",children:S.latencies.length>0?d.jsx(GE,{values:S.latencies,width:88,height:14,className:"text-accent-info",title:`${S.method} latency distribution`}):d.jsx("span",{className:"text-ink-dim",children:"—"})})]},`${S.kind}:${S.method}`))})]})}),o.length>0&&d.jsxs("div",{className:"flex h-[260px] shrink-0 flex-col border-t border-line bg-surface-elev",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line bg-surface-base px-5 py-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 truncate",children:[d.jsx("span",{children:"timeline — wall-clock waterfall"}),d.jsx("span",{className:"text-ink-dim",children:"· drag to pan · Cmd/Ctrl + wheel zoom · click to inspect"})]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[d.jsxs("span",{className:"text-ink-secondary",children:[a.toFixed(a<1?2:1),"×"]}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.zoomOut()},className:"inline-flex h-5 w-5 items-center justify-center rounded-sm border border-line hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Zoom out",title:"Zoom out",children:"−"}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.zoomIn()},className:"inline-flex h-5 w-5 items-center justify-center rounded-sm border border-line hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Zoom in",title:"Zoom in",children:"+"}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.reset()},className:"inline-flex h-5 items-center justify-center rounded-sm border border-line px-2 hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Reset zoom and pan",title:"Reset zoom and pan to defaults",children:"reset"})]})]}),d.jsx("div",{className:"flex-1",children:d.jsx(ZE,{messages:o,controlsRef:s,onZoomChange:l,onSelectSeq:S=>{n?n(S):(i(S),t())}})})]})]})]})}):null}const aP={hotspot:"●","long-tail":"▲",outlier:"◆",busiest:"■",errors:"✗"},lP={hotspot:"text-accent-warn","long-tail":"text-accent-warn",outlier:"text-accent-warn",busiest:"text-accent-info",errors:"text-accent-error"},cP={hotspot:"hotspot","long-tail":"long tail",outlier:"outlier",busiest:"busiest",errors:"errors"};function dP({insights:e}){return d.jsxs("div",{className:"border-b border-line bg-surface-base px-5 py-2.5",children:[d.jsx("div",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"insights"}),d.jsx("ul",{className:"space-y-1.5",children:e.map(t=>d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{"aria-hidden":!0,className:W("mt-[3px] inline-block text-[9px] leading-none",lP[t.kind]),children:aP[t.kind]}),d.jsx("div",{className:"min-w-[68px] font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:cP[t.kind]}),d.jsxs("div",{className:"flex-1 text-[11px] leading-snug",children:[d.jsx("div",{className:"text-ink-primary",children:t.summary}),t.detail&&d.jsx("div",{className:"text-[10px] text-ink-muted",children:t.detail})]})]},t.kind))})]})}function uP({count:e,max:t,kind:n}){const o=t>0?e/t*100:0,r=n==="request"?"bg-accent-out/15":"bg-accent-note/15";return d.jsxs("div",{className:"relative inline-block w-[44px] text-right",children:[d.jsx("div",{"aria-hidden":!0,className:W("absolute inset-y-[1px] right-0 rounded-sm",r),style:{width:`${o}%`}}),d.jsx("span",{className:"relative",children:e})]})}function ar(e,t,n){return(o,r)=>{r?t(n==="asc"?"desc":"asc"):(e(o),t(o==="method"?"asc":"desc"))}}function lr({sk:e,current:t,dir:n,onSort:o,align:r="left",className:i,children:s}){const a=t===e;return d.jsxs("th",{className:W("cursor-pointer select-none px-3 py-2 transition-colors hover:text-ink-primary",r==="right"?"text-right":"",a?"text-ink-primary":"",i),onClick:()=>o(e,a),"aria-sort":a?n==="asc"?"ascending":"descending":"none",children:[d.jsx("span",{children:s}),a&&d.jsx("span",{className:"ml-1 text-accent-warn",children:n==="asc"?"↑":"↓"})]})}function pP({kind:e}){const t=e==="request"?"text-accent-out":"text-accent-note",n=e==="request"?"req":"ntf";return d.jsx("span",{className:W("text-[10px] uppercase tracking-widest",t),title:e,children:n})}function fP(e){let t=0,n=0,o=0;for(const r of e)r.kind==="request"?t+=r.count:n+=r.count,o+=r.sampleSize;return{methods:e.length,requests:t,notifications:n,samples:o}}function mP(e,t,n){const o=n==="asc"?1:-1,r=[...e];return r.sort((i,s)=>{const a=Eh(i,t),l=Eh(s,t);return a===null&&l!==null?1:a!==null&&l===null?-1:t==="method"?o*i.method.localeCompare(s.method):a===null||l===null?0:o*(a-l)}),r}function Eh(e,t){switch(t){case"method":return 0;case"count":return e.count;case"p50":return e.p50;case"p99":return e.p99;case"max":return e.max;case"total":return e.totalLatencyMs}}const hP=[.5,1,2,4,8];function yP(){const e=ne(h=>h.messages),t=ne(h=>h.playback),n=ne(h=>h.setPlaybackCap),o=ne(h=>h.setPlaying),r=ne(h=>h.setPlaybackSpeed),i=e.length>0?e[0].seq:0,s=e.length>0?e[e.length-1].seq:0,a=t.cap??s,l=a>=s,c=I.useRef(null);if(I.useEffect(()=>{if(!t.playing)return;if(l){o(!1);return}const h=e.findIndex(p=>p.seq===a),y=e[h+1];if(!y){o(!1);return}const g=e[h],b=g?y.timestamp-g.timestamp:0,v=Math.max(15,Math.min(1500,b/t.speed));return c.current=setTimeout(()=>{n(y.seq)},v),()=>{c.current&&(clearTimeout(c.current),c.current=null)}},[t.playing,t.speed,a,e,l,n,o]),e.length===0)return null;const f=h=>{h>=s?n(null):n(h),t.playing&&o(!1)},m=()=>{l?(n(i),o(!0)):o(!t.playing)};return d.jsxs("div",{className:"flex items-center gap-3 border-t border-line bg-surface-elev/70 px-4 py-2 font-mono text-[11px]",children:[d.jsx("button",{type:"button",onClick:m,className:W("inline-flex h-6 w-12 items-center justify-center rounded-sm border font-semibold uppercase tracking-widest transition-colors",t.playing?"border-accent-warn/50 bg-accent-warn/10 text-accent-warn":"border-accent-out/50 bg-accent-out/10 text-accent-out"),title:t.playing?"pause":l?"restart playback":"play",children:t.playing?"❚❚":l?"↺":"▶"}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-secondary",children:[String(a).padStart(3,"0")," / ",String(s).padStart(3,"0")]}),d.jsx("input",{type:"range",min:i,max:s,value:a,onChange:h=>f(Number(h.target.value)),className:"h-1 flex-1 cursor-pointer accent-accent-out"}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:hP.map(h=>d.jsxs("button",{type:"button",onClick:()=>r(h),className:W("rounded-sm border px-1.5 py-0.5 text-[10px] uppercase tracking-widest transition-colors",t.speed===h?"border-accent-out/50 bg-accent-out/10 text-accent-out":"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),title:`${h}× speed`,children:[h,"×"]},h))}),d.jsx("button",{type:"button",onClick:()=>{n(null),o(!1)},className:"rounded-sm border border-line px-2 py-0.5 text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:border-line-strong hover:text-ink-secondary",title:"show all messages, exit playback",children:"show all"})]})}function zb(e=5e3){const[t,n]=I.useState(()=>Date.now());return I.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function gP({open:e,onClose:t}){const n=ne(a=>a.session),o=ne(a=>a.messages),r=I.useMemo(()=>il(o),[o]),{rendered:i,visible:s}=Yp(e);return I.useEffect(()=>{if(!e)return;const a=l=>{l.key==="Escape"&&(l.preventDefault(),t())};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[e,t]),i?d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Session info",className:W("fixed inset-0 z-[100] flex items-start justify-end bg-black/60 backdrop-blur-sm transition-opacity duration-200 ease-out",s?"opacity-100":"opacity-0"),onMouseDown:a=>{a.target===a.currentTarget&&t()},children:d.jsxs("div",{className:W("flex h-full w-full max-w-[440px] flex-col border-l border-line bg-surface-base shadow-2xl transition-transform duration-200 ease-out",s?"translate-x-0":"translate-x-full"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Session info"}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close session info panel",children:"close"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:n?d.jsx(vP,{session:n,meta:r,messages:o}):d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"No session attached."})})]})}):null}function vP({session:e,meta:t,messages:n}){const o=zb(5e3),{primary:r}=Ol(e),i=I.useMemo(()=>xP(n),[n]);return d.jsxs("div",{className:"space-y-5 text-[12px]",children:[d.jsxs(bi,{title:"Summary",children:[d.jsx(fn,{label:"Session",value:r}),d.jsx(fn,{label:"Client",value:t.client.title||t.client.name||e.clientName||"—",secondary:t.client.version?`v${t.client.version}${t.client.platform?` · ${t.client.platform}`:""}`:null}),d.jsx(fn,{label:"Agent",value:t.agent.name||bP(e.agentCommand)||"—",secondary:t.agent.version?`v${t.agent.version}`:null}),d.jsx(fn,{label:"Protocol",value:t.protocolVersion!==null?`ACP v${t.protocolVersion}`:"—"}),d.jsx(fn,{label:"Started",value:Sa(e.startedAt,o)}),d.jsx(fn,{label:"Messages",value:`${n.length} (req ${i.req} · rsp ${i.rsp} · ntf ${i.note} · err ${i.err})`})]}),d.jsxs(bi,{title:"Client capabilities",children:[d.jsx(jo,{label:"fs.readTextFile",enabled:t.clientCapabilities.fsReadTextFile}),d.jsx(jo,{label:"fs.writeTextFile",enabled:t.clientCapabilities.fsWriteTextFile}),d.jsx(jo,{label:"terminal",enabled:t.clientCapabilities.terminal}),d.jsx(jo,{label:"auth.terminal",enabled:t.clientCapabilities.authTerminal}),d.jsx(jo,{label:"auth.gateway",enabled:t.clientCapabilities.authGateway})]}),d.jsxs(bi,{title:"Agent capabilities",children:[d.jsx(jo,{label:"prompt",enabled:t.agentCapabilities.prompt}),d.jsx(jo,{label:"loadSession",enabled:t.agentCapabilities.loadSession}),d.jsx(fn,{label:"Auth methods",value:String(t.agent.authMethods)})]}),d.jsxs(bi,{title:"Runtime state",children:[d.jsx(fn,{label:"Mode",value:t.runtime.currentMode??"—",secondary:t.runtime.modeChanges>0?`changed ${t.runtime.modeChanges}× this session`:null}),d.jsx(fn,{label:"Model",value:t.runtime.currentModel??"—",secondary:t.runtime.modelChanges>0?`changed ${t.runtime.modelChanges}× this session`:null}),d.jsx(fn,{label:"Commands",value:t.runtime.availableCommands.length>0?t.runtime.availableCommands.join(", "):"—",wrap:!0})]}),t.extensions.jetbrainsProxyConfig!==null&&d.jsx(bi,{title:"JetBrains extensions",children:d.jsx("div",{className:"rounded-sm border border-line bg-surface-elev p-3 font-mono text-[11px] text-ink-secondary",children:d.jsx(ol,{value:t.extensions.jetbrainsProxyConfig})})})]})}function bP(e){if(!e)return null;const t=e.trim().split(/\s+/);if(t[0]==="npx")for(let n=1;n<t.length;n++){const o=t[n];if(!o.startsWith("-"))return o}return t[0]??null}function xP(e){let t=0,n=0,o=0,r=0;for(const i of e)i.kind==="request"?t++:i.kind==="response"?n++:i.kind==="notification"?o++:i.kind==="error"&&r++;return{req:t,rsp:n,note:o,err:r}}function bi({title:e,children:t}){return d.jsxs("div",{children:[d.jsx("h3",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("div",{className:"space-y-1.5",children:t})]})}function fn({label:e,value:t,secondary:n,wrap:o=!1}){return d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsxs("span",{className:W("flex-1 text-ink-primary",o?"whitespace-normal break-words":"truncate"),title:o?void 0:t,children:[t,n&&d.jsx("span",{className:"ml-2 text-[10px] text-ink-muted",children:n})]})]})}function jo({label:e,enabled:t}){return d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:W("flex-1 font-mono text-[11px]",t?"text-accent-ok":"text-ink-dim"),children:t?"✓ enabled":"— not advertised"})]})}function wP({left:e,right:t,storageKey:n,initialLeftFraction:o=.6,minLeft:r=320,minRight:i=320}){const s=I.useRef(null),[a,l]=I.useState(null),c=I.useRef(!1);I.useEffect(()=>{if(!s.current)return;const y=s.current.clientWidth,g=n?Number(localStorage.getItem(n)):NaN;n&&Number.isFinite(g)&&g>0&&g<y?l(g):l(Math.round(y*o))},[o,n]);const f=I.useCallback(y=>{y.preventDefault(),c.current=!0,y.currentTarget.setPointerCapture(y.pointerId)},[]),m=I.useCallback(y=>{if(!c.current||!s.current)return;const g=s.current.getBoundingClientRect(),b=y.clientX-g.left,v=g.width,p=Math.min(Math.max(b,r),v-i);l(p),n&&localStorage.setItem(n,String(Math.round(p)))},[r,i,n]),h=I.useCallback(y=>{c.current=!1;try{y.currentTarget.releasePointerCapture(y.pointerId)}catch{}},[]);return d.jsxs("div",{ref:s,className:"flex h-full w-full overflow-hidden",children:[d.jsx("div",{style:{width:a??"60%"},className:"flex h-full min-w-0 flex-col",children:e}),d.jsx("div",{role:"separator","aria-orientation":"vertical",className:W("group relative w-px shrink-0 cursor-col-resize bg-line",'before:absolute before:inset-y-0 before:-left-1 before:-right-1 before:content-[""]'),onPointerDown:f,onPointerMove:m,onPointerUp:h,onPointerCancel:h,children:d.jsx("div",{className:"absolute inset-y-0 left-0 w-px bg-line transition-colors group-hover:bg-accent-out/40"})}),d.jsx("div",{className:"flex h-full min-w-0 flex-1 flex-col",children:t})]})}function SP(){const e=ne(n=>n.messages),t=I.useMemo(()=>{let n=0,o=0,r=0,i=0,s=0;const a=new Map;for(const y of e)switch(a.set(y.seq,y.timestamp),s+=y.raw.length,y.kind){case"request":n+=1;break;case"response":o+=1;break;case"notification":r+=1;break;case"error":i+=1;break}const l=Tl(e),c=[];for(const y of e){if(y.kind!=="response"&&y.kind!=="error")continue;const g=l.get(y.seq);if(g===void 0)continue;const b=a.get(g);b!==void 0&&c.push(y.timestamp-b)}c.sort((y,g)=>y-g);const f=c.length?dh(c,50):null,m=c.length?dh(c,99):null,h=MC(Kp(e));return{total:e.length,req:n,res:o,note:r,err:i,bytes:s,p50:f,p99:m,spec:h}},[e]);return d.jsxs("footer",{className:"flex items-center justify-between gap-6 border-t border-line bg-surface-elev/80 px-5 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("div",{className:"flex items-center gap-5",children:[d.jsx(Qn,{label:"msgs",value:t.total,tone:"primary"}),d.jsx(Qn,{label:"req",value:t.req,tone:"out"}),d.jsx(Qn,{label:"rsp",value:t.res,tone:"in"}),d.jsx(Qn,{label:"ntf",value:t.note,tone:"note"}),d.jsx(Qn,{label:"err",value:t.err,tone:t.err>0?"error":"muted"})]}),d.jsxs("div",{className:"flex items-center gap-5",children:[d.jsx(Qn,{label:"p50",value:t.p50!==null?Ht(t.p50):"—",tone:"primary"}),d.jsx(Qn,{label:"p99",value:t.p99!==null?Ht(t.p99):"—",tone:"primary"}),d.jsx(Qn,{label:"bytes",value:t.total>0?Rl(t.bytes):"—",tone:"primary"}),t.spec.checked>0&&d.jsx(kP,{invalidFrames:t.spec.invalidFrames,totalErrors:t.spec.totalErrors,affectedMethods:t.spec.affectedMethods}),d.jsx($P,{})]})]})}function $P(){return d.jsxs("a",{href:"https://github.com/maksugr/acp-devtools",target:"_blank",rel:"noreferrer noopener",title:"Enjoying acp-devtools? Star it on GitHub — thank you!","aria-label":"Star acp-devtools on GitHub",className:"inline-flex items-baseline gap-1 text-ink-muted transition-colors hover:text-accent-warn focus-visible:text-accent-warn focus-visible:outline-none",children:[d.jsx("span",{"aria-hidden":"true",className:"text-[10px]",children:"★"}),d.jsx("span",{className:"text-[9px] tracking-normal",children:"Star on GitHub"})]})}function kP({invalidFrames:e,totalErrors:t,affectedMethods:n}){if(e===0)return d.jsx(ds,{label:d.jsx("span",{className:"font-sans",children:"every frame validates against the ACP schema"}),tone:"info",children:d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:"spec"}),d.jsx("span",{className:"text-accent-ok",children:"✓"})]})});const o=`${t} schema error${t===1?"":"s"} in ${e} frame${e===1?"":"s"}`;return d.jsx(ds,{tone:"warn",label:d.jsxs("div",{className:"space-y-1.5 font-sans",children:[d.jsx("div",{children:o}),n.length>0&&d.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["methods: ",n.join(", ")]})]}),children:d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:"spec"}),d.jsxs("span",{className:"text-accent-error",children:["⚠ ",e]})]})})}function Qn({label:e,value:t,tone:n}){const o=n==="primary"?"text-ink-primary":n==="out"?"text-accent-out":n==="in"?"text-accent-in":n==="note"?"text-accent-note":n==="error"?"text-accent-error":"text-ink-muted";return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:e}),d.jsx("span",{className:o,children:t})]})}const ql=0,So=1,ti=2,Fb=4;function Ph(e){return()=>e}function TP(e){e()}function Bb(e,t){return n=>e(t(n))}function Ih(e,t){return()=>e(t)}function _P(e,t){return n=>e(t,n)}function ef(e){return e!==void 0}function jP(...e){return()=>{e.map(TP)}}function ni(){}function Ul(e,t){return t(e),e}function CP(e,t){return t(e)}function Ue(...e){return e}function $e(e,t){return e(So,t)}function me(e,t){e(ql,t)}function tf(e){e(ti)}function Le(e){return e(Fb)}function oe(e,t){return $e(e,_P(t,ql))}function ln(e,t){const n=e(So,o=>{n(),t(o)});return n}function Oh(e){let t,n;return o=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{o(t)},e)}}function Hb(e,t){return e===t}function Me(e=Hb){let t;return n=>o=>{e(t,o)||(t=o,n(o))}}function ae(e){return t=>n=>{e(n)&&t(n)}}function Y(e){return t=>Bb(t,e)}function hn(e){return t=>()=>{t(e)}}function z(e,...t){const n=NP(...t);return(o,r)=>{switch(o){case ti:tf(e);return;case So:return $e(e,n(r))}}}function wn(e,t){return n=>o=>{n(t=e(t,o))}}function Jo(e){return t=>n=>{e>0?e--:t(n)}}function In(e){let t=null,n;return o=>r=>{t=r,!n&&(n=setTimeout(()=>{n=void 0,o(t)},e))}}function he(...e){const t=new Array(e.length);let n=0,o=null;const r=2**e.length-1;return e.forEach((i,s)=>{const a=2**s;$e(i,l=>{const c=n;n|=a,t[s]=l,c!==r&&n===r&&o&&(o(),o=null)})}),i=>s=>{const a=()=>{i([s].concat(t))};n===r?a():o=a}}function NP(...e){return t=>e.reduceRight(CP,t)}function EP(e){let t,n;const o=()=>t==null?void 0:t();return function(r,i){switch(r){case So:return i?n===i?void 0:(o(),n=i,t=$e(e,i),t):(o(),ni);case ti:o(),n=null;return}}}function V(e){let t=e;const n=ve();return(o,r)=>{switch(o){case ql:t=r;break;case So:{r(t);break}case Fb:return t}return n(o,r)}}function ht(e,t){return Ul(V(t),n=>oe(e,n))}function ve(){const e=[];return(t,n)=>{switch(t){case ql:e.slice().forEach(o=>{o(n)});return;case ti:e.splice(0,e.length);return;case So:return e.push(n),()=>{const o=e.indexOf(n);o>-1&&e.splice(o,1)}}}}function At(e){return Ul(ve(),t=>oe(e,t))}function xe(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:PP(),singleton:n}}const PP=()=>Symbol();function IP(e){const t=new Map,n=({constructor:o,dependencies:r,id:i,singleton:s})=>{if(s&&t.has(i))return t.get(i);const a=o(r.map(l=>n(l)));return s&&t.set(i,a),a};return n(e)}function Je(...e){const t=ve(),n=new Array(e.length);let o=0;const r=2**e.length-1;return e.forEach((i,s)=>{const a=2**s;$e(i,l=>{n[s]=l,o|=a,o===r&&me(t,n)})}),function(i,s){switch(i){case ti:{tf(t);return}case So:return o===r&&s(n),$e(t,s)}}}function se(e,t=Hb){return z(e,Me(t))}function qd(...e){return function(t,n){switch(t){case ti:return;case So:return jP(...e.map(o=>$e(o,n)))}}}const tt={DEBUG:0,INFO:1,WARN:2,ERROR:3},OP={[tt.DEBUG]:"debug",[tt.ERROR]:"error",[tt.INFO]:"log",[tt.WARN]:"warn"},RP=()=>typeof globalThis>"u"?window:globalThis,$o=xe(()=>{const e=V(tt.ERROR);return{log:V((t,n,o=tt.INFO)=>{const r=RP().VIRTUOSO_LOG_LEVEL??Le(e);o>=r&&console[OP[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),Ud=new WeakMap;function Vb(e){return"self"in e?e.document.documentElement:e}function AP(e){const t=Vb(e),n=Ud.get(t);if(n!==void 0)return n;const o=t.ownerDocument.defaultView.getComputedStyle(t).direction==="rtl";return Ud.set(t,o),o}function Rh(e){Ud.delete(Vb(e))}function Wb(e,t){return AP(e)?-t:t}const Uo=Wb;function Ah(e,t){return Wb(e,t)}function Xo(e,t,n){return nf(e,t,n).callbackRef}function nf(e,t,n){const o=te.useRef(null);let r=s=>{};const i=te.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(s=>{const a=()=>{const l=s[0].target;l.offsetParent!==null&&e(l)};n?a():requestAnimationFrame(a)}):null,[e,n]);return r=s=>{s&&t?(i==null||i.observe(s),o.current=s):(o.current&&(i==null||i.unobserve(o.current)),o.current=null)},{callbackRef:r,ref:o}}function MP(e,t,n,o,r,i,s,a,l){const c=te.useCallback(f=>{const m=qP(f.children,t,a?"offsetWidth":"offsetHeight",r);let h=f.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const y=h.lastElementChild.dataset.viewportType==="window";let g;y&&(g=h.ownerDocument.defaultView);const b=s?a?s.scrollWidth:s.scrollHeight:y?a?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight:a?h.scrollWidth:h.scrollHeight,v=s?a?s.offsetWidth:s.offsetHeight:y?a?g.innerWidth:g.innerHeight:a?h.offsetWidth:h.offsetHeight,p=s?a?Uo(s,s.scrollLeft):s.scrollTop:y?a?Uo(g,g.scrollX||g.document.documentElement.scrollLeft):g.scrollY||g.document.documentElement.scrollTop:a?Uo(h,h.scrollLeft):h.scrollTop;o({scrollHeight:b,scrollTop:Math.max(p,0),viewportHeight:v}),i==null||i(a?Mh("column-gap",getComputedStyle(f).columnGap,r):Mh("row-gap",getComputedStyle(f).rowGap,r)),m!==null&&e(m)},[e,t,r,i,s,o,a]);return nf(c,n,l)}function qP(e,t,n,o){const r=e.length;if(r===0)return null;const i=[];for(let s=0;s<r;s++){const a=e.item(s);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),f=t(a,n);if(f===0&&o("Zero-sized element, this should not happen",{child:a},tt.ERROR),f===c)continue;const m=i[i.length-1];i.length===0||m.size!==f||m.endIndex!==l-1?i.push({endIndex:l,size:f,startIndex:l}):i[i.length-1].endIndex++}return i}function Mh(e,t,n){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&n(`${e} was not resolved to pixel value correctly`,t,tt.WARN),t==="normal"?0:parseInt(t??"0",10)}function Kb(e,t,n){const o=te.useRef(null),r=te.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),f=c.width;let m,h;if(t){const y=t.getBoundingClientRect(),g=c.top-y.top;h=y.height-Math.max(0,g),m=g+t.scrollTop}else{const y=s.current.ownerDocument.defaultView;h=y.innerHeight-Math.max(0,c.top),m=c.top+y.scrollY}o.current={listHeight:c.height,offsetTop:m,visibleHeight:h,visibleWidth:f},e(o.current)},[e,t]),{callbackRef:i,ref:s}=nf(r,!0,n),a=te.useCallback(()=>{r(s.current)},[r,s]);return te.useEffect(()=>{var c;if(t){t.addEventListener("scroll",a);const f=new ResizeObserver(()=>{requestAnimationFrame(a)});return f.observe(t),()=>{t.removeEventListener("scroll",a),f.unobserve(t)}}const l=(c=s.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,t,s]),i}const $t=xe(()=>{const e=ve(),t=ve(),n=V(0),o=ve(),r=V(0),i=ve(),s=ve(),a=V(0),l=V(0),c=V(0),f=V(0),m=ve(),h=ve(),y=V(!1),g=V(!1),b=V(!1);return oe(z(e,Y(({scrollTop:v})=>v)),t),oe(z(e,Y(({scrollHeight:v})=>v)),s),oe(t,r),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:f,headerHeight:a,horizontalDirection:g,scrollBy:h,scrollContainerState:e,scrollHeight:s,scrollingInProgress:y,scrollTo:m,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:i}},[],{singleton:!0}),ms={lvl:0};function Gb(e,t){const n=e.length;if(n===0)return[];let{index:o,value:r}=t(e[0]);const i=[];for(let s=1;s<n;s++){const{index:a,value:l}=t(e[s]);i.push({end:a-1,start:o,value:r}),o=a,r=l}return i.push({end:1/0,start:o,value:r}),i}function Te(e){return e===ms}function hs(e,t){if(!Te(e))return t===e.k?e.v:t<e.k?hs(e.l,t):hs(e.r,t)}function dn(e,t,n="k"){if(Te(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const o=dn(e.r,t,n);return o[0]===-1/0?[e.k,e.v]:o}return dn(e.l,t,n)}function Pt(e,t,n){return Te(e)?Yb(t,n,1):t===e.k?Xe(e,{k:t,v:n}):t<e.k?qh(Xe(e,{l:Pt(e.l,t,n)})):qh(Xe(e,{r:Pt(e.r,t,n)}))}function Rr(){return ms}function Ar(e,t,n){if(Te(e))return[];const o=dn(e,t)[0];return UP(Dd(e,o,n))}function Ld(e,t){if(Te(e))return ms;const{k:n,l:o,r}=e;if(t===n){if(Te(o))return r;if(Te(r))return o;const[i,s]=Qb(o);return ka(Xe(e,{k:i,l:Jb(o),v:s}))}return t<n?ka(Xe(e,{l:Ld(o,t)})):ka(Xe(e,{r:Ld(r,t)}))}function Lo(e){return Te(e)?[]:[...Lo(e.l),{k:e.k,v:e.v},...Lo(e.r)]}function Dd(e,t,n){if(Te(e))return[];const{k:o,l:r,r:i,v:s}=e;let a=[];return o>t&&(a=a.concat(Dd(r,t,n))),o>=t&&o<=n&&a.push({k:o,v:s}),o<=n&&(a=a.concat(Dd(i,t,n))),a}function ka(e){const{l:t,lvl:n,r:o}=e;if(o.lvl>=n-1&&t.lvl>=n-1)return e;if(n>o.lvl+1){if(Sc(t))return Xb(Xe(e,{lvl:n-1}));if(!Te(t)&&!Te(t.r))return Xe(t.r,{l:Xe(t,{r:t.r.l}),lvl:n,r:Xe(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Sc(e))return zd(Xe(e,{lvl:n-1}));if(!Te(o)&&!Te(o.l)){const r=o.l,i=Sc(r)?o.lvl-1:o.lvl;return Xe(r,{l:Xe(e,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:zd(Xe(o,{l:r.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Xe(e,t){return Yb(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Jb(e){return Te(e.r)?e.l:ka(Xe(e,{r:Jb(e.r)}))}function Sc(e){return Te(e)||e.lvl>e.r.lvl}function Qb(e){return Te(e.r)?[e.k,e.v]:Qb(e.r)}function Yb(e,t,n,o=ms,r=ms){return{k:e,l:o,lvl:n,r,v:t}}function qh(e){return zd(Xb(e))}function Xb(e){const{l:t}=e;return!Te(t)&&t.lvl===e.lvl?Xe(t,{r:Xe(e,{l:t.r})}):e}function zd(e){const{lvl:t,r:n}=e;return!Te(n)&&!Te(n.r)&&n.lvl===t&&n.r.lvl===t?Xe(n,{l:Xe(e,{r:n.l}),lvl:t+1}):e}function UP(e){return Gb(e,({k:t,v:n})=>({index:t,value:n}))}function Zb(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function ys(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const of=xe(()=>({recalcInProgress:V(!1)}),[],{singleton:!0});function ex(e,t,n){return e[al(e,t,n)]}function al(e,t,n,o=0){let r=e.length-1;for(;o<=r;){const i=Math.floor((o+r)/2),s=e[i],a=n(s,t);if(a===0)return i;if(a===-1){if(r-o<2)return i-1;r=i-1}else{if(r===o)return i;o=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function LP(e,t,n,o){const r=al(e,t,o),i=al(e,n,o,r);return e.slice(r,i+1)}function vo(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ll(e){return!Te(e.groupOffsetTree)}function rf({index:e},t){return t===e?0:t<e?-1:1}function DP(){return{groupIndices:[],groupOffsetTree:Rr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Rr()}}function zP(e,t){let n=Te(e)?0:1/0;for(const o of t){const{endIndex:r,size:i,startIndex:s}=o;if(n=Math.min(n,s),Te(e)){e=Pt(e,0,i);continue}const a=Ar(e,s-1,r+1);if(a.some(GP(o)))continue;let l=!1,c=!1;for(const{end:f,start:m,value:h}of a)l?(r>=m||i===h)&&(e=Ld(e,m)):(c=h!==i,l=!0),f>r&&r>=m&&h!==i&&(e=Pt(e,r+1,h));c&&(e=Pt(e,s,i))}return[e,n]}function FP(e){return typeof e.groupIndex<"u"}function BP({offset:e},t){return t===e?0:t<e?-1:1}function gs(e,t,n){if(t.length===0)return 0;const{index:o,offset:r,size:i}=ex(t,e,rf),s=e-o,a=i*s+(s-1)*n+r;return a>0?a+n:a}function tx(e,t){if(!Ll(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function nx(e,t,n){if(FP(e))return t.groupIndices[e.groupIndex]+1;const o=e.index==="LAST"?n:e.index;let r=tx(o,t);return r=Math.max(0,r,Math.min(n,r)),r}function HP(e,t,n,o=0){return o>0&&(t=Math.max(t,ex(e,o,rf).offset)),Gb(LP(e,t,n,BP),KP)}function VP(e,[t,n,o,r]){t.length>0&&o("received item sizes",t,tt.DEBUG);const i=e.sizeTree;let s=i,a=0;if(n.length>0&&Te(i)&&t.length===2){const h=t[0].size,y=t[1].size;s=n.reduce((g,b)=>Pt(Pt(g,b,h),b+1,y),s)}else[s,a]=zP(s,t);if(s===i)return e;const{lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m}=Fd(e.offsetTree,a,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,y)=>Pt(h,y,gs(y,m,r)),Rr()),lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m,sizeTree:s}}function WP(e){return Lo(e).map(({k:t,v:n},o,r)=>{const i=r[o+1];return{endIndex:i!==void 0?i.k-1:1/0,size:n,startIndex:t}})}function Uh(e,t){let n=0,o=0;for(;n<e;)n+=t[o+1]-t[o]-1,o++;return o-(n===e?0:1)}function Fd(e,t,n,o){let r=e,i=0,s=0,a=0,l=0;if(t!==0){l=al(r,t-1,rf),a=r[l].offset;const c=dn(n,t-1);i=c[0],s=c[1],r.length&&r[l].size===dn(n,t)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:c,value:f}of Ar(n,t,1/0)){const m=c-i,h=m*s+a+m*o;r.push({index:c,offset:h,size:f}),i=c,a=h,s=f}return{lastIndex:i,lastOffset:a,lastSize:s,offsetTree:r}}function KP(e){return{index:e.index,value:e}}function GP(e){const{endIndex:t,size:n,startIndex:o}=e;return r=>r.start===o&&(r.end===t||r.end===1/0)&&r.value===n}const JP={offsetHeight:"height",offsetWidth:"width"},kn=xe(([{log:e},{recalcInProgress:t}])=>{const n=ve(),o=ve(),r=ht(o,0),i=ve(),s=ve(),a=V(0),l=V([]),c=V(void 0),f=V(void 0),m=V(void 0),h=V(void 0),y=V(($,C)=>vo($,JP[C])),g=V(void 0),b=V(0),v=DP(),p=ht(z(n,he(l,e,b),wn(VP,v),Me()),v),u=ht(z(l,Me(),wn(($,C)=>({current:C,prev:$.current}),{current:[],prev:[]}),Y(({prev:$})=>$)),[]);oe(z(l,ae($=>$.length>0),he(p,b),Y(([$,C,R])=>{const M=$.reduce((F,H,L)=>Pt(F,H,gs(H,C.offsetTree,R)||L),Rr());return{...C,groupIndices:$,groupOffsetTree:M}})),p),oe(z(o,he(p),ae(([$,{lastIndex:C}])=>$<C),Y(([$,{lastIndex:C,lastSize:R}])=>[{endIndex:C,size:R,startIndex:$}])),n),oe(c,f);const x=ht(z(c,Y($=>$===void 0)),!0);oe(z(f,ae($=>$!==void 0&&Te(Le(p).sizeTree)),Y($=>{const C=Le(m),R=Le(l).length>0;return C!==void 0&&C!==0?R?[{endIndex:0,size:C,startIndex:0},{endIndex:1,size:$,startIndex:1}]:[]:[{endIndex:0,size:$,startIndex:0}]})),n),oe(z(h,ae($=>$!==void 0&&$.length>0&&Te(Le(p).sizeTree)),Y($=>{const C=[];let R=$[0],M=0;for(let F=1;F<$.length;F++){const H=$[F];H!==R&&(C.push({endIndex:F-1,size:R,startIndex:M}),R=H,M=F)}return C.push({endIndex:$.length-1,size:R,startIndex:M}),C})),n),oe(z(l,he(m,f),ae(([,$,C])=>$!==void 0&&C!==void 0),Y(([$,C,R])=>{const M=[];for(let F=0;F<$.length;F++){const H=$[F],L=$[F+1];M.push({startIndex:H,endIndex:H,size:C}),L!==void 0&&M.push({startIndex:H+1,endIndex:L-1,size:R})}return M})),n);const S=At(z(n,he(p),wn(({sizes:$},[C,R])=>({changed:R!==$,sizes:R}),{changed:!1,sizes:v}),Y($=>$.changed)));$e(z(a,wn(($,C)=>({diff:$.prev-C,prev:C}),{diff:0,prev:0}),Y($=>$.diff)),$=>{const{groupIndices:C}=Le(p);if($>0)me(t,!0),me(i,$+Uh($,C));else if($<0){const R=Le(u);R.length>0&&($-=Uh(-$,R)),me(s,$)}}),$e(z(a,he(e)),([$,C])=>{$<0&&C("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},tt.ERROR)});const T=At(i);oe(z(i,he(p),Y(([$,C])=>{const R=C.groupIndices.length>0,M=[],F=C.lastSize;if(R){const H=hs(C.sizeTree,0);let L=0,U=0;for(;L<$;){const Q=C.groupIndices[U],ee=C.groupIndices.length===U+1?1/0:C.groupIndices[U+1]-Q-1;M.push({endIndex:Q,size:H,startIndex:Q}),M.push({endIndex:Q+1+ee-1,size:F,startIndex:Q+1}),U++,L+=ee+1}const D=Lo(C.sizeTree);return L!==$&&D.shift(),D.reduce((Q,{k:ee,v:q})=>{let G=Q.ranges;return Q.prevSize!==0&&(G=[...Q.ranges,{endIndex:ee+$-1,size:Q.prevSize,startIndex:Q.prevIndex}]),{prevIndex:ee+$,prevSize:q,ranges:G}},{prevIndex:$,prevSize:0,ranges:M}).ranges}return Lo(C.sizeTree).reduce((H,{k:L,v:U})=>({prevIndex:L+$,prevSize:U,ranges:[...H.ranges,{endIndex:L+$-1,size:H.prevSize,startIndex:H.prevIndex}]}),{prevIndex:0,prevSize:F,ranges:[]}).ranges})),n);const N=At(z(s,he(p,b),Y(([$,{offsetTree:C},R])=>{const M=-$;return gs(M,C,R)})));return oe(z(s,he(p,b),Y(([$,C,R])=>{if(C.groupIndices.length>0){if(Te(C.sizeTree))return C;let F=Rr();const H=Le(u);let L=0,U=0,D=0;for(;L<-$;){D=H[U];const Q=H[U+1]-D-1;U++,L+=Q+1}if(F=Lo(C.sizeTree).reduce((Q,{k:ee,v:q})=>Pt(Q,Math.max(0,ee+$),q),F),L!==-$){const Q=hs(C.sizeTree,D);F=Pt(F,0,Q);const ee=dn(C.sizeTree,-$+1)[1];F=Pt(F,1,ee)}return{...C,sizeTree:F,...Fd(C.offsetTree,0,F,R)}}const M=Lo(C.sizeTree).reduce((F,{k:H,v:L})=>Pt(F,Math.max(0,H+$),L),Rr());return{...C,sizeTree:M,...Fd(C.offsetTree,0,M,R)}})),p),{beforeUnshiftWith:T,data:g,defaultItemSize:f,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:m,gap:b,groupIndices:l,heightEstimates:h,itemSize:y,listRefresh:S,shiftWith:s,shiftWithOffset:N,sizeRanges:n,sizes:p,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:i}},Ue($o,of),{singleton:!0});function QP(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const ox=xe(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const i=ve(),s=ve(),a=At(z(i,Y(QP)));return oe(z(a,Y(l=>l.totalCount)),n),oe(z(a,Y(l=>l.groupIndices)),e),oe(z(Je(r,t,o),ae(([l,c])=>Ll(c)),Y(([l,c,f])=>dn(c.groupOffsetTree,Math.max(l-f,0),"v")[0]),Me(),Y(l=>[l])),s),{groupCounts:i,topItemsIndexes:s}},Ue(kn,$t)),ko=xe(([{log:e}])=>{const t=V(!1),n=At(z(t,ae(o=>o),Me()));return $e(t,o=>{o&&Le(e)("props updated",{},tt.DEBUG)}),{didMount:n,propsReady:t}},Ue($o),{singleton:!0}),YP=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function rx(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!YP)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const Ns=xe(([{gap:e,listRefresh:t,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:i,footerHeight:s,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:f,viewportHeight:m},{log:h}])=>{const y=ve(),g=ve(),b=V(0);let v=null,p=null,u=null;function x(){v!==null&&(v(),v=null),u!==null&&(u(),u=null),p&&(clearTimeout(p),p=null),me(l,!1)}return oe(z(y,he(n,m,o,b,a,s,h),he(e,i,r),Y(([[S,T,N,$,C,R,M,F],H,L,U])=>{const D=rx(S),{align:Q,behavior:ee,offset:q}=D,G=$-1,P=nx(D,T,G);let j=gs(P,T.offsetTree,H)+R;Q==="end"?(j+=L+dn(T.sizeTree,P)[1]-N+U,P===G&&(j+=M)):Q==="center"?j+=(L+dn(T.sizeTree,P)[1]-N+U)/2:j-=C,q!==void 0&&q!==0&&(j+=q);const A=_=>{x(),_?(F("retrying to scroll to",{location:S},tt.DEBUG),me(y,S)):(me(g,!0),F("list did not change, scroll successful",{},tt.DEBUG))};if(x(),ee==="smooth"){let _=!1;u=$e(t,w=>{_=_||w}),v=ln(f,()=>{A(_)})}else v=ln(z(t,XP(150)),A);return p=setTimeout(()=>{x()},1200),me(l,!0),F("scrolling from index to",{behavior:ee,index:P,top:j},tt.DEBUG),{behavior:ee,top:j}})),c),{scrollTargetReached:g,scrollToIndex:y,topListHeight:b}},Ue(kn,$t,$o),{singleton:!0});function XP(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return o=>{o&&(t(!0),clearTimeout(n))}}}function sf(e,t){e===0?t():requestAnimationFrame(()=>{sf(e-1,t)})}function af(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Es=xe(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:i},{didMount:s}])=>{const a=V(!0),l=V(0),c=V(!0);return oe(z(s,he(l),ae(([f,m])=>m!==0),hn(!1)),a),oe(z(s,he(l),ae(([f,m])=>m!==0),hn(!1)),c),$e(z(Je(t,s),he(a,n,e,c),ae(([[,f],m,{sizeTree:h},y,g])=>f&&(!Te(h)||ef(y))&&!m&&!g),he(l)),([,f])=>{ln(r,()=>{me(c,!0)}),sf(4,()=>{ln(o,()=>{me(a,!0)}),me(i,f)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},Ue(kn,$t,Ns,ko),{singleton:!0});function ix(e,t){return Math.abs(e-t)<1.01}const vs="up",zi="down",ZP="none",eI={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},tI=0,Ps=xe(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:i}])=>{const s=V(!1),a=V(!0),l=ve(),c=ve(),f=V(4),m=V(tI),h=ht(z(qd(z(se(r),Jo(1),hn(!0)),z(se(r),Jo(1),hn(!1),Oh(100))),Me()),!1),y=ht(z(qd(z(n,hn(!0)),z(n,hn(!1),Oh(200))),Me()),!1);oe(z(Je(se(r),se(m)),Y(([u,x])=>u<=x),Me()),a),oe(z(a,In(50)),c);const g=At(z(Je(o,se(i),se(t),se(e),se(f)),wn((u,[{scrollHeight:x,scrollTop:S},T,N,$,C])=>{const R=S+T-x>-C,M={scrollHeight:x,scrollTop:S,viewportHeight:T};if(R){let H,L;return S>u.state.scrollTop?(H="SCROLLED_DOWN",L=u.state.scrollTop-S):(H="SIZE_DECREASED",L=u.state.scrollTop-S||u.scrollTopDelta),{atBottom:!0,atBottomBecause:H,scrollTopDelta:L,state:M}}let F;return M.scrollHeight>u.state.scrollHeight?F="SIZE_INCREASED":T<u.state.viewportHeight?F="VIEWPORT_HEIGHT_DECREASING":S<u.state.scrollTop?F="SCROLLING_UPWARDS":F="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:F,state:M}},eI),Me((u,x)=>u!==void 0&&u.atBottom===x.atBottom))),b=ht(z(o,wn((u,{scrollHeight:x,scrollTop:S,viewportHeight:T})=>{if(!ix(u.scrollHeight,x)){const N=x-(S+T)<1;return u.scrollTop!==S&&N?{changed:!0,jump:u.scrollTop-S,scrollHeight:x,scrollTop:S}:{changed:!0,jump:0,scrollHeight:x,scrollTop:S}}return{changed:!1,jump:0,scrollHeight:x,scrollTop:S}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ae(u=>u.changed),Y(u=>u.jump)),0);oe(z(g,Y(u=>u.atBottom)),s),oe(z(s,In(50)),l);const v=V(zi);oe(z(o,Y(({scrollTop:u})=>u),Me(),wn((u,x)=>Le(y)?{direction:u.direction,prevScrollTop:x}:{direction:x<u.prevScrollTop?vs:zi,prevScrollTop:x},{direction:zi,prevScrollTop:0}),Y(u=>u.direction)),v),oe(z(o,In(50),hn(ZP)),v);const p=V(0);return oe(z(h,ae(u=>!u),hn(0)),p),oe(z(r,In(100),he(h),ae(([u,x])=>x),wn(([u,x],[S])=>[x,S],[0,0]),Y(([u,x])=>x-u)),p),{atBottomState:g,atBottomStateChange:l,atBottomThreshold:f,atTopStateChange:c,atTopThreshold:m,isAtBottom:s,isAtTop:a,isScrolling:h,lastJumpDueToItemResize:b,scrollDirection:v,scrollVelocity:p}},Ue($t)),bs="top",xs="bottom",Lh="none";function Dh(e,t,n){return typeof e=="number"?n===vs&&t===bs||n===zi&&t===xs?e:0:n===vs?t===bs?e.main:e.reverse:t===xs?e.main:e.reverse}function zh(e,t){return typeof e=="number"?e:e[t]??0}const lf=xe(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const i=ve(),s=V(0),a=V(0),l=V(0),c=ht(z(Je(se(o),se(r),se(n),se(i,ys),se(l),se(s),se(t),se(e),se(a)),Y(([f,m,h,[y,g],b,v,p,u,x])=>{const S=f-u,T=v+p,N=Math.max(h-S,0);let $=Lh;const C=zh(x,bs),R=zh(x,xs);return y-=u,y+=h+p,g+=h+p,g-=u,y>f+T-C&&($=vs),g<f-N+m+R&&($=zi),$!==Lh?[Math.max(S-h-Dh(b,bs,$)-C,0),S-N-p+m+Dh(b,xs,$)+R]:null}),ae(f=>f!==null),Me(ys)),[0,0]);return{increaseViewportBy:a,listBoundary:i,overscan:l,topListHeight:s,visibleRange:c}},Ue($t),{singleton:!0});function nI(e,t,n){if(Ll(t)){const o=tx(e,t);return[{index:dn(t.groupOffsetTree,o)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:o,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const $c={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ta(e,t,n,o,r,i){const{lastIndex:s,lastOffset:a,lastSize:l}=r;let c=0,f=0;if(e.length>0){c=e[0].offset;const b=e[e.length-1];f=b.offset+b.size}const m=n-s,h=a+m*l+(m-1)*o,y=c,g=h-f;return{bottom:f,firstItemIndex:i,items:Fh(e,r,i),offsetBottom:g,offsetTop:c,top:y,topItems:Fh(t,r,i),topListHeight:t.reduce((b,v)=>v.size+b,0),totalCount:n}}function sx(e,t,n,o,r,i){let s=0;if(n.groupIndices.length>0)for(const f of n.groupIndices){if(f-s>=e)break;s++}const a=e+s,l=af(t,a),c=Array.from({length:a}).map((f,m)=>({data:i[m+l],index:m+l,offset:0,size:0}));return Ta(c,[],a,r,n,o)}function Fh(e,t,n){if(e.length===0)return[];if(!Ll(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const o=e[0].index,r=e[e.length-1].index,i=[],s=Ar(t.groupOffsetTree,o,r);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=s.shift(),l=t.groupIndices.indexOf(a.start));let f;c.index===a.start?f={index:l,type:"group"}:f={groupIndex:l,index:c.index-(l+1)+n},i.push({...f,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}function Bh(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const Zo=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o,totalCount:r},i,{listBoundary:s,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:f},{topListHeight:m},h,{didMount:y},{recalcInProgress:g}])=>{const b=V([]),v=V(0),p=ve(),u=V(0);oe(i.topItemsIndexes,b);const x=ht(z(Je(y,g,se(l,ys),se(r),se(o),se(c),f,se(b),se(t),se(n),se(u),e),ae(([$,C,,R,,,,,,,,M])=>{const F=M!==void 0&&M.length!==R;return $&&!C&&!F}),Y(([,,[$,C],R,M,F,H,L,U,D,Q,ee])=>{var X,ie;const q=M,{offsetTree:G,sizeTree:P}=q,j=Le(v);if(R===0)return{...$c,totalCount:R};if($===0&&C===0)return j===0?{...$c,totalCount:R}:sx(j,F,M,U,D,ee||[]);if(Te(P))return j>0?null:Ta(nI(af(F,R),q,ee),[],R,D,q,U);const A=[];if(L.length>0){const de=L[0],we=L[L.length-1];let ze=0;for(const Ee of Ar(P,de,we)){const Se=Ee.value,_e=Math.max(Ee.start,de),Qe=Math.min(Ee.end,we);for(let Pe=_e;Pe<=Qe;Pe++)A.push({data:ee==null?void 0:ee[Pe],index:Pe,offset:ze,size:Se}),ze+=Se}}if(!H)return Ta([],A,R,D,q,U);const _=L.length>0?L[L.length-1]+1:0,w=HP(G,$,C,_);if(w.length===0)return null;const k=R-1,E=Ul([],de=>{for(const we of w){const ze=we.value;let Ee=ze.offset,Se=we.start;const _e=ze.size;if(ze.offset<$){Se+=Math.floor(($-ze.offset+D)/(_e+D));const Pe=Se-we.start;Ee+=Pe*_e+Pe*D}Se<_&&(Ee+=(_-Se)*_e,Se=_);const Qe=Math.min(we.end,k);for(let Pe=Se;Pe<=Qe&&!(Ee>=C);Pe++)de.push({data:ee==null?void 0:ee[Pe],index:Pe,offset:Ee,size:_e}),Ee+=_e+D}}),K=Bh(Q,bs),O=Bh(Q,xs);if(E.length>0&&(K>0||O>0)){const de=E[0],we=E[E.length-1];if(K>0&&de.index>_){const ze=Math.min(K,de.index-_),Ee=[];let Se=de.offset;for(let _e=de.index-1;_e>=de.index-ze;_e--){const Qe=((X=Ar(P,_e,_e)[0])==null?void 0:X.value)??de.size;Se-=Qe+D,Ee.unshift({data:ee==null?void 0:ee[_e],index:_e,offset:Se,size:Qe})}E.unshift(...Ee)}if(O>0&&we.index<k){const ze=Math.min(O,k-we.index);let Ee=we.offset+we.size+D;for(let Se=we.index+1;Se<=we.index+ze;Se++){const _e=((ie=Ar(P,Se,Se)[0])==null?void 0:ie.value)??we.size;E.push({data:ee==null?void 0:ee[Se],index:Se,offset:Ee,size:_e}),Ee+=_e+D}}}return Ta(E,A,R,D,q,U)}),ae($=>$!==null),Me()),$c);oe(z(e,ae(ef),Y($=>$==null?void 0:$.length)),r),oe(z(x,Y($=>$.topListHeight)),m),oe(m,a),oe(z(x,Y($=>[$.top,$.bottom])),s),oe(z(x,Y($=>$.items)),p);const S=At(z(x,ae(({items:$})=>$.length>0),he(r,e),ae(([{items:$},C])=>$[$.length-1].originalIndex===C-1),Y(([,$,C])=>[$-1,C]),Me(ys),Y(([$])=>$))),T=At(z(x,In(200),ae(({items:$,topItems:C})=>$.length>0&&$[0].originalIndex===C.length),Y(({items:$})=>$[0].index),Me())),N=At(z(x,ae(({items:$})=>$.length>0),Y(({items:$})=>{let C=0,R=$.length-1;for(;$[C].type==="group"&&C<R;)C++;for(;$[R].type==="group"&&R>C;)R--;return{endIndex:$[R].index,startIndex:$[C].index}}),Me(Zb)));return{endReached:S,initialItemCount:v,itemsRendered:p,listState:x,minOverscanItemCount:u,rangeChanged:N,startReached:T,topItemsIndexes:b,...h}},Ue(kn,ox,lf,Es,Ns,Ps,ko,of),{singleton:!0}),ax=xe(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:o},{listState:r}])=>{const i=ve(),s=ht(z(Je(n,e,o,t,r),Y(([a,l,c,f,m])=>a+l+c+f+m.offsetBottom+m.bottom)),0);return oe(se(s),i),{totalListHeight:s,totalListHeightChanged:i}},Ue($t,Zo),{singleton:!0}),oI=xe(([{viewportHeight:e},{totalListHeight:t}])=>{const n=V(!1),o=ht(z(Je(n,e,t),ae(([r])=>r),Y(([,r,i])=>Math.max(0,r-i)),In(0),Me()),0);return{alignToBottom:n,paddingTopAddition:o}},Ue($t,ax),{singleton:!0}),lx=xe(()=>({context:V(null)})),rI=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:o,...r},viewportBottom:i,viewportTop:s})=>t<s?{...r,align:n??"start",...o!==void 0?{behavior:o}:{}}:e>i?{...r,align:n??"end",...o!==void 0?{behavior:o}:{}}:null,cx=xe(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:i,scrollingInProgress:s,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const f=ve();return oe(z(f,he(t,l,n,i,r,o,a),he(e),Y(([[m,h,y,g,b,v,p,u],x])=>{const{calculateViewLocation:S=rI,done:T,...N}=m,$=nx(m,h,g-1),C=gs($,h.offsetTree,x)+b+v,R=C+dn(h.sizeTree,$)[1],M=u+v,F=u+y-p,H=S({itemBottom:R,itemTop:C,locationParams:N,viewportBottom:F,viewportTop:M});return H!==null?T&&ln(z(s,ae(L=>!L),Jo(Le(s)?1:2)),T):T==null||T(),H}),ae(m=>m!==null)),c),{scrollIntoView:f}},Ue(kn,$t,Ns,Zo,$o),{singleton:!0});function Hh(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const iI=(e,t)=>typeof e=="function"?Hh(e(t)):t&&Hh(e),sI=xe(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:i},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:f},{scrollingInProgress:m},{context:h},{scrollIntoView:y}])=>{const g=V(!1),b=ve();let v=null;function p(T){me(s,{align:"end",behavior:T,index:"LAST"})}$e(z(Je(z(se(t),Jo(1)),l),he(se(g),i,a,m),Y(([[T,N],$,C,R,M])=>{let F=N&&R,H="auto";return F&&(H=iI($,C||M),F=F&&H!==!1),{followOutputBehavior:H,shouldFollow:F,totalCount:T}}),ae(({shouldFollow:T})=>T)),({followOutputBehavior:T,totalCount:N})=>{v!==null&&(v(),v=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("following output to ",{totalCount:N},tt.DEBUG),p(T)}):v=ln(e,()=>{Le(f)("following output to ",{totalCount:N},tt.DEBUG),p(T),v=null})});function u(T){const N=ln(r,$=>{T&&!$.atBottom&&$.notAtBottomBecause==="SIZE_INCREASED"&&v===null&&(Le(f)("scrolling to bottom due to increased size",{},tt.DEBUG),p("auto"))});setTimeout(N,100)}$e(z(Je(se(g),t,c),ae(([T,,N])=>T!==!1&&N),wn(({value:T},[,N])=>({refreshed:T===N,value:N}),{refreshed:!1,value:0}),ae(({refreshed:T})=>T),he(g,t)),([,T])=>{Le(a)&&u(T!==!1)}),$e(b,()=>{u(Le(g)!==!1)}),$e(Je(se(g),r),([T,N])=>{T!==!1&&!N.atBottom&&N.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&p("auto")});const x=V(null),S=ve();return oe(qd(z(se(o),Y(T=>(T==null?void 0:T.length)??0)),z(se(t))),S),$e(z(Je(z(S,Jo(1)),l),he(se(x),a,m,h),Y(([[T,N],$,C,R,M])=>N&&C&&($==null?void 0:$({context:M,totalCount:T,scrollingInProgress:R}))),ae(T=>!!T),In(0)),T=>{v!==null&&(v(),v=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("scrolling into view",{}),me(y,T)}):v=ln(e,()=>{Le(f)("scrolling into view",{}),me(y,T),v=null})}),{autoscrollToBottom:b,followOutput:g,scrollIntoViewOnChange:x}},Ue(kn,Ps,Ns,Es,ko,$o,$t,lx,cx)),aI=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:i,listState:s},{didMount:a}])=>(oe(z(a,he(i),ae(([,l])=>l!==0),he(r,o,t,n,e),Y(([[,l],c,f,m,h,y=[]])=>sx(l,c,f,m,h,y))),s),{}),Ue(kn,Es,Zo,ko),{singleton:!0}),lI=xe(([{didMount:e},{scrollTo:t},{listState:n}])=>{const o=V(0);return $e(z(e,he(o),ae(([,r])=>r!==0),Y(([,r])=>({top:r}))),r=>{ln(z(n,Jo(1),ae(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{me(t,r)})})}),{initialScrollTop:o}},Ue(ko,$t,Zo),{singleton:!0}),dx=xe(([{scrollVelocity:e}])=>{const t=V(!1),n=ve(),o=V(!1);return oe(z(e,he(o,t,n),ae(([r,i])=>i!==!1&&i!==void 0),Y(([r,i,s,a])=>{const{enter:l,exit:c}=i;if(s){if(c(r,a))return!1}else if(l(r,a))return!0;return s}),Me()),t),$e(z(Je(t,e,n),he(o)),([[r,i,s],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(i,s)}),{isSeeking:t,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:e}},Ue(Ps),{singleton:!0}),cf=xe(([{scrollContainerState:e,scrollTo:t}])=>{const n=ve(),o=ve(),r=ve(),i=V(!1),s=V(void 0);return oe(z(Je(n,o),Y(([{scrollTop:a,viewportHeight:l},{offsetTop:c,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,a-c),viewportHeight:l}))),e),oe(z(t,he(o),Y(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:s,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},Ue($t)),cI=xe(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=ve(),f=V(void 0),m=V(null),h=V(null);return oe(a,m),oe(l,h),$e(z(c,he(t,o,s,m,h,n)),([y,g,b,v,p,u,x])=>{const S=WP(g.sizeTree);v&&p!==null&&u!==null&&(b=p.scrollTop-u.offsetTop),b-=x,y({ranges:S,scrollTop:b})}),oe(z(f,ae(ef),Y(dI)),r),oe(z(i,he(f),ae(([,y])=>y!==void 0),Me(),Y(([,y])=>y.ranges)),e),{getState:c,restoreStateFrom:f}},Ue(kn,$t,Es,ko,cf));function dI(e){return{align:"start",index:0,offset:e.scrollTop}}const uI=xe(([{topItemsIndexes:e}])=>{const t=V(0);return oe(z(t,ae(n=>n>=0),Y(n=>Array.from({length:n}).map((o,r)=>r))),e),{topItemCount:t}},Ue(Zo));function ux(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const pI=ux(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),fI=xe(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:i,lastJumpDueToItemResize:s,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:f,shiftWithOffset:m,sizes:h},{log:y},{recalcInProgress:g}])=>{const b=At(z(l,he(s),wn(([,p,u,x],[{bottom:S,items:T,offsetBottom:N,totalCount:$},C])=>{const R=S+N;let M=0;return u===$&&p.length>0&&T.length>0&&(T[0].originalIndex===0&&p[0].originalIndex===0||(M=R-x,M!==0&&(M+=C))),[M,T,$,R]},[0,[],0,0]),ae(([p])=>p!==0),he(o,a,n,r,y,g),ae(([,p,u,x,,,S])=>!S&&!x&&p!==0&&u===vs),Y(([[p],,,,,u])=>(u("Upward scrolling compensation",{amount:p},tt.DEBUG),p))));function v(p){p>0?(me(t,{behavior:"auto",top:-p}),me(e,0)):(me(e,0),me(t,{behavior:"auto",top:-p}))}return $e(z(b,he(e,i)),([p,u,x])=>{x&&pI()?me(e,u-p):v(-p)}),$e(z(Je(ht(i,!1),e,g),ae(([p,u,x])=>!p&&!x&&u!==0),Y(([p,u])=>u),In(1)),v),oe(z(m,Y(p=>({top:-p}))),t),$e(z(c,he(h,f),Y(([p,{groupIndices:u,lastSize:x,sizeTree:S},T])=>{function N(F){return F*(x+T)}if(u.length===0)return N(p);let $=0;const C=hs(S,0);let R=0,M=0;for(;R<p;){R++,$+=C;let F=u.length===M+1?1/0:u[M+1]-u[M]-1;R+F>p&&($-=C,F=p-R+1),R+=F,$+=N(F),M++}return $})),p=>{me(e,p),requestAnimationFrame(()=>{me(t,{top:p}),requestAnimationFrame(()=>{me(e,0),me(g,!1)})})}),{deviation:e}},Ue($t,Ps,Zo,kn,$o,of)),mI=xe(([e,t,n,o,r,i,s,a,l,c,f])=>({...e,...t,...n,...o,...r,...i,...s,...a,...l,...c,...f}),Ue(lf,aI,ko,dx,ax,lI,oI,cf,cx,$o,lx)),px=xe(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:i,groupIndices:s,heightEstimates:a,itemSize:l,sizeRanges:c,sizes:f,statefulTotalCount:m,totalCount:h,trackItemSizes:y},{initialItemFinalLocationReached:g,initialTopMostItemIndex:b,scrolledToInitialItem:v},p,u,x,S,{scrollToIndex:T},N,{topItemCount:$},{groupCounts:C},R])=>{const{listState:M,minOverscanItemCount:F,topItemsIndexes:H,rangeChanged:L,...U}=S;return oe(L,R.scrollSeekRangeChanged),oe(z(R.windowViewportRect,Y(D=>D.visibleHeight)),p.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:i,groupCounts:C,heightEstimates:a,initialItemFinalLocationReached:g,initialTopMostItemIndex:b,scrolledToInitialItem:v,sizeRanges:c,topItemCount:$,topItemsIndexes:H,totalCount:h,...x,groupIndices:s,itemSize:l,listState:M,minOverscanItemCount:F,scrollToIndex:T,statefulTotalCount:m,trackItemSizes:y,rangeChanged:L,...U,...R,...p,sizes:f,...u}},Ue(kn,Es,$t,cI,sI,Zo,Ns,fI,uI,ox,mI));function hI(e,t){const n={},o={};let r=0;const i=e.length;for(;r<i;)o[e[r]]=1,r+=1;for(const s in t)Object.hasOwn(o,s)||(n[s]=t[s]);return n}const na=typeof document<"u"?te.useLayoutEffect:te.useEffect;function fx(e,t,n){const o=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),i=Object.keys(t.methods||{}),s=Object.keys(t.events||{}),a=te.createContext({});function l(v,p){v.propsReady!==void 0&&me(v.propsReady,!1);for(const u of o){const x=v[t.required[u]];me(x,p[u])}for(const u of r)if(u in p){const x=v[t.optional[u]];me(x,p[u])}v.propsReady!==void 0&&me(v.propsReady,!0)}function c(v){return i.reduce((p,u)=>(p[u]=x=>{const S=v[t.methods[u]];me(S,x)},p),{})}function f(v){return s.reduce((p,u)=>(p[u]=EP(v[t.events[u]]),p),{})}const m=te.forwardRef(function(v,p){const{children:u,...x}=v,[S]=te.useState(()=>Ul(IP(e),$=>{l($,x)})),[T]=te.useState(Ih(f,S));na(()=>{for(const $ of s)$ in x&&$e(T[$],x[$]);return()=>{Object.values(T).map(tf)}},[x,T,S]),na(()=>{l(S,x)}),te.useImperativeHandle(p,Ph(c(S)));const N=n;return d.jsx(a.Provider,{value:S,children:n!==void 0?d.jsx(N,{...hI([...o,...r,...s],x),children:u}):u})}),h=v=>{const p=te.useContext(a);return te.useCallback(u=>{me(p[v],u)},[p,v])},y=v=>{const p=te.useContext(a)[v],u=te.useCallback(x=>$e(p,x),[p]);return te.useSyncExternalStore(u,()=>Le(p),()=>Le(p))},g=v=>{const p=te.useContext(a)[v],[u,x]=te.useState(Ih(Le,p));return na(()=>$e(p,S=>{S!==u&&x(Ph(S))}),[p,u]),u},b=parseInt(te.version)>=18?y:g;return{Component:m,useEmitter:(v,p)=>{const u=te.useContext(a)[v];na(()=>$e(u,p),[p,u])},useEmitterValue:b,usePublisher:h}}const mx=te.createContext(void 0),hx=te.createContext(void 0),kc="-webkit-sticky",Vh="sticky",df=ux(()=>{if(typeof document>"u")return Vh;const e=document.createElement("div");return e.style.position=kc,e.style.position===kc?kc:Vh}),yx=typeof document<"u"?te.useLayoutEffect:te.useEffect;function Tc(e){return"self"in e}function yI(e){return"body"in e}function gx(e,t,n,o=ni,r,i){const s=te.useRef(null),a=te.useRef(null),l=te.useRef(null),c=te.useCallback(h=>{let y,g,b;const v=h.target;if(yI(v)||Tc(v)){const u=Tc(v)?v:v.defaultView;b=i===!0?Uo(u,u.scrollX):u.scrollY,y=i===!0?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight,g=i===!0?u.innerWidth:u.innerHeight}else b=i===!0?Uo(v,v.scrollLeft):v.scrollTop,y=i===!0?v.scrollWidth:v.scrollHeight,g=i===!0?v.offsetWidth:v.offsetHeight;const p=()=>{e({scrollHeight:y,scrollTop:Math.max(b,0),viewportHeight:g})};h.suppressFlushSync===!0?p():Yw.flushSync(p),a.current!==null&&(b===a.current||b<=0||b===y-g)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);te.useEffect(()=>{const h=r||s.current;return Rh(h),o(r||s.current),c({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",c,{passive:!0}),()=>{Rh(h),o(null),h.removeEventListener("scroll",c)}},[s,c,n,o,r]);function f(h){const y=s.current;if(!y||(i===!0?"offsetWidth"in y&&y.offsetWidth===0:"offsetHeight"in y&&y.offsetHeight===0))return;const g=h.behavior==="smooth";let b,v,p;Tc(y)?(v=Math.max(vo(y.document.documentElement,i===!0?"width":"height"),i===!0?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight),b=i===!0?y.innerWidth:y.innerHeight,p=i===!0?Uo(y,y.scrollX):y.scrollY):(v=y[i===!0?"scrollWidth":"scrollHeight"],b=vo(y,i===!0?"width":"height"),p=i===!0?Uo(y,y.scrollLeft):y.scrollTop);const u=v-b;if(h.top===void 0){y.scrollTo(h);return}const x=Math.ceil(Math.max(Math.min(u,h.top),0));if(h.top=x,ix(b,v)||x===p){e({scrollHeight:v,scrollTop:p,viewportHeight:b}),g&&t(!0);return}g?(a.current=x,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,i===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},left:Ah(y,x)}),y.scrollTo(h)}function m(h){i===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},...h.top!==void 0?{left:Ah(s.current,h.top)}:{}}),s.current.scrollBy(h)}return{scrollByCallback:m,scrollerRef:s,scrollToCallback:f}}function uf(e){return e}const gI=xe(()=>{const e=V(a=>`Item ${a}`),t=V(a=>`Group ${a}`),n=V({}),o=V(uf),r=V("div"),i=V(ni),s=(a,l=null)=>ht(z(n,Y(c=>c[a]),Me()),l);return{components:n,computeItemKey:o,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:r,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),vI=xe(([e,t])=>({...e,...t}),Ue(px,gI)),bI=({height:e})=>d.jsx("div",{style:{height:e}}),xI={overflowAnchor:"none",position:df(),zIndex:1},vx={overflowAnchor:"none"},wI={...vx,display:"inline-block",height:"100%"},Wh=te.memo(function({showTopList:e=!1}){const t=ce("listState"),n=Vt("sizeRanges"),o=ce("useWindowScroll"),r=ce("customScrollParent"),i=Vt("windowScrollContainerState"),s=Vt("scrollContainerState"),a=r||o?i:s,l=ce("itemContent"),c=ce("context"),f=ce("groupContent"),m=ce("trackItemSizes"),h=ce("itemSize"),y=ce("log"),g=Vt("gap"),b=ce("horizontalDirection"),{callbackRef:v}=MP(n,h,m,e?ni:a,y,g,r,b,ce("skipAnimationFrameInResizeObserver")),[p,u]=te.useState(0);ff("deviation",U=>{p!==U&&u(U)});const x=ce("EmptyPlaceholder"),S=ce("ScrollSeekPlaceholder")??bI,T=ce("ListComponent"),N=ce("ItemComponent"),$=ce("GroupComponent"),C=ce("computeItemKey"),R=ce("isSeeking"),M=ce("groupIndices").length>0,F=ce("alignToBottom"),H=ce("initialItemFinalLocationReached"),L=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginInlineStart:p!==0?p:F?"auto":0,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:p!==0?p:F?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...H?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&x!==null&&x!==void 0?d.jsx(x,{...mt(x,c)}):d.jsx(T,{...mt(T,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:v,style:L,children:(e?t.topItems:t.items).map(U=>{const D=U.originalIndex,Q=C(D+t.firstItemIndex,U.data,c);return R?I.createElement(S,{...mt(S,c),height:U.size,index:U.index,key:Q,type:U.type||"item",...U.type==="group"?{}:{groupIndex:U.groupIndex}}):U.type==="group"?I.createElement($,{...mt($,c),"data-index":D,"data-item-index":U.index,"data-known-size":U.size,key:Q,style:xI},f(U.index,c)):I.createElement(N,{...mt(N,c),...TI(N,U.data),"data-index":D,"data-item-group-index":U.groupIndex,"data-item-index":U.index,"data-known-size":U.size,key:Q,style:b?wI:vx},M?l(U.index,U.groupIndex,U.data,c):l(U.index,U.data,c))})})}),SI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},$I={outline:"none",overflowX:"auto",position:"relative"},pf=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),bx=(e,t,n=0)=>({...pf(e),position:t?"relative":"absolute",top:t?-n:0}),kI={position:df(),top:0,width:"100%",zIndex:1};function mt(e,t){if(typeof e!="string")return{context:t}}function TI(e,t){return{item:typeof e=="string"?void 0:t}}const _I=te.memo(function(){const e=ce("HeaderComponent"),t=Vt("headerHeight"),n=ce("HeaderFooterTag"),o=Xo(te.useMemo(()=>i=>{t(vo(i,"height"))},[t]),!0,ce("skipAnimationFrameInResizeObserver")),r=ce("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...mt(e,r)})}):null}),jI=te.memo(function(){const e=ce("FooterComponent"),t=Vt("footerHeight"),n=ce("HeaderFooterTag"),o=Xo(te.useMemo(()=>i=>{t(vo(i,"height"))},[t]),!0,ce("skipAnimationFrameInResizeObserver")),r=ce("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...mt(e,r)})}):null});function xx({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("scrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),f=t("scrollerRef"),m=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:y,scrollToCallback:g}=gx(a,c,l,f,void 0,m);return e("scrollTo",g),e("scrollBy",h),d.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:y,style:{...m?$I:SI,...r},tabIndex:0,...s,...mt(l,i),children:o})})}function wx({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("windowScrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),f=t("totalListHeight"),m=t("deviation"),h=t("customScrollParent"),y=te.useRef(null),g=t("scrollerRef"),{scrollByCallback:b,scrollerRef:v,scrollToCallback:p}=gx(a,c,l,g,h);return yx(()=>{var u;return v.current=h||((u=y.current)==null?void 0:u.ownerDocument.defaultView),()=>{v.current=null}},[v,h]),e("windowScrollTo",p),e("scrollBy",b),d.jsx(l,{ref:y,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...f!==0?{height:f+m}:void 0},...s,...mt(l,i),children:o})})}const CI=({children:e})=>{const t=te.useContext(mx),n=Vt("viewportHeight"),o=Vt("fixedItemHeight"),r=ce("alignToBottom"),i=ce("horizontalDirection"),s=te.useMemo(()=>Bb(n,l=>vo(l,i?"width":"height")),[n,i]),a=Xo(s,!0,ce("skipAnimationFrameInResizeObserver"));return te.useEffect(()=>{t&&(n(t.viewportHeight),o(t.itemHeight))},[t,n,o]),d.jsx("div",{"data-viewport-type":"element",ref:a,style:pf(r),children:e})},NI=({children:e})=>{const t=te.useContext(mx),n=Vt("windowViewportRect"),o=Vt("fixedItemHeight"),r=ce("customScrollParent"),i=ce("useWindowScroll"),s=ce("topListHeight"),a=Kb(n,r,ce("skipAnimationFrameInResizeObserver")),l=ce("alignToBottom");return te.useEffect(()=>{t&&(o(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,o]),d.jsx("div",{"data-viewport-type":"window",ref:a,style:bx(l,i,s),children:e})},EI=({children:e})=>{const t=ce("TopItemListComponent")??"div",n=ce("headerHeight"),o={...kI,marginTop:`${n}px`},r=ce("context");return d.jsx(t,{style:o,...mt(t,r),children:e})},PI=te.memo(function(e){const t=ce("useWindowScroll"),n=ce("topItemsIndexes").length>0,o=ce("customScrollParent"),r=ce("context");return d.jsxs(o||t?RI:OI,{...e,context:r,children:[n&&d.jsx(EI,{children:d.jsx(Wh,{showTopList:!0})}),d.jsxs(o||t?NI:CI,{children:[d.jsx(_I,{}),d.jsx(Wh,{}),d.jsx(jI,{})]})]})}),{Component:II,useEmitter:ff,useEmitterValue:ce,usePublisher:Vt}=fx(vI,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},PI),OI=xx({useEmitter:ff,useEmitterValue:ce,usePublisher:Vt}),RI=wx({useEmitter:ff,useEmitterValue:ce,usePublisher:Vt}),AI=II,MI=xe(()=>{const e=V(c=>d.jsxs("td",{children:["Item $",c]})),t=V(null),n=V(c=>d.jsxs("td",{colSpan:1e3,children:["Group ",c]})),o=V(null),r=V(null),i=V({}),s=V(uf),a=V(ni),l=(c,f=null)=>ht(z(i,Y(m=>m[c]),Me()),f);return{components:i,computeItemKey:s,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});Ue(px,MI);df();const Kh={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},qI={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Gh,floor:ll,max:Fi,min:_c,round:Jh}=Math;function Qh(e,t,n){return Array.from({length:t-e+1}).map((o,r)=>({data:n===null?null:n[r+e],index:r+e}))}function UI(e){return{...qI,items:e}}function oa(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function LI(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const DI=xe(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:i,scrollBy:s,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:f,viewportHeight:m},h,y,{didMount:g,propsReady:b},{customScrollParent:v,useWindowScroll:p,windowScrollContainerState:u,windowScrollTo:x,windowViewportRect:S},T])=>{const N=V(0),$=V(0),C=V(Kh),R=V({height:0,width:0}),M=V({height:0,width:0}),F=ve(),H=ve(),L=V(0),U=V(null),D=V({column:0,row:0}),Q=ve(),ee=ve(),q=V(!1),G=V(0),P=V(!0),j=V(!1),A=V(!1);$e(z(g,he(G),ae(([O,X])=>X!==0)),()=>{me(P,!1)}),$e(z(Je(g,P,M,R,G,j),ae(([O,X,ie,de,,we])=>O&&!X&&ie.height!==0&&de.height!==0&&!we)),([,,,,O])=>{me(j,!0),sf(1,()=>{me(F,O)}),ln(z(c),()=>{me(t,[0,0]),me(P,!0)})}),oe(z(ee,ae(O=>O!=null&&O.scrollTop>0),hn(0)),$),$e(z(g,he(ee),ae(([,O])=>O!=null)),([,O])=>{O&&(me(R,O.viewport),me(M,O.item),me(D,O.gap),O.scrollTop>0&&(me(q,!0),ln(z(c,Jo(1)),X=>{me(q,!1)}),me(l,{top:O.scrollTop})))}),oe(z(R,Y(({height:O})=>O)),m),oe(z(Je(se(R,oa),se(M,oa),se(D,(O,X)=>O!==void 0&&O.column===X.column&&O.row===X.row),se(c)),Y(([O,X,ie,de])=>({gap:ie,item:X,scrollTop:de,viewport:O}))),Q),oe(z(Je(se(N),o,se(D,LI),se(M,oa),se(R,oa),se(U),se($),se(q),se(P),se(G)),ae(([,,,,,,,O])=>!O),Y(([O,[X,ie],de,we,ze,Ee,Se,,_e,Qe])=>{const{column:Pe,row:Tn}=de,{height:Fn,width:To}=we,{width:er}=ze;if(Se===0&&(O===0||er===0))return Kh;if(To===0){const mf=af(Qe,O),Tx=mf+Math.max(Se-1,0);return UI(Qh(mf,Tx,Ee))}const Bn=Sx(er,To,Pe);let un,Qt;_e?X===0&&ie===0&&Se>0?(un=0,Qt=Se-1):(un=Bn*ll((X+Tn)/(Fn+Tn)),Qt=Bn*Gh((ie+Tn)/(Fn+Tn))-1,Qt=_c(O-1,Fi(Qt,Bn-1)),un=_c(Qt,Fi(0,un))):(un=0,Qt=-1);const Hn=Qh(un,Qt,Ee),{bottom:tr,top:oi}=Yh(ze,de,we,Hn),ri=Gh(O/Bn),Dl=ri*Fn+(ri-1)*Tn-tr;return{bottom:tr,itemHeight:Fn,items:Hn,itemWidth:To,offsetBottom:Dl,offsetTop:oi,top:oi}})),C),oe(z(U,ae(O=>O!==null),Y(O=>O.length)),N),oe(z(Je(R,M,C,D),ae(([O,X,{items:ie}])=>ie.length>0&&X.height!==0&&O.height!==0),Y(([O,X,{items:ie},de])=>{const{bottom:we,top:ze}=Yh(O,de,X,ie);return[ze,we]}),Me(ys)),t);const _=V(!1);oe(z(c,he(_),Y(([O,X])=>X||O!==0)),_);const w=At(z(Je(C,N),ae(([{items:O}])=>O.length>0),he(_),ae(([[O,X],ie])=>{const de=O.items[O.items.length-1].index===X-1;return(ie||O.bottom>0&&O.itemHeight>0&&O.offsetBottom===0&&O.items.length===X)&&de}),Y(([[,O]])=>O-1),Me())),k=At(z(se(C),ae(({items:O})=>O.length>0&&O[0].index===0),hn(0),Me())),E=At(z(se(C),he(q),ae(([{items:O},X])=>O.length>0&&!X),Y(([{items:O}])=>({endIndex:O[O.length-1].index,startIndex:O[0].index})),Me(Zb),In(0)));oe(E,y.scrollSeekRangeChanged),oe(z(F,he(R,M,N,D),Y(([O,X,ie,de,we])=>{const ze=rx(O),{align:Ee,behavior:Se,offset:_e}=ze;let Qe=ze.index;Qe==="LAST"&&(Qe=de-1),Qe=Fi(0,Qe,_c(de-1,Qe));let Pe=Bd(X,we,ie,Qe);return Ee==="end"?Pe=Jh(Pe-X.height+ie.height):Ee==="center"&&(Pe=Jh(Pe-X.height/2+ie.height/2)),_e!==void 0&&_e!==0&&(Pe+=_e),{behavior:Se,top:Pe}})),l);const K=ht(z(C,Y(O=>O.offsetBottom+O.bottom)),0);return oe(z(S,Y(O=>({height:O.visibleHeight,width:O.visibleWidth}))),R),{customScrollParent:v,data:U,deviation:L,footerHeight:r,gap:D,headerHeight:i,increaseViewportBy:e,initialItemCount:$,itemDimensions:M,overscan:n,restoreStateFrom:ee,scrollBy:s,scrollContainerState:a,scrollHeight:H,scrollTo:l,scrollToIndex:F,scrollTop:c,smoothScrollTargetReached:f,totalCount:N,useWindowScroll:p,viewportDimensions:R,windowScrollContainerState:u,windowScrollTo:x,windowViewportRect:S,...y,gridState:C,horizontalDirection:A,initialTopMostItemIndex:G,totalListHeight:K,...h,endReached:w,propsReady:b,rangeChanged:E,startReached:k,stateChanged:Q,stateRestoreInProgress:q,...T}},Ue(lf,$t,Ps,dx,ko,cf,$o));function Sx(e,t,n){return Fi(1,ll((e+n)/(ll(t)+n)))}function Yh(e,t,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const i=Bd(e,t,n,o[0].index);return{bottom:Bd(e,t,n,o[o.length-1].index)+r,top:i}}function Bd(e,t,n,o){const r=Sx(e.width,n.width,t.column),i=ll(o/r),s=i*n.height+Fi(0,i-1)*t.row;return s>0?s+t.row:s}const zI=xe(()=>{const e=V(m=>`Item ${m}`),t=V({}),n=V(null),o=V("virtuoso-grid-item"),r=V("virtuoso-grid-list"),i=V(uf),s=V("div"),a=V(ni),l=(m,h=null)=>ht(z(t,Y(y=>y[m]),Me()),h),c=V(!1),f=V(!1);return oe(se(f),c),{components:t,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:s,itemClassName:o,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:f,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),FI=xe(([e,t])=>({...e,...t}),Ue(DI,zI)),BI=te.memo(function(){const e=Re("gridState"),t=Re("listClassName"),n=Re("itemClassName"),o=Re("itemContent"),r=Re("computeItemKey"),i=Re("isSeeking"),s=Wt("scrollHeight"),a=Re("ItemComponent"),l=Re("ListComponent"),c=Re("ScrollSeekPlaceholder"),f=Re("context"),m=Wt("itemDimensions"),h=Wt("gap"),y=Re("log"),g=Re("stateRestoreInProgress"),b=Wt("reportReadyState"),v=Xo(te.useMemo(()=>p=>{const u=p.parentElement.parentElement.scrollHeight;s(u);const x=p.firstChild;if(x!==null){const{height:S,width:T}=x.getBoundingClientRect();m({height:S,width:T})}h({column:Xh("column-gap",getComputedStyle(p).columnGap,y),row:Xh("row-gap",getComputedStyle(p).rowGap,y)})},[s,m,h,y]),!0,!1);return yx(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),g?null:d.jsx(l,{className:t,ref:v,...mt(l,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(p=>{const u=r(p.index,p.data,f);return i?d.jsx(c,{...mt(c,f),height:e.itemHeight,index:p.index,width:e.itemWidth},u):I.createElement(a,{...mt(a,f),className:n,"data-index":p.index,key:u},o(p.index,p.data,f))})})}),HI=te.memo(function(){const e=Re("HeaderComponent"),t=Wt("headerHeight"),n=Re("headerFooterTag"),o=Xo(te.useMemo(()=>i=>{t(vo(i,"height"))},[t]),!0,!1),r=Re("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...mt(e,r)})}):null}),VI=te.memo(function(){const e=Re("FooterComponent"),t=Wt("footerHeight"),n=Re("headerFooterTag"),o=Xo(te.useMemo(()=>i=>{t(vo(i,"height"))},[t]),!0,!1),r=Re("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...mt(e,r)})}):null}),WI=({children:e})=>{const t=te.useContext(hx),n=Wt("itemDimensions"),o=Wt("viewportDimensions"),r=Xo(te.useMemo(()=>i=>{o(i.getBoundingClientRect())},[o]),!0,!1);return te.useEffect(()=>{t&&(o({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,o,n]),d.jsx("div",{ref:r,style:pf(!1),children:e})},KI=({children:e})=>{const t=te.useContext(hx),n=Wt("windowViewportRect"),o=Wt("itemDimensions"),r=Re("customScrollParent"),i=Re("useWindowScroll"),s=Kb(n,r,!1);return te.useEffect(()=>{t&&(o({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,o]),d.jsx("div",{ref:s,style:bx(!1,i),children:e})},GI=te.memo(function({...e}){const t=Re("useWindowScroll"),n=Re("customScrollParent"),o=n||t?QI:JI,r=n||t?KI:WI,i=Re("context");return d.jsx(o,{...e,...mt(o,i),children:d.jsxs(r,{children:[d.jsx(HI,{}),d.jsx(BI,{}),d.jsx(VI,{})]})})}),{useEmitter:$x,useEmitterValue:Re,usePublisher:Wt}=fx(FI,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},GI),JI=xx({useEmitter:$x,useEmitterValue:Re,usePublisher:Wt}),QI=wx({useEmitter:$x,useEmitterValue:Re,usePublisher:Wt});function Xh(e,t,n){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&n(`${e} was not resolved to pixel value correctly`,t,tt.WARN),t==="normal"?0:parseInt(t??"0",10)}function YI(e){var o,r,i;if(e.kind!=="notification"||e.method!=="session/update")return null;const t=e.payload;if(!t||typeof t!="object")return null;const n=t.params;return!n||((o=n.update)==null?void 0:o.sessionUpdate)!=="agent_message_chunk"?null:{sessionId:String(n.sessionId??""),text:((i=(r=n.update)==null?void 0:r.content)==null?void 0:i.text)??""}}function XI(e){const t=[];let n=null;const o=()=>{if(n){if(n.messages.length===1){const r=n.messages[0];t.push({type:"message",message:r})}else{const r=n.messages[0],i=n.messages[n.messages.length-1];t.push({type:"stream-cluster",sessionId:n.sessionId,messages:n.messages,firstSeq:r.seq,lastSeq:i.seq,combinedText:n.text,firstTimestamp:r.timestamp,lastTimestamp:i.timestamp})}n=null}};for(const r of e){const i=YI(r);if(i&&n&&n.sessionId===i.sessionId){n.messages.push(r),n.text+=i.text;continue}o(),i?n={sessionId:i.sessionId,messages:[r],text:i.text}:t.push({type:"message",message:r})}return o(),t}function ZI(e){var n;if(!e.payload||typeof e.payload!="object")return null;const t=e.payload.params;if(!t||typeof t!="object")return null;if(e.method==="session/prompt"){const o=t.prompt;if(!Array.isArray(o))return null;const r=[];for(const s of o)(s==null?void 0:s.type)==="text"&&typeof s.text=="string"&&r.push(s.text);const i=r.join(" ").trim();return i.length>0?i:null}if(e.method==="session/update"){const o=t.update;if(!o)return null;const r=((n=o.content)==null?void 0:n.text)??o.text;return typeof r=="string"&&r.length>0?r:null}return null}function eO(e){return e.method==="session/prompt"&&e.kind==="request"}const tO={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"???"},nO={request:"request — expects a response",response:"response — answer to a previous request",notification:"notification — one-way event, no response",error:"error — response carrying an error object",unknown:"unknown — could not classify as JSON-RPC"},oO={"editor-to-agent":"editor → agent (e.g. JetBrains/Zed sending to the AI)","agent-to-editor":"agent → editor (AI replying or calling the host)"};function rO(e){switch(e){case"error":return"text-accent-error";case"notification":return"text-accent-note";case"request":return"text-accent-out";case"response":return"text-accent-in";default:return"text-ink-muted"}}function iO({message:e,selected:t,paired:n=!1,latencyMs:o,validation:r,onSelect:i}){const s=e.direction==="editor-to-agent",a=e.kind==="error",l=o!==void 0?BN(o):null,c=ZI(e),f=eO(e),m=r&&!r.skipped&&!r.valid;return d.jsxs("button",{type:"button",onClick:()=>i(e.seq),className:W("relative flex w-full items-center gap-3 px-4 py-1.5 text-left font-mono text-[12px] leading-5","border-b border-line-grid/70 transition-colors","hover:bg-surface-rowHover",t?"bg-surface-rowHover ring-1 ring-inset ring-accent-out/40":"",n&&!t?"bg-accent-out/[0.04] ring-1 ring-inset ring-accent-out/15":"",a?"bg-accent-error/[0.06]":""),children:[d.jsx("span",{"aria-hidden":!0,className:W("absolute inset-y-0 left-0 w-[3px]",s?"bg-accent-out":"bg-accent-in",a?"bg-accent-error":"")}),d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(e.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:us(e.timestamp)}),d.jsxs("span",{className:W("flex w-16 shrink-0 items-center gap-1 font-semibold",s?"text-accent-out":"text-accent-in"),title:oO[e.direction],children:[d.jsx("span",{"aria-hidden":!0,children:Ab(e.direction)}),d.jsx("span",{className:"text-[10px] tracking-widest",children:Rb(e.direction)})]}),d.jsx("span",{className:W("inline-flex w-12 shrink-0 items-center justify-center rounded-sm border px-1 text-[10px] font-semibold tracking-widest",rO(e.kind),"border-current/40"),title:nO[e.kind],children:tO[e.kind]}),d.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-3 overflow-hidden",children:[d.jsx("span",{className:W("shrink-0",f?"text-accent-out":"text-ink-primary"),children:e.method?e.method:"—"}),m&&r&&d.jsxs("span",{className:W("inline-flex shrink-0 items-center gap-0.5 rounded-sm border border-accent-error/40","bg-accent-error/10 px-1 text-[9px] font-semibold uppercase tracking-widest text-accent-error"),title:`fails ACP schema (${r.schemaName??"?"}): ${r.errors.map(h=>`${h.path==="/"?"":h.path+" "}${h.message}`).join(" · ")}`,children:["⚠ SPEC ",r.errors.length]}),c&&d.jsxs("span",{className:W("truncate",f?"text-accent-out/85":"text-ink-secondary"),title:c,children:["“",c,"”"]})]}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",title:e.rpcId!==void 0&&e.rpcId!==null?`id:${String(e.rpcId)}`:void 0,children:e.rpcId!==void 0&&e.rpcId!==null?`id:${VN(e.rpcId)}`:""}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Rl(e.raw.length)}),d.jsx("span",{className:W("w-20 shrink-0 text-right",l==="ok"&&"text-accent-ok",l==="warn"&&"text-accent-warn",l==="error"&&"text-accent-error",!l&&"text-ink-dim"),children:o!==void 0?`+${Ht(o)}`:""})]})}const sO=I.memo(iO);function aO({messages:e,combinedText:t,firstTimestamp:n,lastTimestamp:o,selectedSeq:r,onSelect:i}){const[s,a]=I.useState(!1),l=e[0],c=e[e.length-1],f=o-n,m=t.length>140?`${t.slice(0,140)}…`:t,h=r!==null&&e.some(y=>y.seq===r);return d.jsxs("div",{className:"border-b border-line-grid/70",children:[d.jsxs("button",{type:"button",onClick:()=>{a(y=>!y),i(l.seq)},className:W("relative flex w-full items-center gap-3 px-4 py-1.5 text-left font-mono text-[12px] leading-5","transition-colors hover:bg-surface-rowHover",h?"bg-surface-rowHover ring-1 ring-inset ring-accent-note/40":""),children:[d.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent-note"}),d.jsxs("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:[String(l.seq).padStart(3,"0"),"…",String(c.seq).padStart(3,"0")]}),d.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:us(n)}),d.jsxs("span",{className:"flex w-16 shrink-0 items-center gap-1 font-semibold text-accent-in",title:"agent → editor (AI replying or calling the host)",children:[d.jsx("span",{"aria-hidden":!0,children:"←"}),d.jsx("span",{className:"text-[10px] tracking-widest",children:"IN"})]}),d.jsx("span",{className:W("inline-flex w-12 shrink-0 items-center justify-center rounded-sm border border-accent-note/40 px-1 text-[10px] font-semibold tracking-widest text-accent-note"),title:`stream — ${e.length} consecutive agent_message_chunk notifications collapsed into one row`,children:"STR"}),d.jsxs("span",{className:"flex flex-1 items-center gap-2 truncate text-ink-primary",children:[d.jsx("span",{className:"inline-flex h-[14px] w-1 rounded-sm bg-accent-note/60","aria-hidden":!0}),d.jsx("span",{className:"truncate text-ink-secondary",children:m||d.jsx("span",{className:"text-ink-muted",children:"(empty stream)"})})]}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:[e.length," chunks"]}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Ht(f)}),d.jsx("span",{"aria-hidden":!0,className:W("w-3 shrink-0 text-ink-muted transition-transform",s?"rotate-90":""),children:"▸"})]}),s&&d.jsx("div",{className:"border-l border-line-grid/70 bg-surface-base/40",children:e.map((y,g)=>d.jsxs("button",{type:"button",onClick:()=>i(y.seq),className:W("flex w-full items-center gap-3 px-8 py-1 text-left font-mono text-[11px] leading-5 text-ink-secondary","transition-colors hover:bg-surface-rowHover",r===y.seq?"bg-surface-rowHover text-ink-primary":""),children:[d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(y.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-muted",children:us(y.timestamp)}),d.jsxs("span",{className:"w-8 shrink-0 text-ink-muted",children:["#",g+1]}),d.jsx("span",{className:"flex-1 truncate text-ink-primary",children:lO(y)})]},y.seq))})]})}function lO(e){var o,r;const t=e.payload;if(!t||typeof t!="object")return"";const n=t.params;return((r=(o=n==null?void 0:n.update)==null?void 0:o.content)==null?void 0:r.text)??""}const cO=80;function dO(){const e=ne(p=>p.messages),t=ne(p=>p.selectedSeq),n=ne(p=>p.filters),o=ne(p=>p.playback.cap),r=ne(p=>p.select),i=I.useMemo(()=>sS(e,n,o),[e,n,o]),s=I.useMemo(()=>XI(i),[i]),a=I.useMemo(()=>Tl(e),[e]),l=I.useMemo(()=>Kp(e),[e]),c=I.useMemo(()=>{const p=new Map;for(const u of e)p.set(u.seq,u.timestamp);return p},[e]),f=I.useMemo(()=>{if(t===null)return null;const p=a.get(t);if(p!==void 0)return p;for(const[u,x]of a)if(x===t)return u;return null},[t,a]),m=I.useRef(null),h=ne(p=>{var u;return((u=p.session)==null?void 0:u.id)??null}),y=ne(p=>p.replayDone),g=I.useRef(h),b=I.useRef(!1);I.useEffect(()=>{g.current!==h&&(g.current=h,b.current=!1)},[h]),I.useEffect(()=>{if(!y||h===null||b.current||s.length===0)return;b.current=!0;const p=s.length-1,u=window.setTimeout(()=>{var x;(x=m.current)==null||x.scrollToIndex({index:p,align:"end",behavior:"smooth"})},50);return()=>window.clearTimeout(u)},[y,h,s.length]);const v=p=>{const u=s[p];return u?uO(u,{selectedSeq:t,pairedSeq:f,onSelect:r,responseToRequest:a,reqTimestampBySeq:c,validationBySeq:l}):null};return d.jsxs("div",{className:"relative flex h-full flex-col",children:[s.length===0?d.jsx("div",{className:"flex h-full items-center justify-center bg-surface-base font-mono text-xs text-ink-muted",children:"no messages match current filters"}):d.jsx(AI,{ref:m,className:"flex-1 bg-surface-base",totalCount:s.length,itemContent:v,atBottomThreshold:cO,initialTopMostItemIndex:Math.max(0,s.length-1),followOutput:p=>p?"auto":!1,computeItemKey:p=>pO(s[p])}),d.jsx(fO,{total:e.length,shown:i.length})]})}function uO(e,t){if(e.type==="message"){const n=e.message,o=t.responseToRequest.get(n.seq),r=o!==void 0?n.timestamp-(t.reqTimestampBySeq.get(o)??n.timestamp):void 0,i=t.validationBySeq.get(n.seq);return d.jsx(sO,{message:n,selected:t.selectedSeq===n.seq,paired:t.pairedSeq===n.seq,...r!==void 0?{latencyMs:r}:{},...i!==void 0?{validation:i}:{},onSelect:t.onSelect})}return d.jsx(aO,{messages:e.messages,combinedText:e.combinedText,firstTimestamp:e.firstTimestamp,lastTimestamp:e.lastTimestamp,selectedSeq:t.selectedSeq,onSelect:t.onSelect})}function pO(e){return e.type==="message"?`m-${e.message.seq}`:`c-${e.firstSeq}-${e.lastSeq}`}function fO({total:e,shown:t}){return e===0||t===e?null:d.jsxs("div",{className:"border-t border-line bg-surface-elev/60 px-4 py-1 text-right font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:["showing ",t," of ",e]})}function mO({message:e,tone:t="info"}){if(!e)return null;const n=t==="success"?"border-accent-out/50 bg-accent-out/10 text-accent-out":t==="warn"?"border-accent-warn/50 bg-accent-warn/10 text-accent-warn":"border-accent-info/50 bg-accent-info/10 text-accent-info";return d.jsx("div",{role:"status",className:W("pointer-events-none fixed right-4 top-[60px] z-50 rounded-sm border px-3 py-2 font-mono text-[11px] uppercase tracking-widest shadow-lg backdrop-blur-sm",n),children:e})}function hO({onImportResult:e}){const[t,n]=I.useState(!1),[o,r]=I.useState(!1),i=I.useRef(null),s=I.useRef(null),a=ne(y=>y.session),l=ne(y=>y.messages.length),c=a!==null&&l>0;I.useEffect(()=>{if(!t)return;const y=b=>{i.current&&!i.current.contains(b.target)&&n(!1)},g=b=>{b.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",g)}},[t]);const f=()=>{var y;n(!1),(y=s.current)==null||y.click()},m=()=>{n(!1);const y=ne.getState();y.session&&y.messages.length>0&&Ob(y.session,y.messages)},h=async y=>{var b;const g=(b=y.target.files)==null?void 0:b[0];if(y.target.value="",!!g){r(!0);try{const v=await gv(g);await Hu(),pt.getState().setSelected(Ya(v.id)),e==null||e(`imported ${g.name} · #${v.id} · ${v.messageCount} message${v.messageCount===1?"":"s"}`,"success")}catch(v){const p=v instanceof Error?v.message:String(v);e==null||e(`import failed: ${p}`,"warn")}finally{r(!1)}}};return d.jsxs("div",{ref:i,className:"relative",children:[d.jsx("input",{ref:s,type:"file",accept:"application/json,.json",onChange:h,className:"hidden","aria-hidden":"true",tabIndex:-1}),d.jsx("button",{type:"button",onClick:()=>n(y=>!y),title:"Session actions — import file · export","aria-haspopup":"menu","aria-expanded":t,"aria-label":"session actions",disabled:o,className:W("inline-flex h-7 w-7 items-center justify-center rounded-sm border font-mono text-[14px] leading-none transition-colors",t?"border-line-strong bg-surface-rowHover text-ink-primary":"border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",o&&"cursor-progress opacity-60"),children:d.jsx("span",{"aria-hidden":!0,children:"⋯"})}),t&&d.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+6px)] z-50 w-max overflow-hidden rounded-sm border border-line bg-surface-elev p-1 font-mono text-[11px] uppercase tracking-widest shadow-lg",children:[d.jsx(Zh,{icon:"↑",label:"import",onClick:f,title:"Open a session JSON exported earlier — yours or someone else's."}),d.jsx(Zh,{icon:"↓",label:"export",onClick:m,disabled:!c,title:"Download this session as self-contained JSON.",disabledTitle:"Nothing to export yet — wait for the first message."})]})]})}function Zh({icon:e,label:t,onClick:n,disabled:o,title:r,disabledTitle:i}){return d.jsxs("button",{type:"button",role:"menuitem",disabled:o,onClick:n,title:o?i:r,className:W("flex w-full items-center gap-2 rounded-[2px] px-2 py-1.5 text-left transition-colors",o?"cursor-not-allowed text-ink-dim opacity-50":"text-ink-muted hover:bg-surface-rowHover hover:text-ink-secondary"),children:[d.jsx("span",{"aria-hidden":!0,className:"w-4 text-center text-[13px] leading-none",children:e}),d.jsx("span",{className:"flex-1",children:t})]})}function yO({onSelect:e,activeUrl:t,overrideUrl:n}){const o=pt(u=>u.captures),r=pt(u=>u.savedSessions),i=pt(u=>u.lastFetchAt),[s,a]=I.useState(!1),l=I.useRef(null);I.useEffect(()=>{if(!s)return;const u=x=>{l.current&&!l.current.contains(x.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]);const c=o.find(u=>u.url===t)??null,f=t!==null&&mS(t)?hS(t):null,m=I.useMemo(()=>new Set(o.map(u=>u.sessionDbId).filter(u=>u!==null)),[o]),h=I.useMemo(()=>r.filter(u=>!m.has(u.id)),[r,m]),y=I.useMemo(()=>h.filter(u=>u.imported_at===null),[h]),g=I.useMemo(()=>h.filter(u=>u.imported_at!==null),[h]),b=f!==null?h.find(u=>u.id===f)??null:null,v=o.length+h.length;let p;return n?p="?ws override":c?p=Gp(c):b?p=`#${b.id} · ${b.name??(b.client_name?`${b.client_name} · ${Ot(b.agent_command??"")}`:Ot(b.agent_command??""))}`:v===0?p="no captures":p="pick capture",d.jsxs("div",{ref:l,className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>a(u=>!u),className:W("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] uppercase tracking-widest transition-colors","border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",s?"border-line-strong text-ink-primary":""),title:"Select a live capture or saved session",children:[d.jsx("span",{className:"inline-block w-[200px] truncate text-left",children:p}),v>1&&!n&&d.jsx("span",{className:"rounded-sm border border-line-strong px-1 text-[9px] text-ink-secondary",children:v}),d.jsx("span",{"aria-hidden":!0,className:W("transition-transform",s?"rotate-180":""),children:"▾"})]}),s&&d.jsxs("div",{className:W("absolute right-0 top-[calc(100%+6px)] z-50 w-[460px] rounded-md border border-line bg-surface-elev shadow-xl"),children:[d.jsxs(jc,{children:["live captures · last poll"," ",i?`${Math.round((Date.now()-i)/1e3)}s ago`:"—"]}),o.length===0&&d.jsxs("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:["none. start a proxy with"," ",d.jsx("span",{className:"text-ink-secondary",children:"acp-devtools proxy …"})]}),d.jsx("ul",{className:"max-h-[260px] overflow-y-auto",children:o.map(u=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>{e(u.url),a(!1)},title:`${u.agentCommand} · ${u.url}${u.saveTo?" · saved to local store":" · not persisted"}`,className:W("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",u.url===t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:W("h-2 w-2 shrink-0 rounded-full",u.url===t?"bg-accent-out animate-pulse-soft":"bg-accent-warn/50")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsx("span",{className:"text-accent-out",children:u.sessionDbId!==null?`#${u.sessionDbId}`:`pid ${u.pid}`}),d.jsx("span",{className:"text-ink-muted",children:" · "}),u.sessionName??(u.clientName?`${u.clientName} · ${Ot(u.agentCommand)}`:Ot(u.agentCommand))]}),d.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:Or(u.startedAt)})]})},u.url))}),d.jsxs(jc,{children:["saved · ",y.length," session",y.length===1?"":"s"]}),y.length===0&&d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:r.length===0?"no saved sessions yet":g.length>0?"no live-captured sessions yet":"all saved sessions are currently live"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:y.map(u=>d.jsx(ey,{s:u,activeUrl:t,onPick:x=>{e(x),a(!1)}},u.id))}),(g.length>0||r.some(u=>u.imported_at!==null))&&d.jsxs(d.Fragment,{children:[d.jsxs(jc,{children:["imported · ",g.length," file",g.length===1?"":"s"]}),g.length===0?d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no imported files"}):d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:g.map(u=>d.jsx(ey,{s:u,activeUrl:t,onPick:x=>{e(x),a(!1)}},u.id))})]}),n&&d.jsx("div",{className:"border-t border-line px-3 py-2 font-mono text-[10px] uppercase tracking-widest text-accent-warn",children:"?ws override active — discovery selection ignored"})]})]})}function jc({children:e}){return d.jsx("div",{className:"border-b border-line bg-surface-base/50 px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e})}function ey({s:e,activeUrl:t,onPick:n}){const o=Ya(e.id),r=o===t,i=s=>{s.stopPropagation();const a=e.name??Ot(e.agent_command??"");window.confirm(`Delete session #${e.id} ${a} forever?`)&&(async()=>{try{await fS(e.id),r&&pt.getState().setSelected(null),await Hu()}catch(l){const c=l instanceof Error?l.message:String(l);window.alert(`Delete failed: ${c}`)}})()};return d.jsxs("li",{className:"group relative",children:[d.jsxs("button",{type:"button",onClick:()=>n(o),title:`session #${e.id} · ${e.agent_command??""} · ${e.message_count} messages`,className:W("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",r?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:W("h-2 w-2 shrink-0 rounded-full",r?"bg-accent-note animate-pulse-soft":"bg-ink-dim")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),d.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Ot(e.agent_command??"")}`:Ot(e.agent_command??""))]}),d.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors group-hover:text-ink-secondary",children:[e.message_count,"msg · ",Or(e.started_at)]})]}),d.jsx("button",{type:"button",onClick:i,"aria-label":`delete session #${e.id} forever`,title:"Delete this session permanently",className:W("absolute right-2 top-1/2 hidden h-6 w-6 -translate-y-1/2 items-center justify-center rounded-sm border border-line bg-surface-elev/70 text-[12px] leading-none text-ink-muted transition-colors","group-hover:flex hover:border-accent-error/70 hover:bg-surface-rowHover hover:text-accent-error"),children:d.jsx("span",{"aria-hidden":!0,children:"×"})})]})}const Cc=[{mode:"system",label:"AUTO",title:"follow OS theme",icon:"◐"},{mode:"light",label:"LIGHT",title:"force light theme",icon:"☀"},{mode:"dark",label:"DARK",title:"force dark theme",icon:"☾"}];function gO(){const e=_d(s=>s.mode),t=_d(s=>s.setMode),[n,o]=I.useState(!1),r=I.useRef(null);I.useEffect(()=>{if(!n)return;const s=a=>{r.current&&!r.current.contains(a.target)&&o(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const i=Cc.find(s=>s.mode===e)??Cc[0];return d.jsxs("div",{ref:r,className:"relative",children:[d.jsx("button",{type:"button",onClick:()=>o(s=>!s),title:`theme · ${i.title}`,"aria-haspopup":"menu","aria-expanded":n,className:W("inline-flex h-7 w-7 items-center justify-center rounded-sm border font-mono text-[12px] transition-colors",n?"border-line-strong bg-surface-rowHover text-ink-primary":"border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary"),children:d.jsx("span",{"aria-hidden":!0,children:i.icon})}),n&&d.jsx("div",{role:"menu",className:"absolute right-0 top-[calc(100%+6px)] z-50 inline-flex items-center gap-px rounded-sm border border-line bg-surface-elev p-px font-mono text-[10px] uppercase tracking-widest shadow-lg",children:Cc.map(s=>{const a=s.mode===e;return d.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":a,onClick:()=>{t(s.mode),o(!1)},title:s.title,className:W("inline-flex items-center gap-1 rounded-[2px] px-2 py-1 transition-colors",a?"bg-accent-out/15 text-accent-out":"text-ink-muted hover:bg-surface-rowHover hover:text-ink-secondary"),children:[d.jsx("span",{"aria-hidden":!0,children:s.icon}),d.jsx("span",{children:s.label})]},s.mode)})})]})}function vO({wsUrl:e,overrideUrl:t,activeUrl:n,isReplay:o,isImported:r=!1,onPickCapture:i,onImportResult:s,onOpenInfo:a,onOpenPerf:l,onOpenDiff:c}){const f=ne(b=>b.connection),m=ne(b=>b.session),h=ne(b=>b.lastError),y=ne(b=>b.messages.length>0?b.messages[b.messages.length-1].timestamp:null),g=zb(5e3);return d.jsxs("header",{className:"flex items-center justify-between border-b border-line bg-surface-base px-5 py-2.5",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"wordmark-rule",children:d.jsx("span",{className:"font-display text-[18px] uppercase tracking-[0.18em] text-ink-primary",children:"acp.devtools"})}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.1.0"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[m&&(()=>{const{primary:b}=Ol(m),v=o||r,p=m.endedAt!==null?m.endedAt:y??m.startedAt,u=v?Or(m.startedAt,p):Or(m.startedAt,g),x=y!==null?g-y:null,S=!v&&x!==null&&x>5e3,T=Sa(m.startedAt,g),N=r?"IMPORTED":o?"REPLAY":"SESSION",$=r?"session loaded from a JSON file on disk — not connected to any proxy":o?"replay of a saved session — proxy has ended":"live capture — proxy process is still running",C=r?"text-accent-warn":o?"text-accent-note":"text-accent-out";return d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] text-ink-secondary",children:[d.jsx("span",{className:"text-ink-muted",title:$,children:N}),d.jsx("span",{className:C,title:m.agentCommand?`session #${m.id} · ${m.agentCommand}`:"persisted session id",children:b}),d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsx("span",{title:`session started at ${T}`,children:Sa(m.startedAt,g)}),u&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-muted",title:v?"capture duration (start → end of recorded session)":"how long the proxy process has been alive",children:[v?"lasted":"alive"," ",u]})]}),S&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-dim",title:`time since the most recent ACP frame · last event ${Sa(y,g)}`,children:["idle ",Or(y,g)]})]})]})})(),d.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&d.jsx(yO,{onSelect:i,activeUrl:n,overrideUrl:t}),d.jsx(bO,{status:f,wsUrl:e,lastError:h,isReplay:o,isImported:r,onReconnect:uS})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[a&&m&&d.jsx("button",{type:"button",onClick:a,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Show session info — client/agent capabilities, runtime state","aria-label":"Open session info panel",children:"info"}),l&&m&&d.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Show performance dashboard — per-method latency stats and waterfall timeline","aria-label":"Open performance dashboard",children:"perf"}),c&&m&&d.jsx("button",{type:"button",onClick:c,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Compare this session against another — metadata, per-method latency, and frame-level differences","aria-label":"Open session diff",children:"diff"}),d.jsx(hO,{...s?{onImportResult:s}:{}})]}),d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsx(gO,{})})]})]})}function bO({status:e,wsUrl:t,lastError:n,isReplay:o,isImported:r,onReconnect:i}){if(r)return d.jsxs("div",{className:"inline-flex h-7 cursor-default items-center gap-2 rounded-sm border border-accent-warn/40 bg-accent-warn/10 px-3 font-mono text-[10px] font-semibold uppercase tracking-widest text-accent-warn",title:`viewing data from a JSON file · ${t}`,children:[d.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 rounded-full bg-accent-warn"}),d.jsx("span",{className:"inline-block min-w-[52px] text-center",children:"FILE"})]});const a=e==="open"?o?"REPLAY":"LIVE":e==="connecting"?"WAITING":e==="idle"?"IDLE":e==="closed"?"CLOSED":"ERROR",c={idle:"text-ink-secondary bg-surface-row border-line",connecting:"text-accent-warn/80 bg-accent-warn/10 border-accent-warn/30",open:o?"text-accent-note bg-accent-note/10 border-accent-note/40":"text-accent-out bg-accent-out/10 border-accent-out/40",closed:"text-ink-secondary bg-surface-row border-line",error:"text-accent-error bg-accent-error/10 border-accent-error/40"},m=e==="open"?o?"bg-accent-note animate-pulse-soft":"bg-accent-out animate-pulse-soft":e==="connecting"?"bg-accent-warn/60 animate-pulse-soft":e==="error"?"bg-accent-error":"bg-ink-dim",h=e==="idle"||e==="closed"||e==="error",g=n||(e==="open"?`${o?"serving a recorded session from the local store":"connected to a live proxy capture"} · ${t}`:h?`click to reconnect · ${t}`:t);return d.jsxs("button",{type:"button",onClick:h?i:void 0,disabled:!h,className:W("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",c[e],h?"cursor-pointer hover:bg-surface-rowHover":"cursor-default"),title:g,children:[d.jsx("span",{"aria-hidden":!0,className:W("inline-block h-2 w-2 rounded-full",m)}),d.jsx("span",{className:"inline-block min-w-[52px] text-center",children:a})]})}function xO(){const e=pt(_=>_.captures),t=pt(_=>_.selectedUrl),n=pt(_=>_.setSelected),o=ne(_=>{var w;return((w=_.session)==null?void 0:w.importedAt)??null}),r=t,i=t!==null&&/\/replay\/\d+$/.test(t),s=o!==null;I.useEffect(()=>wS(),[]),I.useEffect(()=>kS(),[]);const[a,l]=I.useState(null),c=I.useRef(new Set);I.useEffect(()=>{const _=ah(window.location.search),w=ne.getState(),k={};Object.keys(_.filters).length>0&&(k.filters={...w.filters,..._.filters}),_.selectedSeq!==null&&(k.selectedSeq=_.selectedSeq),_.detailTab!==null&&(k.detailTab=_.detailTab),_.playbackCap!==null&&(k.playback={...w.playback,cap:_.playbackCap}),Object.keys(k).length>0&&ne.setState(k),_.captureUrl&&pt.getState().setSelected(_.captureUrl)},[]);const[f,m]=I.useState(!1),[h,y]=I.useState(!1),[g,b]=I.useState(!1);I.useEffect(()=>{const _=()=>{const E=ne.getState(),K=pt.getState();VC({filters:E.filters,selectedSeq:E.selectedSeq,detailTab:E.detailTab,playbackCap:E.playback.cap,captureUrl:K.selectedUrl})},w=ne.subscribe(_),k=pt.subscribe(_);return _(),()=>{w(),k()}},[]);const v=()=>{f||(window.history.pushState({drawer:"info"},"",window.location.href),m(!0))},p=()=>{h||(window.history.pushState({drawer:"perf"},"",window.location.href),y(!0))},u=()=>{g||(window.history.pushState({drawer:"diff"},"",window.location.href),b(!0))},x=()=>{f&&window.history.back()},S=()=>{h&&window.history.back()},T=()=>{g&&window.history.back()},N=_=>{window.history.pushState({drawer:null},"",window.location.href),ne.getState().select(_),m(!1),y(!1),b(!1)};I.useEffect(()=>{const _=w=>{const k=w.state;m((k==null?void 0:k.drawer)==="info"),y((k==null?void 0:k.drawer)==="perf"),b((k==null?void 0:k.drawer)==="diff");const E=ah(window.location.search),K=ne.getState(),O=pt.getState(),X={};Object.keys(E.filters).length>0&&(X.filters={...K.filters,...E.filters}),X.selectedSeq=E.selectedSeq,X.detailTab=E.detailTab??"tree",X.playback={...K.playback,cap:E.playbackCap},ne.setState(X),E.captureUrl!==O.selectedUrl&&E.captureUrl&&O.setSelected(E.captureUrl)};return window.addEventListener("popstate",_),()=>window.removeEventListener("popstate",_)},[]),I.useEffect(()=>{const _=new Set(e.map(O=>O.url));if(c.current=c.current,i){c.current=_;return}const w=e[0]??null,k=t===null,E=t!==null&&_.has(t),K=w!==null&&!c.current.has(w.url)&&c.current.size>0;e.length===0?t!==null&&n(null):k||!E?n(w.url):K&&w.url!==t&&(n(w.url),l({message:`switched → ${Gp(w)}`,tone:"success"})),c.current=_},[e,t,n,i]),I.useEffect(()=>{if(!a)return;let _=3e3,w=Date.now(),k=null;const E=()=>{k===null&&document.visibilityState==="visible"&&(w=Date.now(),k=setTimeout(()=>l(null),_))},K=()=>{k!==null&&(clearTimeout(k),k=null,_=Math.max(0,_-(Date.now()-w)))},O=()=>{document.visibilityState==="visible"?E():K()};return document.addEventListener("visibilitychange",O),E(),()=>{document.removeEventListener("visibilitychange",O),k&&clearTimeout(k)}},[a]),I.useEffect(()=>{if(!r){hv();return}Fu(r)},[r]);const[$,C]=I.useState(!1);I.useEffect(()=>{const _=w=>{if((w.metaKey||w.ctrlKey)&&(w.key==="k"||w.key==="K")){w.preventDefault(),C(E=>!E);return}if($)return;const k=w.target;if(!(k&&(k.tagName==="INPUT"||k.tagName==="TEXTAREA"))){if(w.key==="Escape"){ne.getState().select(null);return}if(w.key==="j"||w.key==="J"){ty(1);return}if(w.key==="k"||w.key==="K"){ty(-1);return}}};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[$]);const R=ne(_=>_.messages),M=ne(_=>_.session),F=ne(_=>_.selectedSeq),H=ne(_=>_.connection),L=ne(_=>_.lastError);I.useEffect(()=>{const _="ACP Devtools";if(!M){document.title=_;return}const{primary:w,secondary:k}=Ol(M),E=k?`${w} · ${k}`:w;document.title=`${E} — ${_}`},[M]);const U=I.useMemo(()=>aS(R,F),[R,F]),D=I.useMemo(()=>{const _=Tl(R),w=new Map;for(const[k,E]of _.entries())w.set(E,k);return{responseToRequest:_,requestToResponse:w}},[R]),Q=I.useMemo(()=>Kp(R),[R]);let ee,q=null;if(U){if(U.kind==="response"||U.kind==="error"){const _=D.responseToRequest.get(U.seq);_!==void 0&&(q=R.find(w=>w.seq===_)??null,q&&(ee=U.timestamp-q.timestamp))}else if(U.kind==="request"){const _=D.requestToResponse.get(U.seq);_!==void 0&&(q=R.find(w=>w.seq===_)??null,q&&(ee=q.timestamp-U.timestamp))}}const G=R.length===0&&!M,P=r??"no capture selected",j=G&&r===null&&e.length===0,A=G&&!j;return d.jsxs("div",{className:"flex h-full flex-col bg-surface-base text-ink-primary",children:[d.jsx(mO,{message:(a==null?void 0:a.message)??null,tone:(a==null?void 0:a.tone)??"info"}),d.jsx(PN,{open:$,onClose:()=>C(!1)}),d.jsx(gP,{open:f,onClose:x}),d.jsx(sP,{open:h,onClose:S,onNavigateToSeq:N}),d.jsx(wE,{open:g,onClose:T}),d.jsx(vO,{wsUrl:P,overrideUrl:null,isReplay:i,isImported:s,onPickCapture:_=>{n(_),c.current.add(_)},onImportResult:(_,w)=>l({message:_,tone:w}),activeUrl:r,onOpenInfo:v,onOpenPerf:p,onOpenDiff:u}),d.jsx(qE,{}),d.jsx("main",{className:"flex-1 overflow-hidden",children:j?d.jsx(AE,{status:H,lastError:L,url:P,captureCount:e.length}):A?d.jsx(AN,{status:H,url:P,lastError:L}):d.jsx(wP,{storageKey:"acp.split.leftPx",initialLeftFraction:.62,minLeft:420,minRight:360,left:d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"min-h-0 flex-1",children:d.jsx(dO,{})}),(i||s)&&d.jsx(yP,{})]}),right:d.jsx(YN,{message:U,...ee!==void 0?{latencyMs:ee}:{},...q?{pairedRequest:q}:{},...U?(()=>{const _=Q.get(U.seq);return _?{validation:_}:{}})():{},onJumpToPaired:_=>ne.getState().select(_)})})}),d.jsx(SP,{})]})}function ty(e){const t=ne.getState(),{messages:n,selectedSeq:o}=t;if(n.length===0)return;if(o===null){const s=e===1?n[0]:n[n.length-1];s&&t.select(s.seq);return}const r=n.findIndex(s=>s.seq===o);if(r===-1){const s=n[0];s&&t.select(s.seq);return}const i=n[r+e];i&&t.select(i.seq)}const kx=document.getElementById("root");if(!kx)throw new Error("#root not found");Nc.createRoot(kx).render(d.jsx(te.StrictMode,{children:d.jsx(xO,{})}));
|
|
1768
|
-
//# sourceMappingURL=index-
|
|
1765
|
+
deps: ${f}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[c,f]=i(l);s(l,c),a(l,f)}};function i({schema:l}){const c={},f={};for(const m in l){if(m==="__proto__")continue;const h=Array.isArray(l[m])?c:f;h[m]=l[m]}return[c,f]}function s(l,c=l.schema){const{gen:f,data:m,it:h}=l;if(Object.keys(c).length===0)return;const y=f.let("missing");for(const g in c){const b=c[g];if(b.length===0)continue;const v=(0,o.propertyInData)(f,m,g,h.opts.ownProperties);l.setParams({property:g,depsCount:b.length,deps:b.join(", ")}),h.allErrors?f.if(v,()=>{for(const u of b)(0,o.checkReportMissingProp)(l,u)}):(f.if((0,t._)`${v} && (${(0,o.checkMissingProp)(l,b,y)})`),(0,o.reportMissingProp)(l,y),f.else())}}e.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:f,data:m,keyword:h,it:y}=l,g=f.name("valid");for(const b in c)(0,n.alwaysValidSchema)(y,c[b])||(f.if((0,o.propertyInData)(f,m,b,y.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:b},g);l.mergeValidEvaluated(v,g)},()=>f.var(g,!0)),l.ok(g))}e.validateSchemaDeps=a,e.default=r})(Rl);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});const Cb=ue,I1=J,O1={message:"property name must be valid",params:({params:e})=>(0,Cb._)`{propertyName: ${e.propertyName}}`},R1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:O1,code(e){const{gen:t,schema:n,data:o,it:r}=e;if((0,I1.alwaysValidSchema)(r,n))return;const i=t.name("valid");t.forIn("key",o,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Cb.not)(i),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(i)}};Ep.default=R1;var Al={};Object.defineProperty(Al,"__esModule",{value:!0});const Zs=ye,en=ue,A1=Dt,ea=J,M1={message:"must NOT have additional properties",params:({params:e})=>(0,en._)`{additionalProperty: ${e.additionalProperty}}`},q1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:M1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,ea.alwaysValidSchema)(s,n))return;const c=(0,Zs.allSchemaProperties)(o.properties),f=(0,Zs.allSchemaProperties)(o.patternProperties);m(),e.ok((0,en._)`${i} === ${A1.default.errors}`);function m(){t.forIn("key",r,v=>{!c.length&&!f.length?g(v):t.if(h(v),()=>g(v))})}function h(v){let u;if(c.length>8){const p=(0,ea.schemaRefOrVal)(s,o.properties,"properties");u=(0,Zs.isOwnProperty)(t,p,v)}else c.length?u=(0,en.or)(...c.map(p=>(0,en._)`${v} === ${p}`)):u=en.nil;return f.length&&(u=(0,en.or)(u,...f.map(p=>(0,en._)`${(0,Zs.usePattern)(e,p)}.test(${v})`))),(0,en.not)(u)}function y(v){t.code((0,en._)`delete ${r}[${v}]`)}function g(v){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){y(v);return}if(n===!1){e.setParams({additionalProperty:v}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,ea.alwaysValidSchema)(s,n)){const u=t.name("valid");l.removeAdditional==="failing"?(b(v,u,!1),t.if((0,en.not)(u),()=>{e.reset(),y(v)})):(b(v,u),a||t.if((0,en.not)(u),()=>t.break()))}}function b(v,u,p){const x={keyword:"additionalProperties",dataProp:v,dataPropType:ea.Type.Str};p===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,u)}}};Al.default=q1;var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});const U1=ln,Ym=ye,wc=J,Xm=Al,L1={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&Xm.default.code(new U1.KeywordCxt(i,Xm.default,"additionalProperties"));const s=(0,Ym.allSchemaProperties)(n);for(const m of s)i.definedProperties.add(m);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=wc.mergeEvaluated.props(t,(0,wc.toHash)(s),i.props));const a=s.filter(m=>!(0,wc.alwaysValidSchema)(i,n[m]));if(a.length===0)return;const l=t.name("valid");for(const m of a)c(m)?f(m):(t.if((0,Ym.propertyInData)(t,r,m,i.opts.ownProperties)),f(m),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(l);function c(m){return i.opts.useDefaults&&!i.compositeRule&&n[m].default!==void 0}function f(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},l)}}};Pp.default=L1;var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});const Zm=ye,ta=ue,eh=J,th=J,D1={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:o,parentSchema:r,it:i}=e,{opts:s}=i,a=(0,Zm.allSchemaProperties)(n),l=a.filter(b=>(0,eh.alwaysValidSchema)(i,n[b]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const c=s.strictSchema&&!s.allowMatchingProperties&&r.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof ta.Name)&&(i.props=(0,th.evaluatedPropsToName)(t,i.props));const{props:m}=i;h();function h(){for(const b of a)c&&y(b),i.allErrors?g(b):(t.var(f,!0),g(b),t.if(f))}function y(b){for(const v in c)new RegExp(b).test(v)&&(0,eh.checkStrictMode)(i,`property ${v} matches pattern ${b} (use allowMatchingProperties)`)}function g(b){t.forIn("key",o,v=>{t.if((0,ta._)`${(0,Zm.usePattern)(e,b)}.test(${v})`,()=>{const u=l.includes(b);u||e.subschema({keyword:"patternProperties",schemaProp:b,dataProp:v,dataPropType:th.Type.Str},f),i.opts.unevaluated&&m!==!0?t.assign((0,ta._)`${m}[${v}]`,!0):!u&&!i.allErrors&&t.if((0,ta.not)(f),()=>t.break())})})}}};Ip.default=D1;var Op={};Object.defineProperty(Op,"__esModule",{value:!0});const z1=J,F1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,z1.alwaysValidSchema)(o,n)){e.fail();return}const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Op.default=F1;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});const B1=ye,H1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:B1.validateUnion,error:{message:"must match a schema in anyOf"}};Rp.default=H1;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});const Sa=ue,V1=J,W1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Sa._)`{passingSchemas: ${e.passing}}`},K1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:W1,code(e){const{gen:t,schema:n,parentSchema:o,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&o.discriminator)return;const i=n,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(s,()=>e.reset(),()=>e.error(!0));function c(){i.forEach((f,m)=>{let h;(0,V1.alwaysValidSchema)(r,f)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},l),m>0&&t.if((0,Sa._)`${l} && ${s}`).assign(s,!1).assign(a,(0,Sa._)`[${a}, ${m}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,m),h&&e.mergeEvaluated(h,Sa.Name)})})}}};Ap.default=K1;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});const G1=J,J1={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach((i,s)=>{if((0,G1.alwaysValidSchema)(o,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},r);e.ok(r),e.mergeEvaluated(a)})}};Mp.default=J1;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});const sl=ue,Eb=J,Q1={message:({params:e})=>(0,sl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,sl._)`{failingKeyword: ${e.ifClause}}`},Y1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Q1,code(e){const{gen:t,parentSchema:n,it:o}=e;n.then===void 0&&n.else===void 0&&(0,Eb.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const r=nh(o,"then"),i=nh(o,"else");if(!r&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),r&&i){const f=t.let("ifClause");e.setParams({ifClause:f}),t.if(a,c("then",f),c("else",f))}else r?t.if(a,c("then")):t.if((0,sl.not)(a),c("else"));e.pass(s,()=>e.error(!0));function l(){const f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(f)}function c(f,m){return()=>{const h=e.subschema({keyword:f},a);t.assign(s,a),e.mergeValidEvaluated(h,s),m?t.assign(m,(0,sl._)`${f}`):e.setParams({ifClause:f})}}}};function nh(e,t){const n=e.schema[t];return n!==void 0&&!(0,Eb.alwaysValidSchema)(e,n)}qp.default=Y1;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});const X1=J,Z1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,X1.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Up.default=Z1;Object.defineProperty(_p,"__esModule",{value:!0});const e_=Xr,t_=jp,n_=Zr,o_=Np,r_=Cp,i_=Rl,s_=Ep,a_=Al,l_=Pp,c_=Ip,d_=Op,u_=Rp,p_=Ap,f_=Mp,m_=qp,h_=Up;function y_(e=!1){const t=[d_.default,u_.default,p_.default,f_.default,m_.default,h_.default,s_.default,a_.default,i_.default,l_.default,c_.default];return e?t.push(t_.default,o_.default):t.push(e_.default,n_.default),t.push(r_.default),t}_p.default=y_;var Lp={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.dynamicAnchor=void 0;const Sc=ue,g_=Dt,oh=xt,v_=zn,b_={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Pb(e,e.schema)};function Pb(e,t){const{gen:n,it:o}=e;o.schemaEnv.root.dynamicAnchors[t]=!0;const r=(0,Sc._)`${g_.default.dynamicAnchors}${(0,Sc.getProperty)(t)}`,i=o.errSchemaPath==="#"?o.validateName:x_(e);n.if((0,Sc._)`!${r}`,()=>n.assign(r,i))}ei.dynamicAnchor=Pb;function x_(e){const{schemaEnv:t,schema:n,self:o}=e.it,{root:r,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=o.opts,c=new oh.SchemaEnv({schema:n,schemaId:l,root:r,baseId:i,localRefs:s,meta:a});return oh.compileSchema.call(o,c),(0,v_.getValidate)(e,c)}ei.default=b_;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.dynamicRef=void 0;const rh=ue,w_=Dt,ih=zn,S_={keyword:"$dynamicRef",schemaType:"string",code:e=>Ib(e,e.schema)};function Ib(e,t){const{gen:n,keyword:o,it:r}=e;if(t[0]!=="#")throw new Error(`"${o}" only supports hash fragment reference`);const i=t.slice(1);if(r.allErrors)s();else{const l=n.let("valid",!1);s(l),e.ok(l)}function s(l){if(r.schemaEnv.root.dynamicAnchors[i]){const c=n.let("_v",(0,rh._)`${w_.default.dynamicAnchors}${(0,rh.getProperty)(i)}`);n.if(c,a(c,l),a(r.validateName,l))}else a(r.validateName,l)()}function a(l,c){return c?()=>n.block(()=>{(0,ih.callRef)(e,l),n.let(c,!0)}):()=>(0,ih.callRef)(e,l)}}ti.dynamicRef=Ib;ti.default=S_;var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});const $_=ei,k_=J,T_={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,$_.dynamicAnchor)(e,""):(0,k_.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Dp.default=T_;var zp={};Object.defineProperty(zp,"__esModule",{value:!0});const __=ti,j_={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,__.dynamicRef)(e,e.schema)};zp.default=j_;Object.defineProperty(Lp,"__esModule",{value:!0});const N_=ei,C_=ti,E_=Dp,P_=zp,I_=[N_.default,C_.default,E_.default,P_.default];Lp.default=I_;var Fp={},Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});const sh=Rl,O_={keyword:"dependentRequired",type:"object",schemaType:"object",error:sh.error,code:e=>(0,sh.validatePropertyDeps)(e)};Bp.default=O_;var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});const R_=Rl,A_={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,R_.validateSchemaDeps)(e)};Hp.default=A_;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});const M_=J,q_={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,M_.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Vp.default=q_;Object.defineProperty(Fp,"__esModule",{value:!0});const U_=Bp,L_=Hp,D_=Vp,z_=[U_.default,L_.default,D_.default];Fp.default=z_;var Wp={},Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});const Xn=ue,ah=J,F_=Dt,B_={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Xn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},H_={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:B_,code(e){const{gen:t,schema:n,data:o,errsCount:r,it:i}=e;if(!r)throw new Error("ajv implementation error");const{allErrors:s,props:a}=i;a instanceof Xn.Name?t.if((0,Xn._)`${a} !== true`,()=>t.forIn("key",o,m=>t.if(c(a,m),()=>l(m)))):a!==!0&&t.forIn("key",o,m=>a===void 0?l(m):t.if(f(a,m),()=>l(m))),i.props=!0,e.ok((0,Xn._)`${r} === ${F_.default.errors}`);function l(m){if(n===!1){e.setParams({unevaluatedProperty:m}),e.error(),s||t.break();return}if(!(0,ah.alwaysValidSchema)(i,n)){const h=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:ah.Type.Str},h),s||t.if((0,Xn.not)(h),()=>t.break())}}function c(m,h){return(0,Xn._)`!${m} || !${m}[${h}]`}function f(m,h){const y=[];for(const g in m)m[g]===!0&&y.push((0,Xn._)`${h} !== ${g}`);return(0,Xn.and)(...y)}}};Kp.default=H_;var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});const Ro=ue,lh=J,V_={message:({params:{len:e}})=>(0,Ro.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ro._)`{limit: ${e}}`},W_={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:V_,code(e){const{gen:t,schema:n,data:o,it:r}=e,i=r.items||0;if(i===!0)return;const s=t.const("len",(0,Ro._)`${o}.length`);if(n===!1)e.setParams({len:i}),e.fail((0,Ro._)`${s} > ${i}`);else if(typeof n=="object"&&!(0,lh.alwaysValidSchema)(r,n)){const l=t.var("valid",(0,Ro._)`${s} <= ${i}`);t.if((0,Ro.not)(l),()=>a(l,i)),e.ok(l)}r.items=!0;function a(l,c){t.forRange("i",c,s,f=>{e.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:lh.Type.Num},l),r.allErrors||t.if((0,Ro.not)(l),()=>t.break())})}}};Gp.default=W_;Object.defineProperty(Wp,"__esModule",{value:!0});const K_=Kp,G_=Gp,J_=[K_.default,G_.default];Wp.default=J_;var Jp={},Qp={};Object.defineProperty(Qp,"__esModule",{value:!0});const We=ue,Q_={message:({schemaCode:e})=>(0,We.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,We._)`{format: ${e}}`},Y_={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Q_,code(e,t){const{gen:n,data:o,$data:r,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:c,schemaEnv:f,self:m}=a;if(!l.validateFormats)return;r?h():y();function h(){const g=n.scopeValue("formats",{ref:m.formats,code:l.code.formats}),b=n.const("fDef",(0,We._)`${g}[${s}]`),v=n.let("fType"),u=n.let("format");n.if((0,We._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>n.assign(v,(0,We._)`${b}.type || "string"`).assign(u,(0,We._)`${b}.validate`),()=>n.assign(v,(0,We._)`"string"`).assign(u,b)),e.fail$data((0,We.or)(p(),x()));function p(){return l.strictSchema===!1?We.nil:(0,We._)`${s} && !${u}`}function x(){const S=f.$async?(0,We._)`(${b}.async ? await ${u}(${o}) : ${u}(${o}))`:(0,We._)`${u}(${o})`,T=(0,We._)`(typeof ${u} == "function" ? ${S} : ${u}.test(${o}))`;return(0,We._)`${u} && ${u} !== true && ${v} === ${t} && !${T}`}}function y(){const g=m.formats[i];if(!g){p();return}if(g===!0)return;const[b,v,u]=x(g);b===t&&e.pass(S());function p(){if(l.strictSchema===!1){m.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${c}"`}}function x(T){const C=T instanceof RegExp?(0,We.regexpCode)(T):l.code.formats?(0,We._)`${l.code.formats}${(0,We.getProperty)(i)}`:void 0,$=n.scopeValue("formats",{key:i,ref:T,code:C});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,We._)`${$}.validate`]:["string",T,$]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!f.$async)throw new Error("async format in sync schema");return(0,We._)`await ${u}(${o})`}return typeof v=="function"?(0,We._)`${u}(${o})`:(0,We._)`${u}.test(${o})`}}}};Qp.default=Y_;Object.defineProperty(Jp,"__esModule",{value:!0});const X_=Qp,Z_=[X_.default];Jp.default=Z_;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.contentVocabulary=Kr.metadataVocabulary=void 0;Kr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Kr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(up,"__esModule",{value:!0});const ej=pp,tj=mp,nj=_p,oj=Lp,rj=Fp,ij=Wp,sj=Jp,ch=Kr,aj=[oj.default,ej.default,tj.default,(0,nj.default)(!0),sj.default,ch.metadataVocabulary,ch.contentVocabulary,rj.default,ij.default];up.default=aj;var Yp={},Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});Ml.DiscrError=void 0;var dh;(function(e){e.Tag="tag",e.Mapping="mapping"})(dh||(Ml.DiscrError=dh={}));Object.defineProperty(Yp,"__esModule",{value:!0});const dr=ue,Ld=Ml,uh=xt,lj=Yr,cj=J,dj={message:({params:{discrError:e,tagName:t}})=>e===Ld.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,dr._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},uj={keyword:"discriminator",type:"object",schemaType:"object",error:dj,code(e){const{gen:t,data:n,schema:o,parentSchema:r,it:i}=e,{oneOf:s}=r;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),c=t.const("tag",(0,dr._)`${n}${(0,dr.getProperty)(a)}`);t.if((0,dr._)`typeof ${c} == "string"`,()=>f(),()=>e.error(!1,{discrError:Ld.DiscrError.Tag,tag:c,tagName:a})),e.ok(l);function f(){const y=h();t.if(!1);for(const g in y)t.elseIf((0,dr._)`${c} === ${g}`),t.assign(l,m(y[g]));t.else(),e.error(!1,{discrError:Ld.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function m(y){const g=t.name("valid"),b=e.subschema({keyword:"oneOf",schemaProp:y},g);return e.mergeEvaluated(b,dr.Name),g}function h(){var y;const g={},b=u(r);let v=!0;for(let S=0;S<s.length;S++){let T=s[S];if(T!=null&&T.$ref&&!(0,cj.schemaHasRulesButRef)(T,i.self.RULES)){const $=T.$ref;if(T=uh.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,$),T instanceof uh.SchemaEnv&&(T=T.schema),T===void 0)throw new lj.default(i.opts.uriResolver,i.baseId,$)}const C=(y=T==null?void 0:T.properties)===null||y===void 0?void 0:y[a];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(b||u(T)),p(C,S)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return g;function u({required:S}){return Array.isArray(S)&&S.includes(a)}function p(S,T){if(S.const)x(S.const,T);else if(S.enum)for(const C of S.enum)x(C,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(S,T){if(typeof S!="string"||S in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[S]=T}}}};Yp.default=uj;var Xp={};const pj="https://json-schema.org/draft/2020-12/schema",fj="https://json-schema.org/draft/2020-12/schema",mj={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},hj="meta",yj="Core and Validation specifications meta-schema",gj=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],vj=["object","boolean"],bj="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",xj={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},wj={$schema:pj,$id:fj,$vocabulary:mj,$dynamicAnchor:hj,title:yj,allOf:gj,type:vj,$comment:bj,properties:xj},Sj="https://json-schema.org/draft/2020-12/schema",$j="https://json-schema.org/draft/2020-12/meta/applicator",kj={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Tj="meta",_j="Applicator vocabulary meta-schema",jj=["object","boolean"],Nj={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},Cj={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Ej={$schema:Sj,$id:$j,$vocabulary:kj,$dynamicAnchor:Tj,title:_j,type:jj,properties:Nj,$defs:Cj},Pj="https://json-schema.org/draft/2020-12/schema",Ij="https://json-schema.org/draft/2020-12/meta/unevaluated",Oj={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},Rj="meta",Aj="Unevaluated applicator vocabulary meta-schema",Mj=["object","boolean"],qj={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},Uj={$schema:Pj,$id:Ij,$vocabulary:Oj,$dynamicAnchor:Rj,title:Aj,type:Mj,properties:qj},Lj="https://json-schema.org/draft/2020-12/schema",Dj="https://json-schema.org/draft/2020-12/meta/content",zj={"https://json-schema.org/draft/2020-12/vocab/content":!0},Fj="meta",Bj="Content vocabulary meta-schema",Hj=["object","boolean"],Vj={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Wj={$schema:Lj,$id:Dj,$vocabulary:zj,$dynamicAnchor:Fj,title:Bj,type:Hj,properties:Vj},Kj="https://json-schema.org/draft/2020-12/schema",Gj="https://json-schema.org/draft/2020-12/meta/core",Jj={"https://json-schema.org/draft/2020-12/vocab/core":!0},Qj="meta",Yj="Core vocabulary meta-schema",Xj=["object","boolean"],Zj={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},eN={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},tN={$schema:Kj,$id:Gj,$vocabulary:Jj,$dynamicAnchor:Qj,title:Yj,type:Xj,properties:Zj,$defs:eN},nN="https://json-schema.org/draft/2020-12/schema",oN="https://json-schema.org/draft/2020-12/meta/format-annotation",rN={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},iN="meta",sN="Format vocabulary meta-schema for annotation results",aN=["object","boolean"],lN={format:{type:"string"}},cN={$schema:nN,$id:oN,$vocabulary:rN,$dynamicAnchor:iN,title:sN,type:aN,properties:lN},dN="https://json-schema.org/draft/2020-12/schema",uN="https://json-schema.org/draft/2020-12/meta/meta-data",pN={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},fN="meta",mN="Meta-data vocabulary meta-schema",hN=["object","boolean"],yN={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},gN={$schema:dN,$id:uN,$vocabulary:pN,$dynamicAnchor:fN,title:mN,type:hN,properties:yN},vN="https://json-schema.org/draft/2020-12/schema",bN="https://json-schema.org/draft/2020-12/meta/validation",xN={"https://json-schema.org/draft/2020-12/vocab/validation":!0},wN="meta",SN="Validation vocabulary meta-schema",$N=["object","boolean"],kN={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},TN={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},_N={$schema:vN,$id:bN,$vocabulary:xN,$dynamicAnchor:wN,title:SN,type:$N,properties:kN,$defs:TN};Object.defineProperty(Xp,"__esModule",{value:!0});const jN=wj,NN=Ej,CN=Uj,EN=Wj,PN=tN,IN=cN,ON=gN,RN=_N,AN=["/properties"];function MN(e){return[jN,NN,CN,EN,PN,t(this,IN),ON,t(this,RN)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,o){return e?n.$dataMetaSchema(o,AN):o}}Xp.default=MN;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=Ev,o=up,r=Yp,i=Xp,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(y={}){super({...y,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:y,meta:g}=this.opts;g&&(i.default.call(this,y),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var l=ln;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=Cs;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=Yr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(Id,Id.exports);var qN=Id.exports;const UN=Qd(qN),ph=UN,LN=ph.default??ph,fh="acp";function DN(e){const t={path:e.instancePath||"/",message:e.message??"validation failed"};return e.keyword&&(t.keyword=e.keyword),t}function zN(e){const t=new LN({strict:!1,allErrors:!0,validateFormats:!1});t.addSchema(e,fh);const n=new Map,o=e.$defs??{};for(const[l,c]of Object.entries(o)){const f=c["x-method"];if(typeof f!="string")continue;let m=n.get(f);m||(m={},n.set(f,m)),l.endsWith("Request")?m.requestDef=l:l.endsWith("Response")?m.responseDef=l:l.endsWith("Notification")&&(m.notificationDef=l)}const r=new Map,i=l=>{const c=r.get(l);if(c)return c;const f=t.compile({$ref:`${fh}#/$defs/${l}`});return r.set(l,f),f};function s(l,c={}){if(!l.payload)return{valid:!0,errors:[],skipped:"parse-error"};if(l.kind==="unknown")return{valid:!0,errors:[],skipped:"wrong-kind"};const f=l.method??c.pairedMethod;if(!f)return{valid:!0,errors:[],skipped:"no-method"};const m=n.get(f);if(!m)return{valid:!0,errors:[],skipped:"unknown-method"};let h,y;const g=l.payload;if(l.kind==="request")h=m.requestDef,y=g.params;else if(l.kind==="notification")h=m.notificationDef,y=g.params;else if(l.kind==="response")h=m.responseDef,y=g.result;else return{valid:!0,errors:[],skipped:"wrong-kind"};if(!h)return{valid:!0,errors:[],skipped:"no-schema-for-kind"};const b=i(h);return b(y)?{valid:!0,errors:[],schemaName:h}:{valid:!1,errors:(b.errors??[]).map(DN),schemaName:h}}function a(){return[...n.keys()].sort()}return{validateAcpMessage:s,knownAcpMethods:a}}const FN=zN(Cv),BN=FN.validateAcpMessage;function Zp(e){const t=Cl(e),n=new Map;for(const r of e)r.method&&n.set(r.seq,r.method);const o=new Map;for(const r of e){const i=t.get(r.seq),s=i!==void 0?n.get(i):void 0,a={};s!==void 0&&(a.pairedMethod=s),o.set(r.seq,BN(r,a))}return o}function HN(e){let t=0,n=0,o=0;const r=new Set;for(const[,i]of e)if(!i.skipped&&(t+=1,!i.valid&&(n+=1,o+=i.errors.length,i.schemaName))){const s=i.schemaName.replace(/(Request|Response|Notification)$/,"");r.add(s)}return{checked:t,invalidFrames:n,totalErrors:o,affectedMethods:[...r].sort()}}const VN={"claude-code":{shortName:"claude-code",displayName:"Claude Code",description:"Anthropic Claude Code via @agentclientprotocol/claude-agent-acp",command:"npx",args:["-y","@agentclientprotocol/claude-agent-acp"],aliases:[["npx","-y","@zed-industries/claude-code-acp"]]},codex:{shortName:"codex",displayName:"Codex",description:"OpenAI Codex via @zed-industries/codex-acp",command:"npx",args:["-y","@zed-industries/codex-acp"]},goose:{shortName:"goose",displayName:"Goose",description:"Block Goose — install separately, then this runs `goose acp`",command:"goose",args:["acp"],requiresExternalInstall:!0},opencode:{shortName:"opencode",displayName:"OpenCode",description:"SST OpenCode — install via opencode.ai/install, then `opencode acp`",command:"opencode",args:["acp"],requiresExternalInstall:!0}};function WN(e){const t=e.trim();if(t.length===0)return null;for(const n of Object.values(VN)){const o=[[n.command,...n.args],...n.aliases??[]];for(const r of o){const i=r.join(" ");if(t===i||t.startsWith(i+" "))return n}}return null}function Rt(e){const t=WN(e);if(t)return t.displayName;const n=e.trim().split(/\s+/).filter(Boolean);if(n.length===0)return e;if(n[0]==="npx")for(let o=1;o<n.length;o++){const r=n[o];if(!r.startsWith("-"))return r}return n[0]==="node"&&n[1]?n[1].split("/").pop()??n[1]:n[0]}function ef(e){const t=e.sessionDbId!==null?`#${e.sessionDbId}`:`pid ${e.pid}`;if(e.sessionName)return`${t} · ${e.sessionName}`;const n=Rt(e.agentCommand);return e.clientName?`${t} · ${e.clientName} · ${n}`:`${t} · ${n}`}function ql(e){const t=e.id>0?`#${e.id}`:"ephemeral";if(e.name)return{primary:t,secondary:e.name};const n=Rt(e.agentCommand??""),o=e.clientName?`${e.clientName} · ${n}`:n;return{primary:t,secondary:o}}const KN={};function GN(){const e=KN;return(e==null?void 0:e.VITE_PLAYGROUND)==="1"}const JN={"editor-to-agent":"out","agent-to-editor":"in"},QN={out:"editor-to-agent",in:"agent-to-editor"},YN={request:"req",response:"rsp",notification:"ntf",error:"err",unknown:"unk"},XN={req:"request",rsp:"response",ntf:"notification",err:"error",unk:"unknown"},ZN=["tree","raw","meta"];function mh(e){const t=new URLSearchParams(e),n={},o=t.get("dir");if(o!==null){const g=o.split(",").map(b=>b.trim()).filter(Boolean).map(b=>QN[b]).filter(b=>b!==void 0);g.length>0&&(n.directions=new Set(g))}const r=t.get("kind");if(r!==null){const g=r.split(",").map(b=>b.trim()).filter(Boolean).map(b=>XN[b]).filter(b=>b!==void 0);g.length>0&&(n.kinds=new Set(g))}t.get("streams")==="0"&&(n.showStreams=!1);const i=t.get("q");i!==null&&(n.search=i);const s=t.get("seq"),a=s!==null&&/^\d+$/.test(s)?Number(s):null,l=t.get("tab"),c=l!==null&&ZN.includes(l)?l:null,f=t.get("play"),m=f!==null&&/^\d+$/.test(f)?Number(f):null,h=t.get("ws");return{filters:n,selectedSeq:a,detailTab:c,playbackCap:m,captureUrl:h}}const eC=["ws","dir","kind","streams","q","seq","tab","play"];function tC(e){const t=new URLSearchParams(window.location.search);for(const r of eC)t.delete(r);e.captureUrl&&t.set("ws",e.captureUrl),e.filters.directions.size<ls.length&&t.set("dir",[...e.filters.directions].map(r=>JN[r]).filter(Boolean).join(",")),e.filters.kinds.size<cs.length&&t.set("kind",[...e.filters.kinds].map(r=>YN[r]).filter(Boolean).join(",")),e.filters.showStreams||t.set("streams","0"),e.filters.search&&t.set("q",e.filters.search),e.selectedSeq!==null&&t.set("seq",String(e.selectedSeq)),e.detailTab!=="tree"&&t.set("tab",e.detailTab),e.playbackCap!==null&&t.set("play",String(e.playbackCap));const n=t.toString(),o=`${window.location.pathname}${n?`?${n}`:""}${window.location.hash}`;o!==window.location.pathname+window.location.search+window.location.hash&&window.history.replaceState(window.history.state,"",o)}function Ob(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Ob(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function nC(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Ob(e))&&(o&&(o+=" "),o+=t);return o}const tf="-",oC=e=>{const t=iC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(tf);return a[0]===""&&a.length!==1&&a.shift(),Rb(a,t)||rC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&o[s]?[...l,...o[s]]:l}}},Rb=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Rb(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(tf);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},hh=/^\[(.+)\]$/,rC=e=>{if(hh.test(e)){const t=hh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},iC=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return aC(Object.entries(e.classGroups),n).forEach(([i,s])=>{Dd(s,o,i,t)}),o},Dd=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:yh(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(sC(r)){Dd(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{Dd(s,yh(t,i),n,o)})})},yh=(e,t)=>{let n=e;return t.split(tf).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},sC=e=>e.isThemeGetter,aC=(e,t)=>t?e.map(([n,o])=>{const r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,r]}):e,lC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},Ab="!",cC=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,s=a=>{const l=[];let c=0,f=0,m;for(let v=0;v<a.length;v++){let u=a[v];if(c===0){if(u===r&&(o||a.slice(v,v+i)===t)){l.push(a.slice(f,v)),f=v+i;continue}if(u==="/"){m=v;continue}}u==="["?c++:u==="]"&&c--}const h=l.length===0?a:a.substring(f),y=h.startsWith(Ab),g=y?h.substring(1):h,b=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},dC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},uC=e=>({cache:lC(e.cacheSize),parseClassName:cC(e),...oC(e)}),pC=/\s+/,fC=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(pC);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:f,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:y}=n(c);let g=!!y,b=o(g?h.substring(0,y):h);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=o(h),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const v=dC(f).join(":"),u=m?v+Ab:v,p=u+b;if(i.includes(p))continue;i.push(p);const x=r(b,g);for(let S=0;S<x.length;++S){const T=x[S];i.push(u+T)}a=c+(a.length>0?" "+a:a)}return a};function mC(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mb(t))&&(o&&(o+=" "),o+=n);return o}const Mb=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Mb(e[o]))&&(n&&(n+=" "),n+=t);return n};function hC(e,...t){let n,o,r,i=s;function s(l){const c=t.reduce((f,m)=>m(f),e());return n=uC(c),o=n.cache.get,r=n.cache.set,i=a,a(l)}function a(l){const c=o(l);if(c)return c;const f=fC(l,n);return r(l,f),f}return function(){return i(mC.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qb=/^\[(?:([a-z-]+):)?(.+)\]$/i,yC=/^\d+\/\d+$/,gC=new Set(["px","full","screen"]),vC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bC=/\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$/,xC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jn=e=>Rr(e)||gC.has(e)||yC.test(e),Jn=e=>ni(e,"length",EC),Rr=e=>!!e&&!Number.isNaN(Number(e)),$c=e=>ni(e,"number",Rr),gi=e=>!!e&&Number.isInteger(Number(e)),$C=e=>e.endsWith("%")&&Rr(e.slice(0,-1)),pe=e=>qb.test(e),Qn=e=>vC.test(e),kC=new Set(["length","size","percentage"]),TC=e=>ni(e,kC,Ub),_C=e=>ni(e,"position",Ub),jC=new Set(["image","url"]),NC=e=>ni(e,jC,IC),CC=e=>ni(e,"",PC),vi=()=>!0,ni=(e,t,n)=>{const o=qb.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},EC=e=>bC.test(e)&&!xC.test(e),Ub=()=>!1,PC=e=>wC.test(e),IC=e=>SC.test(e),OC=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),o=Ie("brightness"),r=Ie("borderColor"),i=Ie("borderRadius"),s=Ie("borderSpacing"),a=Ie("borderWidth"),l=Ie("contrast"),c=Ie("grayscale"),f=Ie("hueRotate"),m=Ie("invert"),h=Ie("gap"),y=Ie("gradientColorStops"),g=Ie("gradientColorStopPositions"),b=Ie("inset"),v=Ie("margin"),u=Ie("opacity"),p=Ie("padding"),x=Ie("saturate"),S=Ie("scale"),T=Ie("sepia"),C=Ie("skew"),$=Ie("space"),j=Ie("translate"),R=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",pe,t],V=()=>[pe,t],L=()=>["",jn,Jn],U=()=>["auto",Rr,pe],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",pe],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[Rr,pe];return{cacheSize:500,separator:":",theme:{colors:[vi],spacing:[jn,Jn],blur:["none","",Qn,pe],brightness:_(),borderColor:[e],borderRadius:["none","","full",Qn,pe],borderSpacing:V(),borderWidth:L(),contrast:_(),grayscale:G(),hueRotate:_(),invert:G(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[$C,Jn],inset:F(),margin:F(),opacity:_(),padding:V(),saturate:_(),scale:_(),sepia:G(),skew:_(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[Qn]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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"],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:[...D(),pe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gi,pe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",gi,pe]}],"grid-cols":[{"grid-cols":[vi]}],"col-start-end":[{col:["auto",{span:["full",gi,pe]},pe]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[vi]}],"row-start-end":[{row:["auto",{span:[gi,pe]},pe]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[Qn]},Qn]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qn,Jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$c]}],"font-family":[{font:[vi]}],"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:["tighter","tight","normal","wide","wider","widest",pe]}],"line-clamp":[{"line-clamp":["none",Rr,$c]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jn,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[u]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[u]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jn,Jn]}],"underline-offset":[{"underline-offset":["auto",jn,pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[u]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),_C]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",TC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},NC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[u]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[u]}],"divide-style":[{divide:Q()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[jn,pe]}],"outline-w":[{outline:[jn,Jn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[u]}],"ring-offset-w":[{"ring-offset":[jn,Jn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qn,CC]}],"shadow-color":[{shadow:[vi]}],opacity:[{opacity:[u]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Qn,pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[m]}],saturate:[{saturate:[x]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[u]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pe]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[gi,pe]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[jn,Jn,$c]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},RC=hC(OC);function K(...e){return RC(nC(e))}const $a=1;function AC(e,t,n){return{version:$a,exportedAt:n.exportedAt??Date.now(),tool:{name:n.tool.name,version:n.tool.version},session:{id:e.id,name:e.name,agentCommand:e.agentCommand,clientName:e.clientName,startedAt:e.startedAt,endedAt:e.endedAt},messages:[...t]}}function MC(e,t=4){return JSON.stringify(e,null,t)+`
|
|
1766
|
+
`}class Ke extends Error{constructor(t){super(t),this.name="ExportParseError"}}function qC(e){let t;try{t=JSON.parse(e)}catch(l){throw new Ke(`invalid JSON: ${l instanceof Error?l.message:String(l)}`)}if(!ka(t))throw new Ke("expected an object at the top level");const n=t.version;if(n!==$a)throw new Ke(`unsupported export version ${String(n)} (expected ${$a})`);const o=t.exportedAt;if(typeof o!="number")throw new Ke("exportedAt must be a number");if(!ka(t.tool))throw new Ke("tool must be an object");const r=t.tool.name,i=t.tool.version;if(typeof r!="string")throw new Ke("tool.name must be a string");if(typeof i!="string")throw new Ke("tool.version must be a string");const s=t.session;if(!ka(s))throw new Ke("session must be an object");if(typeof s.id!="number")throw new Ke("session.id must be a number");if(typeof s.startedAt!="number")throw new Ke("session.startedAt must be a number");if(s.endedAt!==null&&typeof s.endedAt!="number")throw new Ke("session.endedAt must be a number or null");if(s.name!==null&&typeof s.name!="string")throw new Ke("session.name must be a string or null");if(s.agentCommand!==null&&typeof s.agentCommand!="string")throw new Ke("session.agentCommand must be a string or null");if(s.clientName!==null&&typeof s.clientName!="string")throw new Ke("session.clientName must be a string or null");if(!Array.isArray(t.messages))throw new Ke("messages must be an array");const a=t.messages.map((l,c)=>UC(l,c));return{version:$a,exportedAt:o,tool:{name:r,version:i},session:{id:s.id,name:s.name,agentCommand:s.agentCommand,clientName:s.clientName,startedAt:s.startedAt,endedAt:s.endedAt},messages:a}}function UC(e,t){if(!ka(e))throw new Ke(`messages[${t}] must be an object`);if(typeof e.seq!="number")throw new Ke(`messages[${t}].seq must be a number`);if(typeof e.timestamp!="number")throw new Ke(`messages[${t}].timestamp must be a number`);if(e.direction!=="editor-to-agent"&&e.direction!=="agent-to-editor")throw new Ke(`messages[${t}].direction must be 'editor-to-agent' or 'agent-to-editor'`);const n=e.kind;if(n!=="request"&&n!=="response"&&n!=="error"&&n!=="notification"&&n!=="unknown")throw new Ke(`messages[${t}].kind has unexpected value '${String(n)}'`);if(typeof e.raw!="string")throw new Ke(`messages[${t}].raw must be a string`);const o={seq:e.seq,timestamp:e.timestamp,direction:e.direction,kind:n,raw:e.raw,payload:e.payload===null?null:e.payload};return typeof e.method=="string"&&(o.method=e.method),(typeof e.rpcId=="string"||typeof e.rpcId=="number"||e.rpcId===null)&&(o.rpcId=e.rpcId),typeof e.parseError=="string"&&(o.parseError=e.parseError),o}function ka(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Lb="<REDACTED>",LC=new Set(["authorization","proxy-authorization","proxy-authentication","x-api-key","x-api-token","x-auth-token","api-key","api_key","proxy_key","cookie","set-cookie"]);function DC(e){if(e.payload==null)return{redacted:e,count:0};const{value:t,count:n}=zd(e.payload,{inProxyConfig:!1});if(n===0)return{redacted:e,count:0};const o=t;return{redacted:{...e,payload:o,raw:JSON.stringify(o)},count:n}}function zd(e,t){if(Array.isArray(e)){let n=0;const o=new Array(e.length);for(let r=0;r<e.length;r++){const i=zd(e[r],t);o[r]=i.value,n+=i.count}return{value:o,count:n}}if(e!==null&&typeof e=="object"){let n=0;const o={};for(const[r,i]of Object.entries(e)){if(typeof i=="string"&&LC.has(r.toLowerCase())){o[r]=Lb,n+=1;continue}if(t.inProxyConfig&&r==="headers"&&i!==null&&typeof i=="object"&&!Array.isArray(i)){const l=zC(i);o[r]=l.value,n+=l.count;continue}const s=t.inProxyConfig||r.toLowerCase()==="proxyconfig"?{inProxyConfig:!0}:t,a=zd(i,s);o[r]=a.value,n+=a.count}return{value:o,count:n}}return{value:e,count:0}}function zC(e){let t=0;const n={};for(const[o,r]of Object.entries(e))typeof r=="string"?(n[o]=Lb,t+=1):n[o]=r;return{value:n,count:t}}function FC(e){let t=0,n=0;const o=e.messages.map(r=>{const i=DC(r);return i.count>0&&(t+=1,n+=i.count),i.redacted});return n===0?{export:e,messagesAffected:0,fieldsRedacted:0}:{export:{...e,messages:o},messagesAffected:t,fieldsRedacted:n}}const BC={name:"acp-devtools-ui",version:"0.2.1"};function HC(e,t=Date.now()){const n=e.id>0?String(e.id):"live",o=new Date(t).toISOString().slice(0,19).replace(/[:T]/g,"-");return`acp-session-${n}-${o}.json`}function VC(e,t,n=Date.now()){const o=AC(e,t,{tool:BC,exportedAt:n}),{export:r}=FC(o);return MC(r)}function Db(e,t,n=Date.now()){const o=VC(e,t,n),r=new Blob([o],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=HC(e,n),s.rel="noopener",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function WC({open:e,onClose:t}){const[n,o]=P.useState(""),[r,i]=P.useState(0),s=P.useRef(null);P.useEffect(()=>{if(!e)return;o(""),i(0);const c=setTimeout(()=>{var f;return(f=s.current)==null?void 0:f.focus()},0);return()=>clearTimeout(c)},[e]);const a=P.useMemo(()=>KC(),[t,e]),l=P.useMemo(()=>GC(a,n),[a,n]);return P.useEffect(()=>{r>=l.length&&i(0)},[l.length,r]),P.useEffect(()=>{if(!e)return;const c=f=>{if(f.key==="Escape"){f.preventDefault(),t();return}if(f.key==="ArrowDown"){f.preventDefault(),i(m=>l.length===0?0:(m+1)%l.length);return}if(f.key==="ArrowUp"){f.preventDefault(),i(m=>l.length===0?0:(m-1+l.length)%l.length);return}if(f.key==="Enter"){f.preventDefault();const m=l[r];m&&(m.run(),t())}};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[e,l,r,t]),e?d.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] flex items-start justify-center bg-black/60 pt-[8vh] backdrop-blur-sm",onMouseDown:c=>{c.target===c.currentTarget&&t()},children:d.jsxs("div",{className:"w-[min(620px,92vw)] overflow-hidden rounded-md border border-line-strong bg-surface-elev shadow-2xl",children:[d.jsx("div",{className:"border-b border-line bg-surface-base/60",children:d.jsx("input",{ref:s,value:n,onChange:c=>{o(c.target.value),i(0)},placeholder:"type a command… esc closes ↑↓ navigate ↵ run",className:"w-full bg-transparent px-4 py-3 font-mono text-[13px] text-ink-primary placeholder-ink-muted outline-none"})}),d.jsxs("ul",{className:"max-h-[60vh] overflow-y-auto py-1",children:[l.length===0&&d.jsx("li",{className:"px-4 py-3 text-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no match"}),l.map((c,f)=>{const m=f===r,h=l[f-1],y=!h||h.section!==c.section;return d.jsxs("li",{children:[y&&d.jsx("div",{className:"px-4 pt-2 pb-1 font-mono text-[9px] uppercase tracking-widest text-ink-muted",children:c.section}),d.jsxs("button",{type:"button",onClick:()=>{c.run(),t()},onMouseEnter:()=>i(f),className:K("flex w-full items-center justify-between px-4 py-1.5 text-left font-mono text-[12px] transition-colors",m?"bg-accent-out/10 text-ink-primary":"text-ink-secondary hover:bg-surface-rowHover hover:text-ink-primary"),children:[d.jsx("span",{className:"truncate",children:c.label}),c.hint&&d.jsx("span",{className:"ml-3 shrink-0 rounded-sm border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-widest text-ink-muted",children:c.hint})]})]},c.id)})]})]})}):null}function KC(e){const t=ne.getState(),n=ft.getState(),o=[];o.push({id:"session.import",label:"Import session JSON from disk…",section:"session",run:()=>{const r=document.createElement("input");r.type="file",r.accept="application/json,.json",r.addEventListener("change",()=>{var s;const i=(s=r.files)==null?void 0:s[0];i&&(async()=>{try{const a=await $v(i);await Qu(),n.setSelected(tl(a.id))}catch(a){const l=a instanceof Error?a.message:String(a);window.alert(`Import failed: ${l}`)}})()}),r.click()}}),t.session!==null&&t.messages.length>0&&o.push({id:"session.export",label:"Export current session as JSON (redacted — auth tokens hidden)",section:"session",run:()=>Db(t.session,t.messages)}),o.push({id:"view.deselect",label:"Deselect message",hint:"esc",section:"view",run:()=>t.select(null)}),o.push({id:"view.toggle-streams",label:t.filters.showStreams?"Hide streaming chunks":"Show streaming chunks",section:"filter",run:()=>t.toggleStreams()}),o.push({id:"filter.reset",label:"Reset all filters",section:"filter",run:()=>{const r={directions:new Set(ls),kinds:new Set(cs),showStreams:!0,search:""};ne.setState({filters:r})}});for(const r of ls){const i=t.filters.directions.has(r);o.push({id:`filter.dir.${r}`,label:`${i?"Hide":"Show"} ${r==="editor-to-agent"?"editor → agent":"agent → editor"} messages`,section:"filter",run:()=>t.toggleDirection(r)})}for(const r of cs){const i=t.filters.kinds.has(r);o.push({id:`filter.kind.${r}`,label:`${i?"Hide":"Show"} ${r} kind`,section:"filter",run:()=>t.toggleKind(r)})}if(t.selectedSeq!==null){const r=t.messages.find(i=>i.seq===t.selectedSeq);r&&(o.push({id:"copy.raw",label:`Copy selected message raw line (seq ${r.seq})`,section:"copy",run:()=>{navigator.clipboard.writeText(r.raw)}}),r.payload&&o.push({id:"copy.payload",label:`Copy selected payload as JSON (seq ${r.seq})`,section:"copy",run:()=>{navigator.clipboard.writeText(JSON.stringify(r.payload,null,2))}}))}for(const r of n.captures)o.push({id:`switch.live.${r.url}`,label:`Switch to live: ${ef(r)}`,section:"switch",run:()=>n.setSelected(r.url)});for(const r of n.savedSessions.slice(0,25)){const i=Rt(r.agent_command??""),s=r.name??(r.client_name?`${r.client_name} · ${i}`:i);o.push({id:`switch.saved.${r.id}`,label:`Open saved #${r.id} · ${s} (${r.message_count} msg)`,section:"switch",run:()=>n.setSelected(tl(r.id))})}return o}function GC(e,t){const n=t.trim().toLowerCase();if(n==="")return e;const o=n.split(/\s+/);return e.filter(r=>{const i=r.label.toLowerCase();return o.every(s=>i.includes(s))})}const JC={idle:"idle",connecting:"connecting",open:"restoring view",closed:"disconnected",error:"connection error"};function QC({status:e,url:t,lastError:n}){const o=JC[e],r=e==="connecting"||e==="open";return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-surface-base",children:d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:[d.jsx("span",{"aria-hidden":!0,className:K("inline-block h-2 w-2 rounded-full",r?"animate-pulse-soft bg-accent-out":"bg-ink-dim",e==="error"&&"bg-accent-error")}),d.jsx("span",{children:o}),d.jsx("span",{className:"text-ink-dim",children:"·"}),d.jsx("span",{className:"lowercase tracking-normal text-ink-secondary",children:t}),n&&e==="error"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-dim",children:"·"}),d.jsx("span",{className:"lowercase tracking-normal text-accent-error",children:n})]})]})})}function YC(e){const t=e.$defs??{},n=new Map;for(const[g,b]of Object.entries(t)){const v=b["x-method"];if(typeof v!="string")continue;let u=n.get(v);u||(u={},n.set(v,u)),g.endsWith("Request")?u.requestDef=g:g.endsWith("Response")?u.responseDef=g:g.endsWith("Notification")&&(u.notificationDef=g)}function o(g,b){var v,u,p;switch(g.kind){case"request":{const x=g.method;return x?((v=n.get(x))==null?void 0:v.requestDef)??null:null}case"notification":{const x=g.method;return x?((u=n.get(x))==null?void 0:u.notificationDef)??null:null}case"response":case"error":return b?((p=n.get(b))==null?void 0:p.responseDef)??null:null;default:return null}}function r(g){return g==="request"||g==="notification"?"params":g==="response"?"result":g==="error"?"error":null}function i(g){return typeof g=="object"&&g!==null&&!Array.isArray(g)}function s(g,b){const v=g.properties;if(!v)return!0;for(const[u,p]of Object.entries(v))if(!(!p||typeof p!="object")){if("const"in p){if(b[u]!==p.const)return!1}else if(Array.isArray(p.enum)&&!p.enum.includes(b[u]))return!1}return!0}function a(g,b){const v=g.type;if(typeof v=="string"){if(v==="null")return b===null;if(v==="string")return typeof b=="string";if(v==="boolean")return typeof b=="boolean";if(v==="number"||v==="integer")return typeof b=="number";if(v==="array")return Array.isArray(b);if(v==="object")return i(b)&&s(g,b)}return g.$ref||g.properties||g.allOf?i(b)&&s(g,b):!1}function l(g,b=void 0){if(!g)return null;if(g.$ref){const v=g.$ref.replace(/^#\/\$defs\//,""),u=t[v];return u?l(u,b):null}if(g.allOf&&g.allOf.length>0){const v={properties:{}};for(const u of g.allOf){const p=l(u,b);p!=null&&p.properties&&(v.properties={...v.properties,...p.properties}),p!=null&&p.type&&!v.type&&(v.type=p.type),p!=null&&p.items&&!v.items&&(v.items=p.items)}return g.description&&!v.description&&(v.description=g.description),v}if(g.anyOf||g.oneOf){const v=g.anyOf??g.oneOf;if(b!==void 0){for(const u of v)if(u.type!=="null"&&a(u,b))return l(u,b)}for(const u of v){if(u.type==="null")continue;const p=l(u,b);if(p)return p}return null}return g}function c(g,b){let v=g;for(const u of b){if(v==null)return;if(Array.isArray(v)&&/^\d+$/.test(u))v=v[Number(u)];else if(typeof v=="object")v=v[u];else return}return v}function f(g){if(!g)return;if(g.$ref)return g.$ref.replace(/^#\/\$defs\//,"");const b=g.type;if(typeof b=="string")return b;if(Array.isArray(b))return b.find(u=>u!=="null")}function m(g,b){const v=t[g];return{typeName:g,typeDescription:(v==null?void 0:v.description)??null,resolve(u){var R;if(u.length===0)return{inSpec:!0,isExtension:!1,description:v==null?void 0:v.description,type:g};const p=u.slice(1);if(p.length===0)return null;let x=!1,S=v??null;for(let M=0;M<p.length;M++){const F=p[M];F==="_meta"&&(x=!0);const V=/^\d+$/.test(F),L=c(b,u.slice(0,M+1));if(S=l(S,L),!S)return null;if(V){const D=c(b,u.slice(0,M+2));S=l(S.items,D);continue}if(x&&F!=="_meta")return{inSpec:!1,isExtension:!0};const U=(R=S.properties)==null?void 0:R[F];if(!U)return{inSpec:!1,isExtension:x};S=U}const T=c(b,u),C=l(S,T),$={inSpec:!0,isExtension:x};S!=null&&S.description?$.description=S.description:C!=null&&C.description&&($.description=C.description);const j=f(S??null)??f(C);return j&&($.type=j),C!=null&&C.enum&&($.enumValues=C.enum),$}}}function h(g,b={}){const v=o(g,b.pairedMethod);return!v||!r(g.kind)?null:m(v,g.payload)}function y(){return[...n.keys()].sort()}return{resolveForMessage:h,knownMethods:y}}const XC=YC(Cv),ZC=XC.resolveForMessage,eE={info:"border-line bg-surface-base text-ink-primary",warn:"border-accent-warn/40 bg-accent-warn/10 text-ink-primary",error:"border-accent-error/40 bg-accent-error/10 text-ink-primary"};function ps({label:e,children:t,delay:n=60,tone:o="info",className:r,focusable:i=!1}){const s=P.useRef(null),a=P.useRef(null),[l,c]=P.useState(null),f=l!==null,m=()=>{const g=s.current;if(!g)return null;const b=g.getBoundingClientRect(),u=window.innerHeight-b.bottom<120;return{top:u?b.top-8:b.bottom+8,left:Math.min(b.left,window.innerWidth-380),flipUp:u}},h=()=>{a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>{const g=m();g&&c(g)},n)},y=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),c(null)};return P.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),P.useEffect(()=>{if(!f)return;const g=()=>y();return window.addEventListener("scroll",g,!0),()=>window.removeEventListener("scroll",g,!0)},[f]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:s,className:K("cursor-help",r),onMouseEnter:h,onMouseLeave:y,...i?{onFocus:h,onBlur:y,tabIndex:0}:{},children:t}),l&&Vu.createPortal(d.jsx("div",{role:"tooltip",className:K("pointer-events-none fixed z-[200] max-w-[360px] rounded-sm border px-3 py-2 font-mono text-[11px] leading-snug shadow-lg backdrop-blur-sm",eE[o]),style:{top:l.flipUp?void 0:l.top,bottom:l.flipUp?window.innerHeight-l.top:void 0,left:l.left},children:e}),document.body)]})}const tE=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function Ta(e){return tE.format(e)}function fs(e){const t=e%1e3;return`${Ta(e)}.${String(t).padStart(3,"0")}`}const nE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function oE(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function _a(e,t=Date.now()){const n=new Date(e),o=new Date(t);if(oE(n,o))return Ta(e);if(n.getFullYear()===o.getFullYear())return`${nE[n.getMonth()]} ${n.getDate()} ${Ta(e)}`;const r=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getDate()).padStart(2,"0");return`${n.getFullYear()}-${r}-${i} ${Ta(e)}`}function Ul(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Vt(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function rE(e){return e<250?"ok":e<1500?"warn":"error"}function zb(e){return e==="editor-to-agent"?"OUT":"IN"}function Fb(e){return e==="editor-to-agent"?"→":"←"}const iE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sE(e){const t=String(e);return iE.test(t)?t.slice(0,8)+"…":t.length>12?t.slice(0,10)+"…":t}function Ar(e,t=Date.now()){const n=Math.max(0,Math.round((t-e)/1e3));if(n<60)return`${n}s`;const o=Math.floor(n/60);if(o<60)return`${o}m`;const r=Math.floor(o/60);if(r<24){const a=o%60;return`${r}h${String(a).padStart(2,"0")}m`}const i=Math.floor(r/24),s=r%24;return`${i}d${String(s).padStart(2,"0")}h`}function gh(e,t){if(e.length===0)return 0;const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n),i=e[o],s=e[r];return i===void 0||s===void 0?i??0:o===r?i:i+(s-i)*(n-o)}const aE=6;function vh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lE(e){if(e===null)return"text-accent-error";switch(typeof e){case"string":return"text-accent-out";case"number":return"text-accent-in";case"boolean":return"text-accent-note";default:return"text-ink-secondary"}}function cE(e){return e===null?"null":typeof e=="string"?JSON.stringify(e):String(e)}function al({value:e,name:t,depth:n=0,defaultExpanded:o,path:r=[],getSpec:i}){const s=vh(e)||Array.isArray(e),a=vh(e)?Object.keys(e).length:Array.isArray(e)?e.length:0,l=o??(n<2&&a<=aE),[c,f]=P.useState(l),m=t!==void 0&&i?i(r):null,h=t!==void 0?d.jsx(dE,{name:t,spec:m}):null;if(!s)return d.jsxs("div",{className:"flex items-baseline gap-2 font-mono text-xs leading-relaxed",children:[h,d.jsx("span",{className:K("whitespace-pre-wrap break-all",lE(e)),children:cE(e)})]});const y=Array.isArray(e),g=y?"[":"{",b=y?"]":"}";return d.jsxs("div",{className:"font-mono text-xs leading-relaxed",children:[d.jsxs("button",{type:"button",onClick:()=>f(v=>!v),className:"group/expand flex items-baseline gap-2 text-left hover:text-ink-primary",children:[d.jsx("span",{"aria-hidden":!0,className:K("inline-block w-3 text-ink-muted transition-transform",c?"rotate-90":""),children:"▸"}),h,d.jsx("span",{className:"text-ink-secondary",children:g}),!c&&d.jsxs("span",{className:"text-ink-muted",children:[a," ",y?"items":"keys"]}),!c&&d.jsx("span",{className:"text-ink-secondary",children:b})]}),c&&d.jsxs("div",{className:"ml-3 border-l border-line-grid pl-3",children:[y?e.map((v,u)=>d.jsx(al,{value:v,name:String(u),depth:n+1,path:[...r,String(u)],...i?{getSpec:i}:{}},u)):Object.entries(e).map(([v,u])=>d.jsx(al,{value:u,name:v,depth:n+1,path:[...r,v],...i?{getSpec:i}:{}},v)),d.jsx("div",{className:"text-ink-secondary",children:b})]})]})}function dE({name:e,spec:t}){const n=/^\d+$/.test(e),o=(t==null?void 0:t.description)??null;return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:K(n?"text-ink-muted":"text-ink-secondary"),children:n?`${e}:`:`"${e}":`}),t&&!t.inSpec&&d.jsx(bh,{tone:t.isExtension?"extension":"unknown",explanation:t.isExtension?"Extension — not declared in the ACP spec; contents are implementation-defined.":"Unknown — this field is not declared in the ACP schema for this message."}),(t==null?void 0:t.inSpec)&&t.isExtension&&d.jsx(bh,{tone:"extension",explanation:"Extension — _meta payload is implementation-defined per ACP spec."}),o&&d.jsx(ps,{label:d.jsx(uE,{text:o,type:t==null?void 0:t.type,enumValues:t==null?void 0:t.enumValues}),tone:"info",className:"text-ink-muted hover:text-ink-primary",focusable:!0,children:d.jsx("span",{"aria-label":`spec: ${o.split(`
|
|
1767
|
+
`)[0]}`,children:"ⓘ"})})]})}function uE({text:e,type:t,enumValues:n}){return d.jsxs("div",{className:"space-y-1.5",children:[t&&d.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:d.jsx("span",{className:"text-accent-info",children:t})}),d.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:e}),n&&n.length>0&&d.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["enum: ",n.map(o=>JSON.stringify(o)).join(" · ")]})]})}function bh({tone:e,explanation:t}){const n=e==="extension"?"border-accent-warn/40 bg-accent-warn/10 text-accent-warn":"border-accent-error/40 bg-accent-error/10 text-accent-error";return d.jsx(ps,{label:d.jsx("span",{className:"font-sans",children:t}),tone:e==="extension"?"warn":"error",focusable:!0,children:d.jsx("span",{className:K("inline-flex items-center rounded-sm border px-1 font-mono text-[9px] uppercase tracking-widest",n),children:e==="extension"?"⚠ ext":"⚠ unknown"})})}function pE({message:e,latencyMs:t,pairedRequest:n,onJumpToPaired:o,validation:r}){const i=ne(c=>c.detailTab),s=ne(c=>c.setDetailTab),a=P.useMemo(()=>{if(!e)return null;const c=(n==null?void 0:n.method)??void 0;return ZC(e,c?{pairedMethod:c}:void 0)},[e,n]);if(!e)return d.jsx("div",{className:"flex h-full items-center justify-center bg-surface-elev/40",children:d.jsx("div",{className:"text-center font-mono text-xs uppercase tracking-widest text-ink-muted",children:"select a message to inspect"})});const l=e.direction==="editor-to-agent";return d.jsxs("div",{className:"flex h-full flex-col bg-surface-elev/30",children:[d.jsxs("header",{className:"border-b border-line bg-surface-elev px-5 py-3",children:[d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsxs("span",{className:K("font-mono text-[11px] font-semibold tracking-widest",l?"text-accent-out":"text-accent-in"),children:[Fb(e.direction)," ",zb(e.direction)]}),d.jsxs("span",{className:"font-mono text-xs text-ink-muted",children:["seq ",e.seq]}),d.jsx("span",{className:"font-mono text-xs text-ink-muted",children:fs(e.timestamp)})]}),d.jsx("h2",{className:"mt-1 truncate font-display text-lg uppercase tracking-tight text-ink-primary",children:e.method??e.kind}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[11px] text-ink-secondary",children:[d.jsx(gE,{message:e,resolver:a}),e.rpcId!==void 0&&e.rpcId!==null&&d.jsx(ja,{label:"id",value:String(e.rpcId)}),d.jsx(ja,{label:"bytes",value:Ul(e.raw.length)}),t!==void 0&&d.jsx(ja,{label:"latency",value:`+${Vt(t)}`,accent:!0}),n&&d.jsxs("button",{type:"button",onClick:o?()=>o(n.seq):void 0,className:"inline-flex items-baseline gap-1 transition-colors hover:text-ink-primary",title:"jump to paired message",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:"paired"}),d.jsxs("span",{className:"text-ink-primary underline decoration-line-strong decoration-dotted underline-offset-4",children:["seq ",n.seq," ",n.method??""]})]})]})]}),d.jsxs("nav",{className:"flex gap-1 border-b border-line bg-surface-elev/70 px-4",children:[d.jsx(na,{active:i==="tree",onClick:()=>s("tree"),children:"Tree"}),d.jsx(na,{active:i==="raw",onClick:()=>s("raw"),children:"Raw"}),d.jsx(na,{active:i==="meta",onClick:()=>s("meta"),children:"Meta"}),d.jsx(na,{active:i==="spec",onClick:()=>s("spec"),badge:r&&!r.skipped&&!r.valid?r.errors.length:void 0,children:"Spec"})]}),d.jsxs("div",{className:"flex-1 overflow-auto px-5 py-4",children:[i==="tree"&&d.jsx(mE,{message:e,resolver:a}),i==="raw"&&d.jsx(hE,{raw:e.raw}),i==="meta"&&d.jsx(yE,{message:e}),i==="spec"&&d.jsx(fE,{validation:r})]})]})}function fE({validation:e}){if(!e)return d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"no validation result yet"});if(e.skipped){const t={"parse-error":"this frame failed to parse as JSON-RPC — already surfaced in the Tree tab as a parse error","no-method":"no method available for validation (e.g. response without a paired request)","unknown-method":"the ACP spec has no schema for this method — likely an extension or a future addition","no-schema-for-kind":"the spec has no schema for this kind of frame for this method (e.g. notification-only method)","wrong-kind":"no per-method ACP schema applies (e.g. JSON-RPC error envelope, parse failure)"};return d.jsxs("div",{className:"space-y-2 font-mono text-[11px]",children:[d.jsx("div",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:"not validated"}),d.jsx("div",{className:"text-ink-secondary",children:t[e.skipped]})]})}return e.valid?d.jsx("div",{className:"space-y-2 font-mono text-[11px]",children:d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsx("span",{className:"rounded-sm border border-accent-ok/40 bg-accent-ok/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-ok",children:"✓ conforms"}),d.jsxs("span",{className:"text-ink-muted",children:["matched ",d.jsx("span",{className:"text-ink-secondary",children:e.schemaName})," ","from the ACP schema"]})]})}):d.jsxs("div",{className:"space-y-3 font-mono text-[11px]",children:[d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsxs("span",{className:"rounded-sm border border-accent-error/40 bg-accent-error/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-error",children:["⚠ ",e.errors.length," violation",e.errors.length===1?"":"s"]}),d.jsxs("span",{className:"text-ink-muted",children:["against ",d.jsx("span",{className:"text-ink-secondary",children:e.schemaName})]})]}),d.jsx("ul",{className:"space-y-1.5",children:e.errors.map((t,n)=>d.jsxs("li",{className:"rounded-sm border border-accent-error/25 bg-accent-error/[0.04] px-2 py-1.5",children:[d.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:[t.keyword??"error"," · ",t.path==="/"?"(root)":t.path]}),d.jsx("div",{className:"mt-0.5 text-ink-primary",children:t.message})]},`${t.path}-${t.keyword}-${n}`))})]})}function mE({message:e,resolver:t}){const n=P.useMemo(()=>{if(t)return o=>t.resolve(o)},[t]);return e.payload===null?d.jsxs("div",{className:"space-y-2 font-mono text-xs",children:[d.jsxs("div",{className:"text-accent-error",children:["parse error: ",e.parseError??"unknown"]}),d.jsx("pre",{className:"whitespace-pre-wrap break-all text-ink-secondary",children:e.raw})]}):d.jsx(al,{value:e.payload,defaultExpanded:!0,...n?{getSpec:n}:{}})}function hE({raw:e}){const[t,n]=P.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return d.jsxs("div",{className:"group relative",children:[d.jsx("button",{type:"button",onClick:o,"aria-label":"Copy raw frame to clipboard",title:"Copy raw frame to clipboard",className:K("absolute right-0 top-0 inline-flex h-6 items-center rounded-sm border bg-surface-elev/70 px-2 font-mono text-[10px] uppercase tracking-widest opacity-0 transition-[opacity,background-color,border-color,color] duration-150","group-hover:opacity-100 focus-visible:opacity-100",t?"border-accent-ok/60 bg-surface-elev text-accent-ok opacity-100":"border-line text-ink-secondary hover:border-accent-info/70 hover:bg-surface-rowHover hover:text-accent-info"),children:t?"✓ copied":"copy"}),d.jsx("pre",{className:"whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-ink-primary",children:e})]})}function yE({message:e}){const t=[["seq",String(e.seq)],["direction",e.direction],["kind",e.kind],["method",e.method??"(none)"],["rpcId",String(e.rpcId??"(none)")],["timestamp",`${fs(e.timestamp)} (${e.timestamp})`],["raw size",Ul(e.raw.length)],["parse error",e.parseError??"(none)"]];return d.jsx("dl",{className:"grid grid-cols-[110px_1fr] gap-x-4 gap-y-1 font-mono text-[12px]",children:t.map(([n,o])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:n}),d.jsx("dd",{className:"text-ink-primary",children:o})]},n))})}function gE({message:e,resolver:t}){const n=d.jsx(ja,{label:"kind",value:e.kind});return t!=null&&t.typeDescription?d.jsx(ps,{label:d.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:t.typeDescription}),tone:"info",children:n}):n}function ja({label:e,value:t,accent:n}){return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:K(n?"text-accent-warn":"text-ink-primary"),children:t})]})}function na({children:e,active:t,onClick:n,badge:o,tab:r}){return d.jsxs("button",{type:"button",onClick:n,className:K("relative flex items-baseline gap-1.5 px-4 py-2 font-mono text-[11px] uppercase tracking-widest transition-colors",t?"text-ink-primary":"text-ink-muted hover:text-ink-secondary"),children:[d.jsx("span",{children:e}),o!==void 0&&d.jsx("span",{className:"rounded-sm border border-accent-error/40 bg-accent-error/10 px-1 text-[9px] font-semibold text-accent-error",children:o}),t&&d.jsx("span",{className:"absolute inset-x-2 -bottom-px h-px bg-accent-out","aria-hidden":!0})]})}function nf(e){const t=new Map,n=new Map;for(const o of e){if(o.rpcId===void 0||o.rpcId===null)continue;const r=String(o.rpcId);if(o.kind==="request")t.set(r,o);else if(o.kind==="response"||o.kind==="error"){const i=t.get(r);if(!i)continue;const s=Math.max(0,o.timestamp-i.timestamp);n.set(i.seq,{pairSeq:o.seq,latencyMs:s}),n.set(o.seq,{pairSeq:i.seq,latencyMs:s})}}return n}function Fd(e){const t=nf(e),n=new Map,o=new Map;for(const i of e)if(i.method){if(i.kind==="request"){let s=n.get(i.method);s||(s={count:0,latencies:[]},n.set(i.method,s)),s.count+=1;const a=t.get(i.seq);a&&s.latencies.push(a.latencyMs)}else if(i.kind==="notification"){let s=o.get(i.method);s||(s={count:0,latencies:[]},o.set(i.method,s)),s.count+=1}}const r=[];for(const[i,s]of n)s.latencies.sort((a,l)=>a-l),r.push({method:i,kind:"request",count:s.count,sampleSize:s.latencies.length,p50:s.latencies.length?xh(s.latencies,50):null,p99:s.latencies.length?xh(s.latencies,99):null,max:s.latencies.length?s.latencies[s.latencies.length-1]:null,totalLatencyMs:s.latencies.length?s.latencies.reduce((a,l)=>a+l,0):null,latencies:s.latencies});for(const[i,s]of o)r.push({method:i,kind:"notification",count:s.count,sampleSize:0,p50:null,p99:null,max:null,totalLatencyMs:null,latencies:[]});return r.sort((i,s)=>s.count-i.count||(i.kind==="request"?-1:1)),r}function xh(e,t){if(e.length===0)return 0;const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n),i=e[o],s=e[r];return i===void 0||s===void 0?i??0:o===r?i:i+(s-i)*(n-o)}const Bb=100;function vE(e,t,n={}){const o=n.maxChangesPerRow??Bb,r=wh(e),i=wh(t),s=bE(r,i),a=[],l={equal:0,changed:0,added:0,removed:0,total:0};for(const c of s)if(c.kind==="match"){const f=e[c.i],m=t[c.j],h=xE(f,m,o),y=h.length===0?"equal":"changed";a.push({op:y,a:f,b:m,signature:r[c.i],changes:h}),y==="equal"?l.equal+=1:l.changed+=1}else if(c.kind==="removed"){const f=e[c.i];a.push({op:"removed",a:f,b:null,signature:r[c.i],changes:[]}),l.removed+=1}else{const f=t[c.j];a.push({op:"added",a:null,b:f,signature:i[c.j],changes:[]}),l.added+=1}return l.total=a.length,{rows:a,summary:l}}function wh(e){const t=nf(e),n=new Map;for(const o of e)o.method&&n.set(o.seq,o.method);return e.map(o=>{let r=o.method??"";if(!r&&(o.kind==="response"||o.kind==="error")){const i=t.get(o.seq);i&&(r=n.get(i.pairSeq)??"")}return`${o.direction}|${o.kind}|${r}`})}function bE(e,t){const n=e.length,o=t.length,r=o+1,i=new Uint32Array((n+1)*r);for(let c=n-1;c>=0;c--)for(let f=o-1;f>=0;f--){const m=c*r+f;if(e[c]===t[f])i[m]=i[(c+1)*r+(f+1)]+1;else{const h=i[(c+1)*r+f],y=i[c*r+(f+1)];i[m]=h>=y?h:y}}const s=[];let a=0,l=0;for(;a<n&&l<o;)e[a]===t[l]?(s.push({kind:"match",i:a,j:l}),a++,l++):i[(a+1)*r+l]>=i[a*r+(l+1)]?(s.push({kind:"removed",i:a}),a++):(s.push({kind:"added",j:l}),l++);for(;a<n;)s.push({kind:"removed",i:a}),a++;for(;l<o;)s.push({kind:"added",j:l}),l++;return s}function Sh(e){const t=e.payload;if(t===null||typeof t!="object")return{raw:e.raw,parseError:e.parseError??null};const n=t,o={};return"method"in n&&(o.method=n.method),"params"in n&&(o.params=n.params),"result"in n&&(o.result=n.result),"error"in n&&(o.error=n.error),o}function xE(e,t,n){const o=[];return ll(Sh(e),Sh(t),"",o,n),o}function wE(e,t,n=Bb){const o=[];return ll(e,t,"",o,n),o}function $h(e){return Array.isArray(e)?"array":e!==null&&typeof e=="object"?"object":"leaf"}function ll(e,t,n,o,r){if(o.length>=r||Object.is(e,t))return;const i=$h(e),s=$h(t);if(i!==s||i==="leaf"){if(SE(e,t))return;o.push({path:n||"$",kind:"change",a:e,b:t});return}if(i==="array"){const f=e,m=t,h=Math.max(f.length,m.length);for(let y=0;y<h;y++){if(o.length>=r)return;const g=`${n}[${y}]`,b=y<f.length,v=y<m.length;b&&v?ll(f[y],m[y],g,o,r):v?o.push({path:g,kind:"add",b:m[y]}):o.push({path:g,kind:"remove",a:f[y]})}return}const a=e,l=t,c=[...new Set([...Object.keys(a),...Object.keys(l)])].sort();for(const f of c){if(o.length>=r)return;const m=n?`${n}.${f}`:f,h=f in a,y=f in l;h&&y?ll(a[f],l[f],m,o,r):y?o.push({path:m,kind:"add",b:l[f]}):o.push({path:m,kind:"remove",a:a[f]})}}function SE(e,t){return Object.is(e,t)}function Ne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function xn(e){return typeof e=="string"&&e.length>0?e:null}function Ao(e){return e===!0}function $E(e){for(const t of e)if(t.kind==="request"&&t.method==="initialize"&&t.direction==="editor-to-agent")return t;return null}function kE(e,t){if(t==null)return null;for(const n of e)if(n.kind==="response"&&n.direction==="agent-to-editor"&&n.rpcId===t)return n;return null}function TE(e){var r,i;const t={name:null,title:null,version:null,platform:null};if(!e)return t;const n=Ne((r=Ne(e.payload))==null?void 0:r.params),o=Ne(n==null?void 0:n.clientInfo);return o?{name:xn(o.name),title:xn(o.title),version:xn(o.version),platform:xn((i=Ne(o._meta))==null?void 0:i.platform)}:t}function _E(e){var s,a;const t={fsReadTextFile:!1,fsWriteTextFile:!1,terminal:!1,authTerminal:!1,authGateway:!1};if(!e)return t;const n=Ne((s=Ne(e.payload))==null?void 0:s.params),o=Ne(n==null?void 0:n.clientCapabilities);if(!o)return t;const r=Ne(o.fs),i=Ne(o.auth);return{fsReadTextFile:Ao(r==null?void 0:r.readTextFile),fsWriteTextFile:Ao(r==null?void 0:r.writeTextFile),terminal:Ao(o.terminal),authTerminal:Ao(i==null?void 0:i.terminal),authGateway:Ao((a=Ne(i==null?void 0:i._meta))==null?void 0:a.gateway)}}function jE(e){var i;const t={name:null,version:null,authMethods:0};if(!e)return t;const n=Ne((i=Ne(e.payload))==null?void 0:i.result);if(!n)return t;const o=Ne(n.agentInfo),r=n.authMethods;return{name:xn(o==null?void 0:o.name),version:xn(o==null?void 0:o.version),authMethods:Array.isArray(r)?r.length:0}}function NE(e){var r;const t={prompt:!1,loadSession:!1};if(!e)return t;const n=Ne((r=Ne(e.payload))==null?void 0:r.result),o=Ne(n==null?void 0:n.agentCapabilities);return o?{prompt:Ao(o.promptCapabilities)||o.promptCapabilities!==void 0,loadSession:Ao(o.loadSession)}:t}function CE(e,t){const n=t??e;if(!n)return null;const o=Ne(n.payload),r=Ne(o==null?void 0:o.result)??Ne(o==null?void 0:o.params),i=r==null?void 0:r.protocolVersion;return typeof i=="number"?i:null}function EE(e){var s,a;let t=null,n=0,o=null,r=0,i=[];for(const l of e){l.direction!=="editor-to-agent"&&l.kind;const c=Ne((s=Ne(l.payload))==null?void 0:s.params);if(c){if(l.method==="session/set_mode"){const f=xn(c.modeId);f!==null&&(t!==null&&t!==f&&(n+=1),t=f)}else if(l.method==="session/set_model"){const f=xn(c.modelId);f!==null&&(o!==null&&o!==f&&(r+=1),o=f)}else if(l.method==="session/update"){const f=Ne(c.update);if((f==null?void 0:f.sessionUpdate)==="available_commands_update"){const m=f.availableCommands;if(Array.isArray(m)){const h=[];for(const y of m){const g=xn((a=Ne(y))==null?void 0:a.name);g!==null&&h.push(g)}h.length>0&&(i=h)}}else if((f==null?void 0:f.sessionUpdate)==="current_mode_update"){const m=xn(f.currentModeId);m!==null&&(t!==null&&t!==m&&(n+=1),t=m)}}}}return{currentMode:t,modeChanges:n,currentModel:o,modelChanges:r,availableCommands:i}}function PE(e){if(!e)return{jetbrainsProxyConfig:null};const t=Ne(e.payload),n=Ne(t==null?void 0:t.params),o=Ne(n==null?void 0:n._meta);return{jetbrainsProxyConfig:(o==null?void 0:o.proxyConfig)??null}}function cl(e){const t=$E(e),n=kE(e,t==null?void 0:t.rpcId);return{protocolVersion:CE(t,n),client:TE(t),agent:jE(n),clientCapabilities:_E(t),agentCapabilities:NE(n),runtime:EE(e),extensions:PE(t)}}function kh(e){return{protocolVersion:e.protocolVersion,client:e.client,agent:e.agent,clientCapabilities:e.clientCapabilities,agentCapabilities:e.agentCapabilities,runtime:e.runtime}}function IE(e,t){const n=cl(e),o=cl(t);return{a:n,b:o,changes:wE(kh(n),kh(o))}}function OE(e,t){const n=Fd(e),o=Fd(t),r=l=>`${l.kind}:${l.method}`,i=new Map(n.map(l=>[r(l),l])),s=new Map(o.map(l=>[r(l),l])),a=[];for(const l of new Set([...i.keys(),...s.keys()])){const c=i.get(l)??null,f=s.get(l)??null,m=c??f;a.push({method:m.method,kind:m.kind,a:c,b:f,countDelta:((f==null?void 0:f.count)??0)-((c==null?void 0:c.count)??0),p50Delta:kc(c==null?void 0:c.p50,f==null?void 0:f.p50),p99Delta:kc(c==null?void 0:c.p99,f==null?void 0:f.p99),maxDelta:kc(c==null?void 0:c.max,f==null?void 0:f.max)})}return a.sort((l,c)=>Math.abs(c.p99Delta??0)-Math.abs(l.p99Delta??0)||Math.abs(c.countDelta)-Math.abs(l.countDelta)||l.method.localeCompare(c.method)),a}function kc(e,t){return e==null||t===null||t===void 0?null:t-e}function of(e,t=200){const[n,o]=P.useState(e),[r,i]=P.useState(!1);return P.useEffect(()=>{if(e){o(!0);let a=null;const l=requestAnimationFrame(()=>{a=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(l),a!==null&&cancelAnimationFrame(a)}}i(!1);const s=setTimeout(()=>o(!1),t);return()=>clearTimeout(s)},[e,t]),{rendered:n,visible:r}}const rf="flex h-9 items-center gap-4 border-b border-line bg-surface-base px-5",RE={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"UNK"};function AE(e){return e.direction==="editor-to-agent"?"→A":"A←"}function Hb(e){if(e.name)return`#${e.id} · ${e.name}`;const t=e.agent_command?Rt(e.agent_command):"agent";return e.client_name?`#${e.id} · ${e.client_name} · ${t}`:`#${e.id} · ${t}`}const Th={messages:null,loading:!1,error:null};function _h(e){const[t,n]=P.useState(Th);return P.useEffect(()=>{if(e===null){n(Th);return}let o=!1;return n({messages:null,loading:!0,error:null}),xS(e).then(r=>{o||n({messages:r.messages,loading:!1,error:null})}).catch(r=>{o||n({messages:null,loading:!1,error:r instanceof Error?r.message:String(r)})}),()=>{o=!0}},[e]),t}function ME({open:e,onClose:t}){const n=ne(D=>D.messages),o=ne(D=>D.session),r=ft(D=>D.savedSessions),i=(o==null?void 0:o.id)??null,[s,a]=P.useState(null),[l,c]=P.useState(null),[f,m]=P.useState("frames"),[h,y]=P.useState(!0),[g,b]=P.useState(null),{rendered:v,visible:u}=of(e);P.useEffect(()=>{if(!e)return;const D=Q=>{Q.key==="Escape"&&(Q.preventDefault(),t())};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[e,t]),P.useEffect(()=>{e&&(a(i),c(null),b(null))},[e,i]),P.useEffect(()=>b(null),[s,l]);const p=_h(s!==null&&s!==i?s:null),x=_h(l!==null&&l!==i?l:null),S=s===null?null:s===i?n:p.messages,T=l===null?null:l===i?n:x.messages,C=p.loading||x.loading,$=p.error??x.error,j=P.useMemo(()=>S===null||T===null?null:vE(S,T),[S,T]),R=P.useMemo(()=>{if(!j)return[];const D=[];return j.rows.forEach((Q,ee)=>{h&&Q.op==="equal"||D.push({row:Q,index:ee})}),D},[j,h]),M=P.useMemo(()=>{const D=r.find(Q=>Q.id===l);return D?Hb(D):null},[r,l]),F=P.useMemo(()=>S&&T?IE(S,T):null,[S,T]),V=P.useMemo(()=>S&&T?OE(S,T):null,[S,T]);if(!v)return null;const L=r.filter(D=>D.id!==l),U=r.filter(D=>D.id!==s);return d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Session diff",className:K("fixed inset-0 z-[100] flex flex-col bg-surface-base/95 backdrop-blur-sm transition-opacity duration-200 ease-out",u?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:K("flex h-full w-full flex-col transition-transform duration-200 ease-out",u?"translate-y-0":"-translate-y-2"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Diff — compare two sessions"}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close diff panel",children:"close"})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line bg-surface-elev px-5 py-2.5",children:[d.jsx("span",{className:"font-mono text-[11px] text-accent-out",title:"baseline (left)",children:"A"}),d.jsx(Eh,{ariaLabel:"Baseline session",sessions:L,selectedId:s,onSelect:a}),d.jsx("span",{className:"text-ink-muted",children:"→"}),d.jsx("span",{className:"font-mono text-[11px] text-ink-secondary",title:"comparison (right)",children:"B"}),d.jsx(Eh,{ariaLabel:"Comparison session",sessions:U,selectedId:l,onSelect:c})]}),s===null?d.jsx(bi,{children:"Pick a baseline session (A) to compare from."}):l===null?d.jsx(bi,{children:"Pick a session in the B selector above to compare against A."}):C?d.jsx(bi,{children:"Loading sessions…"}):$?d.jsxs(bi,{tone:"error",children:["Could not load a session: ",$]}):!j||!F||!V?d.jsx(bi,{children:"No data."}):d.jsxs(d.Fragment,{children:[d.jsx(qE,{tab:f,onTab:m,summary:j.summary,infoCount:F.changes.length}),d.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[f==="frames"&&d.jsx(UE,{diff:j,bLabel:M,hideEqual:h,onHideEqual:y,visibleRows:R,expanded:g,onToggleExpand:D=>b(Q=>Q===D?null:D)}),f==="info"&&d.jsx(LE,{meta:F}),f==="perf"&&d.jsx(zE,{perf:V})]})]})]})})}function qE({tab:e,onTab:t,summary:n,infoCount:o}){const i=[{id:"frames",label:"frames",badge:n.changed+n.added+n.removed},{id:"info",label:"info",badge:o},{id:"perf",label:"perf",badge:0}];return d.jsx("div",{className:"flex items-center gap-1 border-b border-line bg-surface-elev px-5 py-1.5",children:i.map(s=>d.jsxs("button",{type:"button",onClick:()=>t(s.id),className:K("inline-flex items-center gap-1.5 rounded-sm px-3 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors",e===s.id?"bg-surface-rowHover text-ink-primary":"text-ink-muted hover:text-ink-secondary"),children:[s.label,s.badge>0&&d.jsx("span",{className:"rounded-sm border border-line px-1 text-[9px] text-ink-secondary",children:s.badge})]},s.id))})}function UE({diff:e,bLabel:t,hideEqual:n,onHideEqual:o,visibleRows:r,expanded:i,onToggleExpand:s}){const a=e.summary.changed===0&&e.summary.added===0&&e.summary.removed===0;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K(rf,"font-mono text-[11px]"),children:[d.jsxs("span",{className:"text-ink-muted",children:[e.summary.equal," same"]}),d.jsxs("span",{className:"text-accent-warn",children:[e.summary.changed," differs"]}),d.jsxs("span",{className:"text-accent-error",children:[e.summary.removed," only in A"]}),d.jsxs("span",{className:"text-accent-ok",children:[e.summary.added," only in B"]}),d.jsxs("label",{className:"ml-auto flex cursor-pointer select-none items-center gap-2 text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx("input",{type:"checkbox",checked:n,onChange:l=>o(l.target.checked),className:"accent-accent-info"}),"hide unchanged"]})]}),a?d.jsxs(ms,{tone:"ok",children:["Sessions are identical",t?` — every frame in B (${t}) matches A`:"","."]}):r.length===0?d.jsx(ms,{children:"Only unchanged frames — toggle “hide unchanged” to see them."}):d.jsxs("table",{className:"w-full table-fixed border-collapse font-mono text-[11px]",children:[d.jsxs("colgroup",{children:[d.jsx("col",{className:"w-[24px]"}),d.jsx("col",{className:"w-1/2"}),d.jsx("col",{className:"w-1/2"})]}),d.jsx("tbody",{children:r.map(({row:l,index:c})=>d.jsx(HE,{row:l,expanded:i===c,onToggle:()=>s(c)},c))})]})]})}function Vb(){return d.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-warn",children:"~"})," changed"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-ok",children:"+"})," only in B"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-error",children:"−"})," only in A"]})]})}function LE({meta:e}){return e.changes.length===0?d.jsx(ms,{tone:"ok",children:"Metadata identical — same client, agent, capabilities, protocol and runtime."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:rf,children:d.jsx(Vb,{})}),d.jsx("ul",{className:"space-y-1 px-5 py-3 font-mono text-[11px]",children:e.changes.map((t,n)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Wb,{change:t})},n))})]})}function jh(e){return e==null?"—":Vt(e)}function DE(e){return e===null?{text:"—",tone:"text-ink-dim"}:e===0?{text:"0",tone:"text-ink-muted"}:{text:(e>0?"+":"−")+Vt(Math.abs(e)),tone:e>0?"text-accent-error":"text-accent-ok"}}function zE({perf:e}){return e.length===0?d.jsx(ms,{children:"No methods to compare."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K(rf,"font-mono text-[10px] uppercase tracking-widest text-ink-muted"),children:[d.jsx("span",{children:"Δ = B − A · sorted by |Δ p99|"}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-error",children:"+"})," slower in B"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-ok",children:"−"})," faster in B"]})]}),d.jsxs("table",{className:"w-full text-[11px]",children:[d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:d.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx("th",{className:"py-2 pl-5 pr-3",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"A p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"B p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"Δ p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"count"})]})}),d.jsx("tbody",{className:"font-mono",children:e.map(t=>{var o,r,i,s;const n=DE(t.p99Delta);return d.jsxs("tr",{className:"border-b border-line/40 hover:bg-surface-rowHover/50",children:[d.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:t.method,children:t.method}),d.jsx("td",{className:"px-3 py-1.5 text-[10px] uppercase tracking-widest text-ink-muted",children:t.kind==="request"?"req":"ntf"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:jh(((o=t.a)==null?void 0:o.p99)??null)}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:jh(((r=t.b)==null?void 0:r.p99)??null)}),d.jsx("td",{className:K("px-3 py-1.5 text-right",n.tone),children:n.text}),d.jsxs("td",{className:"px-3 py-1.5 text-right text-ink-muted",children:[((i=t.a)==null?void 0:i.count)??0,"→",((s=t.b)==null?void 0:s.count)??0]})]},`${t.kind}:${t.method}`)})})]})]})}function bi({children:e,tone:t}){return d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d.jsx(ms,{...t?{tone:t}:{},children:e})})}const FE={equal:"",changed:"bg-accent-warn/5",added:"bg-accent-ok/5",removed:"bg-accent-error/5"},BE={equal:{glyph:"=",tone:"text-ink-dim"},changed:{glyph:"≠",tone:"text-accent-warn"},added:{glyph:"▸",tone:"text-accent-ok"},removed:{glyph:"◂",tone:"text-accent-error"}};function HE({row:e,expanded:t,onToggle:n}){const o=BE[e.op],r=e.op==="changed"&&e.changes.length>0;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:K("border-b border-line/40 align-top",FE[e.op],r&&"cursor-pointer hover:bg-accent-warn/10"),onClick:r?n:void 0,children:[d.jsx("td",{className:K("py-1.5 pl-5 text-center",o.tone),children:o.glyph}),d.jsx("td",{className:"px-3 py-1.5",children:d.jsx(Nh,{frame:e.a,muted:e.op==="added"})}),d.jsxs("td",{className:"px-3 py-1.5",children:[d.jsx(Nh,{frame:e.b,muted:e.op==="removed"}),r&&d.jsxs("span",{className:"ml-2 text-[10px] text-accent-warn",children:[t?"▾":"▸"," ",e.changes.length," field",e.changes.length===1?"":"s"]})]})]}),r&&t&&d.jsxs("tr",{className:"border-b border-line/40 bg-surface-elev",children:[d.jsx("td",{}),d.jsxs("td",{colSpan:2,className:"px-5 py-2",children:[d.jsx("div",{className:"mb-1.5",children:d.jsx(Vb,{})}),d.jsx("ul",{className:"space-y-1",children:e.changes.map((i,s)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Wb,{change:i})},s))})]})]})]})}function Nh({frame:e,muted:t}){if(e===null)return d.jsx("span",{className:"text-ink-dim",children:"—"});const n=e.method??(e.parseError?`! ${e.parseError}`:"—");return d.jsxs("span",{className:K("inline-flex items-baseline gap-2",t&&"opacity-60"),children:[d.jsx("span",{className:"text-ink-dim",children:AE(e)}),d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:RE[e.kind]}),d.jsx("span",{className:"truncate text-ink-primary",title:n,children:n}),d.jsxs("span",{className:"text-ink-dim",children:["#",e.seq]})]})}const Ch=80;function oa(e){let t;try{t=JSON.stringify(e)}catch{t=String(e)}return t===void 0&&(t="undefined"),t.length>Ch&&(t=t.slice(0,Ch-1)+"…"),t}function Wb({change:e}){return e.kind==="add"?d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-ok",children:"+ "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-ok",children:oa(e.b)})]}):e.kind==="remove"?d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-error",children:"− "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-error line-through",children:oa(e.a)})]}):d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-warn",children:"~ "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-error line-through",children:oa(e.a)}),d.jsx("span",{className:"text-ink-muted",children:" → "}),d.jsx("span",{className:"text-accent-ok",children:oa(e.b)})]})}function ms({children:e,tone:t="muted"}){const n=t==="error"?"text-accent-error":t==="ok"?"text-accent-ok":"text-ink-muted";return d.jsx("div",{className:K("px-5 py-8 text-center font-mono text-[12px]",n),children:e})}function Eh({ariaLabel:e,sessions:t,selectedId:n,onSelect:o}){const[r,i]=P.useState(!1),s=P.useRef(null);P.useEffect(()=>{if(!r)return;const m=h=>{s.current&&!s.current.contains(h.target)&&i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const a=t.filter(m=>m.imported_at===null),l=t.filter(m=>m.imported_at!==null),c=n!==null?t.find(m=>m.id===n)??null:null,f=c?Hb(c):n!==null?`#${n}`:"select a session…";return d.jsxs("div",{ref:s,className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>i(m=>!m),"aria-label":e,"aria-haspopup":"listbox","aria-expanded":r,className:K("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] uppercase tracking-widest transition-colors","border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",r?"border-line-strong text-ink-primary":""),title:`${e} — pick which session to compare`,children:[d.jsx("span",{className:"inline-block w-[240px] truncate text-left",children:f}),d.jsx("span",{"aria-hidden":!0,className:K("transition-transform",r?"rotate-180":""),children:"▾"})]}),r&&d.jsxs("div",{className:"absolute left-0 top-[calc(100%+6px)] z-50 w-[460px] rounded-md border border-line bg-surface-elev shadow-xl",children:[d.jsxs(Ph,{children:["saved · ",a.length," session",a.length===1?"":"s"]}),a.length===0&&d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no other saved sessions to compare"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:a.map(m=>d.jsx(Ih,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))}),l.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs(Ph,{children:["imported · ",l.length," file",l.length===1?"":"s"]}),d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:l.map(m=>d.jsx(Ih,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))})]})]})]})}function Ph({children:e}){return d.jsx("div",{className:"border-b border-line bg-surface-base/50 px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e})}function Ih({s:e,active:t,onPick:n}){return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:n,title:`session #${e.id} · ${e.agent_command??""} · ${e.message_count} messages`,className:K("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",t?"bg-accent-note animate-pulse-soft":"bg-ink-dim")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),d.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Rt(e.agent_command??"")}`:Rt(e.agent_command??""))]}),d.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[e.message_count,"msg · ",Ar(e.started_at)]})]})})}let Tc=null,xi=null;async function VE(){if(Tc)return Tc;if(xi)return xi;xi=(async()=>{const e=await fetch("/api/info",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`info: HTTP ${e.status}`);const t=await e.json();return Tc=t,t})();try{return await xi}finally{xi=null}}const WE=[{id:"zed",label:"Zed"},{id:"jetbrains",label:"JetBrains"}],KE="/absolute/path/to/acp-devtools";function GE(e){return JSON.stringify({agent_servers:{"Claude Code (via ACP Devtools)":{type:"custom",command:e}}},null,4)}function Kb({text:e,label:t="Copy"}){const[n,o]=P.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1400)}catch{o(!1)}};return d.jsx("button",{type:"button",onClick:r,className:K("rounded border border-line px-2 py-0.5 font-mono text-[10px] uppercase tracking-widest transition-colors",n?"border-accent-out text-accent-out":"text-ink-secondary hover:border-ink-secondary hover:text-ink-primary"),children:n?"Copied":t})}function JE(){const[e,t]=P.useState("zed"),[n,o]=P.useState(null);P.useEffect(()=>{let a=!0;return VE().then(l=>{a&&o(l.binaryPath)}).catch(()=>{}),()=>{a=!1}},[]);const r=n??KE,i=n===null,s=P.useMemo(()=>({zed:GE(r),jetbrainsName:"Claude Code (via ACP Devtools)"}),[r]);return d.jsxs("div",{className:"rounded border border-line bg-surface-base",children:[d.jsx("div",{className:"flex items-center gap-1 border-b border-line px-3 py-2",children:WE.map(a=>d.jsx("button",{type:"button",onClick:()=>t(a.id),className:K("rounded px-2 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors",e===a.id?"bg-surface-elev text-ink-primary":"text-ink-secondary hover:text-ink-primary"),children:a.label},a.id))}),e==="zed"&&d.jsxs("div",{className:"px-3 py-3",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"~/.config/zed/settings.json"}),d.jsx(Kb,{text:s.zed})]}),d.jsx("pre",{className:"overflow-x-auto rounded border border-line bg-surface-elev/60 px-3 py-2 font-mono text-[11px] leading-relaxed text-ink-primary",children:s.zed}),d.jsxs("p",{className:"mt-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Open Zed, paste into ",d.jsx("span",{className:"font-mono",children:"settings.json"})," ","(Cmd+,), pick the new agent in the right-side panel, send a prompt. The CLI auto-proxies ",d.jsx("span",{className:"font-mono",children:"@zed-industries/claude-code-acp"})," ","when launched with no args."]}),d.jsx(Oh,{isPlaceholder:i})]}),e==="jetbrains"&&d.jsxs("div",{className:"px-3 py-3",children:[d.jsxs("p",{className:"mb-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Settings (Cmd+,) → search ",d.jsx("span",{className:"font-mono",children:"agent"})," → open the AI Assistant / Junie agent-servers page → add a new entry with these fields (no arguments needed):"]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(Rh,{label:"Name",value:s.jetbrainsName}),d.jsx(Rh,{label:"Command",value:r})]}),d.jsxs("p",{className:"mt-3 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["JetBrains IDEs require an absolute ",d.jsx("span",{className:"font-mono",children:"command"}),". See ",d.jsx("span",{className:"font-mono",children:"examples/jetbrains-config.md"})," if the agent-servers page is not where the search suggests."]}),d.jsx(Oh,{isPlaceholder:i})]})]})}function Oh({isPlaceholder:e}){return e?d.jsxs("div",{className:"mt-3 rounded border border-line border-dashed bg-surface-elev/40 px-3 py-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["You're viewing the UI through a development server, so the absolute binary path couldn't be auto-detected. After running"," ",d.jsx("span",{className:"font-mono",children:"npm run build:full"})," in the repo and"," ",d.jsx("span",{className:"font-mono",children:"npm link"})," inside"," ",d.jsx("span",{className:"font-mono",children:"packages/cli/"}),", find the path with"," ",d.jsx("span",{className:"font-mono",children:"which acp-devtools"})," and replace the placeholder above."]}):d.jsxs("p",{className:"mt-3 font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:["path auto-resolved · verify with ",d.jsx("span",{className:"text-ink-secondary",children:"which acp-devtools"})]})}function Rh({label:e,value:t}){return d.jsxs("div",{className:"flex items-center gap-2 rounded border border-line bg-surface-elev/60 px-3 py-1.5",children:[d.jsx("span",{className:"w-20 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:"flex-1 truncate font-mono text-[11px] text-ink-primary",children:t}),d.jsx(Kb,{text:t})]})}function QE({status:e,lastError:t,url:n,captureCount:o}){const r=e==="open"?"Awaiting messages":e==="connecting"?"Connecting":e==="closed"?"Disconnected":e==="error"?"Connection error":"No live capture",i=e==="open"?"text-accent-out":e==="error"?"text-accent-error":"text-ink-secondary";return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:d.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[d.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.2.1 / pre-alpha"})]}),d.jsx("h2",{className:K("font-display text-2xl uppercase tracking-tight",i),children:r}),d.jsx("p",{className:"mt-2 font-sans text-sm leading-relaxed text-ink-secondary",children:"Connect an IDE to start streaming ACP frames. Pick yours below — the snippet plugs acp-devtools between editor and agent so every message is captured live."}),o>0&&d.jsxs("p",{className:"mt-2 font-mono text-[11px] uppercase tracking-widest text-accent-out",children:[o," live capture",o===1?"":"s"," discovered — pick one in the picker above"]}),d.jsx("div",{className:"mt-4",children:d.jsx(JE,{})}),d.jsxs("div",{className:"mt-4 flex items-center gap-3 font-mono text-[11px]",children:[d.jsx(YE,{status:e}),d.jsx("span",{className:"text-ink-secondary",children:n}),t&&d.jsx("span",{className:"text-accent-error",children:t})]})]})})}function YE({status:e}){const t=e==="open"?"bg-accent-out":e==="connecting"?"bg-accent-warn animate-pulse-soft":e==="error"?"bg-accent-error":"bg-ink-dim";return d.jsx("span",{className:K("h-2 w-2 rounded-full",t),"aria-hidden":!0})}function XE(){const e=ne(i=>i.filters),t=ne(i=>i.toggleDirection),n=ne(i=>i.toggleKind),o=ne(i=>i.toggleStreams),r=ne(i=>i.setSearch);return d.jsxs("div",{className:"flex items-center gap-3 border-b border-line bg-surface-elev/70 px-4 py-2",children:[d.jsx("div",{className:"flex items-center gap-1",children:ls.map(i=>d.jsx(tP,{dir:i,active:e.directions.has(i),onClick:()=>t(i)},i))}),d.jsx(rP,{}),d.jsxs("div",{className:"flex items-center gap-1",children:[cs.map(i=>d.jsx(nP,{kind:i,active:e.kinds.has(i),onClick:()=>n(i)},i)),d.jsx(oP,{active:e.showStreams,onClick:o})]}),d.jsx("div",{className:"ml-auto",children:d.jsx("input",{type:"search",placeholder:"search payload…",value:e.search,onChange:i=>r(i.target.value),className:K("h-7 w-64 rounded border border-line bg-surface-base px-2 font-mono text-[11px] text-ink-primary placeholder-ink-muted","focus:border-accent-out focus:outline-none")})})]})}const ZE={"editor-to-agent":"editor → agent (toggle to filter messages flowing from your IDE to the AI)","agent-to-editor":"agent → editor (toggle to filter messages coming back from the AI)"},eP={request:"request — expects a response",response:"response — answer to a previous request",notification:"notification — one-way event, no response",error:"error — response carrying an error object",unknown:"unknown — frames that could not be classified as JSON-RPC"};function tP({dir:e,active:t,onClick:n}){const o=e==="editor-to-agent",r=o?"→ OUT":"← IN",i=o?"text-accent-out":"text-accent-in";return d.jsx("button",{type:"button",onClick:n,title:ZE[e],className:K("inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold tracking-widest transition-colors",t?K(i,o?"border-accent-out/50 bg-accent-out/10":"border-accent-in/50 bg-accent-in/10"):"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:r})}function nP({kind:e,active:t,onClick:n}){const r={request:{color:"text-accent-out",border:"border-accent-out/50",bg:"bg-accent-out/10"},response:{color:"text-accent-in",border:"border-accent-in/50",bg:"bg-accent-in/10"},notification:{color:"text-accent-note",border:"border-accent-note/50",bg:"bg-accent-note/10"},error:{color:"text-accent-error",border:"border-accent-error/50",bg:"bg-accent-error/10"},unknown:{color:"text-ink-muted",border:"border-line",bg:"bg-surface-row"}}[e];return d.jsx("button",{type:"button",onClick:n,title:eP[e],className:K("rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",t?K(r.color,r.border,r.bg):"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:e})}function oP({active:e,onClick:t}){return d.jsx("button",{type:"button",onClick:t,title:"stream — collapse runs of agent_message_chunk notifications into a single row",className:K("rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",e?"border-accent-note/50 bg-accent-note/10 text-accent-note":"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:"stream"})}function rP(){return d.jsx("span",{"aria-hidden":!0,className:"h-5 w-px bg-line"})}const iP={minSamplesForTail:3,longTailRatio:5,minBusiestCount:50,minBusiestRatio:2.5,minHotspotShare:.4,minSamplesForOutlier:5,outlierRatio:3};function sP(e,t,n={}){const o={...iP,...n},r=[],i=t.reduce((y,g)=>y+(g.totalLatencyMs??0),0);if(i>0){const g=t.filter(b=>b.totalLatencyMs!==null&&b.totalLatencyMs>0).sort((b,v)=>(v.totalLatencyMs??0)-(b.totalLatencyMs??0))[0];if(g&&g.totalLatencyMs!==null){const b=g.totalLatencyMs/i;b>=o.minHotspotShare&&r.push({kind:"hotspot",summary:`${g.method} consumed ${ar(g.totalLatencyMs)} of total wall time`,detail:`${Math.round(b*100)}% of ${ar(i)} sampled latency`,methods:[g.method]})}}const a=t.filter(y=>y.sampleSize>=o.minSamplesForTail&&y.p50!==null&&y.p99!==null&&y.p50>0&&y.p99/y.p50>=o.longTailRatio).sort((y,g)=>(g.p99??0)/(g.p50??1)-(y.p99??0)/(y.p50??1))[0];if(a&&a.p99!==null&&a.p50!==null){const y=Math.round(a.p99/a.p50);r.push({kind:"long-tail",summary:`${a.method} has a long tail — p99 is ${y}× the p50`,detail:`p50 ${ar(a.p50)} · p99 ${ar(a.p99)} · ${a.sampleSize} samples`,methods:[a.method]})}const l=[...t].filter(y=>y.sampleSize>=o.minSamplesForOutlier&&y.p99!==null&&y.max!==null&&y.p99>0&&y.max/y.p99>=o.outlierRatio).sort((y,g)=>(g.max??0)-(y.max??0))[0];if(l&&l.max!==null&&l.p99!==null){const y=Math.round(l.max/l.p99);r.push({kind:"outlier",summary:`${l.method} had one ${ar(l.max)} call — ${y}× its p99`,detail:`p99 ${ar(l.p99)} · ${l.sampleSize} samples`,methods:[l.method]})}const c=[...t].sort((y,g)=>g.count-y.count),f=c[0],m=c[1];if(f&&f.count>=o.minBusiestCount){const y=m&&m.count>0?f.count/m.count:1/0;if(y>=o.minBusiestRatio){const g=f.kind==="notification"?"notifications":"calls";r.push({kind:"busiest",summary:`${f.method} sent ${f.count} ${g}`,detail:m?`${y.toFixed(1)}× the next-busiest method (${m.method} · ${m.count})`:"no other methods to compare against",methods:[f.method]})}}const h=aP(e);if(h.length>0){const y=h.slice(0,3),g=h.length>3?` (+${h.length-3} more)`:"";r.push({kind:"errors",summary:`${h.length} method${h.length===1?"":"s"} returned an error`,detail:y.join(", ")+g,methods:h})}return r}function aP(e){const t=new Map,n=new Set;for(const o of e){const r=o.rpcId===void 0||o.rpcId===null?null:String(o.rpcId);if(o.kind==="request"&&o.method&&r!==null)t.set(r,o.method);else if(o.kind==="error"&&r!==null){const i=t.get(r);i&&n.add(i)}}return[...n].sort()}function ar(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<1e4)return`${(e/1e3).toFixed(2)}s`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return`${t}m${n}s`}function lP(e,t){if(e.length<=t)return e;const n=[];for(let o=0;o<t;o++){const r=Math.round(o*(e.length-1)/(t-1));n.push(e[r])}return n}function cP({values:e,width:t=64,height:n=14,className:o,title:r}){if(e.length===0)return null;const i=e[e.length-1]??0;if(i===0)return null;const s=Math.max(1,Math.floor(t/4)),a=lP(e,s),l=1,c=(t-l*(a.length-1))/a.length;return d.jsx("svg",{viewBox:`0 0 ${t} ${n}`,width:t,height:n,className:K("inline-block align-middle",o),role:"img","aria-label":r??`latency distribution, ${e.length} samples`,children:a.map((f,m)=>{const h=Math.max(1,f/i*n);return d.jsx("rect",{x:m*(c+l),y:n-h,width:c,height:h,fill:"currentColor",opacity:.4+f/i*.6},m)})})}function dP(e){const t={events:[],startTs:0,endTs:0,durationMs:0,laneCounts:{"editor-req":0,"agent-req":0,notification:0}};if(e.length===0)return t;const n=nf(e),o=new Map;for(const l of e)o.set(l.seq,l);let r=1/0,i=-1/0;const s=[],a={"editor-req":0,"agent-req":0,notification:0};for(const l of e)if(l.timestamp<r&&(r=l.timestamp),l.timestamp>i&&(i=l.timestamp),l.kind==="request"){const c=l.direction==="editor-to-agent"?"editor-req":"agent-req",f=n.get(l.seq),m=f?o.get(f.pairSeq):void 0,h=(m==null?void 0:m.kind)==="error",y=m?m.timestamp:l.timestamp;y>i&&(i=y),s.push({seq:l.seq,startTs:l.timestamp,endTs:y,lane:c,method:l.method??null,kind:l.kind,erroredOut:h,pairedSeq:m?m.seq:null}),a[c]+=1}else l.kind==="notification"&&(s.push({seq:l.seq,startTs:l.timestamp,endTs:l.timestamp,lane:"notification",method:l.method??null,kind:l.kind,erroredOut:!1,pairedSeq:null}),a.notification+=1);return!Number.isFinite(r)||!Number.isFinite(i)?t:{events:s,startTs:r,endTs:i,durationMs:Math.max(0,i-r),laneCounts:a}}const dl=["editor-req","agent-req","notification"],uP={"editor-req":"editor → agent","agent-req":"agent → editor",notification:"notifications"},oo=48,sf=6,Ll=24,wn=132,hs=20,Dl=8,pP=20,Ah=3e4,Mh=50;function fP(e,t,n,o,r,i){if(e.length===0||n<=t)return{segments:[{kind:"active",tStart:t,tEnd:n,pxStart:0,pxEnd:o*r}],tsToX:()=>wn-i,totalActiveMs:0};const s=[...e].sort((p,x)=>p.startTs-x.startTs),a=[];let l=t,c=t;for(const p of s)p.startTs-c>Ah&&(c>l&&a.push({kind:"active",tStart:l,tEnd:c}),a.push({kind:"gap",tStart:c,tEnd:p.startTs}),l=p.startTs),c=Math.max(c,p.endTs);c>l&&a.push({kind:"active",tStart:l,tEnd:c}),n>c+Ah?a.push({kind:"gap",tStart:c,tEnd:n}):n>c&&a.length>0&&(a[a.length-1].tEnd=n);const f=a.filter(p=>p.kind==="gap").length,m=a.filter(p=>p.kind==="active").reduce((p,x)=>p+(x.tEnd-x.tStart),0),h=o*r,y=Math.max(50,h-f*Mh),g=m>0?y/m:0;let b=0;const v=[];for(const p of a){const x=p.kind==="gap"?Mh:(p.tEnd-p.tStart)*g;v.push({...p,pxStart:b,pxEnd:b+x}),b+=x}return{segments:v,tsToX:p=>{if(p<=v[0].tStart)return wn+v[0].pxStart-i;for(const S of v)if(p>=S.tStart&&p<=S.tEnd){const T=S.tEnd>S.tStart?(p-S.tStart)/(S.tEnd-S.tStart):0,C=S.pxStart+T*(S.pxEnd-S.pxStart);return wn+C-i}const x=v[v.length-1];return wn+x.pxEnd-i},totalActiveMs:m}}function mP({messages:e,onSelectSeq:t,height:n=220,controlsRef:o,onZoomChange:r}){const i=P.useMemo(()=>dP(e),[e]),s=P.useRef(null),a=P.useRef(null),[l,c]=P.useState({width:800,height:n}),[f,m]=P.useState(1),[h,y]=P.useState(0),[g,b]=P.useState(null),[v,u]=P.useState({x:0,y:0}),p=P.useRef(null);P.useEffect(()=>{const L=s.current;if(!L||typeof ResizeObserver>"u")return;const U=new ResizeObserver(D=>{const Q=D[0];if(!Q)return;const ee=Q.contentRect;c({width:Math.max(320,ee.width),height:Math.max(120,ee.height)})});return U.observe(L),()=>U.disconnect()},[]),P.useEffect(()=>{m(1),y(0),b(null)},[i.startTs,i.endTs]);const x=P.useMemo(()=>{const L=Math.max(50,l.width-wn-hs);return fP(i.events,i.startTs,i.endTs,L,f,h)},[i,l.width,f,h]),S=P.useMemo(()=>{if(i.events.length===0)return[];const L=[];for(const U of i.events){const D=x.tsToX(U.startTs),Q=x.tsToX(U.endTs),ee=Math.max(2,Q-D),q=dl.indexOf(U.lane),G=Dl+Ll+q*(oo+sf)+oo/2-9;L.push({...U,x:D,y:G,width:ee,height:18})}return L},[i,x]);P.useEffect(()=>{const L=a.current;if(!L)return;const U=window.devicePixelRatio||1;L.width=l.width*U,L.height=l.height*U,L.style.width=`${l.width}px`,L.style.height=`${l.height}px`;const D=L.getContext("2d");if(!D)return;D.setTransform(U,0,0,U,0,0);const Q=getComputedStyle(document.documentElement),ee=G=>`rgb(${Q.getPropertyValue(`--${G}`).trim()})`,q=(G,I)=>`rgba(${Q.getPropertyValue(`--${G}`).trim()} / ${I})`;D.clearRect(0,0,l.width,l.height),hP(D,l,ee),gP(D,x,l,ee,q),yP(D,l,x,ee),xP(D,S,g,ee,q)},[S,x,l,g]);const T=(L,U)=>{for(const D of S){const Q=Math.max(D.width,6);if(L>=D.x&&L<=D.x+Q&&U>=D.y&&U<=D.y+D.height)return D}return null},C=L=>{const U=L.currentTarget.getBoundingClientRect(),D=L.clientX-U.left,Q=L.clientY-U.top;if(p.current){const q=D-p.current.startX;y(Math.max(0,p.current.startPan-q));return}const ee=T(D,Q);b(ee),u({x:L.clientX,y:L.clientY})},$=L=>{const U=L.currentTarget.getBoundingClientRect(),D=L.clientX-U.left,Q=L.clientY-U.top,ee=T(D,Q);if(ee&&t){t(ee.seq);return}p.current={startX:D,startPan:h}},j=()=>{p.current=null},R=L=>{if(!L.metaKey&&!L.ctrlKey)return;L.preventDefault();const U=L.deltaY<0?1.15:1/1.15;m(D=>Math.min(50,Math.max(.3,D*U)))},M=()=>m(L=>Math.min(50,L*1.5)),F=()=>m(L=>Math.max(.3,L/1.5)),V=()=>{m(1),y(0)};return P.useEffect(()=>{if(o)return o.current={zoomIn:M,zoomOut:F,reset:V,getZoom:()=>f},()=>{o.current&&(o.current=null)}}),P.useEffect(()=>{r==null||r(f)},[f,r]),i.events.length===0?d.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no messages — capture or load a session first"}):d.jsxs("div",{ref:s,className:"relative h-full w-full",style:{minHeight:0},children:[d.jsx("canvas",{ref:a,className:K("block h-full w-full",p.current?"cursor-grabbing":g?"cursor-pointer":"cursor-grab"),onMouseMove:C,onMouseDown:$,onMouseUp:j,onMouseLeave:()=>{b(null),p.current=null},onWheel:R}),g&&d.jsxs("div",{role:"tooltip",className:"pointer-events-none fixed z-[150] rounded-sm border border-line bg-surface-base px-3 py-2 font-mono text-[11px] shadow-lg",style:{left:Math.min(window.innerWidth-280,v.x+12),top:v.y+12,maxWidth:280},children:[d.jsxs("div",{className:"text-ink-primary",children:[d.jsxs("span",{className:"text-ink-muted",children:["seq ",g.seq]})," · ",g.method??g.kind]}),d.jsx("div",{className:"text-ink-muted",children:g.endTs>g.startTs?`${Vt(g.endTs-g.startTs)}${g.erroredOut?" · error":""}`:g.lane==="notification"?"notification":"pending"}),t&&d.jsx("div",{className:"mt-1 text-[10px] text-ink-dim",children:"click to inspect"})]})]})}function hP(e,t,n){e.font="10px monospace",e.textBaseline="middle",e.textAlign="start";for(let o=0;o<dl.length;o++){const r=dl[o],i=Dl+Ll+o*(oo+sf);e.fillStyle=n("surface-elev"),e.fillRect(wn,i,t.width-wn-hs,oo),e.fillStyle=n("ink-muted"),e.fillText(uP[r],pP,i+oo/2),e.strokeStyle=n("line"),e.lineWidth=1,e.beginPath(),e.moveTo(wn,i+oo),e.lineTo(t.width-hs,i+oo),e.stroke()}}function yP(e,t,n,o){var g;const r=Dl+Ll-4;e.strokeStyle=o("line"),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="bottom",e.textAlign="center",e.lineWidth=1;const i=n.segments.filter(b=>b.kind==="active").reduce((b,v)=>Math.max(b,v.tEnd-v.tStart),0),s=n.segments.reduce((b,v)=>b+(v.kind==="active"?v.pxEnd-v.pxStart:0),0),l=(i>0?s/n.totalActiveMs:0)*1e3,c=[.1,.25,.5,1,2,5,10,30,60,120,300],f=80;let m=c[c.length-1];for(const b of c)if(b*l>=f){m=b;break}const h=m*1e3,y=((g=n.segments[0])==null?void 0:g.tStart)??0;for(const b of n.segments){if(b.kind!=="active")continue;const v=Math.ceil((b.tStart-y)/h)*h+y;for(let u=v;u<=b.tEnd;u+=h){const p=n.tsToX(u);p<wn||p>t.width-hs||(e.beginPath(),e.moveTo(p,r),e.lineTo(p,r+4),e.stroke(),e.fillText(bP(u-y),p,r-2))}}}function gP(e,t,n,o,r){const i=Dl+Ll,s=i+dl.length*(oo+sf);for(const a of t.segments){if(a.kind!=="gap")continue;const l=t.tsToX(a.tStart),f=t.tsToX(a.tEnd)-l;if(l>n.width-hs||l+f<wn)continue;e.fillStyle=r("ink-muted",.06),e.fillRect(l,i,f,s-i),e.strokeStyle=o("line"),e.setLineDash([3,3]),e.lineWidth=1,e.beginPath(),e.moveTo(l+.5,i),e.lineTo(l+.5,s),e.moveTo(l+f-.5,i),e.lineTo(l+f-.5,s),e.stroke(),e.setLineDash([]),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="middle",e.textAlign="center";const m=l+f/2,h=i+(s-i)/2;e.fillText(vP(a.tEnd-a.tStart),m,h)}}function vP(e){if(e<6e4)return`${Math.round(e/1e3)}s idle`;if(e<36e5)return`${Math.round(e/6e4)}m idle`;const t=Math.floor(e/36e5),n=Math.round(e%36e5/6e4);return n>0?`${t}h${n}m idle`:`${t}h idle`}function bP(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(e<1e4?1:0)}s`;const t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return`${t}m${n}s`}function xP(e,t,n,o,r){for(const i of t){const s=(n==null?void 0:n.seq)===i.seq,a=i.erroredOut?r("accent-error",.6):i.kind==="notification"?r("accent-note",.7):i.lane==="editor-req"?r("accent-out",.7):r("accent-in",.7);e.fillStyle=s?a.replace(/0\.\d+/,"0.95"):a,e.fillRect(i.x,i.y,Math.max(i.width,2),i.height),s&&(e.strokeStyle=o("ink-primary"),e.lineWidth=1,e.strokeRect(i.x-.5,i.y-.5,Math.max(i.width,2)+1,i.height+1))}}function wP({open:e,onClose:t,onNavigateToSeq:n}){const o=ne(S=>S.messages),r=ne(S=>S.session),i=ne(S=>S.select),s=P.useRef(null),[a,l]=P.useState(1),c=P.useMemo(()=>Fd(o),[o]),f=P.useMemo(()=>sP(o,c),[o,c]),m=P.useMemo(()=>c.reduce((S,T)=>Math.max(S,T.count),0),[c]),[h,y]=P.useState("count"),[g,b]=P.useState("desc"),{rendered:v,visible:u}=of(e);P.useEffect(()=>{if(!e)return;const S=T=>{T.key==="Escape"&&(T.preventDefault(),t())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[e,t]);const p=P.useMemo(()=>CP(c,h,g),[c,h,g]),x=P.useMemo(()=>NP(c),[c]);return v?d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Performance dashboard",className:K("fixed inset-0 z-[100] flex flex-col bg-surface-base/95 backdrop-blur-sm transition-opacity duration-200 ease-out",u?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:K("flex h-full w-full flex-col transition-transform duration-200 ease-out",u?"translate-y-0":"-translate-y-2"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsxs("div",{className:"flex min-w-0 items-baseline gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Performance — per-method latency"}),r&&d.jsx("span",{className:"truncate font-mono text-[11px] text-ink-secondary",children:(()=>{const S=ql(r);let T=S.secondary;if(!r.clientName){const C=cl(o),$=C.client.title??C.client.name??null;if($){const j=S.secondary;T=j?`${$} · ${j}`:$}}return T?`${S.primary} · ${T}`:S.primary})()})]}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close performance panel",children:"close"})]}),f.length>0&&d.jsx(TP,{insights:f}),d.jsx("div",{className:"border-b border-line bg-surface-elev px-5 py-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:c.length===0?d.jsx("span",{children:"no messages — capture or load a session first"}):d.jsxs("span",{children:[x.methods," methods · ",x.requests," requests ·"," ",x.notifications," notifications · ",x.samples," latency samples"]})}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsx("div",{className:"flex-1 overflow-y-auto",children:p.length===0?null:d.jsxs("table",{className:"w-full table-fixed text-[11px]",children:[d.jsxs("colgroup",{children:[d.jsx("col",{}),d.jsx("col",{className:"w-[64px]"}),d.jsx("col",{className:"w-[88px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[120px]"})]}),d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:d.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx(cr,{sk:"method",current:h,dir:g,onSort:lr(y,b,g),className:"!pl-5",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx(cr,{sk:"count",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"count"}),d.jsx(cr,{sk:"p50",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"p50"}),d.jsx(cr,{sk:"p99",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"p99"}),d.jsx(cr,{sk:"max",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"max"}),d.jsx(cr,{sk:"total",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"total"}),d.jsx("th",{className:"py-2 pl-3 pr-5 text-right",children:"dist"})]})}),d.jsx("tbody",{className:"font-mono",children:p.map(S=>d.jsxs("tr",{className:"border-b border-line/40 transition-colors hover:bg-surface-rowHover/50",children:[d.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:S.method,children:S.method}),d.jsx("td",{className:"px-3 py-1.5 text-ink-muted",children:d.jsx(jP,{kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-primary",children:d.jsx(_P,{count:S.count,max:m,kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p50!==null?Vt(S.p50):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p99!==null?Vt(S.p99):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.max!==null?Vt(S.max):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.totalLatencyMs!==null?Vt(S.totalLatencyMs):"—"}),d.jsx("td",{className:"py-1.5 pl-3 pr-5 text-right",children:S.latencies.length>0?d.jsx(cP,{values:S.latencies,width:88,height:14,className:"text-accent-info",title:`${S.method} latency distribution`}):d.jsx("span",{className:"text-ink-dim",children:"—"})})]},`${S.kind}:${S.method}`))})]})}),o.length>0&&d.jsxs("div",{className:"flex h-[260px] shrink-0 flex-col border-t border-line bg-surface-elev",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line bg-surface-base px-5 py-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 truncate",children:[d.jsx("span",{children:"timeline — wall-clock waterfall"}),d.jsx("span",{className:"text-ink-dim",children:"· drag to pan · Cmd/Ctrl + wheel zoom · click to inspect"})]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[d.jsxs("span",{className:"text-ink-secondary",children:[a.toFixed(a<1?2:1),"×"]}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.zoomOut()},className:"inline-flex h-5 w-5 items-center justify-center rounded-sm border border-line hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Zoom out",title:"Zoom out",children:"−"}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.zoomIn()},className:"inline-flex h-5 w-5 items-center justify-center rounded-sm border border-line hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Zoom in",title:"Zoom in",children:"+"}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.reset()},className:"inline-flex h-5 items-center justify-center rounded-sm border border-line px-2 hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Reset zoom and pan",title:"Reset zoom and pan to defaults",children:"reset"})]})]}),d.jsx("div",{className:"flex-1",children:d.jsx(mP,{messages:o,controlsRef:s,onZoomChange:l,onSelectSeq:S=>{n?n(S):(i(S),t())}})})]})]})]})}):null}const SP={hotspot:"●","long-tail":"▲",outlier:"◆",busiest:"■",errors:"✗"},$P={hotspot:"text-accent-warn","long-tail":"text-accent-warn",outlier:"text-accent-warn",busiest:"text-accent-info",errors:"text-accent-error"},kP={hotspot:"hotspot","long-tail":"long tail",outlier:"outlier",busiest:"busiest",errors:"errors"};function TP({insights:e}){return d.jsxs("div",{className:"border-b border-line bg-surface-base px-5 py-2.5",children:[d.jsx("div",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"insights"}),d.jsx("ul",{className:"space-y-1.5",children:e.map(t=>d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{"aria-hidden":!0,className:K("mt-[3px] inline-block text-[9px] leading-none",$P[t.kind]),children:SP[t.kind]}),d.jsx("div",{className:"min-w-[68px] font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:kP[t.kind]}),d.jsxs("div",{className:"flex-1 text-[11px] leading-snug",children:[d.jsx("div",{className:"text-ink-primary",children:t.summary}),t.detail&&d.jsx("div",{className:"text-[10px] text-ink-muted",children:t.detail})]})]},t.kind))})]})}function _P({count:e,max:t,kind:n}){const o=t>0?e/t*100:0,r=n==="request"?"bg-accent-out/15":"bg-accent-note/15";return d.jsxs("div",{className:"relative inline-block w-[44px] text-right",children:[d.jsx("div",{"aria-hidden":!0,className:K("absolute inset-y-[1px] right-0 rounded-sm",r),style:{width:`${o}%`}}),d.jsx("span",{className:"relative",children:e})]})}function lr(e,t,n){return(o,r)=>{r?t(n==="asc"?"desc":"asc"):(e(o),t(o==="method"?"asc":"desc"))}}function cr({sk:e,current:t,dir:n,onSort:o,align:r="left",className:i,children:s}){const a=t===e;return d.jsxs("th",{className:K("cursor-pointer select-none px-3 py-2 transition-colors hover:text-ink-primary",r==="right"?"text-right":"",a?"text-ink-primary":"",i),onClick:()=>o(e,a),"aria-sort":a?n==="asc"?"ascending":"descending":"none",children:[d.jsx("span",{children:s}),a&&d.jsx("span",{className:"ml-1 text-accent-warn",children:n==="asc"?"↑":"↓"})]})}function jP({kind:e}){const t=e==="request"?"text-accent-out":"text-accent-note",n=e==="request"?"req":"ntf";return d.jsx("span",{className:K("text-[10px] uppercase tracking-widest",t),title:e,children:n})}function NP(e){let t=0,n=0,o=0;for(const r of e)r.kind==="request"?t+=r.count:n+=r.count,o+=r.sampleSize;return{methods:e.length,requests:t,notifications:n,samples:o}}function CP(e,t,n){const o=n==="asc"?1:-1,r=[...e];return r.sort((i,s)=>{const a=qh(i,t),l=qh(s,t);return a===null&&l!==null?1:a!==null&&l===null?-1:t==="method"?o*i.method.localeCompare(s.method):a===null||l===null?0:o*(a-l)}),r}function qh(e,t){switch(t){case"method":return 0;case"count":return e.count;case"p50":return e.p50;case"p99":return e.p99;case"max":return e.max;case"total":return e.totalLatencyMs}}const af=["raw.githubusercontent.com","gist.githubusercontent.com"];function Gb(e){try{return{ok:!0,export:qC(e)}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}}function EP(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:af.includes(t.host)}async function PP(e){if(!EP(e))return{ok:!1,error:`host not in playground allowlist (${af.join(", ")})`};let t;try{t=await fetch(e,{redirect:"follow"})}catch(o){return{ok:!1,error:`fetch failed: ${o instanceof Error?o.message:String(o)}`}}if(!t.ok)return{ok:!1,error:`HTTP ${t.status} ${t.statusText}`};const n=await t.text();return Gb(n)}function IP({initialUrl:e=null}){const[t,n]=P.useState(null),[o,r]=P.useState(e!==null),[i,s]=P.useState(!1),[a,l]=P.useState(""),c=P.useRef(null),f=(b,v)=>{b.ok?(ne.getState().loadFromExport(b.export),n(null)):n(`${v}: ${b.error}`),r(!1)},m=async b=>{r(!0),n(null);try{const v=await b.text();f(Gb(v),b.name)}catch(v){n(`${b.name}: ${v instanceof Error?v.message:String(v)}`),r(!1)}},h=async b=>{r(!0),n(null),f(await PP(b),b)},y=P.useRef(e);if(y.current!==null){const b=y.current;y.current=null,h(b)}const g=b=>{var u;b.preventDefault(),s(!1);const v=(u=b.dataTransfer.files)==null?void 0:u[0];v&&m(v)};return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:d.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[d.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"playground"})]}),d.jsx("h2",{className:"font-display text-2xl uppercase tracking-tight text-ink-primary",children:"Drop an exported session"}),d.jsxs("p",{className:"mt-2 font-sans text-sm leading-relaxed text-ink-secondary",children:["The playground renders ACP session exports client-side. Nothing leaves your browser. Generate exports with ",d.jsx("code",{className:"font-mono",children:"acp-devtools export <id>"})," ","— auth headers and proxy tokens are redacted by default."]}),d.jsxs("div",{role:"button",tabIndex:0,"aria-label":"Drop session export here or click to pick a file",onClick:()=>{var b;return(b=c.current)==null?void 0:b.click()},onKeyDown:b=>{var v;(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),(v=c.current)==null||v.click())},onDragOver:b=>{b.preventDefault(),s(!0)},onDragLeave:()=>s(!1),onDrop:g,className:K("mt-5 flex h-40 cursor-pointer flex-col items-center justify-center rounded-md border-2 border-dashed text-center transition-colors",i?"border-accent-out bg-accent-out/10":"border-line bg-surface-base/40 hover:border-ink-muted"),children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:o?"Loading…":"Drop .json here"}),d.jsx("span",{className:"mt-1 font-mono text-[11px] text-ink-dim",children:"or click to pick a file"}),d.jsx("input",{ref:c,type:"file",accept:".json,application/json",className:"hidden",onChange:b=>{var u;const v=(u=b.target.files)==null?void 0:u[0];v&&m(v),b.target.value=""}})]}),d.jsxs("form",{className:"mt-4 flex items-center gap-2",onSubmit:b=>{b.preventDefault();const v=a.trim();v&&h(v)},children:[d.jsx("input",{type:"url",value:a,onChange:b=>l(b.target.value),placeholder:"https://raw.githubusercontent.com/…/session.json",className:"flex-1 rounded-sm border border-line bg-surface-base px-3 py-2 font-mono text-[12px] text-ink-primary outline-none focus:border-ink-muted","aria-label":"Load session from URL"}),d.jsx("button",{type:"submit",disabled:o||a.trim().length===0,className:"rounded-sm border border-line bg-surface-base px-3 py-2 font-display text-[11px] uppercase tracking-widest text-ink-secondary transition-colors hover:border-ink-muted disabled:cursor-not-allowed disabled:opacity-50",children:"Load"})]}),d.jsxs("p",{className:"mt-2 font-mono text-[10px] leading-relaxed text-ink-dim",children:["URL allowlist: ",af.join(", "),". Gists are public — don't use this for anything you wouldn't post on Twitter."]}),t&&d.jsx("p",{className:"mt-3 font-mono text-[11px] text-accent-error",children:t})]})})}const OP=[.5,1,2,4,8];function RP(){const e=ne(h=>h.messages),t=ne(h=>h.playback),n=ne(h=>h.setPlaybackCap),o=ne(h=>h.setPlaying),r=ne(h=>h.setPlaybackSpeed),i=e.length>0?e[0].seq:0,s=e.length>0?e[e.length-1].seq:0,a=t.cap??s,l=a>=s,c=P.useRef(null);if(P.useEffect(()=>{if(!t.playing)return;if(l){o(!1);return}const h=e.findIndex(u=>u.seq===a),y=e[h+1];if(!y){o(!1);return}const g=e[h],b=g?y.timestamp-g.timestamp:0,v=Math.max(15,Math.min(1500,b/t.speed));return c.current=setTimeout(()=>{n(y.seq)},v),()=>{c.current&&(clearTimeout(c.current),c.current=null)}},[t.playing,t.speed,a,e,l,n,o]),e.length===0)return null;const f=h=>{h>=s?n(null):n(h),t.playing&&o(!1)},m=()=>{l?(n(i),o(!0)):o(!t.playing)};return d.jsxs("div",{className:"flex items-center gap-3 border-t border-line bg-surface-elev/70 px-4 py-2 font-mono text-[11px]",children:[d.jsx("button",{type:"button",onClick:m,className:K("inline-flex h-6 w-12 items-center justify-center rounded-sm border font-semibold uppercase tracking-widest transition-colors",t.playing?"border-accent-warn/50 bg-accent-warn/10 text-accent-warn":"border-accent-out/50 bg-accent-out/10 text-accent-out"),title:t.playing?"pause":l?"restart playback":"play",children:t.playing?"❚❚":l?"↺":"▶"}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-secondary",children:[String(a).padStart(3,"0")," / ",String(s).padStart(3,"0")]}),d.jsx("input",{type:"range",min:i,max:s,value:a,onChange:h=>f(Number(h.target.value)),className:"h-1 flex-1 cursor-pointer accent-accent-out"}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:OP.map(h=>d.jsxs("button",{type:"button",onClick:()=>r(h),className:K("rounded-sm border px-1.5 py-0.5 text-[10px] uppercase tracking-widest transition-colors",t.speed===h?"border-accent-out/50 bg-accent-out/10 text-accent-out":"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),title:`${h}× speed`,children:[h,"×"]},h))}),d.jsx("button",{type:"button",onClick:()=>{n(null),o(!1)},className:"rounded-sm border border-line px-2 py-0.5 text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:border-line-strong hover:text-ink-secondary",title:"show all messages, exit playback",children:"show all"})]})}function Jb(e=5e3){const[t,n]=P.useState(()=>Date.now());return P.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function AP({open:e,onClose:t}){const n=ne(a=>a.session),o=ne(a=>a.messages),r=P.useMemo(()=>cl(o),[o]),{rendered:i,visible:s}=of(e);return P.useEffect(()=>{if(!e)return;const a=l=>{l.key==="Escape"&&(l.preventDefault(),t())};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[e,t]),i?d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Session info",className:K("fixed inset-0 z-[100] flex items-start justify-end bg-black/60 backdrop-blur-sm transition-opacity duration-200 ease-out",s?"opacity-100":"opacity-0"),onMouseDown:a=>{a.target===a.currentTarget&&t()},children:d.jsxs("div",{className:K("flex h-full w-full max-w-[440px] flex-col border-l border-line bg-surface-base shadow-2xl transition-transform duration-200 ease-out",s?"translate-x-0":"translate-x-full"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Session info"}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close session info panel",children:"close"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:n?d.jsx(MP,{session:n,meta:r,messages:o}):d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"No session attached."})})]})}):null}function MP({session:e,meta:t,messages:n}){const o=Jb(5e3),{primary:r}=ql(e),i=P.useMemo(()=>UP(n),[n]);return d.jsxs("div",{className:"space-y-5 text-[12px]",children:[d.jsxs(wi,{title:"Summary",children:[d.jsx(mn,{label:"Session",value:r}),d.jsx(mn,{label:"Client",value:t.client.title||t.client.name||e.clientName||"—",secondary:t.client.version?`v${t.client.version}${t.client.platform?` · ${t.client.platform}`:""}`:null}),d.jsx(mn,{label:"Agent",value:t.agent.name||qP(e.agentCommand)||"—",secondary:t.agent.version?`v${t.agent.version}`:null}),d.jsx(mn,{label:"Protocol",value:t.protocolVersion!==null?`ACP v${t.protocolVersion}`:"—"}),d.jsx(mn,{label:"Started",value:_a(e.startedAt,o)}),d.jsx(mn,{label:"Messages",value:`${n.length} (req ${i.req} · rsp ${i.rsp} · ntf ${i.note} · err ${i.err})`})]}),d.jsxs(wi,{title:"Client capabilities",children:[d.jsx(No,{label:"fs.readTextFile",enabled:t.clientCapabilities.fsReadTextFile}),d.jsx(No,{label:"fs.writeTextFile",enabled:t.clientCapabilities.fsWriteTextFile}),d.jsx(No,{label:"terminal",enabled:t.clientCapabilities.terminal}),d.jsx(No,{label:"auth.terminal",enabled:t.clientCapabilities.authTerminal}),d.jsx(No,{label:"auth.gateway",enabled:t.clientCapabilities.authGateway})]}),d.jsxs(wi,{title:"Agent capabilities",children:[d.jsx(No,{label:"prompt",enabled:t.agentCapabilities.prompt}),d.jsx(No,{label:"loadSession",enabled:t.agentCapabilities.loadSession}),d.jsx(mn,{label:"Auth methods",value:String(t.agent.authMethods)})]}),d.jsxs(wi,{title:"Runtime state",children:[d.jsx(mn,{label:"Mode",value:t.runtime.currentMode??"—",secondary:t.runtime.modeChanges>0?`changed ${t.runtime.modeChanges}× this session`:null}),d.jsx(mn,{label:"Model",value:t.runtime.currentModel??"—",secondary:t.runtime.modelChanges>0?`changed ${t.runtime.modelChanges}× this session`:null}),d.jsx(mn,{label:"Commands",value:t.runtime.availableCommands.length>0?t.runtime.availableCommands.join(", "):"—",wrap:!0})]}),t.extensions.jetbrainsProxyConfig!==null&&d.jsx(wi,{title:"JetBrains extensions",children:d.jsx("div",{className:"rounded-sm border border-line bg-surface-elev p-3 font-mono text-[11px] text-ink-secondary",children:d.jsx(al,{value:t.extensions.jetbrainsProxyConfig})})})]})}function qP(e){if(!e)return null;const t=e.trim().split(/\s+/);if(t[0]==="npx")for(let n=1;n<t.length;n++){const o=t[n];if(!o.startsWith("-"))return o}return t[0]??null}function UP(e){let t=0,n=0,o=0,r=0;for(const i of e)i.kind==="request"?t++:i.kind==="response"?n++:i.kind==="notification"?o++:i.kind==="error"&&r++;return{req:t,rsp:n,note:o,err:r}}function wi({title:e,children:t}){return d.jsxs("div",{children:[d.jsx("h3",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("div",{className:"space-y-1.5",children:t})]})}function mn({label:e,value:t,secondary:n,wrap:o=!1}){return d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsxs("span",{className:K("flex-1 text-ink-primary",o?"whitespace-normal break-words":"truncate"),title:o?void 0:t,children:[t,n&&d.jsx("span",{className:"ml-2 text-[10px] text-ink-muted",children:n})]})]})}function No({label:e,enabled:t}){return d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:K("flex-1 font-mono text-[11px]",t?"text-accent-ok":"text-ink-dim"),children:t?"✓ enabled":"— not advertised"})]})}function LP({left:e,right:t,storageKey:n,initialLeftFraction:o=.6,minLeft:r=320,minRight:i=320}){const s=P.useRef(null),[a,l]=P.useState(null),c=P.useRef(!1);P.useEffect(()=>{if(!s.current)return;const y=s.current.clientWidth,g=n?Number(localStorage.getItem(n)):NaN;n&&Number.isFinite(g)&&g>0&&g<y?l(g):l(Math.round(y*o))},[o,n]);const f=P.useCallback(y=>{y.preventDefault(),c.current=!0,y.currentTarget.setPointerCapture(y.pointerId)},[]),m=P.useCallback(y=>{if(!c.current||!s.current)return;const g=s.current.getBoundingClientRect(),b=y.clientX-g.left,v=g.width,u=Math.min(Math.max(b,r),v-i);l(u),n&&localStorage.setItem(n,String(Math.round(u)))},[r,i,n]),h=P.useCallback(y=>{c.current=!1;try{y.currentTarget.releasePointerCapture(y.pointerId)}catch{}},[]);return d.jsxs("div",{ref:s,className:"flex h-full w-full overflow-hidden",children:[d.jsx("div",{style:{width:a??"60%"},className:"flex h-full min-w-0 flex-col",children:e}),d.jsx("div",{role:"separator","aria-orientation":"vertical",className:K("group relative w-px shrink-0 cursor-col-resize bg-line",'before:absolute before:inset-y-0 before:-left-1 before:-right-1 before:content-[""]'),onPointerDown:f,onPointerMove:m,onPointerUp:h,onPointerCancel:h,children:d.jsx("div",{className:"absolute inset-y-0 left-0 w-px bg-line transition-colors group-hover:bg-accent-out/40"})}),d.jsx("div",{className:"flex h-full min-w-0 flex-1 flex-col",children:t})]})}function DP(){const e=ne(n=>n.messages),t=P.useMemo(()=>{let n=0,o=0,r=0,i=0,s=0;const a=new Map;for(const y of e)switch(a.set(y.seq,y.timestamp),s+=y.raw.length,y.kind){case"request":n+=1;break;case"response":o+=1;break;case"notification":r+=1;break;case"error":i+=1;break}const l=Cl(e),c=[];for(const y of e){if(y.kind!=="response"&&y.kind!=="error")continue;const g=l.get(y.seq);if(g===void 0)continue;const b=a.get(g);b!==void 0&&c.push(y.timestamp-b)}c.sort((y,g)=>y-g);const f=c.length?gh(c,50):null,m=c.length?gh(c,99):null,h=HN(Zp(e));return{total:e.length,req:n,res:o,note:r,err:i,bytes:s,p50:f,p99:m,spec:h}},[e]);return d.jsxs("footer",{className:"flex items-center justify-between gap-6 border-t border-line bg-surface-elev/80 px-5 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("div",{className:"flex items-center gap-5",children:[d.jsx(Yn,{label:"msgs",value:t.total,tone:"primary"}),d.jsx(Yn,{label:"req",value:t.req,tone:"out"}),d.jsx(Yn,{label:"rsp",value:t.res,tone:"in"}),d.jsx(Yn,{label:"ntf",value:t.note,tone:"note"}),d.jsx(Yn,{label:"err",value:t.err,tone:t.err>0?"error":"muted"})]}),d.jsxs("div",{className:"flex items-center gap-5",children:[d.jsx(Yn,{label:"p50",value:t.p50!==null?Vt(t.p50):"—",tone:"primary"}),d.jsx(Yn,{label:"p99",value:t.p99!==null?Vt(t.p99):"—",tone:"primary"}),d.jsx(Yn,{label:"bytes",value:t.total>0?Ul(t.bytes):"—",tone:"primary"}),t.spec.checked>0&&d.jsx(FP,{invalidFrames:t.spec.invalidFrames,totalErrors:t.spec.totalErrors,affectedMethods:t.spec.affectedMethods}),d.jsx(zP,{})]})]})}function zP(){return d.jsxs("a",{href:"https://github.com/maksugr/acp-devtools",target:"_blank",rel:"noreferrer noopener",title:"Enjoying acp-devtools? Star it on GitHub — thank you!","aria-label":"Star acp-devtools on GitHub",className:"inline-flex items-baseline gap-1 text-ink-muted transition-colors hover:text-accent-warn focus-visible:text-accent-warn focus-visible:outline-none",children:[d.jsx("span",{"aria-hidden":"true",className:"text-[10px]",children:"★"}),d.jsx("span",{className:"text-[9px] tracking-normal",children:"Star on GitHub"})]})}function FP({invalidFrames:e,totalErrors:t,affectedMethods:n}){if(e===0)return d.jsx(ps,{label:d.jsx("span",{className:"font-sans",children:"every frame validates against the ACP schema"}),tone:"info",children:d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:"spec"}),d.jsx("span",{className:"text-accent-ok",children:"✓"})]})});const o=`${t} schema error${t===1?"":"s"} in ${e} frame${e===1?"":"s"}`;return d.jsx(ps,{tone:"warn",label:d.jsxs("div",{className:"space-y-1.5 font-sans",children:[d.jsx("div",{children:o}),n.length>0&&d.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["methods: ",n.join(", ")]})]}),children:d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:"spec"}),d.jsxs("span",{className:"text-accent-error",children:["⚠ ",e]})]})})}function Yn({label:e,value:t,tone:n}){const o=n==="primary"?"text-ink-primary":n==="out"?"text-accent-out":n==="in"?"text-accent-in":n==="note"?"text-accent-note":n==="error"?"text-accent-error":"text-ink-muted";return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:e}),d.jsx("span",{className:o,children:t})]})}const zl=0,$o=1,oi=2,Qb=4;function Uh(e){return()=>e}function BP(e){e()}function Yb(e,t){return n=>e(t(n))}function Lh(e,t){return()=>e(t)}function HP(e,t){return n=>e(t,n)}function lf(e){return e!==void 0}function VP(...e){return()=>{e.map(BP)}}function ri(){}function Fl(e,t){return t(e),e}function WP(e,t){return t(e)}function Ue(...e){return e}function $e(e,t){return e($o,t)}function me(e,t){e(zl,t)}function cf(e){e(oi)}function Le(e){return e(Qb)}function oe(e,t){return $e(e,HP(t,zl))}function cn(e,t){const n=e($o,o=>{n(),t(o)});return n}function Dh(e){let t,n;return o=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{o(t)},e)}}function Xb(e,t){return e===t}function Me(e=Xb){let t;return n=>o=>{e(t,o)||(t=o,n(o))}}function ae(e){return t=>n=>{e(n)&&t(n)}}function X(e){return t=>Yb(t,e)}function yn(e){return t=>()=>{t(e)}}function z(e,...t){const n=KP(...t);return(o,r)=>{switch(o){case oi:cf(e);return;case $o:return $e(e,n(r))}}}function Sn(e,t){return n=>o=>{n(t=e(t,o))}}function Qo(e){return t=>n=>{e>0?e--:t(n)}}function On(e){let t=null,n;return o=>r=>{t=r,!n&&(n=setTimeout(()=>{n=void 0,o(t)},e))}}function he(...e){const t=new Array(e.length);let n=0,o=null;const r=2**e.length-1;return e.forEach((i,s)=>{const a=2**s;$e(i,l=>{const c=n;n|=a,t[s]=l,c!==r&&n===r&&o&&(o(),o=null)})}),i=>s=>{const a=()=>{i([s].concat(t))};n===r?a():o=a}}function KP(...e){return t=>e.reduceRight(WP,t)}function GP(e){let t,n;const o=()=>t==null?void 0:t();return function(r,i){switch(r){case $o:return i?n===i?void 0:(o(),n=i,t=$e(e,i),t):(o(),ri);case oi:o(),n=null;return}}}function W(e){let t=e;const n=ve();return(o,r)=>{switch(o){case zl:t=r;break;case $o:{r(t);break}case Qb:return t}return n(o,r)}}function yt(e,t){return Fl(W(t),n=>oe(e,n))}function ve(){const e=[];return(t,n)=>{switch(t){case zl:e.slice().forEach(o=>{o(n)});return;case oi:e.splice(0,e.length);return;case $o:return e.push(n),()=>{const o=e.indexOf(n);o>-1&&e.splice(o,1)}}}}function Mt(e){return Fl(ve(),t=>oe(e,t))}function xe(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:JP(),singleton:n}}const JP=()=>Symbol();function QP(e){const t=new Map,n=({constructor:o,dependencies:r,id:i,singleton:s})=>{if(s&&t.has(i))return t.get(i);const a=o(r.map(l=>n(l)));return s&&t.set(i,a),a};return n(e)}function Qe(...e){const t=ve(),n=new Array(e.length);let o=0;const r=2**e.length-1;return e.forEach((i,s)=>{const a=2**s;$e(i,l=>{n[s]=l,o|=a,o===r&&me(t,n)})}),function(i,s){switch(i){case oi:{cf(t);return}case $o:return o===r&&s(n),$e(t,s)}}}function se(e,t=Xb){return z(e,Me(t))}function Bd(...e){return function(t,n){switch(t){case oi:return;case $o:return VP(...e.map(o=>$e(o,n)))}}}const nt={DEBUG:0,INFO:1,WARN:2,ERROR:3},YP={[nt.DEBUG]:"debug",[nt.ERROR]:"error",[nt.INFO]:"log",[nt.WARN]:"warn"},XP=()=>typeof globalThis>"u"?window:globalThis,ko=xe(()=>{const e=W(nt.ERROR);return{log:W((t,n,o=nt.INFO)=>{const r=XP().VIRTUOSO_LOG_LEVEL??Le(e);o>=r&&console[YP[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),Hd=new WeakMap;function Zb(e){return"self"in e?e.document.documentElement:e}function ZP(e){const t=Zb(e),n=Hd.get(t);if(n!==void 0)return n;const o=t.ownerDocument.defaultView.getComputedStyle(t).direction==="rtl";return Hd.set(t,o),o}function zh(e){Hd.delete(Zb(e))}function ex(e,t){return ZP(e)?-t:t}const Lo=ex;function Fh(e,t){return ex(e,t)}function Zo(e,t,n){return df(e,t,n).callbackRef}function df(e,t,n){const o=te.useRef(null);let r=s=>{};const i=te.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(s=>{const a=()=>{const l=s[0].target;l.offsetParent!==null&&e(l)};n?a():requestAnimationFrame(a)}):null,[e,n]);return r=s=>{s&&t?(i==null||i.observe(s),o.current=s):(o.current&&(i==null||i.unobserve(o.current)),o.current=null)},{callbackRef:r,ref:o}}function eI(e,t,n,o,r,i,s,a,l){const c=te.useCallback(f=>{const m=tI(f.children,t,a?"offsetWidth":"offsetHeight",r);let h=f.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const y=h.lastElementChild.dataset.viewportType==="window";let g;y&&(g=h.ownerDocument.defaultView);const b=s?a?s.scrollWidth:s.scrollHeight:y?a?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight:a?h.scrollWidth:h.scrollHeight,v=s?a?s.offsetWidth:s.offsetHeight:y?a?g.innerWidth:g.innerHeight:a?h.offsetWidth:h.offsetHeight,u=s?a?Lo(s,s.scrollLeft):s.scrollTop:y?a?Lo(g,g.scrollX||g.document.documentElement.scrollLeft):g.scrollY||g.document.documentElement.scrollTop:a?Lo(h,h.scrollLeft):h.scrollTop;o({scrollHeight:b,scrollTop:Math.max(u,0),viewportHeight:v}),i==null||i(a?Bh("column-gap",getComputedStyle(f).columnGap,r):Bh("row-gap",getComputedStyle(f).rowGap,r)),m!==null&&e(m)},[e,t,r,i,s,o,a]);return df(c,n,l)}function tI(e,t,n,o){const r=e.length;if(r===0)return null;const i=[];for(let s=0;s<r;s++){const a=e.item(s);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),f=t(a,n);if(f===0&&o("Zero-sized element, this should not happen",{child:a},nt.ERROR),f===c)continue;const m=i[i.length-1];i.length===0||m.size!==f||m.endIndex!==l-1?i.push({endIndex:l,size:f,startIndex:l}):i[i.length-1].endIndex++}return i}function Bh(e,t,n){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&n(`${e} was not resolved to pixel value correctly`,t,nt.WARN),t==="normal"?0:parseInt(t??"0",10)}function tx(e,t,n){const o=te.useRef(null),r=te.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),f=c.width;let m,h;if(t){const y=t.getBoundingClientRect(),g=c.top-y.top;h=y.height-Math.max(0,g),m=g+t.scrollTop}else{const y=s.current.ownerDocument.defaultView;h=y.innerHeight-Math.max(0,c.top),m=c.top+y.scrollY}o.current={listHeight:c.height,offsetTop:m,visibleHeight:h,visibleWidth:f},e(o.current)},[e,t]),{callbackRef:i,ref:s}=df(r,!0,n),a=te.useCallback(()=>{r(s.current)},[r,s]);return te.useEffect(()=>{var c;if(t){t.addEventListener("scroll",a);const f=new ResizeObserver(()=>{requestAnimationFrame(a)});return f.observe(t),()=>{t.removeEventListener("scroll",a),f.unobserve(t)}}const l=(c=s.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,t,s]),i}const kt=xe(()=>{const e=ve(),t=ve(),n=W(0),o=ve(),r=W(0),i=ve(),s=ve(),a=W(0),l=W(0),c=W(0),f=W(0),m=ve(),h=ve(),y=W(!1),g=W(!1),b=W(!1);return oe(z(e,X(({scrollTop:v})=>v)),t),oe(z(e,X(({scrollHeight:v})=>v)),s),oe(t,r),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:f,headerHeight:a,horizontalDirection:g,scrollBy:h,scrollContainerState:e,scrollHeight:s,scrollingInProgress:y,scrollTo:m,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:i}},[],{singleton:!0}),ys={lvl:0};function nx(e,t){const n=e.length;if(n===0)return[];let{index:o,value:r}=t(e[0]);const i=[];for(let s=1;s<n;s++){const{index:a,value:l}=t(e[s]);i.push({end:a-1,start:o,value:r}),o=a,r=l}return i.push({end:1/0,start:o,value:r}),i}function Te(e){return e===ys}function gs(e,t){if(!Te(e))return t===e.k?e.v:t<e.k?gs(e.l,t):gs(e.r,t)}function un(e,t,n="k"){if(Te(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const o=un(e.r,t,n);return o[0]===-1/0?[e.k,e.v]:o}return un(e.l,t,n)}function It(e,t,n){return Te(e)?ix(t,n,1):t===e.k?Ze(e,{k:t,v:n}):t<e.k?Hh(Ze(e,{l:It(e.l,t,n)})):Hh(Ze(e,{r:It(e.r,t,n)}))}function Mr(){return ys}function qr(e,t,n){if(Te(e))return[];const o=un(e,t)[0];return nI(Wd(e,o,n))}function Vd(e,t){if(Te(e))return ys;const{k:n,l:o,r}=e;if(t===n){if(Te(o))return r;if(Te(r))return o;const[i,s]=rx(o);return Na(Ze(e,{k:i,l:ox(o),v:s}))}return t<n?Na(Ze(e,{l:Vd(o,t)})):Na(Ze(e,{r:Vd(r,t)}))}function Do(e){return Te(e)?[]:[...Do(e.l),{k:e.k,v:e.v},...Do(e.r)]}function Wd(e,t,n){if(Te(e))return[];const{k:o,l:r,r:i,v:s}=e;let a=[];return o>t&&(a=a.concat(Wd(r,t,n))),o>=t&&o<=n&&a.push({k:o,v:s}),o<=n&&(a=a.concat(Wd(i,t,n))),a}function Na(e){const{l:t,lvl:n,r:o}=e;if(o.lvl>=n-1&&t.lvl>=n-1)return e;if(n>o.lvl+1){if(_c(t))return sx(Ze(e,{lvl:n-1}));if(!Te(t)&&!Te(t.r))return Ze(t.r,{l:Ze(t,{r:t.r.l}),lvl:n,r:Ze(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(_c(e))return Kd(Ze(e,{lvl:n-1}));if(!Te(o)&&!Te(o.l)){const r=o.l,i=_c(r)?o.lvl-1:o.lvl;return Ze(r,{l:Ze(e,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Kd(Ze(o,{l:r.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Ze(e,t){return ix(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function ox(e){return Te(e.r)?e.l:Na(Ze(e,{r:ox(e.r)}))}function _c(e){return Te(e)||e.lvl>e.r.lvl}function rx(e){return Te(e.r)?[e.k,e.v]:rx(e.r)}function ix(e,t,n,o=ys,r=ys){return{k:e,l:o,lvl:n,r,v:t}}function Hh(e){return Kd(sx(e))}function sx(e){const{l:t}=e;return!Te(t)&&t.lvl===e.lvl?Ze(t,{r:Ze(e,{l:t.r})}):e}function Kd(e){const{lvl:t,r:n}=e;return!Te(n)&&!Te(n.r)&&n.lvl===t&&n.r.lvl===t?Ze(n,{l:Ze(e,{r:n.l}),lvl:t+1}):e}function nI(e){return nx(e,({k:t,v:n})=>({index:t,value:n}))}function ax(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function vs(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const uf=xe(()=>({recalcInProgress:W(!1)}),[],{singleton:!0});function lx(e,t,n){return e[ul(e,t,n)]}function ul(e,t,n,o=0){let r=e.length-1;for(;o<=r;){const i=Math.floor((o+r)/2),s=e[i],a=n(s,t);if(a===0)return i;if(a===-1){if(r-o<2)return i-1;r=i-1}else{if(r===o)return i;o=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function oI(e,t,n,o){const r=ul(e,t,o),i=ul(e,n,o,r);return e.slice(r,i+1)}function bo(e,t){return Math.round(e.getBoundingClientRect()[t])}function Bl(e){return!Te(e.groupOffsetTree)}function pf({index:e},t){return t===e?0:t<e?-1:1}function rI(){return{groupIndices:[],groupOffsetTree:Mr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Mr()}}function iI(e,t){let n=Te(e)?0:1/0;for(const o of t){const{endIndex:r,size:i,startIndex:s}=o;if(n=Math.min(n,s),Te(e)){e=It(e,0,i);continue}const a=qr(e,s-1,r+1);if(a.some(pI(o)))continue;let l=!1,c=!1;for(const{end:f,start:m,value:h}of a)l?(r>=m||i===h)&&(e=Vd(e,m)):(c=h!==i,l=!0),f>r&&r>=m&&h!==i&&(e=It(e,r+1,h));c&&(e=It(e,s,i))}return[e,n]}function sI(e){return typeof e.groupIndex<"u"}function aI({offset:e},t){return t===e?0:t<e?-1:1}function bs(e,t,n){if(t.length===0)return 0;const{index:o,offset:r,size:i}=lx(t,e,pf),s=e-o,a=i*s+(s-1)*n+r;return a>0?a+n:a}function cx(e,t){if(!Bl(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function dx(e,t,n){if(sI(e))return t.groupIndices[e.groupIndex]+1;const o=e.index==="LAST"?n:e.index;let r=cx(o,t);return r=Math.max(0,r,Math.min(n,r)),r}function lI(e,t,n,o=0){return o>0&&(t=Math.max(t,lx(e,o,pf).offset)),nx(oI(e,t,n,aI),uI)}function cI(e,[t,n,o,r]){t.length>0&&o("received item sizes",t,nt.DEBUG);const i=e.sizeTree;let s=i,a=0;if(n.length>0&&Te(i)&&t.length===2){const h=t[0].size,y=t[1].size;s=n.reduce((g,b)=>It(It(g,b,h),b+1,y),s)}else[s,a]=iI(s,t);if(s===i)return e;const{lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m}=Gd(e.offsetTree,a,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,y)=>It(h,y,bs(y,m,r)),Mr()),lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m,sizeTree:s}}function dI(e){return Do(e).map(({k:t,v:n},o,r)=>{const i=r[o+1];return{endIndex:i!==void 0?i.k-1:1/0,size:n,startIndex:t}})}function Vh(e,t){let n=0,o=0;for(;n<e;)n+=t[o+1]-t[o]-1,o++;return o-(n===e?0:1)}function Gd(e,t,n,o){let r=e,i=0,s=0,a=0,l=0;if(t!==0){l=ul(r,t-1,pf),a=r[l].offset;const c=un(n,t-1);i=c[0],s=c[1],r.length&&r[l].size===un(n,t)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:c,value:f}of qr(n,t,1/0)){const m=c-i,h=m*s+a+m*o;r.push({index:c,offset:h,size:f}),i=c,a=h,s=f}return{lastIndex:i,lastOffset:a,lastSize:s,offsetTree:r}}function uI(e){return{index:e.index,value:e}}function pI(e){const{endIndex:t,size:n,startIndex:o}=e;return r=>r.start===o&&(r.end===t||r.end===1/0)&&r.value===n}const fI={offsetHeight:"height",offsetWidth:"width"},Tn=xe(([{log:e},{recalcInProgress:t}])=>{const n=ve(),o=ve(),r=yt(o,0),i=ve(),s=ve(),a=W(0),l=W([]),c=W(void 0),f=W(void 0),m=W(void 0),h=W(void 0),y=W(($,j)=>bo($,fI[j])),g=W(void 0),b=W(0),v=rI(),u=yt(z(n,he(l,e,b),Sn(cI,v),Me()),v),p=yt(z(l,Me(),Sn(($,j)=>({current:j,prev:$.current}),{current:[],prev:[]}),X(({prev:$})=>$)),[]);oe(z(l,ae($=>$.length>0),he(u,b),X(([$,j,R])=>{const M=$.reduce((F,V,L)=>It(F,V,bs(V,j.offsetTree,R)||L),Mr());return{...j,groupIndices:$,groupOffsetTree:M}})),u),oe(z(o,he(u),ae(([$,{lastIndex:j}])=>$<j),X(([$,{lastIndex:j,lastSize:R}])=>[{endIndex:j,size:R,startIndex:$}])),n),oe(c,f);const x=yt(z(c,X($=>$===void 0)),!0);oe(z(f,ae($=>$!==void 0&&Te(Le(u).sizeTree)),X($=>{const j=Le(m),R=Le(l).length>0;return j!==void 0&&j!==0?R?[{endIndex:0,size:j,startIndex:0},{endIndex:1,size:$,startIndex:1}]:[]:[{endIndex:0,size:$,startIndex:0}]})),n),oe(z(h,ae($=>$!==void 0&&$.length>0&&Te(Le(u).sizeTree)),X($=>{const j=[];let R=$[0],M=0;for(let F=1;F<$.length;F++){const V=$[F];V!==R&&(j.push({endIndex:F-1,size:R,startIndex:M}),R=V,M=F)}return j.push({endIndex:$.length-1,size:R,startIndex:M}),j})),n),oe(z(l,he(m,f),ae(([,$,j])=>$!==void 0&&j!==void 0),X(([$,j,R])=>{const M=[];for(let F=0;F<$.length;F++){const V=$[F],L=$[F+1];M.push({startIndex:V,endIndex:V,size:j}),L!==void 0&&M.push({startIndex:V+1,endIndex:L-1,size:R})}return M})),n);const S=Mt(z(n,he(u),Sn(({sizes:$},[j,R])=>({changed:R!==$,sizes:R}),{changed:!1,sizes:v}),X($=>$.changed)));$e(z(a,Sn(($,j)=>({diff:$.prev-j,prev:j}),{diff:0,prev:0}),X($=>$.diff)),$=>{const{groupIndices:j}=Le(u);if($>0)me(t,!0),me(i,$+Vh($,j));else if($<0){const R=Le(p);R.length>0&&($-=Vh(-$,R)),me(s,$)}}),$e(z(a,he(e)),([$,j])=>{$<0&&j("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},nt.ERROR)});const T=Mt(i);oe(z(i,he(u),X(([$,j])=>{const R=j.groupIndices.length>0,M=[],F=j.lastSize;if(R){const V=gs(j.sizeTree,0);let L=0,U=0;for(;L<$;){const Q=j.groupIndices[U],ee=j.groupIndices.length===U+1?1/0:j.groupIndices[U+1]-Q-1;M.push({endIndex:Q,size:V,startIndex:Q}),M.push({endIndex:Q+1+ee-1,size:F,startIndex:Q+1}),U++,L+=ee+1}const D=Do(j.sizeTree);return L!==$&&D.shift(),D.reduce((Q,{k:ee,v:q})=>{let G=Q.ranges;return Q.prevSize!==0&&(G=[...Q.ranges,{endIndex:ee+$-1,size:Q.prevSize,startIndex:Q.prevIndex}]),{prevIndex:ee+$,prevSize:q,ranges:G}},{prevIndex:$,prevSize:0,ranges:M}).ranges}return Do(j.sizeTree).reduce((V,{k:L,v:U})=>({prevIndex:L+$,prevSize:U,ranges:[...V.ranges,{endIndex:L+$-1,size:V.prevSize,startIndex:V.prevIndex}]}),{prevIndex:0,prevSize:F,ranges:[]}).ranges})),n);const C=Mt(z(s,he(u,b),X(([$,{offsetTree:j},R])=>{const M=-$;return bs(M,j,R)})));return oe(z(s,he(u,b),X(([$,j,R])=>{if(j.groupIndices.length>0){if(Te(j.sizeTree))return j;let F=Mr();const V=Le(p);let L=0,U=0,D=0;for(;L<-$;){D=V[U];const Q=V[U+1]-D-1;U++,L+=Q+1}if(F=Do(j.sizeTree).reduce((Q,{k:ee,v:q})=>It(Q,Math.max(0,ee+$),q),F),L!==-$){const Q=gs(j.sizeTree,D);F=It(F,0,Q);const ee=un(j.sizeTree,-$+1)[1];F=It(F,1,ee)}return{...j,sizeTree:F,...Gd(j.offsetTree,0,F,R)}}const M=Do(j.sizeTree).reduce((F,{k:V,v:L})=>It(F,Math.max(0,V+$),L),Mr());return{...j,sizeTree:M,...Gd(j.offsetTree,0,M,R)}})),u),{beforeUnshiftWith:T,data:g,defaultItemSize:f,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:m,gap:b,groupIndices:l,heightEstimates:h,itemSize:y,listRefresh:S,shiftWith:s,shiftWithOffset:C,sizeRanges:n,sizes:u,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:i}},Ue(ko,uf),{singleton:!0});function mI(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const ux=xe(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const i=ve(),s=ve(),a=Mt(z(i,X(mI)));return oe(z(a,X(l=>l.totalCount)),n),oe(z(a,X(l=>l.groupIndices)),e),oe(z(Qe(r,t,o),ae(([l,c])=>Bl(c)),X(([l,c,f])=>un(c.groupOffsetTree,Math.max(l-f,0),"v")[0]),Me(),X(l=>[l])),s),{groupCounts:i,topItemsIndexes:s}},Ue(Tn,kt)),To=xe(([{log:e}])=>{const t=W(!1),n=Mt(z(t,ae(o=>o),Me()));return $e(t,o=>{o&&Le(e)("props updated",{},nt.DEBUG)}),{didMount:n,propsReady:t}},Ue(ko),{singleton:!0}),hI=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function px(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!hI)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const Ps=xe(([{gap:e,listRefresh:t,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:i,footerHeight:s,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:f,viewportHeight:m},{log:h}])=>{const y=ve(),g=ve(),b=W(0);let v=null,u=null,p=null;function x(){v!==null&&(v(),v=null),p!==null&&(p(),p=null),u&&(clearTimeout(u),u=null),me(l,!1)}return oe(z(y,he(n,m,o,b,a,s,h),he(e,i,r),X(([[S,T,C,$,j,R,M,F],V,L,U])=>{const D=px(S),{align:Q,behavior:ee,offset:q}=D,G=$-1,I=dx(D,T,G);let _=bs(I,T.offsetTree,V)+R;Q==="end"?(_+=L+un(T.sizeTree,I)[1]-C+U,I===G&&(_+=M)):Q==="center"?_+=(L+un(T.sizeTree,I)[1]-C+U)/2:_-=j,q!==void 0&&q!==0&&(_+=q);const A=E=>{x(),E?(F("retrying to scroll to",{location:S},nt.DEBUG),me(y,S)):(me(g,!0),F("list did not change, scroll successful",{},nt.DEBUG))};if(x(),ee==="smooth"){let E=!1;p=$e(t,w=>{E=E||w}),v=cn(f,()=>{A(E)})}else v=cn(z(t,yI(150)),A);return u=setTimeout(()=>{x()},1200),me(l,!0),F("scrolling from index to",{behavior:ee,index:I,top:_},nt.DEBUG),{behavior:ee,top:_}})),c),{scrollTargetReached:g,scrollToIndex:y,topListHeight:b}},Ue(Tn,kt,ko),{singleton:!0});function yI(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return o=>{o&&(t(!0),clearTimeout(n))}}}function ff(e,t){e===0?t():requestAnimationFrame(()=>{ff(e-1,t)})}function mf(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Is=xe(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:i},{didMount:s}])=>{const a=W(!0),l=W(0),c=W(!0);return oe(z(s,he(l),ae(([f,m])=>m!==0),yn(!1)),a),oe(z(s,he(l),ae(([f,m])=>m!==0),yn(!1)),c),$e(z(Qe(t,s),he(a,n,e,c),ae(([[,f],m,{sizeTree:h},y,g])=>f&&(!Te(h)||lf(y))&&!m&&!g),he(l)),([,f])=>{cn(r,()=>{me(c,!0)}),ff(4,()=>{cn(o,()=>{me(a,!0)}),me(i,f)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},Ue(Tn,kt,Ps,To),{singleton:!0});function fx(e,t){return Math.abs(e-t)<1.01}const xs="up",Bi="down",gI="none",vI={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},bI=0,Os=xe(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:i}])=>{const s=W(!1),a=W(!0),l=ve(),c=ve(),f=W(4),m=W(bI),h=yt(z(Bd(z(se(r),Qo(1),yn(!0)),z(se(r),Qo(1),yn(!1),Dh(100))),Me()),!1),y=yt(z(Bd(z(n,yn(!0)),z(n,yn(!1),Dh(200))),Me()),!1);oe(z(Qe(se(r),se(m)),X(([p,x])=>p<=x),Me()),a),oe(z(a,On(50)),c);const g=Mt(z(Qe(o,se(i),se(t),se(e),se(f)),Sn((p,[{scrollHeight:x,scrollTop:S},T,C,$,j])=>{const R=S+T-x>-j,M={scrollHeight:x,scrollTop:S,viewportHeight:T};if(R){let V,L;return S>p.state.scrollTop?(V="SCROLLED_DOWN",L=p.state.scrollTop-S):(V="SIZE_DECREASED",L=p.state.scrollTop-S||p.scrollTopDelta),{atBottom:!0,atBottomBecause:V,scrollTopDelta:L,state:M}}let F;return M.scrollHeight>p.state.scrollHeight?F="SIZE_INCREASED":T<p.state.viewportHeight?F="VIEWPORT_HEIGHT_DECREASING":S<p.state.scrollTop?F="SCROLLING_UPWARDS":F="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:F,state:M}},vI),Me((p,x)=>p!==void 0&&p.atBottom===x.atBottom))),b=yt(z(o,Sn((p,{scrollHeight:x,scrollTop:S,viewportHeight:T})=>{if(!fx(p.scrollHeight,x)){const C=x-(S+T)<1;return p.scrollTop!==S&&C?{changed:!0,jump:p.scrollTop-S,scrollHeight:x,scrollTop:S}:{changed:!0,jump:0,scrollHeight:x,scrollTop:S}}return{changed:!1,jump:0,scrollHeight:x,scrollTop:S}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ae(p=>p.changed),X(p=>p.jump)),0);oe(z(g,X(p=>p.atBottom)),s),oe(z(s,On(50)),l);const v=W(Bi);oe(z(o,X(({scrollTop:p})=>p),Me(),Sn((p,x)=>Le(y)?{direction:p.direction,prevScrollTop:x}:{direction:x<p.prevScrollTop?xs:Bi,prevScrollTop:x},{direction:Bi,prevScrollTop:0}),X(p=>p.direction)),v),oe(z(o,On(50),yn(gI)),v);const u=W(0);return oe(z(h,ae(p=>!p),yn(0)),u),oe(z(r,On(100),he(h),ae(([p,x])=>x),Sn(([p,x],[S])=>[x,S],[0,0]),X(([p,x])=>x-p)),u),{atBottomState:g,atBottomStateChange:l,atBottomThreshold:f,atTopStateChange:c,atTopThreshold:m,isAtBottom:s,isAtTop:a,isScrolling:h,lastJumpDueToItemResize:b,scrollDirection:v,scrollVelocity:u}},Ue(kt)),ws="top",Ss="bottom",Wh="none";function Kh(e,t,n){return typeof e=="number"?n===xs&&t===ws||n===Bi&&t===Ss?e:0:n===xs?t===ws?e.main:e.reverse:t===Ss?e.main:e.reverse}function Gh(e,t){return typeof e=="number"?e:e[t]??0}const hf=xe(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const i=ve(),s=W(0),a=W(0),l=W(0),c=yt(z(Qe(se(o),se(r),se(n),se(i,vs),se(l),se(s),se(t),se(e),se(a)),X(([f,m,h,[y,g],b,v,u,p,x])=>{const S=f-p,T=v+u,C=Math.max(h-S,0);let $=Wh;const j=Gh(x,ws),R=Gh(x,Ss);return y-=p,y+=h+u,g+=h+u,g-=p,y>f+T-j&&($=xs),g<f-C+m+R&&($=Bi),$!==Wh?[Math.max(S-h-Kh(b,ws,$)-j,0),S-C-u+m+Kh(b,Ss,$)+R]:null}),ae(f=>f!==null),Me(vs)),[0,0]);return{increaseViewportBy:a,listBoundary:i,overscan:l,topListHeight:s,visibleRange:c}},Ue(kt),{singleton:!0});function xI(e,t,n){if(Bl(t)){const o=cx(e,t);return[{index:un(t.groupOffsetTree,o)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:o,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const jc={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ca(e,t,n,o,r,i){const{lastIndex:s,lastOffset:a,lastSize:l}=r;let c=0,f=0;if(e.length>0){c=e[0].offset;const b=e[e.length-1];f=b.offset+b.size}const m=n-s,h=a+m*l+(m-1)*o,y=c,g=h-f;return{bottom:f,firstItemIndex:i,items:Jh(e,r,i),offsetBottom:g,offsetTop:c,top:y,topItems:Jh(t,r,i),topListHeight:t.reduce((b,v)=>v.size+b,0),totalCount:n}}function mx(e,t,n,o,r,i){let s=0;if(n.groupIndices.length>0)for(const f of n.groupIndices){if(f-s>=e)break;s++}const a=e+s,l=mf(t,a),c=Array.from({length:a}).map((f,m)=>({data:i[m+l],index:m+l,offset:0,size:0}));return Ca(c,[],a,r,n,o)}function Jh(e,t,n){if(e.length===0)return[];if(!Bl(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const o=e[0].index,r=e[e.length-1].index,i=[],s=qr(t.groupOffsetTree,o,r);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=s.shift(),l=t.groupIndices.indexOf(a.start));let f;c.index===a.start?f={index:l,type:"group"}:f={groupIndex:l,index:c.index-(l+1)+n},i.push({...f,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}function Qh(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const er=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o,totalCount:r},i,{listBoundary:s,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:f},{topListHeight:m},h,{didMount:y},{recalcInProgress:g}])=>{const b=W([]),v=W(0),u=ve(),p=W(0);oe(i.topItemsIndexes,b);const x=yt(z(Qe(y,g,se(l,vs),se(r),se(o),se(c),f,se(b),se(t),se(n),se(p),e),ae(([$,j,,R,,,,,,,,M])=>{const F=M!==void 0&&M.length!==R;return $&&!j&&!F}),X(([,,[$,j],R,M,F,V,L,U,D,Q,ee])=>{var Y,ie;const q=M,{offsetTree:G,sizeTree:I}=q,_=Le(v);if(R===0)return{...jc,totalCount:R};if($===0&&j===0)return _===0?{...jc,totalCount:R}:mx(_,F,M,U,D,ee||[]);if(Te(I))return _>0?null:Ca(xI(mf(F,R),q,ee),[],R,D,q,U);const A=[];if(L.length>0){const de=L[0],we=L[L.length-1];let ze=0;for(const Ee of qr(I,de,we)){const Se=Ee.value,_e=Math.max(Ee.start,de),Ye=Math.min(Ee.end,we);for(let Pe=_e;Pe<=Ye;Pe++)A.push({data:ee==null?void 0:ee[Pe],index:Pe,offset:ze,size:Se}),ze+=Se}}if(!V)return Ca([],A,R,D,q,U);const E=L.length>0?L[L.length-1]+1:0,w=lI(G,$,j,E);if(w.length===0)return null;const k=R-1,N=Fl([],de=>{for(const we of w){const ze=we.value;let Ee=ze.offset,Se=we.start;const _e=ze.size;if(ze.offset<$){Se+=Math.floor(($-ze.offset+D)/(_e+D));const Pe=Se-we.start;Ee+=Pe*_e+Pe*D}Se<E&&(Ee+=(E-Se)*_e,Se=E);const Ye=Math.min(we.end,k);for(let Pe=Se;Pe<=Ye&&!(Ee>=j);Pe++)de.push({data:ee==null?void 0:ee[Pe],index:Pe,offset:Ee,size:_e}),Ee+=_e+D}}),B=Qh(Q,ws),O=Qh(Q,Ss);if(N.length>0&&(B>0||O>0)){const de=N[0],we=N[N.length-1];if(B>0&&de.index>E){const ze=Math.min(B,de.index-E),Ee=[];let Se=de.offset;for(let _e=de.index-1;_e>=de.index-ze;_e--){const Ye=((Y=qr(I,_e,_e)[0])==null?void 0:Y.value)??de.size;Se-=Ye+D,Ee.unshift({data:ee==null?void 0:ee[_e],index:_e,offset:Se,size:Ye})}N.unshift(...Ee)}if(O>0&&we.index<k){const ze=Math.min(O,k-we.index);let Ee=we.offset+we.size+D;for(let Se=we.index+1;Se<=we.index+ze;Se++){const _e=((ie=qr(I,Se,Se)[0])==null?void 0:ie.value)??we.size;N.push({data:ee==null?void 0:ee[Se],index:Se,offset:Ee,size:_e}),Ee+=_e+D}}}return Ca(N,A,R,D,q,U)}),ae($=>$!==null),Me()),jc);oe(z(e,ae(lf),X($=>$==null?void 0:$.length)),r),oe(z(x,X($=>$.topListHeight)),m),oe(m,a),oe(z(x,X($=>[$.top,$.bottom])),s),oe(z(x,X($=>$.items)),u);const S=Mt(z(x,ae(({items:$})=>$.length>0),he(r,e),ae(([{items:$},j])=>$[$.length-1].originalIndex===j-1),X(([,$,j])=>[$-1,j]),Me(vs),X(([$])=>$))),T=Mt(z(x,On(200),ae(({items:$,topItems:j})=>$.length>0&&$[0].originalIndex===j.length),X(({items:$})=>$[0].index),Me())),C=Mt(z(x,ae(({items:$})=>$.length>0),X(({items:$})=>{let j=0,R=$.length-1;for(;$[j].type==="group"&&j<R;)j++;for(;$[R].type==="group"&&R>j;)R--;return{endIndex:$[R].index,startIndex:$[j].index}}),Me(ax)));return{endReached:S,initialItemCount:v,itemsRendered:u,listState:x,minOverscanItemCount:p,rangeChanged:C,startReached:T,topItemsIndexes:b,...h}},Ue(Tn,ux,hf,Is,Ps,Os,To,uf),{singleton:!0}),hx=xe(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:o},{listState:r}])=>{const i=ve(),s=yt(z(Qe(n,e,o,t,r),X(([a,l,c,f,m])=>a+l+c+f+m.offsetBottom+m.bottom)),0);return oe(se(s),i),{totalListHeight:s,totalListHeightChanged:i}},Ue(kt,er),{singleton:!0}),wI=xe(([{viewportHeight:e},{totalListHeight:t}])=>{const n=W(!1),o=yt(z(Qe(n,e,t),ae(([r])=>r),X(([,r,i])=>Math.max(0,r-i)),On(0),Me()),0);return{alignToBottom:n,paddingTopAddition:o}},Ue(kt,hx),{singleton:!0}),yx=xe(()=>({context:W(null)})),SI=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:o,...r},viewportBottom:i,viewportTop:s})=>t<s?{...r,align:n??"start",...o!==void 0?{behavior:o}:{}}:e>i?{...r,align:n??"end",...o!==void 0?{behavior:o}:{}}:null,gx=xe(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:i,scrollingInProgress:s,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const f=ve();return oe(z(f,he(t,l,n,i,r,o,a),he(e),X(([[m,h,y,g,b,v,u,p],x])=>{const{calculateViewLocation:S=SI,done:T,...C}=m,$=dx(m,h,g-1),j=bs($,h.offsetTree,x)+b+v,R=j+un(h.sizeTree,$)[1],M=p+v,F=p+y-u,V=S({itemBottom:R,itemTop:j,locationParams:C,viewportBottom:F,viewportTop:M});return V!==null?T&&cn(z(s,ae(L=>!L),Qo(Le(s)?1:2)),T):T==null||T(),V}),ae(m=>m!==null)),c),{scrollIntoView:f}},Ue(Tn,kt,Ps,er,ko),{singleton:!0});function Yh(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const $I=(e,t)=>typeof e=="function"?Yh(e(t)):t&&Yh(e),kI=xe(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:i},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:f},{scrollingInProgress:m},{context:h},{scrollIntoView:y}])=>{const g=W(!1),b=ve();let v=null;function u(T){me(s,{align:"end",behavior:T,index:"LAST"})}$e(z(Qe(z(se(t),Qo(1)),l),he(se(g),i,a,m),X(([[T,C],$,j,R,M])=>{let F=C&&R,V="auto";return F&&(V=$I($,j||M),F=F&&V!==!1),{followOutputBehavior:V,shouldFollow:F,totalCount:T}}),ae(({shouldFollow:T})=>T)),({followOutputBehavior:T,totalCount:C})=>{v!==null&&(v(),v=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("following output to ",{totalCount:C},nt.DEBUG),u(T)}):v=cn(e,()=>{Le(f)("following output to ",{totalCount:C},nt.DEBUG),u(T),v=null})});function p(T){const C=cn(r,$=>{T&&!$.atBottom&&$.notAtBottomBecause==="SIZE_INCREASED"&&v===null&&(Le(f)("scrolling to bottom due to increased size",{},nt.DEBUG),u("auto"))});setTimeout(C,100)}$e(z(Qe(se(g),t,c),ae(([T,,C])=>T!==!1&&C),Sn(({value:T},[,C])=>({refreshed:T===C,value:C}),{refreshed:!1,value:0}),ae(({refreshed:T})=>T),he(g,t)),([,T])=>{Le(a)&&p(T!==!1)}),$e(b,()=>{p(Le(g)!==!1)}),$e(Qe(se(g),r),([T,C])=>{T!==!1&&!C.atBottom&&C.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&u("auto")});const x=W(null),S=ve();return oe(Bd(z(se(o),X(T=>(T==null?void 0:T.length)??0)),z(se(t))),S),$e(z(Qe(z(S,Qo(1)),l),he(se(x),a,m,h),X(([[T,C],$,j,R,M])=>C&&j&&($==null?void 0:$({context:M,totalCount:T,scrollingInProgress:R}))),ae(T=>!!T),On(0)),T=>{v!==null&&(v(),v=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("scrolling into view",{}),me(y,T)}):v=cn(e,()=>{Le(f)("scrolling into view",{}),me(y,T),v=null})}),{autoscrollToBottom:b,followOutput:g,scrollIntoViewOnChange:x}},Ue(Tn,Os,Ps,Is,To,ko,kt,yx,gx)),TI=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:i,listState:s},{didMount:a}])=>(oe(z(a,he(i),ae(([,l])=>l!==0),he(r,o,t,n,e),X(([[,l],c,f,m,h,y=[]])=>mx(l,c,f,m,h,y))),s),{}),Ue(Tn,Is,er,To),{singleton:!0}),_I=xe(([{didMount:e},{scrollTo:t},{listState:n}])=>{const o=W(0);return $e(z(e,he(o),ae(([,r])=>r!==0),X(([,r])=>({top:r}))),r=>{cn(z(n,Qo(1),ae(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{me(t,r)})})}),{initialScrollTop:o}},Ue(To,kt,er),{singleton:!0}),vx=xe(([{scrollVelocity:e}])=>{const t=W(!1),n=ve(),o=W(!1);return oe(z(e,he(o,t,n),ae(([r,i])=>i!==!1&&i!==void 0),X(([r,i,s,a])=>{const{enter:l,exit:c}=i;if(s){if(c(r,a))return!1}else if(l(r,a))return!0;return s}),Me()),t),$e(z(Qe(t,e,n),he(o)),([[r,i,s],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(i,s)}),{isSeeking:t,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:e}},Ue(Os),{singleton:!0}),yf=xe(([{scrollContainerState:e,scrollTo:t}])=>{const n=ve(),o=ve(),r=ve(),i=W(!1),s=W(void 0);return oe(z(Qe(n,o),X(([{scrollTop:a,viewportHeight:l},{offsetTop:c,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,a-c),viewportHeight:l}))),e),oe(z(t,he(o),X(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:s,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},Ue(kt)),jI=xe(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=ve(),f=W(void 0),m=W(null),h=W(null);return oe(a,m),oe(l,h),$e(z(c,he(t,o,s,m,h,n)),([y,g,b,v,u,p,x])=>{const S=dI(g.sizeTree);v&&u!==null&&p!==null&&(b=u.scrollTop-p.offsetTop),b-=x,y({ranges:S,scrollTop:b})}),oe(z(f,ae(lf),X(NI)),r),oe(z(i,he(f),ae(([,y])=>y!==void 0),Me(),X(([,y])=>y.ranges)),e),{getState:c,restoreStateFrom:f}},Ue(Tn,kt,Is,To,yf));function NI(e){return{align:"start",index:0,offset:e.scrollTop}}const CI=xe(([{topItemsIndexes:e}])=>{const t=W(0);return oe(z(t,ae(n=>n>=0),X(n=>Array.from({length:n}).map((o,r)=>r))),e),{topItemCount:t}},Ue(er));function bx(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const EI=bx(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),PI=xe(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:i,lastJumpDueToItemResize:s,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:f,shiftWithOffset:m,sizes:h},{log:y},{recalcInProgress:g}])=>{const b=Mt(z(l,he(s),Sn(([,u,p,x],[{bottom:S,items:T,offsetBottom:C,totalCount:$},j])=>{const R=S+C;let M=0;return p===$&&u.length>0&&T.length>0&&(T[0].originalIndex===0&&u[0].originalIndex===0||(M=R-x,M!==0&&(M+=j))),[M,T,$,R]},[0,[],0,0]),ae(([u])=>u!==0),he(o,a,n,r,y,g),ae(([,u,p,x,,,S])=>!S&&!x&&u!==0&&p===xs),X(([[u],,,,,p])=>(p("Upward scrolling compensation",{amount:u},nt.DEBUG),u))));function v(u){u>0?(me(t,{behavior:"auto",top:-u}),me(e,0)):(me(e,0),me(t,{behavior:"auto",top:-u}))}return $e(z(b,he(e,i)),([u,p,x])=>{x&&EI()?me(e,p-u):v(-u)}),$e(z(Qe(yt(i,!1),e,g),ae(([u,p,x])=>!u&&!x&&p!==0),X(([u,p])=>p),On(1)),v),oe(z(m,X(u=>({top:-u}))),t),$e(z(c,he(h,f),X(([u,{groupIndices:p,lastSize:x,sizeTree:S},T])=>{function C(F){return F*(x+T)}if(p.length===0)return C(u);let $=0;const j=gs(S,0);let R=0,M=0;for(;R<u;){R++,$+=j;let F=p.length===M+1?1/0:p[M+1]-p[M]-1;R+F>u&&($-=j,F=u-R+1),R+=F,$+=C(F),M++}return $})),u=>{me(e,u),requestAnimationFrame(()=>{me(t,{top:u}),requestAnimationFrame(()=>{me(e,0),me(g,!1)})})}),{deviation:e}},Ue(kt,Os,er,Tn,ko,uf)),II=xe(([e,t,n,o,r,i,s,a,l,c,f])=>({...e,...t,...n,...o,...r,...i,...s,...a,...l,...c,...f}),Ue(hf,TI,To,vx,hx,_I,wI,yf,gx,ko,yx)),xx=xe(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:i,groupIndices:s,heightEstimates:a,itemSize:l,sizeRanges:c,sizes:f,statefulTotalCount:m,totalCount:h,trackItemSizes:y},{initialItemFinalLocationReached:g,initialTopMostItemIndex:b,scrolledToInitialItem:v},u,p,x,S,{scrollToIndex:T},C,{topItemCount:$},{groupCounts:j},R])=>{const{listState:M,minOverscanItemCount:F,topItemsIndexes:V,rangeChanged:L,...U}=S;return oe(L,R.scrollSeekRangeChanged),oe(z(R.windowViewportRect,X(D=>D.visibleHeight)),u.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:i,groupCounts:j,heightEstimates:a,initialItemFinalLocationReached:g,initialTopMostItemIndex:b,scrolledToInitialItem:v,sizeRanges:c,topItemCount:$,topItemsIndexes:V,totalCount:h,...x,groupIndices:s,itemSize:l,listState:M,minOverscanItemCount:F,scrollToIndex:T,statefulTotalCount:m,trackItemSizes:y,rangeChanged:L,...U,...R,...u,sizes:f,...p}},Ue(Tn,Is,kt,jI,kI,er,Ps,PI,CI,ux,II));function OI(e,t){const n={},o={};let r=0;const i=e.length;for(;r<i;)o[e[r]]=1,r+=1;for(const s in t)Object.hasOwn(o,s)||(n[s]=t[s]);return n}const ra=typeof document<"u"?te.useLayoutEffect:te.useEffect;function wx(e,t,n){const o=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),i=Object.keys(t.methods||{}),s=Object.keys(t.events||{}),a=te.createContext({});function l(v,u){v.propsReady!==void 0&&me(v.propsReady,!1);for(const p of o){const x=v[t.required[p]];me(x,u[p])}for(const p of r)if(p in u){const x=v[t.optional[p]];me(x,u[p])}v.propsReady!==void 0&&me(v.propsReady,!0)}function c(v){return i.reduce((u,p)=>(u[p]=x=>{const S=v[t.methods[p]];me(S,x)},u),{})}function f(v){return s.reduce((u,p)=>(u[p]=GP(v[t.events[p]]),u),{})}const m=te.forwardRef(function(v,u){const{children:p,...x}=v,[S]=te.useState(()=>Fl(QP(e),$=>{l($,x)})),[T]=te.useState(Lh(f,S));ra(()=>{for(const $ of s)$ in x&&$e(T[$],x[$]);return()=>{Object.values(T).map(cf)}},[x,T,S]),ra(()=>{l(S,x)}),te.useImperativeHandle(u,Uh(c(S)));const C=n;return d.jsx(a.Provider,{value:S,children:n!==void 0?d.jsx(C,{...OI([...o,...r,...s],x),children:p}):p})}),h=v=>{const u=te.useContext(a);return te.useCallback(p=>{me(u[v],p)},[u,v])},y=v=>{const u=te.useContext(a)[v],p=te.useCallback(x=>$e(u,x),[u]);return te.useSyncExternalStore(p,()=>Le(u),()=>Le(u))},g=v=>{const u=te.useContext(a)[v],[p,x]=te.useState(Lh(Le,u));return ra(()=>$e(u,S=>{S!==p&&x(Uh(S))}),[u,p]),p},b=parseInt(te.version)>=18?y:g;return{Component:m,useEmitter:(v,u)=>{const p=te.useContext(a)[v];ra(()=>$e(p,u),[u,p])},useEmitterValue:b,usePublisher:h}}const Sx=te.createContext(void 0),$x=te.createContext(void 0),Nc="-webkit-sticky",Xh="sticky",gf=bx(()=>{if(typeof document>"u")return Xh;const e=document.createElement("div");return e.style.position=Nc,e.style.position===Nc?Nc:Xh}),kx=typeof document<"u"?te.useLayoutEffect:te.useEffect;function Cc(e){return"self"in e}function RI(e){return"body"in e}function Tx(e,t,n,o=ri,r,i){const s=te.useRef(null),a=te.useRef(null),l=te.useRef(null),c=te.useCallback(h=>{let y,g,b;const v=h.target;if(RI(v)||Cc(v)){const p=Cc(v)?v:v.defaultView;b=i===!0?Lo(p,p.scrollX):p.scrollY,y=i===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight,g=i===!0?p.innerWidth:p.innerHeight}else b=i===!0?Lo(v,v.scrollLeft):v.scrollTop,y=i===!0?v.scrollWidth:v.scrollHeight,g=i===!0?v.offsetWidth:v.offsetHeight;const u=()=>{e({scrollHeight:y,scrollTop:Math.max(b,0),viewportHeight:g})};h.suppressFlushSync===!0?u():iS.flushSync(u),a.current!==null&&(b===a.current||b<=0||b===y-g)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);te.useEffect(()=>{const h=r||s.current;return zh(h),o(r||s.current),c({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",c,{passive:!0}),()=>{zh(h),o(null),h.removeEventListener("scroll",c)}},[s,c,n,o,r]);function f(h){const y=s.current;if(!y||(i===!0?"offsetWidth"in y&&y.offsetWidth===0:"offsetHeight"in y&&y.offsetHeight===0))return;const g=h.behavior==="smooth";let b,v,u;Cc(y)?(v=Math.max(bo(y.document.documentElement,i===!0?"width":"height"),i===!0?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight),b=i===!0?y.innerWidth:y.innerHeight,u=i===!0?Lo(y,y.scrollX):y.scrollY):(v=y[i===!0?"scrollWidth":"scrollHeight"],b=bo(y,i===!0?"width":"height"),u=i===!0?Lo(y,y.scrollLeft):y.scrollTop);const p=v-b;if(h.top===void 0){y.scrollTo(h);return}const x=Math.ceil(Math.max(Math.min(p,h.top),0));if(h.top=x,fx(b,v)||x===u){e({scrollHeight:v,scrollTop:u,viewportHeight:b}),g&&t(!0);return}g?(a.current=x,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,i===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},left:Fh(y,x)}),y.scrollTo(h)}function m(h){i===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},...h.top!==void 0?{left:Fh(s.current,h.top)}:{}}),s.current.scrollBy(h)}return{scrollByCallback:m,scrollerRef:s,scrollToCallback:f}}function vf(e){return e}const AI=xe(()=>{const e=W(a=>`Item ${a}`),t=W(a=>`Group ${a}`),n=W({}),o=W(vf),r=W("div"),i=W(ri),s=(a,l=null)=>yt(z(n,X(c=>c[a]),Me()),l);return{components:n,computeItemKey:o,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:r,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),MI=xe(([e,t])=>({...e,...t}),Ue(xx,AI)),qI=({height:e})=>d.jsx("div",{style:{height:e}}),UI={overflowAnchor:"none",position:gf(),zIndex:1},_x={overflowAnchor:"none"},LI={..._x,display:"inline-block",height:"100%"},Zh=te.memo(function({showTopList:e=!1}){const t=ce("listState"),n=Wt("sizeRanges"),o=ce("useWindowScroll"),r=ce("customScrollParent"),i=Wt("windowScrollContainerState"),s=Wt("scrollContainerState"),a=r||o?i:s,l=ce("itemContent"),c=ce("context"),f=ce("groupContent"),m=ce("trackItemSizes"),h=ce("itemSize"),y=ce("log"),g=Wt("gap"),b=ce("horizontalDirection"),{callbackRef:v}=eI(n,h,m,e?ri:a,y,g,r,b,ce("skipAnimationFrameInResizeObserver")),[u,p]=te.useState(0);xf("deviation",U=>{u!==U&&p(U)});const x=ce("EmptyPlaceholder"),S=ce("ScrollSeekPlaceholder")??qI,T=ce("ListComponent"),C=ce("ItemComponent"),$=ce("GroupComponent"),j=ce("computeItemKey"),R=ce("isSeeking"),M=ce("groupIndices").length>0,F=ce("alignToBottom"),V=ce("initialItemFinalLocationReached"),L=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginInlineStart:u!==0?u:F?"auto":0,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:u!==0?u:F?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...V?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&x!==null&&x!==void 0?d.jsx(x,{...ht(x,c)}):d.jsx(T,{...ht(T,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:v,style:L,children:(e?t.topItems:t.items).map(U=>{const D=U.originalIndex,Q=j(D+t.firstItemIndex,U.data,c);return R?P.createElement(S,{...ht(S,c),height:U.size,index:U.index,key:Q,type:U.type||"item",...U.type==="group"?{}:{groupIndex:U.groupIndex}}):U.type==="group"?P.createElement($,{...ht($,c),"data-index":D,"data-item-index":U.index,"data-known-size":U.size,key:Q,style:UI},f(U.index,c)):P.createElement(C,{...ht(C,c),...BI(C,U.data),"data-index":D,"data-item-group-index":U.groupIndex,"data-item-index":U.index,"data-known-size":U.size,key:Q,style:b?LI:_x},M?l(U.index,U.groupIndex,U.data,c):l(U.index,U.data,c))})})}),DI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},zI={outline:"none",overflowX:"auto",position:"relative"},bf=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),jx=(e,t,n=0)=>({...bf(e),position:t?"relative":"absolute",top:t?-n:0}),FI={position:gf(),top:0,width:"100%",zIndex:1};function ht(e,t){if(typeof e!="string")return{context:t}}function BI(e,t){return{item:typeof e=="string"?void 0:t}}const HI=te.memo(function(){const e=ce("HeaderComponent"),t=Wt("headerHeight"),n=ce("HeaderFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,ce("skipAnimationFrameInResizeObserver")),r=ce("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null}),VI=te.memo(function(){const e=ce("FooterComponent"),t=Wt("footerHeight"),n=ce("HeaderFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,ce("skipAnimationFrameInResizeObserver")),r=ce("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null});function Nx({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("scrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),f=t("scrollerRef"),m=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:y,scrollToCallback:g}=Tx(a,c,l,f,void 0,m);return e("scrollTo",g),e("scrollBy",h),d.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:y,style:{...m?zI:DI,...r},tabIndex:0,...s,...ht(l,i),children:o})})}function Cx({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("windowScrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),f=t("totalListHeight"),m=t("deviation"),h=t("customScrollParent"),y=te.useRef(null),g=t("scrollerRef"),{scrollByCallback:b,scrollerRef:v,scrollToCallback:u}=Tx(a,c,l,g,h);return kx(()=>{var p;return v.current=h||((p=y.current)==null?void 0:p.ownerDocument.defaultView),()=>{v.current=null}},[v,h]),e("windowScrollTo",u),e("scrollBy",b),d.jsx(l,{ref:y,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...f!==0?{height:f+m}:void 0},...s,...ht(l,i),children:o})})}const WI=({children:e})=>{const t=te.useContext(Sx),n=Wt("viewportHeight"),o=Wt("fixedItemHeight"),r=ce("alignToBottom"),i=ce("horizontalDirection"),s=te.useMemo(()=>Yb(n,l=>bo(l,i?"width":"height")),[n,i]),a=Zo(s,!0,ce("skipAnimationFrameInResizeObserver"));return te.useEffect(()=>{t&&(n(t.viewportHeight),o(t.itemHeight))},[t,n,o]),d.jsx("div",{"data-viewport-type":"element",ref:a,style:bf(r),children:e})},KI=({children:e})=>{const t=te.useContext(Sx),n=Wt("windowViewportRect"),o=Wt("fixedItemHeight"),r=ce("customScrollParent"),i=ce("useWindowScroll"),s=ce("topListHeight"),a=tx(n,r,ce("skipAnimationFrameInResizeObserver")),l=ce("alignToBottom");return te.useEffect(()=>{t&&(o(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,o]),d.jsx("div",{"data-viewport-type":"window",ref:a,style:jx(l,i,s),children:e})},GI=({children:e})=>{const t=ce("TopItemListComponent")??"div",n=ce("headerHeight"),o={...FI,marginTop:`${n}px`},r=ce("context");return d.jsx(t,{style:o,...ht(t,r),children:e})},JI=te.memo(function(e){const t=ce("useWindowScroll"),n=ce("topItemsIndexes").length>0,o=ce("customScrollParent"),r=ce("context");return d.jsxs(o||t?XI:YI,{...e,context:r,children:[n&&d.jsx(GI,{children:d.jsx(Zh,{showTopList:!0})}),d.jsxs(o||t?KI:WI,{children:[d.jsx(HI,{}),d.jsx(Zh,{}),d.jsx(VI,{})]})]})}),{Component:QI,useEmitter:xf,useEmitterValue:ce,usePublisher:Wt}=wx(MI,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},JI),YI=Nx({useEmitter:xf,useEmitterValue:ce,usePublisher:Wt}),XI=Cx({useEmitter:xf,useEmitterValue:ce,usePublisher:Wt}),ZI=QI,eO=xe(()=>{const e=W(c=>d.jsxs("td",{children:["Item $",c]})),t=W(null),n=W(c=>d.jsxs("td",{colSpan:1e3,children:["Group ",c]})),o=W(null),r=W(null),i=W({}),s=W(vf),a=W(ri),l=(c,f=null)=>yt(z(i,X(m=>m[c]),Me()),f);return{components:i,computeItemKey:s,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});Ue(xx,eO);gf();const ey={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},tO={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:ty,floor:pl,max:Hi,min:Ec,round:ny}=Math;function oy(e,t,n){return Array.from({length:t-e+1}).map((o,r)=>({data:n===null?null:n[r+e],index:r+e}))}function nO(e){return{...tO,items:e}}function ia(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function oO(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const rO=xe(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:i,scrollBy:s,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:f,viewportHeight:m},h,y,{didMount:g,propsReady:b},{customScrollParent:v,useWindowScroll:u,windowScrollContainerState:p,windowScrollTo:x,windowViewportRect:S},T])=>{const C=W(0),$=W(0),j=W(ey),R=W({height:0,width:0}),M=W({height:0,width:0}),F=ve(),V=ve(),L=W(0),U=W(null),D=W({column:0,row:0}),Q=ve(),ee=ve(),q=W(!1),G=W(0),I=W(!0),_=W(!1),A=W(!1);$e(z(g,he(G),ae(([O,Y])=>Y!==0)),()=>{me(I,!1)}),$e(z(Qe(g,I,M,R,G,_),ae(([O,Y,ie,de,,we])=>O&&!Y&&ie.height!==0&&de.height!==0&&!we)),([,,,,O])=>{me(_,!0),ff(1,()=>{me(F,O)}),cn(z(c),()=>{me(t,[0,0]),me(I,!0)})}),oe(z(ee,ae(O=>O!=null&&O.scrollTop>0),yn(0)),$),$e(z(g,he(ee),ae(([,O])=>O!=null)),([,O])=>{O&&(me(R,O.viewport),me(M,O.item),me(D,O.gap),O.scrollTop>0&&(me(q,!0),cn(z(c,Qo(1)),Y=>{me(q,!1)}),me(l,{top:O.scrollTop})))}),oe(z(R,X(({height:O})=>O)),m),oe(z(Qe(se(R,ia),se(M,ia),se(D,(O,Y)=>O!==void 0&&O.column===Y.column&&O.row===Y.row),se(c)),X(([O,Y,ie,de])=>({gap:ie,item:Y,scrollTop:de,viewport:O}))),Q),oe(z(Qe(se(C),o,se(D,oO),se(M,ia),se(R,ia),se(U),se($),se(q),se(I),se(G)),ae(([,,,,,,,O])=>!O),X(([O,[Y,ie],de,we,ze,Ee,Se,,_e,Ye])=>{const{column:Pe,row:_n}=de,{height:Bn,width:_o}=we,{width:tr}=ze;if(Se===0&&(O===0||tr===0))return ey;if(_o===0){const wf=mf(Ye,O),Ox=wf+Math.max(Se-1,0);return nO(oy(wf,Ox,Ee))}const Hn=Ex(tr,_o,Pe);let pn,Yt;_e?Y===0&&ie===0&&Se>0?(pn=0,Yt=Se-1):(pn=Hn*pl((Y+_n)/(Bn+_n)),Yt=Hn*ty((ie+_n)/(Bn+_n))-1,Yt=Ec(O-1,Hi(Yt,Hn-1)),pn=Ec(Yt,Hi(0,pn))):(pn=0,Yt=-1);const Vn=oy(pn,Yt,Ee),{bottom:nr,top:ii}=ry(ze,de,we,Vn),si=ty(O/Hn),Hl=si*Bn+(si-1)*_n-nr;return{bottom:nr,itemHeight:Bn,items:Vn,itemWidth:_o,offsetBottom:Hl,offsetTop:ii,top:ii}})),j),oe(z(U,ae(O=>O!==null),X(O=>O.length)),C),oe(z(Qe(R,M,j,D),ae(([O,Y,{items:ie}])=>ie.length>0&&Y.height!==0&&O.height!==0),X(([O,Y,{items:ie},de])=>{const{bottom:we,top:ze}=ry(O,de,Y,ie);return[ze,we]}),Me(vs)),t);const E=W(!1);oe(z(c,he(E),X(([O,Y])=>Y||O!==0)),E);const w=Mt(z(Qe(j,C),ae(([{items:O}])=>O.length>0),he(E),ae(([[O,Y],ie])=>{const de=O.items[O.items.length-1].index===Y-1;return(ie||O.bottom>0&&O.itemHeight>0&&O.offsetBottom===0&&O.items.length===Y)&&de}),X(([[,O]])=>O-1),Me())),k=Mt(z(se(j),ae(({items:O})=>O.length>0&&O[0].index===0),yn(0),Me())),N=Mt(z(se(j),he(q),ae(([{items:O},Y])=>O.length>0&&!Y),X(([{items:O}])=>({endIndex:O[O.length-1].index,startIndex:O[0].index})),Me(ax),On(0)));oe(N,y.scrollSeekRangeChanged),oe(z(F,he(R,M,C,D),X(([O,Y,ie,de,we])=>{const ze=px(O),{align:Ee,behavior:Se,offset:_e}=ze;let Ye=ze.index;Ye==="LAST"&&(Ye=de-1),Ye=Hi(0,Ye,Ec(de-1,Ye));let Pe=Jd(Y,we,ie,Ye);return Ee==="end"?Pe=ny(Pe-Y.height+ie.height):Ee==="center"&&(Pe=ny(Pe-Y.height/2+ie.height/2)),_e!==void 0&&_e!==0&&(Pe+=_e),{behavior:Se,top:Pe}})),l);const B=yt(z(j,X(O=>O.offsetBottom+O.bottom)),0);return oe(z(S,X(O=>({height:O.visibleHeight,width:O.visibleWidth}))),R),{customScrollParent:v,data:U,deviation:L,footerHeight:r,gap:D,headerHeight:i,increaseViewportBy:e,initialItemCount:$,itemDimensions:M,overscan:n,restoreStateFrom:ee,scrollBy:s,scrollContainerState:a,scrollHeight:V,scrollTo:l,scrollToIndex:F,scrollTop:c,smoothScrollTargetReached:f,totalCount:C,useWindowScroll:u,viewportDimensions:R,windowScrollContainerState:p,windowScrollTo:x,windowViewportRect:S,...y,gridState:j,horizontalDirection:A,initialTopMostItemIndex:G,totalListHeight:B,...h,endReached:w,propsReady:b,rangeChanged:N,startReached:k,stateChanged:Q,stateRestoreInProgress:q,...T}},Ue(hf,kt,Os,vx,To,yf,ko));function Ex(e,t,n){return Hi(1,pl((e+n)/(pl(t)+n)))}function ry(e,t,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const i=Jd(e,t,n,o[0].index);return{bottom:Jd(e,t,n,o[o.length-1].index)+r,top:i}}function Jd(e,t,n,o){const r=Ex(e.width,n.width,t.column),i=pl(o/r),s=i*n.height+Hi(0,i-1)*t.row;return s>0?s+t.row:s}const iO=xe(()=>{const e=W(m=>`Item ${m}`),t=W({}),n=W(null),o=W("virtuoso-grid-item"),r=W("virtuoso-grid-list"),i=W(vf),s=W("div"),a=W(ri),l=(m,h=null)=>yt(z(t,X(y=>y[m]),Me()),h),c=W(!1),f=W(!1);return oe(se(f),c),{components:t,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:s,itemClassName:o,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:f,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),sO=xe(([e,t])=>({...e,...t}),Ue(rO,iO)),aO=te.memo(function(){const e=Re("gridState"),t=Re("listClassName"),n=Re("itemClassName"),o=Re("itemContent"),r=Re("computeItemKey"),i=Re("isSeeking"),s=Kt("scrollHeight"),a=Re("ItemComponent"),l=Re("ListComponent"),c=Re("ScrollSeekPlaceholder"),f=Re("context"),m=Kt("itemDimensions"),h=Kt("gap"),y=Re("log"),g=Re("stateRestoreInProgress"),b=Kt("reportReadyState"),v=Zo(te.useMemo(()=>u=>{const p=u.parentElement.parentElement.scrollHeight;s(p);const x=u.firstChild;if(x!==null){const{height:S,width:T}=x.getBoundingClientRect();m({height:S,width:T})}h({column:iy("column-gap",getComputedStyle(u).columnGap,y),row:iy("row-gap",getComputedStyle(u).rowGap,y)})},[s,m,h,y]),!0,!1);return kx(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),g?null:d.jsx(l,{className:t,ref:v,...ht(l,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(u=>{const p=r(u.index,u.data,f);return i?d.jsx(c,{...ht(c,f),height:e.itemHeight,index:u.index,width:e.itemWidth},p):P.createElement(a,{...ht(a,f),className:n,"data-index":u.index,key:p},o(u.index,u.data,f))})})}),lO=te.memo(function(){const e=Re("HeaderComponent"),t=Kt("headerHeight"),n=Re("headerFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,!1),r=Re("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null}),cO=te.memo(function(){const e=Re("FooterComponent"),t=Kt("footerHeight"),n=Re("headerFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,!1),r=Re("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null}),dO=({children:e})=>{const t=te.useContext($x),n=Kt("itemDimensions"),o=Kt("viewportDimensions"),r=Zo(te.useMemo(()=>i=>{o(i.getBoundingClientRect())},[o]),!0,!1);return te.useEffect(()=>{t&&(o({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,o,n]),d.jsx("div",{ref:r,style:bf(!1),children:e})},uO=({children:e})=>{const t=te.useContext($x),n=Kt("windowViewportRect"),o=Kt("itemDimensions"),r=Re("customScrollParent"),i=Re("useWindowScroll"),s=tx(n,r,!1);return te.useEffect(()=>{t&&(o({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,o]),d.jsx("div",{ref:s,style:jx(!1,i),children:e})},pO=te.memo(function({...e}){const t=Re("useWindowScroll"),n=Re("customScrollParent"),o=n||t?mO:fO,r=n||t?uO:dO,i=Re("context");return d.jsx(o,{...e,...ht(o,i),children:d.jsxs(r,{children:[d.jsx(lO,{}),d.jsx(aO,{}),d.jsx(cO,{})]})})}),{useEmitter:Px,useEmitterValue:Re,usePublisher:Kt}=wx(sO,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},pO),fO=Nx({useEmitter:Px,useEmitterValue:Re,usePublisher:Kt}),mO=Cx({useEmitter:Px,useEmitterValue:Re,usePublisher:Kt});function iy(e,t,n){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&n(`${e} was not resolved to pixel value correctly`,t,nt.WARN),t==="normal"?0:parseInt(t??"0",10)}function hO(e){var o,r,i;if(e.kind!=="notification"||e.method!=="session/update")return null;const t=e.payload;if(!t||typeof t!="object")return null;const n=t.params;return!n||((o=n.update)==null?void 0:o.sessionUpdate)!=="agent_message_chunk"?null:{sessionId:String(n.sessionId??""),text:((i=(r=n.update)==null?void 0:r.content)==null?void 0:i.text)??""}}function yO(e){const t=[];let n=null;const o=()=>{if(n){if(n.messages.length===1){const r=n.messages[0];t.push({type:"message",message:r})}else{const r=n.messages[0],i=n.messages[n.messages.length-1];t.push({type:"stream-cluster",sessionId:n.sessionId,messages:n.messages,firstSeq:r.seq,lastSeq:i.seq,combinedText:n.text,firstTimestamp:r.timestamp,lastTimestamp:i.timestamp})}n=null}};for(const r of e){const i=hO(r);if(i&&n&&n.sessionId===i.sessionId){n.messages.push(r),n.text+=i.text;continue}o(),i?n={sessionId:i.sessionId,messages:[r],text:i.text}:t.push({type:"message",message:r})}return o(),t}function gO(e){var n;if(!e.payload||typeof e.payload!="object")return null;const t=e.payload.params;if(!t||typeof t!="object")return null;if(e.method==="session/prompt"){const o=t.prompt;if(!Array.isArray(o))return null;const r=[];for(const s of o)(s==null?void 0:s.type)==="text"&&typeof s.text=="string"&&r.push(s.text);const i=r.join(" ").trim();return i.length>0?i:null}if(e.method==="session/update"){const o=t.update;if(!o)return null;const r=((n=o.content)==null?void 0:n.text)??o.text;return typeof r=="string"&&r.length>0?r:null}return null}function vO(e){return e.method==="session/prompt"&&e.kind==="request"}const bO={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"???"},xO={request:"request — expects a response",response:"response — answer to a previous request",notification:"notification — one-way event, no response",error:"error — response carrying an error object",unknown:"unknown — could not classify as JSON-RPC"},wO={"editor-to-agent":"editor → agent (e.g. JetBrains/Zed sending to the AI)","agent-to-editor":"agent → editor (AI replying or calling the host)"};function SO(e){switch(e){case"error":return"text-accent-error";case"notification":return"text-accent-note";case"request":return"text-accent-out";case"response":return"text-accent-in";default:return"text-ink-muted"}}function $O({message:e,selected:t,paired:n=!1,latencyMs:o,validation:r,onSelect:i}){const s=e.direction==="editor-to-agent",a=e.kind==="error",l=o!==void 0?rE(o):null,c=gO(e),f=vO(e),m=r&&!r.skipped&&!r.valid;return d.jsxs("button",{type:"button",onClick:()=>i(e.seq),className:K("relative flex w-full items-center gap-3 px-4 py-1.5 text-left font-mono text-[12px] leading-5","border-b border-line-grid/70 transition-colors","hover:bg-surface-rowHover",t?"bg-surface-rowHover ring-1 ring-inset ring-accent-out/40":"",n&&!t?"bg-accent-out/[0.04] ring-1 ring-inset ring-accent-out/15":"",a?"bg-accent-error/[0.06]":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("absolute inset-y-0 left-0 w-[3px]",s?"bg-accent-out":"bg-accent-in",a?"bg-accent-error":"")}),d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(e.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:fs(e.timestamp)}),d.jsxs("span",{className:K("flex w-16 shrink-0 items-center gap-1 font-semibold",s?"text-accent-out":"text-accent-in"),title:wO[e.direction],children:[d.jsx("span",{"aria-hidden":!0,children:Fb(e.direction)}),d.jsx("span",{className:"text-[10px] tracking-widest",children:zb(e.direction)})]}),d.jsx("span",{className:K("inline-flex w-12 shrink-0 items-center justify-center rounded-sm border px-1 text-[10px] font-semibold tracking-widest",SO(e.kind),"border-current/40"),title:xO[e.kind],children:bO[e.kind]}),d.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-3 overflow-hidden",children:[d.jsx("span",{className:K("shrink-0",f?"text-accent-out":"text-ink-primary"),children:e.method?e.method:"—"}),m&&r&&d.jsxs("span",{className:K("inline-flex shrink-0 items-center gap-0.5 rounded-sm border border-accent-error/40","bg-accent-error/10 px-1 text-[9px] font-semibold uppercase tracking-widest text-accent-error"),title:`fails ACP schema (${r.schemaName??"?"}): ${r.errors.map(h=>`${h.path==="/"?"":h.path+" "}${h.message}`).join(" · ")}`,children:["⚠ SPEC ",r.errors.length]}),c&&d.jsxs("span",{className:K("truncate",f?"text-accent-out/85":"text-ink-secondary"),title:c,children:["“",c,"”"]})]}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",title:e.rpcId!==void 0&&e.rpcId!==null?`id:${String(e.rpcId)}`:void 0,children:e.rpcId!==void 0&&e.rpcId!==null?`id:${sE(e.rpcId)}`:""}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Ul(e.raw.length)}),d.jsx("span",{className:K("w-20 shrink-0 text-right",l==="ok"&&"text-accent-ok",l==="warn"&&"text-accent-warn",l==="error"&&"text-accent-error",!l&&"text-ink-dim"),children:o!==void 0?`+${Vt(o)}`:""})]})}const kO=P.memo($O);function TO({messages:e,combinedText:t,firstTimestamp:n,lastTimestamp:o,selectedSeq:r,onSelect:i}){const[s,a]=P.useState(!1),l=e[0],c=e[e.length-1],f=o-n,m=t.length>140?`${t.slice(0,140)}…`:t,h=r!==null&&e.some(y=>y.seq===r);return d.jsxs("div",{className:"border-b border-line-grid/70",children:[d.jsxs("button",{type:"button",onClick:()=>{a(y=>!y),i(l.seq)},className:K("relative flex w-full items-center gap-3 px-4 py-1.5 text-left font-mono text-[12px] leading-5","transition-colors hover:bg-surface-rowHover",h?"bg-surface-rowHover ring-1 ring-inset ring-accent-note/40":""),children:[d.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent-note"}),d.jsxs("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:[String(l.seq).padStart(3,"0"),"…",String(c.seq).padStart(3,"0")]}),d.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:fs(n)}),d.jsxs("span",{className:"flex w-16 shrink-0 items-center gap-1 font-semibold text-accent-in",title:"agent → editor (AI replying or calling the host)",children:[d.jsx("span",{"aria-hidden":!0,children:"←"}),d.jsx("span",{className:"text-[10px] tracking-widest",children:"IN"})]}),d.jsx("span",{className:K("inline-flex w-12 shrink-0 items-center justify-center rounded-sm border border-accent-note/40 px-1 text-[10px] font-semibold tracking-widest text-accent-note"),title:`stream — ${e.length} consecutive agent_message_chunk notifications collapsed into one row`,children:"STR"}),d.jsxs("span",{className:"flex flex-1 items-center gap-2 truncate text-ink-primary",children:[d.jsx("span",{className:"inline-flex h-[14px] w-1 rounded-sm bg-accent-note/60","aria-hidden":!0}),d.jsx("span",{className:"truncate text-ink-secondary",children:m||d.jsx("span",{className:"text-ink-muted",children:"(empty stream)"})})]}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:[e.length," chunks"]}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Vt(f)}),d.jsx("span",{"aria-hidden":!0,className:K("w-3 shrink-0 text-ink-muted transition-transform",s?"rotate-90":""),children:"▸"})]}),s&&d.jsx("div",{className:"border-l border-line-grid/70 bg-surface-base/40",children:e.map((y,g)=>d.jsxs("button",{type:"button",onClick:()=>i(y.seq),className:K("flex w-full items-center gap-3 px-8 py-1 text-left font-mono text-[11px] leading-5 text-ink-secondary","transition-colors hover:bg-surface-rowHover",r===y.seq?"bg-surface-rowHover text-ink-primary":""),children:[d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(y.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-muted",children:fs(y.timestamp)}),d.jsxs("span",{className:"w-8 shrink-0 text-ink-muted",children:["#",g+1]}),d.jsx("span",{className:"flex-1 truncate text-ink-primary",children:_O(y)})]},y.seq))})]})}function _O(e){var o,r;const t=e.payload;if(!t||typeof t!="object")return"";const n=t.params;return((r=(o=n==null?void 0:n.update)==null?void 0:o.content)==null?void 0:r.text)??""}const jO=80;function NO(){const e=ne(u=>u.messages),t=ne(u=>u.selectedSeq),n=ne(u=>u.filters),o=ne(u=>u.playback.cap),r=ne(u=>u.select),i=P.useMemo(()=>mS(e,n,o),[e,n,o]),s=P.useMemo(()=>yO(i),[i]),a=P.useMemo(()=>Cl(e),[e]),l=P.useMemo(()=>Zp(e),[e]),c=P.useMemo(()=>{const u=new Map;for(const p of e)u.set(p.seq,p.timestamp);return u},[e]),f=P.useMemo(()=>{if(t===null)return null;const u=a.get(t);if(u!==void 0)return u;for(const[p,x]of a)if(x===t)return p;return null},[t,a]),m=P.useRef(null),h=ne(u=>{var p;return((p=u.session)==null?void 0:p.id)??null}),y=ne(u=>u.replayDone),g=P.useRef(h),b=P.useRef(!1);P.useEffect(()=>{g.current!==h&&(g.current=h,b.current=!1)},[h]),P.useEffect(()=>{if(!y||h===null||b.current||s.length===0)return;b.current=!0;const u=s.length-1,p=window.setTimeout(()=>{var x;(x=m.current)==null||x.scrollToIndex({index:u,align:"end",behavior:"smooth"})},50);return()=>window.clearTimeout(p)},[y,h,s.length]);const v=u=>{const p=s[u];return p?CO(p,{selectedSeq:t,pairedSeq:f,onSelect:r,responseToRequest:a,reqTimestampBySeq:c,validationBySeq:l}):null};return d.jsxs("div",{className:"relative flex h-full flex-col",children:[s.length===0?d.jsx("div",{className:"flex h-full items-center justify-center bg-surface-base font-mono text-xs text-ink-muted",children:"no messages match current filters"}):d.jsx(ZI,{ref:m,className:"flex-1 bg-surface-base",totalCount:s.length,itemContent:v,atBottomThreshold:jO,initialTopMostItemIndex:Math.max(0,s.length-1),followOutput:u=>u?"auto":!1,computeItemKey:u=>EO(s[u])}),d.jsx(PO,{total:e.length,shown:i.length})]})}function CO(e,t){if(e.type==="message"){const n=e.message,o=t.responseToRequest.get(n.seq),r=o!==void 0?n.timestamp-(t.reqTimestampBySeq.get(o)??n.timestamp):void 0,i=t.validationBySeq.get(n.seq);return d.jsx(kO,{message:n,selected:t.selectedSeq===n.seq,paired:t.pairedSeq===n.seq,...r!==void 0?{latencyMs:r}:{},...i!==void 0?{validation:i}:{},onSelect:t.onSelect})}return d.jsx(TO,{messages:e.messages,combinedText:e.combinedText,firstTimestamp:e.firstTimestamp,lastTimestamp:e.lastTimestamp,selectedSeq:t.selectedSeq,onSelect:t.onSelect})}function EO(e){return e.type==="message"?`m-${e.message.seq}`:`c-${e.firstSeq}-${e.lastSeq}`}function PO({total:e,shown:t}){return e===0||t===e?null:d.jsxs("div",{className:"border-t border-line bg-surface-elev/60 px-4 py-1 text-right font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:["showing ",t," of ",e]})}function IO({message:e,tone:t="info"}){if(!e)return null;const n=t==="success"?"border-accent-out/50 bg-accent-out/10 text-accent-out":t==="warn"?"border-accent-warn/50 bg-accent-warn/10 text-accent-warn":"border-accent-info/50 bg-accent-info/10 text-accent-info";return d.jsx("div",{role:"status",className:K("pointer-events-none fixed right-4 top-[60px] z-50 rounded-sm border px-3 py-2 font-mono text-[11px] uppercase tracking-widest shadow-lg backdrop-blur-sm",n),children:e})}function OO({onImportResult:e}){const[t,n]=P.useState(!1),[o,r]=P.useState(!1),i=P.useRef(null),s=P.useRef(null),a=ne(y=>y.session),l=ne(y=>y.messages.length),c=a!==null&&l>0;P.useEffect(()=>{if(!t)return;const y=b=>{i.current&&!i.current.contains(b.target)&&n(!1)},g=b=>{b.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",g)}},[t]);const f=()=>{var y;n(!1),(y=s.current)==null||y.click()},m=()=>{n(!1);const y=ne.getState();y.session&&y.messages.length>0&&Db(y.session,y.messages)},h=async y=>{var b;const g=(b=y.target.files)==null?void 0:b[0];if(y.target.value="",!!g){r(!0);try{const v=await $v(g);await Qu(),ft.getState().setSelected(tl(v.id)),e==null||e(`imported ${g.name} · #${v.id} · ${v.messageCount} message${v.messageCount===1?"":"s"}`,"success")}catch(v){const u=v instanceof Error?v.message:String(v);e==null||e(`import failed: ${u}`,"warn")}finally{r(!1)}}};return d.jsxs("div",{ref:i,className:"relative",children:[d.jsx("input",{ref:s,type:"file",accept:"application/json,.json",onChange:h,className:"hidden","aria-hidden":"true",tabIndex:-1}),d.jsx("button",{type:"button",onClick:()=>n(y=>!y),title:"Session actions — import file · export","aria-haspopup":"menu","aria-expanded":t,"aria-label":"session actions",disabled:o,className:K("inline-flex h-7 w-7 items-center justify-center rounded-sm border font-mono text-[14px] leading-none transition-colors",t?"border-line-strong bg-surface-rowHover text-ink-primary":"border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",o&&"cursor-progress opacity-60"),children:d.jsx("span",{"aria-hidden":!0,children:"⋯"})}),t&&d.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+6px)] z-50 w-max overflow-hidden rounded-sm border border-line bg-surface-elev p-1 font-mono text-[11px] uppercase tracking-widest shadow-lg",children:[d.jsx(sy,{icon:"↑",label:"import",onClick:f,title:"Open a session JSON exported earlier — yours or someone else's."}),d.jsx(sy,{icon:"↓",label:"export",onClick:m,disabled:!c,title:"Download this session as JSON. Auth headers and proxy tokens (Authorization, X-Api-Key, JetBrains proxy_key) are redacted — safe to attach to a bug report. For an un-redacted copy (self-debug only), use 'acp-devtools export <id> --raw' in the CLI.",disabledTitle:"Nothing to export yet — wait for the first message."})]})]})}function sy({icon:e,label:t,onClick:n,disabled:o,title:r,disabledTitle:i}){return d.jsxs("button",{type:"button",role:"menuitem",disabled:o,onClick:n,title:o?i:r,className:K("flex w-full items-center gap-2 rounded-[2px] px-2 py-1.5 text-left transition-colors",o?"cursor-not-allowed text-ink-dim opacity-50":"text-ink-muted hover:bg-surface-rowHover hover:text-ink-secondary"),children:[d.jsx("span",{"aria-hidden":!0,className:"w-4 text-center text-[13px] leading-none",children:e}),d.jsx("span",{className:"flex-1",children:t})]})}function RO({onSelect:e,activeUrl:t,overrideUrl:n}){const o=ft(p=>p.captures),r=ft(p=>p.savedSessions),i=ft(p=>p.lastFetchAt),[s,a]=P.useState(!1),l=P.useRef(null);P.useEffect(()=>{if(!s)return;const p=x=>{l.current&&!l.current.contains(x.target)&&a(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);const c=o.find(p=>p.url===t)??null,f=t!==null&&SS(t)?$S(t):null,m=P.useMemo(()=>new Set(o.map(p=>p.sessionDbId).filter(p=>p!==null)),[o]),h=P.useMemo(()=>r.filter(p=>!m.has(p.id)),[r,m]),y=P.useMemo(()=>h.filter(p=>p.imported_at===null),[h]),g=P.useMemo(()=>h.filter(p=>p.imported_at!==null),[h]),b=f!==null?h.find(p=>p.id===f)??null:null,v=o.length+h.length;let u;return n?u="?ws override":c?u=ef(c):b?u=`#${b.id} · ${b.name??(b.client_name?`${b.client_name} · ${Rt(b.agent_command??"")}`:Rt(b.agent_command??""))}`:v===0?u="no captures":u="pick capture",d.jsxs("div",{ref:l,className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:K("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] uppercase tracking-widest transition-colors","border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",s?"border-line-strong text-ink-primary":""),title:"Select a live capture or saved session",children:[d.jsx("span",{className:"inline-block w-[200px] truncate text-left",children:u}),v>1&&!n&&d.jsx("span",{className:"rounded-sm border border-line-strong px-1 text-[9px] text-ink-secondary",children:v}),d.jsx("span",{"aria-hidden":!0,className:K("transition-transform",s?"rotate-180":""),children:"▾"})]}),s&&d.jsxs("div",{className:K("absolute right-0 top-[calc(100%+6px)] z-50 w-[460px] rounded-md border border-line bg-surface-elev shadow-xl"),children:[d.jsxs(Pc,{children:["live captures · last poll"," ",i?`${Math.round((Date.now()-i)/1e3)}s ago`:"—"]}),o.length===0&&d.jsxs("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:["none. start a proxy with"," ",d.jsx("span",{className:"text-ink-secondary",children:"acp-devtools proxy …"})]}),d.jsx("ul",{className:"max-h-[260px] overflow-y-auto",children:o.map(p=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>{e(p.url),a(!1)},title:`${p.agentCommand} · ${p.url}${p.saveTo?" · saved to local store":" · not persisted"}`,className:K("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",p.url===t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",p.url===t?"bg-accent-out animate-pulse-soft":"bg-accent-warn/50")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsx("span",{className:"text-accent-out",children:p.sessionDbId!==null?`#${p.sessionDbId}`:`pid ${p.pid}`}),d.jsx("span",{className:"text-ink-muted",children:" · "}),p.sessionName??(p.clientName?`${p.clientName} · ${Rt(p.agentCommand)}`:Rt(p.agentCommand))]}),d.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:Ar(p.startedAt)})]})},p.url))}),d.jsxs(Pc,{children:["saved · ",y.length," session",y.length===1?"":"s"]}),y.length===0&&d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:r.length===0?"no saved sessions yet":g.length>0?"no live-captured sessions yet":"all saved sessions are currently live"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:y.map(p=>d.jsx(ay,{s:p,activeUrl:t,onPick:x=>{e(x),a(!1)}},p.id))}),(g.length>0||r.some(p=>p.imported_at!==null))&&d.jsxs(d.Fragment,{children:[d.jsxs(Pc,{children:["imported · ",g.length," file",g.length===1?"":"s"]}),g.length===0?d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no imported files"}):d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:g.map(p=>d.jsx(ay,{s:p,activeUrl:t,onPick:x=>{e(x),a(!1)}},p.id))})]}),n&&d.jsx("div",{className:"border-t border-line px-3 py-2 font-mono text-[10px] uppercase tracking-widest text-accent-warn",children:"?ws override active — discovery selection ignored"})]})]})}function Pc({children:e}){return d.jsx("div",{className:"border-b border-line bg-surface-base/50 px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e})}function ay({s:e,activeUrl:t,onPick:n}){const o=tl(e.id),r=o===t,i=s=>{s.stopPropagation();const a=e.name??Rt(e.agent_command??"");window.confirm(`Delete session #${e.id} ${a} forever?`)&&(async()=>{try{await wS(e.id),r&&ft.getState().setSelected(null),await Qu()}catch(l){const c=l instanceof Error?l.message:String(l);window.alert(`Delete failed: ${c}`)}})()};return d.jsxs("li",{className:"group relative",children:[d.jsxs("button",{type:"button",onClick:()=>n(o),title:`session #${e.id} · ${e.agent_command??""} · ${e.message_count} messages`,className:K("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",r?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",r?"bg-accent-note animate-pulse-soft":"bg-ink-dim")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),d.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Rt(e.agent_command??"")}`:Rt(e.agent_command??""))]}),d.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors group-hover:text-ink-secondary",children:[e.message_count,"msg · ",Ar(e.started_at)]})]}),d.jsx("button",{type:"button",onClick:i,"aria-label":`delete session #${e.id} forever`,title:"Delete this session permanently",className:K("absolute right-2 top-1/2 hidden h-6 w-6 -translate-y-1/2 items-center justify-center rounded-sm border border-line bg-surface-elev/70 text-[12px] leading-none text-ink-muted transition-colors","group-hover:flex hover:border-accent-error/70 hover:bg-surface-rowHover hover:text-accent-error"),children:d.jsx("span",{"aria-hidden":!0,children:"×"})})]})}const Ic=[{mode:"system",label:"AUTO",title:"follow OS theme",icon:"◐"},{mode:"light",label:"LIGHT",title:"force light theme",icon:"☀"},{mode:"dark",label:"DARK",title:"force dark theme",icon:"☾"}];function AO(){const e=Pd(s=>s.mode),t=Pd(s=>s.setMode),[n,o]=P.useState(!1),r=P.useRef(null);P.useEffect(()=>{if(!n)return;const s=a=>{r.current&&!r.current.contains(a.target)&&o(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const i=Ic.find(s=>s.mode===e)??Ic[0];return d.jsxs("div",{ref:r,className:"relative",children:[d.jsx("button",{type:"button",onClick:()=>o(s=>!s),title:`theme · ${i.title}`,"aria-haspopup":"menu","aria-expanded":n,className:K("inline-flex h-7 w-7 items-center justify-center rounded-sm border font-mono text-[12px] transition-colors",n?"border-line-strong bg-surface-rowHover text-ink-primary":"border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary"),children:d.jsx("span",{"aria-hidden":!0,children:i.icon})}),n&&d.jsx("div",{role:"menu",className:"absolute right-0 top-[calc(100%+6px)] z-50 inline-flex items-center gap-px rounded-sm border border-line bg-surface-elev p-px font-mono text-[10px] uppercase tracking-widest shadow-lg",children:Ic.map(s=>{const a=s.mode===e;return d.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":a,onClick:()=>{t(s.mode),o(!1)},title:s.title,className:K("inline-flex items-center gap-1 rounded-[2px] px-2 py-1 transition-colors",a?"bg-accent-out/15 text-accent-out":"text-ink-muted hover:bg-surface-rowHover hover:text-ink-secondary"),children:[d.jsx("span",{"aria-hidden":!0,children:s.icon}),d.jsx("span",{children:s.label})]},s.mode)})})]})}function MO({wsUrl:e,overrideUrl:t,activeUrl:n,isReplay:o,isImported:r=!1,onPickCapture:i,onImportResult:s,onOpenInfo:a,onOpenPerf:l,onOpenDiff:c}){const f=ne(b=>b.connection),m=ne(b=>b.session),h=ne(b=>b.lastError),y=ne(b=>b.messages.length>0?b.messages[b.messages.length-1].timestamp:null),g=Jb(5e3);return d.jsxs("header",{className:"flex items-center justify-between border-b border-line bg-surface-base px-5 py-2.5",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"wordmark-rule",children:d.jsx("span",{className:"font-display text-[18px] uppercase tracking-[0.18em] text-ink-primary",children:"acp.devtools"})}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.2.1"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[m&&(()=>{const{primary:b}=ql(m),v=o||r,u=m.endedAt!==null?m.endedAt:y??m.startedAt,p=v?Ar(m.startedAt,u):Ar(m.startedAt,g),x=y!==null?g-y:null,S=!v&&x!==null&&x>5e3,T=_a(m.startedAt,g),C=r?"IMPORTED":o?"REPLAY":"SESSION",$=r?"session loaded from a JSON file on disk — not connected to any proxy":o?"replay of a saved session — proxy has ended":"live capture — proxy process is still running",j=r?"text-accent-warn":o?"text-accent-note":"text-accent-out";return d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] text-ink-secondary",children:[d.jsx("span",{className:"text-ink-muted",title:$,children:C}),d.jsx("span",{className:j,title:m.agentCommand?`session #${m.id} · ${m.agentCommand}`:"persisted session id",children:b}),d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsx("span",{title:`session started at ${T}`,children:_a(m.startedAt,g)}),p&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-muted",title:v?"capture duration (start → end of recorded session)":"how long the proxy process has been alive",children:[v?"lasted":"alive"," ",p]})]}),S&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-dim",title:`time since the most recent ACP frame · last event ${_a(y,g)}`,children:["idle ",Ar(y,g)]})]})]})})(),d.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&d.jsx(RO,{onSelect:i,activeUrl:n,overrideUrl:t}),d.jsx(qO,{status:f,wsUrl:e,lastError:h,isReplay:o,isImported:r,onReconnect:bS})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[a&&m&&d.jsx("button",{type:"button",onClick:a,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Show session info — client/agent capabilities, runtime state","aria-label":"Open session info panel",children:"info"}),l&&m&&d.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Show performance dashboard — per-method latency stats and waterfall timeline","aria-label":"Open performance dashboard",children:"perf"}),c&&m&&d.jsx("button",{type:"button",onClick:c,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Compare this session against another — metadata, per-method latency, and frame-level differences","aria-label":"Open session diff",children:"diff"}),d.jsx(OO,{...s?{onImportResult:s}:{}})]}),d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsx(AO,{})})]})]})}function qO({status:e,wsUrl:t,lastError:n,isReplay:o,isImported:r,onReconnect:i}){if(r)return d.jsxs("div",{className:"inline-flex h-7 cursor-default items-center gap-2 rounded-sm border border-accent-warn/40 bg-accent-warn/10 px-3 font-mono text-[10px] font-semibold uppercase tracking-widest text-accent-warn",title:`viewing data from a JSON file · ${t}`,children:[d.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 rounded-full bg-accent-warn"}),d.jsx("span",{className:"inline-block min-w-[52px] text-center",children:"FILE"})]});const a=e==="open"?o?"REPLAY":"LIVE":e==="connecting"?"WAITING":e==="idle"?"IDLE":e==="closed"?"CLOSED":"ERROR",c={idle:"text-ink-secondary bg-surface-row border-line",connecting:"text-accent-warn/80 bg-accent-warn/10 border-accent-warn/30",open:o?"text-accent-note bg-accent-note/10 border-accent-note/40":"text-accent-out bg-accent-out/10 border-accent-out/40",closed:"text-ink-secondary bg-surface-row border-line",error:"text-accent-error bg-accent-error/10 border-accent-error/40"},m=e==="open"?o?"bg-accent-note animate-pulse-soft":"bg-accent-out animate-pulse-soft":e==="connecting"?"bg-accent-warn/60 animate-pulse-soft":e==="error"?"bg-accent-error":"bg-ink-dim",h=e==="idle"||e==="closed"||e==="error",g=n||(e==="open"?`${o?"serving a recorded session from the local store":"connected to a live proxy capture"} · ${t}`:h?`click to reconnect · ${t}`:t);return d.jsxs("button",{type:"button",onClick:h?i:void 0,disabled:!h,className:K("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",c[e],h?"cursor-pointer hover:bg-surface-rowHover":"cursor-default"),title:g,children:[d.jsx("span",{"aria-hidden":!0,className:K("inline-block h-2 w-2 rounded-full",m)}),d.jsx("span",{className:"inline-block min-w-[52px] text-center",children:a})]})}const ur=GN(),UO=ur?new URLSearchParams(typeof window<"u"?window.location.search:"").get("url"):null;function LO(){const e=ft(w=>w.captures),t=ft(w=>w.selectedUrl),n=ft(w=>w.setSelected),o=ne(w=>{var k;return((k=w.session)==null?void 0:k.importedAt)??null}),r=t,i=t!==null&&/\/replay\/\d+$/.test(t),s=o!==null;P.useEffect(()=>ur?void 0:CS(),[]),P.useEffect(()=>IS(),[]);const[a,l]=P.useState(null),c=P.useRef(new Set);P.useEffect(()=>{const w=mh(window.location.search),k=ne.getState(),N={};Object.keys(w.filters).length>0&&(N.filters={...k.filters,...w.filters}),w.selectedSeq!==null&&(N.selectedSeq=w.selectedSeq),w.detailTab!==null&&(N.detailTab=w.detailTab),w.playbackCap!==null&&(N.playback={...k.playback,cap:w.playbackCap}),Object.keys(N).length>0&&ne.setState(N),w.captureUrl&&ft.getState().setSelected(w.captureUrl)},[]);const[f,m]=P.useState(!1),[h,y]=P.useState(!1),[g,b]=P.useState(!1);P.useEffect(()=>{const w=()=>{const B=ne.getState(),O=ft.getState();tC({filters:B.filters,selectedSeq:B.selectedSeq,detailTab:B.detailTab,playbackCap:B.playback.cap,captureUrl:O.selectedUrl})},k=ne.subscribe(w),N=ft.subscribe(w);return w(),()=>{k(),N()}},[]);const v=()=>{f||(window.history.pushState({drawer:"info"},"",window.location.href),m(!0))},u=()=>{h||(window.history.pushState({drawer:"perf"},"",window.location.href),y(!0))},p=()=>{g||(window.history.pushState({drawer:"diff"},"",window.location.href),b(!0))},x=()=>{f&&window.history.back()},S=()=>{h&&window.history.back()},T=()=>{g&&window.history.back()},C=w=>{window.history.pushState({drawer:null},"",window.location.href),ne.getState().select(w),m(!1),y(!1),b(!1)};P.useEffect(()=>{const w=k=>{const N=k.state;m((N==null?void 0:N.drawer)==="info"),y((N==null?void 0:N.drawer)==="perf"),b((N==null?void 0:N.drawer)==="diff");const B=mh(window.location.search),O=ne.getState(),Y=ft.getState(),ie={};Object.keys(B.filters).length>0&&(ie.filters={...O.filters,...B.filters}),ie.selectedSeq=B.selectedSeq,ie.detailTab=B.detailTab??"tree",ie.playback={...O.playback,cap:B.playbackCap},ne.setState(ie),B.captureUrl!==Y.selectedUrl&&B.captureUrl&&Y.setSelected(B.captureUrl)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),P.useEffect(()=>{const w=new Set(e.map(Y=>Y.url));if(c.current=c.current,i){c.current=w;return}const k=e[0]??null,N=t===null,B=t!==null&&w.has(t),O=k!==null&&!c.current.has(k.url)&&c.current.size>0;e.length===0?t!==null&&n(null):N||!B?n(k.url):O&&k.url!==t&&(n(k.url),l({message:`switched → ${ef(k)}`,tone:"success"})),c.current=w},[e,t,n,i]),P.useEffect(()=>{if(!a)return;let w=3e3,k=Date.now(),N=null;const B=()=>{N===null&&document.visibilityState==="visible"&&(k=Date.now(),N=setTimeout(()=>l(null),w))},O=()=>{N!==null&&(clearTimeout(N),N=null,w=Math.max(0,w-(Date.now()-k)))},Y=()=>{document.visibilityState==="visible"?B():O()};return document.addEventListener("visibilitychange",Y),B(),()=>{document.removeEventListener("visibilitychange",Y),N&&clearTimeout(N)}},[a]),P.useEffect(()=>{if(ur){Cd();return}if(!r){Cd();return}Gu(r)},[r]);const[$,j]=P.useState(!1);P.useEffect(()=>{const w=k=>{if((k.metaKey||k.ctrlKey)&&(k.key==="k"||k.key==="K")){k.preventDefault(),j(B=>!B);return}if($)return;const N=k.target;if(!(N&&(N.tagName==="INPUT"||N.tagName==="TEXTAREA"))){if(k.key==="Escape"){ne.getState().select(null);return}if(k.key==="j"||k.key==="J"){ly(1);return}if(k.key==="k"||k.key==="K"){ly(-1);return}}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[$]);const R=ne(w=>w.messages),M=ne(w=>w.session),F=ne(w=>w.selectedSeq),V=ne(w=>w.connection),L=ne(w=>w.lastError);P.useEffect(()=>{const w="ACP Devtools";if(!M){document.title=w;return}const{primary:k,secondary:N}=ql(M),B=N?`${k} · ${N}`:k;document.title=`${B} — ${w}`},[M]);const U=P.useMemo(()=>hS(R,F),[R,F]),D=P.useMemo(()=>{const w=Cl(R),k=new Map;for(const[N,B]of w.entries())k.set(B,N);return{responseToRequest:w,requestToResponse:k}},[R]),Q=P.useMemo(()=>Zp(R),[R]);let ee,q=null;if(U){if(U.kind==="response"||U.kind==="error"){const w=D.responseToRequest.get(U.seq);w!==void 0&&(q=R.find(k=>k.seq===w)??null,q&&(ee=U.timestamp-q.timestamp))}else if(U.kind==="request"){const w=D.requestToResponse.get(U.seq);w!==void 0&&(q=R.find(k=>k.seq===w)??null,q&&(ee=q.timestamp-U.timestamp))}}const G=R.length===0&&!M,I=r??"no capture selected",_=ur&&G,A=!ur&&G&&r===null&&e.length===0,E=!ur&&G&&!A;return d.jsxs("div",{className:"flex h-full flex-col bg-surface-base text-ink-primary",children:[d.jsx(IO,{message:(a==null?void 0:a.message)??null,tone:(a==null?void 0:a.tone)??"info"}),d.jsx(WC,{open:$,onClose:()=>j(!1)}),d.jsx(AP,{open:f,onClose:x}),d.jsx(wP,{open:h,onClose:S,onNavigateToSeq:C}),d.jsx(ME,{open:g,onClose:T}),d.jsx(MO,{wsUrl:I,overrideUrl:null,isReplay:i,isImported:s,onPickCapture:w=>{n(w),c.current.add(w)},onImportResult:(w,k)=>l({message:w,tone:k}),activeUrl:r,onOpenInfo:v,onOpenPerf:u,onOpenDiff:p}),d.jsx(XE,{}),d.jsx("main",{className:"flex-1 overflow-hidden",children:_?d.jsx(IP,{initialUrl:UO}):A?d.jsx(QE,{status:V,lastError:L,url:I,captureCount:e.length}):E?d.jsx(QC,{status:V,url:I,lastError:L}):d.jsx(LP,{storageKey:"acp.split.leftPx",initialLeftFraction:.62,minLeft:420,minRight:360,left:d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"min-h-0 flex-1",children:d.jsx(NO,{})}),(i||s)&&d.jsx(RP,{})]}),right:d.jsx(pE,{message:U,...ee!==void 0?{latencyMs:ee}:{},...q?{pairedRequest:q}:{},...U?(()=>{const w=Q.get(U.seq);return w?{validation:w}:{}})():{},onJumpToPaired:w=>ne.getState().select(w)})})}),d.jsx(DP,{})]})}function ly(e){const t=ne.getState(),{messages:n,selectedSeq:o}=t;if(n.length===0)return;if(o===null){const s=e===1?n[0]:n[n.length-1];s&&t.select(s.seq);return}const r=n.findIndex(s=>s.seq===o);if(r===-1){const s=n[0];s&&t.select(s.seq);return}const i=n[r+e];i&&t.select(i.seq)}const Ix=document.getElementById("root");if(!Ix)throw new Error("#root not found");Oc.createRoot(Ix).render(d.jsx(te.StrictMode,{children:d.jsx(LO,{})}));
|
|
1768
|
+
//# sourceMappingURL=index-BnYwNhFF.js.map
|