acp-devtools 0.4.0 → 0.6.0
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 Yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var
|
|
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 Yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var my={exports:{}},fl={},hy={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 $s=Symbol.for("react.element"),
|
|
9
|
+
*/var $s=Symbol.for("react.element"),Lx=Symbol.for("react.portal"),Dx=Symbol.for("react.fragment"),zx=Symbol.for("react.strict_mode"),Fx=Symbol.for("react.profiler"),Bx=Symbol.for("react.provider"),Hx=Symbol.for("react.context"),Vx=Symbol.for("react.forward_ref"),Wx=Symbol.for("react.suspense"),Kx=Symbol.for("react.memo"),Gx=Symbol.for("react.lazy"),kf=Symbol.iterator;function Jx(e){return e===null||typeof e!="object"?null:(e=kf&&e[kf]||e["@@iterator"],typeof e=="function"?e:null)}var yy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gy=Object.assign,vy={};function Jr(e,t,n){this.props=e,this.context=t,this.refs=vy,this.updater=n||yy}Jr.prototype.isReactComponent={};Jr.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")};Jr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function by(){}by.prototype=Jr.prototype;function Xd(e,t,n){this.props=e,this.context=t,this.refs=vy,this.updater=n||yy}var Zd=Xd.prototype=new by;Zd.constructor=Xd;gy(Zd,Jr.prototype);Zd.isPureReactComponent=!0;var Tf=Array.isArray,xy=Object.prototype.hasOwnProperty,eu={current:null},wy={key:!0,ref:!0,__self:!0,__source:!0};function Sy(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)xy.call(t,o)&&!wy.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),d=0;d<a;d++)l[d]=arguments[d+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:eu.current}}function Qx(e,t){return{$$typeof:$s,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function tu(e){return typeof e=="object"&&e!==null&&e.$$typeof===$s}function Yx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _f=/\/+/g;function Vl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Yx(""+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 Lx:s=!0}}if(s)return s=e,r=r(s),e=o===""?"."+Vl(s,0):o,Tf(r)?(n="",e!=null&&(n=e.replace(_f,"$&/")+"/"),sa(r,t,n,"",function(d){return d})):r!=null&&(tu(r)&&(r=Qx(r,n+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(_f,"$&/")+"/")+e)),t.push(r)),1;if(s=0,o=o===""?".":o+":",Tf(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=Jx(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 Xx(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},Zx={ReactCurrentDispatcher:St,ReactCurrentBatchConfig:aa,ReactCurrentOwner:eu};function $y(){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(!tu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Component=Jr;ge.Fragment=Dx;ge.Profiler=Fx;ge.PureComponent=Xd;ge.StrictMode=zx;ge.Suspense=Wx;ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zx;ge.act=$y;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=gy({},e.props),r=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=eu.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)xy.call(t,l)&&!wy.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 d=0;d<l;d++)a[d]=arguments[d+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:Hx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Bx,_context:e},e.Consumer=e};ge.createElement=Sy;ge.createFactory=function(e){var t=Sy.bind(null,e);return t.type=e,t};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:Vx,render:e}};ge.isValidElement=tu;ge.lazy=function(e){return{$$typeof:Gx,_payload:{_status:-1,_result:e},_init:Xx}};ge.memo=function(e,t){return{$$typeof:Kx,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=$y;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";hy.exports=ge;var I=hy.exports;const te=Yd(I);/**
|
|
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 e0=I,t0=Symbol.for("react.element"),n0=Symbol.for("react.fragment"),o0=Object.prototype.hasOwnProperty,r0=e0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i0={key:!0,ref:!0,__self:!0,__source:!0};function ky(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)o0.call(t,o)&&!i0.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:t0,type:e,key:i,ref:s,props:r,_owner:r0.current}}fl.Fragment=n0;fl.jsx=ky;fl.jsxs=ky;my.exports=fl;var c=my.exports,Rc={},Ty={exports:{}},Ut={},_y={exports:{}},jy={};/**
|
|
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(D,J){var O=D.length;D.push(J);e:for(;0<O;){var _=O-1>>>1,M=D[_];if(0<r(M,J))D[_]=J,D[O]=M,O=_;else break e}}function n(D){return D.length===0?null:D[0]}function o(D){if(D.length===0)return null;var J=D[0],O=D.pop();if(O!==J){D[0]=O;e:for(var _=0,M=D.length,P=M>>>1;_<P;){var w=2*(_+1)-1,k=D[w],N=w+1,H=D[N];if(0>r(k,O))N<M&&0>r(H,k)?(D[_]=H,D[N]=O,_=N):(D[_]=k,D[w]=O,_=w);else if(N<M&&0>r(H,O))D[_]=H,D[N]=O,_=N;else break e}}return J}function r(D,J){var O=D.sortIndex-J.sortIndex;return O!==0?O:D.id-J.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=[],
|
|
25
|
+
*/(function(e){function t(D,J){var O=D.length;D.push(J);e:for(;0<O;){var _=O-1>>>1,M=D[_];if(0<r(M,J))D[_]=J,D[O]=M,O=_;else break e}}function n(D){return D.length===0?null:D[0]}function o(D){if(D.length===0)return null;var J=D[0],O=D.pop();if(O!==J){D[0]=O;e:for(var _=0,M=D.length,P=M>>>1;_<P;){var w=2*(_+1)-1,k=D[w],N=w+1,H=D[N];if(0>r(k,O))N<M&&0>r(H,k)?(D[_]=H,D[N]=O,_=N):(D[_]=k,D[w]=O,_=w);else if(N<M&&0>r(H,O))D[_]=H,D[N]=O,_=N;else break e}}return J}function r(D,J){var O=D.sortIndex-J.sortIndex;return O!==0?O:D.id-J.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=[],d=[],p=1,m=null,v=3,h=!1,y=!1,b=!1,g=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,u=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(D){for(var J=n(d);J!==null;){if(J.callback===null)o(d);else if(J.startTime<=D)o(d),J.sortIndex=J.expirationTime,t(l,J);else break;J=n(d)}}function S(D){if(b=!1,x(D),!y)if(n(l)!==null)y=!0,G(T);else{var J=n(d);J!==null&&Y(S,J.startTime-D)}}function T(D,J){y=!1,b&&(b=!1,f(j),j=-1),h=!0;var O=v;try{for(x(J),m=n(l);m!==null&&(!(m.expirationTime>J)||D&&!q());){var _=m.callback;if(typeof _=="function"){m.callback=null,v=m.priorityLevel;var M=_(m.expirationTime<=J);J=e.unstable_now(),typeof M=="function"?m.callback=M:m===n(l)&&o(l),x(J)}else o(l);m=n(l)}if(m!==null)var P=!0;else{var w=n(d);w!==null&&Y(S,w.startTime-J),P=!1}return P}finally{m=null,v=O,h=!1}}var C=!1,$=null,j=-1,A=5,E=-1;function q(){return!(e.unstable_now()-E<A)}function z(){if($!==null){var D=e.unstable_now();E=D;var J=!0;try{J=$(!0,D)}finally{J?U():(C=!1,$=null)}}else C=!1}var U;if(typeof u=="function")U=function(){u(z)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,F=L.port2;L.port1.onmessage=z,U=function(){F.postMessage(null)}}else U=function(){g(z,0)};function G(D){$=D,C||(C=!0,U())}function Y(D,J){j=g(function(){D(e.unstable_now())},J)}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(D){D.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,G(T))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(D){switch(v){case 1:case 2:case 3:var J=3;break;default:J=v}var O=v;v=J;try{return D()}finally{v=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,J){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var O=v;v=D;try{return J()}finally{v=O}},e.unstable_scheduleCallback=function(D,J,O){var _=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?_+O:_):O=_,D){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=O+M,D={id:p++,callback:J,priorityLevel:D,startTime:O,expirationTime:M,sortIndex:-1},O>_?(D.sortIndex=O,t(d,D),n(l)===null&&D===n(d)&&(b?(f(j),j=-1):b=!0,Y(S,O-_))):(D.sortIndex=M,t(l,D),y||h||(y=!0,G(T))),D},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(D){var J=v;return function(){var O=v;v=J;try{return D.apply(this,arguments)}finally{v=O}}}})(jy);_y.exports=jy;var s0=_y.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
|
-
`+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(
|
|
33
|
+
*/var a0=I,qt=s0;function V(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 Ny=new Set,Wi={};function Yo(e,t){Lr(e,t),Lr(e+"Capture",t)}function Lr(e,t){for(Wi[e]=t,e=0;e<t.length;e++)Ny.add(t[e])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ac=Object.prototype.hasOwnProperty,l0=/^[: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]*$/,jf={},Nf={};function c0(e){return Ac.call(Nf,e)?!0:Ac.call(jf,e)?!1:l0.test(e)?Nf[e]=!0:(jf[e]=!0,!1)}function d0(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 u0(e,t,n,o){if(t===null||typeof t>"u"||d0(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 dt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){dt[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];dt[t]=new $t(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){dt[e]=new $t(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){dt[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){dt[e]=new $t(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){dt[e]=new $t(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){dt[e]=new $t(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){dt[e]=new $t(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){dt[e]=new $t(e,5,!1,e.toLowerCase(),null,!1,!1)});var nu=/[\-:]([a-z])/g;function ou(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(nu,ou);dt[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(nu,ou);dt[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(nu,ou);dt[t]=new $t(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){dt[e]=new $t(e,1,!1,e.toLowerCase(),null,!1,!1)});dt.xlinkHref=new $t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){dt[e]=new $t(e,1,!1,e.toLowerCase(),null,!0,!0)});function ru(e,t,n,o){var r=dt.hasOwnProperty(t)?dt[t]:null;(r!==null?r.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(u0(t,n,r,o)&&(n=null),o||r===null?c0(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=a0.__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"),iu=Symbol.for("react.strict_mode"),Mc=Symbol.for("react.profiler"),Cy=Symbol.for("react.provider"),Ey=Symbol.for("react.context"),su=Symbol.for("react.forward_ref"),qc=Symbol.for("react.suspense"),Uc=Symbol.for("react.suspense_list"),au=Symbol.for("react.memo"),Zn=Symbol.for("react.lazy"),Py=Symbol.for("react.offscreen"),Cf=Symbol.iterator;function li(e){return e===null||typeof e!="object"?null:(e=Cf&&e[Cf]||e["@@iterator"],typeof e=="function"?e:null)}var He=Object.assign,Wl;function $i(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(d){var o=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){o=d}e.call(t.prototype)}else{try{throw Error()}catch(d){o=d}e()}}catch(d){if(d&&o&&typeof d.stack=="string"){for(var r=d.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{Kl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Si(e):""}function u0(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 Lc(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 Mc:return"Profiler";case iu:return"StrictMode";case qc:return"Suspense";case Uc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cy:return(e.displayName||"Context")+".Consumer";case Ny:return(e._context.displayName||"Context")+".Provider";case su:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case au:return t=e.displayName||null,t!==null?t:Lc(e.type)||"Memo";case Zn:t=e._payload,e=e._init;try{return Lc(e(t))}catch{}}return null}function p0(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 Lc(t);case 8:return t===iu?"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 Py(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function f0(e){var t=Py(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=f0(e))}function Iy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=Py(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 Dc(e,t){var n=t.checked;return He({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ef(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 Oy(e,t){t=t.checked,t!=null&&ru(e,"checked",t,!1)}function zc(e,t){Oy(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")?Fc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fc(e,t.type,go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pf(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 Fc(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 Bc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return He({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function If(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if($i(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:go(n)}}function Ry(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 Of(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ay(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 Hc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ay(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qs,My=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},m0=["Webkit","ms","Moz","O"];Object.keys(Ni).forEach(function(e){m0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ni[t]=Ni[e]})});function qy(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 Uy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=qy(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var h0=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 Vc(e,t){if(t){if(h0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function Wc(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 Kc=null;function lu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gc=null,_r=null,jr=null;function Rf(e){if(e=_s(e)){if(typeof Gc!="function")throw Error(V(280));var t=e.stateNode;t&&(t=vl(t),Gc(e.stateNode,e.type,t))}}function Ly(e){_r?jr?jr.push(e):jr=[e]:_r=e}function Dy(){if(_r){var e=_r,t=jr;if(jr=_r=null,Rf(e),t)for(e=0;e<t.length;e++)Rf(t[e])}}function zy(e,t){return e(t)}function Fy(){}var Jl=!1;function By(e,t,n){if(Jl)return e(t,n);Jl=!0;try{return zy(e,t,n)}finally{Jl=!1,(_r!==null||jr!==null)&&(Fy(),Dy())}}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(V(231,t,typeof n));return n}var Jc=!1;if(qn)try{var li={};Object.defineProperty(li,"passive",{get:function(){Jc=!0}}),window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{Jc=!1}function y0(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,Qc=null,g0={onError:function(e){Ci=!0,Pa=e}};function v0(e,t,n,o,r,i,s,a,l){Ci=!1,Pa=null,y0.apply(g0,arguments)}function b0(e,t,n,o,r,i,s,a,l){if(v0.apply(this,arguments),Ci){if(Ci){var c=Pa;Ci=!1,Pa=null}else throw Error(V(198));Ia||(Ia=!0,Qc=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 Hy(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 Af(e){if(Xo(e)!==e)throw Error(V(188))}function x0(e){var t=e.alternate;if(!t){if(t=Xo(e),t===null)throw Error(V(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 Af(r),e;if(i===o)return Af(r),t;i=i.sibling}throw Error(V(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(V(189))}}if(n.alternate!==o)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function Vy(e){return e=x0(e),e!==null?Wy(e):null}function Wy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Wy(e);if(t!==null)return t;e=e.sibling}return null}var Ky=qt.unstable_scheduleCallback,Mf=qt.unstable_cancelCallback,w0=qt.unstable_shouldYield,S0=qt.unstable_requestPaint,Ge=qt.unstable_now,$0=qt.unstable_getCurrentPriorityLevel,cu=qt.unstable_ImmediatePriority,Gy=qt.unstable_UserBlockingPriority,Oa=qt.unstable_NormalPriority,k0=qt.unstable_LowPriority,Jy=qt.unstable_IdlePriority,ml=null,$n=null;function T0(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:N0,_0=Math.log,j0=Math.LN2;function N0(e){return e>>>=0,e===0?32:31-(_0(e)/j0|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 C0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function E0(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]=C0(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Yc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Qy(){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 P0(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 du(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 Yy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Xy,uu,Zy,eg,tg,Xc=!1,Ds=[],ao=null,lo=null,co=null,Gi=new Map,Ji=new Map,to=[],I0="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 qf(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&&uu(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function O0(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 ng(e){var t=Mo(e.target);if(t!==null){var n=Xo(t);if(n!==null){if(t=n.tag,t===13){if(t=Hy(n),t!==null){e.blockedOn=t,tg(e.priority,function(){Zy(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=Zc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Kc=o,n.target.dispatchEvent(o),Kc=null}else return t=_s(n),t!==null&&uu(t),e.blockedOn=n,!1;t.shift()}return!0}function Uf(e,t,n){la(e)&&n.delete(t)}function R0(){Xc=!1,ao!==null&&la(ao)&&(ao=null),lo!==null&&la(lo)&&(lo=null),co!==null&&la(co)&&(co=null),Gi.forEach(Uf),Ji.forEach(Uf)}function di(e,t){e.blockedOn===t&&(e.blockedOn=null,Xc||(Xc=!0,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,R0)))}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);)ng(n),n.blockedOn===null&&to.shift()}var Nr=Fn.ReactCurrentBatchConfig,Aa=!0;function A0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=1,pu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function M0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=4,pu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function pu(e,t,n,o){if(Aa){var r=Zc(e,t,n,o);if(r===null)sc(e,t,o,Ma,n),qf(e,o);else if(O0(r,e,t,n,o))o.stopPropagation();else if(qf(e,o),t&4&&-1<I0.indexOf(e)){for(;r!==null;){var i=_s(r);if(i!==null&&Xy(i),i=Zc(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 Zc(e,t,n,o){if(Ma=null,e=lu(o),e=Mo(e),e!==null)if(t=Xo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Hy(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 og(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($0()){case cu:return 1;case Gy:return 4;case Oa:case k0:return 16;case Jy:return 536870912;default:return 16}default:return 16}}var ro=null,fu=null,ca=null;function rg(){if(ca)return ca;var e,t=fu,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 Lf(){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:Lf,this.isPropagationStopped=Lf,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},mu=Lt(Jr),Ts=He({},Jr,{view:0,detail:0}),q0=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:hu,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}}),Df=Lt(hl),U0=He({},hl,{dataTransfer:0}),L0=Lt(U0),D0=He({},Ts,{relatedTarget:0}),Zl=Lt(D0),z0=He({},Jr,{animationName:0,elapsedTime:0,pseudoElement:0}),F0=Lt(z0),B0=He({},Jr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),H0=Lt(B0),V0=He({},Jr,{data:0}),zf=Lt(V0),W0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K0={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"},G0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G0[e])?!!t[e]:!1}function hu(){return J0}var Q0=He({},Ts,{key:function(e){if(e.key){var t=W0[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"?K0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hu,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}}),Y0=Lt(Q0),X0=He({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ff=Lt(X0),Z0=He({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hu}),ew=Lt(Z0),tw=He({},Jr,{propertyName:0,elapsedTime:0,pseudoElement:0}),nw=Lt(tw),ow=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}),rw=Lt(ow),iw=[9,13,27,32],yu=qn&&"CompositionEvent"in window,Ei=null;qn&&"documentMode"in document&&(Ei=document.documentMode);var sw=qn&&"TextEvent"in window&&!Ei,ig=qn&&(!yu||Ei&&8<Ei&&11>=Ei),Bf=" ",Hf=!1;function sg(e,t){switch(e){case"keyup":return iw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ag(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function aw(e,t){switch(e){case"compositionend":return ag(t);case"keypress":return t.which!==32?null:(Hf=!0,Bf);case"textInput":return e=t.data,e===Bf&&Hf?null:e;default:return null}}function lw(e,t){if(mr)return e==="compositionend"||!yu&&sg(e,t)?(e=rg(),ca=fu=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 ig&&t.locale!=="ko"?null:t.data;default:return null}}var cw={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 Vf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cw[e.type]:t==="textarea"}function lg(e,t,n,o){Ly(o),t=qa(t,"onChange"),0<t.length&&(n=new mu("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Pi=null,Yi=null;function dw(e){bg(e,0)}function yl(e){var t=gr(e);if(Iy(t))return e}function uw(e,t){if(e==="change")return t}var cg=!1;if(qn){var ec;if(qn){var tc="oninput"in document;if(!tc){var Wf=document.createElement("div");Wf.setAttribute("oninput","return;"),tc=typeof Wf.oninput=="function"}ec=tc}else ec=!1;cg=ec&&(!document.documentMode||9<document.documentMode)}function Kf(){Pi&&(Pi.detachEvent("onpropertychange",dg),Yi=Pi=null)}function dg(e){if(e.propertyName==="value"&&yl(Yi)){var t=[];lg(t,Yi,e,lu(e)),By(dw,t)}}function pw(e,t,n){e==="focusin"?(Kf(),Pi=t,Yi=n,Pi.attachEvent("onpropertychange",dg)):e==="focusout"&&Kf()}function fw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yl(Yi)}function mw(e,t){if(e==="click")return yl(t)}function hw(e,t){if(e==="input"||e==="change")return yl(t)}function yw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:yw;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(!Ac.call(t,r)||!dn(e[r],t[r]))return!1}return!0}function Gf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jf(e,t){var n=Gf(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=Gf(n)}}function ug(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ug(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pg(){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 gu(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 gw(e){var t=pg(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ug(n.ownerDocument.documentElement,n)){if(o!==null&&gu(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=Jf(n,i);var s=Jf(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 vw=qn&&"documentMode"in document&&11>=document.documentMode,hr=null,ed=null,Ii=null,td=!1;function Qf(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;td||hr==null||hr!==Ea(o)||(o=hr,"selectionStart"in o&&gu(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(ed,"onSelect"),0<o.length&&(t=new mu("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={},fg={};qn&&(fg=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 fg)return nc[e]=t[n];return e}var mg=gl("animationend"),hg=gl("animationiteration"),yg=gl("animationstart"),gg=gl("transitionend"),vg=new Map,Yf="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){vg.set(e,t),Yo(t,[e])}for(var oc=0;oc<Yf.length;oc++){var rc=Yf[oc],bw=rc.toLowerCase(),xw=rc[0].toUpperCase()+rc.slice(1);xo(bw,"on"+xw)}xo(mg,"onAnimationEnd");xo(hg,"onAnimationIteration");xo(yg,"onAnimationStart");xo("dblclick","onDoubleClick");xo("focusin","onFocus");xo("focusout","onBlur");xo(gg,"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(" "),ww=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ti));function Xf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,b0(o,t,void 0,e),e.currentTarget=null}function bg(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;Xf(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;Xf(r,a,c),i=l}}}if(Ia)throw e=Qc,Ia=!1,Qc=null,e}function Oe(e,t){var n=t[sd];n===void 0&&(n=t[sd]=new Set);var o=e+"__bubble";n.has(o)||(xg(t,e,2,!1),n.add(o))}function ic(e,t,n){var o=0;t&&(o|=4),xg(n,e,o,t)}var Bs="_reactListening"+Math.random().toString(36).slice(2);function Zi(e){if(!e[Bs]){e[Bs]=!0,jy.forEach(function(n){n!=="selectionchange"&&(ww.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 xg(e,t,n,o){switch(og(t)){case 1:var r=A0;break;case 4:r=M0;break;default:r=pu}n=r.bind(null,t,n,e),r=void 0,!Jc||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}By(function(){var c=i,f=lu(n),m=[];e:{var v=vg.get(e);if(v!==void 0){var h=mu,y=e;switch(e){case"keypress":if(da(n)===0)break e;case"keydown":case"keyup":h=Y0;break;case"focusin":y="focus",h=Zl;break;case"focusout":y="blur",h=Zl;break;case"beforeblur":case"afterblur":h=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":h=Df;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=L0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=ew;break;case mg:case hg:case yg:h=F0;break;case gg:h=nw;break;case"scroll":h=q0;break;case"wheel":h=rw;break;case"copy":case"cut":case"paste":h=H0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ff}var b=(t&4)!==0,g=!b&&e==="scroll",p=b?v!==null?v+"Capture":null:v;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=Ki(u,p),S!=null&&b.push(es(u,S,x)))),g)break;u=u.return}0<b.length&&(v=new h(v,y,null,n,f),m.push({event:v,listeners:b}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",v&&n!==Kc&&(y=n.relatedTarget||n.fromElement)&&(Mo(y)||y[Un]))break e;if((h||v)&&(v=f.window===f?f:(v=f.ownerDocument)?v.defaultView||v.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?Mo(y):null,y!==null&&(g=Xo(y),y!==g||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(b=Df,S="onMouseLeave",p="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(b=Ff,S="onPointerLeave",p="onPointerEnter",u="pointer"),g=h==null?v:gr(h),x=y==null?v:gr(y),v=new b(S,u+"leave",h,n,f),v.target=g,v.relatedTarget=x,S=null,Mo(f)===c&&(b=new b(p,u+"enter",y,n,f),b.target=x,b.relatedTarget=g,S=b),g=S,h&&y)t:{for(b=h,p=y,u=0,x=b;x;x=or(x))u++;for(x=0,S=p;S;S=or(S))x++;for(;0<u-x;)b=or(b),u--;for(;0<x-u;)p=or(p),x--;for(;u--;){if(b===p||p!==null&&b===p.alternate)break t;b=or(b),p=or(p)}b=null}else b=null;h!==null&&Zf(m,v,h,b,!1),y!==null&&g!==null&&Zf(m,g,y,b,!0)}}e:{if(v=c?gr(c):window,h=v.nodeName&&v.nodeName.toLowerCase(),h==="select"||h==="input"&&v.type==="file")var T=uw;else if(Vf(v))if(cg)T=hw;else{T=fw;var C=pw}else(h=v.nodeName)&&h.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(T=mw);if(T&&(T=T(e,c))){lg(m,T,n,f);break e}C&&C(e,v,c),e==="focusout"&&(C=v._wrapperState)&&C.controlled&&v.type==="number"&&Fc(v,"number",v.value)}switch(C=c?gr(c):window,e){case"focusin":(Vf(C)||C.contentEditable==="true")&&(hr=C,ed=c,Ii=null);break;case"focusout":Ii=ed=hr=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Qf(m,n,f);break;case"selectionchange":if(vw)break;case"keydown":case"keyup":Qf(m,n,f)}var $;if(yu)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?sg(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(ig&&n.locale!=="ko"&&(mr||j!=="onCompositionStart"?j==="onCompositionEnd"&&mr&&($=rg()):(ro=f,fu="value"in ro?ro.value:ro.textContent,mr=!0)),C=qa(c,j),0<C.length&&(j=new zf(j,e,null,n,f),m.push({event:j,listeners:C}),$?j.data=$:($=ag(n),$!==null&&(j.data=$)))),($=sw?aw(e,n):lw(e,n))&&(c=qa(c,"onBeforeInput"),0<c.length&&(f=new zf("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:c}),f.data=$))}bg(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 Zf(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 Sw=/\r\n?/g,$w=/\u0000|\uFFFD/g;function em(e){return(typeof e=="string"?e:""+e).replace(Sw,`
|
|
38
|
-
`).replace($w,"")}function Hs(e,t,n){if(t=em(t),em(e)!==t&&n)throw Error(V(425))}function Ua(){}var nd=null,od=null;function rd(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 id=typeof setTimeout=="function"?setTimeout:void 0,kw=typeof clearTimeout=="function"?clearTimeout:void 0,tm=typeof Promise=="function"?Promise:void 0,Tw=typeof queueMicrotask=="function"?queueMicrotask:typeof tm<"u"?function(e){return tm.resolve(null).then(e).catch(_w)}:id;function _w(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 nm(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,sd="__reactEvents$"+Qr,jw="__reactListeners$"+Qr,Nw="__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=nm(e);e!==null;){if(n=e[gn])return n;e=nm(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(V(33))}function vl(e){return e[ts]||null}var ad=[],vr=-1;function wo(e){return{current:e}}function qe(e){0>vr||(e.current=ad[vr],ad[vr]=null,vr--)}function Ce(e,t){vr++,ad[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 om(e,t,n){if(gt.current!==vo)throw Error(V(168));Ce(gt,t),Ce(Nt,n)}function wg(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(V(108,p0(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 rm(e,t,n){var o=e.stateNode;if(!o)throw Error(V(169));n?(e=wg(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 Sg(e){Cn===null?Cn=[e]:Cn.push(e)}function Cw(e){bl=!0,Sg(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)),Ky(cu,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 $g(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 vu(e){e.return!==null&&(Co(e,1),$g(e,1,0))}function bu(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 kg(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 im(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 ld(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cd(e){if(De){var t=Ot;if(t){var n=t;if(!im(e,t)){if(ld(e))throw Error(V(418));t=uo(n.nextSibling);var o=At;t&&im(e,t)?kg(o,n):(e.flags=e.flags&-4097|2,De=!1,At=e)}}else{if(ld(e))throw Error(V(418));e.flags=e.flags&-4097|2,De=!1,At=e}}}function sm(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 sm(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!rd(e.type,e.memoizedProps)),t&&(t=Ot)){if(ld(e))throw Tg(),Error(V(418));for(;t;)kg(e,t),t=uo(t.nextSibling)}if(sm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(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 Tg(){for(var e=Ot;e;)e=uo(e.nextSibling)}function Dr(){Ot=At=null,De=!1}function xu(e){on===null?on=[e]:on.push(e)}var Ew=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(V(309));var o=n.stateNode}if(!o)throw Error(V(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(V(284));if(!n._owner)throw Error(V(290,e))}return e}function Ws(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function am(e){var t=e._init;return t(e._payload)}function _g(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=ho(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=hc(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===fr?f(p,u,x.props.children,S,x.key):u!==null&&(u.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&am(T)===u.type)?(S=r(u,x.props),S.ref=pi(p,u,x),S.return=p,S):(S=ga(x.type,x.key,x.props,null,p.mode,S),S.ref=pi(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=yc(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=Fo(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=hc(""+u,p.mode,x),u.return=p,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case As:return x=ga(u.type,u.key,u.props,null,p.mode,x),x.ref=pi(p,null,u),x.return=p,x;case pr:return u=yc(u,p.mode,x),u.return=p,u;case Zn:var S=u._init;return m(p,S(u._payload),x)}if($i(u)||ai(u))return u=Fo(u,p.mode,x,null),u.return=p,u;Ws(p,u)}return null}function v(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 As:return x.key===T?l(p,u,x,S):null;case pr:return x.key===T?c(p,u,x,S):null;case Zn:return T=x._init,v(p,u,T(x._payload),S)}if($i(x)||ai(x))return T!==null?null:f(p,u,x,S,null);Ws(p,x)}return null}function h(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 As:return p=p.get(S.key===null?x:S.key)||null,l(u,p,S,T);case pr:return p=p.get(S.key===null?x:S.key)||null,c(u,p,S,T);case Zn:var C=S._init;return h(p,u,x,C(S._payload),T)}if($i(S)||ai(S))return p=p.get(x)||null,f(u,p,S,T,null);Ws(u,S)}return null}function y(p,u,x,S){for(var T=null,C=null,$=u,j=u=0,A=null;$!==null&&j<x.length;j++){$.index>j?(A=$,$=null):A=$.sibling;var E=v(p,$,x[j],S);if(E===null){$===null&&($=A);break}e&&$&&E.alternate===null&&t(p,$),u=i(E,u,j),C===null?T=E:C.sibling=E,C=E,$=A}if(j===x.length)return n(p,$),De&&Co(p,j),T;if($===null){for(;j<x.length;j++)$=m(p,x[j],S),$!==null&&(u=i($,u,j),C===null?T=$:C.sibling=$,C=$);return De&&Co(p,j),T}for($=o(p,$);j<x.length;j++)A=h($,p,j,x[j],S),A!==null&&(e&&A.alternate!==null&&$.delete(A.key===null?j:A.key),u=i(A,u,j),C===null?T=A:C.sibling=A,C=A);return e&&$.forEach(function(q){return t(p,q)}),De&&Co(p,j),T}function b(p,u,x,S){var T=ai(x);if(typeof T!="function")throw Error(V(150));if(x=T.call(x),x==null)throw Error(V(151));for(var C=T=null,$=u,j=u=0,A=null,E=x.next();$!==null&&!E.done;j++,E=x.next()){$.index>j?(A=$,$=null):A=$.sibling;var q=v(p,$,E.value,S);if(q===null){$===null&&($=A);break}e&&$&&q.alternate===null&&t(p,$),u=i(q,u,j),C===null?T=q:C.sibling=q,C=q,$=A}if(E.done)return n(p,$),De&&Co(p,j),T;if($===null){for(;!E.done;j++,E=x.next())E=m(p,E.value,S),E!==null&&(u=i(E,u,j),C===null?T=E:C.sibling=E,C=E);return De&&Co(p,j),T}for($=o(p,$);!E.done;j++,E=x.next())E=h($,p,j,E.value,S),E!==null&&(e&&E.alternate!==null&&$.delete(E.key===null?j:E.key),u=i(E,u,j),C===null?T=E:C.sibling=E,C=E);return e&&$.forEach(function(z){return t(p,z)}),De&&Co(p,j),T}function g(p,u,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=u;C!==null;){if(C.key===T){if(T=x.type,T===fr){if(C.tag===7){n(p,C.sibling),u=r(C,x.props.children),u.return=p,p=u;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&am(T)===C.type){n(p,C.sibling),u=r(C,x.props),u.ref=pi(p,C,x),u.return=p,p=u;break e}n(p,C);break}else t(p,C);C=C.sibling}x.type===fr?(u=Fo(x.props.children,p.mode,S,x.key),u.return=p,p=u):(S=ga(x.type,x.key,x.props,null,p.mode,S),S.ref=pi(p,u,x),S.return=p,p=S)}return s(p);case pr:e:{for(C=x.key;u!==null;){if(u.key===C)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=yc(x,p.mode,S),u.return=p,p=u}return s(p);case Zn:return C=x._init,g(p,u,C(x._payload),S)}if($i(x))return y(p,u,x,S);if(ai(x))return b(p,u,x,S);Ws(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=hc(x,p.mode,S),u.return=p,p=u),s(p)):n(p,u)}return g}var zr=_g(!0),jg=_g(!1),Ba=wo(null),Ha=null,wr=null,wu=null;function Su(){wu=wr=Ha=null}function $u(e){var t=Ba.current;qe(Ba),e._currentValue=t}function dd(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,wu=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(wu!==e)if(e={context:e,memoizedValue:t,next:null},wr===null){if(Ha===null)throw Error(V(308));wr=e,Ha.dependencies={lanes:0,firstContext:e}}else wr=wr.next=e;return t}var qo=null;function ku(e){qo===null?qo=[e]:qo.push(e)}function Ng(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,ku(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 Tu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cg(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,ku(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,du(e,n)}}function lm(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 v=a.lane,h=a.eventTime;if((o&v)===v){f!==null&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,b=a;switch(v=t,h=n,b.tag){case 1:if(y=b.payload,typeof y=="function"){m=y.call(h,m,v);break e}m=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,v=typeof y=="function"?y.call(h,m,v):y,v==null)break e;m=He({},m,v);break e;case 2:eo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,v=r.effects,v===null?r.effects=[a]:v.push(a))}else h={eventTime:h,lane:v,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=h,l=m):f=f.next=h,s|=v;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;v=a,a=v.next,v.next=null,r.lastBaseUpdate=v,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 cm(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(V(191,r));r.call(o)}}}var js={},kn=wo(js),ns=wo(js),os=wo(js);function Uo(e){if(e===js)throw Error(V(174));return e}function _u(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:Hc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hc(t,e)}qe(kn),Ce(kn,t)}function Fr(){qe(kn),qe(ns),qe(os)}function Eg(e){Uo(os.current);var t=Uo(kn.current),n=Hc(t,e.type);t!==n&&(Ce(ns,e),Ce(kn,n))}function ju(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 Nu(){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,Pw=0;function ut(){throw Error(V(321))}function Cu(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 Eu(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?Aw:Mw,e=n(o,r),Oi){i=0;do{if(Oi=!1,rs=0,25<=i)throw Error(V(301));i+=1,ot=Xe=null,t.updateQueue=null,pa.current=qw,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(V(300));return e}function Pu(){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(V(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(V(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(V(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 Pg(){}function Ig(e,t){var n=Be,o=Qt(),r=t(),i=!dn(o.memoizedState,r);if(i&&(o.memoizedState=r,jt=!0),o=o.queue,Iu(Ag.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||ot!==null&&ot.memoizedState.tag&1){if(n.flags|=2048,ss(9,Rg.bind(null,n,o,r,t),void 0,null),rt===null)throw Error(V(349));Vo&30||Og(n,t,r)}return r}function Og(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 Rg(e,t,n,o){t.value=n,t.getSnapshot=o,Mg(t)&&qg(e)}function Ag(e,t,n){return n(function(){Mg(t)&&qg(e)})}function Mg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function qg(e){var t=Ln(e,1);t!==null&&an(t,e,1,-1)}function dm(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=Rw.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 Ug(){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&&Cu(o,s.deps)){r.memoizedState=ss(t,n,i,o);return}}Be.flags|=e,r.memoizedState=ss(1|t,n,i,o)}function um(e,t){return fa(8390656,8,e,t)}function Iu(e,t){return xl(2048,8,e,t)}function Lg(e,t){return xl(4,2,e,t)}function Dg(e,t){return xl(4,4,e,t)}function zg(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 Fg(e,t,n){return n=n!=null?n.concat([e]):null,xl(4,4,zg.bind(null,t,e),n)}function Ou(){}function Bg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Cu(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function Hg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Cu(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function Vg(e,t,n){return Vo&21?(dn(n,t)||(n=Qy(),Be.lanes|=n,Wo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=n)}function Iw(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 Wg(){return Qt().memoizedState}function Ow(e,t,n){var o=mo(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},Kg(e))Gg(t,n);else if(n=Ng(e,t,n,o),n!==null){var r=wt();an(n,e,o,r),Jg(n,t,o)}}function Rw(e,t,n){var o=mo(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kg(e))Gg(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,ku(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=Ng(e,t,r,o),n!==null&&(r=wt(),an(n,e,o,r),Jg(n,t,o))}}function Kg(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Gg(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 Jg(e,t,n){if(n&4194240){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,du(e,n)}}var Ga={readContext:Jt,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useInsertionEffect:ut,useLayoutEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useMutableSource:ut,useSyncExternalStore:ut,useId:ut,unstable_isNewReconciler:!1},Aw={readContext:Jt,useCallback:function(e,t){return hn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:um,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fa(4194308,4,zg.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=Ow.bind(null,Be,e),[o.memoizedState,e]},useRef:function(e){var t=hn();return e={current:e},t.memoizedState=e},useState:dm,useDebugValue:Ou,useDeferredValue:function(e){return hn().memoizedState=e},useTransition:function(){var e=dm(!1),t=e[0];return e=Iw.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(V(407));n=n()}else{if(n=t(),rt===null)throw Error(V(349));Vo&30||Og(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,um(Ag.bind(null,o,i,e),[e]),o.flags|=2048,ss(9,Rg.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=Pw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mw={readContext:Jt,useCallback:Bg,useContext:Jt,useEffect:Iu,useImperativeHandle:Fg,useInsertionEffect:Lg,useLayoutEffect:Dg,useMemo:Hg,useReducer:uc,useRef:Ug,useState:function(){return uc(is)},useDebugValue:Ou,useDeferredValue:function(e){var t=Qt();return Vg(t,Xe.memoizedState,e)},useTransition:function(){var e=uc(is)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Ig,useId:Wg,unstable_isNewReconciler:!1},qw={readContext:Jt,useCallback:Bg,useContext:Jt,useEffect:Iu,useImperativeHandle:Fg,useInsertionEffect:Lg,useLayoutEffect:Dg,useMemo:Hg,useReducer:pc,useRef:Ug,useState:function(){return pc(is)},useDebugValue:Ou,useDeferredValue:function(e){var t=Qt();return Xe===null?t.memoizedState=e:Vg(t,Xe.memoizedState,e)},useTransition:function(){var e=pc(is)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Ig,useId:Wg,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 ud(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 pm(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 Qg(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 fm(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 pd(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Tu(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"&&(ud(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+=u0(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:"")?$i(e):""}function p0(e){switch(e.tag){case 5:return $i(e.type);case 16:return $i("Lazy");case 13:return $i("Suspense");case 19:return $i("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 Lc(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 Mc:return"Profiler";case iu:return"StrictMode";case qc:return"Suspense";case Uc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ey:return(e.displayName||"Context")+".Consumer";case Cy:return(e._context.displayName||"Context")+".Provider";case su:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case au:return t=e.displayName||null,t!==null?t:Lc(e.type)||"Memo";case Zn:t=e._payload,e=e._init;try{return Lc(e(t))}catch{}}return null}function f0(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 Lc(t);case 8:return t===iu?"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 Iy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function m0(e){var t=Iy(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=m0(e))}function Oy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=Iy(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 Dc(e,t){var n=t.checked;return He({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ef(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 Ry(e,t){t=t.checked,t!=null&&ru(e,"checked",t,!1)}function zc(e,t){Ry(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")?Fc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fc(e,t.type,go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pf(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 Fc(e,t,n){(t!=="number"||Ea(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ki=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 Bc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return He({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function If(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(ki(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:go(n)}}function Ay(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 Of(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function My(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 Hc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?My(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qs,qy=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 Ki(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ci={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},h0=["Webkit","ms","Moz","O"];Object.keys(Ci).forEach(function(e){h0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ci[t]=Ci[e]})});function Uy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ci.hasOwnProperty(e)&&Ci[e]?(""+t).trim():t+"px"}function Ly(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=Uy(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var y0=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 Vc(e,t){if(t){if(y0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function Wc(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 Kc=null;function lu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gc=null,_r=null,jr=null;function Rf(e){if(e=_s(e)){if(typeof Gc!="function")throw Error(V(280));var t=e.stateNode;t&&(t=vl(t),Gc(e.stateNode,e.type,t))}}function Dy(e){_r?jr?jr.push(e):jr=[e]:_r=e}function zy(){if(_r){var e=_r,t=jr;if(jr=_r=null,Rf(e),t)for(e=0;e<t.length;e++)Rf(t[e])}}function Fy(e,t){return e(t)}function By(){}var Jl=!1;function Hy(e,t,n){if(Jl)return e(t,n);Jl=!0;try{return Fy(e,t,n)}finally{Jl=!1,(_r!==null||jr!==null)&&(By(),zy())}}function Gi(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(V(231,t,typeof n));return n}var Jc=!1;if(qn)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Jc=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Jc=!1}function g0(e,t,n,o,r,i,s,a,l){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(p){this.onError(p)}}var Ei=!1,Pa=null,Ia=!1,Qc=null,v0={onError:function(e){Ei=!0,Pa=e}};function b0(e,t,n,o,r,i,s,a,l){Ei=!1,Pa=null,g0.apply(v0,arguments)}function x0(e,t,n,o,r,i,s,a,l){if(b0.apply(this,arguments),Ei){if(Ei){var d=Pa;Ei=!1,Pa=null}else throw Error(V(198));Ia||(Ia=!0,Qc=d)}}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 Vy(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 Af(e){if(Xo(e)!==e)throw Error(V(188))}function w0(e){var t=e.alternate;if(!t){if(t=Xo(e),t===null)throw Error(V(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 Af(r),e;if(i===o)return Af(r),t;i=i.sibling}throw Error(V(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(V(189))}}if(n.alternate!==o)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function Wy(e){return e=w0(e),e!==null?Ky(e):null}function Ky(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ky(e);if(t!==null)return t;e=e.sibling}return null}var Gy=qt.unstable_scheduleCallback,Mf=qt.unstable_cancelCallback,S0=qt.unstable_shouldYield,$0=qt.unstable_requestPaint,Ge=qt.unstable_now,k0=qt.unstable_getCurrentPriorityLevel,cu=qt.unstable_ImmediatePriority,Jy=qt.unstable_UserBlockingPriority,Oa=qt.unstable_NormalPriority,T0=qt.unstable_LowPriority,Qy=qt.unstable_IdlePriority,ml=null,$n=null;function _0(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:C0,j0=Math.log,N0=Math.LN2;function C0(e){return e>>>=0,e===0?32:31-(j0(e)/N0|0)|0}var Us=64,Ls=4194304;function Ti(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=Ti(a):(i&=s,i!==0&&(o=Ti(i)))}else s=n&~r,s!==0?o=Ti(s):i!==0&&(o=Ti(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 E0(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 P0(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]=E0(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Yc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Yy(){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 I0(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 du(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 Xy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Zy,uu,eg,tg,ng,Xc=!1,Ds=[],ao=null,lo=null,co=null,Ji=new Map,Qi=new Map,to=[],O0="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 qf(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":Ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qi.delete(t.pointerId)}}function di(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&&uu(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function R0(e,t,n,o,r){switch(t){case"focusin":return ao=di(ao,e,t,n,o,r),!0;case"dragenter":return lo=di(lo,e,t,n,o,r),!0;case"mouseover":return co=di(co,e,t,n,o,r),!0;case"pointerover":var i=r.pointerId;return Ji.set(i,di(Ji.get(i)||null,e,t,n,o,r)),!0;case"gotpointercapture":return i=r.pointerId,Qi.set(i,di(Qi.get(i)||null,e,t,n,o,r)),!0}return!1}function og(e){var t=Mo(e.target);if(t!==null){var n=Xo(t);if(n!==null){if(t=n.tag,t===13){if(t=Vy(n),t!==null){e.blockedOn=t,ng(e.priority,function(){eg(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=Zc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Kc=o,n.target.dispatchEvent(o),Kc=null}else return t=_s(n),t!==null&&uu(t),e.blockedOn=n,!1;t.shift()}return!0}function Uf(e,t,n){la(e)&&n.delete(t)}function A0(){Xc=!1,ao!==null&&la(ao)&&(ao=null),lo!==null&&la(lo)&&(lo=null),co!==null&&la(co)&&(co=null),Ji.forEach(Uf),Qi.forEach(Uf)}function ui(e,t){e.blockedOn===t&&(e.blockedOn=null,Xc||(Xc=!0,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,A0)))}function Yi(e){function t(r){return ui(r,e)}if(0<Ds.length){ui(Ds[0],e);for(var n=1;n<Ds.length;n++){var o=Ds[n];o.blockedOn===e&&(o.blockedOn=null)}}for(ao!==null&&ui(ao,e),lo!==null&&ui(lo,e),co!==null&&ui(co,e),Ji.forEach(t),Qi.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);)og(n),n.blockedOn===null&&to.shift()}var Nr=Fn.ReactCurrentBatchConfig,Aa=!0;function M0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=1,pu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function q0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=4,pu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function pu(e,t,n,o){if(Aa){var r=Zc(e,t,n,o);if(r===null)sc(e,t,o,Ma,n),qf(e,o);else if(R0(r,e,t,n,o))o.stopPropagation();else if(qf(e,o),t&4&&-1<O0.indexOf(e)){for(;r!==null;){var i=_s(r);if(i!==null&&Zy(i),i=Zc(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 Zc(e,t,n,o){if(Ma=null,e=lu(o),e=Mo(e),e!==null)if(t=Xo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vy(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 rg(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(k0()){case cu:return 1;case Jy:return 4;case Oa:case T0:return 16;case Qy:return 536870912;default:return 16}default:return 16}}var ro=null,fu=null,ca=null;function ig(){if(ca)return ca;var e,t=fu,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 Lf(){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:Lf,this.isPropagationStopped=Lf,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 Qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mu=Lt(Qr),Ts=He({},Qr,{view:0,detail:0}),U0=Lt(Ts),Yl,Xl,pi,hl=He({},Ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hu,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!==pi&&(pi&&e.type==="mousemove"?(Yl=e.screenX-pi.screenX,Xl=e.screenY-pi.screenY):Xl=Yl=0,pi=e),Yl)},movementY:function(e){return"movementY"in e?e.movementY:Xl}}),Df=Lt(hl),L0=He({},hl,{dataTransfer:0}),D0=Lt(L0),z0=He({},Ts,{relatedTarget:0}),Zl=Lt(z0),F0=He({},Qr,{animationName:0,elapsedTime:0,pseudoElement:0}),B0=Lt(F0),H0=He({},Qr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),V0=Lt(H0),W0=He({},Qr,{data:0}),zf=Lt(W0),K0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G0={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"},J0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=J0[e])?!!t[e]:!1}function hu(){return Q0}var Y0=He({},Ts,{key:function(e){if(e.key){var t=K0[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"?G0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hu,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}}),X0=Lt(Y0),Z0=He({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ff=Lt(Z0),ew=He({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hu}),tw=Lt(ew),nw=He({},Qr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ow=Lt(nw),rw=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}),iw=Lt(rw),sw=[9,13,27,32],yu=qn&&"CompositionEvent"in window,Pi=null;qn&&"documentMode"in document&&(Pi=document.documentMode);var aw=qn&&"TextEvent"in window&&!Pi,sg=qn&&(!yu||Pi&&8<Pi&&11>=Pi),Bf=" ",Hf=!1;function ag(e,t){switch(e){case"keyup":return sw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function lw(e,t){switch(e){case"compositionend":return lg(t);case"keypress":return t.which!==32?null:(Hf=!0,Bf);case"textInput":return e=t.data,e===Bf&&Hf?null:e;default:return null}}function cw(e,t){if(mr)return e==="compositionend"||!yu&&ag(e,t)?(e=ig(),ca=fu=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 sg&&t.locale!=="ko"?null:t.data;default:return null}}var dw={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 Vf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dw[e.type]:t==="textarea"}function cg(e,t,n,o){Dy(o),t=qa(t,"onChange"),0<t.length&&(n=new mu("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Ii=null,Xi=null;function uw(e){xg(e,0)}function yl(e){var t=gr(e);if(Oy(t))return e}function pw(e,t){if(e==="change")return t}var dg=!1;if(qn){var ec;if(qn){var tc="oninput"in document;if(!tc){var Wf=document.createElement("div");Wf.setAttribute("oninput","return;"),tc=typeof Wf.oninput=="function"}ec=tc}else ec=!1;dg=ec&&(!document.documentMode||9<document.documentMode)}function Kf(){Ii&&(Ii.detachEvent("onpropertychange",ug),Xi=Ii=null)}function ug(e){if(e.propertyName==="value"&&yl(Xi)){var t=[];cg(t,Xi,e,lu(e)),Hy(uw,t)}}function fw(e,t,n){e==="focusin"?(Kf(),Ii=t,Xi=n,Ii.attachEvent("onpropertychange",ug)):e==="focusout"&&Kf()}function mw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yl(Xi)}function hw(e,t){if(e==="click")return yl(t)}function yw(e,t){if(e==="input"||e==="change")return yl(t)}function gw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:gw;function Zi(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(!Ac.call(t,r)||!dn(e[r],t[r]))return!1}return!0}function Gf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jf(e,t){var n=Gf(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=Gf(n)}}function pg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fg(){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 gu(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 vw(e){var t=fg(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pg(n.ownerDocument.documentElement,n)){if(o!==null&&gu(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=Jf(n,i);var s=Jf(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 bw=qn&&"documentMode"in document&&11>=document.documentMode,hr=null,ed=null,Oi=null,td=!1;function Qf(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;td||hr==null||hr!==Ea(o)||(o=hr,"selectionStart"in o&&gu(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}),Oi&&Zi(Oi,o)||(Oi=o,o=qa(ed,"onSelect"),0<o.length&&(t=new mu("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={},mg={};qn&&(mg=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 mg)return nc[e]=t[n];return e}var hg=gl("animationend"),yg=gl("animationiteration"),gg=gl("animationstart"),vg=gl("transitionend"),bg=new Map,Yf="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){bg.set(e,t),Yo(t,[e])}for(var oc=0;oc<Yf.length;oc++){var rc=Yf[oc],xw=rc.toLowerCase(),ww=rc[0].toUpperCase()+rc.slice(1);xo(xw,"on"+ww)}xo(hg,"onAnimationEnd");xo(yg,"onAnimationIteration");xo(gg,"onAnimationStart");xo("dblclick","onDoubleClick");xo("focusin","onFocus");xo("focusout","onBlur");xo(vg,"onTransitionEnd");Lr("onMouseEnter",["mouseout","mouseover"]);Lr("onMouseLeave",["mouseout","mouseover"]);Lr("onPointerEnter",["pointerout","pointerover"]);Lr("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 _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(" "),Sw=new Set("cancel close invalid load scroll toggle".split(" ").concat(_i));function Xf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,x0(o,t,void 0,e),e.currentTarget=null}function xg(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,d=a.currentTarget;if(a=a.listener,l!==i&&r.isPropagationStopped())break e;Xf(r,a,d),i=l}else for(s=0;s<o.length;s++){if(a=o[s],l=a.instance,d=a.currentTarget,a=a.listener,l!==i&&r.isPropagationStopped())break e;Xf(r,a,d),i=l}}}if(Ia)throw e=Qc,Ia=!1,Qc=null,e}function Oe(e,t){var n=t[sd];n===void 0&&(n=t[sd]=new Set);var o=e+"__bubble";n.has(o)||(wg(t,e,2,!1),n.add(o))}function ic(e,t,n){var o=0;t&&(o|=4),wg(n,e,o,t)}var Bs="_reactListening"+Math.random().toString(36).slice(2);function es(e){if(!e[Bs]){e[Bs]=!0,Ny.forEach(function(n){n!=="selectionchange"&&(Sw.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 wg(e,t,n,o){switch(rg(t)){case 1:var r=M0;break;case 4:r=q0;break;default:r=pu}n=r.bind(null,t,n,e),r=void 0,!Jc||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}Hy(function(){var d=i,p=lu(n),m=[];e:{var v=bg.get(e);if(v!==void 0){var h=mu,y=e;switch(e){case"keypress":if(da(n)===0)break e;case"keydown":case"keyup":h=X0;break;case"focusin":y="focus",h=Zl;break;case"focusout":y="blur",h=Zl;break;case"beforeblur":case"afterblur":h=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":h=Df;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=D0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=tw;break;case hg:case yg:case gg:h=B0;break;case vg:h=ow;break;case"scroll":h=U0;break;case"wheel":h=iw;break;case"copy":case"cut":case"paste":h=V0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ff}var b=(t&4)!==0,g=!b&&e==="scroll",f=b?v!==null?v+"Capture":null:v;b=[];for(var u=d,x;u!==null;){x=u;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,f!==null&&(S=Gi(u,f),S!=null&&b.push(ts(u,S,x)))),g)break;u=u.return}0<b.length&&(v=new h(v,y,null,n,p),m.push({event:v,listeners:b}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",v&&n!==Kc&&(y=n.relatedTarget||n.fromElement)&&(Mo(y)||y[Un]))break e;if((h||v)&&(v=p.window===p?p:(v=p.ownerDocument)?v.defaultView||v.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=d,y=y?Mo(y):null,y!==null&&(g=Xo(y),y!==g||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=d),h!==y)){if(b=Df,S="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(b=Ff,S="onPointerLeave",f="onPointerEnter",u="pointer"),g=h==null?v:gr(h),x=y==null?v:gr(y),v=new b(S,u+"leave",h,n,p),v.target=g,v.relatedTarget=x,S=null,Mo(p)===d&&(b=new b(f,u+"enter",y,n,p),b.target=x,b.relatedTarget=g,S=b),g=S,h&&y)t:{for(b=h,f=y,u=0,x=b;x;x=or(x))u++;for(x=0,S=f;S;S=or(S))x++;for(;0<u-x;)b=or(b),u--;for(;0<x-u;)f=or(f),x--;for(;u--;){if(b===f||f!==null&&b===f.alternate)break t;b=or(b),f=or(f)}b=null}else b=null;h!==null&&Zf(m,v,h,b,!1),y!==null&&g!==null&&Zf(m,g,y,b,!0)}}e:{if(v=d?gr(d):window,h=v.nodeName&&v.nodeName.toLowerCase(),h==="select"||h==="input"&&v.type==="file")var T=pw;else if(Vf(v))if(dg)T=yw;else{T=mw;var C=fw}else(h=v.nodeName)&&h.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(T=hw);if(T&&(T=T(e,d))){cg(m,T,n,p);break e}C&&C(e,v,d),e==="focusout"&&(C=v._wrapperState)&&C.controlled&&v.type==="number"&&Fc(v,"number",v.value)}switch(C=d?gr(d):window,e){case"focusin":(Vf(C)||C.contentEditable==="true")&&(hr=C,ed=d,Oi=null);break;case"focusout":Oi=ed=hr=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Qf(m,n,p);break;case"selectionchange":if(bw)break;case"keydown":case"keyup":Qf(m,n,p)}var $;if(yu)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?ag(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(sg&&n.locale!=="ko"&&(mr||j!=="onCompositionStart"?j==="onCompositionEnd"&&mr&&($=ig()):(ro=p,fu="value"in ro?ro.value:ro.textContent,mr=!0)),C=qa(d,j),0<C.length&&(j=new zf(j,e,null,n,p),m.push({event:j,listeners:C}),$?j.data=$:($=lg(n),$!==null&&(j.data=$)))),($=aw?lw(e,n):cw(e,n))&&(d=qa(d,"onBeforeInput"),0<d.length&&(p=new zf("onBeforeInput","beforeinput",null,n,p),m.push({event:p,listeners:d}),p.data=$))}xg(m,t)})}function ts(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=Gi(e,n),i!=null&&o.unshift(ts(e,i,r)),i=Gi(e,t),i!=null&&o.push(ts(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 Zf(e,t,n,o,r){for(var i=t._reactName,s=[];n!==null&&n!==o;){var a=n,l=a.alternate,d=a.stateNode;if(l!==null&&l===o)break;a.tag===5&&d!==null&&(a=d,r?(l=Gi(n,i),l!=null&&s.unshift(ts(n,l,a))):r||(l=Gi(n,i),l!=null&&s.push(ts(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var $w=/\r\n?/g,kw=/\u0000|\uFFFD/g;function em(e){return(typeof e=="string"?e:""+e).replace($w,`
|
|
38
|
+
`).replace(kw,"")}function Hs(e,t,n){if(t=em(t),em(e)!==t&&n)throw Error(V(425))}function Ua(){}var nd=null,od=null;function rd(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 id=typeof setTimeout=="function"?setTimeout:void 0,Tw=typeof clearTimeout=="function"?clearTimeout:void 0,tm=typeof Promise=="function"?Promise:void 0,_w=typeof queueMicrotask=="function"?queueMicrotask:typeof tm<"u"?function(e){return tm.resolve(null).then(e).catch(jw)}:id;function jw(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),Yi(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);Yi(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 nm(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 Yr=Math.random().toString(36).slice(2),gn="__reactFiber$"+Yr,ns="__reactProps$"+Yr,Un="__reactContainer$"+Yr,sd="__reactEvents$"+Yr,Nw="__reactListeners$"+Yr,Cw="__reactHandles$"+Yr;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=nm(e);e!==null;){if(n=e[gn])return n;e=nm(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(V(33))}function vl(e){return e[ns]||null}var ad=[],vr=-1;function wo(e){return{current:e}}function qe(e){0>vr||(e.current=ad[vr],ad[vr]=null,vr--)}function Ce(e,t){vr++,ad[vr]=e.current,e.current=t}var vo={},gt=wo(vo),Nt=wo(!1),Bo=vo;function Dr(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 om(e,t,n){if(gt.current!==vo)throw Error(V(168));Ce(gt,t),Ce(Nt,n)}function Sg(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(V(108,f0(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 rm(e,t,n){var o=e.stateNode;if(!o)throw Error(V(169));n?(e=Sg(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 $g(e){Cn===null?Cn=[e]:Cn.push(e)}function Ew(e){bl=!0,$g(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)),Gy(cu,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 kg(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 vu(e){e.return!==null&&(Co(e,1),kg(e,1,0))}function bu(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 Tg(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 im(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 ld(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cd(e){if(De){var t=Ot;if(t){var n=t;if(!im(e,t)){if(ld(e))throw Error(V(418));t=uo(n.nextSibling);var o=At;t&&im(e,t)?Tg(o,n):(e.flags=e.flags&-4097|2,De=!1,At=e)}}else{if(ld(e))throw Error(V(418));e.flags=e.flags&-4097|2,De=!1,At=e}}}function sm(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 sm(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!rd(e.type,e.memoizedProps)),t&&(t=Ot)){if(ld(e))throw _g(),Error(V(418));for(;t;)Tg(e,t),t=uo(t.nextSibling)}if(sm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(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 _g(){for(var e=Ot;e;)e=uo(e.nextSibling)}function zr(){Ot=At=null,De=!1}function xu(e){on===null?on=[e]:on.push(e)}var Pw=Fn.ReactCurrentBatchConfig;function fi(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(V(309));var o=n.stateNode}if(!o)throw Error(V(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(V(284));if(!n._owner)throw Error(V(290,e))}return e}function Ws(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function am(e){var t=e._init;return t(e._payload)}function jg(e){function t(f,u){if(e){var x=f.deletions;x===null?(f.deletions=[u],f.flags|=16):x.push(u)}}function n(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function o(f,u){for(f=new Map;u!==null;)u.key!==null?f.set(u.key,u):f.set(u.index,u),u=u.sibling;return f}function r(f,u){return f=ho(f,u),f.index=0,f.sibling=null,f}function i(f,u,x){return f.index=x,e?(x=f.alternate,x!==null?(x=x.index,x<u?(f.flags|=2,u):x):(f.flags|=2,u)):(f.flags|=1048576,u)}function s(f){return e&&f.alternate===null&&(f.flags|=2),f}function a(f,u,x,S){return u===null||u.tag!==6?(u=hc(x,f.mode,S),u.return=f,u):(u=r(u,x),u.return=f,u)}function l(f,u,x,S){var T=x.type;return T===fr?p(f,u,x.props.children,S,x.key):u!==null&&(u.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&am(T)===u.type)?(S=r(u,x.props),S.ref=fi(f,u,x),S.return=f,S):(S=ga(x.type,x.key,x.props,null,f.mode,S),S.ref=fi(f,u,x),S.return=f,S)}function d(f,u,x,S){return u===null||u.tag!==4||u.stateNode.containerInfo!==x.containerInfo||u.stateNode.implementation!==x.implementation?(u=yc(x,f.mode,S),u.return=f,u):(u=r(u,x.children||[]),u.return=f,u)}function p(f,u,x,S,T){return u===null||u.tag!==7?(u=Fo(x,f.mode,S,T),u.return=f,u):(u=r(u,x),u.return=f,u)}function m(f,u,x){if(typeof u=="string"&&u!==""||typeof u=="number")return u=hc(""+u,f.mode,x),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case As:return x=ga(u.type,u.key,u.props,null,f.mode,x),x.ref=fi(f,null,u),x.return=f,x;case pr:return u=yc(u,f.mode,x),u.return=f,u;case Zn:var S=u._init;return m(f,S(u._payload),x)}if(ki(u)||li(u))return u=Fo(u,f.mode,x,null),u.return=f,u;Ws(f,u)}return null}function v(f,u,x,S){var T=u!==null?u.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return T!==null?null:a(f,u,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case As:return x.key===T?l(f,u,x,S):null;case pr:return x.key===T?d(f,u,x,S):null;case Zn:return T=x._init,v(f,u,T(x._payload),S)}if(ki(x)||li(x))return T!==null?null:p(f,u,x,S,null);Ws(f,x)}return null}function h(f,u,x,S,T){if(typeof S=="string"&&S!==""||typeof S=="number")return f=f.get(x)||null,a(u,f,""+S,T);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case As:return f=f.get(S.key===null?x:S.key)||null,l(u,f,S,T);case pr:return f=f.get(S.key===null?x:S.key)||null,d(u,f,S,T);case Zn:var C=S._init;return h(f,u,x,C(S._payload),T)}if(ki(S)||li(S))return f=f.get(x)||null,p(u,f,S,T,null);Ws(u,S)}return null}function y(f,u,x,S){for(var T=null,C=null,$=u,j=u=0,A=null;$!==null&&j<x.length;j++){$.index>j?(A=$,$=null):A=$.sibling;var E=v(f,$,x[j],S);if(E===null){$===null&&($=A);break}e&&$&&E.alternate===null&&t(f,$),u=i(E,u,j),C===null?T=E:C.sibling=E,C=E,$=A}if(j===x.length)return n(f,$),De&&Co(f,j),T;if($===null){for(;j<x.length;j++)$=m(f,x[j],S),$!==null&&(u=i($,u,j),C===null?T=$:C.sibling=$,C=$);return De&&Co(f,j),T}for($=o(f,$);j<x.length;j++)A=h($,f,j,x[j],S),A!==null&&(e&&A.alternate!==null&&$.delete(A.key===null?j:A.key),u=i(A,u,j),C===null?T=A:C.sibling=A,C=A);return e&&$.forEach(function(q){return t(f,q)}),De&&Co(f,j),T}function b(f,u,x,S){var T=li(x);if(typeof T!="function")throw Error(V(150));if(x=T.call(x),x==null)throw Error(V(151));for(var C=T=null,$=u,j=u=0,A=null,E=x.next();$!==null&&!E.done;j++,E=x.next()){$.index>j?(A=$,$=null):A=$.sibling;var q=v(f,$,E.value,S);if(q===null){$===null&&($=A);break}e&&$&&q.alternate===null&&t(f,$),u=i(q,u,j),C===null?T=q:C.sibling=q,C=q,$=A}if(E.done)return n(f,$),De&&Co(f,j),T;if($===null){for(;!E.done;j++,E=x.next())E=m(f,E.value,S),E!==null&&(u=i(E,u,j),C===null?T=E:C.sibling=E,C=E);return De&&Co(f,j),T}for($=o(f,$);!E.done;j++,E=x.next())E=h($,f,j,E.value,S),E!==null&&(e&&E.alternate!==null&&$.delete(E.key===null?j:E.key),u=i(E,u,j),C===null?T=E:C.sibling=E,C=E);return e&&$.forEach(function(z){return t(f,z)}),De&&Co(f,j),T}function g(f,u,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=u;C!==null;){if(C.key===T){if(T=x.type,T===fr){if(C.tag===7){n(f,C.sibling),u=r(C,x.props.children),u.return=f,f=u;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&am(T)===C.type){n(f,C.sibling),u=r(C,x.props),u.ref=fi(f,C,x),u.return=f,f=u;break e}n(f,C);break}else t(f,C);C=C.sibling}x.type===fr?(u=Fo(x.props.children,f.mode,S,x.key),u.return=f,f=u):(S=ga(x.type,x.key,x.props,null,f.mode,S),S.ref=fi(f,u,x),S.return=f,f=S)}return s(f);case pr:e:{for(C=x.key;u!==null;){if(u.key===C)if(u.tag===4&&u.stateNode.containerInfo===x.containerInfo&&u.stateNode.implementation===x.implementation){n(f,u.sibling),u=r(u,x.children||[]),u.return=f,f=u;break e}else{n(f,u);break}else t(f,u);u=u.sibling}u=yc(x,f.mode,S),u.return=f,f=u}return s(f);case Zn:return C=x._init,g(f,u,C(x._payload),S)}if(ki(x))return y(f,u,x,S);if(li(x))return b(f,u,x,S);Ws(f,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,u!==null&&u.tag===6?(n(f,u.sibling),u=r(u,x),u.return=f,f=u):(n(f,u),u=hc(x,f.mode,S),u.return=f,f=u),s(f)):n(f,u)}return g}var Fr=jg(!0),Ng=jg(!1),Ba=wo(null),Ha=null,wr=null,wu=null;function Su(){wu=wr=Ha=null}function $u(e){var t=Ba.current;qe(Ba),e._currentValue=t}function dd(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,wu=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(wu!==e)if(e={context:e,memoizedValue:t,next:null},wr===null){if(Ha===null)throw Error(V(308));wr=e,Ha.dependencies={lanes:0,firstContext:e}}else wr=wr.next=e;return t}var qo=null;function ku(e){qo===null?qo=[e]:qo.push(e)}function Cg(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,ku(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 Tu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Eg(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,ku(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,du(e,n)}}function lm(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,d=l.next;l.next=null,s===null?i=d:s.next=d,s=l;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==s&&(a===null?p.firstBaseUpdate=d:a.next=d,p.lastBaseUpdate=l))}if(i!==null){var m=r.baseState;s=0,p=d=l=null,a=i;do{var v=a.lane,h=a.eventTime;if((o&v)===v){p!==null&&(p=p.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,b=a;switch(v=t,h=n,b.tag){case 1:if(y=b.payload,typeof y=="function"){m=y.call(h,m,v);break e}m=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,v=typeof y=="function"?y.call(h,m,v):y,v==null)break e;m=He({},m,v);break e;case 2:eo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,v=r.effects,v===null?r.effects=[a]:v.push(a))}else h={eventTime:h,lane:v,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(d=p=h,l=m):p=p.next=h,s|=v;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;v=a,a=v.next,v.next=null,r.lastBaseUpdate=v,r.shared.pending=null}}while(!0);if(p===null&&(l=m),r.baseState=l,r.firstBaseUpdate=d,r.lastBaseUpdate=p,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 cm(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(V(191,r));r.call(o)}}}var js={},kn=wo(js),os=wo(js),rs=wo(js);function Uo(e){if(e===js)throw Error(V(174));return e}function _u(e,t){switch(Ce(rs,t),Ce(os,e),Ce(kn,js),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Hc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hc(t,e)}qe(kn),Ce(kn,t)}function Br(){qe(kn),qe(os),qe(rs)}function Pg(e){Uo(rs.current);var t=Uo(kn.current),n=Hc(t,e.type);t!==n&&(Ce(os,e),Ce(kn,n))}function ju(e){os.current===e&&(qe(kn),qe(os))}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 Nu(){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,Ri=!1,is=0,Iw=0;function ut(){throw Error(V(321))}function Cu(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 Eu(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?Mw:qw,e=n(o,r),Ri){i=0;do{if(Ri=!1,is=0,25<=i)throw Error(V(301));i+=1,ot=Xe=null,t.updateQueue=null,pa.current=Uw,e=n(o,r)}while(Ri)}if(pa.current=Ga,t=Xe!==null&&Xe.next!==null,Vo=0,ot=Xe=Be=null,Ka=!1,t)throw Error(V(300));return e}function Pu(){var e=is!==0;return is=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(V(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 ss(e,t){return typeof t=="function"?t(e):t}function uc(e){var t=Qt(),n=t.queue;if(n===null)throw Error(V(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,d=i;do{var p=d.lane;if((Vo&p)===p)l!==null&&(l=l.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),o=d.hasEagerState?d.eagerState:e(o,d.action);else{var m={lane:p,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};l===null?(a=l=m,s=o):l=l.next=m,Be.lanes|=p,Wo|=p}d=d.next}while(d!==null&&d!==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(V(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 Ig(){}function Og(e,t){var n=Be,o=Qt(),r=t(),i=!dn(o.memoizedState,r);if(i&&(o.memoizedState=r,jt=!0),o=o.queue,Iu(Mg.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||ot!==null&&ot.memoizedState.tag&1){if(n.flags|=2048,as(9,Ag.bind(null,n,o,r,t),void 0,null),rt===null)throw Error(V(349));Vo&30||Rg(n,t,r)}return r}function Rg(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 Ag(e,t,n,o){t.value=n,t.getSnapshot=o,qg(t)&&Ug(e)}function Mg(e,t,n){return n(function(){qg(t)&&Ug(e)})}function qg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function Ug(e){var t=Ln(e,1);t!==null&&an(t,e,1,-1)}function dm(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:ss,lastRenderedState:e},t.queue=e,e=e.dispatch=Aw.bind(null,Be,e),[t.memoizedState,e]}function as(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 Lg(){return Qt().memoizedState}function fa(e,t,n,o){var r=hn();Be.flags|=e,r.memoizedState=as(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&&Cu(o,s.deps)){r.memoizedState=as(t,n,i,o);return}}Be.flags|=e,r.memoizedState=as(1|t,n,i,o)}function um(e,t){return fa(8390656,8,e,t)}function Iu(e,t){return xl(2048,8,e,t)}function Dg(e,t){return xl(4,2,e,t)}function zg(e,t){return xl(4,4,e,t)}function Fg(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 Bg(e,t,n){return n=n!=null?n.concat([e]):null,xl(4,4,Fg.bind(null,t,e),n)}function Ou(){}function Hg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Cu(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function Vg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Cu(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function Wg(e,t,n){return Vo&21?(dn(n,t)||(n=Yy(),Be.lanes|=n,Wo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=n)}function Ow(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 Kg(){return Qt().memoizedState}function Rw(e,t,n){var o=mo(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},Gg(e))Jg(t,n);else if(n=Cg(e,t,n,o),n!==null){var r=wt();an(n,e,o,r),Qg(n,t,o)}}function Aw(e,t,n){var o=mo(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gg(e))Jg(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,ku(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=Cg(e,t,r,o),n!==null&&(r=wt(),an(n,e,o,r),Qg(n,t,o))}}function Gg(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Jg(e,t){Ri=Ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Qg(e,t,n){if(n&4194240){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,du(e,n)}}var Ga={readContext:Jt,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useInsertionEffect:ut,useLayoutEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useMutableSource:ut,useSyncExternalStore:ut,useId:ut,unstable_isNewReconciler:!1},Mw={readContext:Jt,useCallback:function(e,t){return hn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:um,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fa(4194308,4,Fg.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=Rw.bind(null,Be,e),[o.memoizedState,e]},useRef:function(e){var t=hn();return e={current:e},t.memoizedState=e},useState:dm,useDebugValue:Ou,useDeferredValue:function(e){return hn().memoizedState=e},useTransition:function(){var e=dm(!1),t=e[0];return e=Ow.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(V(407));n=n()}else{if(n=t(),rt===null)throw Error(V(349));Vo&30||Rg(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,um(Mg.bind(null,o,i,e),[e]),o.flags|=2048,as(9,Ag.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=is++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Iw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},qw={readContext:Jt,useCallback:Hg,useContext:Jt,useEffect:Iu,useImperativeHandle:Bg,useInsertionEffect:Dg,useLayoutEffect:zg,useMemo:Vg,useReducer:uc,useRef:Lg,useState:function(){return uc(ss)},useDebugValue:Ou,useDeferredValue:function(e){var t=Qt();return Wg(t,Xe.memoizedState,e)},useTransition:function(){var e=uc(ss)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Ig,useSyncExternalStore:Og,useId:Kg,unstable_isNewReconciler:!1},Uw={readContext:Jt,useCallback:Hg,useContext:Jt,useEffect:Iu,useImperativeHandle:Bg,useInsertionEffect:Dg,useLayoutEffect:zg,useMemo:Vg,useReducer:pc,useRef:Lg,useState:function(){return pc(ss)},useDebugValue:Ou,useDeferredValue:function(e){var t=Qt();return Xe===null?t.memoizedState=e:Wg(t,Xe.memoizedState,e)},useTransition:function(){var e=pc(ss)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Ig,useSyncExternalStore:Og,useId:Kg,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 ud(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 pm(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?!Zi(n,o)||!Zi(r,i):!0}function Yg(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)?Dr(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 fm(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 pd(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Tu(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Jt(i):(i=Ct(t)?Bo:gt.current,r.context=Dr(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ud(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 Hr(e,t){try{var n="",o=t;do n+=p0(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 fc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Uw=typeof WeakMap=="function"?WeakMap:Map;function Yg(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,$d=o),fd(e,t)},n}function Xg(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(){fd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){fd(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 mm(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new Uw;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=Xw.bind(null,e,t,n),t.then(e,e))}function hm(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 ym(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 Lw=Fn.ReactCurrentOwner,jt=!1;function vt(e,t,n,o){t.child=e===null?jg(t,null,n,o):zr(t,e.child,n,o)}function gm(e,t,n,o,r){n=n.render;var i=t.ref;return Cr(t,r),o=Eu(e,t,n,o,i,r),n=Pu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&n&&vu(t),t.flags|=1,vt(e,t,o,r),t.child)}function vm(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!zu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Zg(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 Zg(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 md(e,t,n,o,r)}function ev(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 tv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function md(e,t,n,o,r){var i=Ct(n)?Bo:gt.current;return i=Lr(t,i),Cr(t,r),n=Eu(e,t,n,o,i,r),o=Pu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&o&&vu(t),t.flags|=1,vt(e,t,n,r),t.child)}function bm(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),Qg(t,n,o),pd(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)&&fm(t,s,o,c),eo=!1;var v=t.memoizedState;s.state=v,Va(t,o,s,r),l=t.memoizedState,a!==o||v!==l||Nt.current||eo?(typeof f=="function"&&(ud(t,n,f,o),l=t.memoizedState),(a=eo||pm(t,n,a,o,v,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,Cg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:tn(t.type,a),s.props=c,m=t.pendingProps,v=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ct(n)?Bo:gt.current,l=Lr(t,l));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==m||v!==l)&&fm(t,s,o,l),eo=!1,v=t.memoizedState,s.state=v,Va(t,o,s,r);var y=t.memoizedState;a!==m||v!==y||Nt.current||eo?(typeof h=="function"&&(ud(t,n,h,o),y=t.memoizedState),(c=eo||pm(t,n,c,o,v,y,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(o,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(o,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=y),s.props=o,s.state=y,s.context=l,o=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),o=!1)}return hd(e,t,n,o,i,r)}function hd(e,t,n,o,r,i){tv(e,t);var s=(t.flags&128)!==0;if(!o&&!s)return r&&rm(t,n,!1),Dn(e,t,i);o=t.stateNode,Lw.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&&rm(t,n,!0),t.child}function nv(e){var t=e.stateNode;t.pendingContext?om(e,t.pendingContext,t.pendingContext!==t.context):t.context&&om(e,t.context,!1),_u(e,t.containerInfo)}function xm(e,t,n,o,r){return Dr(),xu(r),t.flags|=256,vt(e,t,n,o),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0};function gd(e){return{baseLanes:e,cachePool:null,transitions:null}}function ov(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 cd(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=gd(n),t.memoizedState=yd,e):Ru(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Dw(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?gd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=yd,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 Ru(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&&xu(o),zr(t,e.child,null,n),e=Ru(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dw(e,t,n,o,r,i,s){if(n)return t.flags&256?(t.flags&=-257,o=fc(Error(V(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=gd(s),t.memoizedState=yd,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(V(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 Du(),o=fc(Error(V(421))),Ks(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,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=Ru(t,o.children),t.flags|=4096,t)}function wm(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),dd(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 rv(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&&wm(e,n,t);else if(e.tag===19)wm(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(V(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 zw(e,t,n){switch(t.tag){case 3:nv(t),Dr();break;case 5:Eg(t);break;case 1:Ct(t.type)&&Da(t);break;case 4:_u(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?ov(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 rv(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,ev(e,t,n)}return Dn(e,t,n)}var iv,vd,sv,av;iv=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}};vd=function(){};sv=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=Dc(e,r),o=Dc(e,o),i=[];break;case"select":r=He({},r,{value:void 0}),o=He({},o,{value:void 0}),i=[];break;case"textarea":r=Bc(e,r),o=Bc(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=Ua)}Vc(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)}};av=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 pt(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 Fw(e,t,n){var o=t.pendingProps;switch(bu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return Ct(t.type)&&La(),pt(t),null;case 3:return o=t.stateNode,Fr(),qe(Nt),qe(gt),Nu(),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&&(_d(on),on=null))),vd(e,t),pt(t),null;case 5:ju(t);var r=Uo(os.current);if(n=t.type,e!==null&&t.stateNode!=null)sv(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(V(166));return pt(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":Ef(o,i),Oe("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",o);break;case"textarea":If(o,i),Oe("invalid",o)}Vc(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),Pf(o,i,!0);break;case"textarea":Ms(o),Of(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=Ay(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,iv(e,t,!1,!1),t.stateNode=e;e:{switch(s=Wc(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":Ef(e,o),r=Dc(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":If(e,o),r=Bc(e,o),Oe("invalid",e);break;default:r=o}Vc(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Uy(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&My(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&&ru(e,i,l,s))}switch(n){case"input":Ms(e),Pf(e,o,!1);break;case"textarea":Ms(e),Of(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 pt(t),null;case 6:if(e&&t.stateNode!=null)av(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(V(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 pt(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))Tg(),Dr(),t.flags|=98560,i=!1;else if(i=Vs(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(V(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[gn]=t}else Dr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else on!==null&&(_d(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):Du())),t.updateQueue!==null&&(t.flags|=4),pt(t),null);case 4:return Fr(),vd(e,t),e===null&&Zi(t.stateNode.containerInfo),pt(t),null;case 10:return $u(t.type._context),pt(t),null;case 17:return Ct(t.type)&&La(),pt(t),null;case 19:if(qe(Fe),i=t.memoizedState,i===null)return pt(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 pt(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):(pt(t),null);case 22:case 23:return Lu(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?Pt&1073741824&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function Bw(e,t){switch(bu(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),Nu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ju(t),null;case 13:if(qe(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(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 $u(t.type._context),null;case 22:case 23:return Lu(),null;case 24:return null;default:return null}}var Gs=!1,mt=!1,Hw=typeof WeakSet=="function"?WeakSet:Set,ee=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 bd(e,t,n){try{n()}catch(o){Ve(e,t,o)}}var Sm=!1;function Vw(e,t){if(nd=Aa,e=pg(),gu(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,v=null;t:for(;;){for(var h;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),(h=m.firstChild)!==null;)v=m,m=h;for(;;){if(m===e)break t;if(v===n&&++c===r&&(a=s),v===i&&++f===o&&(l=s),(h=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(od={focusedElem:e,selectionRange:n},Aa=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,g=y.memoizedState,p=t.stateNode,u=p.getSnapshotBeforeUpdate(t.elementType===t.type?b:tn(t.type,b),g);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(V(163))}}catch(S){Ve(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return y=Sm,Sm=!1,y}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&&bd(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 xd(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 lv(e){var t=e.alternate;t!==null&&(e.alternate=null,lv(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[sd],delete t[jw],delete t[Nw])),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 cv(e){return e.tag===5||e.tag===3||e.tag===4}function $m(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cv(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 wd(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(wd(e,t,n),e=e.sibling;e!==null;)wd(e,t,n),e=e.sibling}function Sd(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(Sd(e,t,n),e=e.sibling;e!==null;)Sd(e,t,n),e=e.sibling}var st=null,nn=!1;function Wn(e,t,n){for(n=n.child;n!==null;)dv(e,t,n),n=n.sibling}function dv(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)&&bd(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 km(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Hw),t.forEach(function(o){var r=eS.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(V(160));dv(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;)uv(t,e),t=t.sibling}function uv(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&&Oy(r,i),Wc(a,s);var c=Wc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],m=l[s+1];f==="style"?Uy(r,m):f==="dangerouslySetInnerHTML"?My(r,m):f==="children"?Wi(r,m):ru(r,f,m,c)}switch(a){case"input":zc(r,i);break;case"textarea":Ry(r,i);break;case"select":var v=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Tr(r,!!i.multiple,h,!1):v!==!!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(V(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||(qu=Ge())),o&4&&km(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(ee=e,f=e.child;f!==null;){for(m=ee=f;ee!==null;){switch(v=ee,h=v.child,v.tag){case 0:case 11:case 14:case 15:Ri(4,v,v.return);break;case 1:Sr(v,v.return);var y=v.stateNode;if(typeof y.componentWillUnmount=="function"){o=v,n=v.return;try{t=o,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(b){Ve(o,n,b)}}break;case 5:Sr(v,v.return);break;case 22:if(v.memoizedState!==null){_m(m);continue}}h!==null?(h.return=v,ee=h):_m(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=qy("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&&km(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(cv(n)){var o=n;break e}n=n.return}throw Error(V(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(Wi(r,""),o.flags&=-33);var i=$m(e);Sd(e,i,r);break;case 3:case 4:var s=o.stateNode.containerInfo,a=$m(e);wd(e,a,s);break;default:throw Error(V(161))}}catch(l){Ve(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ww(e,t,n){ee=e,pv(e)}function pv(e,t,n){for(var o=(e.mode&1)!==0;ee!==null;){var r=ee,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(ee=r;ee!==null;)s=ee,l=s.child,s.tag===22&&s.memoizedState!==null?jm(r):l!==null?(l.return=s,ee=l):jm(r);for(;i!==null;)ee=i,pv(i),i=i.sibling;ee=r,Gs=a,mt=c}Tm(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,ee=i):Tm(e)}}function Tm(e){for(;ee!==null;){var t=ee;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&&cm(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}cm(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(V(163))}mt||t.flags&512&&xd(t)}catch(v){Ve(t,t.return,v)}}if(t===e){ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,ee=n;break}ee=t.return}}function _m(e){for(;ee!==null;){var t=ee;if(t===e){ee=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ee=n;break}ee=t.return}}function jm(e){for(;ee!==null;){var t=ee;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{xd(t)}catch(l){Ve(t,i,l)}break;case 5:var s=t.return;try{xd(t)}catch(l){Ve(t,s,l)}}}catch(l){Ve(t,t.return,l)}if(t===e){ee=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ee=a;break}ee=t.return}}var Kw=Math.ceil,Ja=Fn.ReactCurrentDispatcher,Au=Fn.ReactCurrentOwner,Gt=Fn.ReactCurrentBatchConfig,be=0,rt=null,Je=null,ct=0,Pt=0,$r=wo(0),tt=0,as=null,Wo=0,$l=0,Mu=0,Ai=null,_t=null,qu=0,Hr=1/0,Nn=null,Qa=!1,$d=null,fo=null,Js=!1,io=null,Ya=0,Mi=0,kd=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&&ct!==0?ct&-ct:Ew.transition!==null?(ya===0&&(ya=Qy()),ya):(e=ke,e!==0||(e=window.event,e=e===void 0?16:og(e.type)),e):1}function an(e,t,n,o){if(50<Mi)throw Mi=0,kd=null,Error(V(185));ks(e,n,o),(!(be&2)||e!==rt)&&(e===rt&&(!(be&2)&&($l|=n),tt===4&&no(e,ct)),Et(e,o),n===1&&be===0&&!(t.mode&1)&&(Hr=Ge()+500,bl&&So()))}function Et(e,t){var n=e.callbackNode;E0(e,t);var o=Ra(e,e===rt?ct:0);if(o===0)n!==null&&Mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&Mf(n),t===1)e.tag===0?Cw(Nm.bind(null,e)):Sg(Nm.bind(null,e)),Tw(function(){!(be&6)&&So()}),n=null;else{switch(Yy(o)){case 1:n=cu;break;case 4:n=Gy;break;case 16:n=Oa;break;case 536870912:n=Jy;break;default:n=Oa}n=xv(n,fv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function fv(e,t){if(ha=-1,ya=0,be&6)throw Error(V(327));var n=e.callbackNode;if(Er()&&e.callbackNode!==n)return null;var o=Ra(e,e===rt?ct: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=hv();(rt!==e||ct!==t)&&(Nn=null,Hr=Ge()+500,zo(e,t));do try{Qw();break}catch(a){mv(e,a)}while(!0);Su(),Ja.current=i,be=r,Je!==null?t=0:(rt=null,ct=0,t=tt)}if(t!==0){if(t===2&&(r=Yc(e),r!==0&&(o=r,t=Td(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)&&!Gw(r)&&(t=Xa(e,o),t===2&&(i=Yc(e),i!==0&&(o=i,t=Td(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(V(345));case 2:Eo(e,_t,Nn);break;case 3:if(no(e,o),(o&130023424)===o&&(t=qu+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=id(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*Kw(o/1960))-o,10<o){e.timeoutHandle=id(Eo.bind(null,e,_t,Nn),o);break}Eo(e,_t,Nn);break;case 5:Eo(e,_t,Nn);break;default:throw Error(V(329))}}}return Et(e,Ge()),e.callbackNode===n?fv.bind(null,e):null}function Td(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&&_d(t)),e}function _d(e){_t===null?_t=e:_t.push.apply(_t,e)}function Gw(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&=~Mu,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 Nm(e){if(be&6)throw Error(V(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=Yc(e);o!==0&&(t=o,n=Td(e,o))}if(n===1)throw n=as,zo(e,0),no(e,t),Et(e,Ge()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eo(e,_t,Nn),Et(e,Ge()),null}function Uu(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 Lu(){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,kw(n)),Je!==null)for(n=Je.return;n!==null;){var o=n;switch(bu(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&La();break;case 3:Fr(),qe(Nt),qe(gt),Nu();break;case 5:ju(o);break;case 4:Fr();break;case 13:qe(Fe);break;case 19:qe(Fe);break;case 10:$u(o.type._context);break;case 22:case 23:Lu()}n=n.return}if(rt=e,Je=e=ho(e.current,null),ct=Pt=t,tt=0,as=null,Mu=$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 mv(e,t){do{var n=Je;try{if(Su(),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,Au.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=ct,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 v=f.alternate;v?(f.updateQueue=v.updateQueue,f.memoizedState=v.memoizedState,f.lanes=v.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=hm(s);if(h!==null){h.flags&=-257,ym(h,s,a,i,t),h.mode&1&&mm(i,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var b=new Set;b.add(l),t.updateQueue=b}else y.add(l);break e}else{if(!(t&1)){mm(i,c,t),Du();break e}l=Error(V(426))}}else if(De&&a.mode&1){var g=hm(s);if(g!==null){!(g.flags&65536)&&(g.flags|=256),ym(g,s,a,i,t),xu(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 p=Yg(i,l,t);lm(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"&&(fo===null||!fo.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Xg(i,a,t);lm(i,S);break e}}i=i.return}while(i!==null)}gv(n)}catch(T){t=T,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function hv(){var e=Ja.current;return Ja.current=Ga,e===null?Ga:e}function Du(){(tt===0||tt===3||tt===2)&&(tt=4),rt===null||!(Wo&268435455)&&!($l&268435455)||no(rt,ct)}function Xa(e,t){var n=be;be|=2;var o=hv();(rt!==e||ct!==t)&&(Nn=null,zo(e,t));do try{Jw();break}catch(r){mv(e,r)}while(!0);if(Su(),be=n,Ja.current=o,Je!==null)throw Error(V(261));return rt=null,ct=0,tt}function Jw(){for(;Je!==null;)yv(Je)}function Qw(){for(;Je!==null&&!w0();)yv(Je)}function yv(e){var t=bv(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?gv(e):Je=t,Au.current=null}function gv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Bw(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=Fw(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,Yw(e,t,n,o)}finally{Gt.transition=r,ke=o}return null}function Yw(e,t,n,o){do Er();while(io!==null);if(be&6)throw Error(V(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(V(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(P0(e,i),e===rt&&(Je=rt=null,ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Js||(Js=!0,xv(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,Au.current=null,Vw(e,n),uv(n,e),gw(od),Aa=!!nd,od=nd=null,e.current=n,Ww(n),S0(),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),T0(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=$d,$d=null,e;return Ya&1&&e.tag!==0&&Er(),i=e.pendingLanes,i&1?e===kd?Mi++:(Mi=0,kd=e):Mi=0,So(),null}function Er(){if(io!==null){var e=Yy(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(V(331));var r=be;for(be|=4,ee=e.current;ee!==null;){var i=ee,s=i.child;if(ee.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ee=c;ee!==null;){var f=ee;switch(f.tag){case 0:case 11:case 15:Ri(8,f,i)}var m=f.child;if(m!==null)m.return=f,ee=m;else for(;ee!==null;){f=ee;var v=f.sibling,h=f.return;if(lv(f),f===c){ee=null;break}if(v!==null){v.return=h,ee=v;break}ee=h}}}var y=i.alternate;if(y!==null){var b=y.child;if(b!==null){y.child=null;do{var g=b.sibling;b.sibling=null,b=g}while(b!==null)}}ee=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ee=s;else e:for(;ee!==null;){if(i=ee,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ri(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,ee=p;break e}ee=i.return}}var u=e.current;for(ee=u;ee!==null;){s=ee;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,ee=x;else e:for(s=u;ee!==null;){if(a=ee,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){ee=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ee=S;break e}ee=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 Cm(e,t,n){t=Br(n,t),t=Yg(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)Cm(e,e,n);else for(;t!==null;){if(t.tag===3){Cm(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=Xg(t,e,1),t=po(t,e,1),e=wt(),t!==null&&(ks(t,1,e),Et(t,e));break}}t=t.return}}function Xw(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(ct&n)===n&&(tt===4||tt===3&&(ct&130023424)===ct&&500>Ge()-qu?zo(e,0):Mu|=n),Et(e,t)}function vv(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 Zw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vv(e,n)}function eS(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(V(314))}o!==null&&o.delete(t),vv(e,n)}var bv;bv=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,zw(e,t,n);jt=!!(e.flags&131072)}else jt=!1,De&&t.flags&1048576&&$g(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=Eu(null,t,o,e,r,n);var i=Pu();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,Tu(t),r.updater=wl,t.stateNode=r,r._reactInternals=t,pd(t,o,e,n),t=hd(null,t,o,!0,i,n)):(t.tag=0,De&&i&&vu(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=nS(o),e=tn(o,e),r){case 0:t=md(null,t,o,e,n);break e;case 1:t=bm(null,t,o,e,n);break e;case 11:t=gm(null,t,o,e,n);break e;case 14:t=vm(null,t,o,tn(o.type,e),n);break e}throw Error(V(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),md(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),bm(e,t,o,r,n);case 3:e:{if(nv(t),e===null)throw Error(V(387));o=t.pendingProps,i=t.memoizedState,r=i.element,Cg(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(V(423)),t),t=xm(e,t,o,n,r);break e}else if(o!==r){r=Br(Error(V(424)),t),t=xm(e,t,o,n,r);break e}else for(Ot=uo(t.stateNode.containerInfo.firstChild),At=t,De=!0,on=null,n=jg(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 Eg(t),e===null&&cd(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,s=r.children,rd(o,r)?s=null:i!==null&&rd(o,i)&&(t.flags|=32),tv(e,t),vt(e,t,s,n),t.child;case 6:return e===null&&cd(t),null;case 13:return ov(e,t,n);case 4:return _u(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),gm(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),dd(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(V(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dd(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),vm(e,t,o,r,n);case 15:return Zg(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),Qg(t,o,r),pd(t,o,r,n),hd(null,t,o,!0,e,n);case 19:return rv(e,t,n);case 22:return ev(e,t,n)}throw Error(V(156,t.tag))};function xv(e,t){return Ky(e,t)}function tS(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 tS(e,t,n,o)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nS(e){if(typeof e=="function")return zu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===su)return 11;if(e===au)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")zu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case fr:return Fo(n.children,r,i,t);case iu:s=8,r|=8;break;case Mc:return e=Ht(12,n,t,r|2),e.elementType=Mc,e.lanes=i,e;case qc:return e=Ht(13,n,t,r),e.elementType=qc,e.lanes=i,e;case Uc:return e=Ht(19,n,t,r),e.elementType=Uc,e.lanes=i,e;case Ey:return kl(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ny:s=10;break e;case Cy:s=9;break e;case su:s=11;break e;case au:s=14;break e;case Zn:s=16,o=null;break e}throw Error(V(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=Ey,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 oS(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 Fu(e,t,n,o,r,i,s,a,l){return e=new oS(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},Tu(i),e}function rS(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 wv(e){if(!e)return vo;e=e._reactInternals;e:{if(Xo(e)!==e||e.tag!==1)throw Error(V(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(V(171))}if(e.tag===1){var n=e.type;if(Ct(n))return wg(e,n,t)}return t}function Sv(e,t,n,o,r,i,s,a,l){return e=Fu(n,o,!0,e,r,i,s,a,l),e.context=wv(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=wv(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 Em(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bu(e,t){Em(e,t),(e=e.alternate)&&Em(e,t)}function iS(){return null}var $v=typeof reportError=="function"?reportError:function(e){console.error(e)};function Hu(e){this._internalRoot=e}_l.prototype.render=Hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));Tl(e,t,null,null)};_l.prototype.unmount=Hu.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=eg();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&&ng(e)}};function Vu(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 Pm(){}function sS(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=Sv(t,o,e,0,null,!1,!1,"",Pm);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=Fu(e,0,!1,null,null,!1,!1,"",Pm);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=sS(n,t,e,r,o);return Za(s)}Xy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ki(t.pendingLanes);n!==0&&(du(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)}}),Bu(e,1)}};uu=function(e){if(e.tag===13){var t=Ln(e,134217728);if(t!==null){var n=wt();an(t,e,134217728,n)}Bu(e,134217728)}};Zy=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)}Bu(e,t)}};eg=function(){return ke};tg=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};Gc=function(e,t,n){switch(t){case"input":if(zc(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(V(90));Iy(o),zc(o,r)}}}break;case"textarea":Ry(e,n);break;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}};zy=Uu;Fy=Ko;var aS={usingClientEntryPoint:!1,Events:[_s,gr,vl,Ly,Dy,Uu]},mi={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lS={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=Vy(e),e===null?null:e.stateNode},findFiberByHostInstance:mi.findFiberByHostInstance||iS,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(lS),$n=Qs}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=aS;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vu(t))throw Error(V(200));return rS(e,t,null,n)};Ut.createRoot=function(e,t){if(!Vu(e))throw Error(V(299));var n=!1,o="",r=$v;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Fu(e,1,!1,null,null,n,!1,o,r),e[Un]=t.current,Zi(e.nodeType===8?e.parentNode:e),new Hu(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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Vy(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(V(200));return Nl(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!Vu(e))throw Error(V(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",s=$v;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Sv(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(V(200));return Nl(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!jl(e))throw Error(V(40));return e._reactRootContainer?(Ko(function(){Nl(null,null,e,!1,function(){e._reactRootContainer=null,e[Un]=null})}),!0):!1};Ut.unstable_batchedUpdates=Uu;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!jl(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Nl(e,t,n,!1,o)};Ut.version="18.3.1-next-f1338f8080-20240426";function kv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kv)}catch(e){console.error(e)}}kv(),ky.exports=Ut;var Wu=ky.exports;const cS=Yd(Wu);var Im=Wu;Rc.createRoot=Im.createRoot,Rc.hydrateRoot=Im.hydrateRoot;const Om=e=>{let t;const n=new Set,o=(c,f)=>{const m=typeof c=="function"?c(t):c;if(!Object.is(m,t)){const v=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(h=>h(t,v))}},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},dS=e=>e?Om(e):Om,uS=e=>e;function pS(e,t=uS){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 Rm=e=>{const t=dS(e),n=o=>pS(t,o);return Object.assign(n,t),n},Ku=e=>e?Rm(e):Rm;function fS(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 jd=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return jd(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return jd(o)(n)}}}},mS=(e,t)=>(n,o,r)=>{let i={storage:fS(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,p)=>({...p,...g}),...t},s=!1,a=0;const l=new Set,c=new Set;let f=i.storage;if(!f)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...g)},o,r);const m=()=>{const g=i.partialize({...o()});return f.setItem(i.name,{state:g,version:i.version})},v=r.setState;r.setState=(g,p)=>(v(g,p),m());const h=e((...g)=>(n(...g),m()),o,r);r.getInitialState=()=>h;let y;const b=()=>{var g,p;if(!f)return;const u=++a;s=!1,l.forEach(S=>{var T;return S((T=o())!=null?T:h)});const x=((p=i.onRehydrateStorage)==null?void 0:p.call(i,(g=o())!=null?g:h))||void 0;return jd(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(u!==a)return;const[C,$]=S;if(y=i.merge($,(T=o())!=null?T:h),n(y,!0),C)return m()}).then(()=>{u===a&&(x==null||x(o(),void 0),y=o(),s=!0,c.forEach(S=>S(y)))}).catch(S=>{u===a&&(x==null||x(void 0,S))})};return r.persist={setOptions:g=>{i={...i,...g},g.storage&&(f=g.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},i.skipHydration||b(),y||h},hS=mS,ls=["editor-to-agent","agent-to-editor"],cs=["request","response","notification","error","unknown"],yS={directions:new Set(ls),kinds:new Set(cs),search:"",showStreams:!0};function gS(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=Ku()(hS(e=>({session:null,messages:[],connection:"idle",lastError:null,selectedSeq:null,replayDone:!1,filters:yS,playback:{playhead: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,playhead: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}})),setPlayhead:t=>e(n=>({playback:{...n.playback,playhead: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(n=>{const o=n.session===null;return{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:o?n.selectedSeq:null,replayDone:!0,clearedUpToSeq:o?n.clearedUpToSeq:null,playback:o?{...n.playback,playing:!1}:{playhead: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 vS(e,t){const n=t.search.trim().toLowerCase();return e.filter(o=>{if(!t.directions.has(o.direction))return!1;if(gS(o)){if(!t.showStreams)return!1}else if(!t.kinds.has(o.kind))return!1;return!(n&&!o.raw.toLowerCase().includes(n))})}function bS(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 Tv="ws://127.0.0.1:3737",xS=1500,wS=12e3;let En=null,qi=null,el=0,ds=!1,Gu=Tv,Am=!1,Pr=[],Nd=!1;function Cd(){if(Nd=!1,Pr.length===0)return;const e=Pr;Pr=[],ne.getState().appendMessages(e)}function SS(){Nd||(Nd=!0,typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Cd):Promise.resolve().then(Cd))}function Mm(){if(ds)return;const e=Math.min(wS,xS*Math.pow(1.6,el));el+=1,qi=setTimeout(()=>{qi=null,Ju(Gu)},e)}function Ju(e=Tv){if(En){try{En.close()}catch{}En=null}Pr=[],ds=!1,Gu=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),Mm();return}En=n,n.addEventListener("open",()=>{el=0,Am=!0,ne.getState().setConnection("open")}),n.addEventListener("message",o=>{try{const r=JSON.parse(o.data);if(r.type==="message"){Pr.push(r.message),SS();return}Pr.length>0&&Cd(),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(Am&&o.replayDone){o.setConnection("idle");return}o.setConnection("connecting"),Mm()})}function Ed(){if(ds=!0,qi&&(clearTimeout(qi),qi=null),En){try{En.close()}catch{}En=null}ne.getState().setConnection("idle")}function $S(){Ed(),ds=!1,el=0,Ju(Gu)}async function kS(e){const t=await fetch(`/api/sessions/${e}/messages`,{headers:{accept:"application/json"}});if(!t.ok){const n=await Yu(t);throw new Error(n)}return await t.json()}async function _v(){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 jv(e){const t=await e.text(),n=await fetch("/api/import",{method:"POST",headers:{"content-type":"application/json","x-acp-source-filename":jS(e.name)},body:t});if(!n.ok){const o=await Yu(n);throw new Error(o)}return await n.json()}async function TS(e){const t=await fetch(`/api/sessions/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404){const n=await Yu(t);throw new Error(n)}}function tl(e){return`ws://${window.location.host}/replay/${e}`}function Qu(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 Yu(e){try{const t=await e.json();if(t.error)return t.error}catch{}return`HTTP ${e.status} ${e.statusText}`}function jS(e){return e.replace(/[^\x20-\x7E]/g,"?").slice(0,200)}const Pd="acp.discovery.selectedUrl";function NS(){try{return localStorage.getItem(Pd)}catch{return null}}function CS(e){try{e?localStorage.setItem(Pd,e):localStorage.removeItem(Pd)}catch{}}const at=Ku(e=>({captures:[],savedSessions:[],selectedUrl:NS(),lastFetchAt:null,lastError:null,setCaptures:t=>e({captures:t,lastFetchAt:Date.now(),lastError:null}),setSavedSessions:t=>e({savedSessions:t}),setSelected:t=>{CS(t),e({selectedUrl:t})},setError:t=>e({lastError:t})})),ES=2500;let rr=null;async function PS(){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 qm(){const e=at.getState();try{const[t,n]=await Promise.all([PS(),_v().catch(()=>e.savedSessions)]);e.setCaptures(t),e.setSavedSessions(n)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}function IS(){return qm(),rr&&clearInterval(rr),rr=setInterval(()=>{qm()},ES),()=>{rr&&(clearInterval(rr),rr=null)}}async function Xu(){const e=at.getState();try{const t=await _v();e.setSavedSessions(t)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}const Nv="acp.theme.v1";function OS(){try{const e=localStorage.getItem(Nv);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function RS(){return typeof window>"u"||!window.matchMedia?!0:window.matchMedia("(prefers-color-scheme: dark)").matches}function Cv(e){return e==="system"?RS()?"dark":"light":e}function Ev(e){if(typeof document>"u")return;const t=document.documentElement;t.classList.toggle("light",e==="light"),t.classList.toggle("dark",e==="dark")}const Pv=typeof window<"u"?OS():"system",Iv=Cv(Pv);typeof window<"u"&&Ev(Iv);const Id=Ku(e=>({mode:Pv,resolved:Iv,setMode:t=>{try{localStorage.setItem(Nv,t)}catch{}const n=Cv(t);Ev(n),e({mode:t,resolved:n})}}));function AS(){if(typeof window>"u"||!window.matchMedia)return()=>{};const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{mode:n,setMode:o}=Id.getState();n==="system"&&o("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}const MS={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 fd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Lw=typeof WeakMap=="function"?WeakMap:Map;function Xg(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,$d=o),fd(e,t)},n}function Zg(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(){fd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){fd(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 mm(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new Lw;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=Zw.bind(null,e,t,n),t.then(e,e))}function hm(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 ym(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 Dw=Fn.ReactCurrentOwner,jt=!1;function vt(e,t,n,o){t.child=e===null?Ng(t,null,n,o):Fr(t,e.child,n,o)}function gm(e,t,n,o,r){n=n.render;var i=t.ref;return Cr(t,r),o=Eu(e,t,n,o,i,r),n=Pu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&n&&vu(t),t.flags|=1,vt(e,t,o,r),t.child)}function vm(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!zu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,ev(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:Zi,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 ev(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(Zi(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 md(e,t,n,o,r)}function tv(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 nv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function md(e,t,n,o,r){var i=Ct(n)?Bo:gt.current;return i=Dr(t,i),Cr(t,r),n=Eu(e,t,n,o,i,r),o=Pu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&o&&vu(t),t.flags|=1,vt(e,t,n,r),t.child)}function bm(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),Yg(t,n,o),pd(t,n,o,r),o=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,d=n.contextType;typeof d=="object"&&d!==null?d=Jt(d):(d=Ct(n)?Bo:gt.current,d=Dr(t,d));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==o||l!==d)&&fm(t,s,o,d),eo=!1;var v=t.memoizedState;s.state=v,Va(t,o,s,r),l=t.memoizedState,a!==o||v!==l||Nt.current||eo?(typeof p=="function"&&(ud(t,n,p,o),l=t.memoizedState),(a=eo||pm(t,n,a,o,v,l,d))?(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=d,o=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{s=t.stateNode,Eg(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:tn(t.type,a),s.props=d,m=t.pendingProps,v=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ct(n)?Bo:gt.current,l=Dr(t,l));var h=n.getDerivedStateFromProps;(p=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==m||v!==l)&&fm(t,s,o,l),eo=!1,v=t.memoizedState,s.state=v,Va(t,o,s,r);var y=t.memoizedState;a!==m||v!==y||Nt.current||eo?(typeof h=="function"&&(ud(t,n,h,o),y=t.memoizedState),(d=eo||pm(t,n,d,o,v,y,l)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(o,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(o,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=y),s.props=o,s.state=y,s.context=l,o=d):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),o=!1)}return hd(e,t,n,o,i,r)}function hd(e,t,n,o,r,i){nv(e,t);var s=(t.flags&128)!==0;if(!o&&!s)return r&&rm(t,n,!1),Dn(e,t,i);o=t.stateNode,Dw.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&s?(t.child=Fr(t,e.child,null,i),t.child=Fr(t,null,a,i)):vt(e,t,a,i),t.memoizedState=o.state,r&&rm(t,n,!0),t.child}function ov(e){var t=e.stateNode;t.pendingContext?om(e,t.pendingContext,t.pendingContext!==t.context):t.context&&om(e,t.context,!1),_u(e,t.containerInfo)}function xm(e,t,n,o,r){return zr(),xu(r),t.flags|=256,vt(e,t,n,o),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0};function gd(e){return{baseLanes:e,cachePool:null,transitions:null}}function rv(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 cd(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=gd(n),t.memoizedState=yd,e):Ru(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return zw(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?gd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=yd,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 Ru(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&&xu(o),Fr(t,e.child,null,n),e=Ru(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zw(e,t,n,o,r,i,s){if(n)return t.flags&256?(t.flags&=-257,o=fc(Error(V(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&&Fr(t,e.child,null,s),t.child.memoizedState=gd(s),t.memoizedState=yd,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(V(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 Du(),o=fc(Error(V(421))),Ks(e,t,s,o)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=eS.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=Ru(t,o.children),t.flags|=4096,t)}function wm(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),dd(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 iv(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&&wm(e,n,t);else if(e.tag===19)wm(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(V(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 Fw(e,t,n){switch(t.tag){case 3:ov(t),zr();break;case 5:Pg(t);break;case 1:Ct(t.type)&&Da(t);break;case 4:_u(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?rv(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 iv(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,tv(e,t,n)}return Dn(e,t,n)}var sv,vd,av,lv;sv=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}};vd=function(){};av=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=Dc(e,r),o=Dc(e,o),i=[];break;case"select":r=He({},r,{value:void 0}),o=He({},o,{value:void 0}),i=[];break;case"textarea":r=Bc(e,r),o=Bc(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=Ua)}Vc(n,o);var s;n=null;for(d in r)if(!o.hasOwnProperty(d)&&r.hasOwnProperty(d)&&r[d]!=null)if(d==="style"){var a=r[d];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Wi.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in o){var l=o[d];if(a=r!=null?r[d]:void 0,o.hasOwnProperty(d)&&l!==a&&(l!=null||a!=null))if(d==="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(d,n)),n=l;else d==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(d,l)):d==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(d,""+l):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Wi.hasOwnProperty(d)?(l!=null&&d==="onScroll"&&Oe("scroll",e),i||a===l||(i=[])):(i=i||[]).push(d,l))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};lv=function(e,t,n,o){n!==o&&(t.flags|=4)};function mi(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 pt(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 Bw(e,t,n){var o=t.pendingProps;switch(bu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return Ct(t.type)&&La(),pt(t),null;case 3:return o=t.stateNode,Br(),qe(Nt),qe(gt),Nu(),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&&(_d(on),on=null))),vd(e,t),pt(t),null;case 5:ju(t);var r=Uo(rs.current);if(n=t.type,e!==null&&t.stateNode!=null)av(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(V(166));return pt(t),null}if(e=Uo(kn.current),Vs(t)){o=t.stateNode,n=t.type;var i=t.memoizedProps;switch(o[gn]=t,o[ns]=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":Ef(o,i),Oe("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",o);break;case"textarea":If(o,i),Oe("invalid",o)}Vc(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]):Wi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Oe("scroll",o)}switch(n){case"input":Ms(o),Pf(o,i,!0);break;case"textarea":Ms(o),Of(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=My(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[ns]=o,sv(e,t,!1,!1),t.stateNode=e;e:{switch(s=Wc(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":Ef(e,o),r=Dc(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":If(e,o),r=Bc(e,o),Oe("invalid",e);break;default:r=o}Vc(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Ly(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&qy(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ki(e,l):typeof l=="number"&&Ki(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Wi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Oe("scroll",e):l!=null&&ru(e,i,l,s))}switch(n){case"input":Ms(e),Pf(e,o,!1);break;case"textarea":Ms(e),Of(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 pt(t),null;case 6:if(e&&t.stateNode!=null)lv(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(V(166));if(n=Uo(rs.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 pt(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))_g(),zr(),t.flags|=98560,i=!1;else if(i=Vs(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(V(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[gn]=t}else zr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else on!==null&&(_d(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):Du())),t.updateQueue!==null&&(t.flags|=4),pt(t),null);case 4:return Br(),vd(e,t),e===null&&es(t.stateNode.containerInfo),pt(t),null;case 10:return $u(t.type._context),pt(t),null;case 17:return Ct(t.type)&&La(),pt(t),null;case 19:if(qe(Fe),i=t.memoizedState,i===null)return pt(t),null;if(o=(t.flags&128)!==0,s=i.rendering,s===null)if(o)mi(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,mi(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()>Vr&&(t.flags|=128,o=!0,mi(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),mi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!De)return pt(t),null}else 2*Ge()-i.renderingStartTime>Vr&&n!==1073741824&&(t.flags|=128,o=!0,mi(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):(pt(t),null);case 22:case 23:return Lu(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?Pt&1073741824&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function Hw(e,t){switch(bu(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 Br(),qe(Nt),qe(gt),Nu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ju(t),null;case 13:if(qe(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));zr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Fe),null;case 4:return Br(),null;case 10:return $u(t.type._context),null;case 22:case 23:return Lu(),null;case 24:return null;default:return null}}var Gs=!1,mt=!1,Vw=typeof WeakSet=="function"?WeakSet:Set,ee=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 bd(e,t,n){try{n()}catch(o){Ve(e,t,o)}}var Sm=!1;function Ww(e,t){if(nd=Aa,e=fg(),gu(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,d=0,p=0,m=e,v=null;t:for(;;){for(var h;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),(h=m.firstChild)!==null;)v=m,m=h;for(;;){if(m===e)break t;if(v===n&&++d===r&&(a=s),v===i&&++p===o&&(l=s),(h=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(od={focusedElem:e,selectionRange:n},Aa=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,g=y.memoizedState,f=t.stateNode,u=f.getSnapshotBeforeUpdate(t.elementType===t.type?b:tn(t.type,b),g);f.__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(V(163))}}catch(S){Ve(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return y=Sm,Sm=!1,y}function Ai(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&&bd(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 xd(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 cv(e){var t=e.alternate;t!==null&&(e.alternate=null,cv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gn],delete t[ns],delete t[sd],delete t[Nw],delete t[Cw])),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 dv(e){return e.tag===5||e.tag===3||e.tag===4}function $m(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dv(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 wd(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(wd(e,t,n),e=e.sibling;e!==null;)wd(e,t,n),e=e.sibling}function Sd(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(Sd(e,t,n),e=e.sibling;e!==null;)Sd(e,t,n),e=e.sibling}var st=null,nn=!1;function Wn(e,t,n){for(n=n.child;n!==null;)uv(e,t,n),n=n.sibling}function uv(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),Yi(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)&&bd(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 km(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Vw),t.forEach(function(o){var r=tS.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(V(160));uv(i,s,r),st=null,nn=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(d){Ve(r,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)pv(t,e),t=t.sibling}function pv(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{Ai(3,e,e.return),Sl(3,e)}catch(b){Ve(e,e.return,b)}try{Ai(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{Ki(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&&Ry(r,i),Wc(a,s);var d=Wc(a,i);for(s=0;s<l.length;s+=2){var p=l[s],m=l[s+1];p==="style"?Ly(r,m):p==="dangerouslySetInnerHTML"?qy(r,m):p==="children"?Ki(r,m):ru(r,p,m,d)}switch(a){case"input":zc(r,i);break;case"textarea":Ay(r,i);break;case"select":var v=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Tr(r,!!i.multiple,h,!1):v!==!!i.multiple&&(i.defaultValue!=null?Tr(r,!!i.multiple,i.defaultValue,!0):Tr(r,!!i.multiple,i.multiple?[]:"",!1))}r[ns]=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(V(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{Yi(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||(qu=Ge())),o&4&&km(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(mt=(d=mt)||p,Xt(t,e),mt=d):Xt(t,e),fn(e),o&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!p&&e.mode&1)for(ee=e,p=e.child;p!==null;){for(m=ee=p;ee!==null;){switch(v=ee,h=v.child,v.tag){case 0:case 11:case 14:case 15:Ai(4,v,v.return);break;case 1:Sr(v,v.return);var y=v.stateNode;if(typeof y.componentWillUnmount=="function"){o=v,n=v.return;try{t=o,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(b){Ve(o,n,b)}}break;case 5:Sr(v,v.return);break;case 22:if(v.memoizedState!==null){_m(m);continue}}h!==null?(h.return=v,ee=h):_m(m)}p=p.sibling}e:for(p=null,m=e;;){if(m.tag===5){if(p===null){p=m;try{r=m.stateNode,d?(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=Uy("display",s))}catch(b){Ve(e,e.return,b)}}}else if(m.tag===6){if(p===null)try{m.stateNode.nodeValue=d?"":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;p===m&&(p=null),m=m.return}p===m&&(p=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Xt(t,e),fn(e),o&4&&km(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(dv(n)){var o=n;break e}n=n.return}throw Error(V(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(Ki(r,""),o.flags&=-33);var i=$m(e);Sd(e,i,r);break;case 3:case 4:var s=o.stateNode.containerInfo,a=$m(e);wd(e,a,s);break;default:throw Error(V(161))}}catch(l){Ve(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kw(e,t,n){ee=e,fv(e)}function fv(e,t,n){for(var o=(e.mode&1)!==0;ee!==null;){var r=ee,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 d=mt;if(Gs=s,(mt=l)&&!d)for(ee=r;ee!==null;)s=ee,l=s.child,s.tag===22&&s.memoizedState!==null?jm(r):l!==null?(l.return=s,ee=l):jm(r);for(;i!==null;)ee=i,fv(i),i=i.sibling;ee=r,Gs=a,mt=d}Tm(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,ee=i):Tm(e)}}function Tm(e){for(;ee!==null;){var t=ee;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&&cm(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}cm(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 d=t.alternate;if(d!==null){var p=d.memoizedState;if(p!==null){var m=p.dehydrated;m!==null&&Yi(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}mt||t.flags&512&&xd(t)}catch(v){Ve(t,t.return,v)}}if(t===e){ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,ee=n;break}ee=t.return}}function _m(e){for(;ee!==null;){var t=ee;if(t===e){ee=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ee=n;break}ee=t.return}}function jm(e){for(;ee!==null;){var t=ee;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{xd(t)}catch(l){Ve(t,i,l)}break;case 5:var s=t.return;try{xd(t)}catch(l){Ve(t,s,l)}}}catch(l){Ve(t,t.return,l)}if(t===e){ee=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ee=a;break}ee=t.return}}var Gw=Math.ceil,Ja=Fn.ReactCurrentDispatcher,Au=Fn.ReactCurrentOwner,Gt=Fn.ReactCurrentBatchConfig,be=0,rt=null,Je=null,ct=0,Pt=0,$r=wo(0),tt=0,ls=null,Wo=0,$l=0,Mu=0,Mi=null,_t=null,qu=0,Vr=1/0,Nn=null,Qa=!1,$d=null,fo=null,Js=!1,io=null,Ya=0,qi=0,kd=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&&ct!==0?ct&-ct:Pw.transition!==null?(ya===0&&(ya=Yy()),ya):(e=ke,e!==0||(e=window.event,e=e===void 0?16:rg(e.type)),e):1}function an(e,t,n,o){if(50<qi)throw qi=0,kd=null,Error(V(185));ks(e,n,o),(!(be&2)||e!==rt)&&(e===rt&&(!(be&2)&&($l|=n),tt===4&&no(e,ct)),Et(e,o),n===1&&be===0&&!(t.mode&1)&&(Vr=Ge()+500,bl&&So()))}function Et(e,t){var n=e.callbackNode;P0(e,t);var o=Ra(e,e===rt?ct:0);if(o===0)n!==null&&Mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&Mf(n),t===1)e.tag===0?Ew(Nm.bind(null,e)):$g(Nm.bind(null,e)),_w(function(){!(be&6)&&So()}),n=null;else{switch(Xy(o)){case 1:n=cu;break;case 4:n=Jy;break;case 16:n=Oa;break;case 536870912:n=Qy;break;default:n=Oa}n=wv(n,mv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function mv(e,t){if(ha=-1,ya=0,be&6)throw Error(V(327));var n=e.callbackNode;if(Er()&&e.callbackNode!==n)return null;var o=Ra(e,e===rt?ct: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=yv();(rt!==e||ct!==t)&&(Nn=null,Vr=Ge()+500,zo(e,t));do try{Yw();break}catch(a){hv(e,a)}while(!0);Su(),Ja.current=i,be=r,Je!==null?t=0:(rt=null,ct=0,t=tt)}if(t!==0){if(t===2&&(r=Yc(e),r!==0&&(o=r,t=Td(e,r))),t===1)throw n=ls,zo(e,0),no(e,o),Et(e,Ge()),n;if(t===6)no(e,o);else{if(r=e.current.alternate,!(o&30)&&!Jw(r)&&(t=Xa(e,o),t===2&&(i=Yc(e),i!==0&&(o=i,t=Td(e,i))),t===1))throw n=ls,zo(e,0),no(e,o),Et(e,Ge()),n;switch(e.finishedWork=r,e.finishedLanes=o,t){case 0:case 1:throw Error(V(345));case 2:Eo(e,_t,Nn);break;case 3:if(no(e,o),(o&130023424)===o&&(t=qu+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=id(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*Gw(o/1960))-o,10<o){e.timeoutHandle=id(Eo.bind(null,e,_t,Nn),o);break}Eo(e,_t,Nn);break;case 5:Eo(e,_t,Nn);break;default:throw Error(V(329))}}}return Et(e,Ge()),e.callbackNode===n?mv.bind(null,e):null}function Td(e,t){var n=Mi;return e.current.memoizedState.isDehydrated&&(zo(e,t).flags|=256),e=Xa(e,t),e!==2&&(t=_t,_t=n,t!==null&&_d(t)),e}function _d(e){_t===null?_t=e:_t.push.apply(_t,e)}function Jw(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&=~Mu,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 Nm(e){if(be&6)throw Error(V(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=Yc(e);o!==0&&(t=o,n=Td(e,o))}if(n===1)throw n=ls,zo(e,0),no(e,t),Et(e,Ge()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eo(e,_t,Nn),Et(e,Ge()),null}function Uu(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Vr=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 Lu(){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,Tw(n)),Je!==null)for(n=Je.return;n!==null;){var o=n;switch(bu(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&La();break;case 3:Br(),qe(Nt),qe(gt),Nu();break;case 5:ju(o);break;case 4:Br();break;case 13:qe(Fe);break;case 19:qe(Fe);break;case 10:$u(o.type._context);break;case 22:case 23:Lu()}n=n.return}if(rt=e,Je=e=ho(e.current,null),ct=Pt=t,tt=0,ls=null,Mu=$l=Wo=0,_t=Mi=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 hv(e,t){do{var n=Je;try{if(Su(),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,Ri=!1,is=0,Au.current=null,n===null||n.return===null){tt=1,ls=t,Je=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=ct,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=l,p=a,m=p.tag;if(!(p.mode&1)&&(m===0||m===11||m===15)){var v=p.alternate;v?(p.updateQueue=v.updateQueue,p.memoizedState=v.memoizedState,p.lanes=v.lanes):(p.updateQueue=null,p.memoizedState=null)}var h=hm(s);if(h!==null){h.flags&=-257,ym(h,s,a,i,t),h.mode&1&&mm(i,d,t),t=h,l=d;var y=t.updateQueue;if(y===null){var b=new Set;b.add(l),t.updateQueue=b}else y.add(l);break e}else{if(!(t&1)){mm(i,d,t),Du();break e}l=Error(V(426))}}else if(De&&a.mode&1){var g=hm(s);if(g!==null){!(g.flags&65536)&&(g.flags|=256),ym(g,s,a,i,t),xu(Hr(l,a));break e}}i=l=Hr(l,a),tt!==4&&(tt=2),Mi===null?Mi=[i]:Mi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var f=Xg(i,l,t);lm(i,f);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"&&(fo===null||!fo.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Zg(i,a,t);lm(i,S);break e}}i=i.return}while(i!==null)}vv(n)}catch(T){t=T,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function yv(){var e=Ja.current;return Ja.current=Ga,e===null?Ga:e}function Du(){(tt===0||tt===3||tt===2)&&(tt=4),rt===null||!(Wo&268435455)&&!($l&268435455)||no(rt,ct)}function Xa(e,t){var n=be;be|=2;var o=yv();(rt!==e||ct!==t)&&(Nn=null,zo(e,t));do try{Qw();break}catch(r){hv(e,r)}while(!0);if(Su(),be=n,Ja.current=o,Je!==null)throw Error(V(261));return rt=null,ct=0,tt}function Qw(){for(;Je!==null;)gv(Je)}function Yw(){for(;Je!==null&&!S0();)gv(Je)}function gv(e){var t=xv(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?vv(e):Je=t,Au.current=null}function vv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Hw(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=Bw(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,Xw(e,t,n,o)}finally{Gt.transition=r,ke=o}return null}function Xw(e,t,n,o){do Er();while(io!==null);if(be&6)throw Error(V(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(V(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(I0(e,i),e===rt&&(Je=rt=null,ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Js||(Js=!0,wv(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,Au.current=null,Ww(e,n),pv(n,e),vw(od),Aa=!!nd,od=nd=null,e.current=n,Kw(n),$0(),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),_0(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=$d,$d=null,e;return Ya&1&&e.tag!==0&&Er(),i=e.pendingLanes,i&1?e===kd?qi++:(qi=0,kd=e):qi=0,So(),null}function Er(){if(io!==null){var e=Xy(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(V(331));var r=be;for(be|=4,ee=e.current;ee!==null;){var i=ee,s=i.child;if(ee.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var d=a[l];for(ee=d;ee!==null;){var p=ee;switch(p.tag){case 0:case 11:case 15:Ai(8,p,i)}var m=p.child;if(m!==null)m.return=p,ee=m;else for(;ee!==null;){p=ee;var v=p.sibling,h=p.return;if(cv(p),p===d){ee=null;break}if(v!==null){v.return=h,ee=v;break}ee=h}}}var y=i.alternate;if(y!==null){var b=y.child;if(b!==null){y.child=null;do{var g=b.sibling;b.sibling=null,b=g}while(b!==null)}}ee=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ee=s;else e:for(;ee!==null;){if(i=ee,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ai(9,i,i.return)}var f=i.sibling;if(f!==null){f.return=i.return,ee=f;break e}ee=i.return}}var u=e.current;for(ee=u;ee!==null;){s=ee;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,ee=x;else e:for(s=u;ee!==null;){if(a=ee,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){ee=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ee=S;break e}ee=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 Cm(e,t,n){t=Hr(n,t),t=Xg(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)Cm(e,e,n);else for(;t!==null;){if(t.tag===3){Cm(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=Hr(n,e),e=Zg(t,e,1),t=po(t,e,1),e=wt(),t!==null&&(ks(t,1,e),Et(t,e));break}}t=t.return}}function Zw(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(ct&n)===n&&(tt===4||tt===3&&(ct&130023424)===ct&&500>Ge()-qu?zo(e,0):Mu|=n),Et(e,t)}function bv(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 eS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bv(e,n)}function tS(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(V(314))}o!==null&&o.delete(t),bv(e,n)}var xv;xv=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,Fw(e,t,n);jt=!!(e.flags&131072)}else jt=!1,De&&t.flags&1048576&&kg(t,Fa,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;ma(e,t),e=t.pendingProps;var r=Dr(t,gt.current);Cr(t,n),r=Eu(null,t,o,e,r,n);var i=Pu();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,Tu(t),r.updater=wl,t.stateNode=r,r._reactInternals=t,pd(t,o,e,n),t=hd(null,t,o,!0,i,n)):(t.tag=0,De&&i&&vu(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=oS(o),e=tn(o,e),r){case 0:t=md(null,t,o,e,n);break e;case 1:t=bm(null,t,o,e,n);break e;case 11:t=gm(null,t,o,e,n);break e;case 14:t=vm(null,t,o,tn(o.type,e),n);break e}throw Error(V(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),md(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),bm(e,t,o,r,n);case 3:e:{if(ov(t),e===null)throw Error(V(387));o=t.pendingProps,i=t.memoizedState,r=i.element,Eg(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=Hr(Error(V(423)),t),t=xm(e,t,o,n,r);break e}else if(o!==r){r=Hr(Error(V(424)),t),t=xm(e,t,o,n,r);break e}else for(Ot=uo(t.stateNode.containerInfo.firstChild),At=t,De=!0,on=null,n=Ng(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zr(),o===r){t=Dn(e,t,n);break e}vt(e,t,o,n)}t=t.child}return t;case 5:return Pg(t),e===null&&cd(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,s=r.children,rd(o,r)?s=null:i!==null&&rd(o,i)&&(t.flags|=32),nv(e,t),vt(e,t,s,n),t.child;case 6:return e===null&&cd(t),null;case 13:return rv(e,t,n);case 4:return _u(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Fr(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),gm(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 d=i.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?l.next=l:(l.next=p.next,p.next=l),d.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),dd(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(V(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dd(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),vm(e,t,o,r,n);case 15:return ev(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),Yg(t,o,r),pd(t,o,r,n),hd(null,t,o,!0,e,n);case 19:return iv(e,t,n);case 22:return tv(e,t,n)}throw Error(V(156,t.tag))};function wv(e,t){return Gy(e,t)}function nS(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 nS(e,t,n,o)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oS(e){if(typeof e=="function")return zu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===su)return 11;if(e===au)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")zu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case fr:return Fo(n.children,r,i,t);case iu:s=8,r|=8;break;case Mc:return e=Ht(12,n,t,r|2),e.elementType=Mc,e.lanes=i,e;case qc:return e=Ht(13,n,t,r),e.elementType=qc,e.lanes=i,e;case Uc:return e=Ht(19,n,t,r),e.elementType=Uc,e.lanes=i,e;case Py:return kl(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cy:s=10;break e;case Ey:s=9;break e;case su:s=11;break e;case au:s=14;break e;case Zn:s=16,o=null;break e}throw Error(V(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=Py,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 rS(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 Fu(e,t,n,o,r,i,s,a,l){return e=new rS(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},Tu(i),e}function iS(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 Sv(e){if(!e)return vo;e=e._reactInternals;e:{if(Xo(e)!==e||e.tag!==1)throw Error(V(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(V(171))}if(e.tag===1){var n=e.type;if(Ct(n))return Sg(e,n,t)}return t}function $v(e,t,n,o,r,i,s,a,l){return e=Fu(n,o,!0,e,r,i,s,a,l),e.context=Sv(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=Sv(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 Em(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bu(e,t){Em(e,t),(e=e.alternate)&&Em(e,t)}function sS(){return null}var kv=typeof reportError=="function"?reportError:function(e){console.error(e)};function Hu(e){this._internalRoot=e}_l.prototype.render=Hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));Tl(e,t,null,null)};_l.prototype.unmount=Hu.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=tg();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&&og(e)}};function Vu(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 Pm(){}function aS(e,t,n,o,r){if(r){if(typeof o=="function"){var i=o;o=function(){var d=Za(s);i.call(d)}}var s=$v(t,o,e,0,null,!1,!1,"",Pm);return e._reactRootContainer=s,e[Un]=s.current,es(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 d=Za(l);a.call(d)}}var l=Fu(e,0,!1,null,null,!1,!1,"",Pm);return e._reactRootContainer=l,e[Un]=l.current,es(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=aS(n,t,e,r,o);return Za(s)}Zy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ti(t.pendingLanes);n!==0&&(du(t,n|1),Et(t,Ge()),!(be&6)&&(Vr=Ge()+500,So()))}break;case 13:Ko(function(){var o=Ln(e,1);if(o!==null){var r=wt();an(o,e,1,r)}}),Bu(e,1)}};uu=function(e){if(e.tag===13){var t=Ln(e,134217728);if(t!==null){var n=wt();an(t,e,134217728,n)}Bu(e,134217728)}};eg=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)}Bu(e,t)}};tg=function(){return ke};ng=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};Gc=function(e,t,n){switch(t){case"input":if(zc(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(V(90));Oy(o),zc(o,r)}}}break;case"textarea":Ay(e,n);break;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}};Fy=Uu;By=Ko;var lS={usingClientEntryPoint:!1,Events:[_s,gr,vl,Dy,zy,Uu]},hi={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cS={bundleType:hi.bundleType,version:hi.version,rendererPackageName:hi.rendererPackageName,rendererConfig:hi.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=Wy(e),e===null?null:e.stateNode},findFiberByHostInstance:hi.findFiberByHostInstance||sS,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(cS),$n=Qs}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lS;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vu(t))throw Error(V(200));return iS(e,t,null,n)};Ut.createRoot=function(e,t){if(!Vu(e))throw Error(V(299));var n=!1,o="",r=kv;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Fu(e,1,!1,null,null,n,!1,o,r),e[Un]=t.current,es(e.nodeType===8?e.parentNode:e),new Hu(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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Wy(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(V(200));return Nl(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!Vu(e))throw Error(V(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",s=kv;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=$v(t,null,e,1,n??null,r,!1,i,s),e[Un]=t.current,es(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(V(200));return Nl(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!jl(e))throw Error(V(40));return e._reactRootContainer?(Ko(function(){Nl(null,null,e,!1,function(){e._reactRootContainer=null,e[Un]=null})}),!0):!1};Ut.unstable_batchedUpdates=Uu;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!jl(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Nl(e,t,n,!1,o)};Ut.version="18.3.1-next-f1338f8080-20240426";function Tv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tv)}catch(e){console.error(e)}}Tv(),Ty.exports=Ut;var Wu=Ty.exports;const dS=Yd(Wu);var Im=Wu;Rc.createRoot=Im.createRoot,Rc.hydrateRoot=Im.hydrateRoot;const Om=e=>{let t;const n=new Set,o=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const v=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(h=>h(t,v))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d))},l=t=e(o,r,a);return a},uS=e=>e?Om(e):Om,pS=e=>e;function fS(e,t=pS){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 Rm=e=>{const t=uS(e),n=o=>fS(t,o);return Object.assign(n,t),n},Ku=e=>e?Rm(e):Rm;function mS(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 jd=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return jd(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return jd(o)(n)}}}},hS=(e,t)=>(n,o,r)=>{let i={storage:mS(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,f)=>({...f,...g}),...t},s=!1,a=0;const l=new Set,d=new Set;let p=i.storage;if(!p)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...g)},o,r);const m=()=>{const g=i.partialize({...o()});return p.setItem(i.name,{state:g,version:i.version})},v=r.setState;r.setState=(g,f)=>(v(g,f),m());const h=e((...g)=>(n(...g),m()),o,r);r.getInitialState=()=>h;let y;const b=()=>{var g,f;if(!p)return;const u=++a;s=!1,l.forEach(S=>{var T;return S((T=o())!=null?T:h)});const x=((f=i.onRehydrateStorage)==null?void 0:f.call(i,(g=o())!=null?g:h))||void 0;return jd(p.getItem.bind(p))(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(u!==a)return;const[C,$]=S;if(y=i.merge($,(T=o())!=null?T:h),n(y,!0),C)return m()}).then(()=>{u===a&&(x==null||x(o(),void 0),y=o(),s=!0,d.forEach(S=>S(y)))}).catch(S=>{u===a&&(x==null||x(void 0,S))})};return r.persist={setOptions:g=>{i={...i,...g},g.storage&&(p=g.storage)},clearStorage:()=>{p==null||p.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},i.skipHydration||b(),y||h},yS=hS,cs=["editor-to-agent","agent-to-editor"],ds=["request","response","notification","error","unknown"],gS={directions:new Set(cs),kinds:new Set(ds),search:"",showStreams:!0};function vS(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=Ku()(yS(e=>({session:null,messages:[],connection:"idle",lastError:null,selectedSeq:null,replayDone:!1,filters:gS,playback:{playhead: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,playhead: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}})),setPlayhead:t=>e(n=>({playback:{...n.playback,playhead: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(n=>{const o=n.session===null;return{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:o?n.selectedSeq:null,replayDone:!0,clearedUpToSeq:o?n.clearedUpToSeq:null,playback:o?{...n.playback,playing:!1}:{playhead: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 bS(e,t){const n=t.search.trim().toLowerCase();return e.filter(o=>{if(!t.directions.has(o.direction))return!1;if(vS(o)){if(!t.showStreams)return!1}else if(!t.kinds.has(o.kind))return!1;return!(n&&!o.raw.toLowerCase().includes(n))})}function xS(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 _v="ws://127.0.0.1:3737",wS=1500,SS=12e3;let En=null,Ui=null,el=0,us=!1,Gu=_v,Am=!1,Pr=[],Nd=!1;function Cd(){if(Nd=!1,Pr.length===0)return;const e=Pr;Pr=[],ne.getState().appendMessages(e)}function $S(){Nd||(Nd=!0,typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Cd):Promise.resolve().then(Cd))}function Mm(){if(us)return;const e=Math.min(SS,wS*Math.pow(1.6,el));el+=1,Ui=setTimeout(()=>{Ui=null,Ju(Gu)},e)}function Ju(e=_v){if(En){try{En.close()}catch{}En=null}Pr=[],us=!1,Gu=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),Mm();return}En=n,n.addEventListener("open",()=>{el=0,Am=!0,ne.getState().setConnection("open")}),n.addEventListener("message",o=>{try{const r=JSON.parse(o.data);if(r.type==="message"){Pr.push(r.message),$S();return}Pr.length>0&&Cd(),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),us){ne.getState().setConnection("closed");return}const o=ne.getState();if(Am&&o.replayDone){o.setConnection("idle");return}o.setConnection("connecting"),Mm()})}function Ed(){if(us=!0,Ui&&(clearTimeout(Ui),Ui=null),En){try{En.close()}catch{}En=null}ne.getState().setConnection("idle")}function kS(){Ed(),us=!1,el=0,Ju(Gu)}async function TS(e){const t=await fetch(`/api/sessions/${e}/messages`,{headers:{accept:"application/json"}});if(!t.ok){const n=await Yu(t);throw new Error(n)}return await t.json()}async function jv(){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 Nv(e){const t=await e.text(),n=await fetch("/api/import",{method:"POST",headers:{"content-type":"application/json","x-acp-source-filename":NS(e.name)},body:t});if(!n.ok){const o=await Yu(n);throw new Error(o)}return await n.json()}async function _S(e){const t=await fetch(`/api/sessions/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404){const n=await Yu(t);throw new Error(n)}}function tl(e){return`ws://${window.location.host}/replay/${e}`}function Qu(e){return e!==null&&/\/replay\/\d+$/.test(e)}function jS(e){const t=e.match(/\/replay\/(\d+)$/);return t?Number(t[1]):null}async function Yu(e){try{const t=await e.json();if(t.error)return t.error}catch{}return`HTTP ${e.status} ${e.statusText}`}function NS(e){return e.replace(/[^\x20-\x7E]/g,"?").slice(0,200)}const Pd="acp.discovery.selectedUrl";function CS(){try{return localStorage.getItem(Pd)}catch{return null}}function ES(e){try{e?localStorage.setItem(Pd,e):localStorage.removeItem(Pd)}catch{}}const at=Ku(e=>({captures:[],savedSessions:[],selectedUrl:CS(),lastFetchAt:null,lastError:null,setCaptures:t=>e({captures:t,lastFetchAt:Date.now(),lastError:null}),setSavedSessions:t=>e({savedSessions:t}),setSelected:t=>{ES(t),e({selectedUrl:t})},setError:t=>e({lastError:t})})),PS=2500;let rr=null;async function IS(){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 qm(){const e=at.getState();try{const[t,n]=await Promise.all([IS(),jv().catch(()=>e.savedSessions)]);e.setCaptures(t),e.setSavedSessions(n)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}function OS(){return qm(),rr&&clearInterval(rr),rr=setInterval(()=>{qm()},PS),()=>{rr&&(clearInterval(rr),rr=null)}}async function Xu(){const e=at.getState();try{const t=await jv();e.setSavedSessions(t)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}const Cv="acp.theme.v1";function RS(){try{const e=localStorage.getItem(Cv);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function AS(){return typeof window>"u"||!window.matchMedia?!0:window.matchMedia("(prefers-color-scheme: dark)").matches}function Ev(e){return e==="system"?AS()?"dark":"light":e}function Pv(e){if(typeof document>"u")return;const t=document.documentElement;t.classList.toggle("light",e==="light"),t.classList.toggle("dark",e==="dark")}const Iv=typeof window<"u"?RS():"system",Ov=Ev(Iv);typeof window<"u"&&Pv(Ov);const Id=Ku(e=>({mode:Iv,resolved:Ov,setMode:t=>{try{localStorage.setItem(Cv,t)}catch{}const n=Ev(t);Pv(n),e({mode:t,resolved:n})}}));function MS(){if(typeof window>"u"||!window.matchMedia)return()=>{};const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{mode:n,setMode:o}=Id.getState();n==="system"&&o("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}const qS={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"}},US="https://json-schema.org/draft/2020-12/schema",LS=[{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"}],LS="Agent Client Protocol",Ov={$defs:MS,$schema:qS,anyOf:US,title:LS};var Od={exports:{}},Rv={},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(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=[h(p[0])];let S=0;for(;S<u.length;)x.push(i),a(x,u[S]),x.push(i,h(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:h(Array.isArray(p)?p.join(","):p)}function v(p){return new o(h(p))}e.stringify=v;function h(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function y(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new o(`.${p}`):r`[${p}]`}e.getProperty=y;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 g(p){return new o(p.toString())}e.regexpCode=g})(us);var Rd={};(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 v=this.toName(c),{prefix:h}=v,y=(m=f.key)!==null&&m!==void 0?m:f.ref;let b=this._values[h];if(b){const u=b.get(y);if(u)return u}else b=this._values[h]=new Map;b.set(y,v);const g=this._scope[h]||(this._scope[h]=[]),p=g.length;return g[p]=f.ref,v.setValue(f,{property:h,itemIndex:p}),v}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,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},f,m)}_reduceValues(c,f,m={},v){let h=t.nil;for(const y in c){const b=c[y];if(!b)continue;const g=m[y]=m[y]||new Map;b.forEach(p=>{if(g.has(p))return;g.set(p,o.Started);let u=f(p);if(u){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${x} ${p} = ${u};${this.opts._n}`}else if(u=v==null?void 0:v(p))h=(0,t._)`${h}${u}${this.opts._n}`;else throw new n(p);g.set(p,o.Completed)})}return h}}e.ValueScope=a})(Rd);(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=Rd;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=Rd;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,H=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${H};`+k}optimizeNames(w,k){if(w[this.name.str])return this.rhs&&(this.rhs=L(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=L(this.rhs,w,k),this}get names(){const w=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(w,this.rhs)}}class l extends a{constructor(w,k,N,H){super(w,N,H),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 v 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=L(this.code,w,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h 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 H=N.length;for(;H--;){const R=N[H];R.optimizeNames(w,k)||(F(w,R.names),N.splice(H,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((w,k)=>z(w,k.names),{})}}class y extends h{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class b extends h{}class g extends y{}g.kind="else";class p extends y{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 g(N):N}if(k)return w===!1?k instanceof p?k:k.nodes:this.nodes.length?this:new p(G(w),k instanceof p?[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=L(this.condition,w,k),this}get names(){const w=super.names;return U(w,this.condition),this.else&&z(w,this.else.names),w}}p.kind="if";class u extends y{}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=L(this.iteration,w,k),this}get names(){return z(super.names,this.iteration.names)}}class S extends u{constructor(w,k,N,H){super(),this.varKind=w,this.name=k,this.from=N,this.to=H}render(w){const k=w.es5?n.varKinds.var:this.varKind,{name:N,from:H,to:R}=this;return`for(${k} ${N}=${H}; ${N}<${R}; ${N}++)`+super.render(w)}get names(){const w=U(super.names,this.from);return U(w,this.to)}}class T extends u{constructor(w,k,N,H){super(),this.loop=w,this.varKind=k,this.name=N,this.iterable=H}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=L(this.iterable,w,k),this}get names(){return z(super.names,this.iterable.names)}}class C extends y{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 h{render(w){return"return "+super.render(w)}}$.kind="return";class j extends y{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,H;return super.optimizeNames(w,k),(N=this.catch)===null||N===void 0||N.optimizeNames(w,k),(H=this.finally)===null||H===void 0||H.optimizeNames(w,k),this}get names(){const w=super.names;return this.catch&&z(w,this.catch.names),this.finally&&z(w,this.finally.names),w}}class A extends y{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}}A.kind="catch";class E extends y{render(w){return"finally"+super.render(w)}}E.kind="finally";class q{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,H){const R=this._scope.toName(k);return N!==void 0&&H&&(this._constants[R.str]=N),this._leafNode(new s(w,R,N)),R}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 v(w)),this}object(...w){const k=["{"];for(const[N,H]of w)k.length>1&&k.push(","),k.push(N),(N!==H||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,H));return k.push("}"),new t._Code(k)}if(w,k,N){if(this._blockNode(new p(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 p(w))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(p,g)}_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,H,R=this.opts.es5?n.varKinds.var:n.varKinds.let){const X=this._scope.toName(w);return this._for(new S(R,X,k,N),()=>H(X))}forOf(w,k,N,H=n.varKinds.const){const R=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(R,(0,t._)`${X}[${ie}]`),N(R)})}return this._for(new T("of",H,R,k),()=>N(R))}forIn(w,k,N,H=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${k})`,N);const R=this._scope.toName(w);return this._for(new T("in",H,R,k),()=>N(R))}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,N){if(!k&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const H=new j;if(this._blockNode(H),this.code(w),k){const R=this.name("e");this._currNode=H.catch=new A(R),k(R)}return N&&(this._currNode=H.finally=new E,this.code(N)),this._endBlockNode(A,E)}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,H){return this._blockNode(new C(w,k,N)),H&&this.code(H).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 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=q;function z(P,w){for(const k in w)P[k]=(P[k]||0)+(w[k]||0);return P}function U(P,w){return w instanceof t._CodeOrName?z(P,w.names):P}function L(P,w,k){if(P instanceof t.Name)return N(P);if(!H(P))return P;return new t._Code(P._items.reduce((R,X)=>(X instanceof t.Name&&(X=N(X)),X instanceof t._Code?R.push(...X._items):R.push(X),R),[]));function N(R){const X=k[R.str];return X===void 0||w[R.str]!==1?R:(delete w[R.str],X)}function H(R){return R instanceof t._Code&&R._items.some(X=>X instanceof t.Name&&w[X.str]===1&&k[X.str]!==void 0)}}function F(P,w){for(const k in w)P[k]=(P[k]||0)-(w[k]||0)}function G(P){return typeof P=="boolean"||typeof P=="number"||P===null?!P:(0,t._)`!${M(P)}`}e.not=G;const Y=_(e.operators.AND);function D(...P){return P.reduce(Y)}e.and=D;const J=_(e.operators.OR);function O(...P){return P.reduce(J)}e.or=O;function _(P){return(w,k)=>w===t.nil?k:k===t.nil?w:(0,t._)`${M(w)} ${P} ${M(k)}`}function M(P){return P instanceof t.Name?P:(0,t._)`(${P})`}})(ue);var Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.checkStrictMode=Q.getErrorPath=Q.Type=Q.useFunc=Q.setEvaluated=Q.evaluatedPropsToName=Q.mergeEvaluated=Q.eachItem=Q.unescapeJsonPointer=Q.escapeJsonPointer=Q.escapeFragment=Q.unescapeFragment=Q.schemaRefOrVal=Q.schemaHasRulesButRef=Q.schemaHasRules=Q.checkUnknownRules=Q.alwaysValidSchema=Q.toHash=void 0;const je=ue,DS=us;function zS(e){const t={};for(const n of e)t[n]=!0;return t}Q.toHash=zS;function FS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Av(e,t),!Mv(t,e.self.RULES.all))}Q.alwaysValidSchema=FS;function Av(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]||Lv(e,`unknown keyword: "${i}"`)}Q.checkUnknownRules=Av;function Mv(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}Q.schemaHasRules=Mv;function BS(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}Q.schemaHasRulesButRef=BS;function HS({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)}`}Q.schemaRefOrVal=HS;function VS(e){return qv(decodeURIComponent(e))}Q.unescapeFragment=VS;function WS(e){return encodeURIComponent(Zu(e))}Q.escapeFragment=WS;function Zu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}Q.escapeJsonPointer=Zu;function qv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Q.unescapeJsonPointer=qv;function KS(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}Q.eachItem=KS;function Um({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}}Q.mergeEvaluated={props:Um({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} || {}`),ep(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Uv}),items:Um({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 Uv(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,je._)`{}`);return t!==void 0&&ep(e,n,t),n}Q.evaluatedPropsToName=Uv;function ep(e,t,n){Object.keys(n).forEach(o=>e.assign((0,je._)`${t}${(0,je.getProperty)(o)}`,!0))}Q.setEvaluated=ep;const Lm={};function GS(e,t){return e.scopeValue("func",{ref:t,code:Lm[t.code]||(Lm[t.code]=new DS._Code(t.code))})}Q.useFunc=GS;var Ad;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ad||(Q.Type=Ad={}));function JS(e,t,n){if(e instanceof je.Name){const o=t===Ad.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():"/"+Zu(e)}Q.getErrorPath=JS;function Lv(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}Q.checkStrictMode=Lv;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});const ft=ue,QS={data:new ft.Name("data"),valCxt:new ft.Name("valCxt"),instancePath:new ft.Name("instancePath"),parentData:new ft.Name("parentData"),parentDataProperty:new ft.Name("parentDataProperty"),rootData:new ft.Name("rootData"),dynamicAnchors:new ft.Name("dynamicAnchors"),vErrors:new ft.Name("vErrors"),errors:new ft.Name("errors"),this:new ft.Name("this"),self:new ft.Name("self"),scope:new ft.Name("scope"),json:new ft.Name("json"),jsonPos:new ft.Name("jsonPos"),jsonLen:new ft.Name("jsonLen"),jsonPart:new ft.Name("jsonPart")};Dt.default=QS;(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=Q,o=Dt;e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:p})=>p?(0,t.str)`"${g}" keyword must be ${p} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function r(g,p=e.keywordError,u,x){const{it:S}=g,{gen:T,compositeRule:C,allErrors:$}=S,j=m(g,p,u);x??(C||$)?l(T,j):c(S,(0,t._)`[${j}]`)}e.reportError=r;function i(g,p=e.keywordError,u){const{it:x}=g,{gen:S,compositeRule:T,allErrors:C}=x,$=m(g,p,u);l(S,$),T||C||c(x,o.default.vErrors)}e.reportExtraError=i;function s(g,p){g.assign(o.default.errors,p),g.if((0,t._)`${o.default.vErrors} !== null`,()=>g.if(p,()=>g.assign((0,t._)`${o.default.vErrors}.length`,p),()=>g.assign(o.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:g,keyword:p,schemaValue:u,data:x,errsCount:S,it:T}){if(S===void 0)throw new Error("ajv implementation error");const C=g.name("err");g.forRange("i",S,o.default.errors,$=>{g.const(C,(0,t._)`${o.default.vErrors}[${$}]`),g.if((0,t._)`${C}.instancePath === undefined`,()=>g.assign((0,t._)`${C}.instancePath`,(0,t.strConcat)(o.default.instancePath,T.errorPath))),g.assign((0,t._)`${C}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${p}`),T.opts.verbose&&(g.assign((0,t._)`${C}.schema`,u),g.assign((0,t._)`${C}.data`,x))})}e.extendErrors=a;function l(g,p){const u=g.const("err",p);g.if((0,t._)`${o.default.vErrors} === null`,()=>g.assign(o.default.vErrors,(0,t._)`[${u}]`),(0,t._)`${o.default.vErrors}.push(${u})`),g.code((0,t._)`${o.default.errors}++`)}function c(g,p){const{gen:u,validateName:x,schemaEnv:S}=g;S.$async?u.throw((0,t._)`new ${g.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(g,p,u){const{createErrors:x}=g.it;return x===!1?(0,t._)`{}`:v(g,p,u)}function v(g,p,u={}){const{gen:x,it:S}=g,T=[h(S,u),y(g,u)];return b(g,p,T),x.object(...T)}function h({errorPath:g},{instancePath:p}){const u=p?(0,t.str)`${g}${(0,n.getErrorPath)(p,n.Type.Str)}`:g;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,u)]}function y({keyword:g,it:{errSchemaPath:p}},{schemaPath:u,parentSchema:x}){let S=x?p:(0,t.str)`${p}/${g}`;return u&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(u,n.Type.Str)}`),[f.schemaPath,S]}function b(g,{params:p,message:u},x){const{keyword:S,data:T,schemaValue:C,it:$}=g,{opts:j,propertyName:A,topSchemaRef:E,schemaPath:q}=$;x.push([f.keyword,S],[f.params,typeof p=="function"?p(g):p||(0,t._)`{}`]),j.messages&&x.push([f.message,typeof u=="function"?u(g):u]),j.verbose&&x.push([f.schema,C],[f.parentSchema,(0,t._)`${E}${q}`],[o.default.data,T]),A&&x.push([f.propertyName,A])}})(Ns);Object.defineProperty(Vr,"__esModule",{value:!0});Vr.boolOrEmptySchema=Vr.topBoolOrEmptySchema=void 0;const YS=Ns,XS=ue,ZS=Dt,e$={message:"boolean schema is false"};function t$(e){const{gen:t,schema:n,validateName:o}=e;n===!1?Dv(e,!1):typeof n=="object"&&n.$async===!0?t.return(ZS.default.data):(t.assign((0,XS._)`${o}.errors`,null),t.return(!0))}Vr.topBoolOrEmptySchema=t$;function n$(e,t){const{gen:n,schema:o}=e;o===!1?(n.var(t,!1),Dv(e)):n.var(t,!0)}Vr.boolOrEmptySchema=n$;function Dv(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,YS.reportError)(r,e$,void 0,t)}var et={},Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.getRules=Go.isJSONType=void 0;const o$=["string","number","integer","boolean","null","object","array"],r$=new Set(o$);function i$(e){return typeof e=="string"&&r$.has(e)}Go.isJSONType=i$;function s$(){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=s$;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.shouldUseRule=An.shouldUseGroup=An.schemaHasRulesForType=void 0;function a$({schema:e,self:t},n){const o=t.RULES.types[n];return o&&o!==!0&&zv(e,o)}An.schemaHasRulesForType=a$;function zv(e,t){return t.rules.some(n=>Fv(e,n))}An.shouldUseGroup=zv;function Fv(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=Fv;Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;const l$=Go,c$=An,d$=Ns,fe=ue,Bv=Q;var Ir;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ir||(et.DataType=Ir={}));function u$(e){const t=Hv(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=u$;function Hv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(l$.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}et.getJSONTypes=Hv;function p$(e,t){const{gen:n,data:o,opts:r}=e,i=f$(t,r.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,c$.schemaHasRulesForType)(e,t[0]));if(s){const a=tp(t,o,r.strictNumbers,Ir.Wrong);n.if(a,()=>{i.length?m$(e,t,i):np(e)})}return s}et.coerceAndCheckDataType=p$;const Vv=new Set(["string","number","integer","boolean","null"]);function f$(e,t){return t?e.filter(n=>Vv.has(n)||t==="array"&&n==="array"):[]}function m$(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(tp(t,r,i.strictNumbers),()=>o.assign(a,r))),o.if((0,fe._)`${a} !== undefined`);for(const c of n)(Vv.has(c)||c==="array"&&i.coerceTypes==="array")&&l(c);o.else(),np(e),o.endIf(),o.if((0,fe._)`${a} !== undefined`,()=>{o.assign(r,a),h$(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"}],DS="Agent Client Protocol",Rv={$defs:qS,$schema:US,anyOf:LS,title:DS};var Od={exports:{}},Av={},ln={},Wr={},Ns={},ue={},ps={};(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(f,...u){const x=[f[0]];let S=0;for(;S<u.length;)a(x,u[S]),x.push(f[++S]);return new o(x)}e._=r;const i=new o("+");function s(f,...u){const x=[h(f[0])];let S=0;for(;S<u.length;)x.push(i),a(x,u[S]),x.push(i,h(f[++S]));return l(x),new o(x)}e.str=s;function a(f,u){u instanceof o?f.push(...u._items):u instanceof n?f.push(u):f.push(m(u))}e.addCodeArg=a;function l(f){let u=1;for(;u<f.length-1;){if(f[u]===i){const x=d(f[u-1],f[u+1]);if(x!==void 0){f.splice(u-1,3,x);continue}f[u++]="+"}u++}}function d(f,u){if(u==='""')return f;if(f==='""')return u;if(typeof f=="string")return u instanceof n||f[f.length-1]!=='"'?void 0:typeof u!="string"?`${f.slice(0,-1)}${u}"`:u[0]==='"'?f.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(f instanceof n))return`"${f}${u.slice(1)}`}function p(f,u){return u.emptyStr()?f:f.emptyStr()?u:s`${f}${u}`}e.strConcat=p;function m(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:h(Array.isArray(f)?f.join(","):f)}function v(f){return new o(h(f))}e.stringify=v;function h(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function y(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new o(`.${f}`):r`[${f}]`}e.getProperty=y;function b(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new o(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=b;function g(f){return new o(f.toString())}e.regexpCode=g})(ps);var Rd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ps;class n extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.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:d,parent:p}={}){this._names={},this._prefixes=d,this._parent=p}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const p=this._names[d]||this._nameGroup(d);return`${d}${p.index++}`}_nameGroup(d){var p,m;if(!((m=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||m===void 0)&&m.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=r;class i extends t.Name{constructor(d,p){super(p),this.prefix=d}setValue(d,{property:p,itemIndex:m}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(p)}[${m}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends r{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?s:t.nil}}get(){return this._scope}name(d){return new i(d,this._newName(d))}value(d,p){var m;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName(d),{prefix:h}=v,y=(m=p.key)!==null&&m!==void 0?m:p.ref;let b=this._values[h];if(b){const u=b.get(y);if(u)return u}else b=this._values[h]=new Map;b.set(y,v);const g=this._scope[h]||(this._scope[h]=[]),f=g.length;return g[f]=p.ref,v.setValue(p,{property:h,itemIndex:f}),v}getValue(d,p){const m=this._values[d];if(m)return m.get(p)}scopeRefs(d,p=this._values){return this._reduceValues(p,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${d}${m.scopePath}`})}scopeCode(d=this._values,p,m){return this._reduceValues(d,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},p,m)}_reduceValues(d,p,m={},v){let h=t.nil;for(const y in d){const b=d[y];if(!b)continue;const g=m[y]=m[y]||new Map;b.forEach(f=>{if(g.has(f))return;g.set(f,o.Started);let u=p(f);if(u){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${x} ${f} = ${u};${this.opts._n}`}else if(u=v==null?void 0:v(f))h=(0,t._)`${h}${u}${this.opts._n}`;else throw new n(f);g.set(f,o.Completed)})}return h}}e.ValueScope=a})(Rd);(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=ps,n=Rd;var o=ps;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=Rd;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,H=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${H};`+k}optimizeNames(w,k){if(w[this.name.str])return this.rhs&&(this.rhs=L(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=L(this.rhs,w,k),this}get names(){const w=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(w,this.rhs)}}class l extends a{constructor(w,k,N,H){super(w,N,H),this.op=k}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}}class d extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class p 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 v 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=L(this.code,w,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h 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 H=N.length;for(;H--;){const R=N[H];R.optimizeNames(w,k)||(F(w,R.names),N.splice(H,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((w,k)=>z(w,k.names),{})}}class y extends h{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class b extends h{}class g extends y{}g.kind="else";class f extends y{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 g(N):N}if(k)return w===!1?k instanceof f?k:k.nodes:this.nodes.length?this:new f(G(w),k instanceof f?[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=L(this.condition,w,k),this}get names(){const w=super.names;return U(w,this.condition),this.else&&z(w,this.else.names),w}}f.kind="if";class u extends y{}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=L(this.iteration,w,k),this}get names(){return z(super.names,this.iteration.names)}}class S extends u{constructor(w,k,N,H){super(),this.varKind=w,this.name=k,this.from=N,this.to=H}render(w){const k=w.es5?n.varKinds.var:this.varKind,{name:N,from:H,to:R}=this;return`for(${k} ${N}=${H}; ${N}<${R}; ${N}++)`+super.render(w)}get names(){const w=U(super.names,this.from);return U(w,this.to)}}class T extends u{constructor(w,k,N,H){super(),this.loop=w,this.varKind=k,this.name=N,this.iterable=H}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=L(this.iterable,w,k),this}get names(){return z(super.names,this.iterable.names)}}class C extends y{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 h{render(w){return"return "+super.render(w)}}$.kind="return";class j extends y{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,H;return super.optimizeNames(w,k),(N=this.catch)===null||N===void 0||N.optimizeNames(w,k),(H=this.finally)===null||H===void 0||H.optimizeNames(w,k),this}get names(){const w=super.names;return this.catch&&z(w,this.catch.names),this.finally&&z(w,this.finally.names),w}}class A extends y{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}}A.kind="catch";class E extends y{render(w){return"finally"+super.render(w)}}E.kind="finally";class q{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,H){const R=this._scope.toName(k);return N!==void 0&&H&&(this._constants[R.str]=N),this._leafNode(new s(w,R,N)),R}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 v(w)),this}object(...w){const k=["{"];for(const[N,H]of w)k.length>1&&k.push(","),k.push(N),(N!==H||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,H));return k.push("}"),new t._Code(k)}if(w,k,N){if(this._blockNode(new f(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 f(w))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(f,g)}_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,H,R=this.opts.es5?n.varKinds.var:n.varKinds.let){const X=this._scope.toName(w);return this._for(new S(R,X,k,N),()=>H(X))}forOf(w,k,N,H=n.varKinds.const){const R=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(R,(0,t._)`${X}[${ie}]`),N(R)})}return this._for(new T("of",H,R,k),()=>N(R))}forIn(w,k,N,H=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${k})`,N);const R=this._scope.toName(w);return this._for(new T("in",H,R,k),()=>N(R))}endFor(){return this._endBlockNode(u)}label(w){return this._leafNode(new d(w))}break(w){return this._leafNode(new p(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 H=new j;if(this._blockNode(H),this.code(w),k){const R=this.name("e");this._currNode=H.catch=new A(R),k(R)}return N&&(this._currNode=H.finally=new E,this.code(N)),this._endBlockNode(A,E)}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,H){return this._blockNode(new C(w,k,N)),H&&this.code(H).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 f))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=q;function z(P,w){for(const k in w)P[k]=(P[k]||0)+(w[k]||0);return P}function U(P,w){return w instanceof t._CodeOrName?z(P,w.names):P}function L(P,w,k){if(P instanceof t.Name)return N(P);if(!H(P))return P;return new t._Code(P._items.reduce((R,X)=>(X instanceof t.Name&&(X=N(X)),X instanceof t._Code?R.push(...X._items):R.push(X),R),[]));function N(R){const X=k[R.str];return X===void 0||w[R.str]!==1?R:(delete w[R.str],X)}function H(R){return R instanceof t._Code&&R._items.some(X=>X instanceof t.Name&&w[X.str]===1&&k[X.str]!==void 0)}}function F(P,w){for(const k in w)P[k]=(P[k]||0)-(w[k]||0)}function G(P){return typeof P=="boolean"||typeof P=="number"||P===null?!P:(0,t._)`!${M(P)}`}e.not=G;const Y=_(e.operators.AND);function D(...P){return P.reduce(Y)}e.and=D;const J=_(e.operators.OR);function O(...P){return P.reduce(J)}e.or=O;function _(P){return(w,k)=>w===t.nil?k:k===t.nil?w:(0,t._)`${M(w)} ${P} ${M(k)}`}function M(P){return P instanceof t.Name?P:(0,t._)`(${P})`}})(ue);var Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.checkStrictMode=Q.getErrorPath=Q.Type=Q.useFunc=Q.setEvaluated=Q.evaluatedPropsToName=Q.mergeEvaluated=Q.eachItem=Q.unescapeJsonPointer=Q.escapeJsonPointer=Q.escapeFragment=Q.unescapeFragment=Q.schemaRefOrVal=Q.schemaHasRulesButRef=Q.schemaHasRules=Q.checkUnknownRules=Q.alwaysValidSchema=Q.toHash=void 0;const je=ue,zS=ps;function FS(e){const t={};for(const n of e)t[n]=!0;return t}Q.toHash=FS;function BS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Mv(e,t),!qv(t,e.self.RULES.all))}Q.alwaysValidSchema=BS;function Mv(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]||Dv(e,`unknown keyword: "${i}"`)}Q.checkUnknownRules=Mv;function qv(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}Q.schemaHasRules=qv;function HS(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}Q.schemaHasRulesButRef=HS;function VS({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)}`}Q.schemaRefOrVal=VS;function WS(e){return Uv(decodeURIComponent(e))}Q.unescapeFragment=WS;function KS(e){return encodeURIComponent(Zu(e))}Q.escapeFragment=KS;function Zu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}Q.escapeJsonPointer=Zu;function Uv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Q.unescapeJsonPointer=Uv;function GS(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}Q.eachItem=GS;function Um({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}}Q.mergeEvaluated={props:Um({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} || {}`),ep(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Lv}),items:Um({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 Lv(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,je._)`{}`);return t!==void 0&&ep(e,n,t),n}Q.evaluatedPropsToName=Lv;function ep(e,t,n){Object.keys(n).forEach(o=>e.assign((0,je._)`${t}${(0,je.getProperty)(o)}`,!0))}Q.setEvaluated=ep;const Lm={};function JS(e,t){return e.scopeValue("func",{ref:t,code:Lm[t.code]||(Lm[t.code]=new zS._Code(t.code))})}Q.useFunc=JS;var Ad;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ad||(Q.Type=Ad={}));function QS(e,t,n){if(e instanceof je.Name){const o=t===Ad.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():"/"+Zu(e)}Q.getErrorPath=QS;function Dv(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}Q.checkStrictMode=Dv;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});const ft=ue,YS={data:new ft.Name("data"),valCxt:new ft.Name("valCxt"),instancePath:new ft.Name("instancePath"),parentData:new ft.Name("parentData"),parentDataProperty:new ft.Name("parentDataProperty"),rootData:new ft.Name("rootData"),dynamicAnchors:new ft.Name("dynamicAnchors"),vErrors:new ft.Name("vErrors"),errors:new ft.Name("errors"),this:new ft.Name("this"),self:new ft.Name("self"),scope:new ft.Name("scope"),json:new ft.Name("json"),jsonPos:new ft.Name("jsonPos"),jsonLen:new ft.Name("jsonLen"),jsonPart:new ft.Name("jsonPart")};Dt.default=YS;(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=Q,o=Dt;e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:f})=>f?(0,t.str)`"${g}" keyword must be ${f} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function r(g,f=e.keywordError,u,x){const{it:S}=g,{gen:T,compositeRule:C,allErrors:$}=S,j=m(g,f,u);x??(C||$)?l(T,j):d(S,(0,t._)`[${j}]`)}e.reportError=r;function i(g,f=e.keywordError,u){const{it:x}=g,{gen:S,compositeRule:T,allErrors:C}=x,$=m(g,f,u);l(S,$),T||C||d(x,o.default.vErrors)}e.reportExtraError=i;function s(g,f){g.assign(o.default.errors,f),g.if((0,t._)`${o.default.vErrors} !== null`,()=>g.if(f,()=>g.assign((0,t._)`${o.default.vErrors}.length`,f),()=>g.assign(o.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:g,keyword:f,schemaValue:u,data:x,errsCount:S,it:T}){if(S===void 0)throw new Error("ajv implementation error");const C=g.name("err");g.forRange("i",S,o.default.errors,$=>{g.const(C,(0,t._)`${o.default.vErrors}[${$}]`),g.if((0,t._)`${C}.instancePath === undefined`,()=>g.assign((0,t._)`${C}.instancePath`,(0,t.strConcat)(o.default.instancePath,T.errorPath))),g.assign((0,t._)`${C}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${f}`),T.opts.verbose&&(g.assign((0,t._)`${C}.schema`,u),g.assign((0,t._)`${C}.data`,x))})}e.extendErrors=a;function l(g,f){const u=g.const("err",f);g.if((0,t._)`${o.default.vErrors} === null`,()=>g.assign(o.default.vErrors,(0,t._)`[${u}]`),(0,t._)`${o.default.vErrors}.push(${u})`),g.code((0,t._)`${o.default.errors}++`)}function d(g,f){const{gen:u,validateName:x,schemaEnv:S}=g;S.$async?u.throw((0,t._)`new ${g.ValidationError}(${f})`):(u.assign((0,t._)`${x}.errors`,f),u.return(!1))}const p={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(g,f,u){const{createErrors:x}=g.it;return x===!1?(0,t._)`{}`:v(g,f,u)}function v(g,f,u={}){const{gen:x,it:S}=g,T=[h(S,u),y(g,u)];return b(g,f,T),x.object(...T)}function h({errorPath:g},{instancePath:f}){const u=f?(0,t.str)`${g}${(0,n.getErrorPath)(f,n.Type.Str)}`:g;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,u)]}function y({keyword:g,it:{errSchemaPath:f}},{schemaPath:u,parentSchema:x}){let S=x?f:(0,t.str)`${f}/${g}`;return u&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(u,n.Type.Str)}`),[p.schemaPath,S]}function b(g,{params:f,message:u},x){const{keyword:S,data:T,schemaValue:C,it:$}=g,{opts:j,propertyName:A,topSchemaRef:E,schemaPath:q}=$;x.push([p.keyword,S],[p.params,typeof f=="function"?f(g):f||(0,t._)`{}`]),j.messages&&x.push([p.message,typeof u=="function"?u(g):u]),j.verbose&&x.push([p.schema,C],[p.parentSchema,(0,t._)`${E}${q}`],[o.default.data,T]),A&&x.push([p.propertyName,A])}})(Ns);Object.defineProperty(Wr,"__esModule",{value:!0});Wr.boolOrEmptySchema=Wr.topBoolOrEmptySchema=void 0;const XS=Ns,ZS=ue,e$=Dt,t$={message:"boolean schema is false"};function n$(e){const{gen:t,schema:n,validateName:o}=e;n===!1?zv(e,!1):typeof n=="object"&&n.$async===!0?t.return(e$.default.data):(t.assign((0,ZS._)`${o}.errors`,null),t.return(!0))}Wr.topBoolOrEmptySchema=n$;function o$(e,t){const{gen:n,schema:o}=e;o===!1?(n.var(t,!1),zv(e)):n.var(t,!0)}Wr.boolOrEmptySchema=o$;function zv(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,XS.reportError)(r,t$,void 0,t)}var et={},Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.getRules=Go.isJSONType=void 0;const r$=["string","number","integer","boolean","null","object","array"],i$=new Set(r$);function s$(e){return typeof e=="string"&&i$.has(e)}Go.isJSONType=s$;function a$(){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=a$;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.shouldUseRule=An.shouldUseGroup=An.schemaHasRulesForType=void 0;function l$({schema:e,self:t},n){const o=t.RULES.types[n];return o&&o!==!0&&Fv(e,o)}An.schemaHasRulesForType=l$;function Fv(e,t){return t.rules.some(n=>Bv(e,n))}An.shouldUseGroup=Fv;function Bv(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=Bv;Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;const c$=Go,d$=An,u$=Ns,fe=ue,Hv=Q;var Ir;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ir||(et.DataType=Ir={}));function p$(e){const t=Vv(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=p$;function Vv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(c$.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}et.getJSONTypes=Vv;function f$(e,t){const{gen:n,data:o,opts:r}=e,i=m$(t,r.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,d$.schemaHasRulesForType)(e,t[0]));if(s){const a=tp(t,o,r.strictNumbers,Ir.Wrong);n.if(a,()=>{i.length?h$(e,t,i):np(e)})}return s}et.coerceAndCheckDataType=f$;const Wv=new Set(["string","number","integer","boolean","null"]);function m$(e,t){return t?e.filter(n=>Wv.has(n)||t==="array"&&n==="array"):[]}function h$(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(tp(t,r,i.strictNumbers),()=>o.assign(a,r))),o.if((0,fe._)`${a} !== undefined`);for(const d of n)(Wv.has(d)||d==="array"&&i.coerceTypes==="array")&&l(d);o.else(),np(e),o.endIf(),o.if((0,fe._)`${a} !== undefined`,()=>{o.assign(r,a),y$(e,a)});function l(d){switch(d){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 h$({gen:e,parentData:t,parentDataProperty:n},o){e.if((0,fe._)`${t} !== undefined`,()=>e.assign((0,fe._)`${t}[${n}]`,o))}function Md(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=Md;function tp(e,t,n,o){if(e.length===1)return Md(e[0],t,n,o);let r;const i=(0,Bv.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,Md(s,t,n,o));return r}et.checkDataTypes=tp;const y$={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,fe._)`{type: ${e}}`:(0,fe._)`{type: ${t}}`};function np(e){const t=g$(e);(0,d$.reportError)(t,y$)}et.reportTypeError=np;function g$(e){const{gen:t,data:n,schema:o}=e,r=(0,Bv.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,v$=Q;function b$(e,t){const{properties:n,items:o}=e.schema;if(t==="object"&&n)for(const r in n)Dm(e,r,n[r].default);else t==="array"&&Array.isArray(o)&&o.forEach((r,i)=>Dm(e,i,r.default))}El.assignDefaults=b$;function Dm(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,v$.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,op=Q,Kn=Dt,x$=Q;function w$(e,t){const{gen:n,data:o,it:r}=e;n.if(ip(n,o,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ae._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=w$;function S$({gen:e,data:t,it:{opts:n}},o,r){return(0,Ae.or)(...o.map(i=>(0,Ae.and)(ip(e,t,i,n.ownProperties),(0,Ae._)`${r} = ${i}`)))}ye.checkMissingProp=S$;function $$(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=$$;function Wv(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ae._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=Wv;function rp(e,t,n){return(0,Ae._)`${Wv(e)}.call(${t}, ${n})`}ye.isOwnProperty=rp;function k$(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} !== undefined`;return o?(0,Ae._)`${r} && ${rp(e,t,n)}`:r}ye.propertyInData=k$;function ip(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} === undefined`;return o?(0,Ae.or)(r,(0,Ae.not)(rp(e,t,n))):r}ye.noPropertyInData=ip;function Kv(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=Kv;function T$(e,t){return Kv(t).filter(n=>!(0,op.alwaysValidSchema)(e,t[n]))}ye.schemaProperties=T$;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 v=(0,Ae._)`${f}, ${n.object(...m)}`;return l!==Ae.nil?(0,Ae._)`${a}.call(${l}, ${v})`:(0,Ae._)`${a}(${v})`}ye.callValidateCode=_$;const j$=(0,Ae._)`new RegExp`;function N$({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"?j$:(0,x$.useFunc)(e,r)}(${n}, ${o})`})}ye.usePattern=N$;function C$(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:op.Type.Num},i),t.if((0,Ae.not)(i),a)})}}ye.validateArray=C$;function E$(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,op.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=E$;Object.defineProperty(bn,"__esModule",{value:!0});bn.validateKeywordUsage=bn.validSchemaType=bn.funcKeywordCode=bn.macroKeywordCode=void 0;const bt=ue,Po=Dt,P$=ye,I$=Ns;function O$(e,t){const{gen:n,keyword:o,schema:r,parentSchema:i,it:s}=e,a=t.macro.call(s.self,r,i,s),l=Gv(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=O$;function R$(e,t){var n;const{gen:o,keyword:r,schema:i,parentSchema:s,$data:a,it:l}=e;M$(l,t);const c=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,f=Gv(o,r,c),m=o.let("valid");e.block$data(m,v),e.ok((n=t.valid)!==null&&n!==void 0?n:m);function v(){if(t.errors===!1)b(),t.modifying&&zm(e),g(()=>e.error());else{const p=t.async?h():y();t.modifying&&zm(e),g(()=>A$(e,p))}}function h(){const p=o.let("ruleErrs",null);return o.try(()=>b((0,bt._)`await `),u=>o.assign(m,!1).if((0,bt._)`${u} instanceof ${l.ValidationError}`,()=>o.assign(p,(0,bt._)`${u}.errors`),()=>o.throw(u))),p}function y(){const p=(0,bt._)`${f}.errors`;return o.assign(p,null),b(bt.nil),p}function b(p=t.async?(0,bt._)`await `:bt.nil){const u=l.opts.passContext?Po.default.this:Po.default.self,x=!("compile"in t&&!a||t.schema===!1);o.assign(m,(0,bt._)`${p}${(0,P$.callValidateCode)(e,f,u,x)}`,t.modifying)}function g(p){var u;o.if((0,bt.not)((u=t.valid)!==null&&u!==void 0?u:m),p)}}bn.funcKeywordCode=R$;function zm(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,()=>t.assign(n,(0,bt._)`${o.parentData}[${o.parentDataProperty}]`))}function A$(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,I$.extendErrors)(e)},()=>e.error())}function M$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Gv(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 q$(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=q$;function U$({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=U$;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.extendSubschemaMode=yo.extendSubschemaData=yo.getSubschema=void 0;const vn=ue,Jv=Q;function L$(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,Jv.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=L$;function D$(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,v=a.let("data",(0,vn._)`${t.data}${(0,vn.getProperty)(n)}`,!0);l(v),e.errorPath=(0,vn.str)`${c}${(0,Jv.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=D$;function z$(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=z$;var lt={},Qv=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},Yv={exports:{}},so=Yv.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 v=0;v<m.length;v++)va(e,t,n,m[v],r+"/"+f+"/"+v,i,r,f,o,v)}else if(f in so.propsKeywords){if(m&&typeof m=="object")for(var h in m)va(e,t,n,m[h],r+"/"+f+"/"+F$(h),i,r,f,o,h)}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 F$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var B$=Yv.exports;Object.defineProperty(lt,"__esModule",{value:!0});lt.getSchemaRefs=lt.resolveUrl=lt.normalizeId=lt._getFullPath=lt.getFullPath=lt.inlineRef=void 0;const H$=Q,V$=Qv,W$=B$,K$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function G$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!qd(e):t?Xv(e)<=t:!1}lt.inlineRef=G$;const J$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qd(e){for(const t in e){if(J$.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(qd)||typeof n=="object"&&qd(n))return!0}return!1}function Xv(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!K$.has(n)&&(typeof e[n]=="object"&&(0,H$.eachItem)(e[n],o=>t+=Xv(o)),t===1/0))return 1/0}return t}function Zv(e,t="",n){n!==!1&&(t=Or(t));const o=e.parse(t);return eb(e,o)}lt.getFullPath=Zv;function eb(e,t){return e.serialize(t).split("#")[0]+"#"}lt._getFullPath=eb;const Q$=/#\/?$/;function Or(e){return e?e.replace(Q$,""):""}lt.normalizeId=Or;function Y$(e,t,n){return n=Or(n),e.resolve(t,n)}lt.resolveUrl=Y$;const X$=/^[a-z_][-a-z0-9._]*$/i;function Z$(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:o}=this.opts,r=Or(e[n]||t),i={"":r},s=Zv(o,r,!1),a={},l=new Set;return W$(e,{allKeys:!0},(m,v,h,y)=>{if(y===void 0)return;const b=s+v;let g=i[y];typeof m[n]=="string"&&(g=p.call(this,m[n])),u.call(this,m.$anchor),u.call(this,m.$dynamicAnchor),i[v]=g;function p(x){const S=this.opts.uriResolver.resolve;if(x=Or(g?S(g,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 u(x){if(typeof x=="string"){if(!X$.test(x))throw new Error(`invalid anchor "${x}"`);p.call(this,`#${x}`)}}}),a;function c(m,v,h){if(v!==void 0&&!V$(m,v))throw f(h)}function f(m){return new Error(`reference "${m}" resolves to more than one schema`)}}lt.getSchemaRefs=Z$;Object.defineProperty(ln,"__esModule",{value:!0});ln.getData=ln.KeywordCxt=ln.validateFunctionCode=void 0;const tb=Vr,Fm=et,sp=An,nl=et,ek=El,Ui=bn,gc=yo,re=ue,le=Dt,tk=lt,Mn=Q,hi=Ns;function nk(e){if(rb(e)&&(ib(e),ob(e))){ik(e);return}nb(e,()=>(0,tb.topBoolOrEmptySchema)(e))}ln.validateFunctionCode=nk;function nb({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"; ${Bm(n,r)}`),rk(e,r),e.code(i)}):e.func(t,(0,re._)`${le.default.data}, ${ok(r)}`,o.$async,()=>e.code(Bm(n,r)).code(i))}function ok(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 rk(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 ik(e){const{schema:t,opts:n,gen:o}=e;nb(e,()=>{n.$comment&&t.$comment&&ab(e),dk(e),o.let(le.default.vErrors,null),o.let(le.default.errors,0),n.unevaluated&&sk(e),sb(e),fk(e)})}function sk(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 Bm(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 ak(e,t){if(rb(e)&&(ib(e),ob(e))){lk(e,t);return}(0,tb.boolOrEmptySchema)(e,t)}function ob({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 rb(e){return typeof e.schema!="boolean"}function lk(e,t){const{schema:n,gen:o,opts:r}=e;r.$comment&&n.$comment&&ab(e),uk(e),pk(e);const i=o.const("_errs",le.default.errors);sb(e,i),o.var(t,(0,re._)`${i} === ${le.default.errors}`)}function ib(e){(0,Mn.checkUnknownRules)(e),ck(e)}function sb(e,t){if(e.opts.jtd)return Hm(e,[],!1,t);const n=(0,Fm.getSchemaTypes)(e.schema),o=(0,Fm.coerceAndCheckDataType)(e,n);Hm(e,n,!o,t)}function ck(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 dk(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 uk(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,tk.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function pk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function ab({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 fk(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&&mk(e),t.return((0,re._)`${le.default.errors} === 0`))}function mk({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 Hm(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(()=>db(e,"$ref",f.all.$ref.definition));return}l.jtd||hk(e,t),r.block(()=>{for(const v of f.rules)m(v);m(f.post)});function m(v){(0,sp.shouldUseGroup)(i,v)&&(v.type?(r.if((0,nl.checkDataType)(v.type,s,l.strictNumbers)),Vm(e,v),t.length===1&&t[0]===v.type&&n&&(r.else(),(0,nl.reportTypeError)(e)),r.endIf()):Vm(e,v),a||r.if((0,re._)`${le.default.errors} === ${o||0}`))}}function Vm(e,t){const{gen:n,schema:o,opts:{useDefaults:r}}=e;r&&(0,ek.assignDefaults)(e,t.type),n.block(()=>{for(const i of t.rules)(0,sp.shouldUseRule)(o,i)&&db(e,i.keyword,i.definition,t.type)})}function hk(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(yk(e,t),e.opts.allowUnionTypes||gk(e,t),vk(e,e.dataTypes))}function yk(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{lb(e.dataTypes,n)||ap(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),xk(e,t)}}function gk(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&ap(e,"use allowUnionTypes to allow union type keyword")}function vk(e,t){const n=e.self.RULES.all;for(const o in n){const r=n[o];if(typeof r=="object"&&(0,sp.shouldUseRule)(e.schema,r)){const{type:i}=r.definition;i.length&&!i.some(s=>bk(t,s))&&ap(e,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function bk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function lb(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function xk(e,t){const n=[];for(const o of e.dataTypes)lb(t,o)?n.push(o):t.includes("integer")&&o==="number"&&n.push("integer");e.dataTypes=n}function ap(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Mn.checkStrictMode)(e,t,e.opts.strictTypes)}class cb{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",ub(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 ak(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=cb;function db(e,t,n,o){const r=new cb(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 wk=/^\/(?:[^~]|~0|~1)*$/,Sk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ub(e,{dataLevel:t,dataNames:n,dataPathArr:o}){let r,i;if(e==="")return le.default.rootData;if(e[0]==="/"){if(!wk.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,i=le.default.rootData}else{const c=Sk.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=ub;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});class $k extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Cs.default=$k;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});const vc=lt;class kk 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=kk;var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.resolveSchema=xt.getCompilingSchema=xt.resolveRef=xt.compileSchema=xt.SchemaEnv=void 0;const Zt=ue,Tk=Cs,jo=Dt,rn=lt,Wm=Q,_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 lp(e){const t=pb.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:Tk.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 h=new Function(`${jo.default.self}`,`${jo.default.scope}`,f)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:m,scopeValues:s._values}),this.opts.unevaluated){const{props:y,items:b}=c;h.evaluated={props:y instanceof Zt.Name?void 0:y,items:b instanceof Zt.Name?void 0:b,dynamicProps:y instanceof Zt.Name,dynamicItems:b instanceof Zt.Name},h.source&&(h.source.evaluated=(0,Zt.stringify)(h.evaluated))}return e.validate=h,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=lp;function jk(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=Ek.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]=Nk.call(this,i)}xt.resolveRef=jk;function Nk(e){return(0,rn.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:lp.call(this,e)}function pb(e){for(const t of this._compilations)if(Ck(t,e))return t}xt.getCompilingSchema=pb;function Ck(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Ek(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||lp.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 Pk=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,Wm.unescapeFragment)(a)];if(l===void 0)return;n=l;const c=typeof n=="object"&&n[this.opts.schemaId];!Pk.has(a)&&c&&(t=(0,rn.resolveUrl)(this.opts.uriResolver,t,c))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,Wm.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 Ik="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ok="Meta-schema for $data reference (JSON AnySchema extension proposal)",Rk="object",Ak=["$data"],Mk={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},qk=!1,Uk={$id:Ik,description:Ok,type:Rk,required:Ak,properties:Mk,additionalProperties:qk};var cp={},Ol={exports:{}};const Lk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),fb=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),dp=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),mb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Dk=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function hb(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 zk=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Km(e){return e.length=0,!0}function Fk(e,t,n){if(e.length){const o=hb(e);if(o!=="")t.push(o);else return n.error=!0,!1;e.length=0}return!0}function Bk(e){let t=0;const n={error:!1,address:"",zone:""},o=[],r=[];let i=!1,s=!1,a=Fk;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=Km}else{r.push(c);continue}}return r.length&&(a===Km?n.zone=r.join(""):s?o.push(r.join("")):o.push(hb(r))),n.address=o.join(""),n}function yb(e){if(Hk(e,":")<2)return{host:e,isIPV6:!1};const t=Bk(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 Hk(e,t){let n=0;for(let o=0;o<e.length;o++)e[o]===t&&n++;return n}function Vk(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 Wk={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Kk=/[@/?#:]/g,Gk=/[@/?#]/g;function gb(e,t){const n=t?Gk:Kk;return n.lastIndex=0,e.replace(n,o=>Wk[o])}function Jk(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(dp(r)){const i=r.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&mb(s)?n+=s:n+="%"+i,o+=2;continue}}n+=e[o]}return n}function Qk(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(dp(o)){const r=o.toUpperCase(),i=String.fromCharCode(parseInt(r,16));i!=="."&&mb(i)?t+=i:t+="%"+r,n+=2;continue}}Dk(e[n])?t+=e[n]:t+=escape(e[n])}return t}function Yk(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(dp(o)){t+="%"+o.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function Xk(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!fb(n)){const o=yb(n);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=gb(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 vb={nonSimpleDomain:zk,recomposeAuthority:Xk,reescapeHostDelimiters:gb,normalizePercentEncoding:Jk,normalizePathEncoding:Qk,escapePreservingEscapes:Yk,removeDotSegments:Vk,isIPv4:fb,isUUID:Lk,normalizeIPv6:yb};const{isUUID:Zk}=vb,eT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function bb(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 xb(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function wb(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 tT(e){return e.secure=bb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function nT(e){if((e.port===(bb(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 oT(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(eT);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=up(r);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function rT(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=up(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 iT(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Zk(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function sT(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const Sb={scheme:"http",domainHost:!0,parse:xb,serialize:wb},aT={scheme:"https",domainHost:Sb.domainHost,parse:xb,serialize:wb},ba={scheme:"ws",domainHost:!0,parse:tT,serialize:nT},lT={scheme:"wss",domainHost:ba.domainHost,parse:ba.parse,serialize:ba.serialize},cT={scheme:"urn",parse:oT,serialize:rT,skipNormalize:!0},dT={scheme:"urn:uuid",parse:iT,serialize:sT,skipNormalize:!0},ol={http:Sb,https:aT,ws:ba,wss:lT,urn:cT,"urn:uuid":dT};Object.setPrototypeOf(ol,null);function up(e){return e&&(ol[e]||ol[e.toLowerCase()])||void 0}var uT={SCHEMES:ol,getSchemeHandler:up};const{normalizeIPv6:pT,removeDotSegments:_i,recomposeAuthority:fT,normalizePercentEncoding:mT,normalizePathEncoding:hT,escapePreservingEscapes:yT,reescapeHostDelimiters:gT,isIPv4:vT,nonSimpleDomain:bT}=vb,{SCHEMES:xT,getSchemeHandler:$b}=uT;function wT(e,t){return typeof e=="string"?e=_T(e,t):typeof e=="object"&&(e=Wr(Jo(e,t),t)),e}function ST(e,t,n){const o=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=kb(Wr(e,o),Wr(t,o),o,!0);return o.skipEscape=!0,Jo(r,o)}function kb(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 $T(e,t,n){const o=Gm(e,n),r=Gm(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=$b(o.scheme||n.scheme);i&&i.serialize&&i.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=mT(n.path):(n.path=yT(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),o.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");const s=fT(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 kT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function TT(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 Tb(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(kT);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=TT(o,s);if(a!==void 0&&(o.error=o.error||a,r=!0),o.host)if(vT(o.host)===!1){const f=pT(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=$b(n.scheme||o.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&o.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&bT(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=gT(unescape(o.host),i))),o.path&&(o.path=hT(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 Tb(e,t).parsed}function _T(e,t){return _b(e,t).normalized}function _b(e,t){const{parsed:n,malformedAuthorityOrPort:o}=Tb(e,t);return{normalized:o?e:Jo(n,t),malformedAuthorityOrPort:o}}function Gm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:o}=_b(e,t);return o?void 0:n}if(typeof e=="object")return Jo(e,t)}const pp={SCHEMES:xT,normalize:wT,resolve:ST,resolveComponent:kb,equal:$T,serialize:Jo,parse:Wr};Ol.exports=pp;Ol.exports.default=pp;Ol.exports.fastUri=pp;var jT=Ol.exports;Object.defineProperty(cp,"__esModule",{value:!0});const jb=jT;jb.code='require("ajv/dist/runtime/uri").default';cp.default=jb;(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=lt,c=et,f=Q,m=Uk,v=cp,h=(O,_)=>new RegExp(O,_);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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(O){var _,M,P,w,k,N,H,R,X,ie,de,we,ze,Ee,Se,_e,Ye,Pe,_n,Bn,_o,tr,Hn,pn,Yt;const Vn=O.strict,nr=(_=O.code)===null||_===void 0?void 0:_.optimize,ii=nr===!0||nr===void 0?1:nr||0,si=(P=(M=O.code)===null||M===void 0?void 0:M.regExp)!==null&&P!==void 0?P:h,Hl=(w=O.uriResolver)!==null&&w!==void 0?w:v.default;return{strictSchema:(N=(k=O.strictSchema)!==null&&k!==void 0?k:Vn)!==null&&N!==void 0?N:!0,strictNumbers:(R=(H=O.strictNumbers)!==null&&H!==void 0?H:Vn)!==null&&R!==void 0?R:!0,strictTypes:(ie=(X=O.strictTypes)!==null&&X!==void 0?X:Vn)!==null&&ie!==void 0?ie:"log",strictTuples:(we=(de=O.strictTuples)!==null&&de!==void 0?de:Vn)!==null&&we!==void 0?we:"log",strictRequired:(Ee=(ze=O.strictRequired)!==null&&ze!==void 0?ze:Vn)!==null&&Ee!==void 0?Ee:!1,code:O.code?{...O.code,optimize:ii,regExp:si}:{optimize:ii,regExp:si},loopRequired:(Se=O.loopRequired)!==null&&Se!==void 0?Se:u,loopEnum:(_e=O.loopEnum)!==null&&_e!==void 0?_e:u,meta:(Ye=O.meta)!==null&&Ye!==void 0?Ye:!0,messages:(Pe=O.messages)!==null&&Pe!==void 0?Pe:!0,inlineRefs:(_n=O.inlineRefs)!==null&&_n!==void 0?_n:!0,schemaId:(Bn=O.schemaId)!==null&&Bn!==void 0?Bn:"$id",addUsedSchema:(_o=O.addUsedSchema)!==null&&_o!==void 0?_o:!0,validateSchema:(tr=O.validateSchema)!==null&&tr!==void 0?tr:!0,validateFormats:(Hn=O.validateFormats)!==null&&Hn!==void 0?Hn:!0,unicodeRegExp:(pn=O.unicodeRegExp)!==null&&pn!==void 0?pn:!0,int32range:(Yt=O.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:M,lines:P}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:b,es5:M,lines:P}),this.logger=z(_.logger);const w=_.validateFormats;_.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,g,_,"NOT SUPPORTED"),T.call(this,p,_,"DEPRECATED","warn"),this._metaOpts=E.call(this),_.formats&&j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),_.keywords&&A.call(this,_.keywords),typeof _.meta=="object"&&this.addMetaSchema(_.meta),$.call(this),_.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:_,meta:M,schemaId:P}=this.opts;let w=m;P==="id"&&(w={...m},w.id=w.$id,delete w.$id),M&&_&&this.addMetaSchema(w,w[P],!1)}defaultMeta(){const{meta:_,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof _=="object"?_[M]||_:void 0}validate(_,M){let P;if(typeof _=="string"){if(P=this.getSchema(_),!P)throw new Error(`no schema with key or ref "${_}"`)}else P=this.compile(_);const w=P(M);return"$async"in P||(this.errors=P.errors),w}compile(_,M){const P=this._addSchema(_,M);return P.validate||this._compileSchemaEnv(P)}compileAsync(_,M){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:P}=this.opts;return w.call(this,_,M);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 H.call(this,de),await R.call(this,de.missingSchema),N.call(this,ie)}}function H({missingSchema:ie,missingRef:de}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${de} cannot be resolved`)}async function R(ie){const de=await X.call(this,ie);this.refs[ie]||await k.call(this,de.$schema),this.refs[ie]||this.addSchema(de,ie,M)}async function X(ie){const de=this._loading[ie];if(de)return de;try{return await(this._loading[ie]=P(ie))}finally{delete this._loading[ie]}}}addSchema(_,M,P,w=this.opts.validateSchema){if(Array.isArray(_)){for(const N of _)this.addSchema(N,void 0,P,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 M=(0,l.normalizeId)(M||k),this._checkUnique(M),this.schemas[M]=this._addSchema(_,P,M,w,!0),this}addMetaSchema(_,M,P=this.opts.validateSchema){return this.addSchema(_,M,!0,P),this}validateSchema(_,M){if(typeof _=="boolean")return!0;let P;if(P=_.$schema,P!==void 0&&typeof P!="string")throw new Error("$schema must be a string");if(P=P||this.opts.defaultMeta||this.defaultMeta(),!P)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(P,_);if(!w&&M){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 M;for(;typeof(M=C.call(this,_))=="string";)_=M;if(M===void 0){const{schemaId:P}=this.opts,w=new s.SchemaEnv({schema:{},schemaId:P});if(M=s.resolveSchema.call(this,w,_),!M)return;this.refs[_]=M}return M.validate||this._compileSchemaEnv(M)}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 M=C.call(this,_);return typeof M=="object"&&this._cache.delete(M.schema),delete this.schemas[_],delete this.refs[_],this}case"object":{const M=_;this._cache.delete(M);let P=_[this.opts.schemaId];return P&&(P=(0,l.normalizeId)(P),delete this.schemas[P],delete this.refs[P]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(_){for(const M of _)this.addKeyword(M);return this}addKeyword(_,M){let P;if(typeof _=="string")P=_,typeof M=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=P);else if(typeof _=="object"&&M===void 0){if(M=_,P=M.keyword,Array.isArray(P)&&!P.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,P,M),!M)return(0,f.eachItem)(P,k=>F.call(this,k)),this;Y.call(this,M);const w={...M,type:(0,c.getJSONTypes)(M.type),schemaType:(0,c.getJSONTypes)(M.schemaType)};return(0,f.eachItem)(P,w.type.length===0?k=>F.call(this,k,w):k=>w.type.forEach(N=>F.call(this,k,w,N))),this}getKeyword(_){const M=this.RULES.all[_];return typeof M=="object"?M.definition:!!M}removeKeyword(_){const{RULES:M}=this;delete M.keywords[_],delete M.all[_];for(const P of M.rules){const w=P.rules.findIndex(k=>k.keyword===_);w>=0&&P.rules.splice(w,1)}return this}addFormat(_,M){return typeof M=="string"&&(M=new RegExp(M)),this.formats[_]=M,this}errorsText(_=this.errors,{separator:M=", ",dataVar:P="data"}={}){return!_||_.length===0?"No errors":_.map(w=>`${P}${w.instancePath} ${w.message}`).reduce((w,k)=>w+M+k)}$dataMetaSchema(_,M){const P=this.RULES.all;_=JSON.parse(JSON.stringify(_));for(const w of M){const k=w.split("/").slice(1);let N=_;for(const H of k)N=N[H];for(const H in P){const R=P[H];if(typeof R!="object")continue;const{$data:X}=R.definition,ie=N[H];X&&ie&&(N[H]=J(ie))}}return _}_removeAllSchemas(_,M){for(const P in _){const w=_[P];(!M||M.test(P))&&(typeof w=="string"?delete _[P]:w&&!w.meta&&(this._cache.delete(w.schema),delete _[P]))}}_addSchema(_,M,P,w=this.opts.validateSchema,k=this.opts.addUsedSchema){let N;const{schemaId:H}=this.opts;if(typeof _=="object")N=_[H];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 R=this._cache.get(_);if(R!==void 0)return R;P=(0,l.normalizeId)(N||P);const X=l.getSchemaRefs.call(this,_,P);return R=new s.SchemaEnv({schema:_,schemaId:H,meta:M,baseId:P,localRefs:X}),this._cache.set(R.schema,R),k&&!P.startsWith("#")&&(P&&this._checkUnique(P),this.refs[P]=R),w&&this.validateSchema(_,!0),R}_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 M=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,_)}finally{this.opts=M}}}S.ValidationError=o.default,S.MissingRefError=r.default,e.default=S;function T(O,_,M,P="error"){for(const w in O){const k=w;k in _&&this.logger[P](`${M}: option ${w}. ${O[k]}`)}}function C(O){return O=(0,l.normalizeId)(O),this.schemas[O]||this.refs[O]}function $(){const O=this.opts.schemas;if(O)if(Array.isArray(O))this.addSchema(O);else for(const _ in O)this.addSchema(O[_],_)}function j(){for(const O in this.opts.formats){const _=this.opts.formats[O];_&&this.addFormat(O,_)}}function A(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const _ in O){const M=O[_];M.keyword||(M.keyword=_),this.addKeyword(M)}}function E(){const O={...this.opts};for(const _ of y)delete O[_];return O}const q={log(){},warn(){},error(){}};function z(O){if(O===!1)return q;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function L(O,_){const{RULES:M}=this;if((0,f.eachItem)(O,P=>{if(M.keywords[P])throw new Error(`Keyword ${P} is already defined`);if(!U.test(P))throw new Error(`Keyword ${P} has invalid name`)}),!!_&&_.$data&&!("code"in _||"validate"in _))throw new Error('$data keyword must have "code" or "validate" function')}function F(O,_,M){var P;const w=_==null?void 0:_.post;if(M&&w)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let N=w?k.post:k.rules.find(({type:R})=>R===M);if(N||(N={type:M,rules:[]},k.rules.push(N)),k.keywords[O]=!0,!_)return;const H={keyword:O,definition:{..._,type:(0,c.getJSONTypes)(_.type),schemaType:(0,c.getJSONTypes)(_.schemaType)}};_.before?G.call(this,N,H,_.before):N.rules.push(H),k.all[O]=H,(P=_.implements)===null||P===void 0||P.forEach(R=>this.addKeyword(R))}function G(O,_,M){const P=O.rules.findIndex(w=>w.keyword===M);P>=0?O.rules.splice(P,0,_):(O.rules.push(_),this.logger.warn(`rule ${M} is not defined`))}function Y(O){let{metaSchema:_}=O;_!==void 0&&(O.$data&&this.opts.$data&&(_=J(_)),O.validateSchema=this.compile(_,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function J(O){return{anyOf:[O,D]}}})(Rv);var fp={},mp={},hp={};Object.defineProperty(hp,"__esModule",{value:!0});const NT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};hp.default=NT;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.callRef=zn.getValidate=void 0;const CT=Yr,Jm=ye,Tt=ue,sr=Dt,Qm=xt,Ys=Q,ET={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=Qm.resolveRef.call(l,c,r,n);if(f===void 0)throw new CT.default(o.opts.uriResolver,r,n);if(f instanceof Qm.SchemaEnv)return v(f);return h(f);function m(){if(i===c)return xa(e,s,i,i.$async);const y=t.scopeValue("root",{ref:c});return xa(e,(0,Tt._)`${y}.validate`,c,c.$async)}function v(y){const b=Nb(e,y);xa(e,b,y,y.$async)}function h(y){const b=t.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Tt.stringify)(y)}:{ref:y}),g=t.name("valid"),p=e.subschema({schema:y,dataTypes:[],schemaPath:Tt.nil,topSchemaRef:b,errSchemaPath:n},g);e.mergeEvaluated(p),e.ok(g)}}};function Nb(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=Nb;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 y=r.let("valid");r.try(()=>{r.code((0,Tt._)`await ${(0,Jm.callValidateCode)(e,t,c)}`),h(t),s||r.assign(y,!0)},b=>{r.if((0,Tt._)`!(${b} instanceof ${i.ValidationError})`,()=>r.throw(b)),v(b),s||r.assign(y,!1)}),e.ok(y)}function m(){e.result((0,Jm.callValidateCode)(e,t,c),()=>h(t),()=>v(t))}function v(y){const b=(0,Tt._)`${y}.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 h(y){var b;if(!i.opts.unevaluated)return;const g=(b=n==null?void 0:n.validate)===null||b===void 0?void 0:b.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=Ys.mergeEvaluated.props(r,g.props,i.props));else{const p=r.var("props",(0,Tt._)`${y}.evaluated.props`);i.props=Ys.mergeEvaluated.props(r,p,i.props,Tt.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=Ys.mergeEvaluated.items(r,g.items,i.items));else{const p=r.var("items",(0,Tt._)`${y}.evaluated.items`);i.items=Ys.mergeEvaluated.items(r,p,i.items,Tt.Name)}}}zn.callRef=xa;zn.default=ET;Object.defineProperty(mp,"__esModule",{value:!0});const PT=hp,IT=zn,OT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",PT.default,IT.default];mp.default=OT;var yp={},gp={};Object.defineProperty(gp,"__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}},RT={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}}`},AT={keyword:Object.keys(il),type:"number",schemaType:"number",$data:!0,error:RT,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data((0,rl._)`${n} ${il[t].fail} ${o} || isNaN(${n})`)}};gp.default=AT;var vp={};Object.defineProperty(vp,"__esModule",{value:!0});const Li=ue,MT={message:({schemaCode:e})=>(0,Li.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Li._)`{multipleOf: ${e}}`},qT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:MT,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}))`)}};vp.default=qT;var bp={},xp={};Object.defineProperty(xp,"__esModule",{value:!0});function Cb(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}xp.default=Cb;Cb.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(bp,"__esModule",{value:!0});const Io=ue,UT=Q,LT=xp,DT={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}}`},zT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:DT,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,UT.useFunc)(e.gen,LT.default)}(${n})`;e.fail$data((0,Io._)`${s} ${i} ${o}`)}};bp.default=zT;var wp={};Object.defineProperty(wp,"__esModule",{value:!0});const FT=ye,BT=Q,kr=ue,HT={message:({schemaCode:e})=>(0,kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,kr._)`{pattern: ${e}}`},VT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:HT,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,BT.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,FT.usePattern)(e,r);e.fail$data((0,kr._)`!${l}.test(${n})`)}}};wp.default=VT;var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});const Di=ue,WT={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}}`},KT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:WT,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}`)}};Sp.default=KT;var $p={};Object.defineProperty($p,"__esModule",{value:!0});const yi=ye,zi=ue,GT=Q,JT={message:({params:{missingProperty:e}})=>(0,zi.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,zi._)`{missingProperty: ${e}}`},QT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:JT,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 h=e.parentSchema.properties,{definedProperties:y}=e.it;for(const b of n)if((h==null?void 0:h[b])===void 0&&!y.has(b)){const g=s.schemaEnv.baseId+s.errSchemaPath,p=`required property "${b}" is not defined at "${g}" (strictRequired)`;(0,GT.checkStrictMode)(s,p,s.opts.strictRequired)}}function c(){if(l||i)e.block$data(zi.nil,m);else for(const h of n)(0,yi.checkReportMissingProp)(e,h)}function f(){const h=t.let("missing");if(l||i){const y=t.let("valid",!0);e.block$data(y,()=>v(h,y)),e.ok(y)}else t.if((0,yi.checkMissingProp)(e,n,h)),(0,yi.reportMissingProp)(e,h),t.else()}function m(){t.forOf("prop",o,h=>{e.setParams({missingProperty:h}),t.if((0,yi.noPropertyInData)(t,r,h,a.ownProperties),()=>e.error())})}function v(h,y){e.setParams({missingProperty:h}),t.forOf(h,o,()=>{t.assign(y,(0,yi.propertyInData)(t,r,h,a.ownProperties)),t.if((0,zi.not)(y),()=>{e.error(),t.break()})},zi.nil)}}};$p.default=QT;var kp={};Object.defineProperty(kp,"__esModule",{value:!0});const Fi=ue,YT={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}}`},XT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:YT,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}`)}};kp.default=XT;var Tp={},Es={};Object.defineProperty(Es,"__esModule",{value:!0});const Eb=Qv;Eb.code='require("ajv/dist/runtime/equal").default';Es.default=Eb;Object.defineProperty(Tp,"__esModule",{value:!0});const xc=et,it=ue,ZT=Q,e1=Es,t1={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}}`},n1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:t1,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 y=t.let("i",(0,it._)`${n}.length`),b=t.let("j");e.setParams({i:y,j:b}),t.assign(l,!0),t.if((0,it._)`${y} > 1`,()=>(m()?v:h)(y,b))}function m(){return c.length>0&&!c.some(y=>y==="object"||y==="array")}function v(y,b){const g=t.name("item"),p=(0,xc.checkDataTypes)(c,g,a.opts.strictNumbers,xc.DataType.Wrong),u=t.const("indices",(0,it._)`{}`);t.for((0,it._)`;${y}--;`,()=>{t.let(g,(0,it._)`${n}[${y}]`),t.if(p,(0,it._)`continue`),c.length>1&&t.if((0,it._)`typeof ${g} == "string"`,(0,it._)`${g} += "_"`),t.if((0,it._)`typeof ${u}[${g}] == "number"`,()=>{t.assign(b,(0,it._)`${u}[${g}]`),e.error(),t.assign(l,!1).break()}).code((0,it._)`${u}[${g}] = ${y}`)})}function h(y,b){const g=(0,ZT.useFunc)(t,e1.default),p=t.name("outer");t.label(p).for((0,it._)`;${y}--;`,()=>t.for((0,it._)`${b} = ${y}; ${b}--;`,()=>t.if((0,it._)`${g}(${n}[${y}], ${n}[${b}])`,()=>{e.error(),t.assign(l,!1).break(p)})))}}};Tp.default=n1;var _p={};Object.defineProperty(_p,"__esModule",{value:!0});const Ud=ue,o1=Q,r1=Es,i1={message:"must be equal to constant",params:({schemaCode:e})=>(0,Ud._)`{allowedValue: ${e}}`},s1={keyword:"const",$data:!0,error:i1,code(e){const{gen:t,data:n,$data:o,schemaCode:r,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,Ud._)`!${(0,o1.useFunc)(t,r1.default)}(${n}, ${r})`):e.fail((0,Ud._)`${i} !== ${n}`)}};_p.default=s1;var jp={};Object.defineProperty(jp,"__esModule",{value:!0});const ji=ue,a1=Q,l1=Es,c1={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ji._)`{allowedValues: ${e}}`},d1={keyword:"enum",schemaType:"array",$data:!0,error:c1,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,a1.useFunc)(t,l1.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 h=t.const("vSchema",i);f=(0,ji.or)(...r.map((y,b)=>v(h,b)))}e.pass(f);function m(){t.assign(f,!1),t.forOf("v",i,h=>t.if((0,ji._)`${c()}(${n}, ${h})`,()=>t.assign(f,!0).break()))}function v(h,y){const b=r[y];return typeof b=="object"&&b!==null?(0,ji._)`${c()}(${n}, ${h}[${y}])`:(0,ji._)`${n} === ${b}`}}};jp.default=d1;Object.defineProperty(yp,"__esModule",{value:!0});const u1=gp,p1=vp,f1=bp,m1=wp,h1=Sp,y1=$p,g1=kp,v1=Tp,b1=_p,x1=jp,w1=[u1.default,p1.default,f1.default,m1.default,h1.default,y1.default,g1.default,v1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},b1.default,x1.default];yp.default=w1;var Np={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.validateAdditionalItems=void 0;const Oo=ue,Ld=Q,S1={message:({params:{len:e}})=>(0,Oo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Oo._)`{limit: ${e}}`},$1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:S1,code(e){const{parentSchema:t,it:n}=e,{items:o}=t;if(!Array.isArray(o)){(0,Ld.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}Pb(e,o)}};function Pb(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,Ld.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:Ld.Type.Num},c),s.allErrors||n.if((0,Oo.not)(c),()=>n.break())})}}Xr.validateAdditionalItems=Pb;Xr.default=$1;var Cp={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateTuple=void 0;const Ym=ue,wa=Q,k1=ye,T1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return Ib(e,"additionalItems",t);n.items=!0,!(0,wa.alwaysValidSchema)(n,t)&&e.ok((0,k1.validateArray)(e))}};function Ib(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,Ym._)`${i}.length`);n.forEach((m,v)=>{(0,wa.alwaysValidSchema)(a,m)||(o.if((0,Ym._)`${c} > ${v}`,()=>e.subschema({keyword:s,schemaProp:v,dataProp:v},l)),e.ok(l))});function f(m){const{opts:v,errSchemaPath:h}=a,y=n.length,b=y===m.minItems&&(y===m.maxItems||m[t]===!1);if(v.strictTuples&&!b){const g=`"${s}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,wa.checkStrictMode)(a,g,v.strictTuples)}}}Zr.validateTuple=Ib;Zr.default=T1;Object.defineProperty(Cp,"__esModule",{value:!0});const _1=Zr,j1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,_1.validateTuple)(e,"items")};Cp.default=j1;var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});const Xm=ue,N1=Q,C1=ye,E1=Xr,P1={message:({params:{len:e}})=>(0,Xm.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Xm._)`{limit: ${e}}`},I1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:P1,code(e){const{schema:t,parentSchema:n,it:o}=e,{prefixItems:r}=n;o.items=!0,!(0,N1.alwaysValidSchema)(o,t)&&(r?(0,E1.validateAdditionalItems)(e,r):e.ok((0,C1.validateArray)(e)))}};Ep.default=I1;var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});const zt=ue,Xs=Q,O1={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}}`},R1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:O1,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?h(m,()=>t.if(m,()=>t.break())):s===0?(t.let(m,!0),a!==void 0&&t.if((0,zt._)`${r}.length > 0`,v)):(t.let(m,!1),v()),e.result(m,()=>e.reset());function v(){const b=t.name("_valid"),g=t.let("count",0);h(b,()=>t.if(b,()=>y(g)))}function h(b,g){t.forRange("i",0,f,p=>{e.subschema({keyword:"contains",dataProp:p,dataPropType:Xs.Type.Num,compositeRule:!0},b),g()})}function y(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)))}}};Pp.default=R1;var Rl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ue,n=Q,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 y$({gen:e,parentData:t,parentDataProperty:n},o){e.if((0,fe._)`${t} !== undefined`,()=>e.assign((0,fe._)`${t}[${n}]`,o))}function Md(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=Md;function tp(e,t,n,o){if(e.length===1)return Md(e[0],t,n,o);let r;const i=(0,Hv.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,Md(s,t,n,o));return r}et.checkDataTypes=tp;const g$={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,fe._)`{type: ${e}}`:(0,fe._)`{type: ${t}}`};function np(e){const t=v$(e);(0,u$.reportError)(t,g$)}et.reportTypeError=np;function v$(e){const{gen:t,data:n,schema:o}=e,r=(0,Hv.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,b$=Q;function x$(e,t){const{properties:n,items:o}=e.schema;if(t==="object"&&n)for(const r in n)Dm(e,r,n[r].default);else t==="array"&&Array.isArray(o)&&o.forEach((r,i)=>Dm(e,i,r.default))}El.assignDefaults=x$;function Dm(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,b$.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,op=Q,Kn=Dt,w$=Q;function S$(e,t){const{gen:n,data:o,it:r}=e;n.if(ip(n,o,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ae._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=S$;function $$({gen:e,data:t,it:{opts:n}},o,r){return(0,Ae.or)(...o.map(i=>(0,Ae.and)(ip(e,t,i,n.ownProperties),(0,Ae._)`${r} = ${i}`)))}ye.checkMissingProp=$$;function k$(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=k$;function Kv(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ae._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=Kv;function rp(e,t,n){return(0,Ae._)`${Kv(e)}.call(${t}, ${n})`}ye.isOwnProperty=rp;function T$(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} !== undefined`;return o?(0,Ae._)`${r} && ${rp(e,t,n)}`:r}ye.propertyInData=T$;function ip(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} === undefined`;return o?(0,Ae.or)(r,(0,Ae.not)(rp(e,t,n))):r}ye.noPropertyInData=ip;function Gv(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=Gv;function _$(e,t){return Gv(t).filter(n=>!(0,op.alwaysValidSchema)(e,t[n]))}ye.schemaProperties=_$;function j$({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:r,errorPath:i},it:s},a,l,d){const p=d?(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 v=(0,Ae._)`${p}, ${n.object(...m)}`;return l!==Ae.nil?(0,Ae._)`${a}.call(${l}, ${v})`:(0,Ae._)`${a}(${v})`}ye.callValidateCode=j$;const N$=(0,Ae._)`new RegExp`;function C$({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"?N$:(0,w$.useFunc)(e,r)}(${n}, ${o})`})}ye.usePattern=C$;function E$(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,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:op.Type.Num},i),t.if((0,Ae.not)(i),a)})}}ye.validateArray=E$;function P$(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,op.alwaysValidSchema)(r,l))&&!r.opts.unevaluated)return;const s=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,d)=>{const p=e.subschema({keyword:o,schemaProp:d,compositeRule:!0},a);t.assign(s,(0,Ae._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Ae.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ye.validateUnion=P$;Object.defineProperty(bn,"__esModule",{value:!0});bn.validateKeywordUsage=bn.validSchemaType=bn.funcKeywordCode=bn.macroKeywordCode=void 0;const bt=ue,Po=Dt,I$=ye,O$=Ns;function R$(e,t){const{gen:n,keyword:o,schema:r,parentSchema:i,it:s}=e,a=t.macro.call(s.self,r,i,s),l=Jv(n,o,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const d=n.name("valid");e.subschema({schema:a,schemaPath:bt.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}bn.macroKeywordCode=R$;function A$(e,t){var n;const{gen:o,keyword:r,schema:i,parentSchema:s,$data:a,it:l}=e;q$(l,t);const d=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,p=Jv(o,r,d),m=o.let("valid");e.block$data(m,v),e.ok((n=t.valid)!==null&&n!==void 0?n:m);function v(){if(t.errors===!1)b(),t.modifying&&zm(e),g(()=>e.error());else{const f=t.async?h():y();t.modifying&&zm(e),g(()=>M$(e,f))}}function h(){const f=o.let("ruleErrs",null);return o.try(()=>b((0,bt._)`await `),u=>o.assign(m,!1).if((0,bt._)`${u} instanceof ${l.ValidationError}`,()=>o.assign(f,(0,bt._)`${u}.errors`),()=>o.throw(u))),f}function y(){const f=(0,bt._)`${p}.errors`;return o.assign(f,null),b(bt.nil),f}function b(f=t.async?(0,bt._)`await `:bt.nil){const u=l.opts.passContext?Po.default.this:Po.default.self,x=!("compile"in t&&!a||t.schema===!1);o.assign(m,(0,bt._)`${f}${(0,I$.callValidateCode)(e,p,u,x)}`,t.modifying)}function g(f){var u;o.if((0,bt.not)((u=t.valid)!==null&&u!==void 0?u:m),f)}}bn.funcKeywordCode=A$;function zm(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,()=>t.assign(n,(0,bt._)`${o.parentData}[${o.parentDataProperty}]`))}function M$(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,O$.extendErrors)(e)},()=>e.error())}function q$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Jv(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 U$(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=U$;function L$({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=L$;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.extendSubschemaMode=yo.extendSubschemaData=yo.getSubschema=void 0;const vn=ue,Qv=Q;function D$(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,Qv.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=D$;function z$(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:d,dataPathArr:p,opts:m}=t,v=a.let("data",(0,vn._)`${t.data}${(0,vn.getProperty)(n)}`,!0);l(v),e.errorPath=(0,vn.str)`${d}${(0,Qv.getErrorPath)(n,o,m.jsPropertySyntax)}`,e.parentDataProperty=(0,vn._)`${n}`,e.dataPathArr=[...p,e.parentDataProperty]}if(r!==void 0){const d=r instanceof vn.Name?r:a.let("data",r,!0);l(d),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(d){e.data=d,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,d]}}yo.extendSubschemaData=z$;function F$(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=F$;var lt={},Yv=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},Xv={exports:{}},so=Xv.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,d){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,r,i,s,a,l,d);for(var p in o){var m=o[p];if(Array.isArray(m)){if(p in so.arrayKeywords)for(var v=0;v<m.length;v++)va(e,t,n,m[v],r+"/"+p+"/"+v,i,r,p,o,v)}else if(p in so.propsKeywords){if(m&&typeof m=="object")for(var h in m)va(e,t,n,m[h],r+"/"+p+"/"+B$(h),i,r,p,o,h)}else(p in so.keywords||e.allKeys&&!(p in so.skipKeywords))&&va(e,t,n,m,r+"/"+p,i,r,p,o)}n(o,r,i,s,a,l,d)}}function B$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var H$=Xv.exports;Object.defineProperty(lt,"__esModule",{value:!0});lt.getSchemaRefs=lt.resolveUrl=lt.normalizeId=lt._getFullPath=lt.getFullPath=lt.inlineRef=void 0;const V$=Q,W$=Yv,K$=H$,G$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!qd(e):t?Zv(e)<=t:!1}lt.inlineRef=J$;const Q$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qd(e){for(const t in e){if(Q$.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(qd)||typeof n=="object"&&qd(n))return!0}return!1}function Zv(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!G$.has(n)&&(typeof e[n]=="object"&&(0,V$.eachItem)(e[n],o=>t+=Zv(o)),t===1/0))return 1/0}return t}function eb(e,t="",n){n!==!1&&(t=Or(t));const o=e.parse(t);return tb(e,o)}lt.getFullPath=eb;function tb(e,t){return e.serialize(t).split("#")[0]+"#"}lt._getFullPath=tb;const Y$=/#\/?$/;function Or(e){return e?e.replace(Y$,""):""}lt.normalizeId=Or;function X$(e,t,n){return n=Or(n),e.resolve(t,n)}lt.resolveUrl=X$;const Z$=/^[a-z_][-a-z0-9._]*$/i;function ek(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:o}=this.opts,r=Or(e[n]||t),i={"":r},s=eb(o,r,!1),a={},l=new Set;return K$(e,{allKeys:!0},(m,v,h,y)=>{if(y===void 0)return;const b=s+v;let g=i[y];typeof m[n]=="string"&&(g=f.call(this,m[n])),u.call(this,m.$anchor),u.call(this,m.$dynamicAnchor),i[v]=g;function f(x){const S=this.opts.uriResolver.resolve;if(x=Or(g?S(g,x):x),l.has(x))throw p(x);l.add(x);let T=this.refs[x];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?d(m,T.schema,x):x!==Or(b)&&(x[0]==="#"?(d(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}"`);f.call(this,`#${x}`)}}}),a;function d(m,v,h){if(v!==void 0&&!W$(m,v))throw p(h)}function p(m){return new Error(`reference "${m}" resolves to more than one schema`)}}lt.getSchemaRefs=ek;Object.defineProperty(ln,"__esModule",{value:!0});ln.getData=ln.KeywordCxt=ln.validateFunctionCode=void 0;const nb=Wr,Fm=et,sp=An,nl=et,tk=El,Li=bn,gc=yo,re=ue,le=Dt,nk=lt,Mn=Q,yi=Ns;function ok(e){if(ib(e)&&(sb(e),rb(e))){sk(e);return}ob(e,()=>(0,nb.topBoolOrEmptySchema)(e))}ln.validateFunctionCode=ok;function ob({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"; ${Bm(n,r)}`),ik(e,r),e.code(i)}):e.func(t,(0,re._)`${le.default.data}, ${rk(r)}`,o.$async,()=>e.code(Bm(n,r)).code(i))}function rk(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 ik(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 sk(e){const{schema:t,opts:n,gen:o}=e;ob(e,()=>{n.$comment&&t.$comment&&lb(e),uk(e),o.let(le.default.vErrors,null),o.let(le.default.errors,0),n.unevaluated&&ak(e),ab(e),mk(e)})}function ak(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 Bm(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 lk(e,t){if(ib(e)&&(sb(e),rb(e))){ck(e,t);return}(0,nb.boolOrEmptySchema)(e,t)}function rb({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 ib(e){return typeof e.schema!="boolean"}function ck(e,t){const{schema:n,gen:o,opts:r}=e;r.$comment&&n.$comment&&lb(e),pk(e),fk(e);const i=o.const("_errs",le.default.errors);ab(e,i),o.var(t,(0,re._)`${i} === ${le.default.errors}`)}function sb(e){(0,Mn.checkUnknownRules)(e),dk(e)}function ab(e,t){if(e.opts.jtd)return Hm(e,[],!1,t);const n=(0,Fm.getSchemaTypes)(e.schema),o=(0,Fm.coerceAndCheckDataType)(e,n);Hm(e,n,!o,t)}function dk(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 uk(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 pk(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,nk.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function fk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function lb({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 mk(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&&hk(e),t.return((0,re._)`${le.default.errors} === 0`))}function hk({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 Hm(e,t,n,o){const{gen:r,schema:i,data:s,allErrors:a,opts:l,self:d}=e,{RULES:p}=d;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,Mn.schemaHasRulesButRef)(i,p))){r.block(()=>ub(e,"$ref",p.all.$ref.definition));return}l.jtd||yk(e,t),r.block(()=>{for(const v of p.rules)m(v);m(p.post)});function m(v){(0,sp.shouldUseGroup)(i,v)&&(v.type?(r.if((0,nl.checkDataType)(v.type,s,l.strictNumbers)),Vm(e,v),t.length===1&&t[0]===v.type&&n&&(r.else(),(0,nl.reportTypeError)(e)),r.endIf()):Vm(e,v),a||r.if((0,re._)`${le.default.errors} === ${o||0}`))}}function Vm(e,t){const{gen:n,schema:o,opts:{useDefaults:r}}=e;r&&(0,tk.assignDefaults)(e,t.type),n.block(()=>{for(const i of t.rules)(0,sp.shouldUseRule)(o,i)&&ub(e,i.keyword,i.definition,t.type)})}function yk(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(gk(e,t),e.opts.allowUnionTypes||vk(e,t),bk(e,e.dataTypes))}function gk(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{cb(e.dataTypes,n)||ap(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),wk(e,t)}}function vk(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&ap(e,"use allowUnionTypes to allow union type keyword")}function bk(e,t){const n=e.self.RULES.all;for(const o in n){const r=n[o];if(typeof r=="object"&&(0,sp.shouldUseRule)(e.schema,r)){const{type:i}=r.definition;i.length&&!i.some(s=>xk(t,s))&&ap(e,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function xk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function cb(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function wk(e,t){const n=[];for(const o of e.dataTypes)cb(t,o)?n.push(o):t.includes("integer")&&o==="number"&&n.push("integer");e.dataTypes=n}function ap(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Mn.checkStrictMode)(e,t,e.opts.strictTypes)}class db{constructor(t,n,o){if((0,Li.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",pb(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Li.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?yi.reportExtraError:yi.reportError)(this,this.def.error,n)}$dataError(){(0,yi.reportError)(this,this.def.$dataError||yi.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,yi.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 lk(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=db;function ub(e,t,n,o){const r=new db(e,n,t);"code"in n?n.code(r,o):r.$data&&n.validate?(0,Li.funcKeywordCode)(r,n):"macro"in n?(0,Li.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Li.funcKeywordCode)(r,n)}const Sk=/^\/(?:[^~]|~0|~1)*$/,$k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pb(e,{dataLevel:t,dataNames:n,dataPathArr:o}){let r,i;if(e==="")return le.default.rootData;if(e[0]==="/"){if(!Sk.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,i=le.default.rootData}else{const d=$k.exec(e);if(!d)throw new Error(`Invalid JSON-pointer: ${e}`);const p=+d[1];if(r=d[2],r==="#"){if(p>=t)throw new Error(l("property/index",p));return o[t-p]}if(p>t)throw new Error(l("data",p));if(i=n[t-p],!r)return i}let s=i;const a=r.split("/");for(const d of a)d&&(i=(0,re._)`${i}${(0,re.getProperty)((0,Mn.unescapeJsonPointer)(d))}`,s=(0,re._)`${s} && ${i}`);return s;function l(d,p){return`Cannot access ${d} ${p} levels up, current level is ${t}`}}ln.getData=pb;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});class kk extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Cs.default=kk;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});const vc=lt;class Tk 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))}}Xr.default=Tk;var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.resolveSchema=xt.getCompilingSchema=xt.resolveRef=xt.compileSchema=xt.SchemaEnv=void 0;const Zt=ue,_k=Cs,jo=Dt,rn=lt,Wm=Q,jk=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 lp(e){const t=fb.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:_k.default,code:(0,Zt._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const d={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 p;try{this._compilations.add(e),(0,jk.validateFunctionCode)(d),s.optimize(this.opts.code.optimize);const m=s.toString();p=`${s.scopeRefs(jo.default.scope)}return ${m}`,this.opts.code.process&&(p=this.opts.code.process(p,e));const h=new Function(`${jo.default.self}`,`${jo.default.scope}`,p)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:m,scopeValues:s._values}),this.opts.unevaluated){const{props:y,items:b}=d;h.evaluated={props:y instanceof Zt.Name?void 0:y,items:b instanceof Zt.Name?void 0:b,dynamicProps:y instanceof Zt.Name,dynamicItems:b instanceof Zt.Name},h.source&&(h.source.evaluated=(0,Zt.stringify)(h.evaluated))}return e.validate=h,e}catch(m){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),m}finally{this._compilations.delete(e)}}xt.compileSchema=lp;function Nk(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=Pk.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]=Ck.call(this,i)}xt.resolveRef=Nk;function Ck(e){return(0,rn.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:lp.call(this,e)}function fb(e){for(const t of this._compilations)if(Ek(t,e))return t}xt.getCompilingSchema=fb;function Ek(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Pk(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||lp.call(this,s),i===(0,rn.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,d=a[l];return d&&(r=(0,rn.resolveUrl)(this.opts.uriResolver,r,d)),new Pl({schema:a,schemaId:l,root:e,baseId:r})}return bc.call(this,n,s)}}xt.resolveSchema=Il;const Ik=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,Wm.unescapeFragment)(a)];if(l===void 0)return;n=l;const d=typeof n=="object"&&n[this.opts.schemaId];!Ik.has(a)&&d&&(t=(0,rn.resolveUrl)(this.opts.uriResolver,t,d))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,Wm.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 Ok="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Rk="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ak="object",Mk=["$data"],qk={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Uk=!1,Lk={$id:Ok,description:Rk,type:Ak,required:Mk,properties:qk,additionalProperties:Uk};var cp={},Ol={exports:{}};const Dk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),mb=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),dp=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),hb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),zk=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function yb(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 Fk=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Km(e){return e.length=0,!0}function Bk(e,t,n){if(e.length){const o=yb(e);if(o!=="")t.push(o);else return n.error=!0,!1;e.length=0}return!0}function Hk(e){let t=0;const n={error:!1,address:"",zone:""},o=[],r=[];let i=!1,s=!1,a=Bk;for(let l=0;l<e.length;l++){const d=e[l];if(!(d==="["||d==="]"))if(d===":"){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(d==="%"){if(!a(r,o,n))break;a=Km}else{r.push(d);continue}}return r.length&&(a===Km?n.zone=r.join(""):s?o.push(r.join("")):o.push(yb(r))),n.address=o.join(""),n}function gb(e){if(Vk(e,":")<2)return{host:e,isIPV6:!1};const t=Hk(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 Vk(e,t){let n=0;for(let o=0;o<e.length;o++)e[o]===t&&n++;return n}function Wk(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 Kk={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Gk=/[@/?#:]/g,Jk=/[@/?#]/g;function vb(e,t){const n=t?Jk:Gk;return n.lastIndex=0,e.replace(n,o=>Kk[o])}function Qk(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(dp(r)){const i=r.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&hb(s)?n+=s:n+="%"+i,o+=2;continue}}n+=e[o]}return n}function Yk(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(dp(o)){const r=o.toUpperCase(),i=String.fromCharCode(parseInt(r,16));i!=="."&&hb(i)?t+=i:t+="%"+r,n+=2;continue}}zk(e[n])?t+=e[n]:t+=escape(e[n])}return t}function Xk(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(dp(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(!mb(n)){const o=gb(n);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=vb(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 bb={nonSimpleDomain:Fk,recomposeAuthority:Zk,reescapeHostDelimiters:vb,normalizePercentEncoding:Qk,normalizePathEncoding:Yk,escapePreservingEscapes:Xk,removeDotSegments:Wk,isIPv4:mb,isUUID:Dk,normalizeIPv6:gb};const{isUUID:eT}=bb,tT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function xb(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 wb(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Sb(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 nT(e){return e.secure=xb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function oT(e){if((e.port===(xb(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 rT(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(tT);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=up(r);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function iT(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=up(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 sT(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!eT(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function aT(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const $b={scheme:"http",domainHost:!0,parse:wb,serialize:Sb},lT={scheme:"https",domainHost:$b.domainHost,parse:wb,serialize:Sb},ba={scheme:"ws",domainHost:!0,parse:nT,serialize:oT},cT={scheme:"wss",domainHost:ba.domainHost,parse:ba.parse,serialize:ba.serialize},dT={scheme:"urn",parse:rT,serialize:iT,skipNormalize:!0},uT={scheme:"urn:uuid",parse:sT,serialize:aT,skipNormalize:!0},ol={http:$b,https:lT,ws:ba,wss:cT,urn:dT,"urn:uuid":uT};Object.setPrototypeOf(ol,null);function up(e){return e&&(ol[e]||ol[e.toLowerCase()])||void 0}var pT={SCHEMES:ol,getSchemeHandler:up};const{normalizeIPv6:fT,removeDotSegments:ji,recomposeAuthority:mT,normalizePercentEncoding:hT,normalizePathEncoding:yT,escapePreservingEscapes:gT,reescapeHostDelimiters:vT,isIPv4:bT,nonSimpleDomain:xT}=bb,{SCHEMES:wT,getSchemeHandler:kb}=pT;function ST(e,t){return typeof e=="string"?e=jT(e,t):typeof e=="object"&&(e=Kr(Jo(e,t),t)),e}function $T(e,t,n){const o=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=Tb(Kr(e,o),Kr(t,o),o,!0);return o.skipEscape=!0,Jo(r,o)}function Tb(e,t,n,o){const r={};return o||(e=Kr(Jo(e,n),n),t=Kr(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=ji(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=ji(t.path||""),r.query=t.query):(t.path?(t.path[0]==="/"?r.path=ji(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=ji(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 kT(e,t,n){const o=Gm(e,n),r=Gm(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=kb(o.scheme||n.scheme);i&&i.serialize&&i.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=hT(n.path):(n.path=gT(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),o.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");const s=mT(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=ji(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 TT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _T(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 _b(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(TT);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=_T(o,s);if(a!==void 0&&(o.error=o.error||a,r=!0),o.host)if(bT(o.host)===!1){const p=fT(o.host);o.host=p.host.toLowerCase(),i=p.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=kb(n.scheme||o.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&o.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&xT(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(d){o.error=o.error||"Host's domain name can not be converted to ASCII: "+d}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=vT(unescape(o.host),i))),o.path&&(o.path=yT(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 Kr(e,t){return _b(e,t).parsed}function jT(e,t){return jb(e,t).normalized}function jb(e,t){const{parsed:n,malformedAuthorityOrPort:o}=_b(e,t);return{normalized:o?e:Jo(n,t),malformedAuthorityOrPort:o}}function Gm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:o}=jb(e,t);return o?void 0:n}if(typeof e=="object")return Jo(e,t)}const pp={SCHEMES:wT,normalize:ST,resolve:$T,resolveComponent:Tb,equal:kT,serialize:Jo,parse:Kr};Ol.exports=pp;Ol.exports.default=pp;Ol.exports.fastUri=pp;var NT=Ol.exports;Object.defineProperty(cp,"__esModule",{value:!0});const Nb=NT;Nb.code='require("ajv/dist/runtime/uri").default';cp.default=Nb;(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=Xr,i=Go,s=xt,a=ue,l=lt,d=et,p=Q,m=Lk,v=cp,h=(O,_)=>new RegExp(O,_);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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."},f={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},u=200;function x(O){var _,M,P,w,k,N,H,R,X,ie,de,we,ze,Ee,Se,_e,Ye,Pe,_n,Bn,_o,tr,Hn,pn,Yt;const Vn=O.strict,nr=(_=O.code)===null||_===void 0?void 0:_.optimize,si=nr===!0||nr===void 0?1:nr||0,ai=(P=(M=O.code)===null||M===void 0?void 0:M.regExp)!==null&&P!==void 0?P:h,Hl=(w=O.uriResolver)!==null&&w!==void 0?w:v.default;return{strictSchema:(N=(k=O.strictSchema)!==null&&k!==void 0?k:Vn)!==null&&N!==void 0?N:!0,strictNumbers:(R=(H=O.strictNumbers)!==null&&H!==void 0?H:Vn)!==null&&R!==void 0?R:!0,strictTypes:(ie=(X=O.strictTypes)!==null&&X!==void 0?X:Vn)!==null&&ie!==void 0?ie:"log",strictTuples:(we=(de=O.strictTuples)!==null&&de!==void 0?de:Vn)!==null&&we!==void 0?we:"log",strictRequired:(Ee=(ze=O.strictRequired)!==null&&ze!==void 0?ze:Vn)!==null&&Ee!==void 0?Ee:!1,code:O.code?{...O.code,optimize:si,regExp:ai}:{optimize:si,regExp:ai},loopRequired:(Se=O.loopRequired)!==null&&Se!==void 0?Se:u,loopEnum:(_e=O.loopEnum)!==null&&_e!==void 0?_e:u,meta:(Ye=O.meta)!==null&&Ye!==void 0?Ye:!0,messages:(Pe=O.messages)!==null&&Pe!==void 0?Pe:!0,inlineRefs:(_n=O.inlineRefs)!==null&&_n!==void 0?_n:!0,schemaId:(Bn=O.schemaId)!==null&&Bn!==void 0?Bn:"$id",addUsedSchema:(_o=O.addUsedSchema)!==null&&_o!==void 0?_o:!0,validateSchema:(tr=O.validateSchema)!==null&&tr!==void 0?tr:!0,validateFormats:(Hn=O.validateFormats)!==null&&Hn!==void 0?Hn:!0,unicodeRegExp:(pn=O.unicodeRegExp)!==null&&pn!==void 0?pn:!0,int32range:(Yt=O.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:M,lines:P}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:b,es5:M,lines:P}),this.logger=z(_.logger);const w=_.validateFormats;_.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,g,_,"NOT SUPPORTED"),T.call(this,f,_,"DEPRECATED","warn"),this._metaOpts=E.call(this),_.formats&&j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),_.keywords&&A.call(this,_.keywords),typeof _.meta=="object"&&this.addMetaSchema(_.meta),$.call(this),_.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:_,meta:M,schemaId:P}=this.opts;let w=m;P==="id"&&(w={...m},w.id=w.$id,delete w.$id),M&&_&&this.addMetaSchema(w,w[P],!1)}defaultMeta(){const{meta:_,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof _=="object"?_[M]||_:void 0}validate(_,M){let P;if(typeof _=="string"){if(P=this.getSchema(_),!P)throw new Error(`no schema with key or ref "${_}"`)}else P=this.compile(_);const w=P(M);return"$async"in P||(this.errors=P.errors),w}compile(_,M){const P=this._addSchema(_,M);return P.validate||this._compileSchemaEnv(P)}compileAsync(_,M){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:P}=this.opts;return w.call(this,_,M);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 H.call(this,de),await R.call(this,de.missingSchema),N.call(this,ie)}}function H({missingSchema:ie,missingRef:de}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${de} cannot be resolved`)}async function R(ie){const de=await X.call(this,ie);this.refs[ie]||await k.call(this,de.$schema),this.refs[ie]||this.addSchema(de,ie,M)}async function X(ie){const de=this._loading[ie];if(de)return de;try{return await(this._loading[ie]=P(ie))}finally{delete this._loading[ie]}}}addSchema(_,M,P,w=this.opts.validateSchema){if(Array.isArray(_)){for(const N of _)this.addSchema(N,void 0,P,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 M=(0,l.normalizeId)(M||k),this._checkUnique(M),this.schemas[M]=this._addSchema(_,P,M,w,!0),this}addMetaSchema(_,M,P=this.opts.validateSchema){return this.addSchema(_,M,!0,P),this}validateSchema(_,M){if(typeof _=="boolean")return!0;let P;if(P=_.$schema,P!==void 0&&typeof P!="string")throw new Error("$schema must be a string");if(P=P||this.opts.defaultMeta||this.defaultMeta(),!P)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(P,_);if(!w&&M){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 M;for(;typeof(M=C.call(this,_))=="string";)_=M;if(M===void 0){const{schemaId:P}=this.opts,w=new s.SchemaEnv({schema:{},schemaId:P});if(M=s.resolveSchema.call(this,w,_),!M)return;this.refs[_]=M}return M.validate||this._compileSchemaEnv(M)}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 M=C.call(this,_);return typeof M=="object"&&this._cache.delete(M.schema),delete this.schemas[_],delete this.refs[_],this}case"object":{const M=_;this._cache.delete(M);let P=_[this.opts.schemaId];return P&&(P=(0,l.normalizeId)(P),delete this.schemas[P],delete this.refs[P]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(_){for(const M of _)this.addKeyword(M);return this}addKeyword(_,M){let P;if(typeof _=="string")P=_,typeof M=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=P);else if(typeof _=="object"&&M===void 0){if(M=_,P=M.keyword,Array.isArray(P)&&!P.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,P,M),!M)return(0,p.eachItem)(P,k=>F.call(this,k)),this;Y.call(this,M);const w={...M,type:(0,d.getJSONTypes)(M.type),schemaType:(0,d.getJSONTypes)(M.schemaType)};return(0,p.eachItem)(P,w.type.length===0?k=>F.call(this,k,w):k=>w.type.forEach(N=>F.call(this,k,w,N))),this}getKeyword(_){const M=this.RULES.all[_];return typeof M=="object"?M.definition:!!M}removeKeyword(_){const{RULES:M}=this;delete M.keywords[_],delete M.all[_];for(const P of M.rules){const w=P.rules.findIndex(k=>k.keyword===_);w>=0&&P.rules.splice(w,1)}return this}addFormat(_,M){return typeof M=="string"&&(M=new RegExp(M)),this.formats[_]=M,this}errorsText(_=this.errors,{separator:M=", ",dataVar:P="data"}={}){return!_||_.length===0?"No errors":_.map(w=>`${P}${w.instancePath} ${w.message}`).reduce((w,k)=>w+M+k)}$dataMetaSchema(_,M){const P=this.RULES.all;_=JSON.parse(JSON.stringify(_));for(const w of M){const k=w.split("/").slice(1);let N=_;for(const H of k)N=N[H];for(const H in P){const R=P[H];if(typeof R!="object")continue;const{$data:X}=R.definition,ie=N[H];X&&ie&&(N[H]=J(ie))}}return _}_removeAllSchemas(_,M){for(const P in _){const w=_[P];(!M||M.test(P))&&(typeof w=="string"?delete _[P]:w&&!w.meta&&(this._cache.delete(w.schema),delete _[P]))}}_addSchema(_,M,P,w=this.opts.validateSchema,k=this.opts.addUsedSchema){let N;const{schemaId:H}=this.opts;if(typeof _=="object")N=_[H];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 R=this._cache.get(_);if(R!==void 0)return R;P=(0,l.normalizeId)(N||P);const X=l.getSchemaRefs.call(this,_,P);return R=new s.SchemaEnv({schema:_,schemaId:H,meta:M,baseId:P,localRefs:X}),this._cache.set(R.schema,R),k&&!P.startsWith("#")&&(P&&this._checkUnique(P),this.refs[P]=R),w&&this.validateSchema(_,!0),R}_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 M=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,_)}finally{this.opts=M}}}S.ValidationError=o.default,S.MissingRefError=r.default,e.default=S;function T(O,_,M,P="error"){for(const w in O){const k=w;k in _&&this.logger[P](`${M}: option ${w}. ${O[k]}`)}}function C(O){return O=(0,l.normalizeId)(O),this.schemas[O]||this.refs[O]}function $(){const O=this.opts.schemas;if(O)if(Array.isArray(O))this.addSchema(O);else for(const _ in O)this.addSchema(O[_],_)}function j(){for(const O in this.opts.formats){const _=this.opts.formats[O];_&&this.addFormat(O,_)}}function A(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const _ in O){const M=O[_];M.keyword||(M.keyword=_),this.addKeyword(M)}}function E(){const O={...this.opts};for(const _ of y)delete O[_];return O}const q={log(){},warn(){},error(){}};function z(O){if(O===!1)return q;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function L(O,_){const{RULES:M}=this;if((0,p.eachItem)(O,P=>{if(M.keywords[P])throw new Error(`Keyword ${P} is already defined`);if(!U.test(P))throw new Error(`Keyword ${P} has invalid name`)}),!!_&&_.$data&&!("code"in _||"validate"in _))throw new Error('$data keyword must have "code" or "validate" function')}function F(O,_,M){var P;const w=_==null?void 0:_.post;if(M&&w)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let N=w?k.post:k.rules.find(({type:R})=>R===M);if(N||(N={type:M,rules:[]},k.rules.push(N)),k.keywords[O]=!0,!_)return;const H={keyword:O,definition:{..._,type:(0,d.getJSONTypes)(_.type),schemaType:(0,d.getJSONTypes)(_.schemaType)}};_.before?G.call(this,N,H,_.before):N.rules.push(H),k.all[O]=H,(P=_.implements)===null||P===void 0||P.forEach(R=>this.addKeyword(R))}function G(O,_,M){const P=O.rules.findIndex(w=>w.keyword===M);P>=0?O.rules.splice(P,0,_):(O.rules.push(_),this.logger.warn(`rule ${M} is not defined`))}function Y(O){let{metaSchema:_}=O;_!==void 0&&(O.$data&&this.opts.$data&&(_=J(_)),O.validateSchema=this.compile(_,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function J(O){return{anyOf:[O,D]}}})(Av);var fp={},mp={},hp={};Object.defineProperty(hp,"__esModule",{value:!0});const CT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};hp.default=CT;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.callRef=zn.getValidate=void 0;const ET=Xr,Jm=ye,Tt=ue,sr=Dt,Qm=xt,Ys=Q,PT={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:d}=i;if((n==="#"||n==="#/")&&r===d.baseId)return m();const p=Qm.resolveRef.call(l,d,r,n);if(p===void 0)throw new ET.default(o.opts.uriResolver,r,n);if(p instanceof Qm.SchemaEnv)return v(p);return h(p);function m(){if(i===d)return xa(e,s,i,i.$async);const y=t.scopeValue("root",{ref:d});return xa(e,(0,Tt._)`${y}.validate`,d,d.$async)}function v(y){const b=Cb(e,y);xa(e,b,y,y.$async)}function h(y){const b=t.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Tt.stringify)(y)}:{ref:y}),g=t.name("valid"),f=e.subschema({schema:y,dataTypes:[],schemaPath:Tt.nil,topSchemaRef:b,errSchemaPath:n},g);e.mergeEvaluated(f),e.ok(g)}}};function Cb(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=Cb;function xa(e,t,n,o){const{gen:r,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,d=l.passContext?sr.default.this:Tt.nil;o?p():m();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");const y=r.let("valid");r.try(()=>{r.code((0,Tt._)`await ${(0,Jm.callValidateCode)(e,t,d)}`),h(t),s||r.assign(y,!0)},b=>{r.if((0,Tt._)`!(${b} instanceof ${i.ValidationError})`,()=>r.throw(b)),v(b),s||r.assign(y,!1)}),e.ok(y)}function m(){e.result((0,Jm.callValidateCode)(e,t,d),()=>h(t),()=>v(t))}function v(y){const b=(0,Tt._)`${y}.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 h(y){var b;if(!i.opts.unevaluated)return;const g=(b=n==null?void 0:n.validate)===null||b===void 0?void 0:b.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=Ys.mergeEvaluated.props(r,g.props,i.props));else{const f=r.var("props",(0,Tt._)`${y}.evaluated.props`);i.props=Ys.mergeEvaluated.props(r,f,i.props,Tt.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=Ys.mergeEvaluated.items(r,g.items,i.items));else{const f=r.var("items",(0,Tt._)`${y}.evaluated.items`);i.items=Ys.mergeEvaluated.items(r,f,i.items,Tt.Name)}}}zn.callRef=xa;zn.default=PT;Object.defineProperty(mp,"__esModule",{value:!0});const IT=hp,OT=zn,RT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",IT.default,OT.default];mp.default=RT;var yp={},gp={};Object.defineProperty(gp,"__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}},AT={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}}`},MT={keyword:Object.keys(il),type:"number",schemaType:"number",$data:!0,error:AT,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data((0,rl._)`${n} ${il[t].fail} ${o} || isNaN(${n})`)}};gp.default=MT;var vp={};Object.defineProperty(vp,"__esModule",{value:!0});const Di=ue,qT={message:({schemaCode:e})=>(0,Di.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Di._)`{multipleOf: ${e}}`},UT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:qT,code(e){const{gen:t,data:n,schemaCode:o,it:r}=e,i=r.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Di._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Di._)`${s} !== parseInt(${s})`;e.fail$data((0,Di._)`(${o} === 0 || (${s} = ${n}/${o}, ${a}))`)}};vp.default=UT;var bp={},xp={};Object.defineProperty(xp,"__esModule",{value:!0});function Eb(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}xp.default=Eb;Eb.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(bp,"__esModule",{value:!0});const Io=ue,LT=Q,DT=xp,zT={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}}`},FT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:zT,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,LT.useFunc)(e.gen,DT.default)}(${n})`;e.fail$data((0,Io._)`${s} ${i} ${o}`)}};bp.default=FT;var wp={};Object.defineProperty(wp,"__esModule",{value:!0});const BT=ye,HT=Q,kr=ue,VT={message:({schemaCode:e})=>(0,kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,kr._)`{pattern: ${e}}`},WT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:VT,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,d=l.code==="new RegExp"?(0,kr._)`new RegExp`:(0,HT.useFunc)(t,l),p=t.let("valid");t.try(()=>t.assign(p,(0,kr._)`${d}(${i}, ${a}).test(${n})`),()=>t.assign(p,!1)),e.fail$data((0,kr._)`!${p}`)}else{const l=(0,BT.usePattern)(e,r);e.fail$data((0,kr._)`!${l}.test(${n})`)}}};wp.default=WT;var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});const zi=ue,KT={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,zi.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,zi._)`{limit: ${e}}`},GT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:KT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxProperties"?zi.operators.GT:zi.operators.LT;e.fail$data((0,zi._)`Object.keys(${n}).length ${r} ${o}`)}};Sp.default=GT;var $p={};Object.defineProperty($p,"__esModule",{value:!0});const gi=ye,Fi=ue,JT=Q,QT={message:({params:{missingProperty:e}})=>(0,Fi.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Fi._)`{missingProperty: ${e}}`},YT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:QT,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?d():p(),a.strictRequired){const h=e.parentSchema.properties,{definedProperties:y}=e.it;for(const b of n)if((h==null?void 0:h[b])===void 0&&!y.has(b)){const g=s.schemaEnv.baseId+s.errSchemaPath,f=`required property "${b}" is not defined at "${g}" (strictRequired)`;(0,JT.checkStrictMode)(s,f,s.opts.strictRequired)}}function d(){if(l||i)e.block$data(Fi.nil,m);else for(const h of n)(0,gi.checkReportMissingProp)(e,h)}function p(){const h=t.let("missing");if(l||i){const y=t.let("valid",!0);e.block$data(y,()=>v(h,y)),e.ok(y)}else t.if((0,gi.checkMissingProp)(e,n,h)),(0,gi.reportMissingProp)(e,h),t.else()}function m(){t.forOf("prop",o,h=>{e.setParams({missingProperty:h}),t.if((0,gi.noPropertyInData)(t,r,h,a.ownProperties),()=>e.error())})}function v(h,y){e.setParams({missingProperty:h}),t.forOf(h,o,()=>{t.assign(y,(0,gi.propertyInData)(t,r,h,a.ownProperties)),t.if((0,Fi.not)(y),()=>{e.error(),t.break()})},Fi.nil)}}};$p.default=YT;var kp={};Object.defineProperty(kp,"__esModule",{value:!0});const Bi=ue,XT={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,Bi.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,Bi._)`{limit: ${e}}`},ZT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:XT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxItems"?Bi.operators.GT:Bi.operators.LT;e.fail$data((0,Bi._)`${n}.length ${r} ${o}`)}};kp.default=ZT;var Tp={},Es={};Object.defineProperty(Es,"__esModule",{value:!0});const Pb=Yv;Pb.code='require("ajv/dist/runtime/equal").default';Es.default=Pb;Object.defineProperty(Tp,"__esModule",{value:!0});const xc=et,it=ue,e1=Q,t1=Es,n1={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}}`},o1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n1,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"),d=i.items?(0,xc.getSchemaTypes)(i.items):[];e.block$data(l,p,(0,it._)`${s} === false`),e.ok(l);function p(){const y=t.let("i",(0,it._)`${n}.length`),b=t.let("j");e.setParams({i:y,j:b}),t.assign(l,!0),t.if((0,it._)`${y} > 1`,()=>(m()?v:h)(y,b))}function m(){return d.length>0&&!d.some(y=>y==="object"||y==="array")}function v(y,b){const g=t.name("item"),f=(0,xc.checkDataTypes)(d,g,a.opts.strictNumbers,xc.DataType.Wrong),u=t.const("indices",(0,it._)`{}`);t.for((0,it._)`;${y}--;`,()=>{t.let(g,(0,it._)`${n}[${y}]`),t.if(f,(0,it._)`continue`),d.length>1&&t.if((0,it._)`typeof ${g} == "string"`,(0,it._)`${g} += "_"`),t.if((0,it._)`typeof ${u}[${g}] == "number"`,()=>{t.assign(b,(0,it._)`${u}[${g}]`),e.error(),t.assign(l,!1).break()}).code((0,it._)`${u}[${g}] = ${y}`)})}function h(y,b){const g=(0,e1.useFunc)(t,t1.default),f=t.name("outer");t.label(f).for((0,it._)`;${y}--;`,()=>t.for((0,it._)`${b} = ${y}; ${b}--;`,()=>t.if((0,it._)`${g}(${n}[${y}], ${n}[${b}])`,()=>{e.error(),t.assign(l,!1).break(f)})))}}};Tp.default=o1;var _p={};Object.defineProperty(_p,"__esModule",{value:!0});const Ud=ue,r1=Q,i1=Es,s1={message:"must be equal to constant",params:({schemaCode:e})=>(0,Ud._)`{allowedValue: ${e}}`},a1={keyword:"const",$data:!0,error:s1,code(e){const{gen:t,data:n,$data:o,schemaCode:r,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,Ud._)`!${(0,r1.useFunc)(t,i1.default)}(${n}, ${r})`):e.fail((0,Ud._)`${i} !== ${n}`)}};_p.default=a1;var jp={};Object.defineProperty(jp,"__esModule",{value:!0});const Ni=ue,l1=Q,c1=Es,d1={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Ni._)`{allowedValues: ${e}}`},u1={keyword:"enum",schemaType:"array",$data:!0,error:d1,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 d=()=>l??(l=(0,l1.useFunc)(t,c1.default));let p;if(a||o)p=t.let("valid"),e.block$data(p,m);else{if(!Array.isArray(r))throw new Error("ajv implementation error");const h=t.const("vSchema",i);p=(0,Ni.or)(...r.map((y,b)=>v(h,b)))}e.pass(p);function m(){t.assign(p,!1),t.forOf("v",i,h=>t.if((0,Ni._)`${d()}(${n}, ${h})`,()=>t.assign(p,!0).break()))}function v(h,y){const b=r[y];return typeof b=="object"&&b!==null?(0,Ni._)`${d()}(${n}, ${h}[${y}])`:(0,Ni._)`${n} === ${b}`}}};jp.default=u1;Object.defineProperty(yp,"__esModule",{value:!0});const p1=gp,f1=vp,m1=bp,h1=wp,y1=Sp,g1=$p,v1=kp,b1=Tp,x1=_p,w1=jp,S1=[p1.default,f1.default,m1.default,h1.default,y1.default,g1.default,v1.default,b1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},x1.default,w1.default];yp.default=S1;var Np={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateAdditionalItems=void 0;const Oo=ue,Ld=Q,$1={message:({params:{len:e}})=>(0,Oo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Oo._)`{limit: ${e}}`},k1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:$1,code(e){const{parentSchema:t,it:n}=e,{items:o}=t;if(!Array.isArray(o)){(0,Ld.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ib(e,o)}};function Ib(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,Ld.alwaysValidSchema)(s,o)){const d=n.var("valid",(0,Oo._)`${a} <= ${t.length}`);n.if((0,Oo.not)(d),()=>l(d)),e.ok(d)}function l(d){n.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:Ld.Type.Num},d),s.allErrors||n.if((0,Oo.not)(d),()=>n.break())})}}Zr.validateAdditionalItems=Ib;Zr.default=k1;var Cp={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.validateTuple=void 0;const Ym=ue,wa=Q,T1=ye,_1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return Ob(e,"additionalItems",t);n.items=!0,!(0,wa.alwaysValidSchema)(n,t)&&e.ok((0,T1.validateArray)(e))}};function Ob(e,t,n=e.schema){const{gen:o,parentSchema:r,data:i,keyword:s,it:a}=e;p(r),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=wa.mergeEvaluated.items(o,n.length,a.items));const l=o.name("valid"),d=o.const("len",(0,Ym._)`${i}.length`);n.forEach((m,v)=>{(0,wa.alwaysValidSchema)(a,m)||(o.if((0,Ym._)`${d} > ${v}`,()=>e.subschema({keyword:s,schemaProp:v,dataProp:v},l)),e.ok(l))});function p(m){const{opts:v,errSchemaPath:h}=a,y=n.length,b=y===m.minItems&&(y===m.maxItems||m[t]===!1);if(v.strictTuples&&!b){const g=`"${s}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,wa.checkStrictMode)(a,g,v.strictTuples)}}}ei.validateTuple=Ob;ei.default=_1;Object.defineProperty(Cp,"__esModule",{value:!0});const j1=ei,N1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,j1.validateTuple)(e,"items")};Cp.default=N1;var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});const Xm=ue,C1=Q,E1=ye,P1=Zr,I1={message:({params:{len:e}})=>(0,Xm.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Xm._)`{limit: ${e}}`},O1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:I1,code(e){const{schema:t,parentSchema:n,it:o}=e,{prefixItems:r}=n;o.items=!0,!(0,C1.alwaysValidSchema)(o,t)&&(r?(0,P1.validateAdditionalItems)(e,r):e.ok((0,E1.validateArray)(e)))}};Ep.default=O1;var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});const zt=ue,Xs=Q,R1={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}}`},A1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:R1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;let s,a;const{minContains:l,maxContains:d}=o;i.opts.next?(s=l===void 0?1:l,a=d):s=1;const p=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._)`${p} >= ${s}`;a!==void 0&&(b=(0,zt._)`${b} && ${p} <= ${a}`),e.pass(b);return}i.items=!0;const m=t.name("valid");a===void 0&&s===1?h(m,()=>t.if(m,()=>t.break())):s===0?(t.let(m,!0),a!==void 0&&t.if((0,zt._)`${r}.length > 0`,v)):(t.let(m,!1),v()),e.result(m,()=>e.reset());function v(){const b=t.name("_valid"),g=t.let("count",0);h(b,()=>t.if(b,()=>y(g)))}function h(b,g){t.forRange("i",0,p,f=>{e.subschema({keyword:"contains",dataProp:f,dataPropType:Xs.Type.Num,compositeRule:!0},b),g()})}function y(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)))}}};Pp.default=A1;var Rl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ue,n=Q,o=ye;e.error={message:({params:{property:l,depsCount:d,deps:p}})=>{const m=d===1?"property":"properties";return(0,t.str)`must have ${m} ${p} when property ${l} is present`},params:({params:{property:l,depsCount:d,deps:p,missingProperty:m}})=>(0,t._)`{property: ${l},
|
|
1763
1763
|
missingProperty: ${m},
|
|
1764
|
-
depsCount: ${
|
|
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 v=Array.isArray(l[m])?c:f;v[m]=l[m]}return[c,f]}function s(l,c=l.schema){const{gen:f,data:m,it:v}=l;if(Object.keys(c).length===0)return;const h=f.let("missing");for(const y in c){const b=c[y];if(b.length===0)continue;const g=(0,o.propertyInData)(f,m,y,v.opts.ownProperties);l.setParams({property:y,depsCount:b.length,deps:b.join(", ")}),v.allErrors?f.if(g,()=>{for(const p of b)(0,o.checkReportMissingProp)(l,p)}):(f.if((0,t._)`${g} && (${(0,o.checkMissingProp)(l,b,h)})`),(0,o.reportMissingProp)(l,h),f.else())}}e.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:f,data:m,keyword:v,it:h}=l,y=f.name("valid");for(const b in c)(0,n.alwaysValidSchema)(h,c[b])||(f.if((0,o.propertyInData)(f,m,b,h.opts.ownProperties),()=>{const g=l.subschema({keyword:v,schemaProp:b},y);l.mergeValidEvaluated(g,y)},()=>f.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=r})(Rl);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});const Ob=ue,A1=Q,M1={message:"property name must be valid",params:({params:e})=>(0,Ob._)`{propertyName: ${e.propertyName}}`},q1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:M1,code(e){const{gen:t,schema:n,data:o,it:r}=e;if((0,A1.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,Ob.not)(i),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(i)}};Ip.default=q1;var Al={};Object.defineProperty(Al,"__esModule",{value:!0});const Zs=ye,en=ue,U1=Dt,ea=Q,L1={message:"must NOT have additional properties",params:({params:e})=>(0,en._)`{additionalProperty: ${e.additionalProperty}}`},D1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:L1,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} === ${U1.default.errors}`);function m(){t.forIn("key",r,g=>{!c.length&&!f.length?y(g):t.if(v(g),()=>y(g))})}function v(g){let p;if(c.length>8){const u=(0,ea.schemaRefOrVal)(s,o.properties,"properties");p=(0,Zs.isOwnProperty)(t,u,g)}else c.length?p=(0,en.or)(...c.map(u=>(0,en._)`${g} === ${u}`)):p=en.nil;return f.length&&(p=(0,en.or)(p,...f.map(u=>(0,en._)`${(0,Zs.usePattern)(e,u)}.test(${g})`))),(0,en.not)(p)}function h(g){t.code((0,en._)`delete ${r}[${g}]`)}function y(g){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){h(g);return}if(n===!1){e.setParams({additionalProperty:g}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,ea.alwaysValidSchema)(s,n)){const p=t.name("valid");l.removeAdditional==="failing"?(b(g,p,!1),t.if((0,en.not)(p),()=>{e.reset(),h(g)})):(b(g,p),a||t.if((0,en.not)(p),()=>t.break()))}}function b(g,p,u){const x={keyword:"additionalProperties",dataProp:g,dataPropType:ea.Type.Str};u===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,p)}}};Al.default=D1;var Op={};Object.defineProperty(Op,"__esModule",{value:!0});const z1=ln,Zm=ye,wc=Q,eh=Al,F1={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&&eh.default.code(new z1.KeywordCxt(i,eh.default,"additionalProperties"));const s=(0,Zm.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,Zm.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)}}};Op.default=F1;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});const th=ye,ta=ue,nh=Q,oh=Q,B1={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,th.allSchemaProperties)(n),l=a.filter(b=>(0,nh.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,oh.evaluatedPropsToName)(t,i.props));const{props:m}=i;v();function v(){for(const b of a)c&&h(b),i.allErrors?y(b):(t.var(f,!0),y(b),t.if(f))}function h(b){for(const g in c)new RegExp(b).test(g)&&(0,nh.checkStrictMode)(i,`property ${g} matches pattern ${b} (use allowMatchingProperties)`)}function y(b){t.forIn("key",o,g=>{t.if((0,ta._)`${(0,th.usePattern)(e,b)}.test(${g})`,()=>{const p=l.includes(b);p||e.subschema({keyword:"patternProperties",schemaProp:b,dataProp:g,dataPropType:oh.Type.Str},f),i.opts.unevaluated&&m!==!0?t.assign((0,ta._)`${m}[${g}]`,!0):!p&&!i.allErrors&&t.if((0,ta.not)(f),()=>t.break())})})}}};Rp.default=B1;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});const H1=Q,V1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,H1.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"}};Ap.default=V1;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});const W1=ye,K1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:W1.validateUnion,error:{message:"must match a schema in anyOf"}};Mp.default=K1;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});const Sa=ue,G1=Q,J1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Sa._)`{passingSchemas: ${e.passing}}`},Q1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:J1,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 v;(0,G1.alwaysValidSchema)(r,f)?t.var(l,!0):v=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),v&&e.mergeEvaluated(v,Sa.Name)})})}}};qp.default=Q1;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});const Y1=Q,X1={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,Y1.alwaysValidSchema)(o,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},r);e.ok(r),e.mergeEvaluated(a)})}};Up.default=X1;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});const sl=ue,Rb=Q,Z1={message:({params:e})=>(0,sl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,sl._)`{failingKeyword: ${e.ifClause}}`},e_={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Z1,code(e){const{gen:t,parentSchema:n,it:o}=e;n.then===void 0&&n.else===void 0&&(0,Rb.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const r=rh(o,"then"),i=rh(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 v=e.subschema({keyword:f},a);t.assign(s,a),e.mergeValidEvaluated(v,s),m?t.assign(m,(0,sl._)`${f}`):e.setParams({ifClause:f})}}}};function rh(e,t){const n=e.schema[t];return n!==void 0&&!(0,Rb.alwaysValidSchema)(e,n)}Lp.default=e_;var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});const t_=Q,n_={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,t_.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Dp.default=n_;Object.defineProperty(Np,"__esModule",{value:!0});const o_=Xr,r_=Cp,i_=Zr,s_=Ep,a_=Pp,l_=Rl,c_=Ip,d_=Al,u_=Op,p_=Rp,f_=Ap,m_=Mp,h_=qp,y_=Up,g_=Lp,v_=Dp;function b_(e=!1){const t=[f_.default,m_.default,h_.default,y_.default,g_.default,v_.default,c_.default,d_.default,l_.default,u_.default,p_.default];return e?t.push(r_.default,s_.default):t.push(o_.default,i_.default),t.push(a_.default),t}Np.default=b_;var zp={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.dynamicAnchor=void 0;const Sc=ue,x_=Dt,ih=xt,w_=zn,S_={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Ab(e,e.schema)};function Ab(e,t){const{gen:n,it:o}=e;o.schemaEnv.root.dynamicAnchors[t]=!0;const r=(0,Sc._)`${x_.default.dynamicAnchors}${(0,Sc.getProperty)(t)}`,i=o.errSchemaPath==="#"?o.validateName:$_(e);n.if((0,Sc._)`!${r}`,()=>n.assign(r,i))}ei.dynamicAnchor=Ab;function $_(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 ih.SchemaEnv({schema:n,schemaId:l,root:r,baseId:i,localRefs:s,meta:a});return ih.compileSchema.call(o,c),(0,w_.getValidate)(e,c)}ei.default=S_;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.dynamicRef=void 0;const sh=ue,k_=Dt,ah=zn,T_={keyword:"$dynamicRef",schemaType:"string",code:e=>Mb(e,e.schema)};function Mb(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,sh._)`${k_.default.dynamicAnchors}${(0,sh.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,ah.callRef)(e,l),n.let(c,!0)}):()=>(0,ah.callRef)(e,l)}}ti.dynamicRef=Mb;ti.default=T_;var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});const __=ei,j_=Q,N_={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,__.dynamicAnchor)(e,""):(0,j_.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Fp.default=N_;var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});const C_=ti,E_={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,C_.dynamicRef)(e,e.schema)};Bp.default=E_;Object.defineProperty(zp,"__esModule",{value:!0});const P_=ei,I_=ti,O_=Fp,R_=Bp,A_=[P_.default,I_.default,O_.default,R_.default];zp.default=A_;var Hp={},Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});const lh=Rl,M_={keyword:"dependentRequired",type:"object",schemaType:"object",error:lh.error,code:e=>(0,lh.validatePropertyDeps)(e)};Vp.default=M_;var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});const q_=Rl,U_={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,q_.validateSchemaDeps)(e)};Wp.default=U_;var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});const L_=Q,D_={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,L_.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Kp.default=D_;Object.defineProperty(Hp,"__esModule",{value:!0});const z_=Vp,F_=Wp,B_=Kp,H_=[z_.default,F_.default,B_.default];Hp.default=H_;var Gp={},Jp={};Object.defineProperty(Jp,"__esModule",{value:!0});const Xn=ue,ch=Q,V_=Dt,W_={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Xn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},K_={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:W_,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} === ${V_.default.errors}`);function l(m){if(n===!1){e.setParams({unevaluatedProperty:m}),e.error(),s||t.break();return}if(!(0,ch.alwaysValidSchema)(i,n)){const v=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:ch.Type.Str},v),s||t.if((0,Xn.not)(v),()=>t.break())}}function c(m,v){return(0,Xn._)`!${m} || !${m}[${v}]`}function f(m,v){const h=[];for(const y in m)m[y]===!0&&h.push((0,Xn._)`${v} !== ${y}`);return(0,Xn.and)(...h)}}};Jp.default=K_;var Qp={};Object.defineProperty(Qp,"__esModule",{value:!0});const Ro=ue,dh=Q,G_={message:({params:{len:e}})=>(0,Ro.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ro._)`{limit: ${e}}`},J_={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:G_,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,dh.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:dh.Type.Num},l),r.allErrors||t.if((0,Ro.not)(l),()=>t.break())})}}};Qp.default=J_;Object.defineProperty(Gp,"__esModule",{value:!0});const Q_=Jp,Y_=Qp,X_=[Q_.default,Y_.default];Gp.default=X_;var Yp={},Xp={};Object.defineProperty(Xp,"__esModule",{value:!0});const We=ue,Z_={message:({schemaCode:e})=>(0,We.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,We._)`{format: ${e}}`},ej={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Z_,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?v():h();function v(){const y=n.scopeValue("formats",{ref:m.formats,code:l.code.formats}),b=n.const("fDef",(0,We._)`${y}[${s}]`),g=n.let("fType"),p=n.let("format");n.if((0,We._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>n.assign(g,(0,We._)`${b}.type || "string"`).assign(p,(0,We._)`${b}.validate`),()=>n.assign(g,(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 && ${g} === ${t} && !${T}`}}function h(){const y=m.formats[i];if(!y){u();return}if(y===!0)return;const[b,g,p]=x(y);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 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 y=="object"&&!(y instanceof RegExp)&&y.async){if(!f.$async)throw new Error("async format in sync schema");return(0,We._)`await ${p}(${o})`}return typeof g=="function"?(0,We._)`${p}(${o})`:(0,We._)`${p}.test(${o})`}}}};Xp.default=ej;Object.defineProperty(Yp,"__esModule",{value:!0});const tj=Xp,nj=[tj.default];Yp.default=nj;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(fp,"__esModule",{value:!0});const oj=mp,rj=yp,ij=Np,sj=zp,aj=Hp,lj=Gp,cj=Yp,uh=Kr,dj=[sj.default,oj.default,rj.default,(0,ij.default)(!0),cj.default,uh.metadataVocabulary,uh.contentVocabulary,aj.default,lj.default];fp.default=dj;var Zp={},Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});Ml.DiscrError=void 0;var ph;(function(e){e.Tag="tag",e.Mapping="mapping"})(ph||(Ml.DiscrError=ph={}));Object.defineProperty(Zp,"__esModule",{value:!0});const dr=ue,Dd=Ml,fh=xt,uj=Yr,pj=Q,fj={message:({params:{discrError:e,tagName:t}})=>e===Dd.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}}`},mj={keyword:"discriminator",type:"object",schemaType:"object",error:fj,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:Dd.DiscrError.Tag,tag:c,tagName:a})),e.ok(l);function f(){const h=v();t.if(!1);for(const y in h)t.elseIf((0,dr._)`${c} === ${y}`),t.assign(l,m(h[y]));t.else(),e.error(!1,{discrError:Dd.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function m(h){const y=t.name("valid"),b=e.subschema({keyword:"oneOf",schemaProp:h},y);return e.mergeEvaluated(b,dr.Name),y}function v(){var h;const y={},b=p(r);let g=!0;for(let S=0;S<s.length;S++){let T=s[S];if(T!=null&&T.$ref&&!(0,pj.schemaHasRulesButRef)(T,i.self.RULES)){const $=T.$ref;if(T=fh.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,$),T instanceof fh.SchemaEnv&&(T=T.schema),T===void 0)throw new uj.default(i.opts.uriResolver,i.baseId,$)}const C=(h=T==null?void 0:T.properties)===null||h===void 0?void 0:h[a];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(b||p(T)),u(C,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return y;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 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 y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[S]=T}}}};Zp.default=mj;var ef={};const hj="https://json-schema.org/draft/2020-12/schema",yj="https://json-schema.org/draft/2020-12/schema",gj={"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},vj="meta",bj="Core and Validation specifications meta-schema",xj=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],wj=["object","boolean"],Sj="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",$j={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}},kj={$schema:hj,$id:yj,$vocabulary:gj,$dynamicAnchor:vj,title:bj,allOf:xj,type:wj,$comment:Sj,properties:$j},Tj="https://json-schema.org/draft/2020-12/schema",_j="https://json-schema.org/draft/2020-12/meta/applicator",jj={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Nj="meta",Cj="Applicator vocabulary meta-schema",Ej=["object","boolean"],Pj={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"}},Ij={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Oj={$schema:Tj,$id:_j,$vocabulary:jj,$dynamicAnchor:Nj,title:Cj,type:Ej,properties:Pj,$defs:Ij},Rj="https://json-schema.org/draft/2020-12/schema",Aj="https://json-schema.org/draft/2020-12/meta/unevaluated",Mj={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},qj="meta",Uj="Unevaluated applicator vocabulary meta-schema",Lj=["object","boolean"],Dj={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},zj={$schema:Rj,$id:Aj,$vocabulary:Mj,$dynamicAnchor:qj,title:Uj,type:Lj,properties:Dj},Fj="https://json-schema.org/draft/2020-12/schema",Bj="https://json-schema.org/draft/2020-12/meta/content",Hj={"https://json-schema.org/draft/2020-12/vocab/content":!0},Vj="meta",Wj="Content vocabulary meta-schema",Kj=["object","boolean"],Gj={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Jj={$schema:Fj,$id:Bj,$vocabulary:Hj,$dynamicAnchor:Vj,title:Wj,type:Kj,properties:Gj},Qj="https://json-schema.org/draft/2020-12/schema",Yj="https://json-schema.org/draft/2020-12/meta/core",Xj={"https://json-schema.org/draft/2020-12/vocab/core":!0},Zj="meta",eN="Core vocabulary meta-schema",tN=["object","boolean"],nN={$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"}}},oN={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},rN={$schema:Qj,$id:Yj,$vocabulary:Xj,$dynamicAnchor:Zj,title:eN,type:tN,properties:nN,$defs:oN},iN="https://json-schema.org/draft/2020-12/schema",sN="https://json-schema.org/draft/2020-12/meta/format-annotation",aN={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},lN="meta",cN="Format vocabulary meta-schema for annotation results",dN=["object","boolean"],uN={format:{type:"string"}},pN={$schema:iN,$id:sN,$vocabulary:aN,$dynamicAnchor:lN,title:cN,type:dN,properties:uN},fN="https://json-schema.org/draft/2020-12/schema",mN="https://json-schema.org/draft/2020-12/meta/meta-data",hN={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},yN="meta",gN="Meta-data vocabulary meta-schema",vN=["object","boolean"],bN={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}},xN={$schema:fN,$id:mN,$vocabulary:hN,$dynamicAnchor:yN,title:gN,type:vN,properties:bN},wN="https://json-schema.org/draft/2020-12/schema",SN="https://json-schema.org/draft/2020-12/meta/validation",$N={"https://json-schema.org/draft/2020-12/vocab/validation":!0},kN="meta",TN="Validation vocabulary meta-schema",_N=["object","boolean"],jN={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"}}},NN={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:[]}},CN={$schema:wN,$id:SN,$vocabulary:$N,$dynamicAnchor:kN,title:TN,type:_N,properties:jN,$defs:NN};Object.defineProperty(ef,"__esModule",{value:!0});const EN=kj,PN=Oj,IN=zj,ON=Jj,RN=rN,AN=pN,MN=xN,qN=CN,UN=["/properties"];function LN(e){return[EN,PN,IN,ON,RN,t(this,AN),MN,t(this,qN)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,o){return e?n.$dataMetaSchema(o,UN):o}}ef.default=LN;(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=Rv,o=fp,r=Zp,i=ef,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:y}=this.opts;y&&(i.default.call(this,h),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}})})(Od,Od.exports);var DN=Od.exports;const zN=Yd(DN),mh=zN,FN=mh.default??mh,hh="acp";function BN(e){const t={path:e.instancePath||"/",message:e.message??"validation failed"};return e.keyword&&(t.keyword=e.keyword),t}function HN(e){const t=new FN({strict:!1,allErrors:!0,validateFormats:!1});t.addSchema(e,hh);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:`${hh}#/$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 v,h;const y=l.payload;if(l.kind==="request")v=m.requestDef,h=y.params;else if(l.kind==="notification")v=m.notificationDef,h=y.params;else if(l.kind==="response")v=m.responseDef,h=y.result;else return{valid:!0,errors:[],skipped:"wrong-kind"};if(!v)return{valid:!0,errors:[],skipped:"no-schema-for-kind"};const b=i(v);return b(h)?{valid:!0,errors:[],schemaName:v}:{valid:!1,errors:(b.errors??[]).map(BN),schemaName:v}}function a(){return[...n.keys()].sort()}return{validateAcpMessage:s,knownAcpMethods:a}}const VN=HN(Ov),WN=VN.validateAcpMessage;function tf(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,WN(r,a))}return o}function KN(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 GN={"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 JN(e){const t=e.trim();if(t.length===0)return null;for(const n of Object.values(GN)){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=JN(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 nf(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 QN={};function YN(){const e=QN;return(e==null?void 0:e.VITE_PLAYGROUND)==="1"}const XN={"editor-to-agent":"out","agent-to-editor":"in"},ZN={out:"editor-to-agent",in:"agent-to-editor"},eC={request:"req",response:"rsp",notification:"ntf",error:"err",unknown:"unk"},tC={req:"request",rsp:"response",ntf:"notification",err:"error",unk:"unknown"},nC=["tree","raw","meta"];function yh(e){const t=new URLSearchParams(e),n={},o=t.get("dir");if(o!==null){const y=o.split(",").map(b=>b.trim()).filter(Boolean).map(b=>ZN[b]).filter(b=>b!==void 0);y.length>0&&(n.directions=new Set(y))}const r=t.get("kind");if(r!==null){const y=r.split(",").map(b=>b.trim()).filter(Boolean).map(b=>tC[b]).filter(b=>b!==void 0);y.length>0&&(n.kinds=new Set(y))}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&&nC.includes(l)?l:null,f=t.get("play"),m=f!==null&&/^\d+$/.test(f)?Number(f):null,v=t.get("ws");return{filters:n,selectedSeq:a,detailTab:c,playhead:m,captureUrl:v}}const oC=["ws","dir","kind","streams","q","seq","tab","play"];function rC(e){const t=new URLSearchParams(window.location.search);for(const r of oC)t.delete(r);e.captureUrl&&t.set("ws",e.captureUrl),e.filters.directions.size<ls.length&&t.set("dir",[...e.filters.directions].map(r=>XN[r]).filter(Boolean).join(",")),e.filters.kinds.size<cs.length&&t.set("kind",[...e.filters.kinds].map(r=>eC[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.playhead!==null&&t.set("play",String(e.playhead));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 qb(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=qb(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function iC(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=qb(e))&&(o&&(o+=" "),o+=t);return o}const of="-",sC=e=>{const t=lC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(of);return a[0]===""&&a.length!==1&&a.shift(),Ub(a,t)||aC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&o[s]?[...l,...o[s]]:l}}},Ub=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Ub(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(of);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},gh=/^\[(.+)\]$/,aC=e=>{if(gh.test(e)){const t=gh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},lC=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return dC(Object.entries(e.classGroups),n).forEach(([i,s])=>{zd(s,o,i,t)}),o},zd=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:vh(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(cC(r)){zd(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{zd(s,vh(t,i),n,o)})})},vh=(e,t)=>{let n=e;return t.split(of).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},cC=e=>e.isThemeGetter,dC=(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,uC=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)}}},Lb="!",pC=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 g=0;g<a.length;g++){let p=a[g];if(c===0){if(p===r&&(o||a.slice(g,g+i)===t)){l.push(a.slice(f,g)),f=g+i;continue}if(p==="/"){m=g;continue}}p==="["?c++:p==="]"&&c--}const v=l.length===0?a:a.substring(f),h=v.startsWith(Lb),y=h?v.substring(1):v,b=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},fC=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},mC=e=>({cache:uC(e.cacheSize),parseClassName:pC(e),...sC(e)}),hC=/\s+/,yC=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(hC);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:f,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:h}=n(c);let y=!!h,b=o(y?v.substring(0,h):v);if(!b){if(!y){a=c+(a.length>0?" "+a:a);continue}if(b=o(v),!b){a=c+(a.length>0?" "+a:a);continue}y=!1}const g=fC(f).join(":"),p=m?g+Lb:g,u=p+b;if(i.includes(u))continue;i.push(u);const x=r(b,y);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 gC(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Db(t))&&(o&&(o+=" "),o+=n);return o}const Db=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Db(e[o]))&&(n&&(n+=" "),n+=t);return n};function vC(e,...t){let n,o,r,i=s;function s(l){const c=t.reduce((f,m)=>m(f),e());return n=mC(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=yC(l,n);return r(l,f),f}return function(){return i(gC.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},zb=/^\[(?:([a-z-]+):)?(.+)\]$/i,bC=/^\d+\/\d+$/,xC=new Set(["px","full","screen"]),wC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,SC=/\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$/,$C=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,TC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jn=e=>Rr(e)||xC.has(e)||bC.test(e),Jn=e=>ni(e,"length",OC),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=>zb.test(e),Qn=e=>wC.test(e),jC=new Set(["length","size","percentage"]),NC=e=>ni(e,jC,Fb),CC=e=>ni(e,"position",Fb),EC=new Set(["image","url"]),PC=e=>ni(e,EC,AC),IC=e=>ni(e,"",RC),vi=()=>!0,ni=(e,t,n)=>{const o=zb.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},OC=e=>SC.test(e)&&!$C.test(e),Fb=()=>!1,RC=e=>kC.test(e),AC=e=>TC.test(e),MC=()=>{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"),v=Ie("gap"),h=Ie("gradientColorStops"),y=Ie("gradientColorStopPositions"),b=Ie("inset"),g=Ie("margin"),p=Ie("opacity"),u=Ie("padding"),x=Ie("saturate"),S=Ie("scale"),T=Ie("sepia"),C=Ie("skew"),$=Ie("space"),j=Ie("translate"),A=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",pe,t],z=()=>[pe,t],U=()=>["",jn,Jn],L=()=>["auto",Rr,pe],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",pe],O=()=>["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:z(),borderWidth:U(),contrast:_(),grayscale:J(),hueRotate:_(),invert:J(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[_C,Jn],inset:q(),margin:q(),opacity:_(),padding:z(),saturate:_(),scale:_(),sepia:J(),skew:_(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[Qn]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...F(),pe]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],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:q()}],"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:J()}],shrink:[{shrink:J()}],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":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[vi]}],"row-start-end":[{row:["auto",{span:[gi,pe]},pe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"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:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"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:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"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":[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:[...G(),"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:z()}],"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:[...F(),CC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",NC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},PC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[...G(),"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:G()}],"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:["",...G()]}],"outline-offset":[{"outline-offset":[jn,pe]}],"outline-w":[{outline:[jn,Jn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[jn,Jn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qn,IC]}],"shadow-color":[{shadow:[vi]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],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":[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:_()}],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":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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"]}}},qC=vC(MC);function K(...e){return qC(iC(e))}const $a=1;function UC(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 LC(e,t=4){return JSON.stringify(e,null,t)+`
|
|
1766
|
-
`}class Ke extends Error{constructor(t){super(t),this.name="ExportParseError"}}function DC(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)=>zC(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 zC(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 Bb="<REDACTED>",FC=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 BC(e){if(e.payload==null)return{redacted:e,count:0};const{value:t,count:n}=Fd(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 Fd(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=Fd(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"&&FC.has(r.toLowerCase())){o[r]=Bb,n+=1;continue}if(t.inProxyConfig&&r==="headers"&&i!==null&&typeof i=="object"&&!Array.isArray(i)){const l=HC(i);o[r]=l.value,n+=l.count;continue}const s=t.inProxyConfig||r.toLowerCase()==="proxyconfig"?{inProxyConfig:!0}:t,a=Fd(i,s);o[r]=a.value,n+=a.count}return{value:o,count:n}}return{value:e,count:0}}function HC(e){let t=0;const n={};for(const[o,r]of Object.entries(e))typeof r=="string"?(n[o]=Bb,t+=1):n[o]=r;return{value:n,count:t}}function VC(e){let t=0,n=0;const o=e.messages.map(r=>{const i=BC(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 WC={name:"acp-devtools-ui",version:"0.4.0"};function KC(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 GC(e,t,n=Date.now()){const o=UC(e,t,{tool:WC,exportedAt:n}),{export:r}=VC(o);return LC(r)}function Hb(e,t,n=Date.now()){const o=GC(e,t,n),r=new Blob([o],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=KC(e,n),s.rel="noopener",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function JC({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(()=>QC(),[t,e]),l=I.useMemo(()=>YC(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,v=l[f-1],h=!v||v.section!==c.section;return d.jsxs("li",{children:[h&&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 QC(e){const t=ne.getState(),n=at.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 jv(i);await Xu(),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:()=>Hb(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: ${nf(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 YC(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 XC={idle:"idle",connecting:"connecting",open:"restoring view",closed:"disconnected",error:"connection error"};function ZC({status:e,url:t,lastError:n}){const o=XC[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 eE(e){const t=e.$defs??{},n=new Map;for(const[y,b]of Object.entries(t)){const g=b["x-method"];if(typeof g!="string")continue;let p=n.get(g);p||(p={},n.set(g,p)),y.endsWith("Request")?p.requestDef=y:y.endsWith("Response")?p.responseDef=y:y.endsWith("Notification")&&(p.notificationDef=y)}function o(y,b){var g,p,u;switch(y.kind){case"request":{const x=y.method;return x?((g=n.get(x))==null?void 0:g.requestDef)??null:null}case"notification":{const x=y.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(y){return y==="request"||y==="notification"?"params":y==="response"?"result":y==="error"?"error":null}function i(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function s(y,b){const g=y.properties;if(!g)return!0;for(const[p,u]of Object.entries(g))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(y,b){const g=y.type;if(typeof g=="string"){if(g==="null")return b===null;if(g==="string")return typeof b=="string";if(g==="boolean")return typeof b=="boolean";if(g==="number"||g==="integer")return typeof b=="number";if(g==="array")return Array.isArray(b);if(g==="object")return i(b)&&s(y,b)}return y.$ref||y.properties||y.allOf?i(b)&&s(y,b):!1}function l(y,b=void 0){if(!y)return null;if(y.$ref){const g=y.$ref.replace(/^#\/\$defs\//,""),p=t[g];return p?l(p,b):null}if(y.allOf&&y.allOf.length>0){const g={properties:{}};for(const p of y.allOf){const u=l(p,b);u!=null&&u.properties&&(g.properties={...g.properties,...u.properties}),u!=null&&u.type&&!g.type&&(g.type=u.type),u!=null&&u.items&&!g.items&&(g.items=u.items)}return y.description&&!g.description&&(g.description=y.description),g}if(y.anyOf||y.oneOf){const g=y.anyOf??y.oneOf;if(b!==void 0){for(const p of g)if(p.type!=="null"&&a(p,b))return l(p,b)}for(const p of g){if(p.type==="null")continue;const u=l(p,b);if(u)return u}return null}return y}function c(y,b){let g=y;for(const p of b){if(g==null)return;if(Array.isArray(g)&&/^\d+$/.test(p))g=g[Number(p)];else if(typeof g=="object")g=g[p];else return}return g}function f(y){if(!y)return;if(y.$ref)return y.$ref.replace(/^#\/\$defs\//,"");const b=y.type;if(typeof b=="string")return b;if(Array.isArray(b))return b.find(p=>p!=="null")}function m(y,b){const g=t[y];return{typeName:y,typeDescription:(g==null?void 0:g.description)??null,resolve(p){var A;if(p.length===0)return{inSpec:!0,isExtension:!1,description:g==null?void 0:g.description,type:y};const u=p.slice(1);if(u.length===0)return null;let x=!1,S=g??null;for(let E=0;E<u.length;E++){const q=u[E];q==="_meta"&&(x=!0);const z=/^\d+$/.test(q),U=c(b,p.slice(0,E+1));if(S=l(S,U),!S)return null;if(z){const F=c(b,p.slice(0,E+2));S=l(S.items,F);continue}if(x&&q!=="_meta")return{inSpec:!1,isExtension:!0};const L=(A=S.properties)==null?void 0:A[q];if(!L)return{inSpec:!1,isExtension:x};S=L}const T=c(b,p),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 v(y,b={}){const g=o(y,b.pairedMethod);return!g||!r(y.kind)?null:m(g,y.payload)}function h(){return[...n.keys()].sort()}return{resolveForMessage:v,knownMethods:h}}const tE=eE(Ov),nE=tE.resolveForMessage,oE={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=I.useRef(null),a=I.useRef(null),[l,c]=I.useState(null),f=l!==null,m=()=>{const y=s.current;if(!y)return null;const b=y.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}},v=()=>{a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>{const y=m();y&&c(y)},n)},h=()=>{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 y=()=>h();return window.addEventListener("scroll",y,!0),()=>window.removeEventListener("scroll",y,!0)},[f]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:s,className:K("cursor-help",r),onMouseEnter:v,onMouseLeave:h,...i?{onFocus:v,onBlur:h,tabIndex:0}:{},children:t}),l&&Wu.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",oE[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 rE=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function Ta(e){return rE.format(e)}function fs(e){const t=e%1e3;return`${Ta(e)}.${String(t).padStart(3,"0")}`}const iE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function sE(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(sE(n,o))return Ta(e);if(n.getFullYear()===o.getFullYear())return`${iE[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 aE(e){return e<250?"ok":e<1500?"warn":"error"}function Vb(e){return e==="editor-to-agent"?"OUT":"IN"}function Wb(e){return e==="editor-to-agent"?"→":"←"}const lE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function cE(e){const t=String(e);return lE.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 bh(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 dE=6;function xh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function uE(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 pE(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=xh(e)||Array.isArray(e),a=xh(e)?Object.keys(e).length:Array.isArray(e)?e.length:0,l=o??(n<2&&a<=dE),[c,f]=I.useState(l),m=t!==void 0&&i?i(r):null,v=t!==void 0?d.jsx(fE,{name:t,spec:m}):null;if(!s)return d.jsxs("div",{className:"flex items-baseline gap-2 font-mono text-xs leading-relaxed",children:[v,d.jsx("span",{className:K("whitespace-pre-wrap break-all",uE(e)),children:pE(e)})]});const h=Array.isArray(e),y=h?"[":"{",b=h?"]":"}";return d.jsxs("div",{className:"font-mono text-xs leading-relaxed",children:[d.jsxs("button",{type:"button",onClick:()=>f(g=>!g),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:"▸"}),v,d.jsx("span",{className:"text-ink-secondary",children:y}),!c&&d.jsxs("span",{className:"text-ink-muted",children:[a," ",h?"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:[h?e.map((g,p)=>d.jsx(al,{value:g,name:String(p),depth:n+1,path:[...r,String(p)],...i?{getSpec:i}:{}},p)):Object.entries(e).map(([g,p])=>d.jsx(al,{value:p,name:g,depth:n+1,path:[...r,g],...i?{getSpec:i}:{}},g)),d.jsx("div",{className:"text-ink-secondary",children:b})]})]})}function fE({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(wh,{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(wh,{tone:"extension",explanation:"Extension — _meta payload is implementation-defined per ACP spec."}),o&&d.jsx(ps,{label:d.jsx(mE,{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 mE({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 wh({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 hE({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 nE(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:[Wb(e.direction)," ",Vb(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(xE,{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(gE,{message:e,resolver:a}),i==="raw"&&d.jsx(vE,{raw:e.raw}),i==="meta"&&d.jsx(bE,{message:e}),i==="spec"&&d.jsx(yE,{validation:r})]})]})}function yE({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 gE({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(al,{value:e.payload,defaultExpanded:!0,...n?{getSpec:n}:{}})}function vE({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: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 bE({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 xE({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 rf(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 Bd(e){const t=rf(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?Sh(s.latencies,50):null,p99:s.latencies.length?Sh(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 Sh(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 Kb=100;function wE(e,t,n={}){const o=n.maxChangesPerRow??Kb,r=$h(e),i=$h(t),s=SE(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],v=$E(f,m,o),h=v.length===0?"equal":"changed";a.push({op:h,a:f,b:m,signature:r[c.i],changes:v}),h==="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 $h(e){const t=rf(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 SE(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 v=i[(c+1)*r+f],h=i[c*r+(f+1)];i[m]=v>=h?v:h}}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 kh(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 $E(e,t,n){const o=[];return ll(kh(e),kh(t),"",o,n),o}function kE(e,t,n=Kb){const o=[];return ll(e,t,"",o,n),o}function Th(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=Th(e),s=Th(t);if(i!==s||i==="leaf"){if(TE(e,t))return;o.push({path:n||"$",kind:"change",a:e,b:t});return}if(i==="array"){const f=e,m=t,v=Math.max(f.length,m.length);for(let h=0;h<v;h++){if(o.length>=r)return;const y=`${n}[${h}]`,b=h<f.length,g=h<m.length;b&&g?ll(f[h],m[h],y,o,r):g?o.push({path:y,kind:"add",b:m[h]}):o.push({path:y,kind:"remove",a:f[h]})}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,v=f in a,h=f in l;v&&h?ll(a[f],l[f],m,o,r):h?o.push({path:m,kind:"add",b:l[f]}):o.push({path:m,kind:"remove",a:a[f]})}}function TE(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 jE(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 NE(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 CE(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 EE(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 PE(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 IE(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 OE(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 v=[];for(const h of m){const y=xn((a=Ne(h))==null?void 0:a.name);y!==null&&v.push(y)}v.length>0&&(i=v)}}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 RE(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=jE(e,t==null?void 0:t.rpcId);return{protocolVersion:IE(t,n),client:NE(t),agent:EE(n),clientCapabilities:CE(t),agentCapabilities:PE(n),runtime:OE(e),extensions:RE(t)}}function _h(e){return{protocolVersion:e.protocolVersion,client:e.client,agent:e.agent,clientCapabilities:e.clientCapabilities,agentCapabilities:e.agentCapabilities,runtime:e.runtime}}function AE(e,t){const n=cl(e),o=cl(t);return{a:n,b:o,changes:kE(_h(n),_h(o))}}function ME(e,t){const n=Bd(e),o=Bd(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 sf(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 af="flex h-9 items-center gap-4 border-b border-line bg-surface-base px-5",qE={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"UNK"};function UE(e){return e.direction==="editor-to-agent"?"→A":"A←"}function Gb(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 jh={messages:null,loading:!1,error:null};function Nh(e){const[t,n]=I.useState(jh);return I.useEffect(()=>{if(e===null){n(jh);return}let o=!1;return n({messages:null,loading:!0,error:null}),kS(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 LE({open:e,onClose:t}){const n=ne(F=>F.messages),o=ne(F=>F.session),r=at(F=>F.savedSessions),i=(o==null?void 0:o.id)??null,[s,a]=I.useState(null),[l,c]=I.useState(null),[f,m]=I.useState("frames"),[v,h]=I.useState(!0),[y,b]=I.useState(null),{rendered:g,visible:p}=sf(e);I.useEffect(()=>{if(!e)return;const F=G=>{G.key==="Escape"&&(G.preventDefault(),t())};return window.addEventListener("keydown",F,!0),()=>window.removeEventListener("keydown",F,!0)},[e,t]),I.useEffect(()=>{e&&(a(i),c(null),b(null))},[e,i]),I.useEffect(()=>b(null),[s,l]);const u=Nh(s!==null&&s!==i?s:null),x=Nh(l!==null&&l!==i?l:null),S=s===null?null:s===i?n:u.messages,T=l===null?null:l===i?n:x.messages,C=u.loading||x.loading,$=u.error??x.error,j=I.useMemo(()=>S===null||T===null?null:wE(S,T),[S,T]),A=I.useMemo(()=>{if(!j)return[];const F=[];return j.rows.forEach((G,Y)=>{v&&G.op==="equal"||F.push({row:G,index:Y})}),F},[j,v]),E=I.useMemo(()=>{const F=r.find(G=>G.id===l);return F?Gb(F):null},[r,l]),q=I.useMemo(()=>S&&T?AE(S,T):null,[S,T]),z=I.useMemo(()=>S&&T?ME(S,T):null,[S,T]);if(!g)return null;const U=r.filter(F=>F.id!==l),L=r.filter(F=>F.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",p?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:K("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(Ih,{ariaLabel:"Baseline session",sessions:U,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(Ih,{ariaLabel:"Comparison session",sessions:L,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||!q||!z?d.jsx(bi,{children:"No data."}):d.jsxs(d.Fragment,{children:[d.jsx(DE,{tab:f,onTab:m,summary:j.summary,infoCount:q.changes.length}),d.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[f==="frames"&&d.jsx(zE,{diff:j,bLabel:E,hideEqual:v,onHideEqual:h,visibleRows:A,expanded:y,onToggleExpand:F=>b(G=>G===F?null:F)}),f==="info"&&d.jsx(FE,{meta:q}),f==="perf"&&d.jsx(HE,{perf:z})]})]})]})})}function DE({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 zE({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(af,"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(KE,{row:l,expanded:i===c,onToggle:()=>s(c)},c))})]})]})}function Jb(){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 FE({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:af,children:d.jsx(Jb,{})}),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(Qb,{change:t})},n))})]})}function Ch(e){return e==null?"—":Vt(e)}function BE(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 HE({perf:e}){return e.length===0?d.jsx(ms,{children:"No methods to compare."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K(af,"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=BE(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:Ch(((o=t.a)==null?void 0:o.p99)??null)}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:Ch(((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 VE={equal:"",changed:"bg-accent-warn/5",added:"bg-accent-ok/5",removed:"bg-accent-error/5"},WE={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 KE({row:e,expanded:t,onToggle:n}){const o=WE[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",VE[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(Eh,{frame:e.a,muted:e.op==="added"})}),d.jsxs("td",{className:"px-3 py-1.5",children:[d.jsx(Eh,{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(Jb,{})}),d.jsx("ul",{className:"space-y-1",children:e.changes.map((i,s)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Qb,{change:i})},s))})]})]})]})}function Eh({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:UE(e)}),d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:qE[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 Ph=80;function oa(e){let t;try{t=JSON.stringify(e)}catch{t=String(e)}return t===void 0&&(t="undefined"),t.length>Ph&&(t=t.slice(0,Ph-1)+"…"),t}function Qb({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 Ih({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=v=>{s.current&&!s.current.contains(v.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?Gb(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(Oh,{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(Rh,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))}),l.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs(Oh,{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(Rh,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))})]})]})]})}function Oh({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 Rh({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 GE(){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 JE=[{id:"zed",label:"Zed"},{id:"jetbrains",label:"JetBrains"}],QE="/absolute/path/to/acp-devtools";function YE(e){return JSON.stringify({agent_servers:{"Claude Code (via ACP Devtools)":{type:"custom",command:e}}},null,4)}function Yb({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: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 XE(){const[e,t]=I.useState("zed"),[n,o]=I.useState(null);I.useEffect(()=>{let a=!0;return GE().then(l=>{a&&o(l.binaryPath)}).catch(()=>{}),()=>{a=!1}},[]);const r=n??QE,i=n===null,s=I.useMemo(()=>({zed:YE(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:JE.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(Yb,{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(Ah,{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(Mh,{label:"Name",value:s.jetbrainsName}),d.jsx(Mh,{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(Ah,{isPlaceholder:i})]})]})}function Ah({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 Mh({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(Yb,{text:t})]})}function ZE({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.4.0 / 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(XE,{})}),d.jsxs("div",{className:"mt-4 flex items-center gap-3 font-mono text-[11px]",children:[d.jsx(eP,{status:e}),d.jsx("span",{className:"text-ink-secondary",children:n}),t&&d.jsx("span",{className:"text-accent-error",children:t})]})]})})}function eP({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 tP(){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(rP,{dir:i,active:e.directions.has(i),onClick:()=>t(i)},i))}),d.jsx(aP,{}),d.jsxs("div",{className:"flex items-center gap-1",children:[cs.map(i=>d.jsx(iP,{kind:i,active:e.kinds.has(i),onClick:()=>n(i)},i)),d.jsx(sP,{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 nP={"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)"},oP={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 rP({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:nP[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 iP({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:oP[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 sP({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 aP(){return d.jsx("span",{"aria-hidden":!0,className:"h-5 w-px bg-line"})}const lP={minSamplesForTail:3,longTailRatio:5,minBusiestCount:50,minBusiestRatio:2.5,minHotspotShare:.4,minSamplesForOutlier:5,outlierRatio:3};function cP(e,t,n={}){const o={...lP,...n},r=[],i=t.reduce((h,y)=>h+(y.totalLatencyMs??0),0);if(i>0){const y=t.filter(b=>b.totalLatencyMs!==null&&b.totalLatencyMs>0).sort((b,g)=>(g.totalLatencyMs??0)-(b.totalLatencyMs??0))[0];if(y&&y.totalLatencyMs!==null){const b=y.totalLatencyMs/i;b>=o.minHotspotShare&&r.push({kind:"hotspot",summary:`${y.method} consumed ${ar(y.totalLatencyMs)} of total wall time`,detail:`${Math.round(b*100)}% of ${ar(i)} sampled latency`,methods:[y.method]})}}const a=t.filter(h=>h.sampleSize>=o.minSamplesForTail&&h.p50!==null&&h.p99!==null&&h.p50>0&&h.p99/h.p50>=o.longTailRatio).sort((h,y)=>(y.p99??0)/(y.p50??1)-(h.p99??0)/(h.p50??1))[0];if(a&&a.p99!==null&&a.p50!==null){const h=Math.round(a.p99/a.p50);r.push({kind:"long-tail",summary:`${a.method} has a long tail — p99 is ${h}× the p50`,detail:`p50 ${ar(a.p50)} · p99 ${ar(a.p99)} · ${a.sampleSize} samples`,methods:[a.method]})}const l=[...t].filter(h=>h.sampleSize>=o.minSamplesForOutlier&&h.p99!==null&&h.max!==null&&h.p99>0&&h.max/h.p99>=o.outlierRatio).sort((h,y)=>(y.max??0)-(h.max??0))[0];if(l&&l.max!==null&&l.p99!==null){const h=Math.round(l.max/l.p99);r.push({kind:"outlier",summary:`${l.method} had one ${ar(l.max)} call — ${h}× its p99`,detail:`p99 ${ar(l.p99)} · ${l.sampleSize} samples`,methods:[l.method]})}const c=[...t].sort((h,y)=>y.count-h.count),f=c[0],m=c[1];if(f&&f.count>=o.minBusiestCount){const h=m&&m.count>0?f.count/m.count:1/0;if(h>=o.minBusiestRatio){const y=f.kind==="notification"?"notifications":"calls";r.push({kind:"busiest",summary:`${f.method} sent ${f.count} ${y}`,detail:m?`${h.toFixed(1)}× the next-busiest method (${m.method} · ${m.count})`:"no other methods to compare against",methods:[f.method]})}}const v=dP(e);if(v.length>0){const h=v.slice(0,3),y=v.length>3?` (+${v.length-3} more)`:"";r.push({kind:"errors",summary:`${v.length} method${v.length===1?"":"s"} returned an error`,detail:h.join(", ")+y,methods:v})}return r}function dP(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 uP(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 pP({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=uP(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 v=Math.max(1,f/i*n);return d.jsx("rect",{x:m*(c+l),y:n-v,width:c,height:v,fill:"currentColor",opacity:.4+f/i*.6},m)})})}function fP(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=rf(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,v=(m==null?void 0:m.kind)==="error",h=m?m.timestamp:l.timestamp;h>i&&(i=h),s.push({seq:l.seq,startTs:l.timestamp,endTs:h,lane:c,method:l.method??null,kind:l.kind,erroredOut:v,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"],mP={"editor-req":"editor → agent","agent-req":"agent → editor",notification:"notifications"},oo=48,lf=6,Ll=24,wn=132,hs=20,Dl=8,hP=20,qh=3e4,Uh=50;function yP(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((u,x)=>u.startTs-x.startTs),a=[];let l=t,c=t;for(const u of s)u.startTs-c>qh&&(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+qh?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),v=o*r,h=Math.max(50,v-f*Uh),y=m>0?h/m:0;let b=0;const g=[];for(const u of a){const x=u.kind==="gap"?Uh:(u.tEnd-u.tStart)*y;g.push({...u,pxStart:b,pxEnd:b+x}),b+=x}return{segments:g,tsToX:u=>{if(u<=g[0].tStart)return wn+g[0].pxStart-i;for(const S of g)if(u>=S.tStart&&u<=S.tEnd){const T=S.tEnd>S.tStart?(u-S.tStart)/(S.tEnd-S.tStart):0,C=S.pxStart+T*(S.pxEnd-S.pxStart);return wn+C-i}const x=g[g.length-1];return wn+x.pxEnd-i},totalActiveMs:m}}function gP({messages:e,onSelectSeq:t,height:n=220,controlsRef:o,onZoomChange:r}){const i=I.useMemo(()=>fP(e),[e]),s=I.useRef(null),a=I.useRef(null),[l,c]=I.useState({width:800,height:n}),[f,m]=I.useState(1),[v,h]=I.useState(0),[y,b]=I.useState(null),[g,p]=I.useState({x:0,y:0}),u=I.useRef(null);I.useEffect(()=>{const U=s.current;if(!U||typeof ResizeObserver>"u")return;const L=new ResizeObserver(F=>{const G=F[0];if(!G)return;const Y=G.contentRect;c({width:Math.max(320,Y.width),height:Math.max(120,Y.height)})});return L.observe(U),()=>L.disconnect()},[]),I.useEffect(()=>{m(1),h(0),b(null)},[i.startTs,i.endTs]);const x=I.useMemo(()=>{const U=Math.max(50,l.width-wn-hs);return yP(i.events,i.startTs,i.endTs,U,f,v)},[i,l.width,f,v]),S=I.useMemo(()=>{if(i.events.length===0)return[];const U=[];for(const L of i.events){const F=x.tsToX(L.startTs),G=x.tsToX(L.endTs),Y=Math.max(2,G-F),D=dl.indexOf(L.lane),J=Dl+Ll+D*(oo+lf)+oo/2-9;U.push({...L,x:F,y:J,width:Y,height:18})}return U},[i,x]);I.useEffect(()=>{const U=a.current;if(!U)return;const L=window.devicePixelRatio||1;U.width=l.width*L,U.height=l.height*L,U.style.width=`${l.width}px`,U.style.height=`${l.height}px`;const F=U.getContext("2d");if(!F)return;F.setTransform(L,0,0,L,0,0);const G=getComputedStyle(document.documentElement),Y=J=>`rgb(${G.getPropertyValue(`--${J}`).trim()})`,D=(J,O)=>`rgba(${G.getPropertyValue(`--${J}`).trim()} / ${O})`;F.clearRect(0,0,l.width,l.height),vP(F,l,Y),xP(F,x,l,Y,D),bP(F,l,x,Y),$P(F,S,y,Y,D)},[S,x,l,y]);const T=(U,L)=>{for(const F of S){const G=Math.max(F.width,6);if(U>=F.x&&U<=F.x+G&&L>=F.y&&L<=F.y+F.height)return F}return null},C=U=>{const L=U.currentTarget.getBoundingClientRect(),F=U.clientX-L.left,G=U.clientY-L.top;if(u.current){const D=F-u.current.startX;h(Math.max(0,u.current.startPan-D));return}const Y=T(F,G);b(Y),p({x:U.clientX,y:U.clientY})},$=U=>{const L=U.currentTarget.getBoundingClientRect(),F=U.clientX-L.left,G=U.clientY-L.top,Y=T(F,G);if(Y&&t){t(Y.seq);return}u.current={startX:F,startPan:v}},j=()=>{u.current=null},A=U=>{if(!U.metaKey&&!U.ctrlKey)return;U.preventDefault();const L=U.deltaY<0?1.15:1/1.15;m(F=>Math.min(50,Math.max(.3,F*L)))},E=()=>m(U=>Math.min(50,U*1.5)),q=()=>m(U=>Math.max(.3,U/1.5)),z=()=>{m(1),h(0)};return I.useEffect(()=>{if(o)return o.current={zoomIn:E,zoomOut:q,reset:z,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:K("block h-full w-full",u.current?"cursor-grabbing":y?"cursor-pointer":"cursor-grab"),onMouseMove:C,onMouseDown:$,onMouseUp:j,onMouseLeave:()=>{b(null),u.current=null},onWheel:A}),y&&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,g.x+12),top:g.y+12,maxWidth:280},children:[d.jsxs("div",{className:"text-ink-primary",children:[d.jsxs("span",{className:"text-ink-muted",children:["seq ",y.seq]})," · ",y.method??y.kind]}),d.jsx("div",{className:"text-ink-muted",children:y.endTs>y.startTs?`${Vt(y.endTs-y.startTs)}${y.erroredOut?" · error":""}`:y.lane==="notification"?"notification":"pending"}),t&&d.jsx("div",{className:"mt-1 text-[10px] text-ink-dim",children:"click to inspect"})]})]})}function vP(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+lf);e.fillStyle=n("surface-elev"),e.fillRect(wn,i,t.width-wn-hs,oo),e.fillStyle=n("ink-muted"),e.fillText(mP[r],hP,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 bP(e,t,n,o){var y;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,g)=>Math.max(b,g.tEnd-g.tStart),0),s=n.segments.reduce((b,g)=>b+(g.kind==="active"?g.pxEnd-g.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 v=m*1e3,h=((y=n.segments[0])==null?void 0:y.tStart)??0;for(const b of n.segments){if(b.kind!=="active")continue;const g=Math.ceil((b.tStart-h)/v)*v+h;for(let p=g;p<=b.tEnd;p+=v){const u=n.tsToX(p);u<wn||u>t.width-hs||(e.beginPath(),e.moveTo(u,r),e.lineTo(u,r+4),e.stroke(),e.fillText(SP(p-h),u,r-2))}}}function xP(e,t,n,o,r){const i=Dl+Ll,s=i+dl.length*(oo+lf);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,v=i+(s-i)/2;e.fillText(wP(a.tEnd-a.tStart),m,v)}}function wP(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 SP(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 $P(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 kP({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(()=>Bd(o),[o]),f=I.useMemo(()=>cP(o,c),[o,c]),m=I.useMemo(()=>c.reduce((S,T)=>Math.max(S,T.count),0),[c]),[v,h]=I.useState("count"),[y,b]=I.useState("desc"),{rendered:g,visible:p}=sf(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(()=>IP(c,v,y),[c,v,y]),x=I.useMemo(()=>PP(c),[c]);return g?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",p?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:K("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=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(NP,{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(cr,{sk:"method",current:v,dir:y,onSort:lr(h,b,y),className:"!pl-5",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx(cr,{sk:"count",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"count"}),d.jsx(cr,{sk:"p50",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"p50"}),d.jsx(cr,{sk:"p99",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"p99"}),d.jsx(cr,{sk:"max",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"max"}),d.jsx(cr,{sk:"total",current:v,dir:y,onSort:lr(h,b,y),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(EP,{kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-primary",children:d.jsx(CP,{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(pP,{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(gP,{messages:o,controlsRef:s,onZoomChange:l,onSelectSeq:S=>{n?n(S):(i(S),t())}})})]})]})]})}):null}const TP={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"},jP={hotspot:"hotspot","long-tail":"long tail",outlier:"outlier",busiest:"busiest",errors:"errors"};function NP({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:TP[t.kind]}),d.jsx("div",{className:"min-w-[68px] font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:jP[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 CP({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 EP({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 PP(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 IP(e,t,n){const o=n==="asc"?1:-1,r=[...e];return r.sort((i,s)=>{const a=Lh(i,t),l=Lh(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 Lh(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 cf=["raw.githubusercontent.com","gist.githubusercontent.com"];function Xb(e){try{return{ok:!0,export:DC(e)}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}}function OP(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:cf.includes(t.host)}async function RP(e){if(!OP(e))return{ok:!1,error:`host not in playground allowlist (${cf.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 Xb(n)}function AP({initialUrl:e=null}){const[t,n]=I.useState(null),[o,r]=I.useState(e!==null),[i,s]=I.useState(!1),[a,l]=I.useState(""),c=I.useRef(null),f=(b,g)=>{b.ok?(ne.getState().loadFromExport(b.export),n(null)):n(`${g}: ${b.error}`),r(!1)},m=async b=>{r(!0),n(null);try{const g=await b.text();f(Xb(g),b.name)}catch(g){n(`${b.name}: ${g instanceof Error?g.message:String(g)}`),r(!1)}},v=async b=>{r(!0),n(null),f(await RP(b),b)},h=I.useRef(e);if(h.current!==null){const b=h.current;h.current=null,v(b)}const y=b=>{var p;b.preventDefault(),s(!1);const g=(p=b.dataTransfer.files)==null?void 0:p[0];g&&m(g)};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 g;(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),(g=c.current)==null||g.click())},onDragOver:b=>{b.preventDefault(),s(!0)},onDragLeave:()=>s(!1),onDrop:y,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 p;const g=(p=b.target.files)==null?void 0:p[0];g&&m(g),b.target.value=""}})]}),d.jsxs("form",{className:"mt-4 flex items-center gap-2",onSubmit:b=>{b.preventDefault();const g=a.trim();g&&v(g)},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: ",cf.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 MP=[.5,1,2,4,8];function qP(){const e=ne(h=>h.messages),t=ne(h=>h.playback),n=ne(h=>h.setPlayhead),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.playhead,l=a??i,c=a!==null&&a>=s,f=I.useRef(null);if(I.useEffect(()=>{if(!t.playing)return;if(c){o(!1);return}const h=a===null?-1:e.findIndex(u=>u.seq===a),y=e[h+1];if(!y){o(!1);return}const b=h>=0?e[h]:void 0,g=b?y.timestamp-b.timestamp:0,p=Math.max(15,Math.min(1500,g/t.speed));return f.current=setTimeout(()=>{n(y.seq)},p),()=>{f.current&&(clearTimeout(f.current),f.current=null)}},[t.playing,t.speed,a,e,c,n,o]),e.length===0)return null;const m=h=>{n(h),t.playing&&o(!1)},v=()=>{c?(n(null),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:v,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":c?"restart playback":"play",children:t.playing?"❚❚":c?"↺":"▶"}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-secondary",children:[String(a??0).padStart(3,"0")," / ",String(s).padStart(3,"0")]}),d.jsx("input",{type:"range",min:i,max:s,value:l,onChange:h=>m(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:MP.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))})]})}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 UP({open:e,onClose:t}){const n=ne(a=>a.session),o=ne(a=>a.messages),r=I.useMemo(()=>cl(o),[o]),{rendered:i,visible:s}=sf(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: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(LP,{session:n,meta:r,messages:o}):d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"No session attached."})})]})}):null}function LP({session:e,meta:t,messages:n}){const o=Zb(5e3),{primary:r}=ql(e),i=I.useMemo(()=>zP(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||DP(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 DP(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 zP(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 FP({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 h=s.current.clientWidth,y=n?Number(localStorage.getItem(n)):NaN;n&&Number.isFinite(y)&&y>0&&y<h?l(y):l(Math.round(h*o))},[o,n]);const f=I.useCallback(h=>{h.preventDefault(),c.current=!0,h.currentTarget.setPointerCapture(h.pointerId)},[]),m=I.useCallback(h=>{if(!c.current||!s.current)return;const y=s.current.getBoundingClientRect(),b=h.clientX-y.left,g=y.width,p=Math.min(Math.max(b,r),g-i);l(p),n&&localStorage.setItem(n,String(Math.round(p)))},[r,i,n]),v=I.useCallback(h=>{c.current=!1;try{h.currentTarget.releasePointerCapture(h.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:v,onPointerCancel:v,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 BP(){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 h of e)switch(a.set(h.seq,h.timestamp),s+=h.raw.length,h.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 h of e){if(h.kind!=="response"&&h.kind!=="error")continue;const y=l.get(h.seq);if(y===void 0)continue;const b=a.get(y);b!==void 0&&c.push(h.timestamp-b)}c.sort((h,y)=>h-y);const f=c.length?bh(c,50):null,m=c.length?bh(c,99):null,v=KN(tf(e));return{total:e.length,req:n,res:o,note:r,err:i,bytes:s,p50:f,p99:m,spec:v}},[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(VP,{invalidFrames:t.spec.invalidFrames,totalErrors:t.spec.totalErrors,affectedMethods:t.spec.affectedMethods}),d.jsx(HP,{})]})]})}function HP(){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 VP({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,ex=4;function Dh(e){return()=>e}function WP(e){e()}function tx(e,t){return n=>e(t(n))}function zh(e,t){return()=>e(t)}function KP(e,t){return n=>e(t,n)}function df(e){return e!==void 0}function GP(...e){return()=>{e.map(WP)}}function ri(){}function Fl(e,t){return t(e),e}function JP(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 uf(e){e(oi)}function Le(e){return e(ex)}function oe(e,t){return $e(e,KP(t,zl))}function cn(e,t){const n=e($o,o=>{n(),t(o)});return n}function Fh(e){let t,n;return o=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{o(t)},e)}}function nx(e,t){return e===t}function Me(e=nx){let t;return n=>o=>{e(t,o)||(t=o,n(o))}}function ae(e){return t=>n=>{e(n)&&t(n)}}function Z(e){return t=>tx(t,e)}function yn(e){return t=>()=>{t(e)}}function B(e,...t){const n=QP(...t);return(o,r)=>{switch(o){case oi:uf(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 QP(...e){return t=>e.reduceRight(JP,t)}function YP(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 ex: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:XP(),singleton:n}}const XP=()=>Symbol();function ZP(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:{uf(t);return}case $o:return o===r&&s(n),$e(t,s)}}}function se(e,t=nx){return B(e,Me(t))}function Hd(...e){return function(t,n){switch(t){case oi:return;case $o:return GP(...e.map(o=>$e(o,n)))}}}const nt={DEBUG:0,INFO:1,WARN:2,ERROR:3},eI={[nt.DEBUG]:"debug",[nt.ERROR]:"error",[nt.INFO]:"log",[nt.WARN]:"warn"},tI=()=>typeof globalThis>"u"?window:globalThis,ko=xe(()=>{const e=W(nt.ERROR);return{log:W((t,n,o=nt.INFO)=>{const r=tI().VIRTUOSO_LOG_LEVEL??Le(e);o>=r&&console[eI[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),Vd=new WeakMap;function ox(e){return"self"in e?e.document.documentElement:e}function nI(e){const t=ox(e),n=Vd.get(t);if(n!==void 0)return n;const o=t.ownerDocument.defaultView.getComputedStyle(t).direction==="rtl";return Vd.set(t,o),o}function Bh(e){Vd.delete(ox(e))}function rx(e,t){return nI(e)?-t:t}const Lo=rx;function Hh(e,t){return rx(e,t)}function Zo(e,t,n){return pf(e,t,n).callbackRef}function pf(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 oI(e,t,n,o,r,i,s,a,l){const c=te.useCallback(f=>{const m=rI(f.children,t,a?"offsetWidth":"offsetHeight",r);let v=f.parentElement;for(;v.dataset.virtuosoScroller===void 0;)v=v.parentElement;const h=v.lastElementChild.dataset.viewportType==="window";let y;h&&(y=v.ownerDocument.defaultView);const b=s?a?s.scrollWidth:s.scrollHeight:h?a?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight:a?v.scrollWidth:v.scrollHeight,g=s?a?s.offsetWidth:s.offsetHeight:h?a?y.innerWidth:y.innerHeight:a?v.offsetWidth:v.offsetHeight,p=s?a?Lo(s,s.scrollLeft):s.scrollTop:h?a?Lo(y,y.scrollX||y.document.documentElement.scrollLeft):y.scrollY||y.document.documentElement.scrollTop:a?Lo(v,v.scrollLeft):v.scrollTop;o({scrollHeight:b,scrollTop:Math.max(p,0),viewportHeight:g}),i==null||i(a?Vh("column-gap",getComputedStyle(f).columnGap,r):Vh("row-gap",getComputedStyle(f).rowGap,r)),m!==null&&e(m)},[e,t,r,i,s,o,a]);return pf(c,n,l)}function rI(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 Vh(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 ix(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,v;if(t){const h=t.getBoundingClientRect(),y=c.top-h.top;v=h.height-Math.max(0,y),m=y+t.scrollTop}else{const h=s.current.ownerDocument.defaultView;v=h.innerHeight-Math.max(0,c.top),m=c.top+h.scrollY}o.current={listHeight:c.height,offsetTop:m,visibleHeight:v,visibleWidth:f},e(o.current)},[e,t]),{callbackRef:i,ref:s}=pf(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(),v=ve(),h=W(!1),y=W(!1),b=W(!1);return oe(B(e,Z(({scrollTop:g})=>g)),t),oe(B(e,Z(({scrollHeight:g})=>g)),s),oe(t,r),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:f,headerHeight:a,horizontalDirection:y,scrollBy:v,scrollContainerState:e,scrollHeight:s,scrollingInProgress:h,scrollTo:m,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:i}},[],{singleton:!0}),ys={lvl:0};function sx(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)?cx(t,n,1):t===e.k?Ze(e,{k:t,v:n}):t<e.k?Wh(Ze(e,{l:It(e.l,t,n)})):Wh(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 iI(Kd(e,o,n))}function Wd(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]=lx(o);return Na(Ze(e,{k:i,l:ax(o),v:s}))}return t<n?Na(Ze(e,{l:Wd(o,t)})):Na(Ze(e,{r:Wd(r,t)}))}function Do(e){return Te(e)?[]:[...Do(e.l),{k:e.k,v:e.v},...Do(e.r)]}function Kd(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(Kd(r,t,n))),o>=t&&o<=n&&a.push({k:o,v:s}),o<=n&&(a=a.concat(Kd(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 dx(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 Gd(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:Gd(Ze(o,{l:r.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Ze(e,t){return cx(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 ax(e){return Te(e.r)?e.l:Na(Ze(e,{r:ax(e.r)}))}function _c(e){return Te(e)||e.lvl>e.r.lvl}function lx(e){return Te(e.r)?[e.k,e.v]:lx(e.r)}function cx(e,t,n,o=ys,r=ys){return{k:e,l:o,lvl:n,r,v:t}}function Wh(e){return Gd(dx(e))}function dx(e){const{l:t}=e;return!Te(t)&&t.lvl===e.lvl?Ze(t,{r:Ze(e,{l:t.r})}):e}function Gd(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 iI(e){return sx(e,({k:t,v:n})=>({index:t,value:n}))}function ux(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 ff=xe(()=>({recalcInProgress:W(!1)}),[],{singleton:!0});function px(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 sI(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 mf({index:e},t){return t===e?0:t<e?-1:1}function aI(){return{groupIndices:[],groupOffsetTree:Mr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Mr()}}function lI(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(hI(o)))continue;let l=!1,c=!1;for(const{end:f,start:m,value:v}of a)l?(r>=m||i===v)&&(e=Wd(e,m)):(c=v!==i,l=!0),f>r&&r>=m&&v!==i&&(e=It(e,r+1,v));c&&(e=It(e,s,i))}return[e,n]}function cI(e){return typeof e.groupIndex<"u"}function dI({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}=px(t,e,mf),s=e-o,a=i*s+(s-1)*n+r;return a>0?a+n:a}function fx(e,t){if(!Bl(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function mx(e,t,n){if(cI(e))return t.groupIndices[e.groupIndex]+1;const o=e.index==="LAST"?n:e.index;let r=fx(o,t);return r=Math.max(0,r,Math.min(n,r)),r}function uI(e,t,n,o=0){return o>0&&(t=Math.max(t,px(e,o,mf).offset)),sx(sI(e,t,n,dI),mI)}function pI(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 v=t[0].size,h=t[1].size;s=n.reduce((y,b)=>It(It(y,b,v),b+1,h),s)}else[s,a]=lI(s,t);if(s===i)return e;const{lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m}=Jd(e.offsetTree,a,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((v,h)=>It(v,h,bs(h,m,r)),Mr()),lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m,sizeTree:s}}function fI(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 Kh(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 Jd(e,t,n,o){let r=e,i=0,s=0,a=0,l=0;if(t!==0){l=ul(r,t-1,mf),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,v=m*s+a+m*o;r.push({index:c,offset:v,size:f}),i=c,a=v,s=f}return{lastIndex:i,lastOffset:a,lastSize:s,offsetTree:r}}function mI(e){return{index:e.index,value:e}}function hI(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 yI={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),v=W(void 0),h=W(($,j)=>bo($,yI[j])),y=W(void 0),b=W(0),g=aI(),p=yt(B(n,he(l,e,b),Sn(pI,g),Me()),g),u=yt(B(l,Me(),Sn(($,j)=>({current:j,prev:$.current}),{current:[],prev:[]}),Z(({prev:$})=>$)),[]);oe(B(l,ae($=>$.length>0),he(p,b),Z(([$,j,A])=>{const E=$.reduce((q,z,U)=>It(q,z,bs(z,j.offsetTree,A)||U),Mr());return{...j,groupIndices:$,groupOffsetTree:E}})),p),oe(B(o,he(p),ae(([$,{lastIndex:j}])=>$<j),Z(([$,{lastIndex:j,lastSize:A}])=>[{endIndex:j,size:A,startIndex:$}])),n),oe(c,f);const x=yt(B(c,Z($=>$===void 0)),!0);oe(B(f,ae($=>$!==void 0&&Te(Le(p).sizeTree)),Z($=>{const j=Le(m),A=Le(l).length>0;return j!==void 0&&j!==0?A?[{endIndex:0,size:j,startIndex:0},{endIndex:1,size:$,startIndex:1}]:[]:[{endIndex:0,size:$,startIndex:0}]})),n),oe(B(v,ae($=>$!==void 0&&$.length>0&&Te(Le(p).sizeTree)),Z($=>{const j=[];let A=$[0],E=0;for(let q=1;q<$.length;q++){const z=$[q];z!==A&&(j.push({endIndex:q-1,size:A,startIndex:E}),A=z,E=q)}return j.push({endIndex:$.length-1,size:A,startIndex:E}),j})),n),oe(B(l,he(m,f),ae(([,$,j])=>$!==void 0&&j!==void 0),Z(([$,j,A])=>{const E=[];for(let q=0;q<$.length;q++){const z=$[q],U=$[q+1];E.push({startIndex:z,endIndex:z,size:j}),U!==void 0&&E.push({startIndex:z+1,endIndex:U-1,size:A})}return E})),n);const S=Mt(B(n,he(p),Sn(({sizes:$},[j,A])=>({changed:A!==$,sizes:A}),{changed:!1,sizes:g}),Z($=>$.changed)));$e(B(a,Sn(($,j)=>({diff:$.prev-j,prev:j}),{diff:0,prev:0}),Z($=>$.diff)),$=>{const{groupIndices:j}=Le(p);if($>0)me(t,!0),me(i,$+Kh($,j));else if($<0){const A=Le(u);A.length>0&&($-=Kh(-$,A)),me(s,$)}}),$e(B(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(B(i,he(p),Z(([$,j])=>{const A=j.groupIndices.length>0,E=[],q=j.lastSize;if(A){const z=gs(j.sizeTree,0);let U=0,L=0;for(;U<$;){const G=j.groupIndices[L],Y=j.groupIndices.length===L+1?1/0:j.groupIndices[L+1]-G-1;E.push({endIndex:G,size:z,startIndex:G}),E.push({endIndex:G+1+Y-1,size:q,startIndex:G+1}),L++,U+=Y+1}const F=Do(j.sizeTree);return U!==$&&F.shift(),F.reduce((G,{k:Y,v:D})=>{let J=G.ranges;return G.prevSize!==0&&(J=[...G.ranges,{endIndex:Y+$-1,size:G.prevSize,startIndex:G.prevIndex}]),{prevIndex:Y+$,prevSize:D,ranges:J}},{prevIndex:$,prevSize:0,ranges:E}).ranges}return Do(j.sizeTree).reduce((z,{k:U,v:L})=>({prevIndex:U+$,prevSize:L,ranges:[...z.ranges,{endIndex:U+$-1,size:z.prevSize,startIndex:z.prevIndex}]}),{prevIndex:0,prevSize:q,ranges:[]}).ranges})),n);const C=Mt(B(s,he(p,b),Z(([$,{offsetTree:j},A])=>{const E=-$;return bs(E,j,A)})));return oe(B(s,he(p,b),Z(([$,j,A])=>{if(j.groupIndices.length>0){if(Te(j.sizeTree))return j;let q=Mr();const z=Le(u);let U=0,L=0,F=0;for(;U<-$;){F=z[L];const G=z[L+1]-F-1;L++,U+=G+1}if(q=Do(j.sizeTree).reduce((G,{k:Y,v:D})=>It(G,Math.max(0,Y+$),D),q),U!==-$){const G=gs(j.sizeTree,F);q=It(q,0,G);const Y=un(j.sizeTree,-$+1)[1];q=It(q,1,Y)}return{...j,sizeTree:q,...Jd(j.offsetTree,0,q,A)}}const E=Do(j.sizeTree).reduce((q,{k:z,v:U})=>It(q,Math.max(0,z+$),U),Mr());return{...j,sizeTree:E,...Jd(j.offsetTree,0,E,A)}})),p),{beforeUnshiftWith:T,data:y,defaultItemSize:f,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:m,gap:b,groupIndices:l,heightEstimates:v,itemSize:h,listRefresh:S,shiftWith:s,shiftWithOffset:C,sizeRanges:n,sizes:p,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:i}},Ue(ko,ff),{singleton:!0});function gI(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const hx=xe(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const i=ve(),s=ve(),a=Mt(B(i,Z(gI)));return oe(B(a,Z(l=>l.totalCount)),n),oe(B(a,Z(l=>l.groupIndices)),e),oe(B(Qe(r,t,o),ae(([l,c])=>Bl(c)),Z(([l,c,f])=>un(c.groupOffsetTree,Math.max(l-f,0),"v")[0]),Me(),Z(l=>[l])),s),{groupCounts:i,topItemsIndexes:s}},Ue(Tn,kt)),To=xe(([{log:e}])=>{const t=W(!1),n=Mt(B(t,ae(o=>o),Me()));return $e(t,o=>{o&&Le(e)("props updated",{},nt.DEBUG)}),{didMount:n,propsReady:t}},Ue(ko),{singleton:!0}),vI=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function yx(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!vI)&&(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:v}])=>{const h=ve(),y=ve(),b=W(0);let g=null,p=null,u=null;function x(){g!==null&&(g(),g=null),u!==null&&(u(),u=null),p&&(clearTimeout(p),p=null),me(l,!1)}return oe(B(h,he(n,m,o,b,a,s,v),he(e,i,r),Z(([[S,T,C,$,j,A,E,q],z,U,L])=>{const F=yx(S),{align:G,behavior:Y,offset:D}=F,J=$-1,O=mx(F,T,J);let _=bs(O,T.offsetTree,z)+A;G==="end"?(_+=U+un(T.sizeTree,O)[1]-C+L,O===J&&(_+=E)):G==="center"?_+=(U+un(T.sizeTree,O)[1]-C+L)/2:_-=j,D!==void 0&&D!==0&&(_+=D);const M=P=>{x(),P?(q("retrying to scroll to",{location:S},nt.DEBUG),me(h,S)):(me(y,!0),q("list did not change, scroll successful",{},nt.DEBUG))};if(x(),Y==="smooth"){let P=!1;u=$e(t,w=>{P=P||w}),g=cn(f,()=>{M(P)})}else g=cn(B(t,bI(150)),M);return p=setTimeout(()=>{x()},1200),me(l,!0),q("scrolling from index to",{behavior:Y,index:O,top:_},nt.DEBUG),{behavior:Y,top:_}})),c),{scrollTargetReached:y,scrollToIndex:h,topListHeight:b}},Ue(Tn,kt,ko),{singleton:!0});function bI(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return o=>{o&&(t(!0),clearTimeout(n))}}}function hf(e,t){e===0?t():requestAnimationFrame(()=>{hf(e-1,t)})}function yf(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(B(s,he(l),ae(([f,m])=>m!==0),yn(!1)),a),oe(B(s,he(l),ae(([f,m])=>m!==0),yn(!1)),c),$e(B(Qe(t,s),he(a,n,e,c),ae(([[,f],m,{sizeTree:v},h,y])=>f&&(!Te(v)||df(h))&&!m&&!y),he(l)),([,f])=>{cn(r,()=>{me(c,!0)}),hf(4,()=>{cn(o,()=>{me(a,!0)}),me(i,f)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},Ue(Tn,kt,Ps,To),{singleton:!0});function gx(e,t){return Math.abs(e-t)<1.01}const xs="up",Bi="down",xI="none",wI={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},SI=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(SI),v=yt(B(Hd(B(se(r),Qo(1),yn(!0)),B(se(r),Qo(1),yn(!1),Fh(100))),Me()),!1),h=yt(B(Hd(B(n,yn(!0)),B(n,yn(!1),Fh(200))),Me()),!1);oe(B(Qe(se(r),se(m)),Z(([u,x])=>u<=x),Me()),a),oe(B(a,On(50)),c);const y=Mt(B(Qe(o,se(i),se(t),se(e),se(f)),Sn((u,[{scrollHeight:x,scrollTop:S},T,C,$,j])=>{const A=S+T-x>-j,E={scrollHeight:x,scrollTop:S,viewportHeight:T};if(A){let z,U;return S>u.state.scrollTop?(z="SCROLLED_DOWN",U=u.state.scrollTop-S):(z="SIZE_DECREASED",U=u.state.scrollTop-S||u.scrollTopDelta),{atBottom:!0,atBottomBecause:z,scrollTopDelta:U,state:E}}let q;return E.scrollHeight>u.state.scrollHeight?q="SIZE_INCREASED":T<u.state.viewportHeight?q="VIEWPORT_HEIGHT_DECREASING":S<u.state.scrollTop?q="SCROLLING_UPWARDS":q="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:q,state:E}},wI),Me((u,x)=>u!==void 0&&u.atBottom===x.atBottom))),b=yt(B(o,Sn((u,{scrollHeight:x,scrollTop:S,viewportHeight:T})=>{if(!gx(u.scrollHeight,x)){const C=x-(S+T)<1;return u.scrollTop!==S&&C?{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),Z(u=>u.jump)),0);oe(B(y,Z(u=>u.atBottom)),s),oe(B(s,On(50)),l);const g=W(Bi);oe(B(o,Z(({scrollTop:u})=>u),Me(),Sn((u,x)=>Le(h)?{direction:u.direction,prevScrollTop:x}:{direction:x<u.prevScrollTop?xs:Bi,prevScrollTop:x},{direction:Bi,prevScrollTop:0}),Z(u=>u.direction)),g),oe(B(o,On(50),yn(xI)),g);const p=W(0);return oe(B(v,ae(u=>!u),yn(0)),p),oe(B(r,On(100),he(v),ae(([u,x])=>x),Sn(([u,x],[S])=>[x,S],[0,0]),Z(([u,x])=>x-u)),p),{atBottomState:y,atBottomStateChange:l,atBottomThreshold:f,atTopStateChange:c,atTopThreshold:m,isAtBottom:s,isAtTop:a,isScrolling:v,lastJumpDueToItemResize:b,scrollDirection:g,scrollVelocity:p}},Ue(kt)),ws="top",Ss="bottom",Gh="none";function Jh(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 Qh(e,t){return typeof e=="number"?e:e[t]??0}const gf=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(B(Qe(se(o),se(r),se(n),se(i,vs),se(l),se(s),se(t),se(e),se(a)),Z(([f,m,v,[h,y],b,g,p,u,x])=>{const S=f-u,T=g+p,C=Math.max(v-S,0);let $=Gh;const j=Qh(x,ws),A=Qh(x,Ss);return h-=u,h+=v+p,y+=v+p,y-=u,h>f+T-j&&($=xs),y<f-C+m+A&&($=Bi),$!==Gh?[Math.max(S-v-Jh(b,ws,$)-j,0),S-C-p+m+Jh(b,Ss,$)+A]: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 $I(e,t,n){if(Bl(t)){const o=fx(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,v=a+m*l+(m-1)*o,h=c,y=v-f;return{bottom:f,firstItemIndex:i,items:Yh(e,r,i),offsetBottom:y,offsetTop:c,top:h,topItems:Yh(t,r,i),topListHeight:t.reduce((b,g)=>g.size+b,0),totalCount:n}}function vx(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=yf(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 Yh(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 Xh(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},v,{didMount:h},{recalcInProgress:y}])=>{const b=W([]),g=W(0),p=ve(),u=W(0);oe(i.topItemsIndexes,b);const x=yt(B(Qe(h,y,se(l,vs),se(r),se(o),se(c),f,se(b),se(t),se(n),se(u),e),ae(([$,j,,A,,,,,,,,E])=>{const q=E!==void 0&&E.length!==A;return $&&!j&&!q}),Z(([,,[$,j],A,E,q,z,U,L,F,G,Y])=>{var X,ie;const D=E,{offsetTree:J,sizeTree:O}=D,_=Le(g);if(A===0)return{...jc,totalCount:A};if($===0&&j===0)return _===0?{...jc,totalCount:A}:vx(_,q,E,L,F,Y||[]);if(Te(O))return _>0?null:Ca($I(yf(q,A),D,Y),[],A,F,D,L);const M=[];if(U.length>0){const de=U[0],we=U[U.length-1];let ze=0;for(const Ee of qr(O,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++)M.push({data:Y==null?void 0:Y[Pe],index:Pe,offset:ze,size:Se}),ze+=Se}}if(!z)return Ca([],M,A,F,D,L);const P=U.length>0?U[U.length-1]+1:0,w=uI(J,$,j,P);if(w.length===0)return null;const k=A-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+F)/(_e+F));const Pe=Se-we.start;Ee+=Pe*_e+Pe*F}Se<P&&(Ee+=(P-Se)*_e,Se=P);const Ye=Math.min(we.end,k);for(let Pe=Se;Pe<=Ye&&!(Ee>=j);Pe++)de.push({data:Y==null?void 0:Y[Pe],index:Pe,offset:Ee,size:_e}),Ee+=_e+F}}),H=Xh(G,ws),R=Xh(G,Ss);if(N.length>0&&(H>0||R>0)){const de=N[0],we=N[N.length-1];if(H>0&&de.index>P){const ze=Math.min(H,de.index-P),Ee=[];let Se=de.offset;for(let _e=de.index-1;_e>=de.index-ze;_e--){const Ye=((X=qr(O,_e,_e)[0])==null?void 0:X.value)??de.size;Se-=Ye+F,Ee.unshift({data:Y==null?void 0:Y[_e],index:_e,offset:Se,size:Ye})}N.unshift(...Ee)}if(R>0&&we.index<k){const ze=Math.min(R,k-we.index);let Ee=we.offset+we.size+F;for(let Se=we.index+1;Se<=we.index+ze;Se++){const _e=((ie=qr(O,Se,Se)[0])==null?void 0:ie.value)??we.size;N.push({data:Y==null?void 0:Y[Se],index:Se,offset:Ee,size:_e}),Ee+=_e+F}}}return Ca(N,M,A,F,D,L)}),ae($=>$!==null),Me()),jc);oe(B(e,ae(df),Z($=>$==null?void 0:$.length)),r),oe(B(x,Z($=>$.topListHeight)),m),oe(m,a),oe(B(x,Z($=>[$.top,$.bottom])),s),oe(B(x,Z($=>$.items)),p);const S=Mt(B(x,ae(({items:$})=>$.length>0),he(r,e),ae(([{items:$},j])=>$[$.length-1].originalIndex===j-1),Z(([,$,j])=>[$-1,j]),Me(vs),Z(([$])=>$))),T=Mt(B(x,On(200),ae(({items:$,topItems:j})=>$.length>0&&$[0].originalIndex===j.length),Z(({items:$})=>$[0].index),Me())),C=Mt(B(x,ae(({items:$})=>$.length>0),Z(({items:$})=>{let j=0,A=$.length-1;for(;$[j].type==="group"&&j<A;)j++;for(;$[A].type==="group"&&A>j;)A--;return{endIndex:$[A].index,startIndex:$[j].index}}),Me(ux)));return{endReached:S,initialItemCount:g,itemsRendered:p,listState:x,minOverscanItemCount:u,rangeChanged:C,startReached:T,topItemsIndexes:b,...v}},Ue(Tn,hx,gf,Is,Ps,Os,To,ff),{singleton:!0}),bx=xe(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:o},{listState:r}])=>{const i=ve(),s=yt(B(Qe(n,e,o,t,r),Z(([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}),kI=xe(([{viewportHeight:e},{totalListHeight:t}])=>{const n=W(!1),o=yt(B(Qe(n,e,t),ae(([r])=>r),Z(([,r,i])=>Math.max(0,r-i)),On(0),Me()),0);return{alignToBottom:n,paddingTopAddition:o}},Ue(kt,bx),{singleton:!0}),xx=xe(()=>({context:W(null)})),TI=({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,wx=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(B(f,he(t,l,n,i,r,o,a),he(e),Z(([[m,v,h,y,b,g,p,u],x])=>{const{calculateViewLocation:S=TI,done:T,...C}=m,$=mx(m,v,y-1),j=bs($,v.offsetTree,x)+b+g,A=j+un(v.sizeTree,$)[1],E=u+g,q=u+h-p,z=S({itemBottom:A,itemTop:j,locationParams:C,viewportBottom:q,viewportTop:E});return z!==null?T&&cn(B(s,ae(U=>!U),Qo(Le(s)?1:2)),T):T==null||T(),z}),ae(m=>m!==null)),c),{scrollIntoView:f}},Ue(Tn,kt,Ps,er,ko),{singleton:!0});function Zh(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const _I=(e,t)=>typeof e=="function"?Zh(e(t)):t&&Zh(e),jI=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:v},{scrollIntoView:h}])=>{const y=W(!1),b=ve();let g=null;function p(T){me(s,{align:"end",behavior:T,index:"LAST"})}$e(B(Qe(B(se(t),Qo(1)),l),he(se(y),i,a,m),Z(([[T,C],$,j,A,E])=>{let q=C&&A,z="auto";return q&&(z=_I($,j||E),q=q&&z!==!1),{followOutputBehavior:z,shouldFollow:q,totalCount:T}}),ae(({shouldFollow:T})=>T)),({followOutputBehavior:T,totalCount:C})=>{g!==null&&(g(),g=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("following output to ",{totalCount:C},nt.DEBUG),p(T)}):g=cn(e,()=>{Le(f)("following output to ",{totalCount:C},nt.DEBUG),p(T),g=null})});function u(T){const C=cn(r,$=>{T&&!$.atBottom&&$.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(Le(f)("scrolling to bottom due to increased size",{},nt.DEBUG),p("auto"))});setTimeout(C,100)}$e(B(Qe(se(y),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(y,t)),([,T])=>{Le(a)&&u(T!==!1)}),$e(b,()=>{u(Le(y)!==!1)}),$e(Qe(se(y),r),([T,C])=>{T!==!1&&!C.atBottom&&C.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&p("auto")});const x=W(null),S=ve();return oe(Hd(B(se(o),Z(T=>(T==null?void 0:T.length)??0)),B(se(t))),S),$e(B(Qe(B(S,Qo(1)),l),he(se(x),a,m,v),Z(([[T,C],$,j,A,E])=>C&&j&&($==null?void 0:$({context:E,totalCount:T,scrollingInProgress:A}))),ae(T=>!!T),On(0)),T=>{g!==null&&(g(),g=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("scrolling into view",{}),me(h,T)}):g=cn(e,()=>{Le(f)("scrolling into view",{}),me(h,T),g=null})}),{autoscrollToBottom:b,followOutput:y,scrollIntoViewOnChange:x}},Ue(Tn,Os,Ps,Is,To,ko,kt,xx,wx)),NI=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:i,listState:s},{didMount:a}])=>(oe(B(a,he(i),ae(([,l])=>l!==0),he(r,o,t,n,e),Z(([[,l],c,f,m,v,h=[]])=>vx(l,c,f,m,v,h))),s),{}),Ue(Tn,Is,er,To),{singleton:!0}),CI=xe(([{didMount:e},{scrollTo:t},{listState:n}])=>{const o=W(0);return $e(B(e,he(o),ae(([,r])=>r!==0),Z(([,r])=>({top:r}))),r=>{cn(B(n,Qo(1),ae(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{me(t,r)})})}),{initialScrollTop:o}},Ue(To,kt,er),{singleton:!0}),Sx=xe(([{scrollVelocity:e}])=>{const t=W(!1),n=ve(),o=W(!1);return oe(B(e,he(o,t,n),ae(([r,i])=>i!==!1&&i!==void 0),Z(([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(B(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}),vf=xe(([{scrollContainerState:e,scrollTo:t}])=>{const n=ve(),o=ve(),r=ve(),i=W(!1),s=W(void 0);return oe(B(Qe(n,o),Z(([{scrollTop:a,viewportHeight:l},{offsetTop:c,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,a-c),viewportHeight:l}))),e),oe(B(t,he(o),Z(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:s,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},Ue(kt)),EI=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),v=W(null);return oe(a,m),oe(l,v),$e(B(c,he(t,o,s,m,v,n)),([h,y,b,g,p,u,x])=>{const S=fI(y.sizeTree);g&&p!==null&&u!==null&&(b=p.scrollTop-u.offsetTop),b-=x,h({ranges:S,scrollTop:b})}),oe(B(f,ae(df),Z(PI)),r),oe(B(i,he(f),ae(([,h])=>h!==void 0),Me(),Z(([,h])=>h.ranges)),e),{getState:c,restoreStateFrom:f}},Ue(Tn,kt,Is,To,vf));function PI(e){return{align:"start",index:0,offset:e.scrollTop}}const II=xe(([{topItemsIndexes:e}])=>{const t=W(0);return oe(B(t,ae(n=>n>=0),Z(n=>Array.from({length:n}).map((o,r)=>r))),e),{topItemCount:t}},Ue(er));function $x(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const OI=$x(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),RI=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:v},{log:h},{recalcInProgress:y}])=>{const b=Mt(B(l,he(s),Sn(([,p,u,x],[{bottom:S,items:T,offsetBottom:C,totalCount:$},j])=>{const A=S+C;let E=0;return u===$&&p.length>0&&T.length>0&&(T[0].originalIndex===0&&p[0].originalIndex===0||(E=A-x,E!==0&&(E+=j))),[E,T,$,A]},[0,[],0,0]),ae(([p])=>p!==0),he(o,a,n,r,h,y),ae(([,p,u,x,,,S])=>!S&&!x&&p!==0&&u===xs),Z(([[p],,,,,u])=>(u("Upward scrolling compensation",{amount:p},nt.DEBUG),p))));function g(p){p>0?(me(t,{behavior:"auto",top:-p}),me(e,0)):(me(e,0),me(t,{behavior:"auto",top:-p}))}return $e(B(b,he(e,i)),([p,u,x])=>{x&&OI()?me(e,u-p):g(-p)}),$e(B(Qe(yt(i,!1),e,y),ae(([p,u,x])=>!p&&!x&&u!==0),Z(([p,u])=>u),On(1)),g),oe(B(m,Z(p=>({top:-p}))),t),$e(B(c,he(v,f),Z(([p,{groupIndices:u,lastSize:x,sizeTree:S},T])=>{function C(q){return q*(x+T)}if(u.length===0)return C(p);let $=0;const j=gs(S,0);let A=0,E=0;for(;A<p;){A++,$+=j;let q=u.length===E+1?1/0:u[E+1]-u[E]-1;A+q>p&&($-=j,q=p-A+1),A+=q,$+=C(q),E++}return $})),p=>{me(e,p),requestAnimationFrame(()=>{me(t,{top:p}),requestAnimationFrame(()=>{me(e,0),me(y,!1)})})}),{deviation:e}},Ue(kt,Os,er,Tn,ko,ff)),AI=xe(([e,t,n,o,r,i,s,a,l,c,f])=>({...e,...t,...n,...o,...r,...i,...s,...a,...l,...c,...f}),Ue(gf,NI,To,Sx,bx,CI,kI,vf,wx,ko,xx)),kx=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:v,trackItemSizes:h},{initialItemFinalLocationReached:y,initialTopMostItemIndex:b,scrolledToInitialItem:g},p,u,x,S,{scrollToIndex:T},C,{topItemCount:$},{groupCounts:j},A])=>{const{listState:E,minOverscanItemCount:q,topItemsIndexes:z,rangeChanged:U,...L}=S;return oe(U,A.scrollSeekRangeChanged),oe(B(A.windowViewportRect,Z(F=>F.visibleHeight)),p.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:i,groupCounts:j,heightEstimates:a,initialItemFinalLocationReached:y,initialTopMostItemIndex:b,scrolledToInitialItem:g,sizeRanges:c,topItemCount:$,topItemsIndexes:z,totalCount:v,...x,groupIndices:s,itemSize:l,listState:E,minOverscanItemCount:q,scrollToIndex:T,statefulTotalCount:m,trackItemSizes:h,rangeChanged:U,...L,...A,...p,sizes:f,...u}},Ue(Tn,Is,kt,EI,jI,er,Ps,RI,II,hx,AI));function MI(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 Tx(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(g,p){g.propsReady!==void 0&&me(g.propsReady,!1);for(const u of o){const x=g[t.required[u]];me(x,p[u])}for(const u of r)if(u in p){const x=g[t.optional[u]];me(x,p[u])}g.propsReady!==void 0&&me(g.propsReady,!0)}function c(g){return i.reduce((p,u)=>(p[u]=x=>{const S=g[t.methods[u]];me(S,x)},p),{})}function f(g){return s.reduce((p,u)=>(p[u]=YP(g[t.events[u]]),p),{})}const m=te.forwardRef(function(g,p){const{children:u,...x}=g,[S]=te.useState(()=>Fl(ZP(e),$=>{l($,x)})),[T]=te.useState(zh(f,S));ra(()=>{for(const $ of s)$ in x&&$e(T[$],x[$]);return()=>{Object.values(T).map(uf)}},[x,T,S]),ra(()=>{l(S,x)}),te.useImperativeHandle(p,Dh(c(S)));const C=n;return d.jsx(a.Provider,{value:S,children:n!==void 0?d.jsx(C,{...MI([...o,...r,...s],x),children:u}):u})}),v=g=>{const p=te.useContext(a);return te.useCallback(u=>{me(p[g],u)},[p,g])},h=g=>{const p=te.useContext(a)[g],u=te.useCallback(x=>$e(p,x),[p]);return te.useSyncExternalStore(u,()=>Le(p),()=>Le(p))},y=g=>{const p=te.useContext(a)[g],[u,x]=te.useState(zh(Le,p));return ra(()=>$e(p,S=>{S!==u&&x(Dh(S))}),[p,u]),u},b=parseInt(te.version)>=18?h:y;return{Component:m,useEmitter:(g,p)=>{const u=te.useContext(a)[g];ra(()=>$e(u,p),[p,u])},useEmitterValue:b,usePublisher:v}}const _x=te.createContext(void 0),jx=te.createContext(void 0),Nc="-webkit-sticky",ey="sticky",bf=$x(()=>{if(typeof document>"u")return ey;const e=document.createElement("div");return e.style.position=Nc,e.style.position===Nc?Nc:ey}),Nx=typeof document<"u"?te.useLayoutEffect:te.useEffect;function Cc(e){return"self"in e}function qI(e){return"body"in e}function Cx(e,t,n,o=ri,r,i){const s=te.useRef(null),a=te.useRef(null),l=te.useRef(null),c=te.useCallback(v=>{let h,y,b;const g=v.target;if(qI(g)||Cc(g)){const u=Cc(g)?g:g.defaultView;b=i===!0?Lo(u,u.scrollX):u.scrollY,h=i===!0?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight,y=i===!0?u.innerWidth:u.innerHeight}else b=i===!0?Lo(g,g.scrollLeft):g.scrollTop,h=i===!0?g.scrollWidth:g.scrollHeight,y=i===!0?g.offsetWidth:g.offsetHeight;const p=()=>{e({scrollHeight:h,scrollTop:Math.max(b,0),viewportHeight:y})};v.suppressFlushSync===!0?p():cS.flushSync(p),a.current!==null&&(b===a.current||b<=0||b===h-y)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);te.useEffect(()=>{const v=r||s.current;return Bh(v),o(r||s.current),c({suppressFlushSync:!0,target:v}),v.addEventListener("scroll",c,{passive:!0}),()=>{Bh(v),o(null),v.removeEventListener("scroll",c)}},[s,c,n,o,r]);function f(v){const h=s.current;if(!h||(i===!0?"offsetWidth"in h&&h.offsetWidth===0:"offsetHeight"in h&&h.offsetHeight===0))return;const y=v.behavior==="smooth";let b,g,p;Cc(h)?(g=Math.max(bo(h.document.documentElement,i===!0?"width":"height"),i===!0?h.document.documentElement.scrollWidth:h.document.documentElement.scrollHeight),b=i===!0?h.innerWidth:h.innerHeight,p=i===!0?Lo(h,h.scrollX):h.scrollY):(g=h[i===!0?"scrollWidth":"scrollHeight"],b=bo(h,i===!0?"width":"height"),p=i===!0?Lo(h,h.scrollLeft):h.scrollTop);const u=g-b;if(v.top===void 0){h.scrollTo(v);return}const x=Math.ceil(Math.max(Math.min(u,v.top),0));if(v.top=x,gx(b,g)||x===p){e({scrollHeight:g,scrollTop:p,viewportHeight:b}),y&&t(!0);return}y?(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&&(v={...v.behavior!==void 0?{behavior:v.behavior}:{},left:Hh(h,x)}),h.scrollTo(v)}function m(v){i===!0&&(v={...v.behavior!==void 0?{behavior:v.behavior}:{},...v.top!==void 0?{left:Hh(s.current,v.top)}:{}}),s.current.scrollBy(v)}return{scrollByCallback:m,scrollerRef:s,scrollToCallback:f}}function xf(e){return e}const UI=xe(()=>{const e=W(a=>`Item ${a}`),t=W(a=>`Group ${a}`),n=W({}),o=W(xf),r=W("div"),i=W(ri),s=(a,l=null)=>yt(B(n,Z(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")}}),LI=xe(([e,t])=>({...e,...t}),Ue(kx,UI)),DI=({height:e})=>d.jsx("div",{style:{height:e}}),zI={overflowAnchor:"none",position:bf(),zIndex:1},Ex={overflowAnchor:"none"},FI={...Ex,display:"inline-block",height:"100%"},ty=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"),v=ce("itemSize"),h=ce("log"),y=Wt("gap"),b=ce("horizontalDirection"),{callbackRef:g}=oI(n,v,m,e?ri:a,h,y,r,b,ce("skipAnimationFrameInResizeObserver")),[p,u]=te.useState(0);Sf("deviation",L=>{p!==L&&u(L)});const x=ce("EmptyPlaceholder"),S=ce("ScrollSeekPlaceholder")??DI,T=ce("ListComponent"),C=ce("ItemComponent"),$=ce("GroupComponent"),j=ce("computeItemKey"),A=ce("isSeeking"),E=ce("groupIndices").length>0,q=ce("alignToBottom"),z=ce("initialItemFinalLocationReached"),U=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginInlineStart:p!==0?p:q?"auto":0,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:p!==0?p:q?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...z?{}:{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:g,style:U,children:(e?t.topItems:t.items).map(L=>{const F=L.originalIndex,G=j(F+t.firstItemIndex,L.data,c);return A?I.createElement(S,{...ht(S,c),height:L.size,index:L.index,key:G,type:L.type||"item",...L.type==="group"?{}:{groupIndex:L.groupIndex}}):L.type==="group"?I.createElement($,{...ht($,c),"data-index":F,"data-item-index":L.index,"data-known-size":L.size,key:G,style:zI},f(L.index,c)):I.createElement(C,{...ht(C,c),...WI(C,L.data),"data-index":F,"data-item-group-index":L.groupIndex,"data-item-index":L.index,"data-known-size":L.size,key:G,style:b?FI:Ex},E?l(L.index,L.groupIndex,L.data,c):l(L.index,L.data,c))})})}),BI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},HI={outline:"none",overflowX:"auto",position:"relative"},wf=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),Px=(e,t,n=0)=>({...wf(e),position:t?"relative":"absolute",top:t?-n:0}),VI={position:bf(),top:0,width:"100%",zIndex:1};function ht(e,t){if(typeof e!="string")return{context:t}}function WI(e,t){return{item:typeof e=="string"?void 0:t}}const KI=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}),GI=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 Ix({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:v,scrollerRef:h,scrollToCallback:y}=Cx(a,c,l,f,void 0,m);return e("scrollTo",y),e("scrollBy",v),d.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...m?HI:BI,...r},tabIndex:0,...s,...ht(l,i),children:o})})}function Ox({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"),v=t("customScrollParent"),h=te.useRef(null),y=t("scrollerRef"),{scrollByCallback:b,scrollerRef:g,scrollToCallback:p}=Cx(a,c,l,y,v);return Nx(()=>{var u;return g.current=v||((u=h.current)==null?void 0:u.ownerDocument.defaultView),()=>{g.current=null}},[g,v]),e("windowScrollTo",p),e("scrollBy",b),d.jsx(l,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...f!==0?{height:f+m}:void 0},...s,...ht(l,i),children:o})})}const JI=({children:e})=>{const t=te.useContext(_x),n=Wt("viewportHeight"),o=Wt("fixedItemHeight"),r=ce("alignToBottom"),i=ce("horizontalDirection"),s=te.useMemo(()=>tx(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:wf(r),children:e})},QI=({children:e})=>{const t=te.useContext(_x),n=Wt("windowViewportRect"),o=Wt("fixedItemHeight"),r=ce("customScrollParent"),i=ce("useWindowScroll"),s=ce("topListHeight"),a=ix(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:Px(l,i,s),children:e})},YI=({children:e})=>{const t=ce("TopItemListComponent")??"div",n=ce("headerHeight"),o={...VI,marginTop:`${n}px`},r=ce("context");return d.jsx(t,{style:o,...ht(t,r),children:e})},XI=te.memo(function(e){const t=ce("useWindowScroll"),n=ce("topItemsIndexes").length>0,o=ce("customScrollParent"),r=ce("context");return d.jsxs(o||t?tO:eO,{...e,context:r,children:[n&&d.jsx(YI,{children:d.jsx(ty,{showTopList:!0})}),d.jsxs(o||t?QI:JI,{children:[d.jsx(KI,{}),d.jsx(ty,{}),d.jsx(GI,{})]})]})}),{Component:ZI,useEmitter:Sf,useEmitterValue:ce,usePublisher:Wt}=Tx(LI,{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"}},XI),eO=Ix({useEmitter:Sf,useEmitterValue:ce,usePublisher:Wt}),tO=Ox({useEmitter:Sf,useEmitterValue:ce,usePublisher:Wt}),nO=ZI,oO=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(xf),a=W(ri),l=(c,f=null)=>yt(B(i,Z(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(kx,oO);bf();const ny={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},rO={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:oy,floor:pl,max:Hi,min:Ec,round:ry}=Math;function iy(e,t,n){return Array.from({length:t-e+1}).map((o,r)=>({data:n===null?null:n[r+e],index:r+e}))}function iO(e){return{...rO,items:e}}function ia(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function sO(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const aO=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},v,h,{didMount:y,propsReady:b},{customScrollParent:g,useWindowScroll:p,windowScrollContainerState:u,windowScrollTo:x,windowViewportRect:S},T])=>{const C=W(0),$=W(0),j=W(ny),A=W({height:0,width:0}),E=W({height:0,width:0}),q=ve(),z=ve(),U=W(0),L=W(null),F=W({column:0,row:0}),G=ve(),Y=ve(),D=W(!1),J=W(0),O=W(!0),_=W(!1),M=W(!1);$e(B(y,he(J),ae(([R,X])=>X!==0)),()=>{me(O,!1)}),$e(B(Qe(y,O,E,A,J,_),ae(([R,X,ie,de,,we])=>R&&!X&&ie.height!==0&&de.height!==0&&!we)),([,,,,R])=>{me(_,!0),hf(1,()=>{me(q,R)}),cn(B(c),()=>{me(t,[0,0]),me(O,!0)})}),oe(B(Y,ae(R=>R!=null&&R.scrollTop>0),yn(0)),$),$e(B(y,he(Y),ae(([,R])=>R!=null)),([,R])=>{R&&(me(A,R.viewport),me(E,R.item),me(F,R.gap),R.scrollTop>0&&(me(D,!0),cn(B(c,Qo(1)),X=>{me(D,!1)}),me(l,{top:R.scrollTop})))}),oe(B(A,Z(({height:R})=>R)),m),oe(B(Qe(se(A,ia),se(E,ia),se(F,(R,X)=>R!==void 0&&R.column===X.column&&R.row===X.row),se(c)),Z(([R,X,ie,de])=>({gap:ie,item:X,scrollTop:de,viewport:R}))),G),oe(B(Qe(se(C),o,se(F,sO),se(E,ia),se(A,ia),se(L),se($),se(D),se(O),se(J)),ae(([,,,,,,,R])=>!R),Z(([R,[X,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&&(R===0||tr===0))return ny;if(_o===0){const $f=yf(Ye,R),qx=$f+Math.max(Se-1,0);return iO(iy($f,qx,Ee))}const Hn=Rx(tr,_o,Pe);let pn,Yt;_e?X===0&&ie===0&&Se>0?(pn=0,Yt=Se-1):(pn=Hn*pl((X+_n)/(Bn+_n)),Yt=Hn*oy((ie+_n)/(Bn+_n))-1,Yt=Ec(R-1,Hi(Yt,Hn-1)),pn=Ec(Yt,Hi(0,pn))):(pn=0,Yt=-1);const Vn=iy(pn,Yt,Ee),{bottom:nr,top:ii}=sy(ze,de,we,Vn),si=oy(R/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(B(L,ae(R=>R!==null),Z(R=>R.length)),C),oe(B(Qe(A,E,j,F),ae(([R,X,{items:ie}])=>ie.length>0&&X.height!==0&&R.height!==0),Z(([R,X,{items:ie},de])=>{const{bottom:we,top:ze}=sy(R,de,X,ie);return[ze,we]}),Me(vs)),t);const P=W(!1);oe(B(c,he(P),Z(([R,X])=>X||R!==0)),P);const w=Mt(B(Qe(j,C),ae(([{items:R}])=>R.length>0),he(P),ae(([[R,X],ie])=>{const de=R.items[R.items.length-1].index===X-1;return(ie||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===X)&&de}),Z(([[,R]])=>R-1),Me())),k=Mt(B(se(j),ae(({items:R})=>R.length>0&&R[0].index===0),yn(0),Me())),N=Mt(B(se(j),he(D),ae(([{items:R},X])=>R.length>0&&!X),Z(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),Me(ux),On(0)));oe(N,h.scrollSeekRangeChanged),oe(B(q,he(A,E,C,F),Z(([R,X,ie,de,we])=>{const ze=yx(R),{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=Qd(X,we,ie,Ye);return Ee==="end"?Pe=ry(Pe-X.height+ie.height):Ee==="center"&&(Pe=ry(Pe-X.height/2+ie.height/2)),_e!==void 0&&_e!==0&&(Pe+=_e),{behavior:Se,top:Pe}})),l);const H=yt(B(j,Z(R=>R.offsetBottom+R.bottom)),0);return oe(B(S,Z(R=>({height:R.visibleHeight,width:R.visibleWidth}))),A),{customScrollParent:g,data:L,deviation:U,footerHeight:r,gap:F,headerHeight:i,increaseViewportBy:e,initialItemCount:$,itemDimensions:E,overscan:n,restoreStateFrom:Y,scrollBy:s,scrollContainerState:a,scrollHeight:z,scrollTo:l,scrollToIndex:q,scrollTop:c,smoothScrollTargetReached:f,totalCount:C,useWindowScroll:p,viewportDimensions:A,windowScrollContainerState:u,windowScrollTo:x,windowViewportRect:S,...h,gridState:j,horizontalDirection:M,initialTopMostItemIndex:J,totalListHeight:H,...v,endReached:w,propsReady:b,rangeChanged:N,startReached:k,stateChanged:G,stateRestoreInProgress:D,...T}},Ue(gf,kt,Os,Sx,To,vf,ko));function Rx(e,t,n){return Hi(1,pl((e+n)/(pl(t)+n)))}function sy(e,t,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const i=Qd(e,t,n,o[0].index);return{bottom:Qd(e,t,n,o[o.length-1].index)+r,top:i}}function Qd(e,t,n,o){const r=Rx(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 lO=xe(()=>{const e=W(m=>`Item ${m}`),t=W({}),n=W(null),o=W("virtuoso-grid-item"),r=W("virtuoso-grid-list"),i=W(xf),s=W("div"),a=W(ri),l=(m,v=null)=>yt(B(t,Z(h=>h[m]),Me()),v),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")}}),cO=xe(([e,t])=>({...e,...t}),Ue(aO,lO)),dO=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"),v=Kt("gap"),h=Re("log"),y=Re("stateRestoreInProgress"),b=Kt("reportReadyState"),g=Zo(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})}v({column:ay("column-gap",getComputedStyle(p).columnGap,h),row:ay("row-gap",getComputedStyle(p).rowGap,h)})},[s,m,v,h]),!0,!1);return Nx(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),y?null:d.jsx(l,{className:t,ref:g,...ht(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,{...ht(c,f),height:e.itemHeight,index:p.index,width:e.itemWidth},u):I.createElement(a,{...ht(a,f),className:n,"data-index":p.index,key:u},o(p.index,p.data,f))})})}),uO=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}),pO=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}),fO=({children:e})=>{const t=te.useContext(jx),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:wf(!1),children:e})},mO=({children:e})=>{const t=te.useContext(jx),n=Kt("windowViewportRect"),o=Kt("itemDimensions"),r=Re("customScrollParent"),i=Re("useWindowScroll"),s=ix(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:Px(!1,i),children:e})},hO=te.memo(function({...e}){const t=Re("useWindowScroll"),n=Re("customScrollParent"),o=n||t?gO:yO,r=n||t?mO:fO,i=Re("context");return d.jsx(o,{...e,...ht(o,i),children:d.jsxs(r,{children:[d.jsx(uO,{}),d.jsx(dO,{}),d.jsx(pO,{})]})})}),{useEmitter:Ax,useEmitterValue:Re,usePublisher:Kt}=Tx(cO,{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"}},hO),yO=Ix({useEmitter:Ax,useEmitterValue:Re,usePublisher:Kt}),gO=Ox({useEmitter:Ax,useEmitterValue:Re,usePublisher:Kt});function ay(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 vO(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 bO(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=vO(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 xO(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 wO(e){return e.method==="session/prompt"&&e.kind==="request"}const SO={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"???"},$O={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"},kO={"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 TO(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?aE(o):null,c=xO(e),f=wO(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:kO[e.direction],children:[d.jsx("span",{"aria-hidden":!0,children:Wb(e.direction)}),d.jsx("span",{className:"text-[10px] tracking-widest",children:Vb(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",TO(e.kind),"border-current/40"),title:$O[e.kind],children:SO[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(v=>`${v.path==="/"?"":v.path+" "}${v.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:${cE(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 jO=I.memo(_O);function NO({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,v=r!==null&&e.some(h=>h.seq===r);return d.jsxs("div",{className:"border-b border-line-grid/70",children:[d.jsxs("button",{type:"button",onClick:()=>{a(h=>!h),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",v?"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((h,y)=>d.jsxs("button",{type:"button",onClick:()=>i(h.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===h.seq?"bg-surface-rowHover text-ink-primary":""),children:[d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(h.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-muted",children:fs(h.timestamp)}),d.jsxs("span",{className:"w-8 shrink-0 text-ink-muted",children:["#",y+1]}),d.jsx("span",{className:"flex-1 truncate text-ink-primary",children:CO(h)})]},h.seq))})]})}function CO(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 ly="border-ink-secondary/45",cy="border-dashed border-ink-muted/35";function EO({state:e,firstRow:t=!1,lastRow:n=!1}){const o=e!=="upcoming",r=e==="played";return d.jsxs("span",{"aria-hidden":!0,className:"relative w-4 shrink-0 self-stretch",children:[!t&&d.jsx("span",{className:K("absolute left-1/2 top-0 h-1/2 -translate-x-1/2 border-l",o?ly:cy)}),!n&&d.jsx("span",{className:K("absolute bottom-0 left-1/2 h-1/2 -translate-x-1/2 border-l",r?ly:cy)}),e==="current"&&d.jsx("span",{className:"absolute left-1/2 top-1/2 h-[7px] w-[7px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-ink-primary ring-2 ring-surface-base"})]})}function PO(e,t,n){return n===null?"upcoming":n>=e&&n<=t?"current":t<n?"played":"upcoming"}const IO=80;function Pc(e){return e.type==="message"?[e.message.seq,e.message.seq]:[e.firstSeq,e.lastSeq]}function OO(){const e=ne(E=>E.messages),t=ne(E=>E.selectedSeq),n=ne(E=>E.filters),o=ne(E=>E.playback.playhead),r=ne(E=>E.playback.playing),i=ne(E=>E.select),s=ne(E=>E.setPlayhead),a=I.useMemo(()=>vS(e,n),[e,n]),l=I.useMemo(()=>bO(a),[a]),c=I.useMemo(()=>Cl(e),[e]),f=I.useMemo(()=>tf(e),[e]),m=I.useMemo(()=>{const E=new Map;for(const q of e)E.set(q.seq,q.timestamp);return E},[e]),v=I.useMemo(()=>{if(t===null)return null;const E=c.get(t);if(E!==void 0)return E;for(const[q,z]of c)if(z===t)return q;return null},[t,c]),h=I.useRef(null),y=I.useRef({startIndex:0,endIndex:0}),b=at(E=>E.selectedUrl),g=b!==null&&!Qu(b),p=ne(E=>{var q;return((q=E.session)==null?void 0:q.id)??null}),u=ne(E=>E.replayDone),x=I.useRef(p),S=I.useRef(!1),T=I.useRef(!1);I.useEffect(()=>{x.current!==p&&(x.current=p,S.current=!1,T.current=!1)},[p]),I.useEffect(()=>{if(!g||!u||p===null||S.current||l.length===0)return;S.current=!0;const E=l.length-1,q=window.setTimeout(()=>{var z;(z=h.current)==null||z.scrollToIndex({index:E,align:"end",behavior:"smooth"})},50);return()=>window.clearTimeout(q)},[g,u,p,l.length]),I.useEffect(()=>{var F;if(g||!u||p===null||T.current||l.length===0)return;T.current=!0;const E=((F=e[e.length-1])==null?void 0:F.seq)??null;let q=o;o!==null&&E!==null&&o>=E&&(s(null),q=null);const z=t??q;if(z===null)return;const U=l.findIndex(G=>{const[Y,D]=Pc(G);return z>=Y&&z<=D});if(U<0)return;const L=G=>{var Y;return(Y=h.current)==null?void 0:Y.scrollToIndex({index:U,align:"center",behavior:G})};requestAnimationFrame(()=>requestAnimationFrame(()=>{L("smooth"),window.setTimeout(()=>{const{startIndex:G,endIndex:Y}=y.current;(U<G||U>Y)&&L("auto")},500)}))},[g,u,p,l,e,o,t,s]);const C=!g&&l.length>0,$=I.useMemo(()=>o===null?-1:l.findIndex(E=>{const[q,z]=Pc(E);return o>=q&&o<=z}),[l,o]),j=I.useRef(!0);I.useEffect(()=>{r&&(j.current=!0)},[r]),I.useEffect(()=>{var U;if(!r||!j.current||$<0)return;const{startIndex:E,endIndex:q}=y.current;($<=E||$>=q)&&((U=h.current)==null||U.scrollToIndex({index:$,align:"center",behavior:"auto"}))},[r,$]);const A=E=>{const q=l[E];if(!q)return null;const z=RO(q,{selectedSeq:t,pairedSeq:v,onSelect:i,responseToRequest:c,reqTimestampBySeq:m,validationBySeq:f});if(!C)return z;const[U,L]=Pc(q);return d.jsxs("div",{className:"flex items-stretch",children:[d.jsx(EO,{state:PO(U,L,o),firstRow:E===0,lastRow:E===l.length-1}),d.jsx("div",{className:"min-w-0 flex-1",children:z})]})};return d.jsxs("div",{className:"relative flex h-full flex-col",onWheel:()=>{r&&(j.current=!1)},children:[l.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(nO,{ref:h,className:"flex-1 bg-surface-base",totalCount:l.length,itemContent:A,rangeChanged:E=>{y.current=E},atBottomThreshold:IO,...g?{initialTopMostItemIndex:Math.max(0,l.length-1)}:{},followOutput:g?E=>E?"auto":!1:!1,computeItemKey:E=>AO(l[E])}),d.jsx(MO,{total:e.length,shown:a.length})]})}function RO(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(jO,{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(NO,{messages:e.messages,combinedText:e.combinedText,firstTimestamp:e.firstTimestamp,lastTimestamp:e.lastTimestamp,selectedSeq:t.selectedSeq,onSelect:t.onSelect})}function AO(e){return e.type==="message"?`m-${e.message.seq}`:`c-${e.firstSeq}-${e.lastSeq}`}function MO({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 qO({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 UO({onImportResult:e}){const[t,n]=I.useState(!1),[o,r]=I.useState(!1),i=I.useRef(null),s=I.useRef(null),a=ne(h=>h.session),l=ne(h=>h.messages.length),c=a!==null&&l>0;I.useEffect(()=>{if(!t)return;const h=b=>{i.current&&!i.current.contains(b.target)&&n(!1)},y=b=>{b.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",y)}},[t]);const f=()=>{var h;n(!1),(h=s.current)==null||h.click()},m=()=>{n(!1);const h=ne.getState();h.session&&h.messages.length>0&&Hb(h.session,h.messages)},v=async h=>{var b;const y=(b=h.target.files)==null?void 0:b[0];if(h.target.value="",!!y){r(!0);try{const g=await jv(y);await Xu(),at.getState().setSelected(tl(g.id)),e==null||e(`imported ${y.name} · #${g.id} · ${g.messageCount} message${g.messageCount===1?"":"s"}`,"success")}catch(g){const p=g instanceof Error?g.message:String(g);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:v,className:"hidden","aria-hidden":"true",tabIndex:-1}),d.jsx("button",{type:"button",onClick:()=>n(h=>!h),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(dy,{icon:"↑",label:"import",onClick:f,title:"Open a session JSON exported earlier — yours or someone else's."}),d.jsx(dy,{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 dy({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 LO({onSelect:e,activeUrl:t,overrideUrl:n}){const o=at(u=>u.captures),r=at(u=>u.savedSessions),i=at(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&&Qu(t)?_S(t):null,m=I.useMemo(()=>new Set(o.map(u=>u.sessionDbId).filter(u=>u!==null)),[o]),v=I.useMemo(()=>r.filter(u=>!m.has(u.id)),[r,m]),h=I.useMemo(()=>v.filter(u=>u.imported_at===null),[v]),y=I.useMemo(()=>v.filter(u=>u.imported_at!==null),[v]),b=f!==null?v.find(u=>u.id===f)??null:null,g=o.length+v.length;let p;return n?p="?ws override":c?p=nf(c):b?p=`#${b.id} · ${b.name??(b.client_name?`${b.client_name} · ${Rt(b.agent_command??"")}`:Rt(b.agent_command??""))}`:g===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: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:p}),g>1&&!n&&d.jsx("span",{className:"rounded-sm border border-line-strong px-1 text-[9px] text-ink-secondary",children:g}),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(Ic,{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: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",u.url===t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("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} · ${Rt(u.agentCommand)}`:Rt(u.agentCommand))]}),d.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:Ar(u.startedAt)})]})},u.url))}),d.jsxs(Ic,{children:["saved · ",h.length," session",h.length===1?"":"s"]}),h.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":y.length>0?"no live-captured sessions yet":"all saved sessions are currently live"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:h.map(u=>d.jsx(uy,{s:u,activeUrl:t,onPick:x=>{e(x),a(!1)}},u.id))}),(y.length>0||r.some(u=>u.imported_at!==null))&&d.jsxs(d.Fragment,{children:[d.jsxs(Ic,{children:["imported · ",y.length," file",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:"no imported files"}):d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:y.map(u=>d.jsx(uy,{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 Ic({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 uy({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 TS(e.id),r&&at.getState().setSelected(null),await Xu()}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 Oc=[{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 DO(){const e=Id(s=>s.mode),t=Id(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=Oc.find(s=>s.mode===e)??Oc[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:Oc.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 zO({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),v=ne(b=>b.lastError),h=ne(b=>b.messages.length>0?b.messages[b.messages.length-1].timestamp:null),y=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.4.0"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[m&&(()=>{const{primary:b}=ql(m),g=o||r,p=m.endedAt!==null?m.endedAt:h??m.startedAt,u=g?Ar(m.startedAt,p):Ar(m.startedAt,y),x=h!==null?y-h:null,S=!g&&x!==null&&x>5e3,T=_a(m.startedAt,y),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,y)}),u&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-muted",title:g?"capture duration (start → end of recorded session)":"how long the proxy process has been alive",children:[g?"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 ${_a(h,y)}`,children:["idle ",Ar(h,y)]})]})]})})(),d.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&d.jsx(LO,{onSelect:i,activeUrl:n,overrideUrl:t}),d.jsx(FO,{status:f,wsUrl:e,lastError:v,isReplay:o,isImported:r,onReconnect:$S})]}),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(UO,{...s?{onImportResult:s}:{}})]}),d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsx(DO,{})})]})]})}function FO({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",v=e==="idle"||e==="closed"||e==="error",y=n||(e==="open"?`${o?"serving a recorded session from the local store":"connected to a live proxy capture"} · ${t}`:v?`click to reconnect · ${t}`:t);return d.jsxs("button",{type:"button",onClick:v?i:void 0,disabled:!v,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],v?"cursor-pointer hover:bg-surface-rowHover":"cursor-default"),title:y,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=YN(),BO=ur?new URLSearchParams(typeof window<"u"?window.location.search:"").get("url"):null;function HO(){const e=at(w=>w.captures),t=at(w=>w.selectedUrl),n=at(w=>w.setSelected),o=ne(w=>{var k;return((k=w.session)==null?void 0:k.importedAt)??null}),r=t,i=Qu(t),s=o!==null;I.useEffect(()=>ur?void 0:IS(),[]),I.useEffect(()=>AS(),[]);const[a,l]=I.useState(null),c=I.useRef(new Set);I.useEffect(()=>{const w=yh(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.playhead!==null&&(N.playback={...k.playback,playhead:w.playhead}),Object.keys(N).length>0&&ne.setState(N),w.captureUrl&&at.getState().setSelected(w.captureUrl)},[]);const[f,m]=I.useState(!1),[v,h]=I.useState(!1),[y,b]=I.useState(!1);I.useEffect(()=>{const w=()=>{const H=ne.getState(),R=at.getState();rC({filters:H.filters,selectedSeq:H.selectedSeq,detailTab:H.detailTab,playhead:H.playback.playhead,captureUrl:R.selectedUrl})},k=ne.subscribe(w),N=at.subscribe(w);return w(),()=>{k(),N()}},[]);const g=()=>{f||(window.history.pushState({drawer:"info"},"",window.location.href),m(!0))},p=()=>{v||(window.history.pushState({drawer:"perf"},"",window.location.href),h(!0))},u=()=>{y||(window.history.pushState({drawer:"diff"},"",window.location.href),b(!0))},x=()=>{f&&window.history.back()},S=()=>{v&&window.history.back()},T=()=>{y&&window.history.back()},C=w=>{window.history.pushState({drawer:null},"",window.location.href),ne.getState().select(w),m(!1),h(!1),b(!1)};I.useEffect(()=>{const w=k=>{const N=k.state;m((N==null?void 0:N.drawer)==="info"),h((N==null?void 0:N.drawer)==="perf"),b((N==null?void 0:N.drawer)==="diff");const H=yh(window.location.search),R=ne.getState(),X=at.getState(),ie={};Object.keys(H.filters).length>0&&(ie.filters={...R.filters,...H.filters}),ie.selectedSeq=H.selectedSeq,ie.detailTab=H.detailTab??"tree",ie.playback={...R.playback,playhead:H.playhead},ne.setState(ie),H.captureUrl!==X.selectedUrl&&H.captureUrl&&X.setSelected(H.captureUrl)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),I.useEffect(()=>{const w=new Set(e.map(X=>X.url));if(c.current=c.current,i){c.current=w;return}const k=e[0]??null,N=t===null,H=t!==null&&w.has(t),R=k!==null&&!c.current.has(k.url)&&c.current.size>0;e.length===0?t!==null&&n(null):N||!H?n(k.url):R&&k.url!==t&&(n(k.url),l({message:`switched → ${nf(k)}`,tone:"success"})),c.current=w},[e,t,n,i]),I.useEffect(()=>{if(!a)return;let w=3e3,k=Date.now(),N=null;const H=()=>{N===null&&document.visibilityState==="visible"&&(k=Date.now(),N=setTimeout(()=>l(null),w))},R=()=>{N!==null&&(clearTimeout(N),N=null,w=Math.max(0,w-(Date.now()-k)))},X=()=>{document.visibilityState==="visible"?H():R()};return document.addEventListener("visibilitychange",X),H(),()=>{document.removeEventListener("visibilitychange",X),N&&clearTimeout(N)}},[a]),I.useEffect(()=>{if(ur){Ed();return}if(!r){Ed();return}Ju(r)},[r]);const[$,j]=I.useState(!1);I.useEffect(()=>{const w=k=>{if((k.metaKey||k.ctrlKey)&&(k.key==="k"||k.key==="K")){k.preventDefault(),j(H=>!H);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"){py(1);return}if(k.key==="k"||k.key==="K"){py(-1);return}}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[$]);const A=ne(w=>w.messages),E=ne(w=>w.session),q=ne(w=>w.selectedSeq),z=ne(w=>w.connection),U=ne(w=>w.lastError);I.useEffect(()=>{const w="ACP Devtools";if(!E){document.title=w;return}const{primary:k,secondary:N}=ql(E),H=N?`${k} · ${N}`:k;document.title=`${H} — ${w}`},[E]);const L=I.useMemo(()=>bS(A,q),[A,q]),F=I.useMemo(()=>{const w=Cl(A),k=new Map;for(const[N,H]of w.entries())k.set(H,N);return{responseToRequest:w,requestToResponse:k}},[A]),G=I.useMemo(()=>tf(A),[A]);let Y,D=null;if(L){if(L.kind==="response"||L.kind==="error"){const w=F.responseToRequest.get(L.seq);w!==void 0&&(D=A.find(k=>k.seq===w)??null,D&&(Y=L.timestamp-D.timestamp))}else if(L.kind==="request"){const w=F.requestToResponse.get(L.seq);w!==void 0&&(D=A.find(k=>k.seq===w)??null,D&&(Y=D.timestamp-L.timestamp))}}const J=A.length===0&&!E,O=r??"no capture selected",_=ur&&J,M=!ur&&J&&r===null&&e.length===0,P=!ur&&J&&!M;return d.jsxs("div",{className:"flex h-full flex-col bg-surface-base text-ink-primary",children:[d.jsx(qO,{message:(a==null?void 0:a.message)??null,tone:(a==null?void 0:a.tone)??"info"}),d.jsx(JC,{open:$,onClose:()=>j(!1)}),d.jsx(UP,{open:f,onClose:x}),d.jsx(kP,{open:v,onClose:S,onNavigateToSeq:C}),d.jsx(LE,{open:y,onClose:T}),d.jsx(zO,{wsUrl:O,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:g,onOpenPerf:p,onOpenDiff:u}),d.jsx(tP,{}),d.jsx("main",{className:"flex-1 overflow-hidden",children:_?d.jsx(AP,{initialUrl:BO}):M?d.jsx(ZE,{status:z,lastError:U,url:O,captureCount:e.length}):P?d.jsx(ZC,{status:z,url:O,lastError:U}):d.jsx(FP,{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(OO,{})}),(i||s)&&d.jsx(qP,{})]}),right:d.jsx(hE,{message:L,...Y!==void 0?{latencyMs:Y}:{},...D?{pairedRequest:D}:{},...L?(()=>{const w=G.get(L.seq);return w?{validation:w}:{}})():{},onJumpToPaired:w=>ne.getState().select(w)})})}),d.jsx(BP,{})]})}function py(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 Mx=document.getElementById("root");if(!Mx)throw new Error("#root not found");Rc.createRoot(Mx).render(d.jsx(te.StrictMode,{children:d.jsx(HO,{})}));
|
|
1768
|
-
//# sourceMappingURL=index-
|
|
1764
|
+
depsCount: ${d},
|
|
1765
|
+
deps: ${p}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[d,p]=i(l);s(l,d),a(l,p)}};function i({schema:l}){const d={},p={};for(const m in l){if(m==="__proto__")continue;const v=Array.isArray(l[m])?d:p;v[m]=l[m]}return[d,p]}function s(l,d=l.schema){const{gen:p,data:m,it:v}=l;if(Object.keys(d).length===0)return;const h=p.let("missing");for(const y in d){const b=d[y];if(b.length===0)continue;const g=(0,o.propertyInData)(p,m,y,v.opts.ownProperties);l.setParams({property:y,depsCount:b.length,deps:b.join(", ")}),v.allErrors?p.if(g,()=>{for(const f of b)(0,o.checkReportMissingProp)(l,f)}):(p.if((0,t._)`${g} && (${(0,o.checkMissingProp)(l,b,h)})`),(0,o.reportMissingProp)(l,h),p.else())}}e.validatePropertyDeps=s;function a(l,d=l.schema){const{gen:p,data:m,keyword:v,it:h}=l,y=p.name("valid");for(const b in d)(0,n.alwaysValidSchema)(h,d[b])||(p.if((0,o.propertyInData)(p,m,b,h.opts.ownProperties),()=>{const g=l.subschema({keyword:v,schemaProp:b},y);l.mergeValidEvaluated(g,y)},()=>p.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=r})(Rl);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});const Rb=ue,M1=Q,q1={message:"property name must be valid",params:({params:e})=>(0,Rb._)`{propertyName: ${e.propertyName}}`},U1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:q1,code(e){const{gen:t,schema:n,data:o,it:r}=e;if((0,M1.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,Rb.not)(i),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(i)}};Ip.default=U1;var Al={};Object.defineProperty(Al,"__esModule",{value:!0});const Zs=ye,en=ue,L1=Dt,ea=Q,D1={message:"must NOT have additional properties",params:({params:e})=>(0,en._)`{additionalProperty: ${e.additionalProperty}}`},z1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:D1,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 d=(0,Zs.allSchemaProperties)(o.properties),p=(0,Zs.allSchemaProperties)(o.patternProperties);m(),e.ok((0,en._)`${i} === ${L1.default.errors}`);function m(){t.forIn("key",r,g=>{!d.length&&!p.length?y(g):t.if(v(g),()=>y(g))})}function v(g){let f;if(d.length>8){const u=(0,ea.schemaRefOrVal)(s,o.properties,"properties");f=(0,Zs.isOwnProperty)(t,u,g)}else d.length?f=(0,en.or)(...d.map(u=>(0,en._)`${g} === ${u}`)):f=en.nil;return p.length&&(f=(0,en.or)(f,...p.map(u=>(0,en._)`${(0,Zs.usePattern)(e,u)}.test(${g})`))),(0,en.not)(f)}function h(g){t.code((0,en._)`delete ${r}[${g}]`)}function y(g){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){h(g);return}if(n===!1){e.setParams({additionalProperty:g}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,ea.alwaysValidSchema)(s,n)){const f=t.name("valid");l.removeAdditional==="failing"?(b(g,f,!1),t.if((0,en.not)(f),()=>{e.reset(),h(g)})):(b(g,f),a||t.if((0,en.not)(f),()=>t.break()))}}function b(g,f,u){const x={keyword:"additionalProperties",dataProp:g,dataPropType:ea.Type.Str};u===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,f)}}};Al.default=z1;var Op={};Object.defineProperty(Op,"__esModule",{value:!0});const F1=ln,Zm=ye,wc=Q,eh=Al,B1={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&&eh.default.code(new F1.KeywordCxt(i,eh.default,"additionalProperties"));const s=(0,Zm.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)d(m)?p(m):(t.if((0,Zm.propertyInData)(t,r,m,i.opts.ownProperties)),p(m),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(l);function d(m){return i.opts.useDefaults&&!i.compositeRule&&n[m].default!==void 0}function p(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},l)}}};Op.default=B1;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});const th=ye,ta=ue,nh=Q,oh=Q,H1={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,th.allSchemaProperties)(n),l=a.filter(b=>(0,nh.alwaysValidSchema)(i,n[b]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const d=s.strictSchema&&!s.allowMatchingProperties&&r.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof ta.Name)&&(i.props=(0,oh.evaluatedPropsToName)(t,i.props));const{props:m}=i;v();function v(){for(const b of a)d&&h(b),i.allErrors?y(b):(t.var(p,!0),y(b),t.if(p))}function h(b){for(const g in d)new RegExp(b).test(g)&&(0,nh.checkStrictMode)(i,`property ${g} matches pattern ${b} (use allowMatchingProperties)`)}function y(b){t.forIn("key",o,g=>{t.if((0,ta._)`${(0,th.usePattern)(e,b)}.test(${g})`,()=>{const f=l.includes(b);f||e.subschema({keyword:"patternProperties",schemaProp:b,dataProp:g,dataPropType:oh.Type.Str},p),i.opts.unevaluated&&m!==!0?t.assign((0,ta._)`${m}[${g}]`,!0):!f&&!i.allErrors&&t.if((0,ta.not)(p),()=>t.break())})})}}};Rp.default=H1;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});const V1=Q,W1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,V1.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"}};Ap.default=W1;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});const K1=ye,G1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:K1.validateUnion,error:{message:"must match a schema in anyOf"}};Mp.default=G1;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});const Sa=ue,J1=Q,Q1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Sa._)`{passingSchemas: ${e.passing}}`},Y1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Q1,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(d),e.result(s,()=>e.reset(),()=>e.error(!0));function d(){i.forEach((p,m)=>{let v;(0,J1.alwaysValidSchema)(r,p)?t.var(l,!0):v=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),v&&e.mergeEvaluated(v,Sa.Name)})})}}};qp.default=Y1;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});const X1=Q,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,X1.alwaysValidSchema)(o,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},r);e.ok(r),e.mergeEvaluated(a)})}};Up.default=Z1;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});const sl=ue,Ab=Q,e_={message:({params:e})=>(0,sl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,sl._)`{failingKeyword: ${e.ifClause}}`},t_={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:e_,code(e){const{gen:t,parentSchema:n,it:o}=e;n.then===void 0&&n.else===void 0&&(0,Ab.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const r=rh(o,"then"),i=rh(o,"else");if(!r&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),r&&i){const p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,d("then",p),d("else",p))}else r?t.if(a,d("then")):t.if((0,sl.not)(a),d("else"));e.pass(s,()=>e.error(!0));function l(){const p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function d(p,m){return()=>{const v=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(v,s),m?t.assign(m,(0,sl._)`${p}`):e.setParams({ifClause:p})}}}};function rh(e,t){const n=e.schema[t];return n!==void 0&&!(0,Ab.alwaysValidSchema)(e,n)}Lp.default=t_;var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});const n_=Q,o_={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,n_.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Dp.default=o_;Object.defineProperty(Np,"__esModule",{value:!0});const r_=Zr,i_=Cp,s_=ei,a_=Ep,l_=Pp,c_=Rl,d_=Ip,u_=Al,p_=Op,f_=Rp,m_=Ap,h_=Mp,y_=qp,g_=Up,v_=Lp,b_=Dp;function x_(e=!1){const t=[m_.default,h_.default,y_.default,g_.default,v_.default,b_.default,d_.default,u_.default,c_.default,p_.default,f_.default];return e?t.push(i_.default,a_.default):t.push(r_.default,s_.default),t.push(l_.default),t}Np.default=x_;var zp={},ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.dynamicAnchor=void 0;const Sc=ue,w_=Dt,ih=xt,S_=zn,$_={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Mb(e,e.schema)};function Mb(e,t){const{gen:n,it:o}=e;o.schemaEnv.root.dynamicAnchors[t]=!0;const r=(0,Sc._)`${w_.default.dynamicAnchors}${(0,Sc.getProperty)(t)}`,i=o.errSchemaPath==="#"?o.validateName:k_(e);n.if((0,Sc._)`!${r}`,()=>n.assign(r,i))}ti.dynamicAnchor=Mb;function k_(e){const{schemaEnv:t,schema:n,self:o}=e.it,{root:r,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=o.opts,d=new ih.SchemaEnv({schema:n,schemaId:l,root:r,baseId:i,localRefs:s,meta:a});return ih.compileSchema.call(o,d),(0,S_.getValidate)(e,d)}ti.default=$_;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.dynamicRef=void 0;const sh=ue,T_=Dt,ah=zn,__={keyword:"$dynamicRef",schemaType:"string",code:e=>qb(e,e.schema)};function qb(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 d=n.let("_v",(0,sh._)`${T_.default.dynamicAnchors}${(0,sh.getProperty)(i)}`);n.if(d,a(d,l),a(r.validateName,l))}else a(r.validateName,l)()}function a(l,d){return d?()=>n.block(()=>{(0,ah.callRef)(e,l),n.let(d,!0)}):()=>(0,ah.callRef)(e,l)}}ni.dynamicRef=qb;ni.default=__;var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});const j_=ti,N_=Q,C_={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,j_.dynamicAnchor)(e,""):(0,N_.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Fp.default=C_;var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});const E_=ni,P_={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,E_.dynamicRef)(e,e.schema)};Bp.default=P_;Object.defineProperty(zp,"__esModule",{value:!0});const I_=ti,O_=ni,R_=Fp,A_=Bp,M_=[I_.default,O_.default,R_.default,A_.default];zp.default=M_;var Hp={},Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});const lh=Rl,q_={keyword:"dependentRequired",type:"object",schemaType:"object",error:lh.error,code:e=>(0,lh.validatePropertyDeps)(e)};Vp.default=q_;var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});const U_=Rl,L_={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,U_.validateSchemaDeps)(e)};Wp.default=L_;var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});const D_=Q,z_={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,D_.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Kp.default=z_;Object.defineProperty(Hp,"__esModule",{value:!0});const F_=Vp,B_=Wp,H_=Kp,V_=[F_.default,B_.default,H_.default];Hp.default=V_;var Gp={},Jp={};Object.defineProperty(Jp,"__esModule",{value:!0});const Xn=ue,ch=Q,W_=Dt,K_={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Xn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},G_={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:K_,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(d(a,m),()=>l(m)))):a!==!0&&t.forIn("key",o,m=>a===void 0?l(m):t.if(p(a,m),()=>l(m))),i.props=!0,e.ok((0,Xn._)`${r} === ${W_.default.errors}`);function l(m){if(n===!1){e.setParams({unevaluatedProperty:m}),e.error(),s||t.break();return}if(!(0,ch.alwaysValidSchema)(i,n)){const v=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:ch.Type.Str},v),s||t.if((0,Xn.not)(v),()=>t.break())}}function d(m,v){return(0,Xn._)`!${m} || !${m}[${v}]`}function p(m,v){const h=[];for(const y in m)m[y]===!0&&h.push((0,Xn._)`${v} !== ${y}`);return(0,Xn.and)(...h)}}};Jp.default=G_;var Qp={};Object.defineProperty(Qp,"__esModule",{value:!0});const Ro=ue,dh=Q,J_={message:({params:{len:e}})=>(0,Ro.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ro._)`{limit: ${e}}`},Q_={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:J_,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,dh.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,d){t.forRange("i",d,s,p=>{e.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:dh.Type.Num},l),r.allErrors||t.if((0,Ro.not)(l),()=>t.break())})}}};Qp.default=Q_;Object.defineProperty(Gp,"__esModule",{value:!0});const Y_=Jp,X_=Qp,Z_=[Y_.default,X_.default];Gp.default=Z_;var Yp={},Xp={};Object.defineProperty(Xp,"__esModule",{value:!0});const We=ue,ej={message:({schemaCode:e})=>(0,We.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,We._)`{format: ${e}}`},tj={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ej,code(e,t){const{gen:n,data:o,$data:r,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:d,schemaEnv:p,self:m}=a;if(!l.validateFormats)return;r?v():h();function v(){const y=n.scopeValue("formats",{ref:m.formats,code:l.code.formats}),b=n.const("fDef",(0,We._)`${y}[${s}]`),g=n.let("fType"),f=n.let("format");n.if((0,We._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>n.assign(g,(0,We._)`${b}.type || "string"`).assign(f,(0,We._)`${b}.validate`),()=>n.assign(g,(0,We._)`"string"`).assign(f,b)),e.fail$data((0,We.or)(u(),x()));function u(){return l.strictSchema===!1?We.nil:(0,We._)`${s} && !${f}`}function x(){const S=p.$async?(0,We._)`(${b}.async ? await ${f}(${o}) : ${f}(${o}))`:(0,We._)`${f}(${o})`,T=(0,We._)`(typeof ${f} == "function" ? ${S} : ${f}.test(${o}))`;return(0,We._)`${f} && ${f} !== true && ${g} === ${t} && !${T}`}}function h(){const y=m.formats[i];if(!y){u();return}if(y===!0)return;const[b,g,f]=x(y);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 "${d}"`}}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 y=="object"&&!(y instanceof RegExp)&&y.async){if(!p.$async)throw new Error("async format in sync schema");return(0,We._)`await ${f}(${o})`}return typeof g=="function"?(0,We._)`${f}(${o})`:(0,We._)`${f}.test(${o})`}}}};Xp.default=tj;Object.defineProperty(Yp,"__esModule",{value:!0});const nj=Xp,oj=[nj.default];Yp.default=oj;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.contentVocabulary=Gr.metadataVocabulary=void 0;Gr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(fp,"__esModule",{value:!0});const rj=mp,ij=yp,sj=Np,aj=zp,lj=Hp,cj=Gp,dj=Yp,uh=Gr,uj=[aj.default,rj.default,ij.default,(0,sj.default)(!0),dj.default,uh.metadataVocabulary,uh.contentVocabulary,lj.default,cj.default];fp.default=uj;var Zp={},Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});Ml.DiscrError=void 0;var ph;(function(e){e.Tag="tag",e.Mapping="mapping"})(ph||(Ml.DiscrError=ph={}));Object.defineProperty(Zp,"__esModule",{value:!0});const dr=ue,Dd=Ml,fh=xt,pj=Xr,fj=Q,mj={message:({params:{discrError:e,tagName:t}})=>e===Dd.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}}`},hj={keyword:"discriminator",type:"object",schemaType:"object",error:mj,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),d=t.const("tag",(0,dr._)`${n}${(0,dr.getProperty)(a)}`);t.if((0,dr._)`typeof ${d} == "string"`,()=>p(),()=>e.error(!1,{discrError:Dd.DiscrError.Tag,tag:d,tagName:a})),e.ok(l);function p(){const h=v();t.if(!1);for(const y in h)t.elseIf((0,dr._)`${d} === ${y}`),t.assign(l,m(h[y]));t.else(),e.error(!1,{discrError:Dd.DiscrError.Mapping,tag:d,tagName:a}),t.endIf()}function m(h){const y=t.name("valid"),b=e.subschema({keyword:"oneOf",schemaProp:h},y);return e.mergeEvaluated(b,dr.Name),y}function v(){var h;const y={},b=f(r);let g=!0;for(let S=0;S<s.length;S++){let T=s[S];if(T!=null&&T.$ref&&!(0,fj.schemaHasRulesButRef)(T,i.self.RULES)){const $=T.$ref;if(T=fh.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,$),T instanceof fh.SchemaEnv&&(T=T.schema),T===void 0)throw new pj.default(i.opts.uriResolver,i.baseId,$)}const C=(h=T==null?void 0:T.properties)===null||h===void 0?void 0:h[a];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(b||f(T)),u(C,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return y;function f({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 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 y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[S]=T}}}};Zp.default=hj;var ef={};const yj="https://json-schema.org/draft/2020-12/schema",gj="https://json-schema.org/draft/2020-12/schema",vj={"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},bj="meta",xj="Core and Validation specifications meta-schema",wj=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],Sj=["object","boolean"],$j="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",kj={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}},Tj={$schema:yj,$id:gj,$vocabulary:vj,$dynamicAnchor:bj,title:xj,allOf:wj,type:Sj,$comment:$j,properties:kj},_j="https://json-schema.org/draft/2020-12/schema",jj="https://json-schema.org/draft/2020-12/meta/applicator",Nj={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Cj="meta",Ej="Applicator vocabulary meta-schema",Pj=["object","boolean"],Ij={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"}},Oj={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Rj={$schema:_j,$id:jj,$vocabulary:Nj,$dynamicAnchor:Cj,title:Ej,type:Pj,properties:Ij,$defs:Oj},Aj="https://json-schema.org/draft/2020-12/schema",Mj="https://json-schema.org/draft/2020-12/meta/unevaluated",qj={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},Uj="meta",Lj="Unevaluated applicator vocabulary meta-schema",Dj=["object","boolean"],zj={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},Fj={$schema:Aj,$id:Mj,$vocabulary:qj,$dynamicAnchor:Uj,title:Lj,type:Dj,properties:zj},Bj="https://json-schema.org/draft/2020-12/schema",Hj="https://json-schema.org/draft/2020-12/meta/content",Vj={"https://json-schema.org/draft/2020-12/vocab/content":!0},Wj="meta",Kj="Content vocabulary meta-schema",Gj=["object","boolean"],Jj={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Qj={$schema:Bj,$id:Hj,$vocabulary:Vj,$dynamicAnchor:Wj,title:Kj,type:Gj,properties:Jj},Yj="https://json-schema.org/draft/2020-12/schema",Xj="https://json-schema.org/draft/2020-12/meta/core",Zj={"https://json-schema.org/draft/2020-12/vocab/core":!0},eN="meta",tN="Core vocabulary meta-schema",nN=["object","boolean"],oN={$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"}}},rN={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},iN={$schema:Yj,$id:Xj,$vocabulary:Zj,$dynamicAnchor:eN,title:tN,type:nN,properties:oN,$defs:rN},sN="https://json-schema.org/draft/2020-12/schema",aN="https://json-schema.org/draft/2020-12/meta/format-annotation",lN={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},cN="meta",dN="Format vocabulary meta-schema for annotation results",uN=["object","boolean"],pN={format:{type:"string"}},fN={$schema:sN,$id:aN,$vocabulary:lN,$dynamicAnchor:cN,title:dN,type:uN,properties:pN},mN="https://json-schema.org/draft/2020-12/schema",hN="https://json-schema.org/draft/2020-12/meta/meta-data",yN={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},gN="meta",vN="Meta-data vocabulary meta-schema",bN=["object","boolean"],xN={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}},wN={$schema:mN,$id:hN,$vocabulary:yN,$dynamicAnchor:gN,title:vN,type:bN,properties:xN},SN="https://json-schema.org/draft/2020-12/schema",$N="https://json-schema.org/draft/2020-12/meta/validation",kN={"https://json-schema.org/draft/2020-12/vocab/validation":!0},TN="meta",_N="Validation vocabulary meta-schema",jN=["object","boolean"],NN={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"}}},CN={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:[]}},EN={$schema:SN,$id:$N,$vocabulary:kN,$dynamicAnchor:TN,title:_N,type:jN,properties:NN,$defs:CN};Object.defineProperty(ef,"__esModule",{value:!0});const PN=Tj,IN=Rj,ON=Fj,RN=Qj,AN=iN,MN=fN,qN=wN,UN=EN,LN=["/properties"];function DN(e){return[PN,IN,ON,RN,AN,t(this,MN),qN,t(this,UN)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,o){return e?n.$dataMetaSchema(o,LN):o}}ef.default=DN;(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=Av,o=fp,r=Zp,i=ef,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:y}=this.opts;y&&(i.default.call(this,h),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 d=ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=Cs;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var m=Xr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(Od,Od.exports);var zN=Od.exports;const FN=Yd(zN),mh=FN,BN=mh.default??mh,hh="acp",HN=/will be required/i;function VN(e){const t={path:e.instancePath||"/",message:e.message??"validation failed"};return e.keyword&&(t.keyword=e.keyword),t}function WN(e){const t=new BN({strict:!1,allErrors:!0,validateFormats:!1});t.addSchema(e,hh);const n=new Map,o=new Map,r=e.$defs??{};for(const[p,m]of Object.entries(r)){const v=Object.entries(m.properties??{}).filter(([,b])=>HN.test(b.description??"")).map(([b])=>b);v.length>0&&o.set(p,v);const h=m["x-method"];if(typeof h!="string")continue;let y=n.get(h);y||(y={},n.set(h,y)),p.endsWith("Request")?y.requestDef=p:p.endsWith("Response")?y.responseDef=p:p.endsWith("Notification")&&(y.notificationDef=p)}const i=new Map,s=p=>{const m=i.get(p);if(m)return m;const v=t.compile({$ref:`${hh}#/$defs/${p}`});return i.set(p,v),v};function a(p,m={}){if(!p.payload)return{valid:!0,errors:[],skipped:"parse-error"};if(p.kind==="unknown")return{valid:!0,errors:[],skipped:"wrong-kind"};const v=p.method??m.pairedMethod;if(!v)return{valid:!0,errors:[],skipped:"no-method"};const h=n.get(v);if(!h)return{valid:!0,errors:[],skipped:"unknown-method"};let y,b;const g=p.payload;if(p.kind==="request")y=h.requestDef,b=g.params;else if(p.kind==="notification")y=h.notificationDef,b=g.params;else if(p.kind==="response")y=h.responseDef,b=g.result;else return{valid:!0,errors:[],skipped:"wrong-kind"};if(!y)return{valid:!0,errors:[],skipped:"no-schema-for-kind"};const f=l(y,b),u=s(y),S=u(b)?{valid:!0,errors:[],schemaName:y}:{valid:!1,errors:(u.errors??[]).map(VN),schemaName:y};return f.length>0&&(S.advisories=f),S}function l(p,m){const v=o.get(p);if(!v||typeof m!="object"||m===null)return[];const h=m,y=[];for(const b of v)(h[b]===void 0||h[b]===null)&&y.push({path:b,message:`missing ${b} — will be required in a future ACP version`,kind:"soon-required"});return y}function d(){return[...n.keys()].sort()}return{validateAcpMessage:a,knownAcpMethods:d}}const KN=WN(Rv),GN=KN.validateAcpMessage;function tf(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,GN(r,a))}return o}function JN(e){let t=0,n=0,o=0,r=0,i=0;const s=new Set;for(const[,a]of e)if(!a.skipped){if(t+=1,!a.valid&&(n+=1,o+=a.errors.length,a.schemaName)){const l=a.schemaName.replace(/(Request|Response|Notification)$/,"");s.add(l)}a.advisories&&a.advisories.length>0&&(r+=1,i+=a.advisories.length)}return{checked:t,invalidFrames:n,totalErrors:o,affectedMethods:[...s].sort(),advisoryFrames:r,totalAdvisories:i}}const QN={"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},junie:{shortName:"junie",displayName:"Junie",description:"JetBrains Junie CLI — install separately, then this runs `junie --acp=true`",command:"junie",args:["--acp=true"],requiresExternalInstall:!0}};function YN(e){const t=e.trim();if(t.length===0)return null;const n=[t,XN(t)];for(const o of Object.values(QN)){const r=[[o.command,...o.args],...o.aliases??[]];for(const i of r){const s=i.join(" ");for(const a of n)if(a===s||a.startsWith(s+" "))return o}}return null}function XN(e){const t=e.indexOf(" "),n=t===-1?e:e.slice(0,t),o=t===-1?"":e.slice(t);return(n.split(/[/\\]/).pop()??n)+o}function Rt(e){const t=YN(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].split(/[/\\]/).pop()||n[0]}function nf(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 ZN={};function eC(){const e=ZN;return(e==null?void 0:e.VITE_PLAYGROUND)==="1"}const tC={"editor-to-agent":"out","agent-to-editor":"in"},nC={out:"editor-to-agent",in:"agent-to-editor"},oC={request:"req",response:"rsp",notification:"ntf",error:"err",unknown:"unk"},rC={req:"request",rsp:"response",ntf:"notification",err:"error",unk:"unknown"},iC=["tree","raw","meta"];function yh(e){const t=new URLSearchParams(e),n={},o=t.get("dir");if(o!==null){const y=o.split(",").map(b=>b.trim()).filter(Boolean).map(b=>nC[b]).filter(b=>b!==void 0);y.length>0&&(n.directions=new Set(y))}const r=t.get("kind");if(r!==null){const y=r.split(",").map(b=>b.trim()).filter(Boolean).map(b=>rC[b]).filter(b=>b!==void 0);y.length>0&&(n.kinds=new Set(y))}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"),d=l!==null&&iC.includes(l)?l:null,p=t.get("play"),m=p!==null&&/^\d+$/.test(p)?Number(p):null,v=t.get("ws");return{filters:n,selectedSeq:a,detailTab:d,playhead:m,captureUrl:v}}const sC=["ws","dir","kind","streams","q","seq","tab","play"];function aC(e){const t=new URLSearchParams(window.location.search);for(const r of sC)t.delete(r);e.captureUrl&&t.set("ws",e.captureUrl),e.filters.directions.size<cs.length&&t.set("dir",[...e.filters.directions].map(r=>tC[r]).filter(Boolean).join(",")),e.filters.kinds.size<ds.length&&t.set("kind",[...e.filters.kinds].map(r=>oC[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.playhead!==null&&t.set("play",String(e.playhead));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 Ub(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=Ub(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function lC(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Ub(e))&&(o&&(o+=" "),o+=t);return o}const of="-",cC=e=>{const t=uC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(of);return a[0]===""&&a.length!==1&&a.shift(),Lb(a,t)||dC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&o[s]?[...l,...o[s]]:l}}},Lb=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Lb(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(of);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},gh=/^\[(.+)\]$/,dC=e=>{if(gh.test(e)){const t=gh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},uC=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return fC(Object.entries(e.classGroups),n).forEach(([i,s])=>{zd(s,o,i,t)}),o},zd=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:vh(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(pC(r)){zd(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{zd(s,vh(t,i),n,o)})})},vh=(e,t)=>{let n=e;return t.split(of).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},pC=e=>e.isThemeGetter,fC=(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,mC=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)}}},Db="!",hC=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,s=a=>{const l=[];let d=0,p=0,m;for(let g=0;g<a.length;g++){let f=a[g];if(d===0){if(f===r&&(o||a.slice(g,g+i)===t)){l.push(a.slice(p,g)),p=g+i;continue}if(f==="/"){m=g;continue}}f==="["?d++:f==="]"&&d--}const v=l.length===0?a:a.substring(p),h=v.startsWith(Db),y=h?v.substring(1):v,b=m&&m>p?m-p:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},yC=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},gC=e=>({cache:mC(e.cacheSize),parseClassName:hC(e),...cC(e)}),vC=/\s+/,bC=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(vC);let a="";for(let l=s.length-1;l>=0;l-=1){const d=s[l],{modifiers:p,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:h}=n(d);let y=!!h,b=o(y?v.substring(0,h):v);if(!b){if(!y){a=d+(a.length>0?" "+a:a);continue}if(b=o(v),!b){a=d+(a.length>0?" "+a:a);continue}y=!1}const g=yC(p).join(":"),f=m?g+Db:g,u=f+b;if(i.includes(u))continue;i.push(u);const x=r(b,y);for(let S=0;S<x.length;++S){const T=x[S];i.push(f+T)}a=d+(a.length>0?" "+a:a)}return a};function xC(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zb(t))&&(o&&(o+=" "),o+=n);return o}const zb=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=zb(e[o]))&&(n&&(n+=" "),n+=t);return n};function wC(e,...t){let n,o,r,i=s;function s(l){const d=t.reduce((p,m)=>m(p),e());return n=gC(d),o=n.cache.get,r=n.cache.set,i=a,a(l)}function a(l){const d=o(l);if(d)return d;const p=bC(l,n);return r(l,p),p}return function(){return i(xC.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Fb=/^\[(?:([a-z-]+):)?(.+)\]$/i,SC=/^\d+\/\d+$/,$C=new Set(["px","full","screen"]),kC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TC=/\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$/,_C=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jn=e=>Rr(e)||$C.has(e)||SC.test(e),Jn=e=>oi(e,"length",MC),Rr=e=>!!e&&!Number.isNaN(Number(e)),$c=e=>oi(e,"number",Rr),vi=e=>!!e&&Number.isInteger(Number(e)),CC=e=>e.endsWith("%")&&Rr(e.slice(0,-1)),pe=e=>Fb.test(e),Qn=e=>kC.test(e),EC=new Set(["length","size","percentage"]),PC=e=>oi(e,EC,Bb),IC=e=>oi(e,"position",Bb),OC=new Set(["image","url"]),RC=e=>oi(e,OC,UC),AC=e=>oi(e,"",qC),bi=()=>!0,oi=(e,t,n)=>{const o=Fb.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},MC=e=>TC.test(e)&&!_C.test(e),Bb=()=>!1,qC=e=>jC.test(e),UC=e=>NC.test(e),LC=()=>{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"),d=Ie("grayscale"),p=Ie("hueRotate"),m=Ie("invert"),v=Ie("gap"),h=Ie("gradientColorStops"),y=Ie("gradientColorStopPositions"),b=Ie("inset"),g=Ie("margin"),f=Ie("opacity"),u=Ie("padding"),x=Ie("saturate"),S=Ie("scale"),T=Ie("sepia"),C=Ie("skew"),$=Ie("space"),j=Ie("translate"),A=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",pe,t],z=()=>[pe,t],U=()=>["",jn,Jn],L=()=>["auto",Rr,pe],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",pe],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[Rr,pe];return{cacheSize:500,separator:":",theme:{colors:[bi],spacing:[jn,Jn],blur:["none","",Qn,pe],brightness:_(),borderColor:[e],borderRadius:["none","","full",Qn,pe],borderSpacing:z(),borderWidth:U(),contrast:_(),grayscale:J(),hueRotate:_(),invert:J(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[CC,Jn],inset:q(),margin:q(),opacity:_(),padding:z(),saturate:_(),scale:_(),sepia:J(),skew:_(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[Qn]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...F(),pe]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],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",vi,pe]}],basis:[{basis:q()}],"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:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",vi,pe]}],"grid-cols":[{"grid-cols":[bi]}],"col-start-end":[{col:["auto",{span:["full",vi,pe]},pe]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[bi]}],"row-start-end":[{row:["auto",{span:[vi,pe]},pe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"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:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"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:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"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:[bi]}],"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":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"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:z()}],"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":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),IC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",PC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},RC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[f]}],"border-style":[{border:[...G(),"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":[f]}],"divide-style":[{divide:G()}],"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:["",...G()]}],"outline-offset":[{"outline-offset":[jn,pe]}],"outline-w":[{outline:[jn,Jn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[jn,Jn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qn,AC]}],"shadow-color":[{shadow:[bi]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Qn,pe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],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":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"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:[vi,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":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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"]}}},DC=wC(LC);function K(...e){return DC(lC(e))}const $a=1;function zC(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 FC(e,t=4){return JSON.stringify(e,null,t)+`
|
|
1766
|
+
`}class Ke extends Error{constructor(t){super(t),this.name="ExportParseError"}}function BC(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,d)=>HC(l,d));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 HC(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 Hb="<REDACTED>",VC=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 WC(e){if(e.payload==null)return{redacted:e,count:0};const{value:t,count:n}=Fd(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 Fd(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=Fd(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"&&VC.has(r.toLowerCase())){o[r]=Hb,n+=1;continue}if(t.inProxyConfig&&r==="headers"&&i!==null&&typeof i=="object"&&!Array.isArray(i)){const l=KC(i);o[r]=l.value,n+=l.count;continue}const s=t.inProxyConfig||r.toLowerCase()==="proxyconfig"?{inProxyConfig:!0}:t,a=Fd(i,s);o[r]=a.value,n+=a.count}return{value:o,count:n}}return{value:e,count:0}}function KC(e){let t=0;const n={};for(const[o,r]of Object.entries(e))typeof r=="string"?(n[o]=Hb,t+=1):n[o]=r;return{value:n,count:t}}function GC(e){let t=0,n=0;const o=e.messages.map(r=>{const i=WC(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 JC={name:"acp-devtools-ui",version:"0.6.0"};function QC(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 YC(e,t,n=Date.now()){const o=zC(e,t,{tool:JC,exportedAt:n}),{export:r}=GC(o);return FC(r)}function Vb(e,t,n=Date.now()){const o=YC(e,t,n),r=new Blob([o],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=QC(e,n),s.rel="noopener",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function XC({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 d=setTimeout(()=>{var p;return(p=s.current)==null?void 0:p.focus()},0);return()=>clearTimeout(d)},[e]);const a=I.useMemo(()=>ZC(),[t,e]),l=I.useMemo(()=>eE(a,n),[a,n]);return I.useEffect(()=>{r>=l.length&&i(0)},[l.length,r]),I.useEffect(()=>{if(!e)return;const d=p=>{if(p.key==="Escape"){p.preventDefault(),t();return}if(p.key==="ArrowDown"){p.preventDefault(),i(m=>l.length===0?0:(m+1)%l.length);return}if(p.key==="ArrowUp"){p.preventDefault(),i(m=>l.length===0?0:(m-1+l.length)%l.length);return}if(p.key==="Enter"){p.preventDefault();const m=l[r];m&&(m.run(),t())}};return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[e,l,r,t]),e?c.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:d=>{d.target===d.currentTarget&&t()},children:c.jsxs("div",{className:"w-[min(620px,92vw)] overflow-hidden rounded-md border border-line-strong bg-surface-elev shadow-2xl",children:[c.jsx("div",{className:"border-b border-line bg-surface-base/60",children:c.jsx("input",{ref:s,value:n,onChange:d=>{o(d.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"})}),c.jsxs("ul",{className:"max-h-[60vh] overflow-y-auto py-1",children:[l.length===0&&c.jsx("li",{className:"px-4 py-3 text-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no match"}),l.map((d,p)=>{const m=p===r,v=l[p-1],h=!v||v.section!==d.section;return c.jsxs("li",{children:[h&&c.jsx("div",{className:"px-4 pt-2 pb-1 font-mono text-[9px] uppercase tracking-widest text-ink-muted",children:d.section}),c.jsxs("button",{type:"button",onClick:()=>{d.run(),t()},onMouseEnter:()=>i(p),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:[c.jsx("span",{className:"truncate",children:d.label}),d.hint&&c.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:d.hint})]})]},d.id)})]})]})}):null}function ZC(e){const t=ne.getState(),n=at.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 Nv(i);await Xu(),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:()=>Vb(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(cs),kinds:new Set(ds),showStreams:!0,search:""};ne.setState({filters:r})}});for(const r of cs){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 ds){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: ${nf(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 eE(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 tE={idle:"idle",connecting:"connecting",open:"restoring view",closed:"disconnected",error:"connection error"};function nE({status:e,url:t,lastError:n}){const o=tE[e],r=e==="connecting"||e==="open";return c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-surface-base",children:c.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:[c.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")}),c.jsx("span",{children:o}),c.jsx("span",{className:"text-ink-dim",children:"·"}),c.jsx("span",{className:"lowercase tracking-normal text-ink-secondary",children:t}),n&&e==="error"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-ink-dim",children:"·"}),c.jsx("span",{className:"lowercase tracking-normal text-accent-error",children:n})]})]})})}function oE(e){const t=e.$defs??{},n=new Map;for(const[y,b]of Object.entries(t)){const g=b["x-method"];if(typeof g!="string")continue;let f=n.get(g);f||(f={},n.set(g,f)),y.endsWith("Request")?f.requestDef=y:y.endsWith("Response")?f.responseDef=y:y.endsWith("Notification")&&(f.notificationDef=y)}function o(y,b){var g,f,u;switch(y.kind){case"request":{const x=y.method;return x?((g=n.get(x))==null?void 0:g.requestDef)??null:null}case"notification":{const x=y.method;return x?((f=n.get(x))==null?void 0:f.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(y){return y==="request"||y==="notification"?"params":y==="response"?"result":y==="error"?"error":null}function i(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function s(y,b){const g=y.properties;if(!g)return!0;for(const[f,u]of Object.entries(g))if(!(!u||typeof u!="object")){if("const"in u){if(b[f]!==u.const)return!1}else if(Array.isArray(u.enum)&&!u.enum.includes(b[f]))return!1}return!0}function a(y,b){const g=y.type;if(typeof g=="string"){if(g==="null")return b===null;if(g==="string")return typeof b=="string";if(g==="boolean")return typeof b=="boolean";if(g==="number"||g==="integer")return typeof b=="number";if(g==="array")return Array.isArray(b);if(g==="object")return i(b)&&s(y,b)}return y.$ref||y.properties||y.allOf?i(b)&&s(y,b):!1}function l(y,b=void 0){if(!y)return null;if(y.$ref){const g=y.$ref.replace(/^#\/\$defs\//,""),f=t[g];return f?l(f,b):null}if(y.allOf&&y.allOf.length>0){const g={properties:{}};for(const f of y.allOf){const u=l(f,b);u!=null&&u.properties&&(g.properties={...g.properties,...u.properties}),u!=null&&u.type&&!g.type&&(g.type=u.type),u!=null&&u.items&&!g.items&&(g.items=u.items)}return y.description&&!g.description&&(g.description=y.description),g}if(y.anyOf||y.oneOf){const g=y.anyOf??y.oneOf;if(b!==void 0){for(const f of g)if(f.type!=="null"&&a(f,b))return l(f,b)}for(const f of g){if(f.type==="null")continue;const u=l(f,b);if(u)return u}return null}return y}function d(y,b){let g=y;for(const f of b){if(g==null)return;if(Array.isArray(g)&&/^\d+$/.test(f))g=g[Number(f)];else if(typeof g=="object")g=g[f];else return}return g}function p(y){if(!y)return;if(y.$ref)return y.$ref.replace(/^#\/\$defs\//,"");const b=y.type;if(typeof b=="string")return b;if(Array.isArray(b))return b.find(f=>f!=="null")}function m(y,b){const g=t[y];return{typeName:y,typeDescription:(g==null?void 0:g.description)??null,resolve(f){var A;if(f.length===0)return{inSpec:!0,isExtension:!1,description:g==null?void 0:g.description,type:y};const u=f.slice(1);if(u.length===0)return null;let x=!1,S=g??null;for(let E=0;E<u.length;E++){const q=u[E];q==="_meta"&&(x=!0);const z=/^\d+$/.test(q),U=d(b,f.slice(0,E+1));if(S=l(S,U),!S)return null;if(z){const F=d(b,f.slice(0,E+2));S=l(S.items,F);continue}if(x&&q!=="_meta")return{inSpec:!1,isExtension:!0};const L=(A=S.properties)==null?void 0:A[q];if(!L)return{inSpec:!1,isExtension:x};S=L}const T=d(b,f),C=l(S,T),$={inSpec:!0,isExtension:x};S!=null&&S.description?$.description=S.description:C!=null&&C.description&&($.description=C.description);const j=p(S??null)??p(C);return j&&($.type=j),C!=null&&C.enum&&($.enumValues=C.enum),$}}}function v(y,b={}){const g=o(y,b.pairedMethod);return!g||!r(y.kind)?null:m(g,y.payload)}function h(){return[...n.keys()].sort()}return{resolveForMessage:v,knownMethods:h}}const rE=oE(Rv),iE=rE.resolveForMessage,sE={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 Ar({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,d]=I.useState(null),p=l!==null,m=()=>{const y=s.current;if(!y)return null;const b=y.getBoundingClientRect(),f=window.innerHeight-b.bottom<120;return{top:f?b.top-8:b.bottom+8,left:Math.min(b.left,window.innerWidth-380),flipUp:f}},v=()=>{a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>{const y=m();y&&d(y)},n)},h=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),d(null)};return I.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),I.useEffect(()=>{if(!p)return;const y=()=>h();return window.addEventListener("scroll",y,!0),()=>window.removeEventListener("scroll",y,!0)},[p]),c.jsxs(c.Fragment,{children:[c.jsx("span",{ref:s,className:K("cursor-help",r),onMouseEnter:v,onMouseLeave:h,...i?{onFocus:v,onBlur:h,tabIndex:0}:{},children:t}),l&&Wu.createPortal(c.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",sE[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 aE=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function Ta(e){return aE.format(e)}function fs(e){const t=e%1e3;return`${Ta(e)}.${String(t).padStart(3,"0")}`}const lE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function cE(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(cE(n,o))return Ta(e);if(n.getFullYear()===o.getFullYear())return`${lE[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 dE(e){return e<250?"ok":e<1500?"warn":"error"}function Wb(e){return e==="editor-to-agent"?"OUT":"IN"}function Kb(e){return e==="editor-to-agent"?"→":"←"}const uE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function pE(e){const t=String(e);return uE.test(t)?t.slice(0,8)+"…":t.length>12?t.slice(0,10)+"…":t}function Mr(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 bh(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 fE=6;function xh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mE(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 hE(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=xh(e)||Array.isArray(e),a=xh(e)?Object.keys(e).length:Array.isArray(e)?e.length:0,l=o??(n<2&&a<=fE),[d,p]=I.useState(l),m=t!==void 0&&i?i(r):null,v=t!==void 0?c.jsx(yE,{name:t,spec:m}):null;if(!s)return c.jsxs("div",{className:"flex items-baseline gap-2 font-mono text-xs leading-relaxed",children:[v,c.jsx("span",{className:K("whitespace-pre-wrap break-all",mE(e)),children:hE(e)})]});const h=Array.isArray(e),y=h?"[":"{",b=h?"]":"}";return c.jsxs("div",{className:"font-mono text-xs leading-relaxed",children:[c.jsxs("button",{type:"button",onClick:()=>p(g=>!g),className:"group/expand flex items-baseline gap-2 text-left hover:text-ink-primary",children:[c.jsx("span",{"aria-hidden":!0,className:K("inline-block w-3 text-ink-muted transition-transform",d?"rotate-90":""),children:"▸"}),v,c.jsx("span",{className:"text-ink-secondary",children:y}),!d&&c.jsxs("span",{className:"text-ink-muted",children:[a," ",h?"items":"keys"]}),!d&&c.jsx("span",{className:"text-ink-secondary",children:b})]}),d&&c.jsxs("div",{className:"ml-3 border-l border-line-grid pl-3",children:[h?e.map((g,f)=>c.jsx(al,{value:g,name:String(f),depth:n+1,path:[...r,String(f)],...i?{getSpec:i}:{}},f)):Object.entries(e).map(([g,f])=>c.jsx(al,{value:f,name:g,depth:n+1,path:[...r,g],...i?{getSpec:i}:{}},g)),c.jsx("div",{className:"text-ink-secondary",children:b})]})]})}function yE({name:e,spec:t}){const n=/^\d+$/.test(e),o=(t==null?void 0:t.description)??null;return c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:K(n?"text-ink-muted":"text-ink-secondary"),children:n?`${e}:`:`"${e}":`}),t&&!t.inSpec&&c.jsx(wh,{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&&c.jsx(wh,{tone:"extension",explanation:"Extension — _meta payload is implementation-defined per ACP spec."}),o&&c.jsx(Ar,{label:c.jsx(gE,{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:c.jsx("span",{"aria-label":`spec: ${o.split(`
|
|
1767
|
+
`)[0]}`,children:"ⓘ"})})]})}function gE({text:e,type:t,enumValues:n}){return c.jsxs("div",{className:"space-y-1.5",children:[t&&c.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:c.jsx("span",{className:"text-accent-info",children:t})}),c.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:e}),n&&n.length>0&&c.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["enum: ",n.map(o=>JSON.stringify(o)).join(" · ")]})]})}function wh({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 c.jsx(Ar,{label:c.jsx("span",{className:"font-sans",children:t}),tone:e==="extension"?"warn":"error",focusable:!0,children:c.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 vE({message:e,latencyMs:t,pairedRequest:n,onJumpToPaired:o,validation:r}){var d;const i=ne(p=>p.detailTab),s=ne(p=>p.setDetailTab),a=I.useMemo(()=>{if(!e)return null;const p=(n==null?void 0:n.method)??void 0;return iE(e,p?{pairedMethod:p}:void 0)},[e,n]);if(!e)return c.jsx("div",{className:"flex h-full items-center justify-center bg-surface-elev/40",children:c.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 c.jsxs("div",{className:"flex h-full flex-col bg-surface-elev/30",children:[c.jsxs("header",{className:"border-b border-line bg-surface-elev px-5 py-3",children:[c.jsxs("div",{className:"flex items-baseline gap-3",children:[c.jsxs("span",{className:K("font-mono text-[11px] font-semibold tracking-widest",l?"text-accent-out":"text-accent-in"),children:[Kb(e.direction)," ",Wb(e.direction)]}),c.jsxs("span",{className:"font-mono text-xs text-ink-muted",children:["seq ",e.seq]}),c.jsx("span",{className:"font-mono text-xs text-ink-muted",children:fs(e.timestamp)})]}),c.jsx("h2",{className:"mt-1 truncate font-display text-lg uppercase tracking-tight text-ink-primary",children:e.method??e.kind}),c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[11px] text-ink-secondary",children:[c.jsx($E,{message:e,resolver:a}),e.rpcId!==void 0&&e.rpcId!==null&&c.jsx(ja,{label:"id",value:String(e.rpcId)}),c.jsx(ja,{label:"bytes",value:Ul(e.raw.length)}),t!==void 0&&c.jsx(ja,{label:"latency",value:`+${Vt(t)}`,accent:!0}),n&&c.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:[c.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:"paired"}),c.jsxs("span",{className:"text-ink-primary underline decoration-line-strong decoration-dotted underline-offset-4",children:["seq ",n.seq," ",n.method??""]})]})]})]}),c.jsxs("nav",{className:"flex gap-1 border-b border-line bg-surface-elev/70 px-4",children:[c.jsx(na,{active:i==="tree",onClick:()=>s("tree"),children:"Tree"}),c.jsx(na,{active:i==="raw",onClick:()=>s("raw"),children:"Raw"}),c.jsx(na,{active:i==="meta",onClick:()=>s("meta"),children:"Meta"}),c.jsx(na,{active:i==="spec",onClick:()=>s("spec"),badge:r&&!r.skipped&&!r.valid?r.errors.length:void 0,advisoryBadge:r&&!r.skipped&&((d=r.advisories)!=null&&d.length)?r.advisories.length:void 0,children:"Spec"})]}),c.jsxs("div",{className:"flex-1 overflow-auto px-5 py-4",children:[i==="tree"&&c.jsx(xE,{message:e,resolver:a}),i==="raw"&&c.jsx(wE,{raw:e.raw}),i==="meta"&&c.jsx(SE,{message:e}),i==="spec"&&c.jsx(bE,{validation:r})]})]})}function bE({validation:e}){if(!e)return c.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 c.jsxs("div",{className:"space-y-2 font-mono text-[11px]",children:[c.jsx("div",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:"not validated"}),c.jsx("div",{className:"text-ink-secondary",children:t[e.skipped]})]})}return e.valid?c.jsxs("div",{className:"space-y-3 font-mono text-[11px]",children:[c.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[c.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"}),c.jsxs("span",{className:"text-ink-muted",children:["matched ",c.jsx("span",{className:"text-ink-secondary",children:e.schemaName})," ","from the ACP schema"]})]}),c.jsx(Sh,{advisories:e.advisories})]}):c.jsxs("div",{className:"space-y-3 font-mono text-[11px]",children:[c.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[c.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"]}),c.jsxs("span",{className:"text-ink-muted",children:["against ",c.jsx("span",{className:"text-ink-secondary",children:e.schemaName})]})]}),c.jsx("ul",{className:"space-y-1.5",children:e.errors.map((t,n)=>c.jsxs("li",{className:"rounded-sm border border-accent-error/25 bg-accent-error/[0.04] px-2 py-1.5",children:[c.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:[t.keyword??"error"," · ",t.path==="/"?"(root)":t.path]}),c.jsx("div",{className:"mt-0.5 text-ink-primary",children:t.message})]},`${t.path}-${t.keyword}-${n}`))}),c.jsx(Sh,{advisories:e.advisories})]})}function Sh({advisories:e}){return!e||e.length===0?null:c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[c.jsxs("span",{className:"rounded-sm border border-accent-warn/40 bg-accent-warn/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-warn",children:["⚠ ",e.length," advisor",e.length===1?"y":"ies"]}),c.jsx("span",{className:"text-ink-muted",children:"valid today — required in a future ACP version"})]}),c.jsx("ul",{className:"space-y-1.5",children:e.map((t,n)=>c.jsxs("li",{className:"rounded-sm border border-accent-warn/25 bg-accent-warn/[0.04] px-2 py-1.5",children:[c.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:["soon-required · ",t.path]}),c.jsx("div",{className:"mt-0.5 text-ink-primary",children:t.message})]},`${t.path}-${n}`))})]})}function xE({message:e,resolver:t}){const n=I.useMemo(()=>{if(t)return o=>t.resolve(o)},[t]);return e.payload===null?c.jsxs("div",{className:"space-y-2 font-mono text-xs",children:[c.jsxs("div",{className:"text-accent-error",children:["parse error: ",e.parseError??"unknown"]}),c.jsx("pre",{className:"whitespace-pre-wrap break-all text-ink-secondary",children:e.raw})]}):c.jsx(al,{value:e.payload,defaultExpanded:!0,...n?{getSpec:n}:{}})}function wE({raw:e}){const[t,n]=I.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return c.jsxs("div",{className:"group relative",children:[c.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"}),c.jsx("pre",{className:"whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-ink-primary",children:e})]})}function SE({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 c.jsx("dl",{className:"grid grid-cols-[110px_1fr] gap-x-4 gap-y-1 font-mono text-[12px]",children:t.map(([n,o])=>c.jsxs("div",{className:"contents",children:[c.jsx("dt",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:n}),c.jsx("dd",{className:"text-ink-primary",children:o})]},n))})}function $E({message:e,resolver:t}){const n=c.jsx(ja,{label:"kind",value:e.kind});return t!=null&&t.typeDescription?c.jsx(Ar,{label:c.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 c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:e}),c.jsx("span",{className:K(n?"text-accent-warn":"text-ink-primary"),children:t})]})}function na({children:e,active:t,onClick:n,badge:o,advisoryBadge:r,tab:i}){return c.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:[c.jsx("span",{children:e}),o!==void 0&&c.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}),r!==void 0&&c.jsx("span",{className:"rounded-sm border border-accent-warn/40 bg-accent-warn/10 px-1 text-[9px] font-semibold text-accent-warn",children:r}),t&&c.jsx("span",{className:"absolute inset-x-2 -bottom-px h-px bg-accent-out","aria-hidden":!0})]})}function rf(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 Bd(e){const t=rf(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?$h(s.latencies,50):null,p99:s.latencies.length?$h(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 $h(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 Gb=100;function kE(e,t,n={}){const o=n.maxChangesPerRow??Gb,r=kh(e),i=kh(t),s=TE(r,i),a=[],l={equal:0,changed:0,added:0,removed:0,total:0};for(const d of s)if(d.kind==="match"){const p=e[d.i],m=t[d.j],v=_E(p,m,o),h=v.length===0?"equal":"changed";a.push({op:h,a:p,b:m,signature:r[d.i],changes:v}),h==="equal"?l.equal+=1:l.changed+=1}else if(d.kind==="removed"){const p=e[d.i];a.push({op:"removed",a:p,b:null,signature:r[d.i],changes:[]}),l.removed+=1}else{const p=t[d.j];a.push({op:"added",a:null,b:p,signature:i[d.j],changes:[]}),l.added+=1}return l.total=a.length,{rows:a,summary:l}}function kh(e){const t=rf(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 TE(e,t){const n=e.length,o=t.length,r=o+1,i=new Uint32Array((n+1)*r);for(let d=n-1;d>=0;d--)for(let p=o-1;p>=0;p--){const m=d*r+p;if(e[d]===t[p])i[m]=i[(d+1)*r+(p+1)]+1;else{const v=i[(d+1)*r+p],h=i[d*r+(p+1)];i[m]=v>=h?v:h}}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 Th(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 _E(e,t,n){const o=[];return ll(Th(e),Th(t),"",o,n),o}function jE(e,t,n=Gb){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(NE(e,t))return;o.push({path:n||"$",kind:"change",a:e,b:t});return}if(i==="array"){const p=e,m=t,v=Math.max(p.length,m.length);for(let h=0;h<v;h++){if(o.length>=r)return;const y=`${n}[${h}]`,b=h<p.length,g=h<m.length;b&&g?ll(p[h],m[h],y,o,r):g?o.push({path:y,kind:"add",b:m[h]}):o.push({path:y,kind:"remove",a:p[h]})}return}const a=e,l=t,d=[...new Set([...Object.keys(a),...Object.keys(l)])].sort();for(const p of d){if(o.length>=r)return;const m=n?`${n}.${p}`:p,v=p in a,h=p in l;v&&h?ll(a[p],l[p],m,o,r):h?o.push({path:m,kind:"add",b:l[p]}):o.push({path:m,kind:"remove",a:a[p]})}}function NE(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 CE(e){for(const t of e)if(t.kind==="request"&&t.method==="initialize"&&t.direction==="editor-to-agent")return t;return null}function EE(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 PE(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 IE(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 OE(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 RE(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 AE(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 ME(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 d=Ne((s=Ne(l.payload))==null?void 0:s.params);if(d){if(l.method==="session/set_mode"){const p=xn(d.modeId);p!==null&&(t!==null&&t!==p&&(n+=1),t=p)}else if(l.method==="session/set_model"){const p=xn(d.modelId);p!==null&&(o!==null&&o!==p&&(r+=1),o=p)}else if(l.method==="session/update"){const p=Ne(d.update);if((p==null?void 0:p.sessionUpdate)==="available_commands_update"){const m=p.availableCommands;if(Array.isArray(m)){const v=[];for(const h of m){const y=xn((a=Ne(h))==null?void 0:a.name);y!==null&&v.push(y)}v.length>0&&(i=v)}}else if((p==null?void 0:p.sessionUpdate)==="current_mode_update"){const m=xn(p.currentModeId);m!==null&&(t!==null&&t!==m&&(n+=1),t=m)}}}}return{currentMode:t,modeChanges:n,currentModel:o,modelChanges:r,availableCommands:i}}function qE(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=CE(e),n=EE(e,t==null?void 0:t.rpcId);return{protocolVersion:AE(t,n),client:PE(t),agent:OE(n),clientCapabilities:IE(t),agentCapabilities:RE(n),runtime:ME(e),extensions:qE(t)}}function jh(e){return{protocolVersion:e.protocolVersion,client:e.client,agent:e.agent,clientCapabilities:e.clientCapabilities,agentCapabilities:e.agentCapabilities,runtime:e.runtime}}function UE(e,t){const n=cl(e),o=cl(t);return{a:n,b:o,changes:jE(jh(n),jh(o))}}function LE(e,t){const n=Bd(e),o=Bd(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 d=i.get(l)??null,p=s.get(l)??null,m=d??p;a.push({method:m.method,kind:m.kind,a:d,b:p,countDelta:((p==null?void 0:p.count)??0)-((d==null?void 0:d.count)??0),p50Delta:kc(d==null?void 0:d.p50,p==null?void 0:p.p50),p99Delta:kc(d==null?void 0:d.p99,p==null?void 0:p.p99),maxDelta:kc(d==null?void 0:d.max,p==null?void 0:p.max)})}return a.sort((l,d)=>Math.abs(d.p99Delta??0)-Math.abs(l.p99Delta??0)||Math.abs(d.countDelta)-Math.abs(l.countDelta)||l.method.localeCompare(d.method)),a}function kc(e,t){return e==null||t===null||t===void 0?null:t-e}function sf(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 af="flex h-9 items-center gap-4 border-b border-line bg-surface-base px-5",DE={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"UNK"};function zE(e){return e.direction==="editor-to-agent"?"→A":"A←"}function Jb(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 Nh={messages:null,loading:!1,error:null};function Ch(e){const[t,n]=I.useState(Nh);return I.useEffect(()=>{if(e===null){n(Nh);return}let o=!1;return n({messages:null,loading:!0,error:null}),TS(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 FE({open:e,onClose:t}){const n=ne(F=>F.messages),o=ne(F=>F.session),r=at(F=>F.savedSessions),i=(o==null?void 0:o.id)??null,[s,a]=I.useState(null),[l,d]=I.useState(null),[p,m]=I.useState("frames"),[v,h]=I.useState(!0),[y,b]=I.useState(null),{rendered:g,visible:f}=sf(e);I.useEffect(()=>{if(!e)return;const F=G=>{G.key==="Escape"&&(G.preventDefault(),t())};return window.addEventListener("keydown",F,!0),()=>window.removeEventListener("keydown",F,!0)},[e,t]),I.useEffect(()=>{e&&(a(i),d(null),b(null))},[e,i]),I.useEffect(()=>b(null),[s,l]);const u=Ch(s!==null&&s!==i?s:null),x=Ch(l!==null&&l!==i?l:null),S=s===null?null:s===i?n:u.messages,T=l===null?null:l===i?n:x.messages,C=u.loading||x.loading,$=u.error??x.error,j=I.useMemo(()=>S===null||T===null?null:kE(S,T),[S,T]),A=I.useMemo(()=>{if(!j)return[];const F=[];return j.rows.forEach((G,Y)=>{v&&G.op==="equal"||F.push({row:G,index:Y})}),F},[j,v]),E=I.useMemo(()=>{const F=r.find(G=>G.id===l);return F?Jb(F):null},[r,l]),q=I.useMemo(()=>S&&T?UE(S,T):null,[S,T]),z=I.useMemo(()=>S&&T?LE(S,T):null,[S,T]);if(!g)return null;const U=r.filter(F=>F.id!==l),L=r.filter(F=>F.id!==s);return c.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",f?"opacity-100":"opacity-0"),children:c.jsxs("div",{className:K("flex h-full w-full flex-col transition-transform duration-200 ease-out",f?"translate-y-0":"-translate-y-2"),children:[c.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Diff — compare two sessions"}),c.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"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line bg-surface-elev px-5 py-2.5",children:[c.jsx("span",{className:"font-mono text-[11px] text-accent-out",title:"baseline (left)",children:"A"}),c.jsx(Oh,{ariaLabel:"Baseline session",sessions:U,selectedId:s,onSelect:a}),c.jsx("span",{className:"text-ink-muted",children:"→"}),c.jsx("span",{className:"font-mono text-[11px] text-ink-secondary",title:"comparison (right)",children:"B"}),c.jsx(Oh,{ariaLabel:"Comparison session",sessions:L,selectedId:l,onSelect:d})]}),s===null?c.jsx(xi,{children:"Pick a baseline session (A) to compare from."}):l===null?c.jsx(xi,{children:"Pick a session in the B selector above to compare against A."}):C?c.jsx(xi,{children:"Loading sessions…"}):$?c.jsxs(xi,{tone:"error",children:["Could not load a session: ",$]}):!j||!q||!z?c.jsx(xi,{children:"No data."}):c.jsxs(c.Fragment,{children:[c.jsx(BE,{tab:p,onTab:m,summary:j.summary,infoCount:q.changes.length}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[p==="frames"&&c.jsx(HE,{diff:j,bLabel:E,hideEqual:v,onHideEqual:h,visibleRows:A,expanded:y,onToggleExpand:F=>b(G=>G===F?null:F)}),p==="info"&&c.jsx(VE,{meta:q}),p==="perf"&&c.jsx(KE,{perf:z})]})]})]})})}function BE({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 c.jsx("div",{className:"flex items-center gap-1 border-b border-line bg-surface-elev px-5 py-1.5",children:i.map(s=>c.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&&c.jsx("span",{className:"rounded-sm border border-line px-1 text-[9px] text-ink-secondary",children:s.badge})]},s.id))})}function HE({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 c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:K(af,"font-mono text-[11px]"),children:[c.jsxs("span",{className:"text-ink-muted",children:[e.summary.equal," same"]}),c.jsxs("span",{className:"text-accent-warn",children:[e.summary.changed," differs"]}),c.jsxs("span",{className:"text-accent-error",children:[e.summary.removed," only in A"]}),c.jsxs("span",{className:"text-accent-ok",children:[e.summary.added," only in B"]}),c.jsxs("label",{className:"ml-auto flex cursor-pointer select-none items-center gap-2 text-[10px] uppercase tracking-widest text-ink-muted",children:[c.jsx("input",{type:"checkbox",checked:n,onChange:l=>o(l.target.checked),className:"accent-accent-info"}),"hide unchanged"]})]}),a?c.jsxs(ms,{tone:"ok",children:["Sessions are identical",t?` — every frame in B (${t}) matches A`:"","."]}):r.length===0?c.jsx(ms,{children:"Only unchanged frames — toggle “hide unchanged” to see them."}):c.jsxs("table",{className:"w-full table-fixed border-collapse font-mono text-[11px]",children:[c.jsxs("colgroup",{children:[c.jsx("col",{className:"w-[24px]"}),c.jsx("col",{className:"w-1/2"}),c.jsx("col",{className:"w-1/2"})]}),c.jsx("tbody",{children:r.map(({row:l,index:d})=>c.jsx(QE,{row:l,expanded:i===d,onToggle:()=>s(d)},d))})]})]})}function Qb(){return c.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:[c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:"text-accent-warn",children:"~"})," changed"]}),c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:"text-accent-ok",children:"+"})," only in B"]}),c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:"text-accent-error",children:"−"})," only in A"]})]})}function VE({meta:e}){return e.changes.length===0?c.jsx(ms,{tone:"ok",children:"Metadata identical — same client, agent, capabilities, protocol and runtime."}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:af,children:c.jsx(Qb,{})}),c.jsx("ul",{className:"space-y-1 px-5 py-3 font-mono text-[11px]",children:e.changes.map((t,n)=>c.jsx("li",{className:"leading-snug",children:c.jsx(Yb,{change:t})},n))})]})}function Eh(e){return e==null?"—":Vt(e)}function WE(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 KE({perf:e}){return e.length===0?c.jsx(ms,{children:"No methods to compare."}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:K(af,"font-mono text-[10px] uppercase tracking-widest text-ink-muted"),children:[c.jsx("span",{children:"Δ = B − A · sorted by |Δ p99|"}),c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:"text-accent-error",children:"+"})," slower in B"]}),c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{className:"text-accent-ok",children:"−"})," faster in B"]})]}),c.jsxs("table",{className:"w-full text-[11px]",children:[c.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:c.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[c.jsx("th",{className:"py-2 pl-5 pr-3",children:"method"}),c.jsx("th",{className:"px-3 py-2",children:"kind"}),c.jsx("th",{className:"px-3 py-2 text-right",children:"A p99"}),c.jsx("th",{className:"px-3 py-2 text-right",children:"B p99"}),c.jsx("th",{className:"px-3 py-2 text-right",children:"Δ p99"}),c.jsx("th",{className:"px-3 py-2 text-right",children:"count"})]})}),c.jsx("tbody",{className:"font-mono",children:e.map(t=>{var o,r,i,s;const n=WE(t.p99Delta);return c.jsxs("tr",{className:"border-b border-line/40 hover:bg-surface-rowHover/50",children:[c.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:t.method,children:t.method}),c.jsx("td",{className:"px-3 py-1.5 text-[10px] uppercase tracking-widest text-ink-muted",children:t.kind==="request"?"req":"ntf"}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:Eh(((o=t.a)==null?void 0:o.p99)??null)}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:Eh(((r=t.b)==null?void 0:r.p99)??null)}),c.jsx("td",{className:K("px-3 py-1.5 text-right",n.tone),children:n.text}),c.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 xi({children:e,tone:t}){return c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:c.jsx(ms,{...t?{tone:t}:{},children:e})})}const GE={equal:"",changed:"bg-accent-warn/5",added:"bg-accent-ok/5",removed:"bg-accent-error/5"},JE={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 QE({row:e,expanded:t,onToggle:n}){const o=JE[e.op],r=e.op==="changed"&&e.changes.length>0;return c.jsxs(c.Fragment,{children:[c.jsxs("tr",{className:K("border-b border-line/40 align-top",GE[e.op],r&&"cursor-pointer hover:bg-accent-warn/10"),onClick:r?n:void 0,children:[c.jsx("td",{className:K("py-1.5 pl-5 text-center",o.tone),children:o.glyph}),c.jsx("td",{className:"px-3 py-1.5",children:c.jsx(Ph,{frame:e.a,muted:e.op==="added"})}),c.jsxs("td",{className:"px-3 py-1.5",children:[c.jsx(Ph,{frame:e.b,muted:e.op==="removed"}),r&&c.jsxs("span",{className:"ml-2 text-[10px] text-accent-warn",children:[t?"▾":"▸"," ",e.changes.length," field",e.changes.length===1?"":"s"]})]})]}),r&&t&&c.jsxs("tr",{className:"border-b border-line/40 bg-surface-elev",children:[c.jsx("td",{}),c.jsxs("td",{colSpan:2,className:"px-5 py-2",children:[c.jsx("div",{className:"mb-1.5",children:c.jsx(Qb,{})}),c.jsx("ul",{className:"space-y-1",children:e.changes.map((i,s)=>c.jsx("li",{className:"leading-snug",children:c.jsx(Yb,{change:i})},s))})]})]})]})}function Ph({frame:e,muted:t}){if(e===null)return c.jsx("span",{className:"text-ink-dim",children:"—"});const n=e.method??(e.parseError?`! ${e.parseError}`:"—");return c.jsxs("span",{className:K("inline-flex items-baseline gap-2",t&&"opacity-60"),children:[c.jsx("span",{className:"text-ink-dim",children:zE(e)}),c.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:DE[e.kind]}),c.jsx("span",{className:"truncate text-ink-primary",title:n,children:n}),c.jsxs("span",{className:"text-ink-dim",children:["#",e.seq]})]})}const Ih=80;function oa(e){let t;try{t=JSON.stringify(e)}catch{t=String(e)}return t===void 0&&(t="undefined"),t.length>Ih&&(t=t.slice(0,Ih-1)+"…"),t}function Yb({change:e}){return e.kind==="add"?c.jsxs("span",{children:[c.jsx("span",{className:"text-accent-ok",children:"+ "}),c.jsx("span",{className:"text-ink-secondary",children:e.path}),c.jsx("span",{className:"text-ink-muted",children:": "}),c.jsx("span",{className:"text-accent-ok",children:oa(e.b)})]}):e.kind==="remove"?c.jsxs("span",{children:[c.jsx("span",{className:"text-accent-error",children:"− "}),c.jsx("span",{className:"text-ink-secondary",children:e.path}),c.jsx("span",{className:"text-ink-muted",children:": "}),c.jsx("span",{className:"text-accent-error line-through",children:oa(e.a)})]}):c.jsxs("span",{children:[c.jsx("span",{className:"text-accent-warn",children:"~ "}),c.jsx("span",{className:"text-ink-secondary",children:e.path}),c.jsx("span",{className:"text-ink-muted",children:": "}),c.jsx("span",{className:"text-accent-error line-through",children:oa(e.a)}),c.jsx("span",{className:"text-ink-muted",children:" → "}),c.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 c.jsx("div",{className:K("px-5 py-8 text-center font-mono text-[12px]",n),children:e})}function Oh({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=v=>{s.current&&!s.current.contains(v.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),d=n!==null?t.find(m=>m.id===n)??null:null,p=d?Jb(d):n!==null?`#${n}`:"select a session…";return c.jsxs("div",{ref:s,className:"relative",children:[c.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:[c.jsx("span",{className:"inline-block w-[240px] truncate text-left",children:p}),c.jsx("span",{"aria-hidden":!0,className:K("transition-transform",r?"rotate-180":""),children:"▾"})]}),r&&c.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:[c.jsxs(Rh,{children:["saved · ",a.length," session",a.length===1?"":"s"]}),a.length===0&&c.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no other saved sessions to compare"}),c.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:a.map(m=>c.jsx(Ah,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))}),l.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs(Rh,{children:["imported · ",l.length," file",l.length===1?"":"s"]}),c.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:l.map(m=>c.jsx(Ah,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))})]})]})]})}function Rh({children:e}){return c.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 Ah({s:e,active:t,onPick:n}){return c.jsx("li",{children:c.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:[c.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")}),c.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[c.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),c.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Rt(e.agent_command??"")}`:Rt(e.agent_command??""))]}),c.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[e.message_count,"msg · ",Mr(e.started_at)]})]})})}let Tc=null,wi=null;async function YE(){if(Tc)return Tc;if(wi)return wi;wi=(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 wi}finally{wi=null}}const XE=[{id:"zed",label:"Zed"},{id:"jetbrains",label:"JetBrains"}],ZE="/absolute/path/to/acp-devtools";function eP(e){return JSON.stringify({agent_servers:{"Claude Code (via ACP Devtools)":{type:"custom",command:e}}},null,4)}function Xb({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 c.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 tP(){const[e,t]=I.useState("zed"),[n,o]=I.useState(null);I.useEffect(()=>{let a=!0;return YE().then(l=>{a&&o(l.binaryPath)}).catch(()=>{}),()=>{a=!1}},[]);const r=n??ZE,i=n===null,s=I.useMemo(()=>({zed:eP(r),jetbrainsName:"Claude Code (via ACP Devtools)"}),[r]);return c.jsxs("div",{className:"rounded border border-line bg-surface-base",children:[c.jsx("div",{className:"flex items-center gap-1 border-b border-line px-3 py-2",children:XE.map(a=>c.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"&&c.jsxs("div",{className:"px-3 py-3",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"~/.config/zed/settings.json"}),c.jsx(Xb,{text:s.zed})]}),c.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}),c.jsxs("p",{className:"mt-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Open Zed, paste into ",c.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 ",c.jsx("span",{className:"font-mono",children:"@zed-industries/claude-code-acp"})," ","when launched with no args."]}),c.jsx(Mh,{isPlaceholder:i})]}),e==="jetbrains"&&c.jsxs("div",{className:"px-3 py-3",children:[c.jsxs("p",{className:"mb-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Settings (Cmd+,) → search ",c.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):"]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(qh,{label:"Name",value:s.jetbrainsName}),c.jsx(qh,{label:"Command",value:r})]}),c.jsxs("p",{className:"mt-3 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["JetBrains IDEs require an absolute ",c.jsx("span",{className:"font-mono",children:"command"}),". See ",c.jsx("span",{className:"font-mono",children:"examples/jetbrains-config.md"})," if the agent-servers page is not where the search suggests."]}),c.jsx(Mh,{isPlaceholder:i})]})]})}function Mh({isPlaceholder:e}){return e?c.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"," ",c.jsx("span",{className:"font-mono",children:"npm run build:full"})," in the repo and"," ",c.jsx("span",{className:"font-mono",children:"npm link"})," inside"," ",c.jsx("span",{className:"font-mono",children:"packages/cli/"}),", find the path with"," ",c.jsx("span",{className:"font-mono",children:"which acp-devtools"})," and replace the placeholder above."]}):c.jsxs("p",{className:"mt-3 font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:["path auto-resolved · verify with ",c.jsx("span",{className:"text-ink-secondary",children:"which acp-devtools"})]})}function qh({label:e,value:t}){return c.jsxs("div",{className:"flex items-center gap-2 rounded border border-line bg-surface-elev/60 px-3 py-1.5",children:[c.jsx("span",{className:"w-20 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),c.jsx("span",{className:"flex-1 truncate font-mono text-[11px] text-ink-primary",children:t}),c.jsx(Xb,{text:t})]})}function nP({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 c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:c.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[c.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[c.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.6.0 / pre-alpha"})]}),c.jsx("h2",{className:K("font-display text-2xl uppercase tracking-tight",i),children:r}),c.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&&c.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"]}),c.jsx("div",{className:"mt-4",children:c.jsx(tP,{})}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 font-mono text-[11px]",children:[c.jsx(oP,{status:e}),c.jsx("span",{className:"text-ink-secondary",children:n}),t&&c.jsx("span",{className:"text-accent-error",children:t})]})]})})}function oP({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 c.jsx("span",{className:K("h-2 w-2 rounded-full",t),"aria-hidden":!0})}function rP(){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 c.jsxs("div",{className:"flex items-center gap-3 border-b border-line bg-surface-elev/70 px-4 py-2",children:[c.jsx("div",{className:"flex items-center gap-1",children:cs.map(i=>c.jsx(aP,{dir:i,active:e.directions.has(i),onClick:()=>t(i)},i))}),c.jsx(dP,{}),c.jsxs("div",{className:"flex items-center gap-1",children:[ds.map(i=>c.jsx(lP,{kind:i,active:e.kinds.has(i),onClick:()=>n(i)},i)),c.jsx(cP,{active:e.showStreams,onClick:o})]}),c.jsx("div",{className:"ml-auto",children:c.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 iP={"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)"},sP={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 aP({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 c.jsx("button",{type:"button",onClick:n,title:iP[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 lP({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 c.jsx("button",{type:"button",onClick:n,title:sP[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 cP({active:e,onClick:t}){return c.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 dP(){return c.jsx("span",{"aria-hidden":!0,className:"h-5 w-px bg-line"})}const uP={minSamplesForTail:3,longTailRatio:5,minBusiestCount:50,minBusiestRatio:2.5,minHotspotShare:.4,minSamplesForOutlier:5,outlierRatio:3};function pP(e,t,n={}){const o={...uP,...n},r=[],i=t.reduce((h,y)=>h+(y.totalLatencyMs??0),0);if(i>0){const y=t.filter(b=>b.totalLatencyMs!==null&&b.totalLatencyMs>0).sort((b,g)=>(g.totalLatencyMs??0)-(b.totalLatencyMs??0))[0];if(y&&y.totalLatencyMs!==null){const b=y.totalLatencyMs/i;b>=o.minHotspotShare&&r.push({kind:"hotspot",summary:`${y.method} consumed ${ar(y.totalLatencyMs)} of total wall time`,detail:`${Math.round(b*100)}% of ${ar(i)} sampled latency`,methods:[y.method]})}}const a=t.filter(h=>h.sampleSize>=o.minSamplesForTail&&h.p50!==null&&h.p99!==null&&h.p50>0&&h.p99/h.p50>=o.longTailRatio).sort((h,y)=>(y.p99??0)/(y.p50??1)-(h.p99??0)/(h.p50??1))[0];if(a&&a.p99!==null&&a.p50!==null){const h=Math.round(a.p99/a.p50);r.push({kind:"long-tail",summary:`${a.method} has a long tail — p99 is ${h}× the p50`,detail:`p50 ${ar(a.p50)} · p99 ${ar(a.p99)} · ${a.sampleSize} samples`,methods:[a.method]})}const l=[...t].filter(h=>h.sampleSize>=o.minSamplesForOutlier&&h.p99!==null&&h.max!==null&&h.p99>0&&h.max/h.p99>=o.outlierRatio).sort((h,y)=>(y.max??0)-(h.max??0))[0];if(l&&l.max!==null&&l.p99!==null){const h=Math.round(l.max/l.p99);r.push({kind:"outlier",summary:`${l.method} had one ${ar(l.max)} call — ${h}× its p99`,detail:`p99 ${ar(l.p99)} · ${l.sampleSize} samples`,methods:[l.method]})}const d=[...t].sort((h,y)=>y.count-h.count),p=d[0],m=d[1];if(p&&p.count>=o.minBusiestCount){const h=m&&m.count>0?p.count/m.count:1/0;if(h>=o.minBusiestRatio){const y=p.kind==="notification"?"notifications":"calls";r.push({kind:"busiest",summary:`${p.method} sent ${p.count} ${y}`,detail:m?`${h.toFixed(1)}× the next-busiest method (${m.method} · ${m.count})`:"no other methods to compare against",methods:[p.method]})}}const v=fP(e);if(v.length>0){const h=v.slice(0,3),y=v.length>3?` (+${v.length-3} more)`:"";r.push({kind:"errors",summary:`${v.length} method${v.length===1?"":"s"} returned an error`,detail:h.join(", ")+y,methods:v})}return r}function fP(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 mP(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 hP({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=mP(e,s),l=1,d=(t-l*(a.length-1))/a.length;return c.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((p,m)=>{const v=Math.max(1,p/i*n);return c.jsx("rect",{x:m*(d+l),y:n-v,width:d,height:v,fill:"currentColor",opacity:.4+p/i*.6},m)})})}function yP(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=rf(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 d=l.direction==="editor-to-agent"?"editor-req":"agent-req",p=n.get(l.seq),m=p?o.get(p.pairSeq):void 0,v=(m==null?void 0:m.kind)==="error",h=m?m.timestamp:l.timestamp;h>i&&(i=h),s.push({seq:l.seq,startTs:l.timestamp,endTs:h,lane:d,method:l.method??null,kind:l.kind,erroredOut:v,pairedSeq:m?m.seq:null}),a[d]+=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"],gP={"editor-req":"editor → agent","agent-req":"agent → editor",notification:"notifications"},oo=48,lf=6,Ll=24,wn=132,hs=20,Dl=8,vP=20,Uh=3e4,Lh=50;function bP(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((u,x)=>u.startTs-x.startTs),a=[];let l=t,d=t;for(const u of s)u.startTs-d>Uh&&(d>l&&a.push({kind:"active",tStart:l,tEnd:d}),a.push({kind:"gap",tStart:d,tEnd:u.startTs}),l=u.startTs),d=Math.max(d,u.endTs);d>l&&a.push({kind:"active",tStart:l,tEnd:d}),n>d+Uh?a.push({kind:"gap",tStart:d,tEnd:n}):n>d&&a.length>0&&(a[a.length-1].tEnd=n);const p=a.filter(u=>u.kind==="gap").length,m=a.filter(u=>u.kind==="active").reduce((u,x)=>u+(x.tEnd-x.tStart),0),v=o*r,h=Math.max(50,v-p*Lh),y=m>0?h/m:0;let b=0;const g=[];for(const u of a){const x=u.kind==="gap"?Lh:(u.tEnd-u.tStart)*y;g.push({...u,pxStart:b,pxEnd:b+x}),b+=x}return{segments:g,tsToX:u=>{if(u<=g[0].tStart)return wn+g[0].pxStart-i;for(const S of g)if(u>=S.tStart&&u<=S.tEnd){const T=S.tEnd>S.tStart?(u-S.tStart)/(S.tEnd-S.tStart):0,C=S.pxStart+T*(S.pxEnd-S.pxStart);return wn+C-i}const x=g[g.length-1];return wn+x.pxEnd-i},totalActiveMs:m}}function xP({messages:e,onSelectSeq:t,height:n=220,controlsRef:o,onZoomChange:r}){const i=I.useMemo(()=>yP(e),[e]),s=I.useRef(null),a=I.useRef(null),[l,d]=I.useState({width:800,height:n}),[p,m]=I.useState(1),[v,h]=I.useState(0),[y,b]=I.useState(null),[g,f]=I.useState({x:0,y:0}),u=I.useRef(null);I.useEffect(()=>{const U=s.current;if(!U||typeof ResizeObserver>"u")return;const L=new ResizeObserver(F=>{const G=F[0];if(!G)return;const Y=G.contentRect;d({width:Math.max(320,Y.width),height:Math.max(120,Y.height)})});return L.observe(U),()=>L.disconnect()},[]),I.useEffect(()=>{m(1),h(0),b(null)},[i.startTs,i.endTs]);const x=I.useMemo(()=>{const U=Math.max(50,l.width-wn-hs);return bP(i.events,i.startTs,i.endTs,U,p,v)},[i,l.width,p,v]),S=I.useMemo(()=>{if(i.events.length===0)return[];const U=[];for(const L of i.events){const F=x.tsToX(L.startTs),G=x.tsToX(L.endTs),Y=Math.max(2,G-F),D=dl.indexOf(L.lane),J=Dl+Ll+D*(oo+lf)+oo/2-9;U.push({...L,x:F,y:J,width:Y,height:18})}return U},[i,x]);I.useEffect(()=>{const U=a.current;if(!U)return;const L=window.devicePixelRatio||1;U.width=l.width*L,U.height=l.height*L,U.style.width=`${l.width}px`,U.style.height=`${l.height}px`;const F=U.getContext("2d");if(!F)return;F.setTransform(L,0,0,L,0,0);const G=getComputedStyle(document.documentElement),Y=J=>`rgb(${G.getPropertyValue(`--${J}`).trim()})`,D=(J,O)=>`rgba(${G.getPropertyValue(`--${J}`).trim()} / ${O})`;F.clearRect(0,0,l.width,l.height),wP(F,l,Y),$P(F,x,l,Y,D),SP(F,l,x,Y),_P(F,S,y,Y,D)},[S,x,l,y]);const T=(U,L)=>{for(const F of S){const G=Math.max(F.width,6);if(U>=F.x&&U<=F.x+G&&L>=F.y&&L<=F.y+F.height)return F}return null},C=U=>{const L=U.currentTarget.getBoundingClientRect(),F=U.clientX-L.left,G=U.clientY-L.top;if(u.current){const D=F-u.current.startX;h(Math.max(0,u.current.startPan-D));return}const Y=T(F,G);b(Y),f({x:U.clientX,y:U.clientY})},$=U=>{const L=U.currentTarget.getBoundingClientRect(),F=U.clientX-L.left,G=U.clientY-L.top,Y=T(F,G);if(Y&&t){t(Y.seq);return}u.current={startX:F,startPan:v}},j=()=>{u.current=null},A=U=>{if(!U.metaKey&&!U.ctrlKey)return;U.preventDefault();const L=U.deltaY<0?1.15:1/1.15;m(F=>Math.min(50,Math.max(.3,F*L)))},E=()=>m(U=>Math.min(50,U*1.5)),q=()=>m(U=>Math.max(.3,U/1.5)),z=()=>{m(1),h(0)};return I.useEffect(()=>{if(o)return o.current={zoomIn:E,zoomOut:q,reset:z,getZoom:()=>p},()=>{o.current&&(o.current=null)}}),I.useEffect(()=>{r==null||r(p)},[p,r]),i.events.length===0?c.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"}):c.jsxs("div",{ref:s,className:"relative h-full w-full",style:{minHeight:0},children:[c.jsx("canvas",{ref:a,className:K("block h-full w-full",u.current?"cursor-grabbing":y?"cursor-pointer":"cursor-grab"),onMouseMove:C,onMouseDown:$,onMouseUp:j,onMouseLeave:()=>{b(null),u.current=null},onWheel:A}),y&&c.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,g.x+12),top:g.y+12,maxWidth:280},children:[c.jsxs("div",{className:"text-ink-primary",children:[c.jsxs("span",{className:"text-ink-muted",children:["seq ",y.seq]})," · ",y.method??y.kind]}),c.jsx("div",{className:"text-ink-muted",children:y.endTs>y.startTs?`${Vt(y.endTs-y.startTs)}${y.erroredOut?" · error":""}`:y.lane==="notification"?"notification":"pending"}),t&&c.jsx("div",{className:"mt-1 text-[10px] text-ink-dim",children:"click to inspect"})]})]})}function wP(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+lf);e.fillStyle=n("surface-elev"),e.fillRect(wn,i,t.width-wn-hs,oo),e.fillStyle=n("ink-muted"),e.fillText(gP[r],vP,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 SP(e,t,n,o){var y;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,g)=>Math.max(b,g.tEnd-g.tStart),0),s=n.segments.reduce((b,g)=>b+(g.kind==="active"?g.pxEnd-g.pxStart:0),0),l=(i>0?s/n.totalActiveMs:0)*1e3,d=[.1,.25,.5,1,2,5,10,30,60,120,300],p=80;let m=d[d.length-1];for(const b of d)if(b*l>=p){m=b;break}const v=m*1e3,h=((y=n.segments[0])==null?void 0:y.tStart)??0;for(const b of n.segments){if(b.kind!=="active")continue;const g=Math.ceil((b.tStart-h)/v)*v+h;for(let f=g;f<=b.tEnd;f+=v){const u=n.tsToX(f);u<wn||u>t.width-hs||(e.beginPath(),e.moveTo(u,r),e.lineTo(u,r+4),e.stroke(),e.fillText(TP(f-h),u,r-2))}}}function $P(e,t,n,o,r){const i=Dl+Ll,s=i+dl.length*(oo+lf);for(const a of t.segments){if(a.kind!=="gap")continue;const l=t.tsToX(a.tStart),p=t.tsToX(a.tEnd)-l;if(l>n.width-hs||l+p<wn)continue;e.fillStyle=r("ink-muted",.06),e.fillRect(l,i,p,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+p-.5,i),e.lineTo(l+p-.5,s),e.stroke(),e.setLineDash([]),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="middle",e.textAlign="center";const m=l+p/2,v=i+(s-i)/2;e.fillText(kP(a.tEnd-a.tStart),m,v)}}function kP(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 TP(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 _P(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 jP({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),d=I.useMemo(()=>Bd(o),[o]),p=I.useMemo(()=>pP(o,d),[o,d]),m=I.useMemo(()=>d.reduce((S,T)=>Math.max(S,T.count),0),[d]),[v,h]=I.useState("count"),[y,b]=I.useState("desc"),{rendered:g,visible:f}=sf(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(()=>AP(d,v,y),[d,v,y]),x=I.useMemo(()=>RP(d),[d]);return g?c.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",f?"opacity-100":"opacity-0"),children:c.jsxs("div",{className:K("flex h-full w-full flex-col transition-transform duration-200 ease-out",f?"translate-y-0":"-translate-y-2"),children:[c.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[c.jsxs("div",{className:"flex min-w-0 items-baseline gap-3",children:[c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Performance — per-method latency"}),r&&c.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})()})]}),c.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"})]}),p.length>0&&c.jsx(PP,{insights:p}),c.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:d.length===0?c.jsx("span",{children:"no messages — capture or load a session first"}):c.jsxs("span",{children:[x.methods," methods · ",x.requests," requests ·"," ",x.notifications," notifications · ",x.samples," latency samples"]})}),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsx("div",{className:"flex-1 overflow-y-auto",children:u.length===0?null:c.jsxs("table",{className:"w-full table-fixed text-[11px]",children:[c.jsxs("colgroup",{children:[c.jsx("col",{}),c.jsx("col",{className:"w-[64px]"}),c.jsx("col",{className:"w-[88px]"}),c.jsx("col",{className:"w-[80px]"}),c.jsx("col",{className:"w-[80px]"}),c.jsx("col",{className:"w-[80px]"}),c.jsx("col",{className:"w-[80px]"}),c.jsx("col",{className:"w-[120px]"})]}),c.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:c.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[c.jsx(cr,{sk:"method",current:v,dir:y,onSort:lr(h,b,y),className:"!pl-5",children:"method"}),c.jsx("th",{className:"px-3 py-2",children:"kind"}),c.jsx(cr,{sk:"count",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"count"}),c.jsx(cr,{sk:"p50",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"p50"}),c.jsx(cr,{sk:"p99",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"p99"}),c.jsx(cr,{sk:"max",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"max"}),c.jsx(cr,{sk:"total",current:v,dir:y,onSort:lr(h,b,y),align:"right",children:"total"}),c.jsx("th",{className:"py-2 pl-3 pr-5 text-right",children:"dist"})]})}),c.jsx("tbody",{className:"font-mono",children:u.map(S=>c.jsxs("tr",{className:"border-b border-line/40 transition-colors hover:bg-surface-rowHover/50",children:[c.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:S.method,children:S.method}),c.jsx("td",{className:"px-3 py-1.5 text-ink-muted",children:c.jsx(OP,{kind:S.kind})}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-primary",children:c.jsx(IP,{count:S.count,max:m,kind:S.kind})}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p50!==null?Vt(S.p50):"—"}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p99!==null?Vt(S.p99):"—"}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.max!==null?Vt(S.max):"—"}),c.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.totalLatencyMs!==null?Vt(S.totalLatencyMs):"—"}),c.jsx("td",{className:"py-1.5 pl-3 pr-5 text-right",children:S.latencies.length>0?c.jsx(hP,{values:S.latencies,width:88,height:14,className:"text-accent-info",title:`${S.method} latency distribution`}):c.jsx("span",{className:"text-ink-dim",children:"—"})})]},`${S.kind}:${S.method}`))})]})}),o.length>0&&c.jsxs("div",{className:"flex h-[260px] shrink-0 flex-col border-t border-line bg-surface-elev",children:[c.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:[c.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 truncate",children:[c.jsx("span",{children:"timeline — wall-clock waterfall"}),c.jsx("span",{className:"text-ink-dim",children:"· drag to pan · Cmd/Ctrl + wheel zoom · click to inspect"})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[c.jsxs("span",{className:"text-ink-secondary",children:[a.toFixed(a<1?2:1),"×"]}),c.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:"−"}),c.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:"+"}),c.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"})]})]}),c.jsx("div",{className:"flex-1",children:c.jsx(xP,{messages:o,controlsRef:s,onZoomChange:l,onSelectSeq:S=>{n?n(S):(i(S),t())}})})]})]})]})}):null}const NP={hotspot:"●","long-tail":"▲",outlier:"◆",busiest:"■",errors:"✗"},CP={hotspot:"text-accent-warn","long-tail":"text-accent-warn",outlier:"text-accent-warn",busiest:"text-accent-info",errors:"text-accent-error"},EP={hotspot:"hotspot","long-tail":"long tail",outlier:"outlier",busiest:"busiest",errors:"errors"};function PP({insights:e}){return c.jsxs("div",{className:"border-b border-line bg-surface-base px-5 py-2.5",children:[c.jsx("div",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"insights"}),c.jsx("ul",{className:"space-y-1.5",children:e.map(t=>c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{"aria-hidden":!0,className:K("mt-[3px] inline-block text-[9px] leading-none",CP[t.kind]),children:NP[t.kind]}),c.jsx("div",{className:"min-w-[68px] font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:EP[t.kind]}),c.jsxs("div",{className:"flex-1 text-[11px] leading-snug",children:[c.jsx("div",{className:"text-ink-primary",children:t.summary}),t.detail&&c.jsx("div",{className:"text-[10px] text-ink-muted",children:t.detail})]})]},t.kind))})]})}function IP({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 c.jsxs("div",{className:"relative inline-block w-[44px] text-right",children:[c.jsx("div",{"aria-hidden":!0,className:K("absolute inset-y-[1px] right-0 rounded-sm",r),style:{width:`${o}%`}}),c.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 c.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:[c.jsx("span",{children:s}),a&&c.jsx("span",{className:"ml-1 text-accent-warn",children:n==="asc"?"↑":"↓"})]})}function OP({kind:e}){const t=e==="request"?"text-accent-out":"text-accent-note",n=e==="request"?"req":"ntf";return c.jsx("span",{className:K("text-[10px] uppercase tracking-widest",t),title:e,children:n})}function RP(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 AP(e,t,n){const o=n==="asc"?1:-1,r=[...e];return r.sort((i,s)=>{const a=Dh(i,t),l=Dh(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 Dh(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 cf=["raw.githubusercontent.com","gist.githubusercontent.com"];function Zb(e){try{return{ok:!0,export:BC(e)}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}}function MP(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:cf.includes(t.host)}async function qP(e){if(!MP(e))return{ok:!1,error:`host not in playground allowlist (${cf.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 Zb(n)}function UP({initialUrl:e=null}){const[t,n]=I.useState(null),[o,r]=I.useState(e!==null),[i,s]=I.useState(!1),[a,l]=I.useState(""),d=I.useRef(null),p=(b,g)=>{b.ok?(ne.getState().loadFromExport(b.export),n(null)):n(`${g}: ${b.error}`),r(!1)},m=async b=>{r(!0),n(null);try{const g=await b.text();p(Zb(g),b.name)}catch(g){n(`${b.name}: ${g instanceof Error?g.message:String(g)}`),r(!1)}},v=async b=>{r(!0),n(null),p(await qP(b),b)},h=I.useRef(e);if(h.current!==null){const b=h.current;h.current=null,v(b)}const y=b=>{var f;b.preventDefault(),s(!1);const g=(f=b.dataTransfer.files)==null?void 0:f[0];g&&m(g)};return c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:c.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[c.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[c.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"playground"})]}),c.jsx("h2",{className:"font-display text-2xl uppercase tracking-tight text-ink-primary",children:"Drop an exported session"}),c.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 ",c.jsx("code",{className:"font-mono",children:"acp-devtools export <id>"})," ","— auth headers and proxy tokens are redacted by default."]}),c.jsxs("div",{role:"button",tabIndex:0,"aria-label":"Drop session export here or click to pick a file",onClick:()=>{var b;return(b=d.current)==null?void 0:b.click()},onKeyDown:b=>{var g;(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),(g=d.current)==null||g.click())},onDragOver:b=>{b.preventDefault(),s(!0)},onDragLeave:()=>s(!1),onDrop:y,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:[c.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:o?"Loading…":"Drop .json here"}),c.jsx("span",{className:"mt-1 font-mono text-[11px] text-ink-dim",children:"or click to pick a file"}),c.jsx("input",{ref:d,type:"file",accept:".json,application/json",className:"hidden",onChange:b=>{var f;const g=(f=b.target.files)==null?void 0:f[0];g&&m(g),b.target.value=""}})]}),c.jsxs("form",{className:"mt-4 flex items-center gap-2",onSubmit:b=>{b.preventDefault();const g=a.trim();g&&v(g)},children:[c.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"}),c.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"})]}),c.jsxs("p",{className:"mt-2 font-mono text-[10px] leading-relaxed text-ink-dim",children:["URL allowlist: ",cf.join(", "),". Gists are public — don't use this for anything you wouldn't post on Twitter."]}),t&&c.jsx("p",{className:"mt-3 font-mono text-[11px] text-accent-error",children:t})]})})}const LP=[.5,1,2,4,8];function DP(){const e=ne(h=>h.messages),t=ne(h=>h.playback),n=ne(h=>h.setPlayhead),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.playhead,l=a??i,d=a!==null&&a>=s,p=I.useRef(null);if(I.useEffect(()=>{if(!t.playing)return;if(d){o(!1);return}const h=a===null?-1:e.findIndex(u=>u.seq===a),y=e[h+1];if(!y){o(!1);return}const b=h>=0?e[h]:void 0,g=b?y.timestamp-b.timestamp:0,f=Math.max(15,Math.min(1500,g/t.speed));return p.current=setTimeout(()=>{n(y.seq)},f),()=>{p.current&&(clearTimeout(p.current),p.current=null)}},[t.playing,t.speed,a,e,d,n,o]),e.length===0)return null;const m=h=>{n(h),t.playing&&o(!1)},v=()=>{d?(n(null),o(!0)):o(!t.playing)};return c.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:[c.jsx("button",{type:"button",onClick:v,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":d?"restart playback":"play",children:t.playing?"❚❚":d?"↺":"▶"}),c.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-secondary",children:[String(a??0).padStart(3,"0")," / ",String(s).padStart(3,"0")]}),c.jsx("input",{type:"range",min:i,max:s,value:l,onChange:h=>m(Number(h.target.value)),className:"h-1 flex-1 cursor-pointer accent-accent-out"}),c.jsx("div",{className:"flex shrink-0 items-center gap-1",children:LP.map(h=>c.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))})]})}function ex(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 zP({open:e,onClose:t}){const n=ne(a=>a.session),o=ne(a=>a.messages),r=I.useMemo(()=>cl(o),[o]),{rendered:i,visible:s}=sf(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?c.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:c.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:[c.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[c.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Session info"}),c.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"})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:n?c.jsx(FP,{session:n,meta:r,messages:o}):c.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"No session attached."})})]})}):null}function FP({session:e,meta:t,messages:n}){const o=ex(5e3),{primary:r}=ql(e),i=I.useMemo(()=>HP(n),[n]);return c.jsxs("div",{className:"space-y-5 text-[12px]",children:[c.jsxs(Si,{title:"Summary",children:[c.jsx(mn,{label:"Session",value:r}),c.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}),c.jsx(mn,{label:"Agent",value:t.agent.name||BP(e.agentCommand)||"—",secondary:t.agent.version?`v${t.agent.version}`:null}),c.jsx(mn,{label:"Protocol",value:t.protocolVersion!==null?`ACP v${t.protocolVersion}`:"—"}),c.jsx(mn,{label:"Started",value:_a(e.startedAt,o)}),c.jsx(mn,{label:"Messages",value:`${n.length} (req ${i.req} · rsp ${i.rsp} · ntf ${i.note} · err ${i.err})`})]}),c.jsxs(Si,{title:"Client capabilities",children:[c.jsx(No,{label:"fs.readTextFile",enabled:t.clientCapabilities.fsReadTextFile}),c.jsx(No,{label:"fs.writeTextFile",enabled:t.clientCapabilities.fsWriteTextFile}),c.jsx(No,{label:"terminal",enabled:t.clientCapabilities.terminal}),c.jsx(No,{label:"auth.terminal",enabled:t.clientCapabilities.authTerminal}),c.jsx(No,{label:"auth.gateway",enabled:t.clientCapabilities.authGateway})]}),c.jsxs(Si,{title:"Agent capabilities",children:[c.jsx(No,{label:"prompt",enabled:t.agentCapabilities.prompt}),c.jsx(No,{label:"loadSession",enabled:t.agentCapabilities.loadSession}),c.jsx(mn,{label:"Auth methods",value:String(t.agent.authMethods)})]}),c.jsxs(Si,{title:"Runtime state",children:[c.jsx(mn,{label:"Mode",value:t.runtime.currentMode??"—",secondary:t.runtime.modeChanges>0?`changed ${t.runtime.modeChanges}× this session`:null}),c.jsx(mn,{label:"Model",value:t.runtime.currentModel??"—",secondary:t.runtime.modelChanges>0?`changed ${t.runtime.modelChanges}× this session`:null}),c.jsx(mn,{label:"Commands",value:t.runtime.availableCommands.length>0?t.runtime.availableCommands.join(", "):"—",wrap:!0})]}),t.extensions.jetbrainsProxyConfig!==null&&c.jsx(Si,{title:"JetBrains extensions",children:c.jsx("div",{className:"rounded-sm border border-line bg-surface-elev p-3 font-mono text-[11px] text-ink-secondary",children:c.jsx(al,{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 HP(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 Si({title:e,children:t}){return c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),c.jsx("div",{className:"space-y-1.5",children:t})]})}function mn({label:e,value:t,secondary:n,wrap:o=!1}){return c.jsxs("div",{className:"flex items-baseline gap-3",children:[c.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),c.jsxs("span",{className:K("flex-1 text-ink-primary",o?"whitespace-normal break-words":"truncate"),title:o?void 0:t,children:[t,n&&c.jsx("span",{className:"ml-2 text-[10px] text-ink-muted",children:n})]})]})}function No({label:e,enabled:t}){return c.jsxs("div",{className:"flex items-baseline gap-3",children:[c.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),c.jsx("span",{className:K("flex-1 font-mono text-[11px]",t?"text-accent-ok":"text-ink-dim"),children:t?"✓ enabled":"— not advertised"})]})}function VP({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),d=I.useRef(!1);I.useEffect(()=>{if(!s.current)return;const h=s.current.clientWidth,y=n?Number(localStorage.getItem(n)):NaN;n&&Number.isFinite(y)&&y>0&&y<h?l(y):l(Math.round(h*o))},[o,n]);const p=I.useCallback(h=>{h.preventDefault(),d.current=!0,h.currentTarget.setPointerCapture(h.pointerId)},[]),m=I.useCallback(h=>{if(!d.current||!s.current)return;const y=s.current.getBoundingClientRect(),b=h.clientX-y.left,g=y.width,f=Math.min(Math.max(b,r),g-i);l(f),n&&localStorage.setItem(n,String(Math.round(f)))},[r,i,n]),v=I.useCallback(h=>{d.current=!1;try{h.currentTarget.releasePointerCapture(h.pointerId)}catch{}},[]);return c.jsxs("div",{ref:s,className:"flex h-full w-full overflow-hidden",children:[c.jsx("div",{style:{width:a??"60%"},className:"flex h-full min-w-0 flex-col",children:e}),c.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:p,onPointerMove:m,onPointerUp:v,onPointerCancel:v,children:c.jsx("div",{className:"absolute inset-y-0 left-0 w-px bg-line transition-colors group-hover:bg-accent-out/40"})}),c.jsx("div",{className:"flex h-full min-w-0 flex-1 flex-col",children:t})]})}function WP(){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 h of e)switch(a.set(h.seq,h.timestamp),s+=h.raw.length,h.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),d=[];for(const h of e){if(h.kind!=="response"&&h.kind!=="error")continue;const y=l.get(h.seq);if(y===void 0)continue;const b=a.get(y);b!==void 0&&d.push(h.timestamp-b)}d.sort((h,y)=>h-y);const p=d.length?bh(d,50):null,m=d.length?bh(d,99):null,v=JN(tf(e));return{total:e.length,req:n,res:o,note:r,err:i,bytes:s,p50:p,p99:m,spec:v}},[e]);return c.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:[c.jsxs("div",{className:"flex items-center gap-5",children:[c.jsx(Yn,{label:"msgs",value:t.total,tone:"primary"}),c.jsx(Yn,{label:"req",value:t.req,tone:"out"}),c.jsx(Yn,{label:"rsp",value:t.res,tone:"in"}),c.jsx(Yn,{label:"ntf",value:t.note,tone:"note"}),c.jsx(Yn,{label:"err",value:t.err,tone:t.err>0?"error":"muted"})]}),c.jsxs("div",{className:"flex items-center gap-5",children:[c.jsx(Yn,{label:"p50",value:t.p50!==null?Vt(t.p50):"—",tone:"primary"}),c.jsx(Yn,{label:"p99",value:t.p99!==null?Vt(t.p99):"—",tone:"primary"}),c.jsx(Yn,{label:"bytes",value:t.total>0?Ul(t.bytes):"—",tone:"primary"}),t.spec.checked>0&&c.jsx(GP,{invalidFrames:t.spec.invalidFrames,totalErrors:t.spec.totalErrors,affectedMethods:t.spec.affectedMethods,advisoryFrames:t.spec.advisoryFrames,totalAdvisories:t.spec.totalAdvisories}),c.jsx(KP,{})]})]})}function KP(){return c.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:[c.jsx("span",{"aria-hidden":"true",className:"text-[10px]",children:"★"}),c.jsx("span",{className:"text-[9px] tracking-normal",children:"Star on GitHub"})]})}function GP({invalidFrames:e,totalErrors:t,affectedMethods:n,advisoryFrames:o,totalAdvisories:r}){const i=o>0?c.jsx(Ar,{tone:"warn",label:c.jsxs("span",{className:"font-sans",children:[r," field",r===1?"":"s"," a future ACP version will require ",r===1?"is":"are"," missing — valid today"]}),children:c.jsxs("span",{className:"text-accent-warn",children:["⚠ ",o]})}):null;if(e===0)return c.jsxs("span",{className:"inline-flex items-baseline gap-1.5",children:[c.jsx(Ar,{label:c.jsx("span",{className:"font-sans",children:"every frame validates against the ACP schema"}),tone:"info",children:c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{children:"spec"}),c.jsx("span",{className:"text-accent-ok",children:"✓"})]})}),i]});const s=`${t} schema error${t===1?"":"s"} in ${e} frame${e===1?"":"s"}`;return c.jsxs("span",{className:"inline-flex items-baseline gap-1.5",children:[c.jsx(Ar,{tone:"warn",label:c.jsxs("div",{className:"space-y-1.5 font-sans",children:[c.jsx("div",{children:s}),n.length>0&&c.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["methods: ",n.join(", ")]})]}),children:c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{children:"spec"}),c.jsxs("span",{className:"text-accent-error",children:["⚠ ",e]})]})}),i]})}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 c.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[c.jsx("span",{children:e}),c.jsx("span",{className:o,children:t})]})}const zl=0,$o=1,ri=2,tx=4;function zh(e){return()=>e}function JP(e){e()}function nx(e,t){return n=>e(t(n))}function Fh(e,t){return()=>e(t)}function QP(e,t){return n=>e(t,n)}function df(e){return e!==void 0}function YP(...e){return()=>{e.map(JP)}}function ii(){}function Fl(e,t){return t(e),e}function XP(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 uf(e){e(ri)}function Le(e){return e(tx)}function oe(e,t){return $e(e,QP(t,zl))}function cn(e,t){const n=e($o,o=>{n(),t(o)});return n}function Bh(e){let t,n;return o=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{o(t)},e)}}function ox(e,t){return e===t}function Me(e=ox){let t;return n=>o=>{e(t,o)||(t=o,n(o))}}function ae(e){return t=>n=>{e(n)&&t(n)}}function Z(e){return t=>nx(t,e)}function yn(e){return t=>()=>{t(e)}}function B(e,...t){const n=ZP(...t);return(o,r)=>{switch(o){case ri:uf(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 d=n;n|=a,t[s]=l,d!==r&&n===r&&o&&(o(),o=null)})}),i=>s=>{const a=()=>{i([s].concat(t))};n===r?a():o=a}}function ZP(...e){return t=>e.reduceRight(XP,t)}function eI(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(),ii);case ri: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 tx: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 ri: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:tI(),singleton:n}}const tI=()=>Symbol();function nI(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 ri:{uf(t);return}case $o:return o===r&&s(n),$e(t,s)}}}function se(e,t=ox){return B(e,Me(t))}function Hd(...e){return function(t,n){switch(t){case ri:return;case $o:return YP(...e.map(o=>$e(o,n)))}}}const nt={DEBUG:0,INFO:1,WARN:2,ERROR:3},oI={[nt.DEBUG]:"debug",[nt.ERROR]:"error",[nt.INFO]:"log",[nt.WARN]:"warn"},rI=()=>typeof globalThis>"u"?window:globalThis,ko=xe(()=>{const e=W(nt.ERROR);return{log:W((t,n,o=nt.INFO)=>{const r=rI().VIRTUOSO_LOG_LEVEL??Le(e);o>=r&&console[oI[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),Vd=new WeakMap;function rx(e){return"self"in e?e.document.documentElement:e}function iI(e){const t=rx(e),n=Vd.get(t);if(n!==void 0)return n;const o=t.ownerDocument.defaultView.getComputedStyle(t).direction==="rtl";return Vd.set(t,o),o}function Hh(e){Vd.delete(rx(e))}function ix(e,t){return iI(e)?-t:t}const Lo=ix;function Vh(e,t){return ix(e,t)}function Zo(e,t,n){return pf(e,t,n).callbackRef}function pf(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 sI(e,t,n,o,r,i,s,a,l){const d=te.useCallback(p=>{const m=aI(p.children,t,a?"offsetWidth":"offsetHeight",r);let v=p.parentElement;for(;v.dataset.virtuosoScroller===void 0;)v=v.parentElement;const h=v.lastElementChild.dataset.viewportType==="window";let y;h&&(y=v.ownerDocument.defaultView);const b=s?a?s.scrollWidth:s.scrollHeight:h?a?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight:a?v.scrollWidth:v.scrollHeight,g=s?a?s.offsetWidth:s.offsetHeight:h?a?y.innerWidth:y.innerHeight:a?v.offsetWidth:v.offsetHeight,f=s?a?Lo(s,s.scrollLeft):s.scrollTop:h?a?Lo(y,y.scrollX||y.document.documentElement.scrollLeft):y.scrollY||y.document.documentElement.scrollTop:a?Lo(v,v.scrollLeft):v.scrollTop;o({scrollHeight:b,scrollTop:Math.max(f,0),viewportHeight:g}),i==null||i(a?Wh("column-gap",getComputedStyle(p).columnGap,r):Wh("row-gap",getComputedStyle(p).rowGap,r)),m!==null&&e(m)},[e,t,r,i,s,o,a]);return pf(d,n,l)}function aI(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),d=parseFloat(a.dataset.knownSize),p=t(a,n);if(p===0&&o("Zero-sized element, this should not happen",{child:a},nt.ERROR),p===d)continue;const m=i[i.length-1];i.length===0||m.size!==p||m.endIndex!==l-1?i.push({endIndex:l,size:p,startIndex:l}):i[i.length-1].endIndex++}return i}function Wh(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 sx(e,t,n){const o=te.useRef(null),r=te.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const d=l.getBoundingClientRect(),p=d.width;let m,v;if(t){const h=t.getBoundingClientRect(),y=d.top-h.top;v=h.height-Math.max(0,y),m=y+t.scrollTop}else{const h=s.current.ownerDocument.defaultView;v=h.innerHeight-Math.max(0,d.top),m=d.top+h.scrollY}o.current={listHeight:d.height,offsetTop:m,visibleHeight:v,visibleWidth:p},e(o.current)},[e,t]),{callbackRef:i,ref:s}=pf(r,!0,n),a=te.useCallback(()=>{r(s.current)},[r,s]);return te.useEffect(()=>{var d;if(t){t.addEventListener("scroll",a);const p=new ResizeObserver(()=>{requestAnimationFrame(a)});return p.observe(t),()=>{t.removeEventListener("scroll",a),p.unobserve(t)}}const l=(d=s.current)==null?void 0:d.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),d=W(0),p=W(0),m=ve(),v=ve(),h=W(!1),y=W(!1),b=W(!1);return oe(B(e,Z(({scrollTop:g})=>g)),t),oe(B(e,Z(({scrollHeight:g})=>g)),s),oe(t,r),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:l,footerHeight:p,headerHeight:a,horizontalDirection:y,scrollBy:v,scrollContainerState:e,scrollHeight:s,scrollingInProgress:h,scrollTo:m,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:i}},[],{singleton:!0}),ys={lvl:0};function ax(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)?dx(t,n,1):t===e.k?Ze(e,{k:t,v:n}):t<e.k?Kh(Ze(e,{l:It(e.l,t,n)})):Kh(Ze(e,{r:It(e.r,t,n)}))}function qr(){return ys}function Ur(e,t,n){if(Te(e))return[];const o=un(e,t)[0];return lI(Kd(e,o,n))}function Wd(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]=cx(o);return Na(Ze(e,{k:i,l:lx(o),v:s}))}return t<n?Na(Ze(e,{l:Wd(o,t)})):Na(Ze(e,{r:Wd(r,t)}))}function Do(e){return Te(e)?[]:[...Do(e.l),{k:e.k,v:e.v},...Do(e.r)]}function Kd(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(Kd(r,t,n))),o>=t&&o<=n&&a.push({k:o,v:s}),o<=n&&(a=a.concat(Kd(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 ux(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 Gd(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:Gd(Ze(o,{l:r.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Ze(e,t){return dx(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 lx(e){return Te(e.r)?e.l:Na(Ze(e,{r:lx(e.r)}))}function _c(e){return Te(e)||e.lvl>e.r.lvl}function cx(e){return Te(e.r)?[e.k,e.v]:cx(e.r)}function dx(e,t,n,o=ys,r=ys){return{k:e,l:o,lvl:n,r,v:t}}function Kh(e){return Gd(ux(e))}function ux(e){const{l:t}=e;return!Te(t)&&t.lvl===e.lvl?Ze(t,{r:Ze(e,{l:t.r})}):e}function Gd(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 lI(e){return ax(e,({k:t,v:n})=>({index:t,value:n}))}function px(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 ff=xe(()=>({recalcInProgress:W(!1)}),[],{singleton:!0});function fx(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 cI(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 mf({index:e},t){return t===e?0:t<e?-1:1}function dI(){return{groupIndices:[],groupOffsetTree:qr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:qr()}}function uI(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=Ur(e,s-1,r+1);if(a.some(vI(o)))continue;let l=!1,d=!1;for(const{end:p,start:m,value:v}of a)l?(r>=m||i===v)&&(e=Wd(e,m)):(d=v!==i,l=!0),p>r&&r>=m&&v!==i&&(e=It(e,r+1,v));d&&(e=It(e,s,i))}return[e,n]}function pI(e){return typeof e.groupIndex<"u"}function fI({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}=fx(t,e,mf),s=e-o,a=i*s+(s-1)*n+r;return a>0?a+n:a}function mx(e,t){if(!Bl(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function hx(e,t,n){if(pI(e))return t.groupIndices[e.groupIndex]+1;const o=e.index==="LAST"?n:e.index;let r=mx(o,t);return r=Math.max(0,r,Math.min(n,r)),r}function mI(e,t,n,o=0){return o>0&&(t=Math.max(t,fx(e,o,mf).offset)),ax(cI(e,t,n,fI),gI)}function hI(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 v=t[0].size,h=t[1].size;s=n.reduce((y,b)=>It(It(y,b,v),b+1,h),s)}else[s,a]=uI(s,t);if(s===i)return e;const{lastIndex:l,lastOffset:d,lastSize:p,offsetTree:m}=Jd(e.offsetTree,a,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((v,h)=>It(v,h,bs(h,m,r)),qr()),lastIndex:l,lastOffset:d,lastSize:p,offsetTree:m,sizeTree:s}}function yI(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 Gh(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 Jd(e,t,n,o){let r=e,i=0,s=0,a=0,l=0;if(t!==0){l=ul(r,t-1,mf),a=r[l].offset;const d=un(n,t-1);i=d[0],s=d[1],r.length&&r[l].size===un(n,t)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:d,value:p}of Ur(n,t,1/0)){const m=d-i,v=m*s+a+m*o;r.push({index:d,offset:v,size:p}),i=d,a=v,s=p}return{lastIndex:i,lastOffset:a,lastSize:s,offsetTree:r}}function gI(e){return{index:e.index,value:e}}function vI(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 bI={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([]),d=W(void 0),p=W(void 0),m=W(void 0),v=W(void 0),h=W(($,j)=>bo($,bI[j])),y=W(void 0),b=W(0),g=dI(),f=yt(B(n,he(l,e,b),Sn(hI,g),Me()),g),u=yt(B(l,Me(),Sn(($,j)=>({current:j,prev:$.current}),{current:[],prev:[]}),Z(({prev:$})=>$)),[]);oe(B(l,ae($=>$.length>0),he(f,b),Z(([$,j,A])=>{const E=$.reduce((q,z,U)=>It(q,z,bs(z,j.offsetTree,A)||U),qr());return{...j,groupIndices:$,groupOffsetTree:E}})),f),oe(B(o,he(f),ae(([$,{lastIndex:j}])=>$<j),Z(([$,{lastIndex:j,lastSize:A}])=>[{endIndex:j,size:A,startIndex:$}])),n),oe(d,p);const x=yt(B(d,Z($=>$===void 0)),!0);oe(B(p,ae($=>$!==void 0&&Te(Le(f).sizeTree)),Z($=>{const j=Le(m),A=Le(l).length>0;return j!==void 0&&j!==0?A?[{endIndex:0,size:j,startIndex:0},{endIndex:1,size:$,startIndex:1}]:[]:[{endIndex:0,size:$,startIndex:0}]})),n),oe(B(v,ae($=>$!==void 0&&$.length>0&&Te(Le(f).sizeTree)),Z($=>{const j=[];let A=$[0],E=0;for(let q=1;q<$.length;q++){const z=$[q];z!==A&&(j.push({endIndex:q-1,size:A,startIndex:E}),A=z,E=q)}return j.push({endIndex:$.length-1,size:A,startIndex:E}),j})),n),oe(B(l,he(m,p),ae(([,$,j])=>$!==void 0&&j!==void 0),Z(([$,j,A])=>{const E=[];for(let q=0;q<$.length;q++){const z=$[q],U=$[q+1];E.push({startIndex:z,endIndex:z,size:j}),U!==void 0&&E.push({startIndex:z+1,endIndex:U-1,size:A})}return E})),n);const S=Mt(B(n,he(f),Sn(({sizes:$},[j,A])=>({changed:A!==$,sizes:A}),{changed:!1,sizes:g}),Z($=>$.changed)));$e(B(a,Sn(($,j)=>({diff:$.prev-j,prev:j}),{diff:0,prev:0}),Z($=>$.diff)),$=>{const{groupIndices:j}=Le(f);if($>0)me(t,!0),me(i,$+Gh($,j));else if($<0){const A=Le(u);A.length>0&&($-=Gh(-$,A)),me(s,$)}}),$e(B(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(B(i,he(f),Z(([$,j])=>{const A=j.groupIndices.length>0,E=[],q=j.lastSize;if(A){const z=gs(j.sizeTree,0);let U=0,L=0;for(;U<$;){const G=j.groupIndices[L],Y=j.groupIndices.length===L+1?1/0:j.groupIndices[L+1]-G-1;E.push({endIndex:G,size:z,startIndex:G}),E.push({endIndex:G+1+Y-1,size:q,startIndex:G+1}),L++,U+=Y+1}const F=Do(j.sizeTree);return U!==$&&F.shift(),F.reduce((G,{k:Y,v:D})=>{let J=G.ranges;return G.prevSize!==0&&(J=[...G.ranges,{endIndex:Y+$-1,size:G.prevSize,startIndex:G.prevIndex}]),{prevIndex:Y+$,prevSize:D,ranges:J}},{prevIndex:$,prevSize:0,ranges:E}).ranges}return Do(j.sizeTree).reduce((z,{k:U,v:L})=>({prevIndex:U+$,prevSize:L,ranges:[...z.ranges,{endIndex:U+$-1,size:z.prevSize,startIndex:z.prevIndex}]}),{prevIndex:0,prevSize:q,ranges:[]}).ranges})),n);const C=Mt(B(s,he(f,b),Z(([$,{offsetTree:j},A])=>{const E=-$;return bs(E,j,A)})));return oe(B(s,he(f,b),Z(([$,j,A])=>{if(j.groupIndices.length>0){if(Te(j.sizeTree))return j;let q=qr();const z=Le(u);let U=0,L=0,F=0;for(;U<-$;){F=z[L];const G=z[L+1]-F-1;L++,U+=G+1}if(q=Do(j.sizeTree).reduce((G,{k:Y,v:D})=>It(G,Math.max(0,Y+$),D),q),U!==-$){const G=gs(j.sizeTree,F);q=It(q,0,G);const Y=un(j.sizeTree,-$+1)[1];q=It(q,1,Y)}return{...j,sizeTree:q,...Jd(j.offsetTree,0,q,A)}}const E=Do(j.sizeTree).reduce((q,{k:z,v:U})=>It(q,Math.max(0,z+$),U),qr());return{...j,sizeTree:E,...Jd(j.offsetTree,0,E,A)}})),f),{beforeUnshiftWith:T,data:y,defaultItemSize:p,firstItemIndex:a,fixedItemSize:d,fixedGroupSize:m,gap:b,groupIndices:l,heightEstimates:v,itemSize:h,listRefresh:S,shiftWith:s,shiftWithOffset:C,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:i}},Ue(ko,ff),{singleton:!0});function xI(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const yx=xe(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const i=ve(),s=ve(),a=Mt(B(i,Z(xI)));return oe(B(a,Z(l=>l.totalCount)),n),oe(B(a,Z(l=>l.groupIndices)),e),oe(B(Qe(r,t,o),ae(([l,d])=>Bl(d)),Z(([l,d,p])=>un(d.groupOffsetTree,Math.max(l-p,0),"v")[0]),Me(),Z(l=>[l])),s),{groupCounts:i,topItemsIndexes:s}},Ue(Tn,kt)),To=xe(([{log:e}])=>{const t=W(!1),n=Mt(B(t,ae(o=>o),Me()));return $e(t,o=>{o&&Le(e)("props updated",{},nt.DEBUG)}),{didMount:n,propsReady:t}},Ue(ko),{singleton:!0}),wI=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function gx(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!wI)&&(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:d,smoothScrollTargetReached:p,viewportHeight:m},{log:v}])=>{const h=ve(),y=ve(),b=W(0);let g=null,f=null,u=null;function x(){g!==null&&(g(),g=null),u!==null&&(u(),u=null),f&&(clearTimeout(f),f=null),me(l,!1)}return oe(B(h,he(n,m,o,b,a,s,v),he(e,i,r),Z(([[S,T,C,$,j,A,E,q],z,U,L])=>{const F=gx(S),{align:G,behavior:Y,offset:D}=F,J=$-1,O=hx(F,T,J);let _=bs(O,T.offsetTree,z)+A;G==="end"?(_+=U+un(T.sizeTree,O)[1]-C+L,O===J&&(_+=E)):G==="center"?_+=(U+un(T.sizeTree,O)[1]-C+L)/2:_-=j,D!==void 0&&D!==0&&(_+=D);const M=P=>{x(),P?(q("retrying to scroll to",{location:S},nt.DEBUG),me(h,S)):(me(y,!0),q("list did not change, scroll successful",{},nt.DEBUG))};if(x(),Y==="smooth"){let P=!1;u=$e(t,w=>{P=P||w}),g=cn(p,()=>{M(P)})}else g=cn(B(t,SI(150)),M);return f=setTimeout(()=>{x()},1200),me(l,!0),q("scrolling from index to",{behavior:Y,index:O,top:_},nt.DEBUG),{behavior:Y,top:_}})),d),{scrollTargetReached:y,scrollToIndex:h,topListHeight:b}},Ue(Tn,kt,ko),{singleton:!0});function SI(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return o=>{o&&(t(!0),clearTimeout(n))}}}function hf(e,t){e===0?t():requestAnimationFrame(()=>{hf(e-1,t)})}function yf(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),d=W(!0);return oe(B(s,he(l),ae(([p,m])=>m!==0),yn(!1)),a),oe(B(s,he(l),ae(([p,m])=>m!==0),yn(!1)),d),$e(B(Qe(t,s),he(a,n,e,d),ae(([[,p],m,{sizeTree:v},h,y])=>p&&(!Te(v)||df(h))&&!m&&!y),he(l)),([,p])=>{cn(r,()=>{me(d,!0)}),hf(4,()=>{cn(o,()=>{me(a,!0)}),me(i,p)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:l,scrolledToInitialItem:a}},Ue(Tn,kt,Ps,To),{singleton:!0});function vx(e,t){return Math.abs(e-t)<1.01}const xs="up",Hi="down",$I="none",kI={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},TI=0,Os=xe(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:i}])=>{const s=W(!1),a=W(!0),l=ve(),d=ve(),p=W(4),m=W(TI),v=yt(B(Hd(B(se(r),Qo(1),yn(!0)),B(se(r),Qo(1),yn(!1),Bh(100))),Me()),!1),h=yt(B(Hd(B(n,yn(!0)),B(n,yn(!1),Bh(200))),Me()),!1);oe(B(Qe(se(r),se(m)),Z(([u,x])=>u<=x),Me()),a),oe(B(a,On(50)),d);const y=Mt(B(Qe(o,se(i),se(t),se(e),se(p)),Sn((u,[{scrollHeight:x,scrollTop:S},T,C,$,j])=>{const A=S+T-x>-j,E={scrollHeight:x,scrollTop:S,viewportHeight:T};if(A){let z,U;return S>u.state.scrollTop?(z="SCROLLED_DOWN",U=u.state.scrollTop-S):(z="SIZE_DECREASED",U=u.state.scrollTop-S||u.scrollTopDelta),{atBottom:!0,atBottomBecause:z,scrollTopDelta:U,state:E}}let q;return E.scrollHeight>u.state.scrollHeight?q="SIZE_INCREASED":T<u.state.viewportHeight?q="VIEWPORT_HEIGHT_DECREASING":S<u.state.scrollTop?q="SCROLLING_UPWARDS":q="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:q,state:E}},kI),Me((u,x)=>u!==void 0&&u.atBottom===x.atBottom))),b=yt(B(o,Sn((u,{scrollHeight:x,scrollTop:S,viewportHeight:T})=>{if(!vx(u.scrollHeight,x)){const C=x-(S+T)<1;return u.scrollTop!==S&&C?{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),Z(u=>u.jump)),0);oe(B(y,Z(u=>u.atBottom)),s),oe(B(s,On(50)),l);const g=W(Hi);oe(B(o,Z(({scrollTop:u})=>u),Me(),Sn((u,x)=>Le(h)?{direction:u.direction,prevScrollTop:x}:{direction:x<u.prevScrollTop?xs:Hi,prevScrollTop:x},{direction:Hi,prevScrollTop:0}),Z(u=>u.direction)),g),oe(B(o,On(50),yn($I)),g);const f=W(0);return oe(B(v,ae(u=>!u),yn(0)),f),oe(B(r,On(100),he(v),ae(([u,x])=>x),Sn(([u,x],[S])=>[x,S],[0,0]),Z(([u,x])=>x-u)),f),{atBottomState:y,atBottomStateChange:l,atBottomThreshold:p,atTopStateChange:d,atTopThreshold:m,isAtBottom:s,isAtTop:a,isScrolling:v,lastJumpDueToItemResize:b,scrollDirection:g,scrollVelocity:f}},Ue(kt)),ws="top",Ss="bottom",Jh="none";function Qh(e,t,n){return typeof e=="number"?n===xs&&t===ws||n===Hi&&t===Ss?e:0:n===xs?t===ws?e.main:e.reverse:t===Ss?e.main:e.reverse}function Yh(e,t){return typeof e=="number"?e:e[t]??0}const gf=xe(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const i=ve(),s=W(0),a=W(0),l=W(0),d=yt(B(Qe(se(o),se(r),se(n),se(i,vs),se(l),se(s),se(t),se(e),se(a)),Z(([p,m,v,[h,y],b,g,f,u,x])=>{const S=p-u,T=g+f,C=Math.max(v-S,0);let $=Jh;const j=Yh(x,ws),A=Yh(x,Ss);return h-=u,h+=v+f,y+=v+f,y-=u,h>p+T-j&&($=xs),y<p-C+m+A&&($=Hi),$!==Jh?[Math.max(S-v-Qh(b,ws,$)-j,0),S-C-f+m+Qh(b,Ss,$)+A]:null}),ae(p=>p!==null),Me(vs)),[0,0]);return{increaseViewportBy:a,listBoundary:i,overscan:l,topListHeight:s,visibleRange:d}},Ue(kt),{singleton:!0});function _I(e,t,n){if(Bl(t)){const o=mx(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 d=0,p=0;if(e.length>0){d=e[0].offset;const b=e[e.length-1];p=b.offset+b.size}const m=n-s,v=a+m*l+(m-1)*o,h=d,y=v-p;return{bottom:p,firstItemIndex:i,items:Xh(e,r,i),offsetBottom:y,offsetTop:d,top:h,topItems:Xh(t,r,i),topListHeight:t.reduce((b,g)=>g.size+b,0),totalCount:n}}function bx(e,t,n,o,r,i){let s=0;if(n.groupIndices.length>0)for(const p of n.groupIndices){if(p-s>=e)break;s++}const a=e+s,l=yf(t,a),d=Array.from({length:a}).map((p,m)=>({data:i[m+l],index:m+l,offset:0,size:0}));return Ca(d,[],a,r,n,o)}function Xh(e,t,n){if(e.length===0)return[];if(!Bl(t))return e.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const o=e[0].index,r=e[e.length-1].index,i=[],s=Ur(t.groupOffsetTree,o,r);let a,l=0;for(const d of e){(!a||a.end<d.index)&&(a=s.shift(),l=t.groupIndices.indexOf(a.start));let p;d.index===a.start?p={index:l,type:"group"}:p={groupIndex:l,index:d.index-(l+1)+n},i.push({...p,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return i}function Zh(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:d,scrolledToInitialItem:p},{topListHeight:m},v,{didMount:h},{recalcInProgress:y}])=>{const b=W([]),g=W(0),f=ve(),u=W(0);oe(i.topItemsIndexes,b);const x=yt(B(Qe(h,y,se(l,vs),se(r),se(o),se(d),p,se(b),se(t),se(n),se(u),e),ae(([$,j,,A,,,,,,,,E])=>{const q=E!==void 0&&E.length!==A;return $&&!j&&!q}),Z(([,,[$,j],A,E,q,z,U,L,F,G,Y])=>{var X,ie;const D=E,{offsetTree:J,sizeTree:O}=D,_=Le(g);if(A===0)return{...jc,totalCount:A};if($===0&&j===0)return _===0?{...jc,totalCount:A}:bx(_,q,E,L,F,Y||[]);if(Te(O))return _>0?null:Ca(_I(yf(q,A),D,Y),[],A,F,D,L);const M=[];if(U.length>0){const de=U[0],we=U[U.length-1];let ze=0;for(const Ee of Ur(O,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++)M.push({data:Y==null?void 0:Y[Pe],index:Pe,offset:ze,size:Se}),ze+=Se}}if(!z)return Ca([],M,A,F,D,L);const P=U.length>0?U[U.length-1]+1:0,w=mI(J,$,j,P);if(w.length===0)return null;const k=A-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+F)/(_e+F));const Pe=Se-we.start;Ee+=Pe*_e+Pe*F}Se<P&&(Ee+=(P-Se)*_e,Se=P);const Ye=Math.min(we.end,k);for(let Pe=Se;Pe<=Ye&&!(Ee>=j);Pe++)de.push({data:Y==null?void 0:Y[Pe],index:Pe,offset:Ee,size:_e}),Ee+=_e+F}}),H=Zh(G,ws),R=Zh(G,Ss);if(N.length>0&&(H>0||R>0)){const de=N[0],we=N[N.length-1];if(H>0&&de.index>P){const ze=Math.min(H,de.index-P),Ee=[];let Se=de.offset;for(let _e=de.index-1;_e>=de.index-ze;_e--){const Ye=((X=Ur(O,_e,_e)[0])==null?void 0:X.value)??de.size;Se-=Ye+F,Ee.unshift({data:Y==null?void 0:Y[_e],index:_e,offset:Se,size:Ye})}N.unshift(...Ee)}if(R>0&&we.index<k){const ze=Math.min(R,k-we.index);let Ee=we.offset+we.size+F;for(let Se=we.index+1;Se<=we.index+ze;Se++){const _e=((ie=Ur(O,Se,Se)[0])==null?void 0:ie.value)??we.size;N.push({data:Y==null?void 0:Y[Se],index:Se,offset:Ee,size:_e}),Ee+=_e+F}}}return Ca(N,M,A,F,D,L)}),ae($=>$!==null),Me()),jc);oe(B(e,ae(df),Z($=>$==null?void 0:$.length)),r),oe(B(x,Z($=>$.topListHeight)),m),oe(m,a),oe(B(x,Z($=>[$.top,$.bottom])),s),oe(B(x,Z($=>$.items)),f);const S=Mt(B(x,ae(({items:$})=>$.length>0),he(r,e),ae(([{items:$},j])=>$[$.length-1].originalIndex===j-1),Z(([,$,j])=>[$-1,j]),Me(vs),Z(([$])=>$))),T=Mt(B(x,On(200),ae(({items:$,topItems:j})=>$.length>0&&$[0].originalIndex===j.length),Z(({items:$})=>$[0].index),Me())),C=Mt(B(x,ae(({items:$})=>$.length>0),Z(({items:$})=>{let j=0,A=$.length-1;for(;$[j].type==="group"&&j<A;)j++;for(;$[A].type==="group"&&A>j;)A--;return{endIndex:$[A].index,startIndex:$[j].index}}),Me(px)));return{endReached:S,initialItemCount:g,itemsRendered:f,listState:x,minOverscanItemCount:u,rangeChanged:C,startReached:T,topItemsIndexes:b,...v}},Ue(Tn,yx,gf,Is,Ps,Os,To,ff),{singleton:!0}),xx=xe(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:o},{listState:r}])=>{const i=ve(),s=yt(B(Qe(n,e,o,t,r),Z(([a,l,d,p,m])=>a+l+d+p+m.offsetBottom+m.bottom)),0);return oe(se(s),i),{totalListHeight:s,totalListHeightChanged:i}},Ue(kt,er),{singleton:!0}),jI=xe(([{viewportHeight:e},{totalListHeight:t}])=>{const n=W(!1),o=yt(B(Qe(n,e,t),ae(([r])=>r),Z(([,r,i])=>Math.max(0,r-i)),On(0),Me()),0);return{alignToBottom:n,paddingTopAddition:o}},Ue(kt,xx),{singleton:!0}),wx=xe(()=>({context:W(null)})),NI=({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,Sx=xe(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:i,scrollingInProgress:s,scrollTop:a,viewportHeight:l},{scrollToIndex:d}])=>{const p=ve();return oe(B(p,he(t,l,n,i,r,o,a),he(e),Z(([[m,v,h,y,b,g,f,u],x])=>{const{calculateViewLocation:S=NI,done:T,...C}=m,$=hx(m,v,y-1),j=bs($,v.offsetTree,x)+b+g,A=j+un(v.sizeTree,$)[1],E=u+g,q=u+h-f,z=S({itemBottom:A,itemTop:j,locationParams:C,viewportBottom:q,viewportTop:E});return z!==null?T&&cn(B(s,ae(U=>!U),Qo(Le(s)?1:2)),T):T==null||T(),z}),ae(m=>m!==null)),d),{scrollIntoView:p}},Ue(Tn,kt,Ps,er,ko),{singleton:!0});function ey(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const CI=(e,t)=>typeof e=="function"?ey(e(t)):t&&ey(e),EI=xe(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:i},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:l,propsReady:d},{log:p},{scrollingInProgress:m},{context:v},{scrollIntoView:h}])=>{const y=W(!1),b=ve();let g=null;function f(T){me(s,{align:"end",behavior:T,index:"LAST"})}$e(B(Qe(B(se(t),Qo(1)),l),he(se(y),i,a,m),Z(([[T,C],$,j,A,E])=>{let q=C&&A,z="auto";return q&&(z=CI($,j||E),q=q&&z!==!1),{followOutputBehavior:z,shouldFollow:q,totalCount:T}}),ae(({shouldFollow:T})=>T)),({followOutputBehavior:T,totalCount:C})=>{g!==null&&(g(),g=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(p)("following output to ",{totalCount:C},nt.DEBUG),f(T)}):g=cn(e,()=>{Le(p)("following output to ",{totalCount:C},nt.DEBUG),f(T),g=null})});function u(T){const C=cn(r,$=>{T&&!$.atBottom&&$.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(Le(p)("scrolling to bottom due to increased size",{},nt.DEBUG),f("auto"))});setTimeout(C,100)}$e(B(Qe(se(y),t,d),ae(([T,,C])=>T!==!1&&C),Sn(({value:T},[,C])=>({refreshed:T===C,value:C}),{refreshed:!1,value:0}),ae(({refreshed:T})=>T),he(y,t)),([,T])=>{Le(a)&&u(T!==!1)}),$e(b,()=>{u(Le(y)!==!1)}),$e(Qe(se(y),r),([T,C])=>{T!==!1&&!C.atBottom&&C.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const x=W(null),S=ve();return oe(Hd(B(se(o),Z(T=>(T==null?void 0:T.length)??0)),B(se(t))),S),$e(B(Qe(B(S,Qo(1)),l),he(se(x),a,m,v),Z(([[T,C],$,j,A,E])=>C&&j&&($==null?void 0:$({context:E,totalCount:T,scrollingInProgress:A}))),ae(T=>!!T),On(0)),T=>{g!==null&&(g(),g=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(p)("scrolling into view",{}),me(h,T)}):g=cn(e,()=>{Le(p)("scrolling into view",{}),me(h,T),g=null})}),{autoscrollToBottom:b,followOutput:y,scrollIntoViewOnChange:x}},Ue(Tn,Os,Ps,Is,To,ko,kt,wx,Sx)),PI=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:i,listState:s},{didMount:a}])=>(oe(B(a,he(i),ae(([,l])=>l!==0),he(r,o,t,n,e),Z(([[,l],d,p,m,v,h=[]])=>bx(l,d,p,m,v,h))),s),{}),Ue(Tn,Is,er,To),{singleton:!0}),II=xe(([{didMount:e},{scrollTo:t},{listState:n}])=>{const o=W(0);return $e(B(e,he(o),ae(([,r])=>r!==0),Z(([,r])=>({top:r}))),r=>{cn(B(n,Qo(1),ae(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{me(t,r)})})}),{initialScrollTop:o}},Ue(To,kt,er),{singleton:!0}),$x=xe(([{scrollVelocity:e}])=>{const t=W(!1),n=ve(),o=W(!1);return oe(B(e,he(o,t,n),ae(([r,i])=>i!==!1&&i!==void 0),Z(([r,i,s,a])=>{const{enter:l,exit:d}=i;if(s){if(d(r,a))return!1}else if(l(r,a))return!0;return s}),Me()),t),$e(B(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}),vf=xe(([{scrollContainerState:e,scrollTo:t}])=>{const n=ve(),o=ve(),r=ve(),i=W(!1),s=W(void 0);return oe(B(Qe(n,o),Z(([{scrollTop:a,viewportHeight:l},{offsetTop:d,listHeight:p}])=>({scrollHeight:p,scrollTop:Math.max(0,a-d),viewportHeight:l}))),e),oe(B(t,he(o),Z(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:s,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},Ue(kt)),OI=xe(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:l}])=>{const d=ve(),p=W(void 0),m=W(null),v=W(null);return oe(a,m),oe(l,v),$e(B(d,he(t,o,s,m,v,n)),([h,y,b,g,f,u,x])=>{const S=yI(y.sizeTree);g&&f!==null&&u!==null&&(b=f.scrollTop-u.offsetTop),b-=x,h({ranges:S,scrollTop:b})}),oe(B(p,ae(df),Z(RI)),r),oe(B(i,he(p),ae(([,h])=>h!==void 0),Me(),Z(([,h])=>h.ranges)),e),{getState:d,restoreStateFrom:p}},Ue(Tn,kt,Is,To,vf));function RI(e){return{align:"start",index:0,offset:e.scrollTop}}const AI=xe(([{topItemsIndexes:e}])=>{const t=W(0);return oe(B(t,ae(n=>n>=0),Z(n=>Array.from({length:n}).map((o,r)=>r))),e),{topItemCount:t}},Ue(er));function kx(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const MI=kx(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),qI=xe(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:i,lastJumpDueToItemResize:s,scrollDirection:a},{listState:l},{beforeUnshiftWith:d,gap:p,shiftWithOffset:m,sizes:v},{log:h},{recalcInProgress:y}])=>{const b=Mt(B(l,he(s),Sn(([,f,u,x],[{bottom:S,items:T,offsetBottom:C,totalCount:$},j])=>{const A=S+C;let E=0;return u===$&&f.length>0&&T.length>0&&(T[0].originalIndex===0&&f[0].originalIndex===0||(E=A-x,E!==0&&(E+=j))),[E,T,$,A]},[0,[],0,0]),ae(([f])=>f!==0),he(o,a,n,r,h,y),ae(([,f,u,x,,,S])=>!S&&!x&&f!==0&&u===xs),Z(([[f],,,,,u])=>(u("Upward scrolling compensation",{amount:f},nt.DEBUG),f))));function g(f){f>0?(me(t,{behavior:"auto",top:-f}),me(e,0)):(me(e,0),me(t,{behavior:"auto",top:-f}))}return $e(B(b,he(e,i)),([f,u,x])=>{x&&MI()?me(e,u-f):g(-f)}),$e(B(Qe(yt(i,!1),e,y),ae(([f,u,x])=>!f&&!x&&u!==0),Z(([f,u])=>u),On(1)),g),oe(B(m,Z(f=>({top:-f}))),t),$e(B(d,he(v,p),Z(([f,{groupIndices:u,lastSize:x,sizeTree:S},T])=>{function C(q){return q*(x+T)}if(u.length===0)return C(f);let $=0;const j=gs(S,0);let A=0,E=0;for(;A<f;){A++,$+=j;let q=u.length===E+1?1/0:u[E+1]-u[E]-1;A+q>f&&($-=j,q=f-A+1),A+=q,$+=C(q),E++}return $})),f=>{me(e,f),requestAnimationFrame(()=>{me(t,{top:f}),requestAnimationFrame(()=>{me(e,0),me(y,!1)})})}),{deviation:e}},Ue(kt,Os,er,Tn,ko,ff)),UI=xe(([e,t,n,o,r,i,s,a,l,d,p])=>({...e,...t,...n,...o,...r,...i,...s,...a,...l,...d,...p}),Ue(gf,PI,To,$x,xx,II,jI,vf,Sx,ko,wx)),Tx=xe(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:i,groupIndices:s,heightEstimates:a,itemSize:l,sizeRanges:d,sizes:p,statefulTotalCount:m,totalCount:v,trackItemSizes:h},{initialItemFinalLocationReached:y,initialTopMostItemIndex:b,scrolledToInitialItem:g},f,u,x,S,{scrollToIndex:T},C,{topItemCount:$},{groupCounts:j},A])=>{const{listState:E,minOverscanItemCount:q,topItemsIndexes:z,rangeChanged:U,...L}=S;return oe(U,A.scrollSeekRangeChanged),oe(B(A.windowViewportRect,Z(F=>F.visibleHeight)),f.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:i,groupCounts:j,heightEstimates:a,initialItemFinalLocationReached:y,initialTopMostItemIndex:b,scrolledToInitialItem:g,sizeRanges:d,topItemCount:$,topItemsIndexes:z,totalCount:v,...x,groupIndices:s,itemSize:l,listState:E,minOverscanItemCount:q,scrollToIndex:T,statefulTotalCount:m,trackItemSizes:h,rangeChanged:U,...L,...A,...f,sizes:p,...u}},Ue(Tn,Is,kt,OI,EI,er,Ps,qI,AI,yx,UI));function LI(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 _x(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(g,f){g.propsReady!==void 0&&me(g.propsReady,!1);for(const u of o){const x=g[t.required[u]];me(x,f[u])}for(const u of r)if(u in f){const x=g[t.optional[u]];me(x,f[u])}g.propsReady!==void 0&&me(g.propsReady,!0)}function d(g){return i.reduce((f,u)=>(f[u]=x=>{const S=g[t.methods[u]];me(S,x)},f),{})}function p(g){return s.reduce((f,u)=>(f[u]=eI(g[t.events[u]]),f),{})}const m=te.forwardRef(function(g,f){const{children:u,...x}=g,[S]=te.useState(()=>Fl(nI(e),$=>{l($,x)})),[T]=te.useState(Fh(p,S));ra(()=>{for(const $ of s)$ in x&&$e(T[$],x[$]);return()=>{Object.values(T).map(uf)}},[x,T,S]),ra(()=>{l(S,x)}),te.useImperativeHandle(f,zh(d(S)));const C=n;return c.jsx(a.Provider,{value:S,children:n!==void 0?c.jsx(C,{...LI([...o,...r,...s],x),children:u}):u})}),v=g=>{const f=te.useContext(a);return te.useCallback(u=>{me(f[g],u)},[f,g])},h=g=>{const f=te.useContext(a)[g],u=te.useCallback(x=>$e(f,x),[f]);return te.useSyncExternalStore(u,()=>Le(f),()=>Le(f))},y=g=>{const f=te.useContext(a)[g],[u,x]=te.useState(Fh(Le,f));return ra(()=>$e(f,S=>{S!==u&&x(zh(S))}),[f,u]),u},b=parseInt(te.version)>=18?h:y;return{Component:m,useEmitter:(g,f)=>{const u=te.useContext(a)[g];ra(()=>$e(u,f),[f,u])},useEmitterValue:b,usePublisher:v}}const jx=te.createContext(void 0),Nx=te.createContext(void 0),Nc="-webkit-sticky",ty="sticky",bf=kx(()=>{if(typeof document>"u")return ty;const e=document.createElement("div");return e.style.position=Nc,e.style.position===Nc?Nc:ty}),Cx=typeof document<"u"?te.useLayoutEffect:te.useEffect;function Cc(e){return"self"in e}function DI(e){return"body"in e}function Ex(e,t,n,o=ii,r,i){const s=te.useRef(null),a=te.useRef(null),l=te.useRef(null),d=te.useCallback(v=>{let h,y,b;const g=v.target;if(DI(g)||Cc(g)){const u=Cc(g)?g:g.defaultView;b=i===!0?Lo(u,u.scrollX):u.scrollY,h=i===!0?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight,y=i===!0?u.innerWidth:u.innerHeight}else b=i===!0?Lo(g,g.scrollLeft):g.scrollTop,h=i===!0?g.scrollWidth:g.scrollHeight,y=i===!0?g.offsetWidth:g.offsetHeight;const f=()=>{e({scrollHeight:h,scrollTop:Math.max(b,0),viewportHeight:y})};v.suppressFlushSync===!0?f():dS.flushSync(f),a.current!==null&&(b===a.current||b<=0||b===h-y)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);te.useEffect(()=>{const v=r||s.current;return Hh(v),o(r||s.current),d({suppressFlushSync:!0,target:v}),v.addEventListener("scroll",d,{passive:!0}),()=>{Hh(v),o(null),v.removeEventListener("scroll",d)}},[s,d,n,o,r]);function p(v){const h=s.current;if(!h||(i===!0?"offsetWidth"in h&&h.offsetWidth===0:"offsetHeight"in h&&h.offsetHeight===0))return;const y=v.behavior==="smooth";let b,g,f;Cc(h)?(g=Math.max(bo(h.document.documentElement,i===!0?"width":"height"),i===!0?h.document.documentElement.scrollWidth:h.document.documentElement.scrollHeight),b=i===!0?h.innerWidth:h.innerHeight,f=i===!0?Lo(h,h.scrollX):h.scrollY):(g=h[i===!0?"scrollWidth":"scrollHeight"],b=bo(h,i===!0?"width":"height"),f=i===!0?Lo(h,h.scrollLeft):h.scrollTop);const u=g-b;if(v.top===void 0){h.scrollTo(v);return}const x=Math.ceil(Math.max(Math.min(u,v.top),0));if(v.top=x,vx(b,g)||x===f){e({scrollHeight:g,scrollTop:f,viewportHeight:b}),y&&t(!0);return}y?(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&&(v={...v.behavior!==void 0?{behavior:v.behavior}:{},left:Vh(h,x)}),h.scrollTo(v)}function m(v){i===!0&&(v={...v.behavior!==void 0?{behavior:v.behavior}:{},...v.top!==void 0?{left:Vh(s.current,v.top)}:{}}),s.current.scrollBy(v)}return{scrollByCallback:m,scrollerRef:s,scrollToCallback:p}}function xf(e){return e}const zI=xe(()=>{const e=W(a=>`Item ${a}`),t=W(a=>`Group ${a}`),n=W({}),o=W(xf),r=W("div"),i=W(ii),s=(a,l=null)=>yt(B(n,Z(d=>d[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")}}),FI=xe(([e,t])=>({...e,...t}),Ue(Tx,zI)),BI=({height:e})=>c.jsx("div",{style:{height:e}}),HI={overflowAnchor:"none",position:bf(),zIndex:1},Px={overflowAnchor:"none"},VI={...Px,display:"inline-block",height:"100%"},ny=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"),d=ce("context"),p=ce("groupContent"),m=ce("trackItemSizes"),v=ce("itemSize"),h=ce("log"),y=Wt("gap"),b=ce("horizontalDirection"),{callbackRef:g}=sI(n,v,m,e?ii:a,h,y,r,b,ce("skipAnimationFrameInResizeObserver")),[f,u]=te.useState(0);Sf("deviation",L=>{f!==L&&u(L)});const x=ce("EmptyPlaceholder"),S=ce("ScrollSeekPlaceholder")??BI,T=ce("ListComponent"),C=ce("ItemComponent"),$=ce("GroupComponent"),j=ce("computeItemKey"),A=ce("isSeeking"),E=ce("groupIndices").length>0,q=ce("alignToBottom"),z=ce("initialItemFinalLocationReached"),U=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginInlineStart:f!==0?f:q?"auto":0,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:f!==0?f:q?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...z?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&x!==null&&x!==void 0?c.jsx(x,{...ht(x,d)}):c.jsx(T,{...ht(T,d),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:U,children:(e?t.topItems:t.items).map(L=>{const F=L.originalIndex,G=j(F+t.firstItemIndex,L.data,d);return A?I.createElement(S,{...ht(S,d),height:L.size,index:L.index,key:G,type:L.type||"item",...L.type==="group"?{}:{groupIndex:L.groupIndex}}):L.type==="group"?I.createElement($,{...ht($,d),"data-index":F,"data-item-index":L.index,"data-known-size":L.size,key:G,style:HI},p(L.index,d)):I.createElement(C,{...ht(C,d),...JI(C,L.data),"data-index":F,"data-item-group-index":L.groupIndex,"data-item-index":L.index,"data-known-size":L.size,key:G,style:b?VI:Px},E?l(L.index,L.groupIndex,L.data,d):l(L.index,L.data,d))})})}),WI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},KI={outline:"none",overflowX:"auto",position:"relative"},wf=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),Ix=(e,t,n=0)=>({...wf(e),position:t?"relative":"absolute",top:t?-n:0}),GI={position:bf(),top:0,width:"100%",zIndex:1};function ht(e,t){if(typeof e!="string")return{context:t}}function JI(e,t){return{item:typeof e=="string"?void 0:t}}const QI=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?c.jsx(n,{ref:o,children:c.jsx(e,{...ht(e,r)})}):null}),YI=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?c.jsx(n,{ref:o,children:c.jsx(e,{...ht(e,r)})}):null});function Ox({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("scrollContainerState"),l=t("ScrollerComponent"),d=n("smoothScrollTargetReached"),p=t("scrollerRef"),m=t("horizontalDirection")||!1,{scrollByCallback:v,scrollerRef:h,scrollToCallback:y}=Ex(a,d,l,p,void 0,m);return e("scrollTo",y),e("scrollBy",v),c.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...m?KI:WI,...r},tabIndex:0,...s,...ht(l,i),children:o})})}function Rx({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("windowScrollContainerState"),l=t("ScrollerComponent"),d=n("smoothScrollTargetReached"),p=t("totalListHeight"),m=t("deviation"),v=t("customScrollParent"),h=te.useRef(null),y=t("scrollerRef"),{scrollByCallback:b,scrollerRef:g,scrollToCallback:f}=Ex(a,d,l,y,v);return Cx(()=>{var u;return g.current=v||((u=h.current)==null?void 0:u.ownerDocument.defaultView),()=>{g.current=null}},[g,v]),e("windowScrollTo",f),e("scrollBy",b),c.jsx(l,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...p!==0?{height:p+m}:void 0},...s,...ht(l,i),children:o})})}const XI=({children:e})=>{const t=te.useContext(jx),n=Wt("viewportHeight"),o=Wt("fixedItemHeight"),r=ce("alignToBottom"),i=ce("horizontalDirection"),s=te.useMemo(()=>nx(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]),c.jsx("div",{"data-viewport-type":"element",ref:a,style:wf(r),children:e})},ZI=({children:e})=>{const t=te.useContext(jx),n=Wt("windowViewportRect"),o=Wt("fixedItemHeight"),r=ce("customScrollParent"),i=ce("useWindowScroll"),s=ce("topListHeight"),a=sx(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]),c.jsx("div",{"data-viewport-type":"window",ref:a,style:Ix(l,i,s),children:e})},eO=({children:e})=>{const t=ce("TopItemListComponent")??"div",n=ce("headerHeight"),o={...GI,marginTop:`${n}px`},r=ce("context");return c.jsx(t,{style:o,...ht(t,r),children:e})},tO=te.memo(function(e){const t=ce("useWindowScroll"),n=ce("topItemsIndexes").length>0,o=ce("customScrollParent"),r=ce("context");return c.jsxs(o||t?rO:oO,{...e,context:r,children:[n&&c.jsx(eO,{children:c.jsx(ny,{showTopList:!0})}),c.jsxs(o||t?ZI:XI,{children:[c.jsx(QI,{}),c.jsx(ny,{}),c.jsx(YI,{})]})]})}),{Component:nO,useEmitter:Sf,useEmitterValue:ce,usePublisher:Wt}=_x(FI,{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"}},tO),oO=Ox({useEmitter:Sf,useEmitterValue:ce,usePublisher:Wt}),rO=Rx({useEmitter:Sf,useEmitterValue:ce,usePublisher:Wt}),iO=nO,sO=xe(()=>{const e=W(d=>c.jsxs("td",{children:["Item $",d]})),t=W(null),n=W(d=>c.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=W(null),r=W(null),i=W({}),s=W(xf),a=W(ii),l=(d,p=null)=>yt(B(i,Z(m=>m[d]),Me()),p);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(Tx,sO);bf();const oy={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},aO={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:ry,floor:pl,max:Vi,min:Ec,round:iy}=Math;function sy(e,t,n){return Array.from({length:t-e+1}).map((o,r)=>({data:n===null?null:n[r+e],index:r+e}))}function lO(e){return{...aO,items:e}}function ia(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function cO(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const dO=xe(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:i,scrollBy:s,scrollContainerState:a,scrollTo:l,scrollTop:d,smoothScrollTargetReached:p,viewportHeight:m},v,h,{didMount:y,propsReady:b},{customScrollParent:g,useWindowScroll:f,windowScrollContainerState:u,windowScrollTo:x,windowViewportRect:S},T])=>{const C=W(0),$=W(0),j=W(oy),A=W({height:0,width:0}),E=W({height:0,width:0}),q=ve(),z=ve(),U=W(0),L=W(null),F=W({column:0,row:0}),G=ve(),Y=ve(),D=W(!1),J=W(0),O=W(!0),_=W(!1),M=W(!1);$e(B(y,he(J),ae(([R,X])=>X!==0)),()=>{me(O,!1)}),$e(B(Qe(y,O,E,A,J,_),ae(([R,X,ie,de,,we])=>R&&!X&&ie.height!==0&&de.height!==0&&!we)),([,,,,R])=>{me(_,!0),hf(1,()=>{me(q,R)}),cn(B(d),()=>{me(t,[0,0]),me(O,!0)})}),oe(B(Y,ae(R=>R!=null&&R.scrollTop>0),yn(0)),$),$e(B(y,he(Y),ae(([,R])=>R!=null)),([,R])=>{R&&(me(A,R.viewport),me(E,R.item),me(F,R.gap),R.scrollTop>0&&(me(D,!0),cn(B(d,Qo(1)),X=>{me(D,!1)}),me(l,{top:R.scrollTop})))}),oe(B(A,Z(({height:R})=>R)),m),oe(B(Qe(se(A,ia),se(E,ia),se(F,(R,X)=>R!==void 0&&R.column===X.column&&R.row===X.row),se(d)),Z(([R,X,ie,de])=>({gap:ie,item:X,scrollTop:de,viewport:R}))),G),oe(B(Qe(se(C),o,se(F,cO),se(E,ia),se(A,ia),se(L),se($),se(D),se(O),se(J)),ae(([,,,,,,,R])=>!R),Z(([R,[X,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&&(R===0||tr===0))return oy;if(_o===0){const $f=yf(Ye,R),Ux=$f+Math.max(Se-1,0);return lO(sy($f,Ux,Ee))}const Hn=Ax(tr,_o,Pe);let pn,Yt;_e?X===0&&ie===0&&Se>0?(pn=0,Yt=Se-1):(pn=Hn*pl((X+_n)/(Bn+_n)),Yt=Hn*ry((ie+_n)/(Bn+_n))-1,Yt=Ec(R-1,Vi(Yt,Hn-1)),pn=Ec(Yt,Vi(0,pn))):(pn=0,Yt=-1);const Vn=sy(pn,Yt,Ee),{bottom:nr,top:si}=ay(ze,de,we,Vn),ai=ry(R/Hn),Hl=ai*Bn+(ai-1)*_n-nr;return{bottom:nr,itemHeight:Bn,items:Vn,itemWidth:_o,offsetBottom:Hl,offsetTop:si,top:si}})),j),oe(B(L,ae(R=>R!==null),Z(R=>R.length)),C),oe(B(Qe(A,E,j,F),ae(([R,X,{items:ie}])=>ie.length>0&&X.height!==0&&R.height!==0),Z(([R,X,{items:ie},de])=>{const{bottom:we,top:ze}=ay(R,de,X,ie);return[ze,we]}),Me(vs)),t);const P=W(!1);oe(B(d,he(P),Z(([R,X])=>X||R!==0)),P);const w=Mt(B(Qe(j,C),ae(([{items:R}])=>R.length>0),he(P),ae(([[R,X],ie])=>{const de=R.items[R.items.length-1].index===X-1;return(ie||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===X)&&de}),Z(([[,R]])=>R-1),Me())),k=Mt(B(se(j),ae(({items:R})=>R.length>0&&R[0].index===0),yn(0),Me())),N=Mt(B(se(j),he(D),ae(([{items:R},X])=>R.length>0&&!X),Z(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),Me(px),On(0)));oe(N,h.scrollSeekRangeChanged),oe(B(q,he(A,E,C,F),Z(([R,X,ie,de,we])=>{const ze=gx(R),{align:Ee,behavior:Se,offset:_e}=ze;let Ye=ze.index;Ye==="LAST"&&(Ye=de-1),Ye=Vi(0,Ye,Ec(de-1,Ye));let Pe=Qd(X,we,ie,Ye);return Ee==="end"?Pe=iy(Pe-X.height+ie.height):Ee==="center"&&(Pe=iy(Pe-X.height/2+ie.height/2)),_e!==void 0&&_e!==0&&(Pe+=_e),{behavior:Se,top:Pe}})),l);const H=yt(B(j,Z(R=>R.offsetBottom+R.bottom)),0);return oe(B(S,Z(R=>({height:R.visibleHeight,width:R.visibleWidth}))),A),{customScrollParent:g,data:L,deviation:U,footerHeight:r,gap:F,headerHeight:i,increaseViewportBy:e,initialItemCount:$,itemDimensions:E,overscan:n,restoreStateFrom:Y,scrollBy:s,scrollContainerState:a,scrollHeight:z,scrollTo:l,scrollToIndex:q,scrollTop:d,smoothScrollTargetReached:p,totalCount:C,useWindowScroll:f,viewportDimensions:A,windowScrollContainerState:u,windowScrollTo:x,windowViewportRect:S,...h,gridState:j,horizontalDirection:M,initialTopMostItemIndex:J,totalListHeight:H,...v,endReached:w,propsReady:b,rangeChanged:N,startReached:k,stateChanged:G,stateRestoreInProgress:D,...T}},Ue(gf,kt,Os,$x,To,vf,ko));function Ax(e,t,n){return Vi(1,pl((e+n)/(pl(t)+n)))}function ay(e,t,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const i=Qd(e,t,n,o[0].index);return{bottom:Qd(e,t,n,o[o.length-1].index)+r,top:i}}function Qd(e,t,n,o){const r=Ax(e.width,n.width,t.column),i=pl(o/r),s=i*n.height+Vi(0,i-1)*t.row;return s>0?s+t.row:s}const uO=xe(()=>{const e=W(m=>`Item ${m}`),t=W({}),n=W(null),o=W("virtuoso-grid-item"),r=W("virtuoso-grid-list"),i=W(xf),s=W("div"),a=W(ii),l=(m,v=null)=>yt(B(t,Z(h=>h[m]),Me()),v),d=W(!1),p=W(!1);return oe(se(p),d),{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:d,reportReadyState:p,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),pO=xe(([e,t])=>({...e,...t}),Ue(dO,uO)),fO=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"),d=Re("ScrollSeekPlaceholder"),p=Re("context"),m=Kt("itemDimensions"),v=Kt("gap"),h=Re("log"),y=Re("stateRestoreInProgress"),b=Kt("reportReadyState"),g=Zo(te.useMemo(()=>f=>{const u=f.parentElement.parentElement.scrollHeight;s(u);const x=f.firstChild;if(x!==null){const{height:S,width:T}=x.getBoundingClientRect();m({height:S,width:T})}v({column:ly("column-gap",getComputedStyle(f).columnGap,h),row:ly("row-gap",getComputedStyle(f).rowGap,h)})},[s,m,v,h]),!0,!1);return Cx(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),y?null:c.jsx(l,{className:t,ref:g,...ht(l,p),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(f=>{const u=r(f.index,f.data,p);return i?c.jsx(d,{...ht(d,p),height:e.itemHeight,index:f.index,width:e.itemWidth},u):I.createElement(a,{...ht(a,p),className:n,"data-index":f.index,key:u},o(f.index,f.data,p))})})}),mO=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?c.jsx(n,{ref:o,children:c.jsx(e,{...ht(e,r)})}):null}),hO=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?c.jsx(n,{ref:o,children:c.jsx(e,{...ht(e,r)})}):null}),yO=({children:e})=>{const t=te.useContext(Nx),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]),c.jsx("div",{ref:r,style:wf(!1),children:e})},gO=({children:e})=>{const t=te.useContext(Nx),n=Kt("windowViewportRect"),o=Kt("itemDimensions"),r=Re("customScrollParent"),i=Re("useWindowScroll"),s=sx(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]),c.jsx("div",{ref:s,style:Ix(!1,i),children:e})},vO=te.memo(function({...e}){const t=Re("useWindowScroll"),n=Re("customScrollParent"),o=n||t?xO:bO,r=n||t?gO:yO,i=Re("context");return c.jsx(o,{...e,...ht(o,i),children:c.jsxs(r,{children:[c.jsx(mO,{}),c.jsx(fO,{}),c.jsx(hO,{})]})})}),{useEmitter:Mx,useEmitterValue:Re,usePublisher:Kt}=_x(pO,{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"}},vO),bO=Ox({useEmitter:Mx,useEmitterValue:Re,usePublisher:Kt}),xO=Rx({useEmitter:Mx,useEmitterValue:Re,usePublisher:Kt});function ly(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 wO(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 SO(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=wO(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 $O(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 kO(e){return e.method==="session/prompt"&&e.kind==="request"}const TO={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"???"},_O={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"},jO={"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 NO(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 CO({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?dE(o):null,d=$O(e),p=kO(e),m=r&&!r.skipped&&!r.valid,v=r==null?void 0:r.advisories,h=v&&v.length>0;return c.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:[c.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":"")}),c.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(e.seq).padStart(3,"0")}),c.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:fs(e.timestamp)}),c.jsxs("span",{className:K("flex w-16 shrink-0 items-center gap-1 font-semibold",s?"text-accent-out":"text-accent-in"),title:jO[e.direction],children:[c.jsx("span",{"aria-hidden":!0,children:Kb(e.direction)}),c.jsx("span",{className:"text-[10px] tracking-widest",children:Wb(e.direction)})]}),c.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",NO(e.kind),"border-current/40"),title:_O[e.kind],children:TO[e.kind]}),c.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-3 overflow-hidden",children:[c.jsx("span",{className:K("shrink-0",p?"text-accent-out":"text-ink-primary"),children:e.method?e.method:"—"}),m&&r&&c.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(y=>`${y.path==="/"?"":y.path+" "}${y.message}`).join(" · ")}`,children:["⚠ SPEC ",r.errors.length]}),h&&v&&c.jsxs("span",{className:K("inline-flex shrink-0 items-center gap-0.5 rounded-sm border border-accent-warn/40","bg-accent-warn/10 px-1 text-[9px] font-semibold uppercase tracking-widest text-accent-warn"),title:`soon-required by the ACP spec: ${v.map(y=>y.message).join(" · ")}`,children:["⚠ ADV ",v.length]}),d&&c.jsxs("span",{className:K("truncate",p?"text-accent-out/85":"text-ink-secondary"),title:d,children:["“",d,"”"]})]}),c.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:${pE(e.rpcId)}`:""}),c.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Ul(e.raw.length)}),c.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 EO=I.memo(CO);function PO({messages:e,combinedText:t,firstTimestamp:n,lastTimestamp:o,selectedSeq:r,onSelect:i}){const[s,a]=I.useState(!1),l=e[0],d=e[e.length-1],p=o-n,m=t.length>140?`${t.slice(0,140)}…`:t,v=r!==null&&e.some(h=>h.seq===r);return c.jsxs("div",{className:"border-b border-line-grid/70",children:[c.jsxs("button",{type:"button",onClick:()=>{a(h=>!h),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",v?"bg-surface-rowHover ring-1 ring-inset ring-accent-note/40":""),children:[c.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent-note"}),c.jsxs("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:[String(l.seq).padStart(3,"0"),"…",String(d.seq).padStart(3,"0")]}),c.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:fs(n)}),c.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:[c.jsx("span",{"aria-hidden":!0,children:"←"}),c.jsx("span",{className:"text-[10px] tracking-widest",children:"IN"})]}),c.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"}),c.jsxs("span",{className:"flex flex-1 items-center gap-2 truncate text-ink-primary",children:[c.jsx("span",{className:"inline-flex h-[14px] w-1 rounded-sm bg-accent-note/60","aria-hidden":!0}),c.jsx("span",{className:"truncate text-ink-secondary",children:m||c.jsx("span",{className:"text-ink-muted",children:"(empty stream)"})})]}),c.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:[e.length," chunks"]}),c.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Vt(p)}),c.jsx("span",{"aria-hidden":!0,className:K("w-3 shrink-0 text-ink-muted transition-transform",s?"rotate-90":""),children:"▸"})]}),s&&c.jsx("div",{className:"border-l border-line-grid/70 bg-surface-base/40",children:e.map((h,y)=>c.jsxs("button",{type:"button",onClick:()=>i(h.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===h.seq?"bg-surface-rowHover text-ink-primary":""),children:[c.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(h.seq).padStart(3,"0")}),c.jsx("span",{className:"w-24 shrink-0 text-ink-muted",children:fs(h.timestamp)}),c.jsxs("span",{className:"w-8 shrink-0 text-ink-muted",children:["#",y+1]}),c.jsx("span",{className:"flex-1 truncate text-ink-primary",children:IO(h)})]},h.seq))})]})}function IO(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 cy="border-ink-secondary/45",dy="border-dashed border-ink-muted/35";function OO({state:e,firstRow:t=!1,lastRow:n=!1}){const o=e!=="upcoming",r=e==="played";return c.jsxs("span",{"aria-hidden":!0,className:"relative w-4 shrink-0 self-stretch",children:[!t&&c.jsx("span",{className:K("absolute left-1/2 top-0 h-1/2 -translate-x-1/2 border-l",o?cy:dy)}),!n&&c.jsx("span",{className:K("absolute bottom-0 left-1/2 h-1/2 -translate-x-1/2 border-l",r?cy:dy)}),e==="current"&&c.jsx("span",{className:"absolute left-1/2 top-1/2 h-[7px] w-[7px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-ink-primary ring-2 ring-surface-base"})]})}function RO(e,t,n){return n===null?"upcoming":n>=e&&n<=t?"current":t<n?"played":"upcoming"}const AO=80;function Pc(e){return e.type==="message"?[e.message.seq,e.message.seq]:[e.firstSeq,e.lastSeq]}function MO(){const e=ne(E=>E.messages),t=ne(E=>E.selectedSeq),n=ne(E=>E.filters),o=ne(E=>E.playback.playhead),r=ne(E=>E.playback.playing),i=ne(E=>E.select),s=ne(E=>E.setPlayhead),a=I.useMemo(()=>bS(e,n),[e,n]),l=I.useMemo(()=>SO(a),[a]),d=I.useMemo(()=>Cl(e),[e]),p=I.useMemo(()=>tf(e),[e]),m=I.useMemo(()=>{const E=new Map;for(const q of e)E.set(q.seq,q.timestamp);return E},[e]),v=I.useMemo(()=>{if(t===null)return null;const E=d.get(t);if(E!==void 0)return E;for(const[q,z]of d)if(z===t)return q;return null},[t,d]),h=I.useRef(null),y=I.useRef({startIndex:0,endIndex:0}),b=at(E=>E.selectedUrl),g=b!==null&&!Qu(b),f=ne(E=>{var q;return((q=E.session)==null?void 0:q.id)??null}),u=ne(E=>E.replayDone),x=I.useRef(f),S=I.useRef(!1),T=I.useRef(!1);I.useEffect(()=>{x.current!==f&&(x.current=f,S.current=!1,T.current=!1)},[f]),I.useEffect(()=>{if(!g||!u||f===null||S.current||l.length===0)return;S.current=!0;const E=l.length-1,q=window.setTimeout(()=>{var z;(z=h.current)==null||z.scrollToIndex({index:E,align:"end",behavior:"smooth"})},50);return()=>window.clearTimeout(q)},[g,u,f,l.length]),I.useEffect(()=>{var F;if(g||!u||f===null||T.current||l.length===0)return;T.current=!0;const E=((F=e[e.length-1])==null?void 0:F.seq)??null;let q=o;o!==null&&E!==null&&o>=E&&(s(null),q=null);const z=t??q;if(z===null)return;const U=l.findIndex(G=>{const[Y,D]=Pc(G);return z>=Y&&z<=D});if(U<0)return;const L=G=>{var Y;return(Y=h.current)==null?void 0:Y.scrollToIndex({index:U,align:"center",behavior:G})};requestAnimationFrame(()=>requestAnimationFrame(()=>{L("smooth"),window.setTimeout(()=>{const{startIndex:G,endIndex:Y}=y.current;(U<G||U>Y)&&L("auto")},500)}))},[g,u,f,l,e,o,t,s]);const C=!g&&l.length>0,$=I.useMemo(()=>o===null?-1:l.findIndex(E=>{const[q,z]=Pc(E);return o>=q&&o<=z}),[l,o]),j=I.useRef(!0);I.useEffect(()=>{r&&(j.current=!0)},[r]),I.useEffect(()=>{var U;if(!r||!j.current||$<0)return;const{startIndex:E,endIndex:q}=y.current;($<=E||$>=q)&&((U=h.current)==null||U.scrollToIndex({index:$,align:"center",behavior:"auto"}))},[r,$]);const A=E=>{const q=l[E];if(!q)return null;const z=qO(q,{selectedSeq:t,pairedSeq:v,onSelect:i,responseToRequest:d,reqTimestampBySeq:m,validationBySeq:p});if(!C)return z;const[U,L]=Pc(q);return c.jsxs("div",{className:"flex items-stretch",children:[c.jsx(OO,{state:RO(U,L,o),firstRow:E===0,lastRow:E===l.length-1}),c.jsx("div",{className:"min-w-0 flex-1",children:z})]})};return c.jsxs("div",{className:"relative flex h-full flex-col",onWheel:()=>{r&&(j.current=!1)},children:[l.length===0?c.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"}):c.jsx(iO,{ref:h,className:"flex-1 bg-surface-base",totalCount:l.length,itemContent:A,rangeChanged:E=>{y.current=E},atBottomThreshold:AO,...g?{initialTopMostItemIndex:Math.max(0,l.length-1)}:{},followOutput:g?E=>E?"auto":!1:!1,computeItemKey:E=>UO(l[E])}),c.jsx(LO,{total:e.length,shown:a.length})]})}function qO(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 c.jsx(EO,{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 c.jsx(PO,{messages:e.messages,combinedText:e.combinedText,firstTimestamp:e.firstTimestamp,lastTimestamp:e.lastTimestamp,selectedSeq:t.selectedSeq,onSelect:t.onSelect})}function UO(e){return e.type==="message"?`m-${e.message.seq}`:`c-${e.firstSeq}-${e.lastSeq}`}function LO({total:e,shown:t}){return e===0||t===e?null:c.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 DO({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 c.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 zO({onImportResult:e}){const[t,n]=I.useState(!1),[o,r]=I.useState(!1),i=I.useRef(null),s=I.useRef(null),a=ne(h=>h.session),l=ne(h=>h.messages.length),d=a!==null&&l>0;I.useEffect(()=>{if(!t)return;const h=b=>{i.current&&!i.current.contains(b.target)&&n(!1)},y=b=>{b.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",y)}},[t]);const p=()=>{var h;n(!1),(h=s.current)==null||h.click()},m=()=>{n(!1);const h=ne.getState();h.session&&h.messages.length>0&&Vb(h.session,h.messages)},v=async h=>{var b;const y=(b=h.target.files)==null?void 0:b[0];if(h.target.value="",!!y){r(!0);try{const g=await Nv(y);await Xu(),at.getState().setSelected(tl(g.id)),e==null||e(`imported ${y.name} · #${g.id} · ${g.messageCount} message${g.messageCount===1?"":"s"}`,"success")}catch(g){const f=g instanceof Error?g.message:String(g);e==null||e(`import failed: ${f}`,"warn")}finally{r(!1)}}};return c.jsxs("div",{ref:i,className:"relative",children:[c.jsx("input",{ref:s,type:"file",accept:"application/json,.json",onChange:v,className:"hidden","aria-hidden":"true",tabIndex:-1}),c.jsx("button",{type:"button",onClick:()=>n(h=>!h),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:c.jsx("span",{"aria-hidden":!0,children:"⋯"})}),t&&c.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:[c.jsx(uy,{icon:"↑",label:"import",onClick:p,title:"Open a session JSON exported earlier — yours or someone else's."}),c.jsx(uy,{icon:"↓",label:"export",onClick:m,disabled:!d,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 uy({icon:e,label:t,onClick:n,disabled:o,title:r,disabledTitle:i}){return c.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:[c.jsx("span",{"aria-hidden":!0,className:"w-4 text-center text-[13px] leading-none",children:e}),c.jsx("span",{className:"flex-1",children:t})]})}function FO({onSelect:e,activeUrl:t,overrideUrl:n}){const o=at(u=>u.captures),r=at(u=>u.savedSessions),i=at(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 d=o.find(u=>u.url===t)??null,p=t!==null&&Qu(t)?jS(t):null,m=I.useMemo(()=>new Set(o.map(u=>u.sessionDbId).filter(u=>u!==null)),[o]),v=I.useMemo(()=>r.filter(u=>!m.has(u.id)),[r,m]),h=I.useMemo(()=>v.filter(u=>u.imported_at===null),[v]),y=I.useMemo(()=>v.filter(u=>u.imported_at!==null),[v]),b=p!==null?v.find(u=>u.id===p)??null:null,g=o.length+v.length;let f;return n?f="?ws override":d?f=nf(d):b?f=`#${b.id} · ${b.name??(b.client_name?`${b.client_name} · ${Rt(b.agent_command??"")}`:Rt(b.agent_command??""))}`:g===0?f="no captures":f="pick capture",c.jsxs("div",{ref:l,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>a(u=>!u),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:[c.jsx("span",{className:"inline-block w-[200px] truncate text-left",children:f}),g>1&&!n&&c.jsx("span",{className:"rounded-sm border border-line-strong px-1 text-[9px] text-ink-secondary",children:g}),c.jsx("span",{"aria-hidden":!0,className:K("transition-transform",s?"rotate-180":""),children:"▾"})]}),s&&c.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:[c.jsxs(Ic,{children:["live captures · last poll"," ",i?`${Math.round((Date.now()-i)/1e3)}s ago`:"—"]}),o.length===0&&c.jsxs("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:["none. start a proxy with"," ",c.jsx("span",{className:"text-ink-secondary",children:"acp-devtools proxy …"})]}),c.jsx("ul",{className:"max-h-[260px] overflow-y-auto",children:o.map(u=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>{e(u.url),a(!1)},title:`${u.agentCommand} · ${u.url}${u.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",u.url===t?"bg-surface-rowHover":""),children:[c.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",u.url===t?"bg-accent-out animate-pulse-soft":"bg-accent-warn/50")}),c.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[c.jsx("span",{className:"text-accent-out",children:u.sessionDbId!==null?`#${u.sessionDbId}`:`pid ${u.pid}`}),c.jsx("span",{className:"text-ink-muted",children:" · "}),u.sessionName??(u.clientName?`${u.clientName} · ${Rt(u.agentCommand)}`:Rt(u.agentCommand))]}),c.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:Mr(u.startedAt)})]})},u.url))}),c.jsxs(Ic,{children:["saved · ",h.length," session",h.length===1?"":"s"]}),h.length===0&&c.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:r.length===0?"no saved sessions yet":y.length>0?"no live-captured sessions yet":"all saved sessions are currently live"}),c.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:h.map(u=>c.jsx(py,{s:u,activeUrl:t,onPick:x=>{e(x),a(!1)}},u.id))}),(y.length>0||r.some(u=>u.imported_at!==null))&&c.jsxs(c.Fragment,{children:[c.jsxs(Ic,{children:["imported · ",y.length," file",y.length===1?"":"s"]}),y.length===0?c.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no imported files"}):c.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:y.map(u=>c.jsx(py,{s:u,activeUrl:t,onPick:x=>{e(x),a(!1)}},u.id))})]}),n&&c.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 Ic({children:e}){return c.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 py({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 _S(e.id),r&&at.getState().setSelected(null),await Xu()}catch(l){const d=l instanceof Error?l.message:String(l);window.alert(`Delete failed: ${d}`)}})()};return c.jsxs("li",{className:"group relative",children:[c.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:[c.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")}),c.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[c.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),c.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Rt(e.agent_command??"")}`:Rt(e.agent_command??""))]}),c.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 · ",Mr(e.started_at)]})]}),c.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:c.jsx("span",{"aria-hidden":!0,children:"×"})})]})}const Oc=[{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 BO(){const e=Id(s=>s.mode),t=Id(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=Oc.find(s=>s.mode===e)??Oc[0];return c.jsxs("div",{ref:r,className:"relative",children:[c.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:c.jsx("span",{"aria-hidden":!0,children:i.icon})}),n&&c.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:Oc.map(s=>{const a=s.mode===e;return c.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:[c.jsx("span",{"aria-hidden":!0,children:s.icon}),c.jsx("span",{children:s.label})]},s.mode)})})]})}function HO({wsUrl:e,overrideUrl:t,activeUrl:n,isReplay:o,isImported:r=!1,onPickCapture:i,onImportResult:s,onOpenInfo:a,onOpenPerf:l,onOpenDiff:d}){const p=ne(b=>b.connection),m=ne(b=>b.session),v=ne(b=>b.lastError),h=ne(b=>b.messages.length>0?b.messages[b.messages.length-1].timestamp:null),y=ex(5e3);return c.jsxs("header",{className:"flex items-center justify-between border-b border-line bg-surface-base px-5 py-2.5",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"wordmark-rule",children:c.jsx("span",{className:"font-display text-[18px] uppercase tracking-[0.18em] text-ink-primary",children:"acp.devtools"})}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.6.0"})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[m&&(()=>{const{primary:b}=ql(m),g=o||r,f=m.endedAt!==null?m.endedAt:h??m.startedAt,u=g?Mr(m.startedAt,f):Mr(m.startedAt,y),x=h!==null?y-h:null,S=!g&&x!==null&&x>5e3,T=_a(m.startedAt,y),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 c.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] text-ink-secondary",children:[c.jsx("span",{className:"text-ink-muted",title:$,children:C}),c.jsx("span",{className:j,title:m.agentCommand?`session #${m.id} · ${m.agentCommand}`:"persisted session id",children:b}),c.jsx("span",{className:"text-ink-muted",children:"·"}),c.jsx("span",{title:`session started at ${T}`,children:_a(m.startedAt,y)}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-ink-muted",children:"·"}),c.jsxs("span",{className:"text-ink-muted",title:g?"capture duration (start → end of recorded session)":"how long the proxy process has been alive",children:[g?"lasted":"alive"," ",u]})]}),S&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-ink-muted",children:"·"}),c.jsxs("span",{className:"text-ink-dim",title:`time since the most recent ACP frame · last event ${_a(h,y)}`,children:["idle ",Mr(h,y)]})]})]})})(),c.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&c.jsx(FO,{onSelect:i,activeUrl:n,overrideUrl:t}),c.jsx(VO,{status:p,wsUrl:e,lastError:v,isReplay:o,isImported:r,onReconnect:kS})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[a&&m&&c.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&&c.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"}),d&&m&&c.jsx("button",{type:"button",onClick:d,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"}),c.jsx(zO,{...s?{onImportResult:s}:{}})]}),c.jsx("div",{className:"flex items-center gap-1.5",children:c.jsx(BO,{})})]})]})}function VO({status:e,wsUrl:t,lastError:n,isReplay:o,isImported:r,onReconnect:i}){if(r)return c.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:[c.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 rounded-full bg-accent-warn"}),c.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",d={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",v=e==="idle"||e==="closed"||e==="error",y=n||(e==="open"?`${o?"serving a recorded session from the local store":"connected to a live proxy capture"} · ${t}`:v?`click to reconnect · ${t}`:t);return c.jsxs("button",{type:"button",onClick:v?i:void 0,disabled:!v,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",d[e],v?"cursor-pointer hover:bg-surface-rowHover":"cursor-default"),title:y,children:[c.jsx("span",{"aria-hidden":!0,className:K("inline-block h-2 w-2 rounded-full",m)}),c.jsx("span",{className:"inline-block min-w-[52px] text-center",children:a})]})}const ur=eC(),WO=ur?new URLSearchParams(typeof window<"u"?window.location.search:"").get("url"):null;function KO(){const e=at(w=>w.captures),t=at(w=>w.selectedUrl),n=at(w=>w.setSelected),o=ne(w=>{var k;return((k=w.session)==null?void 0:k.importedAt)??null}),r=t,i=Qu(t),s=o!==null;I.useEffect(()=>ur?void 0:OS(),[]),I.useEffect(()=>MS(),[]);const[a,l]=I.useState(null),d=I.useRef(new Set);I.useEffect(()=>{const w=yh(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.playhead!==null&&(N.playback={...k.playback,playhead:w.playhead}),Object.keys(N).length>0&&ne.setState(N),w.captureUrl&&at.getState().setSelected(w.captureUrl)},[]);const[p,m]=I.useState(!1),[v,h]=I.useState(!1),[y,b]=I.useState(!1);I.useEffect(()=>{const w=()=>{const H=ne.getState(),R=at.getState();aC({filters:H.filters,selectedSeq:H.selectedSeq,detailTab:H.detailTab,playhead:H.playback.playhead,captureUrl:R.selectedUrl})},k=ne.subscribe(w),N=at.subscribe(w);return w(),()=>{k(),N()}},[]);const g=()=>{p||(window.history.pushState({drawer:"info"},"",window.location.href),m(!0))},f=()=>{v||(window.history.pushState({drawer:"perf"},"",window.location.href),h(!0))},u=()=>{y||(window.history.pushState({drawer:"diff"},"",window.location.href),b(!0))},x=()=>{p&&window.history.back()},S=()=>{v&&window.history.back()},T=()=>{y&&window.history.back()},C=w=>{window.history.pushState({drawer:null},"",window.location.href),ne.getState().select(w),m(!1),h(!1),b(!1)};I.useEffect(()=>{const w=k=>{const N=k.state;m((N==null?void 0:N.drawer)==="info"),h((N==null?void 0:N.drawer)==="perf"),b((N==null?void 0:N.drawer)==="diff");const H=yh(window.location.search),R=ne.getState(),X=at.getState(),ie={};Object.keys(H.filters).length>0&&(ie.filters={...R.filters,...H.filters}),ie.selectedSeq=H.selectedSeq,ie.detailTab=H.detailTab??"tree",ie.playback={...R.playback,playhead:H.playhead},ne.setState(ie),H.captureUrl!==X.selectedUrl&&H.captureUrl&&X.setSelected(H.captureUrl)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),I.useEffect(()=>{const w=new Set(e.map(X=>X.url));if(d.current=d.current,i){d.current=w;return}const k=e[0]??null,N=t===null,H=t!==null&&w.has(t),R=k!==null&&!d.current.has(k.url)&&d.current.size>0;e.length===0?t!==null&&n(null):N||!H?n(k.url):R&&k.url!==t&&(n(k.url),l({message:`switched → ${nf(k)}`,tone:"success"})),d.current=w},[e,t,n,i]),I.useEffect(()=>{if(!a)return;let w=3e3,k=Date.now(),N=null;const H=()=>{N===null&&document.visibilityState==="visible"&&(k=Date.now(),N=setTimeout(()=>l(null),w))},R=()=>{N!==null&&(clearTimeout(N),N=null,w=Math.max(0,w-(Date.now()-k)))},X=()=>{document.visibilityState==="visible"?H():R()};return document.addEventListener("visibilitychange",X),H(),()=>{document.removeEventListener("visibilitychange",X),N&&clearTimeout(N)}},[a]),I.useEffect(()=>{if(ur){Ed();return}if(!r){Ed();return}Ju(r)},[r]);const[$,j]=I.useState(!1);I.useEffect(()=>{const w=k=>{if((k.metaKey||k.ctrlKey)&&(k.key==="k"||k.key==="K")){k.preventDefault(),j(H=>!H);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"){fy(1);return}if(k.key==="k"||k.key==="K"){fy(-1);return}}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[$]);const A=ne(w=>w.messages),E=ne(w=>w.session),q=ne(w=>w.selectedSeq),z=ne(w=>w.connection),U=ne(w=>w.lastError);I.useEffect(()=>{const w="ACP Devtools";if(!E){document.title=w;return}const{primary:k,secondary:N}=ql(E),H=N?`${k} · ${N}`:k;document.title=`${H} — ${w}`},[E]);const L=I.useMemo(()=>xS(A,q),[A,q]),F=I.useMemo(()=>{const w=Cl(A),k=new Map;for(const[N,H]of w.entries())k.set(H,N);return{responseToRequest:w,requestToResponse:k}},[A]),G=I.useMemo(()=>tf(A),[A]);let Y,D=null;if(L){if(L.kind==="response"||L.kind==="error"){const w=F.responseToRequest.get(L.seq);w!==void 0&&(D=A.find(k=>k.seq===w)??null,D&&(Y=L.timestamp-D.timestamp))}else if(L.kind==="request"){const w=F.requestToResponse.get(L.seq);w!==void 0&&(D=A.find(k=>k.seq===w)??null,D&&(Y=D.timestamp-L.timestamp))}}const J=A.length===0&&!E,O=r??"no capture selected",_=ur&&J,M=!ur&&J&&r===null&&e.length===0,P=!ur&&J&&!M;return c.jsxs("div",{className:"flex h-full flex-col bg-surface-base text-ink-primary",children:[c.jsx(DO,{message:(a==null?void 0:a.message)??null,tone:(a==null?void 0:a.tone)??"info"}),c.jsx(XC,{open:$,onClose:()=>j(!1)}),c.jsx(zP,{open:p,onClose:x}),c.jsx(jP,{open:v,onClose:S,onNavigateToSeq:C}),c.jsx(FE,{open:y,onClose:T}),c.jsx(HO,{wsUrl:O,overrideUrl:null,isReplay:i,isImported:s,onPickCapture:w=>{n(w),d.current.add(w)},onImportResult:(w,k)=>l({message:w,tone:k}),activeUrl:r,onOpenInfo:g,onOpenPerf:f,onOpenDiff:u}),c.jsx(rP,{}),c.jsx("main",{className:"flex-1 overflow-hidden",children:_?c.jsx(UP,{initialUrl:WO}):M?c.jsx(nP,{status:z,lastError:U,url:O,captureCount:e.length}):P?c.jsx(nE,{status:z,url:O,lastError:U}):c.jsx(VP,{storageKey:"acp.split.leftPx",initialLeftFraction:.62,minLeft:420,minRight:360,left:c.jsxs("div",{className:"flex h-full flex-col",children:[c.jsx("div",{className:"min-h-0 flex-1",children:c.jsx(MO,{})}),(i||s)&&c.jsx(DP,{})]}),right:c.jsx(vE,{message:L,...Y!==void 0?{latencyMs:Y}:{},...D?{pairedRequest:D}:{},...L?(()=>{const w=G.get(L.seq);return w?{validation:w}:{}})():{},onJumpToPaired:w=>ne.getState().select(w)})})}),c.jsx(WP,{})]})}function fy(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 qx=document.getElementById("root");if(!qx)throw new Error("#root not found");Rc.createRoot(qx).render(c.jsx(te.StrictMode,{children:c.jsx(KO,{})}));
|
|
1768
|
+
//# sourceMappingURL=index-D6fYTnQ6.js.map
|