@vibek/cli 0.1.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.
- package/.env.example +9 -0
- package/README.md +210 -0
- package/config.example.toml +58 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/index.js +2633 -0
- package/package.json +27 -0
- package/strategy-sdk.js +2 -0
- package/vibek-package.json +5 -0
- package/webui/client.js +41 -0
- package/webui/index.html +16 -0
- package/webui/styles.css +651 -0
package/webui/client.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var PI=Object.create;var{getPrototypeOf:qI,defineProperty:Uf,getOwnPropertyNames:FI}=Object;var UI=Object.prototype.hasOwnProperty;function HI(e){return this[e]}var VI,GI,qe=(e,t,a)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?VI??=new WeakMap:GI??=new WeakMap,r=i.get(e);if(r)return r}a=e!=null?PI(qI(e)):{};let l=t||!e||!e.__esModule?Uf(a,"default",{value:e,enumerable:!0}):a;if(e&&typeof e==="object"||typeof e==="function"){for(let s of FI(e))if(!UI.call(l,s))Uf(l,s,{get:HI.bind(e,s),enumerable:!0})}if(n)i.set(e,l);return l};var ca=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var QI=(e)=>e;function jI(e,t){this[e]=QI.bind(null,t)}var Ex=(e,t)=>{for(var a in t)Uf(e,a,{get:t[a],enumerable:!0,configurable:!0,set:jI.bind(t,a)})};var YI=(e,t)=>()=>(e&&(t=e(e=0)),t);var Je=ca(function(cM){var Gf=Symbol.for("react.transitional.element"),KI=Symbol.for("react.portal"),XI=Symbol.for("react.fragment"),WI=Symbol.for("react.strict_mode"),ZI=Symbol.for("react.profiler"),JI=Symbol.for("react.consumer"),$I=Symbol.for("react.context"),eM=Symbol.for("react.forward_ref"),tM=Symbol.for("react.suspense"),aM=Symbol.for("react.memo"),_x=Symbol.for("react.lazy"),nM=Symbol.for("react.activity"),Dx=Symbol.iterator;function iM(e){if(e===null||typeof e!=="object")return null;return e=Dx&&e[Dx]||e["@@iterator"],typeof e==="function"?e:null}var Nx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ox=Object.assign,Px={};function sr(e,t,a){this.props=e,this.context=t,this.refs=Px,this.updater=a||Nx}sr.prototype.isReactComponent={};sr.prototype.setState=function(e,t){if(typeof e!=="object"&&typeof e!=="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};sr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qx(){}qx.prototype=sr.prototype;function Qf(e,t,a){this.props=e,this.context=t,this.refs=Px,this.updater=a||Nx}var jf=Qf.prototype=new qx;jf.constructor=Qf;Ox(jf,sr.prototype);jf.isPureReactComponent=!0;var Rx=Array.isArray;function Vf(){}var ve={H:null,A:null,T:null,S:null},Fx=Object.prototype.hasOwnProperty;function Yf(e,t,a){var n=a.ref;return{$$typeof:Gf,type:e,key:t,ref:n!==void 0?n:null,props:a}}function rM(e,t){return Yf(e.type,t,e.props)}function Kf(e){return typeof e==="object"&&e!==null&&e.$$typeof===Gf}function lM(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Bx=/\/+/g;function Hf(e,t){return typeof e==="object"&&e!==null&&e.key!=null?lM(""+e.key):t.toString(36)}function sM(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status==="string"?e.then(Vf,Vf):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function lr(e,t,a,n,i){var r=typeof e;if(r==="undefined"||r==="boolean")e=null;var l=!1;if(e===null)l=!0;else switch(r){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Gf:case KI:l=!0;break;case _x:return l=e._init,lr(l(e._payload),t,a,n,i)}}if(l)return i=i(e),l=n===""?"."+Hf(e,0):n,Rx(i)?(a="",l!=null&&(a=l.replace(Bx,"$&/")+"/"),lr(i,t,a,"",function(u){return u})):i!=null&&(Kf(i)&&(i=rM(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Bx,"$&/")+"/")+l)),t.push(i)),1;l=0;var s=n===""?".":n+":";if(Rx(e))for(var o=0;o<e.length;o++)n=e[o],r=s+Hf(n,o),l+=lr(n,t,a,r,i);else if(o=iM(e),typeof o==="function")for(e=o.call(e),o=0;!(n=e.next()).done;)n=n.value,r=s+Hf(n,o++),l+=lr(n,t,a,r,i);else if(r==="object"){if(typeof e.then==="function")return lr(sM(e),t,a,n,i);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 l}function qo(e,t,a){if(e==null)return e;var n=[],i=0;return lr(e,n,"","",function(r){return t.call(a,r,i++)}),n}function oM(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){if(e._status===0||e._status===-1)e._status=1,e._result=a},function(a){if(e._status===0||e._status===-1)e._status=2,e._result=a}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var zx=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},uM={map:qo,forEach:function(e,t,a){qo(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return qo(e,function(){t++}),t},toArray:function(e){return qo(e,function(t){return t})||[]},only:function(e){if(!Kf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};cM.Activity=nM;cM.Children=uM;cM.Component=sr;cM.Fragment=XI;cM.Profiler=ZI;cM.PureComponent=Qf;cM.StrictMode=WI;cM.Suspense=tM;cM.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ve;cM.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ve.H.useMemoCache(e)}};cM.cache=function(e){return function(){return e.apply(null,arguments)}};cM.cacheSignal=function(){return null};cM.cloneElement=function(e,t,a){if(e===null||e===void 0)throw Error("The argument must be a React element, but you passed "+e+".");var n=Ox({},e.props),i=e.key;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)!Fx.call(t,r)||r==="key"||r==="__self"||r==="__source"||r==="ref"&&t.ref===void 0||(n[r]=t[r]);var r=arguments.length-2;if(r===1)n.children=a;else if(1<r){for(var l=Array(r),s=0;s<r;s++)l[s]=arguments[s+2];n.children=l}return Yf(e.type,i,n)};cM.createContext=function(e){return e={$$typeof:$I,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:JI,_context:e},e};cM.createElement=function(e,t,a){var n,i={},r=null;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)Fx.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=a;else if(1<l){for(var s=Array(l),o=0;o<l;o++)s[o]=arguments[o+2];i.children=s}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return Yf(e,r,i)};cM.createRef=function(){return{current:null}};cM.forwardRef=function(e){return{$$typeof:eM,render:e}};cM.isValidElement=Kf;cM.lazy=function(e){return{$$typeof:_x,_payload:{_status:-1,_result:e},_init:oM}};cM.memo=function(e,t){return{$$typeof:aM,type:e,compare:t===void 0?null:t}};cM.startTransition=function(e){var t=ve.T,a={};ve.T=a;try{var n=e(),i=ve.S;i!==null&&i(a,n),typeof n==="object"&&n!==null&&typeof n.then==="function"&&n.then(Vf,zx)}catch(r){zx(r)}finally{t!==null&&a.types!==null&&(t.types=a.types),ve.T=t}};cM.unstable_useCacheRefresh=function(){return ve.H.useCacheRefresh()};cM.use=function(e){return ve.H.use(e)};cM.useActionState=function(e,t,a){return ve.H.useActionState(e,t,a)};cM.useCallback=function(e,t){return ve.H.useCallback(e,t)};cM.useContext=function(e){return ve.H.useContext(e)};cM.useDebugValue=function(){};cM.useDeferredValue=function(e,t){return ve.H.useDeferredValue(e,t)};cM.useEffect=function(e,t){return ve.H.useEffect(e,t)};cM.useEffectEvent=function(e){return ve.H.useEffectEvent(e)};cM.useId=function(){return ve.H.useId()};cM.useImperativeHandle=function(e,t,a){return ve.H.useImperativeHandle(e,t,a)};cM.useInsertionEffect=function(e,t){return ve.H.useInsertionEffect(e,t)};cM.useLayoutEffect=function(e,t){return ve.H.useLayoutEffect(e,t)};cM.useMemo=function(e,t){return ve.H.useMemo(e,t)};cM.useOptimistic=function(e,t){return ve.H.useOptimistic(e,t)};cM.useReducer=function(e,t,a){return ve.H.useReducer(e,t,a)};cM.useRef=function(e){return ve.H.useRef(e)};cM.useState=function(e){return ve.H.useState(e)};cM.useSyncExternalStore=function(e,t,a){return ve.H.useSyncExternalStore(e,t,a)};cM.useTransition=function(){return ve.H.useTransition()};cM.version="19.2.8"});function Wf(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,i=e[n];if(0<Fo(i,t))e[n]=t,e[a]=i,a=n;else break e}}function fa(e){return e.length===0?null:e[0]}function Qo(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var n=0,i=e.length,r=i>>>1;n<r;){var l=2*(n+1)-1,s=e[l],o=l+1,u=e[o];if(0>Fo(s,a))o<i&&0>Fo(u,s)?(e[n]=u,e[o]=a,n=o):(e[n]=s,e[l]=a,n=l);else if(o<i&&0>Fo(u,a))e[n]=u,e[o]=a,n=o;else break e}}return t}function Fo(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}function Vo(e){for(var t=fa(cn);t!==null;){if(t.callback===null)Qo(cn);else if(t.startTime<=e)Qo(cn),t.sortIndex=t.expirationTime,Wf(Da,t);else break;t=fa(cn)}}function ad(e){if(Rl=!1,Vo(e),!Dl)if(fa(Da)!==null)Dl=!0,ur||(ur=!0,or());else{var t=fa(cn);t!==null&&nd(ad,t.startTime-e)}}function Qx(){return td?!0:da()-Gx<eT?!1:!0}function Xf(){if(td=!1,ur){var e=da();Gx=e;var t=!0;try{e:{Dl=!1,Rl&&(Rl=!1,Vx(Bl),Bl=-1),$f=!0;var a=Ho;try{t:{Vo(e);for(Ut=fa(Da);Ut!==null&&!(Ut.expirationTime>e&&Qx());){var n=Ut.callback;if(typeof n==="function"){Ut.callback=null,Ho=Ut.priorityLevel;var i=n(Ut.expirationTime<=e);if(e=da(),typeof i==="function"){Ut.callback=i,Vo(e),t=!0;break t}Ut===fa(Da)&&Qo(Da),Vo(e)}else Qo(Da);Ut=fa(Da)}if(Ut!==null)t=!0;else{var r=fa(cn);r!==null&&nd(ad,r.startTime-e),t=!1}}break e}finally{Ut=null,Ho=a,$f=!1}t=void 0}}finally{t?or():ur=!1}}}function nd(e,t){Bl=Hx(function(){e(da())},t)}var da=void 0,Zf,Uo,Jf,Da,cn,$M=1,Ut=null,Ho=3,$f=!1,Dl=!1,Rl=!1,td=!1,Hx,Vx,Ux,ur=!1,Bl=-1,eT=5,Gx=-1,or,Go,ed,id=5,rd=1,ld=4,cr=3,sd=2,od=function(e){e.callback=null},ud=function(){return Ho},cd=function(){td=!0},fr=function(e,t,a){var n=da();switch(typeof a==="object"&&a!==null?(a=a.delay,a=typeof a==="number"&&0<a?n+a:n):a=n,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5000}return i=a+i,e={id:$M++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>n?(e.sortIndex=a,Wf(cn,e),fa(Da)===null&&e===fa(cn)&&(Rl?(Vx(Bl),Bl=-1):Rl=!0,nd(ad,a-n))):(e.sortIndex=i,Wf(Da,e),Dl||$f||(Dl=!0,ur||(ur=!0,or()))),e},fd;var jx=YI(()=>{if(typeof performance==="object"&&typeof performance.now==="function")Zf=performance,da=function(){return Zf.now()};else Uo=Date,Jf=Uo.now(),da=function(){return Uo.now()-Jf};Da=[],cn=[],Hx=typeof setTimeout==="function"?setTimeout:null,Vx=typeof clearTimeout==="function"?clearTimeout:null,Ux=typeof setImmediate<"u"?setImmediate:null;if(typeof Ux==="function")or=function(){Ux(Xf)};else if(typeof MessageChannel<"u")Go=new MessageChannel,ed=Go.port2,Go.port1.onmessage=Xf,or=function(){ed.postMessage(null)};else or=function(){Hx(Xf,0)};fd=Qx});var Xx=ca(function(iT){var Yx=qe(Je());function Kx(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function fn(){}var ft={d:{f:fn,r:function(){throw Error(Kx(522))},D:fn,C:fn,L:fn,m:fn,X:fn,S:fn,M:fn},p:0,findDOMNode:null},aT=Symbol.for("react.portal");function nT(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:aT,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var zl=Yx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function jo(e,t){if(e==="font")return"";if(typeof t==="string")return t==="use-credentials"?t:""}iT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ft;iT.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Kx(299));return nT(e,t,null,a)};iT.flushSync=function(e){var t=zl.T,a=ft.p;try{if(zl.T=null,ft.p=2,e)return e()}finally{zl.T=t,ft.p=a,ft.d.f()}};iT.preconnect=function(e,t){typeof e==="string"&&(t?(t=t.crossOrigin,t=typeof t==="string"?t==="use-credentials"?t:"":void 0):t=null,ft.d.C(e,t))};iT.prefetchDNS=function(e){typeof e==="string"&&ft.d.D(e)};iT.preinit=function(e,t){if(typeof e==="string"&&t&&typeof t.as==="string"){var a=t.as,n=jo(a,t.crossOrigin),i=typeof t.integrity==="string"?t.integrity:void 0,r=typeof t.fetchPriority==="string"?t.fetchPriority:void 0;a==="style"?ft.d.S(e,typeof t.precedence==="string"?t.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:r}):a==="script"&&ft.d.X(e,{crossOrigin:n,integrity:i,fetchPriority:r,nonce:typeof t.nonce==="string"?t.nonce:void 0})}};iT.preinitModule=function(e,t){if(typeof e==="string")if(typeof t==="object"&&t!==null){if(t.as==null||t.as==="script"){var a=jo(t.as,t.crossOrigin);ft.d.M(e,{crossOrigin:a,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0})}}else t==null&&ft.d.M(e)};iT.preload=function(e,t){if(typeof e==="string"&&typeof t==="object"&&t!==null&&typeof t.as==="string"){var a=t.as,n=jo(a,t.crossOrigin);ft.d.L(e,a,{crossOrigin:n,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0,type:typeof t.type==="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority==="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==="string"?t.imageSizes:void 0,media:typeof t.media==="string"?t.media:void 0})}};iT.preloadModule=function(e,t){if(typeof e==="string")if(t){var a=jo(t.as,t.crossOrigin);ft.d.m(e,{as:typeof t.as==="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity==="string"?t.integrity:void 0})}else ft.d.m(e)};iT.requestFormReset=function(e){ft.d.r(e)};iT.unstable_batchedUpdates=function(e,t){return e(t)};iT.useFormState=function(e,t,a){return zl.H.useFormState(e,t,a)};iT.useFormStatus=function(){return zl.H.useHostTransitionStatus()};iT.version="19.2.8"});var Jx=ca(function(DO,Zx){function Wx(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wx)}catch(e){console.error(e)}}Wx(),Zx.exports=Xx()});var o0=ca(function(VA){jx();var Ju=qe(Je()),Cb=qe(Jx());function D(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Lb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ls(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function wb(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 kb(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function $x(e){if(Ls(e)!==e)throw Error(D(188))}function bT(e){var t=e.alternate;if(!t){if(t=Ls(e),t===null)throw Error(D(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var r=i.alternate;if(r===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===a)return $x(i),e;if(r===n)return $x(i),t;r=r.sibling}throw Error(D(188))}if(a.return!==n.return)a=i,n=r;else{for(var l=!1,s=i.child;s;){if(s===a){l=!0,a=i,n=r;break}if(s===n){l=!0,n=i,a=r;break}s=s.sibling}if(!l){for(s=r.child;s;){if(s===a){l=!0,a=r,n=i;break}if(s===n){l=!0,n=r,a=i;break}s=s.sibling}if(!l)throw Error(D(189))}}if(a.alternate!==n)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?e:t}function Ib(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Ib(e),t!==null)return t;e=e.sibling}return null}var we=Object.assign,ST=Symbol.for("react.element"),Yo=Symbol.for("react.transitional.element"),Ul=Symbol.for("react.portal"),xr=Symbol.for("react.fragment"),Mb=Symbol.for("react.strict_mode"),Gd=Symbol.for("react.profiler"),Tb=Symbol.for("react.consumer"),qa=Symbol.for("react.context"),Uh=Symbol.for("react.forward_ref"),Qd=Symbol.for("react.suspense"),jd=Symbol.for("react.suspense_list"),Hh=Symbol.for("react.memo"),dn=Symbol.for("react.lazy"),Yd=Symbol.for("react.activity"),vT=Symbol.for("react.memo_cache_sentinel"),ey=Symbol.iterator;function _l(e){if(e===null||typeof e!=="object")return null;return e=ey&&e[ey]||e["@@iterator"],typeof e==="function"?e:null}var CT=Symbol.for("react.client.reference");function Kd(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===CT?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case xr:return"Fragment";case Gd:return"Profiler";case Mb:return"StrictMode";case Qd:return"Suspense";case jd:return"SuspenseList";case Yd:return"Activity"}if(typeof e==="object")switch(e.$$typeof){case Ul:return"Portal";case qa:return e.displayName||"Context";case Tb:return(e._context.displayName||"Context")+".Consumer";case Uh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Hh:return t=e.displayName||null,t!==null?t:Kd(e.type)||"Memo";case dn:t=e._payload,e=e._init;try{return Kd(e(t))}catch(a){}}return null}var Hl=Array.isArray,j=Ju.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Cb.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fi={pending:!1,data:null,method:null,action:null},Xd=[],yr=-1;function xa(e){return{current:e}}function We(e){0>yr||(e.current=Xd[yr],Xd[yr]=null,yr--)}function be(e,t){yr++,Xd[yr]=e.current,e.current=t}var ga=xa(null),us=xa(null),Ln=xa(null),Lu=xa(null);function wu(e,t){switch(be(Ln,t),be(us,e),be(ga,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)?(e=e.namespaceURI)?rb(e):0:0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rb(t),e=Kv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}We(ga),be(ga,e)}function Nr(){We(ga),We(us),We(Ln)}function Wd(e){e.memoizedState!==null&&be(Lu,e);var t=ga.current,a=Kv(t,e.type);t!==a&&(be(us,e),be(ga,a))}function ku(e){us.current===e&&(We(ga),We(us)),Lu.current===e&&(We(Lu),Ss._currentValue=fi)}var dd,ty;function li(e){if(dd===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);dd=t&&t[1]||"",ty=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+dd+e+ty}var hd=!1;function md(e,t){if(!e||hd)return"";hd=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){d=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){d=h}(f=e())&&typeof f.catch==="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack==="string")return[h.stack,d.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),l=r[0],s=r[1];if(l&&s){var o=l.split(`
|
|
4
|
+
`),u=s.split(`
|
|
5
|
+
`);for(i=n=0;n<o.length&&!o[n].includes("DetermineComponentFrameRoot");)n++;for(;i<u.length&&!u[i].includes("DetermineComponentFrameRoot");)i++;if(n===o.length||i===u.length)for(n=o.length-1,i=u.length-1;1<=n&&0<=i&&o[n]!==u[i];)i--;for(;1<=n&&0<=i;n--,i--)if(o[n]!==u[i]){if(n!==1||i!==1)do if(n--,i--,0>i||o[n]!==u[i]){var c=`
|
|
6
|
+
`+o[n].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=n&&0<=i);break}}}finally{hd=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?li(a):""}function LT(e,t){switch(e.tag){case 26:case 27:case 5:return li(e.type);case 16:return li("Lazy");case 13:return e.child!==t&&t!==null?li("Suspense Fallback"):li("Suspense");case 19:return li("SuspenseList");case 0:case 15:return md(e.type,!1);case 11:return md(e.type.render,!1);case 1:return md(e.type,!0);case 31:return li("Activity");default:return""}}function ay(e){try{var t="",a=null;do t+=LT(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
|
+
Error generating stack: `+n.message+`
|
|
8
|
+
`+n.stack}}var Zd=Object.prototype.hasOwnProperty,Vh=fr,pd=od,wT=fd,kT=cd,Bt=da,IT=ud,Ab=rd,Eb=sd,Iu=cr,MT=ld,Db=id,TT=void 0,AT=void 0,ws=null,zt=null;function yn(e){if(typeof TT==="function"&&AT(e),zt&&typeof zt.setStrictMode==="function")try{zt.setStrictMode(ws,e)}catch(t){}}var _t=Math.clz32?Math.clz32:RT,ET=Math.log,DT=Math.LN2;function RT(e){return e>>>=0,e===0?32:31-(ET(e)/DT|0)|0}var Ko=256,Xo=262144,Wo=4194304;function si(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $u(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,l=e.pingedLanes;e=e.warmLanes;var s=n&134217727;return s!==0?(n=s&~r,n!==0?i=si(n):(l&=s,l!==0?i=si(l):a||(a=s&~e,a!==0&&(i=si(a))))):(s=n&~r,s!==0?i=si(s):l!==0?i=si(l):a||(a=n&~e,a!==0&&(i=si(a)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,a=t&-t,r>=a||r===32&&(a&4194048)!==0)?t:i}function ks(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function BT(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rb(){var e=Wo;return Wo<<=1,(Wo&62914560)===0&&(Wo=4194304),e}function gd(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Is(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zT(e,t,a,n,i,r){var l=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var{entanglements:s,expirationTimes:o,hiddenUpdates:u}=e;for(a=l&~a;0<a;){var c=31-_t(a),f=1<<c;s[c]=0,o[c]=-1;var d=u[c];if(d!==null)for(u[c]=null,c=0;c<d.length;c++){var h=d[c];h!==null&&(h.lane&=-536870913)}a&=~f}n!==0&&Bb(e,n,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(l&~t))}function Bb(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-_t(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function zb(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-_t(a),i=1<<n;i&t|e[n]&t&&(e[n]|=t),a&=~i}}function _b(e,t){var a=t&-t;return a=(a&42)!==0?1:Gh(a),(a&(e.suspendedLanes|t))!==0?0:a}function Gh(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qh(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Nb(){var e=ue.p;if(e!==0)return e;return e=window.event,e===void 0?32:r0(e.type)}function ny(e,t){var a=ue.p;try{return ue.p=e,t()}finally{ue.p=a}}var Nn=Math.random().toString(36).slice(2),et="__reactFiber$"+Nn,Ct="__reactProps$"+Nn,Yr="__reactContainer$"+Nn,Jd="__reactEvents$"+Nn,_T="__reactListeners$"+Nn,NT="__reactHandles$"+Nn,iy="__reactResources$"+Nn,Ms="__reactMarker$"+Nn;function jh(e){delete e[et],delete e[Ct],delete e[Jd],delete e[_T],delete e[NT]}function br(e){var t=e[et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Yr]||a[et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=cb(e);e!==null;){if(a=e[et])return a;e=cb(e)}return t}e=a,a=e.parentNode}return null}function Kr(e){if(e=e[et]||e[Yr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(D(33))}function Ar(e){var t=e[iy];return t||(t=e[iy]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Xe(e){e[Ms]=!0}var Ob=new Set,Pb={};function vi(e,t){Or(e,t),Or(e+"Capture",t)}function Or(e,t){Pb[e]=t;for(e=0;e<t.length;e++)Ob.add(t[e])}var OT=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ry={},ly={};function PT(e){if(Zd.call(ly,e))return!0;if(Zd.call(ry,e))return!1;if(OT.test(e))return ly[e]=!0;return ry[e]=!0,!1}function su(e,t,a){if(PT(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Zo(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Ra(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Vt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qT(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get==="function"&&typeof n.set==="function"){var{get:i,set:r}=n;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){a=""+l,r.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(l){a=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $d(e){if(!e._valueTracker){var t=qb(e)?"checked":"value";e._valueTracker=qT(e,t,""+e[t])}}function Fb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=qb(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Mu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}var FT=/[\n"\\]/g;function jt(e){return e.replace(FT,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function eh(e,t,a,n,i,r,l,s){if(e.name="",l!=null&&typeof l!=="function"&&typeof l!=="symbol"&&typeof l!=="boolean"?e.type=l:e.removeAttribute("type"),t!=null)if(l==="number"){if(t===0&&e.value===""||e.value!=t)e.value=""+Vt(t)}else e.value!==""+Vt(t)&&(e.value=""+Vt(t));else l!=="submit"&&l!=="reset"||e.removeAttribute("value");t!=null?th(e,l,Vt(t)):a!=null?th(e,l,Vt(a)):n!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!=="function"&&typeof i!=="symbol"),s!=null&&typeof s!=="function"&&typeof s!=="symbol"&&typeof s!=="boolean"?e.name=""+Vt(s):e.removeAttribute("name")}function Ub(e,t,a,n,i,r,l,s){if(r!=null&&typeof r!=="function"&&typeof r!=="symbol"&&typeof r!=="boolean"&&(e.type=r),t!=null||a!=null){if(!(r!=="submit"&&r!=="reset"||t!==void 0&&t!==null)){$d(e);return}a=a!=null?""+Vt(a):"",t=t!=null?""+Vt(t):a,s||t===e.value||(e.value=t),e.defaultValue=t}n=n!=null?n:i,n=typeof n!=="function"&&typeof n!=="symbol"&&!!n,e.checked=s?e.checked:!!n,e.defaultChecked=!!n,l!=null&&typeof l!=="function"&&typeof l!=="symbol"&&typeof l!=="boolean"&&(e.name=l),$d(e)}function th(e,t,a){t==="number"&&Mu(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Er(e,t,a,n){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&n&&(e[a].defaultSelected=!0)}else{a=""+Vt(a),t=null;for(i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Hb(e,t,a){if(t!=null&&(t=""+Vt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Vt(a):""}function Vb(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(D(92));if(Hl(n)){if(1<n.length)throw Error(D(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Vt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),$d(e)}function Pr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var UT=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function sy(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a==="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!=="number"||a===0||UT.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Gb(e,t,a){if(t!=null&&typeof t!=="object")throw Error(D(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var i in t)n=t[i],t.hasOwnProperty(i)&&a[i]!==n&&sy(e,i,n)}else for(var r in t)t.hasOwnProperty(r)&&sy(e,r,t[r])}function Yh(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var HT=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),VT=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ou(e){return VT.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Fa(){}var ah=null;function Kh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sr=null,Dr=null;function oy(e){var t=Kr(e);if(t&&(e=t.stateNode)){var a=e[Ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(eh(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;a=a.querySelectorAll('input[name="'+jt(""+t)+'"][type="radio"]');for(t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var i=n[Ct]||null;if(!i)throw Error(D(90));eh(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Fb(n)}break e;case"textarea":Hb(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Er(e,!!a.multiple,t,!1)}}}var xd=!1;function Qb(e,t,a){if(xd)return e(t,a);xd=!0;try{var n=e(t);return n}finally{if(xd=!1,Sr!==null||Dr!==null){if(fc(),Sr&&(t=Sr,e=Dr,Dr=Sr=null,oy(t),e))for(t=0;t<e.length;t++)oy(e[t])}}}function cs(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Ct]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!=="function")throw Error(D(231,t,typeof a));return a}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nh=!1;if(Qa)try{oi={},Object.defineProperty(oi,"passive",{get:function(){nh=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch(e){nh=!1}var oi,bn=null,Xh=null,uu=null;function jb(){if(uu)return uu;var e,t=Xh,a=t.length,n,i="value"in bn?bn.value:bn.textContent,r=i.length;for(e=0;e<a&&t[e]===i[e];e++);var l=a-e;for(n=1;n<=l&&t[a-n]===i[r-n];n++);return uu=i.slice(e,1<n?1-n:void 0)}function cu(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 Jo(){return!0}function uy(){return!1}function Lt(e){function t(a,n,i,r,l){this._reactName=a,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(r):r[s]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Jo:uy,this.isPropagationStopped=uy,this}return we(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!=="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Jo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!=="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Jo)},persist:function(){},isPersistent:Jo}),t}var Ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ec=Lt(Ci),Ts=we({},Ci,{view:0,detail:0}),GT=Lt(Ts),yd,bd,Nl,tc=we({},Ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wh,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){if("movementX"in e)return e.movementX;return e!==Nl&&(Nl&&e.type==="mousemove"?(yd=e.screenX-Nl.screenX,bd=e.screenY-Nl.screenY):bd=yd=0,Nl=e),yd},movementY:function(e){return"movementY"in e?e.movementY:bd}}),cy=Lt(tc),QT=we({},tc,{dataTransfer:0}),jT=Lt(QT),YT=we({},Ts,{relatedTarget:0}),Sd=Lt(YT),KT=we({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),XT=Lt(KT),WT=we({},Ci,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ZT=Lt(WT),JT=we({},Ci,{data:0}),fy=Lt(JT),$T={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},e2={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"},t2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=t2[e])?!!t[e]:!1}function Wh(){return a2}var n2=we({},Ts,{key:function(e){if(e.key){var t=$T[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?e2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wh,charCode:function(e){return e.type==="keypress"?cu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),i2=Lt(n2),r2=we({},tc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dy=Lt(r2),l2=we({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wh}),s2=Lt(l2),o2=we({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),u2=Lt(o2),c2=we({},tc,{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}),f2=Lt(c2),d2=we({},Ci,{newState:0,oldState:0}),h2=Lt(d2),m2=[9,13,27,32],Zh=Qa&&"CompositionEvent"in window,Wl=null;Qa&&"documentMode"in document&&(Wl=document.documentMode);var p2=Qa&&"TextEvent"in window&&!Wl,Yb=Qa&&(!Zh||Wl&&8<Wl&&11>=Wl),hy=String.fromCharCode(32),my=!1;function Kb(e,t){switch(e){case"keyup":return m2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xb(e){return e=e.detail,typeof e==="object"&&"data"in e?e.data:null}var vr=!1;function g2(e,t){switch(e){case"compositionend":return Xb(t);case"keypress":if(t.which!==32)return null;return my=!0,hy;case"textInput":return e=t.data,e===hy&&my?null:e;default:return null}}function x2(e,t){if(vr)return e==="compositionend"||!Zh&&Kb(e,t)?(e=jb(),uu=Xh=bn=null,vr=!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 Yb&&t.locale!=="ko"?null:t.data;default:return null}}var y2={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 py(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!y2[e.type]:t==="textarea"?!0:!1}function Wb(e,t,a,n){Sr?Dr?Dr.push(n):Dr=[n]:Sr=n,t=Qu(t,"onChange"),0<t.length&&(a=new ec("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Zl=null,fs=null;function b2(e){Qv(e,0)}function ac(e){var t=Vl(e);if(Fb(t))return e}function gy(e,t){if(e==="change")return t}var Zb=!1;if(Qa){if(Qa){if(Ql="oninput"in document,!Ql)fu=document.createElement("div"),fu.setAttribute("oninput","return;"),Ql=typeof fu.oninput==="function";Gl=Ql}else Gl=!1;Zb=Gl&&(!document.documentMode||9<document.documentMode)}var Gl,Ql,fu;function xy(){Zl&&(Zl.detachEvent("onpropertychange",Jb),fs=Zl=null)}function Jb(e){if(e.propertyName==="value"&&ac(fs)){var t=[];Wb(t,fs,e,Kh(e)),Qb(b2,t)}}function S2(e,t,a){e==="focusin"?(xy(),Zl=t,fs=a,Zl.attachEvent("onpropertychange",Jb)):e==="focusout"&&xy()}function v2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ac(fs)}function C2(e,t){if(e==="click")return ac(t)}function L2(e,t){if(e==="input"||e==="change")return ac(t)}function w2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is==="function"?Object.is:w2;function ds(e,t){if(Ot(e,t))return!0;if(typeof e!=="object"||e===null||typeof t!=="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var i=a[n];if(!Zd.call(t,i)||!Ot(e[i],t[i]))return!1}return!0}function yy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function by(e,t){var a=yy(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=yy(a)}}function $b(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$b(e,t.parentNode):("contains"in e)?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mu(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href==="string"}catch(n){a=!1}if(a)e=t.contentWindow;else break;t=Mu(e.document)}return t}function Jh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var k2=Qa&&"documentMode"in document&&11>=document.documentMode,Cr=null,ih=null,Jl=null,rh=!1;function Sy(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;rh||Cr==null||Cr!==Mu(n)||(n=Cr,("selectionStart"in n)&&Jh(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Jl&&ds(Jl,n)||(Jl=n,n=Qu(ih,"onSelect"),0<n.length&&(t=new ec("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Cr)))}function ri(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Lr={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},vd={},tS={};Qa&&(tS=document.createElement("div").style,("AnimationEvent"in window)||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),("TransitionEvent"in window)||delete Lr.transitionend.transition);function Li(e){if(vd[e])return vd[e];if(!Lr[e])return e;var t=Lr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in tS)return vd[e]=t[a];return e}var aS=Li("animationend"),nS=Li("animationiteration"),iS=Li("animationstart"),I2=Li("transitionrun"),M2=Li("transitionstart"),T2=Li("transitioncancel"),rS=Li("transitionend"),lS=new Map,lh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lh.push("scrollEnd");function ia(e,t){lS.set(e,t),vi(t,[e])}var Tu=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},Ht=[],wr=0,$h=0;function nc(){for(var e=wr,t=$h=wr=0;t<e;){var a=Ht[t];Ht[t++]=null;var n=Ht[t];Ht[t++]=null;var i=Ht[t];Ht[t++]=null;var r=Ht[t];if(Ht[t++]=null,n!==null&&i!==null){var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}r!==0&&sS(a,i,r)}}function ic(e,t,a,n){Ht[wr++]=e,Ht[wr++]=t,Ht[wr++]=a,Ht[wr++]=n,$h|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function em(e,t,a,n){return ic(e,t,a,n),Au(e)}function wi(e,t){return ic(e,null,null,t),Au(e)}function sS(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var i=!1,r=e.return;r!==null;)r.childLanes|=a,n=r.alternate,n!==null&&(n.childLanes|=a),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-_t(a),e=r.hiddenUpdates,n=e[i],n===null?e[i]=[t]:n.push(t),t.lane=a|536870912),r):null}function Au(e){if(50<ss)throw ss=0,Mh=null,Error(D(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function A2(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(e,t,a,n){return new A2(e,t,a,n)}function tm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ha(e,t){var a=e.alternate;return a===null?(a=Dt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function oS(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function du(e,t,a,n,i,r){var l=0;if(n=e,typeof e==="function")tm(e)&&(l=1);else if(typeof e==="string")l=RA(e,a,ga.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Yd:return e=Dt(31,a,t,i),e.elementType=Yd,e.lanes=r,e;case xr:return di(a.children,i,r,t);case Mb:l=8,i|=24;break;case Gd:return e=Dt(12,a,t,i|2),e.elementType=Gd,e.lanes=r,e;case Qd:return e=Dt(13,a,t,i),e.elementType=Qd,e.lanes=r,e;case jd:return e=Dt(19,a,t,i),e.elementType=jd,e.lanes=r,e;default:if(typeof e==="object"&&e!==null)switch(e.$$typeof){case qa:l=10;break e;case Tb:l=9;break e;case Uh:l=11;break e;case Hh:l=14;break e;case dn:l=16,n=null;break e}l=29,a=Error(D(130,e===null?"null":typeof e,"")),n=null}return t=Dt(l,a,t,i),t.elementType=e,t.type=n,t.lanes=r,t}function di(e,t,a,n){return e=Dt(7,e,n,t),e.lanes=a,e}function Cd(e,t,a){return e=Dt(6,e,null,t),e.lanes=a,e}function uS(e){var t=Dt(18,null,null,0);return t.stateNode=e,t}function Ld(e,t,a){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vy=new WeakMap;function Yt(e,t){if(typeof e==="object"&&e!==null){var a=vy.get(e);if(a!==void 0)return a;return t={value:e,source:t,stack:ay(t)},vy.set(e,t),t}return{value:e,source:t,stack:ay(t)}}var Ir=[],Mr=0,Eu=null,hs=0,Gt=[],Qt=0,Rn=null,ha=1,ma="";function Oa(e,t){Ir[Mr++]=hs,Ir[Mr++]=Eu,Eu=e,hs=t}function cS(e,t,a){Gt[Qt++]=ha,Gt[Qt++]=ma,Gt[Qt++]=Rn,Rn=e;var n=ha;e=ma;var i=32-_t(n)-1;n&=~(1<<i),a+=1;var r=32-_t(t)+i;if(30<r){var l=i-i%5;r=(n&(1<<l)-1).toString(32),n>>=l,i-=l,ha=1<<32-_t(t)+i|a<<i|n,ma=r+e}else ha=1<<r|a<<i|n,ma=e}function am(e){e.return!==null&&(Oa(e,1),cS(e,1,0))}function nm(e){for(;e===Eu;)Eu=Ir[--Mr],Ir[Mr]=null,hs=Ir[--Mr],Ir[Mr]=null;for(;e===Rn;)Rn=Gt[--Qt],Gt[Qt]=null,ma=Gt[--Qt],Gt[Qt]=null,ha=Gt[--Qt],Gt[Qt]=null}function fS(e,t){Gt[Qt++]=ha,Gt[Qt++]=ma,Gt[Qt++]=Rn,ha=t.id,ma=t.overflow,Rn=e}var tt=null,Le=null,re=!1,wn=null,Kt=!1,sh=Error(D(519));function Bn(e){var t=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ms(Yt(t,e)),sh}function Cy(e){var{stateNode:t,type:a,memoizedProps:n}=e;switch(t[et]=e,t[Ct]=n,a){case"dialog":te("cancel",t),te("close",t);break;case"iframe":case"object":case"embed":te("load",t);break;case"video":case"audio":for(a=0;a<ys.length;a++)te(ys[a],t);break;case"source":te("error",t);break;case"img":case"image":case"link":te("error",t),te("load",t);break;case"details":te("toggle",t);break;case"input":te("invalid",t),Ub(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":te("invalid",t);break;case"textarea":te("invalid",t),Vb(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!=="string"&&typeof a!=="number"&&typeof a!=="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Yv(t.textContent,a)?(n.popover!=null&&(te("beforetoggle",t),te("toggle",t)),n.onScroll!=null&&te("scroll",t),n.onScrollEnd!=null&&te("scrollend",t),n.onClick!=null&&(t.onclick=Fa),t=!0):t=!1,t||Bn(e,!0)}function Ly(e){for(tt=e.return;tt;)switch(tt.tag){case 5:case 31:case 13:Kt=!1;return;case 27:case 3:Kt=!0;return;default:tt=tt.return}}function dr(e){if(e!==tt)return!1;if(!re)return Ly(e),re=!0,!1;var t=e.tag,a;if(a=t!==3&&t!==27){if(a=t===5)a=e.type,a=!(a!=="form"&&a!=="button")||zh(e.type,e.memoizedProps);a=!a}if(a&&Le&&Bn(e),Ly(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));Le=ub(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));Le=ub(e)}else t===27?(t=Le,On(e.type)?(e=Ph,Ph=null,Le=e):Le=t):Le=tt?Wt(e.stateNode.nextSibling):null;return!0}function gi(){Le=tt=null,re=!1}function wd(){var e=wn;return e!==null&&(St===null?St=e:St.push.apply(St,e),wn=null),e}function ms(e){wn===null?wn=[e]:wn.push(e)}var oh=xa(null),ki=null,Ua=null;function mn(e,t,a){be(oh,t._currentValue),t._currentValue=a}function Va(e){e._currentValue=oh.current,We(oh)}function uh(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function ch(e,t,a,n){var i=e.child;i!==null&&(i.return=e);for(;i!==null;){var r=i.dependencies;if(r!==null){var l=i.child;r=r.firstContext;e:for(;r!==null;){var s=r;r=i;for(var o=0;o<t.length;o++)if(s.context===t[o]){r.lanes|=a,s=r.alternate,s!==null&&(s.lanes|=a),uh(r.return,a,e),n||(l=null);break e}r=s.next}}else if(i.tag===18){if(l=i.return,l===null)throw Error(D(341));l.lanes|=a,r=l.alternate,r!==null&&(r.lanes|=a),uh(l,a,e),l=null}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===e){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}}function Xr(e,t,a,n){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var l=i.alternate;if(l===null)throw Error(D(387));if(l=l.memoizedProps,l!==null){var s=i.type;Ot(i.pendingProps.value,l.value)||(e!==null?e.push(s):e=[s])}}else if(i===Lu.current){if(l=i.alternate,l===null)throw Error(D(387));l.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ss):e=[Ss])}i=i.return}e!==null&&ch(t,e,a,n),t.flags|=262144}function Du(e){for(e=e.firstContext;e!==null;){if(!Ot(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xi(e){ki=e,Ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return dS(ki,e)}function $o(e,t){return ki===null&&xi(e),dS(e,t)}function dS(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ua===null){if(e===null)throw Error(D(308));Ua=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ua=Ua.next=t;return a}var E2=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},D2=fr,R2=cr,He={$$typeof:qa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function im(){return{controller:new E2,data:new Map,refCount:0}}function As(e){e.refCount--,e.refCount===0&&D2(R2,function(){e.controller.abort()})}var $l=null,fh=0,qr=0,Rr=null;function B2(e,t){if($l===null){var a=$l=[];fh=0,qr=Am(),Rr={status:"pending",value:void 0,then:function(n){a.push(n)}}}return fh++,t.then(wy,wy),t}function wy(){if(--fh===0&&$l!==null){Rr!==null&&(Rr.status="fulfilled");var e=$l;$l=null,qr=0,Rr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function z2(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){n.status="rejected",n.reason=i;for(i=0;i<a.length;i++)(0,a[i])(void 0)}),n}var ky=j.S;j.S=function(e,t){Iv=Bt(),typeof t==="object"&&t!==null&&typeof t.then==="function"&&B2(e,t),ky!==null&&ky(e,t)};var hi=xa(null);function rm(){var e=hi.current;return e!==null?e:xe.pooledCache}function hu(e,t){t===null?be(hi,hi.current):be(hi,t.pool)}function hS(){var e=rm();return e===null?null:{parent:He._currentValue,pool:e}}var Wr=Error(D(460)),lm=Error(D(474)),rc=Error(D(542)),Ru={then:function(){}};function Iy(e){return e=e.status,e==="fulfilled"||e==="rejected"}function mS(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Fa,Fa),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ty(e),e;default:if(typeof t.status==="string")t.then(Fa,Fa);else{if(e=xe,e!==null&&100<e.shellSuspendCounter)throw Error(D(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=n}},function(n){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ty(e),e}throw mi=t,Wr}}function ui(e){try{var t=e._init;return t(e._payload)}catch(a){if(a!==null&&typeof a==="object"&&typeof a.then==="function")throw mi=a,Wr;throw a}}var mi=null;function My(){if(mi===null)throw Error(D(459));var e=mi;return mi=null,e}function Ty(e){if(e===Wr||e===rc)throw Error(D(483))}var Br=null,ps=0;function eu(e){var t=ps;return ps+=1,Br===null&&(Br=[]),mS(Br,e,t)}function Ol(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function tu(e,t){if(t.$$typeof===ST)throw Error(D(525));throw e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function pS(e){function t(p,x){if(e){var y=p.deletions;y===null?(p.deletions=[x],p.flags|=16):y.push(x)}}function a(p,x){if(!e)return null;for(;x!==null;)t(p,x),x=x.sibling;return null}function n(p){for(var x=new Map;p!==null;)p.key!==null?x.set(p.key,p):x.set(p.index,p),p=p.sibling;return x}function i(p,x){return p=Ha(p,x),p.index=0,p.sibling=null,p}function r(p,x,y){if(p.index=y,!e)return p.flags|=1048576,x;if(y=p.alternate,y!==null)return y=y.index,y<x?(p.flags|=67108866,x):y;return p.flags|=67108866,x}function l(p){return e&&p.alternate===null&&(p.flags|=67108866),p}function s(p,x,y,w){if(x===null||x.tag!==6)return x=Cd(y,p.mode,w),x.return=p,x;return x=i(x,y),x.return=p,x}function o(p,x,y,w){var T=y.type;if(T===xr)return c(p,x,y.props.children,w,y.key);if(x!==null&&(x.elementType===T||typeof T==="object"&&T!==null&&T.$$typeof===dn&&ui(T)===x.type))return x=i(x,y.props),Ol(x,y),x.return=p,x;return x=du(y.type,y.key,y.props,null,p.mode,w),Ol(x,y),x.return=p,x}function u(p,x,y,w){if(x===null||x.tag!==4||x.stateNode.containerInfo!==y.containerInfo||x.stateNode.implementation!==y.implementation)return x=Ld(y,p.mode,w),x.return=p,x;return x=i(x,y.children||[]),x.return=p,x}function c(p,x,y,w,T){if(x===null||x.tag!==7)return x=di(y,p.mode,w,T),x.return=p,x;return x=i(x,y),x.return=p,x}function f(p,x,y){if(typeof x==="string"&&x!==""||typeof x==="number"||typeof x==="bigint")return x=Cd(""+x,p.mode,y),x.return=p,x;if(typeof x==="object"&&x!==null){switch(x.$$typeof){case Yo:return y=du(x.type,x.key,x.props,null,p.mode,y),Ol(y,x),y.return=p,y;case Ul:return x=Ld(x,p.mode,y),x.return=p,x;case dn:return x=ui(x),f(p,x,y)}if(Hl(x)||_l(x))return x=di(x,p.mode,y,null),x.return=p,x;if(typeof x.then==="function")return f(p,eu(x),y);if(x.$$typeof===qa)return f(p,$o(p,x),y);tu(p,x)}return null}function d(p,x,y,w){var T=x!==null?x.key:null;if(typeof y==="string"&&y!==""||typeof y==="number"||typeof y==="bigint")return T!==null?null:s(p,x,""+y,w);if(typeof y==="object"&&y!==null){switch(y.$$typeof){case Yo:return y.key===T?o(p,x,y,w):null;case Ul:return y.key===T?u(p,x,y,w):null;case dn:return y=ui(y),d(p,x,y,w)}if(Hl(y)||_l(y))return T!==null?null:c(p,x,y,w,null);if(typeof y.then==="function")return d(p,x,eu(y),w);if(y.$$typeof===qa)return d(p,x,$o(p,y),w);tu(p,y)}return null}function h(p,x,y,w,T){if(typeof w==="string"&&w!==""||typeof w==="number"||typeof w==="bigint")return p=p.get(y)||null,s(x,p,""+w,T);if(typeof w==="object"&&w!==null){switch(w.$$typeof){case Yo:return p=p.get(w.key===null?y:w.key)||null,o(x,p,w,T);case Ul:return p=p.get(w.key===null?y:w.key)||null,u(x,p,w,T);case dn:return w=ui(w),h(p,x,y,w,T)}if(Hl(w)||_l(w))return p=p.get(y)||null,c(x,p,w,T,null);if(typeof w.then==="function")return h(p,x,y,eu(w),T);if(w.$$typeof===qa)return h(p,x,y,$o(x,w),T);tu(x,w)}return null}function g(p,x,y,w){for(var T=null,I=null,M=x,R=x=0,A=null;M!==null&&R<y.length;R++){M.index>R?(A=M,M=null):A=M.sibling;var v=d(p,M,y[R],w);if(v===null){M===null&&(M=A);break}e&&M&&v.alternate===null&&t(p,M),x=r(v,x,R),I===null?T=v:I.sibling=v,I=v,M=A}if(R===y.length)return a(p,M),re&&Oa(p,R),T;if(M===null){for(;R<y.length;R++)M=f(p,y[R],w),M!==null&&(x=r(M,x,R),I===null?T=M:I.sibling=M,I=M);return re&&Oa(p,R),T}for(M=n(M);R<y.length;R++)A=h(M,p,R,y[R],w),A!==null&&(e&&A.alternate!==null&&M.delete(A.key===null?R:A.key),x=r(A,x,R),I===null?T=A:I.sibling=A,I=A);return e&&M.forEach(function(F){return t(p,F)}),re&&Oa(p,R),T}function b(p,x,y,w){if(y==null)throw Error(D(151));for(var T=null,I=null,M=x,R=x=0,A=null,v=y.next();M!==null&&!v.done;R++,v=y.next()){M.index>R?(A=M,M=null):A=M.sibling;var F=d(p,M,v.value,w);if(F===null){M===null&&(M=A);break}e&&M&&F.alternate===null&&t(p,M),x=r(F,x,R),I===null?T=F:I.sibling=F,I=F,M=A}if(v.done)return a(p,M),re&&Oa(p,R),T;if(M===null){for(;!v.done;R++,v=y.next())v=f(p,v.value,w),v!==null&&(x=r(v,x,R),I===null?T=v:I.sibling=v,I=v);return re&&Oa(p,R),T}for(M=n(M);!v.done;R++,v=y.next())v=h(M,p,R,v.value,w),v!==null&&(e&&v.alternate!==null&&M.delete(v.key===null?R:v.key),x=r(v,x,R),I===null?T=v:I.sibling=v,I=v);return e&&M.forEach(function(H){return t(p,H)}),re&&Oa(p,R),T}function S(p,x,y,w){if(typeof y==="object"&&y!==null&&y.type===xr&&y.key===null&&(y=y.props.children),typeof y==="object"&&y!==null){switch(y.$$typeof){case Yo:e:{for(var T=y.key;x!==null;){if(x.key===T){if(T=y.type,T===xr){if(x.tag===7){a(p,x.sibling),w=i(x,y.props.children),w.return=p,p=w;break e}}else if(x.elementType===T||typeof T==="object"&&T!==null&&T.$$typeof===dn&&ui(T)===x.type){a(p,x.sibling),w=i(x,y.props),Ol(w,y),w.return=p,p=w;break e}a(p,x);break}else t(p,x);x=x.sibling}y.type===xr?(w=di(y.props.children,p.mode,w,y.key),w.return=p,p=w):(w=du(y.type,y.key,y.props,null,p.mode,w),Ol(w,y),w.return=p,p=w)}return l(p);case Ul:e:{for(T=y.key;x!==null;){if(x.key===T)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){a(p,x.sibling),w=i(x,y.children||[]),w.return=p,p=w;break e}else{a(p,x);break}else t(p,x);x=x.sibling}w=Ld(y,p.mode,w),w.return=p,p=w}return l(p);case dn:return y=ui(y),S(p,x,y,w)}if(Hl(y))return g(p,x,y,w);if(_l(y)){if(T=_l(y),typeof T!=="function")throw Error(D(150));return y=T.call(y),b(p,x,y,w)}if(typeof y.then==="function")return S(p,x,eu(y),w);if(y.$$typeof===qa)return S(p,x,$o(p,y),w);tu(p,y)}return typeof y==="string"&&y!==""||typeof y==="number"||typeof y==="bigint"?(y=""+y,x!==null&&x.tag===6?(a(p,x.sibling),w=i(x,y),w.return=p,p=w):(a(p,x),w=Cd(y,p.mode,w),w.return=p,p=w),l(p)):a(p,x)}return function(p,x,y,w){try{ps=0;var T=S(p,x,y,w);return Br=null,T}catch(M){if(M===Wr||M===rc)throw M;var I=Dt(29,M,null,p.mode);return I.lanes=w,I.return=p,I}finally{}}}var yi=pS(!0),gS=pS(!1),hn=!1;function sm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function kn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function In(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(oe&2)!==0){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,t=Au(e),sS(e,null,a),t}return ic(e,n,t,a),Au(e)}function es(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,zb(e,a)}}function kd(e,t){var{updateQueue:a,alternate:n}=e;if(n!==null&&(n=n.updateQueue,a===n)){var i=null,r=null;if(a=a.firstBaseUpdate,a!==null){do{var l={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};r===null?i=r=l:r=r.next=l,a=a.next}while(a!==null);r===null?i=r=t:r=r.next=t}else i=r=t;a={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var hh=!1;function ts(){if(hh){var e=Rr;if(e!==null)throw e}}function as(e,t,a,n){hh=!1;var i=e.updateQueue;hn=!1;var{firstBaseUpdate:r,lastBaseUpdate:l}=i,s=i.shared.pending;if(s!==null){i.shared.pending=null;var o=s,u=o.next;o.next=null,l===null?r=u:l.next=u,l=o;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=o))}if(r!==null){var f=i.baseState;l=0,c=u=o=null,s=r;do{var d=s.lane&-536870913,h=d!==s.lane;if(h?(ne&d)===d:(n&d)===d){d!==0&&d===qr&&(hh=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var g=e,b=s;d=t;var S=a;switch(b.tag){case 1:if(g=b.payload,typeof g==="function"){f=g.call(S,f,d);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,d=typeof g==="function"?g.call(S,f,d):g,d===null||d===void 0)break e;f=we({},f,d);break e;case 2:hn=!0}}d=s.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,o=f):c=c.next=h,l|=d;if(s=s.next,s===null)if(s=i.shared.pending,s===null)break;else h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}while(1);c===null&&(o=f),i.baseState=o,i.firstBaseUpdate=u,i.lastBaseUpdate=c,r===null&&(i.shared.lanes=0),_n|=l,e.lanes=l,e.memoizedState=f}}function xS(e,t){if(typeof e!=="function")throw Error(D(191,e));e.call(t)}function yS(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)xS(a[e],t)}var Fr=xa(null),Bu=xa(0);function Ay(e,t){e=Xa,be(Bu,e),be(Fr,t),Xa=e|t.baseLanes}function mh(){be(Bu,Xa),be(Fr,Fr.current)}function om(){Xa=Bu.current,We(Fr),We(Bu)}var Pt=xa(null),Xt=null;function pn(e){var t=e.alternate;be(Ne,Ne.current&1),be(Pt,e),Xt===null&&(t===null||Fr.current!==null?Xt=e:t.memoizedState!==null&&(Xt=e))}function ph(e){be(Ne,Ne.current),be(Pt,e),Xt===null&&(Xt=e)}function bS(e){e.tag===22?(be(Ne,Ne.current),be(Pt,e),Xt===null&&(Xt=e)):gn(e)}function gn(){be(Ne,Ne.current),be(Pt,Pt.current)}function Et(e){We(Pt),Xt===e&&(Xt=null),We(Ne)}var Ne=xa(0);function zu(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Nh(a)||Oh(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ja=0,W=null,pe=null,Fe=null,_u=!1,zr=!1,bi=!1,Nu=0,gs=0,_r=null,_2=0;function Ae(){throw Error(D(321))}function um(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ot(e[a],t[a]))return!1;return!0}function cm(e,t,a,n,i,r){return ja=r,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?WS:vm,bi=!1,r=a(n,i),bi=!1,zr&&(r=vS(t,a,n,i)),SS(e),r}function SS(e){j.H=xs;var t=pe!==null&&pe.next!==null;if(ja=0,Fe=pe=W=null,_u=!1,gs=0,_r=null,t)throw Error(D(300));e===null||Ve||(e=e.dependencies,e!==null&&Du(e)&&(Ve=!0))}function vS(e,t,a,n){W=e;var i=0;do{if(zr&&(_r=null),gs=0,zr=!1,25<=i)throw Error(D(301));if(i+=1,Fe=pe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}j.H=ZS,r=t(a,n)}while(zr);return r}function N2(){var e=j.H,t=e.useState()[0];return t=typeof t.then==="function"?Es(t):t,e=e.useState()[0],(pe!==null?pe.memoizedState:null)!==e&&(W.flags|=1024),t}function fm(){var e=Nu!==0;return Nu=0,e}function dm(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function hm(e){if(_u){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_u=!1}ja=0,Fe=pe=W=null,zr=!1,gs=Nu=0,_r=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?W.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Oe(){if(pe===null){var e=W.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=Fe===null?W.memoizedState:Fe.next;if(t!==null)Fe=t,pe=e;else{if(e===null){if(W.alternate===null)throw Error(D(467));throw Error(D(310))}pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},Fe===null?W.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function lc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Es(e){var t=gs;return gs+=1,_r===null&&(_r=[]),e=mS(_r,e,t),t=W,(Fe===null?t.memoizedState:Fe.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?WS:vm),e}function sc(e){if(e!==null&&typeof e==="object"){if(typeof e.then==="function")return Es(e);if(e.$$typeof===qa)return at(e)}throw Error(D(438,String(e)))}function mm(e){var t=null,a=W.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=W.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=lc(),W.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=vT;return t.index++,a}function Ya(e,t){return typeof t==="function"?t(e):t}function mu(e){var t=Oe();return pm(t,pe,e)}function pm(e,t,a){var n=e.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=a;var i=e.baseQueue,r=n.pending;if(r!==null){if(i!==null){var l=i.next;i.next=r.next,r.next=l}t.baseQueue=i=r,n.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var s=l=null,o=null,u=t,c=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(ne&f)===f:(ja&f)===f){var d=u.revertLane;if(d===0)o!==null&&(o=o.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===qr&&(c=!0);else if((ja&d)===d){u=u.next,d===qr&&(c=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},o===null?(s=o=f,l=r):o=o.next=f,W.lanes|=d,_n|=d;f=u.action,bi&&a(r,f),r=u.hasEagerState?u.eagerState:a(r,f)}else d={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},o===null?(s=o=d,l=r):o=o.next=d,W.lanes|=f,_n|=f;u=u.next}while(u!==null&&u!==t);if(o===null?l=r:o.next=s,!Ot(r,e.memoizedState)&&(Ve=!0,c&&(a=Rr,a!==null)))throw a;e.memoizedState=r,e.baseState=l,e.baseQueue=o,n.lastRenderedState=r}return i===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Id(e){var t=Oe(),a=t.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=e;var{dispatch:n,pending:i}=a,r=t.memoizedState;if(i!==null){a.pending=null;var l=i=i.next;do r=e(r,l.action),l=l.next;while(l!==i);Ot(r,t.memoizedState)||(Ve=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),a.lastRenderedState=r}return[r,n]}function CS(e,t,a){var n=W,i=Oe(),r=re;if(r){if(a===void 0)throw Error(D(407));a=a()}else a=t();var l=!Ot((pe||i).memoizedState,a);if(l&&(i.memoizedState=a,Ve=!0),i=i.queue,gm(kS.bind(null,n,i,e),[e]),i.getSnapshot!==t||l||Fe!==null&&Fe.memoizedState.tag&1){if(n.flags|=2048,Ur(9,{destroy:void 0},wS.bind(null,n,i,a,t),null),xe===null)throw Error(D(349));r||(ja&127)!==0||LS(n,t,a)}return a}function LS(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=W.updateQueue,t===null?(t=lc(),W.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function wS(e,t,a,n){t.value=a,t.getSnapshot=n,IS(t)&&MS(e)}function kS(e,t,a){return a(function(){IS(t)&&MS(e)})}function IS(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ot(e,a)}catch(n){return!0}}function MS(e){var t=wi(e,2);t!==null&&vt(t,e,2)}function gh(e){var t=dt();if(typeof e==="function"){var a=e;if(e=a(),bi){yn(!0);try{a()}finally{yn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ya,lastRenderedState:e},t}function TS(e,t,a,n){return e.baseState=a,pm(e,pe,typeof n==="function"?n:Ya)}function O2(e,t,a,n,i){if(uc(e))throw Error(D(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(l){r.listeners.push(l)}};j.T!==null?a(!0):r.isTransition=!1,n(r),a=t.pending,a===null?(r.next=t.pending=r,AS(t,r)):(r.next=a.next,t.pending=a.next=r)}}function AS(e,t){var{action:a,payload:n}=t,i=e.state;if(t.isTransition){var r=j.T,l={};j.T=l;try{var s=a(i,n),o=j.S;o!==null&&o(l,s),Ey(e,t,s)}catch(u){xh(e,t,u)}finally{r!==null&&l.types!==null&&(r.types=l.types),j.T=r}}else try{r=a(i,n),Ey(e,t,r)}catch(u){xh(e,t,u)}}function Ey(e,t,a){a!==null&&typeof a==="object"&&typeof a.then==="function"?a.then(function(n){Dy(e,t,n)},function(n){return xh(e,t,n)}):Dy(e,t,a)}function Dy(e,t,a){t.status="fulfilled",t.value=a,ES(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,AS(e,a)))}function xh(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,ES(t),t=t.next;while(t!==n)}e.action=null}function ES(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function DS(e,t){return t}function Ry(e,t){if(re){var a=xe.formState;if(a!==null){e:{var n=W;if(re){if(Le){t:{var i=Le;for(var r=Kt;i.nodeType!==8;){if(!r){i=null;break t}if(i=Wt(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Le=Wt(i.nextSibling),n=i.data==="F!";break e}}Bn(n)}n=!1}n&&(t=a[0])}}return a=dt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DS,lastRenderedState:t},a.queue=n,a=YS.bind(null,W,n),n.dispatch=a,n=gh(!1),r=Sm.bind(null,W,!1,n.queue),n=dt(),i={state:t,dispatch:null,action:e,pending:null},n.queue=i,a=O2.bind(null,W,i,r,a),i.dispatch=a,n.memoizedState=e,[t,a,!1]}function By(e){var t=Oe();return RS(t,pe,e)}function RS(e,t,a){if(t=pm(e,t,DS)[0],e=mu(Ya)[0],typeof t==="object"&&t!==null&&typeof t.then==="function")try{var n=Es(t)}catch(l){if(l===Wr)throw rc;throw l}else n=t;t=Oe();var i=t.queue,r=i.dispatch;return a!==t.memoizedState&&(W.flags|=2048,Ur(9,{destroy:void 0},P2.bind(null,i,a),null)),[n,r,e]}function P2(e,t){e.action=t}function zy(e){var t=Oe(),a=pe;if(a!==null)return RS(t,a,e);Oe(),t=t.memoizedState,a=Oe();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Ur(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=W.updateQueue,t===null&&(t=lc(),W.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function BS(){return Oe().memoizedState}function pu(e,t,a,n){var i=dt();W.flags|=e,i.memoizedState=Ur(1|t,{destroy:void 0},a,n===void 0?null:n)}function oc(e,t,a,n){var i=Oe();n=n===void 0?null:n;var r=i.memoizedState.inst;pe!==null&&n!==null&&um(n,pe.memoizedState.deps)?i.memoizedState=Ur(t,r,a,n):(W.flags|=e,i.memoizedState=Ur(1|t,r,a,n))}function _y(e,t){pu(8390656,8,e,t)}function gm(e,t){oc(2048,8,e,t)}function q2(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=lc(),W.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function zS(e){var t=Oe().memoizedState;return q2({ref:t,nextImpl:e}),function(){if((oe&2)!==0)throw Error(D(440));return t.impl.apply(void 0,arguments)}}function _S(e,t){return oc(4,2,e,t)}function NS(e,t){return oc(4,4,e,t)}function OS(e,t){if(typeof t==="function"){e=e();var a=t(e);return function(){typeof a==="function"?a():t(null)}}if(t!==null&&t!==void 0)return e=e(),t.current=e,function(){t.current=null}}function PS(e,t,a){a=a!==null&&a!==void 0?a.concat([e]):null,oc(4,4,OS.bind(null,t,e),a)}function xm(){}function qS(e,t){var a=Oe();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&um(t,n[1]))return n[0];return a.memoizedState=[e,t],e}function FS(e,t){var a=Oe();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&um(t,n[1]))return n[0];if(n=e(),bi){yn(!0);try{e()}finally{yn(!1)}}return a.memoizedState=[n,t],n}function ym(e,t,a){if(a===void 0||(ja&1073741824)!==0&&(ne&261930)===0)return e.memoizedState=t;return e.memoizedState=a,e=Tv(),W.lanes|=e,_n|=e,a}function US(e,t,a,n){if(Ot(a,t))return a;if(Fr.current!==null)return e=ym(e,a,n),Ot(e,t)||(Ve=!0),e;if((ja&42)===0||(ja&1073741824)!==0&&(ne&261930)===0)return Ve=!0,e.memoizedState=a;return e=Tv(),W.lanes|=e,_n|=e,t}function HS(e,t,a,n,i){var r=ue.p;ue.p=r!==0&&8>r?r:8;var l=j.T,s={};j.T=s,Sm(e,!1,t,a);try{var o=i(),u=j.S;if(u!==null&&u(s,o),o!==null&&typeof o==="object"&&typeof o.then==="function"){var c=z2(o,n);ns(e,t,c,Nt(e))}else ns(e,t,n,Nt(e))}catch(f){ns(e,t,{then:function(){},status:"rejected",reason:f},Nt())}finally{ue.p=r,l!==null&&s.types!==null&&(l.types=s.types),j.T=l}}function F2(){}function yh(e,t,a,n){if(e.tag!==5)throw Error(D(476));var i=VS(e).queue;HS(e,i,t,fi,a===null?F2:function(){return GS(e),a(n)})}function VS(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fi,baseState:fi,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ya,lastRenderedState:fi},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ya,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function GS(e){var t=VS(e);t.next===null&&(t=e.alternate.memoizedState),ns(e,t.next.queue,{},Nt())}function bm(){return at(Ss)}function QS(){return Oe().memoizedState}function jS(){return Oe().memoizedState}function U2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Nt();e=kn(a);var n=In(t,e,a);n!==null&&(vt(n,t,a),es(n,t,a)),t={cache:im()},e.payload=t;return}t=t.return}}function H2(e,t,a){var n=Nt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},uc(e)?KS(t,a):(a=em(e,t,a,n),a!==null&&(vt(a,e,n),XS(a,t,n)))}function YS(e,t,a){var n=Nt();ns(e,t,a,n)}function ns(e,t,a,n){var i={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(uc(e))KS(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var l=t.lastRenderedState,s=r(l,a);if(i.hasEagerState=!0,i.eagerState=s,Ot(s,l))return ic(e,t,i,0),xe===null&&nc(),!1}catch(o){}finally{}if(a=em(e,t,i,n),a!==null)return vt(a,e,n),XS(a,t,n),!0}return!1}function Sm(e,t,a,n){if(n={lane:2,revertLane:Am(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(D(479))}else t=em(e,a,n,2),t!==null&&vt(t,e,2)}function uc(e){var t=e.alternate;return e===W||t!==null&&t===W}function KS(e,t){zr=_u=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function XS(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,zb(e,a)}}var xs={readContext:at,use:sc,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useLayoutEffect:Ae,useInsertionEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useSyncExternalStore:Ae,useId:Ae,useHostTransitionStatus:Ae,useFormState:Ae,useActionState:Ae,useOptimistic:Ae,useMemoCache:Ae,useCacheRefresh:Ae};xs.useEffectEvent=Ae;var WS={readContext:at,use:sc,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:_y,useImperativeHandle:function(e,t,a){a=a!==null&&a!==void 0?a.concat([e]):null,pu(4194308,4,OS.bind(null,t,e),a)},useLayoutEffect:function(e,t){return pu(4194308,4,e,t)},useInsertionEffect:function(e,t){pu(4,2,e,t)},useMemo:function(e,t){var a=dt();t=t===void 0?null:t;var n=e();if(bi){yn(!0);try{e()}finally{yn(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=dt();if(a!==void 0){var i=a(t);if(bi){yn(!0);try{a(t)}finally{yn(!1)}}}else i=t;return n.memoizedState=n.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},n.queue=e,e=e.dispatch=H2.bind(null,W,e),[n.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=gh(e);var t=e.queue,a=YS.bind(null,W,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:xm,useDeferredValue:function(e,t){var a=dt();return ym(a,e,t)},useTransition:function(){var e=gh(!1);return e=HS.bind(null,W,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=W,i=dt();if(re){if(a===void 0)throw Error(D(407));a=a()}else{if(a=t(),xe===null)throw Error(D(349));(ne&127)!==0||LS(n,t,a)}i.memoizedState=a;var r={value:a,getSnapshot:t};return i.queue=r,_y(kS.bind(null,n,r,e),[e]),n.flags|=2048,Ur(9,{destroy:void 0},wS.bind(null,n,r,a,t),null),a},useId:function(){var e=dt(),t=xe.identifierPrefix;if(re){var a=ma,n=ha;a=(n&~(1<<32-_t(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Nu++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=_2++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bm,useFormState:Ry,useActionState:Ry,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Sm.bind(null,W,!0,a),a.dispatch=t,[e,t]},useMemoCache:mm,useCacheRefresh:function(){return dt().memoizedState=U2.bind(null,W)},useEffectEvent:function(e){var t=dt(),a={impl:e};return t.memoizedState=a,function(){if((oe&2)!==0)throw Error(D(440));return a.impl.apply(void 0,arguments)}}},vm={readContext:at,use:sc,useCallback:qS,useContext:at,useEffect:gm,useImperativeHandle:PS,useInsertionEffect:_S,useLayoutEffect:NS,useMemo:FS,useReducer:mu,useRef:BS,useState:function(){return mu(Ya)},useDebugValue:xm,useDeferredValue:function(e,t){var a=Oe();return US(a,pe.memoizedState,e,t)},useTransition:function(){var e=mu(Ya)[0],t=Oe().memoizedState;return[typeof e==="boolean"?e:Es(e),t]},useSyncExternalStore:CS,useId:QS,useHostTransitionStatus:bm,useFormState:By,useActionState:By,useOptimistic:function(e,t){var a=Oe();return TS(a,pe,e,t)},useMemoCache:mm,useCacheRefresh:jS};vm.useEffectEvent=zS;var ZS={readContext:at,use:sc,useCallback:qS,useContext:at,useEffect:gm,useImperativeHandle:PS,useInsertionEffect:_S,useLayoutEffect:NS,useMemo:FS,useReducer:Id,useRef:BS,useState:function(){return Id(Ya)},useDebugValue:xm,useDeferredValue:function(e,t){var a=Oe();return pe===null?ym(a,e,t):US(a,pe.memoizedState,e,t)},useTransition:function(){var e=Id(Ya)[0],t=Oe().memoizedState;return[typeof e==="boolean"?e:Es(e),t]},useSyncExternalStore:CS,useId:QS,useHostTransitionStatus:bm,useFormState:zy,useActionState:zy,useOptimistic:function(e,t){var a=Oe();if(pe!==null)return TS(a,pe,e,t);return a.baseState=e,[e,a.queue.dispatch]},useMemoCache:mm,useCacheRefresh:jS};ZS.useEffectEvent=zS;function Md(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a===null||a===void 0?t:we({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var bh={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Nt(),i=kn(n);i.payload=t,a!==void 0&&a!==null&&(i.callback=a),t=In(e,i,n),t!==null&&(vt(t,e,n),es(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Nt(),i=kn(n);i.tag=1,i.payload=t,a!==void 0&&a!==null&&(i.callback=a),t=In(e,i,n),t!==null&&(vt(t,e,n),es(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Nt(),n=kn(a);n.tag=2,t!==void 0&&t!==null&&(n.callback=t),t=In(e,n,a),t!==null&&(vt(t,e,a),es(t,e,a))}};function Ny(e,t,a,n,i,r,l){return e=e.stateNode,typeof e.shouldComponentUpdate==="function"?e.shouldComponentUpdate(n,r,l):t.prototype&&t.prototype.isPureReactComponent?!ds(a,n)||!ds(i,r):!0}function Oy(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps==="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps==="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&bh.enqueueReplaceState(t,t.state,null)}function Si(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=we({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function JS(e){Tu(e)}function $S(e){console.error(e)}function ev(e){Tu(e)}function Ou(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Py(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Sh(e,t,a){return a=kn(a),a.tag=3,a.payload={element:null},a.callback=function(){Ou(e,t)},a}function tv(e){return e=kn(e),e.tag=3,e}function av(e,t,a,n){var i=a.type.getDerivedStateFromError;if(typeof i==="function"){var r=n.value;e.payload=function(){return i(r)},e.callback=function(){Py(t,a,n)}}var l=a.stateNode;l!==null&&typeof l.componentDidCatch==="function"&&(e.callback=function(){Py(t,a,n),typeof i!=="function"&&(Mn===null?Mn=new Set([this]):Mn.add(this));var s=n.stack;this.componentDidCatch(n.value,{componentStack:s!==null?s:""})})}function V2(e,t,a,n,i){if(a.flags|=32768,n!==null&&typeof n==="object"&&typeof n.then==="function"){if(t=a.alternate,t!==null&&Xr(t,a,i,!0),a=Pt.current,a!==null){switch(a.tag){case 31:case 13:return Xt===null?Hu():a.alternate===null&&Ee===0&&(Ee=3),a.flags&=-257,a.flags|=65536,a.lanes=i,n===Ru?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Pd(e,n,i)),!1;case 22:return a.flags|=65536,n===Ru?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Pd(e,n,i)),!1}throw Error(D(435,a.tag))}return Pd(e,n,i),Hu(),!1}if(re)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,n!==sh&&(e=Error(D(422),{cause:n}),ms(Yt(e,a)))):(n!==sh&&(t=Error(D(423),{cause:n}),ms(Yt(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,n=Yt(n,a),i=Sh(e.stateNode,n,i),kd(e,i),Ee!==4&&(Ee=2)),!1;var r=Error(D(520),{cause:n});if(r=Yt(r,a),ls===null?ls=[r]:ls.push(r),Ee!==4&&(Ee=2),t===null)return!0;n=Yt(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=Sh(a.stateNode,n,e),kd(a,e),!1;case 1:if(t=a.type,r=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError==="function"||r!==null&&typeof r.componentDidCatch==="function"&&(Mn===null||!Mn.has(r))))return a.flags|=65536,i&=-i,a.lanes|=i,i=tv(i),av(i,e,a,n),kd(a,i),!1}a=a.return}while(a!==null);return!1}var Cm=Error(D(461)),Ve=!1;function $e(e,t,a,n){t.child=e===null?gS(t,null,a,n):yi(t,e.child,a,n)}function qy(e,t,a,n,i){a=a.render;var r=t.ref;if("ref"in n){var l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}else l=n;if(xi(t),n=cm(e,t,a,l,r,i),s=fm(),e!==null&&!Ve)return dm(e,t,i),Ka(e,t,i);return re&&s&&am(t),t.flags|=1,$e(e,t,n,i),t.child}function Fy(e,t,a,n,i){if(e===null){var r=a.type;if(typeof r==="function"&&!tm(r)&&r.defaultProps===void 0&&a.compare===null)return t.tag=15,t.type=r,nv(e,t,r,n,i);return e=du(a.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e}if(r=e.child,!Lm(e,i)){var l=r.memoizedProps;if(a=a.compare,a=a!==null?a:ds,a(l,n)&&e.ref===t.ref)return Ka(e,t,i)}return t.flags|=1,e=Ha(r,n),e.ref=t.ref,e.return=t,t.child=e}function nv(e,t,a,n,i){if(e!==null){var r=e.memoizedProps;if(ds(r,n)&&e.ref===t.ref)if(Ve=!1,t.pendingProps=n=r,Lm(e,i))(e.flags&131072)!==0&&(Ve=!0);else return t.lanes=e.lanes,Ka(e,t,i)}return vh(e,t,a,n,i)}function iv(e,t,a,n){var i=n.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|a:a,e!==null){n=t.child=e.child;for(i=0;n!==null;)i=i|n.lanes|n.childLanes,n=n.sibling;n=i&~r}else n=0,t.child=null;return Uy(e,t,r,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hu(t,r!==null?r.cachePool:null),r!==null?Ay(t,r):mh(),bS(t);else return n=t.lanes=536870912,Uy(e,t,r!==null?r.baseLanes|a:a,a,n)}else r!==null?(hu(t,r.cachePool),Ay(t,r),gn(t),t.memoizedState=null):(e!==null&&hu(t,null),mh(),gn(t));return $e(e,t,i,a),t.child}function jl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Uy(e,t,a,n,i){var r=rm();return r=r===null?null:{parent:He._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&hu(t,null),mh(),bS(t),e!==null&&Xr(e,t,n,!0),t.childLanes=i,null}function gu(e,t){return t=Pu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hy(e,t,a){return yi(t,e.child,null,a),e=gu(t,t.pendingProps),e.flags|=2,Et(t),t.memoizedState=null,e}function G2(e,t,a){var n=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(n.mode==="hidden")return e=gu(t,n),t.lanes=536870912,jl(null,e);if(ph(t),(e=Le)?(e=Wv(e,Kt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rn!==null?{id:ha,overflow:ma}:null,retryLane:536870912,hydrationErrors:null},a=uS(e),a.return=t,t.child=a,tt=t,Le=null)):e=null,e===null)throw Bn(t);return t.lanes=536870912,null}return gu(t,n)}var r=e.memoizedState;if(r!==null){var l=r.dehydrated;if(ph(t),i)if(t.flags&256)t.flags&=-257,t=Hy(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(D(558));else if(Ve||Xr(e,t,a,!1),i=(a&e.childLanes)!==0,Ve||i){if(n=xe,n!==null&&(l=_b(n,a),l!==0&&l!==r.retryLane))throw r.retryLane=l,wi(e,l),vt(n,e,l),Cm;Hu(),t=Hy(e,t,a)}else e=r.treeContext,Le=Wt(l.nextSibling),tt=t,re=!0,wn=null,Kt=!1,e!==null&&fS(t,e),t=gu(t,n),t.flags|=4096;return t}return e=Ha(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xu(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!=="function"&&typeof a!=="object")throw Error(D(284));if(e===null||e.ref!==a)t.flags|=4194816}}function vh(e,t,a,n,i){if(xi(t),a=cm(e,t,a,n,void 0,i),n=fm(),e!==null&&!Ve)return dm(e,t,i),Ka(e,t,i);return re&&n&&am(t),t.flags|=1,$e(e,t,a,i),t.child}function Vy(e,t,a,n,i,r){if(xi(t),t.updateQueue=null,a=vS(t,n,a,i),SS(e),n=fm(),e!==null&&!Ve)return dm(e,t,r),Ka(e,t,r);return re&&n&&am(t),t.flags|=1,$e(e,t,a,r),t.child}function Gy(e,t,a,n,i){if(xi(t),t.stateNode===null){var r=kr,l=a.contextType;typeof l==="object"&&l!==null&&(r=at(l)),r=new a(n,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=bh,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=n,r.state=t.memoizedState,r.refs={},sm(t),l=a.contextType,r.context=typeof l==="object"&&l!==null?at(l):kr,r.state=t.memoizedState,l=a.getDerivedStateFromProps,typeof l==="function"&&(Md(t,a,l,n),r.state=t.memoizedState),typeof a.getDerivedStateFromProps==="function"||typeof r.getSnapshotBeforeUpdate==="function"||typeof r.UNSAFE_componentWillMount!=="function"&&typeof r.componentWillMount!=="function"||(l=r.state,typeof r.componentWillMount==="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==="function"&&r.UNSAFE_componentWillMount(),l!==r.state&&bh.enqueueReplaceState(r,r.state,null),as(t,n,r,i),ts(),r.state=t.memoizedState),typeof r.componentDidMount==="function"&&(t.flags|=4194308),n=!0}else if(e===null){r=t.stateNode;var s=t.memoizedProps,o=Si(a,s);r.props=o;var u=r.context,c=a.contextType;l=kr,typeof c==="object"&&c!==null&&(l=at(c));var f=a.getDerivedStateFromProps;c=typeof f==="function"||typeof r.getSnapshotBeforeUpdate==="function",s=t.pendingProps!==s,c||typeof r.UNSAFE_componentWillReceiveProps!=="function"&&typeof r.componentWillReceiveProps!=="function"||(s||u!==l)&&Oy(t,r,n,l),hn=!1;var d=t.memoizedState;r.state=d,as(t,n,r,i),ts(),u=t.memoizedState,s||d!==u||hn?(typeof f==="function"&&(Md(t,a,f,n),u=t.memoizedState),(o=hn||Ny(t,a,o,n,d,u,l))?(c||typeof r.UNSAFE_componentWillMount!=="function"&&typeof r.componentWillMount!=="function"||(typeof r.componentWillMount==="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount==="function"&&(t.flags|=4194308)):(typeof r.componentDidMount==="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),r.props=n,r.state=u,r.context=l,n=o):(typeof r.componentDidMount==="function"&&(t.flags|=4194308),n=!1)}else{r=t.stateNode,dh(e,t),l=t.memoizedProps,c=Si(a,l),r.props=c,f=t.pendingProps,d=r.context,u=a.contextType,o=kr,typeof u==="object"&&u!==null&&(o=at(u)),s=a.getDerivedStateFromProps,(u=typeof s==="function"||typeof r.getSnapshotBeforeUpdate==="function")||typeof r.UNSAFE_componentWillReceiveProps!=="function"&&typeof r.componentWillReceiveProps!=="function"||(l!==f||d!==o)&&Oy(t,r,n,o),hn=!1,d=t.memoizedState,r.state=d,as(t,n,r,i),ts();var h=t.memoizedState;l!==f||d!==h||hn||e!==null&&e.dependencies!==null&&Du(e.dependencies)?(typeof s==="function"&&(Md(t,a,s,n),h=t.memoizedState),(c=hn||Ny(t,a,c,n,d,h,o)||e!==null&&e.dependencies!==null&&Du(e.dependencies))?(u||typeof r.UNSAFE_componentWillUpdate!=="function"&&typeof r.componentWillUpdate!=="function"||(typeof r.componentWillUpdate==="function"&&r.componentWillUpdate(n,h,o),typeof r.UNSAFE_componentWillUpdate==="function"&&r.UNSAFE_componentWillUpdate(n,h,o)),typeof r.componentDidUpdate==="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate==="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!=="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=h),r.props=n,r.state=h,r.context=o,n=c):(typeof r.componentDidUpdate!=="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return r=n,xu(e,t),n=(t.flags&128)!==0,r||n?(r=t.stateNode,a=n&&typeof a.getDerivedStateFromError!=="function"?null:r.render(),t.flags|=1,e!==null&&n?(t.child=yi(t,e.child,null,i),t.child=yi(t,null,a,i)):$e(e,t,a,i),t.memoizedState=r.state,e=t.child):e=Ka(e,t,i),e}function Qy(e,t,a,n){return gi(),t.flags|=256,$e(e,t,a,n),t.child}var Td={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(e){return{baseLanes:e,cachePool:hS()}}function Ed(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Rt),e}function rv(e,t,a){var n=t.pendingProps,i=!1,r=(t.flags&128)!==0,l;if((l=r)||(l=e!==null&&e.memoizedState===null?!1:(Ne.current&2)!==0),l&&(i=!0,t.flags&=-129),l=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(i?pn(t):gn(t),(e=Le)?(e=Wv(e,Kt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rn!==null?{id:ha,overflow:ma}:null,retryLane:536870912,hydrationErrors:null},a=uS(e),a.return=t,t.child=a,tt=t,Le=null)):e=null,e===null)throw Bn(t);return Oh(e)?t.lanes=32:t.lanes=536870912,null}var s=n.children;if(n=n.fallback,i)return gn(t),i=t.mode,s=Pu({mode:"hidden",children:s},i),n=di(n,i,a,null),s.return=t,n.return=t,s.sibling=n,t.child=s,n=t.child,n.memoizedState=Ad(a),n.childLanes=Ed(e,l,a),t.memoizedState=Td,jl(null,n);return pn(t),Ch(t,s)}var o=e.memoizedState;if(o!==null&&(s=o.dehydrated,s!==null)){if(r)t.flags&256?(pn(t),t.flags&=-257,t=Dd(e,t,a)):t.memoizedState!==null?(gn(t),t.child=e.child,t.flags|=128,t=null):(gn(t),s=n.fallback,i=t.mode,n=Pu({mode:"visible",children:n.children},i),s=di(s,i,a,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,yi(t,e.child,null,a),n=t.child,n.memoizedState=Ad(a),n.childLanes=Ed(e,l,a),t.memoizedState=Td,t=jl(null,n));else if(pn(t),Oh(s)){if(l=s.nextSibling&&s.nextSibling.dataset,l)var u=l.dgst;l=u,n=Error(D(419)),n.stack="",n.digest=l,ms({value:n,source:null,stack:null}),t=Dd(e,t,a)}else if(Ve||Xr(e,t,a,!1),l=(a&e.childLanes)!==0,Ve||l){if(l=xe,l!==null&&(n=_b(l,a),n!==0&&n!==o.retryLane))throw o.retryLane=n,wi(e,n),vt(l,e,n),Cm;Nh(s)||Hu(),t=Dd(e,t,a)}else Nh(s)?(t.flags|=192,t.child=e.child,t=null):(e=o.treeContext,Le=Wt(s.nextSibling),tt=t,re=!0,wn=null,Kt=!1,e!==null&&fS(t,e),t=Ch(t,n.children),t.flags|=4096);return t}if(i)return gn(t),s=n.fallback,i=t.mode,o=e.child,u=o.sibling,n=Ha(o,{mode:"hidden",children:n.children}),n.subtreeFlags=o.subtreeFlags&65011712,u!==null?s=Ha(u,s):(s=di(s,i,a,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,jl(null,n),n=t.child,s=e.child.memoizedState,s===null?s=Ad(a):(i=s.cachePool,i!==null?(o=He._currentValue,i=i.parent!==o?{parent:o,pool:o}:i):i=hS(),s={baseLanes:s.baseLanes|a,cachePool:i}),n.memoizedState=s,n.childLanes=Ed(e,l,a),t.memoizedState=Td,jl(e.child,n);return pn(t),a=e.child,e=a.sibling,a=Ha(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=a,t.memoizedState=null,a}function Ch(e,t){return t=Pu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Pu(e,t){return e=Dt(22,e,null,t),e.lanes=0,e}function Dd(e,t,a){return yi(t,e.child,null,a),e=Ch(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jy(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),uh(e.return,t,a)}function Rd(e,t,a,n,i,r){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:i,treeForkCount:r}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=n,l.tail=a,l.tailMode=i,l.treeForkCount=r)}function lv(e,t,a){var n=t.pendingProps,i=n.revealOrder,r=n.tail;n=n.children;var l=Ne.current,s=(l&2)!==0;if(s?(l=l&1|2,t.flags|=128):l&=1,be(Ne,l),$e(e,t,n,a),n=re?hs:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jy(e,a,t);else if(e.tag===19)jy(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":a=t.child;for(i=null;a!==null;)e=a.alternate,e!==null&&zu(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),Rd(t,!1,i,a,r,n);break;case"backwards":case"unstable_legacy-backwards":a=null,i=t.child;for(t.child=null;i!==null;){if(e=i.alternate,e!==null&&zu(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}Rd(t,!0,a,null,r,n);break;case"together":Rd(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ka(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),_n|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Xr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){e=t.child,a=Ha(e,e.pendingProps),t.child=a;for(a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ha(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Lm(e,t){if((e.lanes&t)!==0)return!0;return e=e.dependencies,e!==null&&Du(e)?!0:!1}function Q2(e,t,a){switch(t.tag){case 3:wu(t,t.stateNode.containerInfo),mn(t,He,e.memoizedState.cache),gi();break;case 27:case 5:Wd(t);break;case 4:wu(t,t.stateNode.containerInfo);break;case 10:mn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ph(t),null;break;case 13:var n=t.memoizedState;if(n!==null){if(n.dehydrated!==null)return pn(t),t.flags|=128,null;if((a&t.child.childLanes)!==0)return rv(e,t,a);return pn(t),e=Ka(e,t,a),e!==null?e.sibling:null}pn(t);break;case 19:var i=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Xr(e,t,a,!1),n=(a&t.childLanes)!==0),i){if(n)return lv(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),be(Ne,Ne.current),n)break;else return null;case 22:return t.lanes=0,iv(e,t,a,t.pendingProps);case 24:mn(t,He,e.memoizedState.cache)}return Ka(e,t,a)}function sv(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ve=!0;else{if(!Lm(e,a)&&(t.flags&128)===0)return Ve=!1,Q2(e,t,a);Ve=(e.flags&131072)!==0?!0:!1}else Ve=!1,re&&(t.flags&1048576)!==0&&cS(t,hs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ui(t.elementType),t.type=e,typeof e==="function")tm(e)?(n=Si(e,n),t.tag=1,t=Gy(null,t,e,n,a)):(t.tag=0,t=vh(null,t,e,n,a));else{if(e!==void 0&&e!==null){var i=e.$$typeof;if(i===Uh){t.tag=11,t=qy(null,t,e,n,a);break e}else if(i===Hh){t.tag=14,t=Fy(null,t,e,n,a);break e}}throw t=Kd(e)||e,Error(D(306,t,""))}}return t;case 0:return vh(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,i=Si(n,t.pendingProps),Gy(e,t,n,i,a);case 3:e:{if(wu(t,t.stateNode.containerInfo),e===null)throw Error(D(387));n=t.pendingProps;var r=t.memoizedState;i=r.element,dh(e,t),as(t,n,null,a);var l=t.memoizedState;if(n=l.cache,mn(t,He,n),n!==r.cache&&ch(t,[He],a,!0),ts(),n=l.element,r.isDehydrated)if(r={element:n,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Qy(e,t,n,a);break e}else if(n!==i){i=Yt(Error(D(424)),t),ms(i),t=Qy(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}Le=Wt(e.firstChild),tt=t,re=!0,wn=null,Kt=!0,a=gS(t,null,n,a);for(t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(gi(),n===i){t=Ka(e,t,a);break e}$e(e,t,n,a)}t=t.child}return t;case 26:return xu(e,t),e===null?(a=db(t.type,null,t.pendingProps,null))?t.memoizedState=a:re||(a=t.type,e=t.pendingProps,n=ju(Ln.current).createElement(a),n[et]=t,n[Ct]=e,nt(n,a,e),Xe(n),t.stateNode=n):t.memoizedState=db(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Wd(t),e===null&&re&&(n=t.stateNode=Zv(t.type,t.pendingProps,Ln.current),tt=t,Kt=!0,i=Le,On(t.type)?(Ph=i,Le=Wt(n.firstChild)):Le=i),$e(e,t,t.pendingProps.children,a),xu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:if(e===null&&re){if(i=n=Le)n=bA(n,t.type,t.pendingProps,Kt),n!==null?(t.stateNode=n,tt=t,Le=Wt(n.firstChild),Kt=!1,i=!0):i=!1;i||Bn(t)}return Wd(t),i=t.type,r=t.pendingProps,l=e!==null?e.memoizedProps:null,n=r.children,zh(i,r)?n=null:l!==null&&zh(i,l)&&(t.flags|=32),t.memoizedState!==null&&(i=cm(e,t,N2,null,null,a),Ss._currentValue=i),xu(e,t),$e(e,t,n,a),t.child;case 6:if(e===null&&re){if(e=a=Le)a=SA(a,t.pendingProps,Kt),a!==null?(t.stateNode=a,tt=t,Le=null,e=!0):e=!1;e||Bn(t)}return null;case 13:return rv(e,t,a);case 4:return wu(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=yi(t,null,n,a):$e(e,t,n,a),t.child;case 11:return qy(e,t,t.type,t.pendingProps,a);case 7:return $e(e,t,t.pendingProps,a),t.child;case 8:return $e(e,t,t.pendingProps.children,a),t.child;case 12:return $e(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,mn(t,t.type,n.value),$e(e,t,n.children,a),t.child;case 9:return i=t.type._context,n=t.pendingProps.children,xi(t),i=at(i),n=n(i),t.flags|=1,$e(e,t,n,a),t.child;case 14:return Fy(e,t,t.type,t.pendingProps,a);case 15:return nv(e,t,t.type,t.pendingProps,a);case 19:return lv(e,t,a);case 31:return G2(e,t,a);case 22:return iv(e,t,a,t.pendingProps);case 24:return xi(t),n=at(He),e===null?(i=rm(),i===null&&(i=xe,r=im(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=a),i=r),t.memoizedState={parent:n,cache:i},sm(t),mn(t,He,i)):((e.lanes&a)!==0&&(dh(e,t),as(t,null,null,a),ts()),i=e.memoizedState,r=t.memoizedState,i.parent!==n?(i={parent:n,cache:n},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),mn(t,He,n)):(n=r.cache,mn(t,He,n),n!==i.cache&&ch(t,[He],a,!0))),$e(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(D(156,t.tag))}function Ba(e){e.flags|=4}function Bd(e,t,a,n,i){if(t=(e.mode&32)!==0)t=!1;if(t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Dv())e.flags|=8192;else throw mi=Ru,lm}else e.flags&=-16777217}function Yy(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!e0(t))if(Dv())e.flags|=8192;else throw mi=Ru,lm}function au(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Rb():536870912,e.lanes|=t,Hr|=t)}function Pl(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ce(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function j2(e,t,a){var n=t.pendingProps;switch(nm(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ce(t),null;case 1:return Ce(t),null;case 3:if(a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Va(He),Nr(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),e===null||e.child===null)dr(t)?Ba(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wd());return Ce(t),null;case 26:var{type:i,memoizedState:r}=t;return e===null?(Ba(t),r!==null?(Ce(t),Yy(t,r)):(Ce(t),Bd(t,i,null,n,a))):r?r!==e.memoizedState?(Ba(t),Ce(t),Yy(t,r)):(Ce(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ba(t),Ce(t),Bd(t,i,e,n,a)),null;case 27:if(ku(t),a=Ln.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ba(t);else{if(!n){if(t.stateNode===null)throw Error(D(166));return Ce(t),null}e=ga.current,dr(t)?Cy(t,e):(e=Zv(i,n,a),t.stateNode=e,Ba(t))}return Ce(t),null;case 5:if(ku(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ba(t);else{if(!n){if(t.stateNode===null)throw Error(D(166));return Ce(t),null}if(r=ga.current,dr(t))Cy(t,r);else{var l=ju(Ln.current);switch(r){case 1:r=l.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=l.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=l.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=l.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=l.createElement("div"),r.innerHTML="<script></script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof n.is==="string"?l.createElement("select",{is:n.is}):l.createElement("select"),n.multiple?r.multiple=!0:n.size&&(r.size=n.size);break;default:r=typeof n.is==="string"?l.createElement(i,{is:n.is}):l.createElement(i)}}r[et]=t,r[Ct]=n;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)r.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=r;e:switch(nt(r,i,n),i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ba(t)}}return Ce(t),Bd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ba(t);else{if(typeof n!=="string"&&t.stateNode===null)throw Error(D(166));if(e=Ln.current,dr(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,i=tt,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}e[et]=t,e=e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Yv(e.nodeValue,a)?!0:!1,e||Bn(t,!0)}else e=ju(e).createTextNode(n),e[et]=t,t.stateNode=e}return Ce(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=dr(t),a!==null){if(e===null){if(!n)throw Error(D(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(557));e[et]=t}else gi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),e=!1}else a=wd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e){if(t.flags&256)return Et(t),t;return Et(t),null}if((t.flags&128)!==0)throw Error(D(558))}return Ce(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=dr(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(D(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(D(317));i[et]=t}else gi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),i=!1}else i=wd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i){if(t.flags&256)return Et(t),t;return Et(t),null}}if(Et(t),(t.flags&128)!==0)return t.lanes=a,t;return a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool),r=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),r!==i&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),au(t,t.updateQueue),Ce(t),null;case 4:return Nr(),e===null&&Em(t.stateNode.containerInfo),Ce(t),null;case 10:return Va(t.type),Ce(t),null;case 19:if(We(Ne),n=t.memoizedState,n===null)return Ce(t),null;if(i=(t.flags&128)!==0,r=n.rendering,r===null)if(i)Pl(n,!1);else{if(Ee!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=zu(e),r!==null){t.flags|=128,Pl(n,!1),e=r.updateQueue,t.updateQueue=e,au(t,e),t.subtreeFlags=0,e=a;for(a=t.child;a!==null;)oS(a,e),a=a.sibling;return be(Ne,Ne.current&1|2),re&&Oa(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Bt()>Fu&&(t.flags|=128,i=!0,Pl(n,!1),t.lanes=4194304)}else{if(!i)if(e=zu(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,au(t,e),Pl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!r.alternate&&!re)return Ce(t),null}else 2*Bt()-n.renderingStartTime>Fu&&a!==536870912&&(t.flags|=128,i=!0,Pl(n,!1),t.lanes=4194304);n.isBackwards?(r.sibling=t.child,t.child=r):(e=n.last,e!==null?e.sibling=r:t.child=r,n.last=r)}if(n.tail!==null)return e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Bt(),e.sibling=null,a=Ne.current,be(Ne,i?a&1|2:a&1),re&&Oa(t,n.treeForkCount),e;return Ce(t),null;case 22:case 23:return Et(t),om(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),a=t.updateQueue,a!==null&&au(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&We(hi),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Va(He),Ce(t),null;case 25:return null;case 30:return null}throw Error(D(156,t.tag))}function Y2(e,t){switch(nm(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Va(He),Nr(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ku(t),null;case 31:if(t.memoizedState!==null){if(Et(t),t.alternate===null)throw Error(D(340));gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Et(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(Ne),null;case 4:return Nr(),null;case 10:return Va(t.type),null;case 22:case 23:return Et(t),om(),e!==null&&We(hi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Va(He),null;case 25:return null;default:return null}}function ov(e,t){switch(nm(t),t.tag){case 3:Va(He),Nr();break;case 26:case 27:case 5:ku(t);break;case 4:Nr();break;case 31:t.memoizedState!==null&&Et(t);break;case 13:Et(t);break;case 19:We(Ne);break;case 10:Va(t.type);break;case 22:case 23:Et(t),om(),e!==null&&We(hi);break;case 24:Va(He)}}function Ds(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){n=void 0;var{create:r,inst:l}=a;n=r(),l.destroy=n}a=a.next}while(a!==i)}}catch(s){he(t,t.return,s)}}function zn(e,t,a){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){var l=n.inst,s=l.destroy;if(s!==void 0){l.destroy=void 0,i=t;var o=a,u=s;try{u()}catch(c){he(i,o,c)}}}n=n.next}while(n!==r)}}catch(c){he(t,t.return,c)}}function uv(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{yS(t,a)}catch(n){he(e,e.return,n)}}}function cv(e,t,a){a.props=Si(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){he(e,t,n)}}function is(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a==="function"?e.refCleanup=a(n):a.current=n}}catch(i){he(e,t,i)}}function pa(e,t){var{ref:a,refCleanup:n}=e;if(a!==null)if(typeof n==="function")try{n()}catch(i){he(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a==="function")try{a(null)}catch(i){he(e,t,i)}else a.current=null}function fv(e){var{type:t,memoizedProps:a,stateNode:n}=e;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(i){he(e,e.return,i)}}function zd(e,t,a){try{var n=e.stateNode;hA(n,e.type,a,t),n[Ct]=t}catch(i){he(e,e.return,i)}}function dv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&On(e.type)||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dv(e.return))return null;e=e.return}e.sibling.return=e.return;for(e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&On(e.type))continue e;if(e.flags&2)continue e;if(e.child===null||e.tag===4)continue e;else e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lh(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!==null&&a!==void 0||t.onclick!==null||(t.onclick=Fa));else if(n!==4&&(n===27&&On(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Lh(e,t,a),e=e.sibling;e!==null;)Lh(e,t,a),e=e.sibling}function qu(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&On(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(qu(e,t,a),e=e.sibling;e!==null;)qu(e,t,a),e=e.sibling}function hv(e){var{stateNode:t,memoizedProps:a}=e;try{for(var n=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);nt(t,n,a),t[et]=e,t[Ct]=a}catch(r){he(e,e.return,r)}}var Pa=!1,Ue=!1,Nd=!1,Ky=typeof WeakSet==="function"?WeakSet:Set,Ke=null;function K2(e,t){if(e=e.containerInfo,Rh=Wu,e=eS(e),Jh(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var{anchorOffset:i,focusNode:r}=n;n=n.focusOffset;try{a.nodeType,r.nodeType}catch(b){a=null;break e}var l=0,s=-1,o=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;;){if(f!==a||i!==0&&f.nodeType!==3||(s=l+i),f!==r||n!==0&&f.nodeType!==3||(o=l+n),f.nodeType===3&&(l+=f.nodeValue.length),(h=f.firstChild)===null)break;d=f,f=h}for(;;){if(f===e)break t;if(d===a&&++u===i&&(s=l),d===r&&++c===n&&(o=l),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}a=s===-1||o===-1?null:{start:s,end:o}}else a=null}a=a||{start:0,end:0}}else a=null;Bh={focusedElem:e,selectionRange:a},Wu=!1;for(Ke=t;Ke!==null;)if(t=Ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ke=e;else for(;Ke!==null;){switch(t=Ke,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,a=t,i=r.memoizedProps,r=r.memoizedState,n=a.stateNode;try{var g=Si(a.type,i);e=n.getSnapshotBeforeUpdate(g,r),n.__reactInternalSnapshotBeforeUpdate=e}catch(b){he(a,a.return,b)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)_h(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_h(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(D(163))}if(e=t.sibling,e!==null){e.return=t.return,Ke=e;break}Ke=t.return}}function mv(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:_a(e,a),n&4&&Ds(5,a);break;case 1:if(_a(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(l){he(a,a.return,l)}else{var i=Si(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){he(a,a.return,l)}}n&64&&uv(a),n&512&&is(a,a.return);break;case 3:if(_a(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{yS(e,t)}catch(l){he(a,a.return,l)}}break;case 27:t===null&&n&4&&hv(a);case 26:case 5:_a(e,a),t===null&&n&4&&fv(a),n&512&&is(a,a.return);break;case 12:_a(e,a);break;case 31:_a(e,a),n&4&&xv(e,a);break;case 13:_a(e,a),n&4&&yv(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=nA.bind(null,a),vA(e,a))));break;case 22:if(n=a.memoizedState!==null||Pa,!n){t=t!==null&&t.memoizedState!==null||Ue,i=Pa;var r=Ue;Pa=n,(Ue=t)&&!r?Na(e,a,(a.subtreeFlags&8772)!==0):_a(e,a),Pa=i,Ue=r}break;case 30:break;default:_a(e,a)}}function pv(e){var t=e.alternate;t!==null&&(e.alternate=null,pv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jh(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ie=null,bt=!1;function za(e,t,a){for(a=a.child;a!==null;)gv(e,t,a),a=a.sibling}function gv(e,t,a){if(zt&&typeof zt.onCommitFiberUnmount==="function")try{zt.onCommitFiberUnmount(ws,a)}catch(r){}switch(a.tag){case 26:Ue||pa(a,t),za(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ue||pa(a,t);var n=Ie,i=bt;On(a.type)&&(Ie=a.stateNode,bt=!1),za(e,t,a),os(a.stateNode),Ie=n,bt=i;break;case 5:Ue||pa(a,t);case 6:if(n=Ie,i=bt,Ie=null,za(e,t,a),Ie=n,bt=i,Ie!==null)if(bt)try{(Ie.nodeType===9?Ie.body:Ie.nodeName==="HTML"?Ie.ownerDocument.body:Ie).removeChild(a.stateNode)}catch(r){he(a,t,r)}else try{Ie.removeChild(a.stateNode)}catch(r){he(a,t,r)}break;case 18:Ie!==null&&(bt?(e=Ie,sb(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),jr(e)):sb(Ie,a.stateNode));break;case 4:n=Ie,i=bt,Ie=a.stateNode.containerInfo,bt=!0,za(e,t,a),Ie=n,bt=i;break;case 0:case 11:case 14:case 15:zn(2,a,t),Ue||zn(4,a,t),za(e,t,a);break;case 1:Ue||(pa(a,t),n=a.stateNode,typeof n.componentWillUnmount==="function"&&cv(a,t,n)),za(e,t,a);break;case 21:za(e,t,a);break;case 22:Ue=(n=Ue)||a.memoizedState!==null,za(e,t,a),Ue=n;break;default:za(e,t,a)}}function xv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jr(e)}catch(a){he(t,t.return,a)}}}function yv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jr(e)}catch(a){he(t,t.return,a)}}function X2(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ky),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ky),t;default:throw Error(D(435,e.tag))}}function nu(e,t){var a=X2(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var i=iA.bind(null,e,n);n.then(i,i)}})}function xt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var i=a[n],r=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 27:if(On(s.type)){Ie=s.stateNode,bt=!1;break e}break;case 5:Ie=s.stateNode,bt=!1;break e;case 3:case 4:Ie=s.stateNode.containerInfo,bt=!0;break e}s=s.return}if(Ie===null)throw Error(D(160));gv(r,l,i),Ie=null,bt=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bv(t,e),t=t.sibling}var na=null;function bv(e,t){var{alternate:a,flags:n}=e;switch(e.tag){case 0:case 11:case 14:case 15:xt(t,e),yt(e),n&4&&(zn(3,e,e.return),Ds(3,e),zn(5,e,e.return));break;case 1:xt(t,e),yt(e),n&512&&(Ue||a===null||pa(a,a.return)),n&64&&Pa&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var i=na;if(xt(t,e),yt(e),n&512&&(Ue||a===null||pa(a,a.return)),n&4){var r=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":if(r=i.getElementsByTagName("title")[0],!r||r[Ms]||r[et]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))r=i.createElement(n),i.head.insertBefore(r,i.querySelector("head > title"));nt(r,n,a),r[et]=e,Xe(r),n=r;break e;case"link":var l=mb("link","href",i).get(n+(a.href||""));if(l){for(var s=0;s<l.length;s++)if(r=l[s],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){l.splice(s,1);break t}}r=i.createElement(n),nt(r,n,a),i.head.appendChild(r);break;case"meta":if(l=mb("meta","content",i).get(n+(a.content||""))){for(s=0;s<l.length;s++)if(r=l[s],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){l.splice(s,1);break t}}r=i.createElement(n),nt(r,n,a),i.head.appendChild(r);break;default:throw Error(D(468,n))}r[et]=e,Xe(r),n=r}e.stateNode=n}else pb(i,e.type,e.stateNode);else e.stateNode=hb(i,n,e.memoizedProps);else r!==n?(r===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):r.count--,n===null?pb(i,e.type,e.stateNode):hb(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&zd(e,e.memoizedProps,a.memoizedProps)}break;case 27:xt(t,e),yt(e),n&512&&(Ue||a===null||pa(a,a.return)),a!==null&&n&4&&zd(e,e.memoizedProps,a.memoizedProps);break;case 5:if(xt(t,e),yt(e),n&512&&(Ue||a===null||pa(a,a.return)),e.flags&32){i=e.stateNode;try{Pr(i,"")}catch(g){he(e,e.return,g)}}n&4&&e.stateNode!=null&&(i=e.memoizedProps,zd(e,i,a!==null?a.memoizedProps:i)),n&1024&&(Nd=!0);break;case 6:if(xt(t,e),yt(e),n&4){if(e.stateNode===null)throw Error(D(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(g){he(e,e.return,g)}}break;case 3:if(Su=null,i=na,na=Yu(t.containerInfo),xt(t,e),na=i,yt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{jr(t.containerInfo)}catch(g){he(e,e.return,g)}Nd&&(Nd=!1,Sv(e));break;case 4:n=na,na=Yu(e.stateNode.containerInfo),xt(t,e),yt(e),na=n;break;case 12:xt(t,e),yt(e);break;case 31:xt(t,e),yt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,nu(e,n)));break;case 13:xt(t,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!==(a!==null&&a.memoizedState!==null)&&(cc=Bt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,nu(e,n)));break;case 22:i=e.memoizedState!==null;var o=a!==null&&a.memoizedState!==null,u=Pa,c=Ue;if(Pa=u||i,Ue=c||o,xt(t,e),Ue=c,Pa=u,yt(e),n&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||o||Pa||Ue||ci(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){o=a=t;try{if(r=o.stateNode,i)l=r.style,typeof l.setProperty==="function"?l.setProperty("display","none","important"):l.display="none";else{s=o.stateNode;var f=o.memoizedProps.style,d=f!==void 0&&f!==null&&f.hasOwnProperty("display")?f.display:null;s.style.display=d==null||typeof d==="boolean"?"":(""+d).trim()}}catch(g){he(o,o.return,g)}}}else if(t.tag===6){if(a===null){o=t;try{o.stateNode.nodeValue=i?"":o.memoizedProps}catch(g){he(o,o.return,g)}}}else if(t.tag===18){if(a===null){o=t;try{var h=o.stateNode;i?ob(h,!0):ob(o.stateNode,!1)}catch(g){he(o,o.return,g)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,nu(e,a))));break;case 19:xt(t,e),yt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,nu(e,n)));break;case 30:break;case 21:break;default:xt(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(dv(n)){a=n;break}n=n.return}if(a==null)throw Error(D(160));switch(a.tag){case 27:var i=a.stateNode,r=_d(e);qu(e,r,i);break;case 5:var l=a.stateNode;a.flags&32&&(Pr(l,""),a.flags&=-33);var s=_d(e);qu(e,s,l);break;case 3:case 4:var o=a.stateNode.containerInfo,u=_d(e);Lh(e,u,o);break;default:throw Error(D(161))}}catch(c){he(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _a(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mv(e,t.alternate,t),t=t.sibling}function ci(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zn(4,t,t.return),ci(t);break;case 1:pa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount==="function"&&cv(t,t.return,a),ci(t);break;case 27:os(t.stateNode);case 26:case 5:pa(t,t.return),ci(t);break;case 22:t.memoizedState===null&&ci(t);break;case 30:ci(t);break;default:ci(t)}e=e.sibling}}function Na(e,t,a){a=a&&(t.subtreeFlags&8772)!==0;for(t=t.child;t!==null;){var n=t.alternate,i=e,r=t,l=r.flags;switch(r.tag){case 0:case 11:case 15:Na(i,r,a),Ds(4,r);break;case 1:if(Na(i,r,a),n=r,i=n.stateNode,typeof i.componentDidMount==="function")try{i.componentDidMount()}catch(u){he(n,n.return,u)}if(n=r,i=n.updateQueue,i!==null){var s=n.stateNode;try{var o=i.shared.hiddenCallbacks;if(o!==null)for(i.shared.hiddenCallbacks=null,i=0;i<o.length;i++)xS(o[i],s)}catch(u){he(n,n.return,u)}}a&&l&64&&uv(r),is(r,r.return);break;case 27:hv(r);case 26:case 5:Na(i,r,a),a&&n===null&&l&4&&fv(r),is(r,r.return);break;case 12:Na(i,r,a);break;case 31:Na(i,r,a),a&&l&4&&xv(i,r);break;case 13:Na(i,r,a),a&&l&4&&yv(i,r);break;case 22:r.memoizedState===null&&Na(i,r,a),is(r,r.return);break;case 30:break;default:Na(i,r,a)}t=t.sibling}}function wm(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&As(a))}function km(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&As(e))}function aa(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vv(e,t,a,n),t=t.sibling}function vv(e,t,a,n){var i=t.flags;switch(t.tag){case 0:case 11:case 15:aa(e,t,a,n),i&2048&&Ds(9,t);break;case 1:aa(e,t,a,n);break;case 3:aa(e,t,a,n),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&As(e)));break;case 12:if(i&2048){aa(e,t,a,n),e=t.stateNode;try{var r=t.memoizedProps,l=r.id,s=r.onPostCommit;typeof s==="function"&&s(l,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(o){he(t,t.return,o)}}else aa(e,t,a,n);break;case 31:aa(e,t,a,n);break;case 13:aa(e,t,a,n);break;case 23:break;case 22:r=t.stateNode,l=t.alternate,t.memoizedState!==null?r._visibility&2?aa(e,t,a,n):rs(e,t):r._visibility&2?aa(e,t,a,n):(r._visibility|=2,mr(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),i&2048&&wm(l,t);break;case 24:aa(e,t,a,n),i&2048&&km(t.alternate,t);break;default:aa(e,t,a,n)}}function mr(e,t,a,n,i){i=i&&((t.subtreeFlags&10256)!==0||!1);for(t=t.child;t!==null;){var r=e,l=t,s=a,o=n,u=l.flags;switch(l.tag){case 0:case 11:case 15:mr(r,l,s,o,i),Ds(8,l);break;case 23:break;case 22:var c=l.stateNode;l.memoizedState!==null?c._visibility&2?mr(r,l,s,o,i):rs(r,l):(c._visibility|=2,mr(r,l,s,o,i)),i&&u&2048&&wm(l.alternate,l);break;case 24:mr(r,l,s,o,i),i&&u&2048&&km(l.alternate,l);break;default:mr(r,l,s,o,i)}t=t.sibling}}function rs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,i=n.flags;switch(n.tag){case 22:rs(a,n),i&2048&&wm(n.alternate,n);break;case 24:rs(a,n),i&2048&&km(n.alternate,n);break;default:rs(a,n)}t=t.sibling}}var Yl=8192;function hr(e,t,a){if(e.subtreeFlags&Yl)for(e=e.child;e!==null;)Cv(e,t,a),e=e.sibling}function Cv(e,t,a){switch(e.tag){case 26:hr(e,t,a),e.flags&Yl&&e.memoizedState!==null&&BA(a,na,e.memoizedState,e.memoizedProps);break;case 5:hr(e,t,a);break;case 3:case 4:var n=na;na=Yu(e.stateNode.containerInfo),hr(e,t,a),na=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Yl,Yl=16777216,hr(e,t,a),Yl=n):hr(e,t,a));break;default:hr(e,t,a)}}function Lv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ql(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ke=n,kv(n,e)}Lv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wv(e),e=e.sibling}function wv(e){switch(e.tag){case 0:case 11:case 15:ql(e),e.flags&2048&&zn(9,e,e.return);break;case 3:ql(e);break;case 12:ql(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,yu(e)):ql(e);break;default:ql(e)}}function yu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ke=n,kv(n,e)}Lv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zn(8,t,t.return),yu(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,yu(t));break;default:yu(t)}e=e.sibling}}function kv(e,t){for(;Ke!==null;){var a=Ke;switch(a.tag){case 0:case 11:case 15:zn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:As(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Ke=n;else e:for(a=e;Ke!==null;){n=Ke;var{sibling:i,return:r}=n;if(pv(n),n===a){Ke=null;break e}if(i!==null){i.return=r,Ke=i;break e}Ke=r}}}var W2={getCacheForType:function(e){var t=at(He),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return at(He).controller.signal}},Z2=typeof WeakMap==="function"?WeakMap:Map,oe=0,xe=null,ae=null,ne=0,de=0,At=null,Sn=!1,Zr=!1,Im=!1,Xa=0,Ee=0,_n=0,pi=0,Mm=0,Rt=0,Hr=0,ls=null,St=null,wh=!1,cc=0,Iv=0,Fu=1/0,Uu=null,Mn=null,je=0,Tn=null,Vr=null,Ga=0,kh=0,Ih=null,Mv=null,ss=0,Mh=null;function Nt(){return(oe&2)!==0&&ne!==0?ne&-ne:j.T!==null?Am():Nb()}function Tv(){if(Rt===0)if((ne&536870912)===0||re){var e=Xo;Xo<<=1,(Xo&3932160)===0&&(Xo=262144),Rt=e}else Rt=536870912;return e=Pt.current,e!==null&&(e.flags|=32),Rt}function vt(e,t,a){if(e===xe&&(de===2||de===9)||e.cancelPendingCommit!==null)Gr(e,0),vn(e,ne,Rt,!1);if(Is(e,a),(oe&2)===0||e!==xe)e===xe&&((oe&2)===0&&(pi|=a),Ee===4&&vn(e,ne,Rt,!1)),ya(e)}function Av(e,t,a){if((oe&6)!==0)throw Error(D(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ks(e,t),i=n?eA(e,t):Od(e,t,!0),r=n;do{if(i===0){Zr&&!n&&vn(e,t,0,!1);break}else{if(a=e.current.alternate,r&&!J2(a)){i=Od(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var l=0;else l=e.pendingLanes&-536870913,l=l!==0?l:l&536870912?536870912:0;if(l!==0){t=l;e:{var s=e;i=ls;var o=s.current.memoizedState.isDehydrated;if(o&&(Gr(s,l).flags|=256),l=Od(s,l,!1),l!==2){if(Im&&!o){s.errorRecoveryDisabledLanes|=r,pi|=r,i=4;break e}r=St,St=i,r!==null&&(St===null?St=r:St.push.apply(St,r))}i=l}if(r=!1,i!==2)continue}}if(i===1){Gr(e,0),vn(e,t,0,!0);break}e:{switch(n=e,r=i,r){case 0:case 1:throw Error(D(345));case 4:if((t&4194048)!==t)break;case 6:vn(n,t,Rt,!Sn);break e;case 2:St=null;break;case 3:case 5:break;default:throw Error(D(329))}if((t&62914560)===t&&(i=cc+300-Bt(),10<i)){if(vn(n,t,Rt,!Sn),$u(n,0,!0)!==0)break e;Ga=t,n.timeoutHandle=Xv(Xy.bind(null,n,a,St,Uu,wh,t,Rt,pi,Hr,Sn,r,"Throttled",-0,0),i);break e}Xy(n,a,St,Uu,wh,t,Rt,pi,Hr,Sn,r,null,-0,0)}}break}while(1);ya(e)}function Xy(e,t,a,n,i,r,l,s,o,u,c,f,d,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fa},Cv(t,r,f);var g=(r&62914560)===r?cc-Bt():(r&4194048)===r?Iv-Bt():0;if(g=zA(f,g),g!==null){Ga=r,e.cancelPendingCommit=g(Zy.bind(null,e,t,r,a,n,i,l,s,o,c,f,null,d,h)),vn(e,r,l,!u);return}}Zy(e,t,r,a,n,i,l,s,o)}function J2(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var i=a[n],r=i.getSnapshot;i=i.value;try{if(!Ot(r(),i))return!1}catch(l){return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 vn(e,t,a,n){t&=~Mm,t&=~pi,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var i=t;0<i;){var r=31-_t(i),l=1<<r;n[r]=-1,i&=~l}a!==0&&Bb(e,a,t)}function fc(){return(oe&6)===0?(Rs(0,!1),!1):!0}function Tm(){if(ae!==null){if(de===0)var e=ae.return;else e=ae,Ua=ki=null,hm(e),Br=null,ps=0,e=ae;for(;e!==null;)ov(e.alternate,e),e=e.return;ae=null}}function Gr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,gA(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ga=0,Tm(),xe=e,ae=a=Ha(e.current,null),ne=t,de=0,At=null,Sn=!1,Zr=ks(e,t),Im=!1,Hr=Rt=Mm=pi=_n=Ee=0,St=ls=null,wh=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-_t(n),r=1<<i;t|=e[i],n&=~r}return Xa=t,nc(),a}function Ev(e,t){W=null,j.H=xs,t===Wr||t===rc?(t=My(),de=3):t===lm?(t=My(),de=4):de=t===Cm?8:t!==null&&typeof t==="object"&&typeof t.then==="function"?6:1,At=t,ae===null&&(Ee=1,Ou(e,Yt(t,e.current)))}function Dv(){var e=Pt.current;return e===null?!0:(ne&4194048)===ne?Xt===null?!0:!1:(ne&62914560)===ne||(ne&536870912)!==0?e===Xt:!1}function Rv(){var e=j.H;return j.H=xs,e===null?xs:e}function Bv(){var e=j.A;return j.A=W2,e}function Hu(){Ee=4,Sn||(ne&4194048)!==ne&&Pt.current!==null||(Zr=!0),(_n&134217727)===0&&(pi&134217727)===0||xe===null||vn(xe,ne,Rt,!1)}function Od(e,t,a){var n=oe;oe|=2;var i=Rv(),r=Bv();if(xe!==e||ne!==t)Uu=null,Gr(e,t);t=!1;var l=Ee;e:do try{if(de!==0&&ae!==null){var s=ae,o=At;switch(de){case 8:Tm(),l=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var u=de;if(de=0,At=null,Tr(e,s,o,u),a&&Zr){l=0;break e}break;default:u=de,de=0,At=null,Tr(e,s,o,u)}}$2(),l=Ee;break}catch(c){Ev(e,c)}while(1);return t&&e.shellSuspendCounter++,Ua=ki=null,oe=n,j.H=i,j.A=r,ae===null&&(xe=null,ne=0,nc()),l}function $2(){for(;ae!==null;)zv(ae)}function eA(e,t){var a=oe;oe|=2;var n=Rv(),i=Bv();xe!==e||ne!==t?(Uu=null,Fu=Bt()+500,Gr(e,t)):Zr=ks(e,t);e:do try{if(de!==0&&ae!==null){t=ae;var r=At;t:switch(de){case 1:de=0,At=null,Tr(e,t,r,1);break;case 2:case 9:if(Iy(r)){de=0,At=null,Wy(t);break}t=function(){de!==2&&de!==9||xe!==e||(de=7),ya(e)},r.then(t,t);break e;case 3:de=7;break e;case 4:de=5;break e;case 7:Iy(r)?(de=0,At=null,Wy(t)):(de=0,At=null,Tr(e,t,r,7));break;case 5:var l=null;switch(ae.tag){case 26:l=ae.memoizedState;case 5:case 27:var s=ae;if(l?e0(l):s.stateNode.complete){de=0,At=null;var o=s.sibling;if(o!==null)ae=o;else{var u=s.return;u!==null?(ae=u,dc(u)):ae=null}break t}}de=0,At=null,Tr(e,t,r,5);break;case 6:de=0,At=null,Tr(e,t,r,6);break;case 8:Tm(),Ee=6;break e;default:throw Error(D(462))}}tA();break}catch(c){Ev(e,c)}while(1);if(Ua=ki=null,j.H=n,j.A=i,oe=a,ae!==null)return 0;return xe=null,ne=0,nc(),Ee}function tA(){for(;ae!==null&&!wT();)zv(ae)}function zv(e){var t=sv(e.alternate,e,Xa);e.memoizedProps=e.pendingProps,t===null?dc(e):ae=t}function Wy(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Vy(a,t,t.pendingProps,t.type,void 0,ne);break;case 11:t=Vy(a,t,t.pendingProps,t.type.render,t.ref,ne);break;case 5:hm(t);default:ov(a,t),t=ae=oS(t,Xa),t=sv(a,t,Xa)}e.memoizedProps=e.pendingProps,t===null?dc(e):ae=t}function Tr(e,t,a,n){Ua=ki=null,hm(t),Br=null,ps=0;var i=t.return;try{if(V2(e,i,t,a,ne)){Ee=1,Ou(e,Yt(a,e.current)),ae=null;return}}catch(r){if(i!==null)throw ae=i,r;Ee=1,Ou(e,Yt(a,e.current)),ae=null;return}if(t.flags&32768){if(re||n===1)e=!0;else if(Zr||(ne&536870912)!==0)e=!1;else if(Sn=e=!0,n===2||n===9||n===3||n===6)n=Pt.current,n!==null&&n.tag===13&&(n.flags|=16384);_v(t,e)}else dc(t)}function dc(e){var t=e;do{if((t.flags&32768)!==0){_v(t,Sn);return}e=t.return;var a=j2(t.alternate,t,Xa);if(a!==null){ae=a;return}if(t=t.sibling,t!==null){ae=t;return}ae=t=e}while(t!==null);Ee===0&&(Ee=5)}function _v(e,t){do{var a=Y2(e.alternate,e);if(a!==null){a.flags&=32767,ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ae=e;return}ae=e=a}while(e!==null);Ee=6,ae=null}function Zy(e,t,a,n,i,r,l,s,o){e.cancelPendingCommit=null;do hc();while(je!==0);if((oe&6)!==0)throw Error(D(327));if(t!==null){if(t===e.current)throw Error(D(177));if(r=t.lanes|t.childLanes,r|=$h,zT(e,a,r,l,s,o),e===xe&&(ae=xe=null,ne=0),Vr=t,Tn=e,Ga=a,kh=r,Ih=i,Mv=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,rA(Iu,function(){return Fv(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=j.T,j.T=null,i=ue.p,ue.p=2,l=oe,oe|=4;try{K2(e,t,a)}finally{oe=l,ue.p=i,j.T=n}}je=1,Nv(),Ov(),Pv()}}function Nv(){if(je===1){je=0;var e=Tn,t=Vr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=j.T,j.T=null;var n=ue.p;ue.p=2;var i=oe;oe|=4;try{bv(t,e);var r=Bh,l=eS(e.containerInfo),s=r.focusedElem,o=r.selectionRange;if(l!==s&&s&&s.ownerDocument&&$b(s.ownerDocument.documentElement,s)){if(o!==null&&Jh(s)){var{start:u,end:c}=o;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var f=s.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),g=s.textContent.length,b=Math.min(o.start,g),S=o.end===void 0?b:Math.min(o.end,g);!h.extend&&b>S&&(l=S,S=b,b=l);var p=by(s,b),x=by(s,S);if(p&&x&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==x.node||h.focusOffset!==x.offset)){var y=f.createRange();y.setStart(p.node,p.offset),h.removeAllRanges(),b>S?(h.addRange(y),h.extend(x.node,x.offset)):(y.setEnd(x.node,x.offset),h.addRange(y))}}}}f=[];for(h=s;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});typeof s.focus==="function"&&s.focus();for(s=0;s<f.length;s++){var w=f[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Wu=!!Rh,Bh=Rh=null}finally{oe=i,ue.p=n,j.T=a}}e.current=t,je=2}}function Ov(){if(je===2){je=0;var e=Tn,t=Vr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=j.T,j.T=null;var n=ue.p;ue.p=2;var i=oe;oe|=4;try{mv(e,t.alternate,t)}finally{oe=i,ue.p=n,j.T=a}}je=3}}function Pv(){if(je===4||je===3){je=0,kT();var e=Tn,t=Vr,a=Ga,n=Mv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?je=5:(je=0,Vr=Tn=null,qv(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Mn=null),Qh(a),t=t.stateNode,zt&&typeof zt.onCommitFiberRoot==="function")try{zt.onCommitFiberRoot(ws,t,void 0,(t.current.flags&128)===128)}catch(o){}if(n!==null){t=j.T,i=ue.p,ue.p=2,j.T=null;try{for(var r=e.onRecoverableError,l=0;l<n.length;l++){var s=n[l];r(s.value,{componentStack:s.stack})}}finally{j.T=t,ue.p=i}}(Ga&3)!==0&&hc(),ya(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===Mh?ss++:(ss=0,Mh=e):ss=0,Rs(0,!1)}}function qv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,As(t)))}function hc(){return Nv(),Ov(),Pv(),Fv()}function Fv(){if(je!==5)return!1;var e=Tn,t=kh;kh=0;var a=Qh(Ga),n=j.T,i=ue.p;try{ue.p=32>a?32:a,j.T=null,a=Ih,Ih=null;var r=Tn,l=Ga;if(je=0,Vr=Tn=null,Ga=0,(oe&6)!==0)throw Error(D(331));var s=oe;if(oe|=4,wv(r.current),vv(r,r.current,l,a),oe=s,Rs(0,!1),zt&&typeof zt.onPostCommitFiberRoot==="function")try{zt.onPostCommitFiberRoot(ws,r)}catch(o){}return!0}finally{ue.p=i,j.T=n,qv(e,t)}}function Jy(e,t,a){t=Yt(a,t),t=Sh(e.stateNode,t,2),e=In(e,t,2),e!==null&&(Is(e,2),ya(e))}function he(e,t,a){if(e.tag===3)Jy(e,e,a);else for(;t!==null;){if(t.tag===3){Jy(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError==="function"||typeof n.componentDidCatch==="function"&&(Mn===null||!Mn.has(n))){e=Yt(a,e),a=tv(2),n=In(t,a,2),n!==null&&(av(a,n,t,e),Is(n,2),ya(n));break}}t=t.return}}function Pd(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Z2;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(a)||(Im=!0,i.add(a),e=aA.bind(null,e,t,a),t.then(e,e))}function aA(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,xe===e&&(ne&a)===a&&(Ee===4||Ee===3&&(ne&62914560)===ne&&300>Bt()-cc?(oe&2)===0&&Gr(e,0):Mm|=a,Hr===ne&&(Hr=0)),ya(e)}function Uv(e,t){t===0&&(t=Rb()),e=wi(e,t),e!==null&&(Is(e,t),ya(e))}function nA(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Uv(e,a)}function iA(e,t){var a=0;switch(e.tag){case 31:case 13:var{stateNode:n,memoizedState:i}=e;i!==null&&(a=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(D(314))}n!==null&&n.delete(t),Uv(e,a)}function rA(e,t){return Vh(e,t)}var Vu=null,pr=null,Th=!1,Gu=!1,qd=!1,Cn=0;function ya(e){e!==pr&&e.next===null&&(pr===null?Vu=pr=e:pr=pr.next=e),Gu=!0,Th||(Th=!0,sA())}function Rs(e,t){if(!qd&&Gu){qd=!0;do{var a=!1;for(var n=Vu;n!==null;){if(!t)if(e!==0){var i=n.pendingLanes;if(i===0)var r=0;else{var{suspendedLanes:l,pingedLanes:s}=n;r=(1<<31-_t(42|e)+1)-1,r&=i&~(l&~s),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(a=!0,$y(n,r))}else r=ne,r=$u(n,n===xe?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(r&3)===0||ks(n,r)||(a=!0,$y(n,r));n=n.next}}while(a);qd=!1}}function lA(){Hv()}function Hv(){Gu=Th=!1;var e=0;Cn!==0&&pA()&&(e=Cn);for(var t=Bt(),a=null,n=Vu;n!==null;){var i=n.next,r=Vv(n,t);if(r===0)n.next=null,a===null?Vu=i:a.next=i,i===null&&(pr=a);else if(a=n,e!==0||(r&3)!==0)Gu=!0;n=i}je!==0&&je!==5||Rs(e,!1),Cn!==0&&(Cn=0)}function Vv(e,t){for(var{suspendedLanes:a,pingedLanes:n,expirationTimes:i}=e,r=e.pendingLanes&-62914561;0<r;){var l=31-_t(r),s=1<<l,o=i[l];if(o===-1){if((s&a)===0||(s&n)!==0)i[l]=BT(s,t)}else o<=t&&(e.expiredLanes|=s);r&=~s}if(t=xe,a=ne,a=$u(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(de===2||de===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&pd(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ks(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&pd(n),Qh(a)){case 2:case 8:a=Eb;break;case 32:a=Iu;break;case 268435456:a=Db;break;default:a=Iu}return n=Gv.bind(null,e),a=Vh(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&pd(n),e.callbackPriority=2,e.callbackNode=null,2}function Gv(e,t){if(je!==0&&je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(hc()&&e.callbackNode!==a)return null;var n=ne;if(n=$u(e,e===xe?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0)return null;return Av(e,n,t),Vv(e,Bt()),e.callbackNode!=null&&e.callbackNode===a?Gv.bind(null,e):null}function $y(e,t){if(hc())return null;Av(e,t,!0)}function sA(){xA(function(){(oe&6)!==0?Vh(Ab,lA):Hv()})}function Am(){if(Cn===0){var e=qr;e===0&&(e=Ko,Ko<<=1,(Ko&261888)===0&&(Ko=256)),Cn=e}return Cn}function eb(e){return e==null||typeof e==="symbol"||typeof e==="boolean"?null:typeof e==="function"?e:ou(""+e)}function tb(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function oA(e,t,a,n,i){if(t==="submit"&&a&&a.stateNode===i){var r=eb((i[Ct]||null).action),l=n.submitter;l&&(t=(t=l[Ct]||null)?eb(t.formAction):l.getAttribute("formAction"),t!==null&&(r=t,l=null));var s=new ec("action","action",null,n,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Cn!==0){var o=l?tb(i,l):new FormData(i);yh(a,{pending:!0,data:o,method:i.method,action:r},null,o)}}else typeof r==="function"&&(s.preventDefault(),o=l?tb(i,l):new FormData(i),yh(a,{pending:!0,data:o,method:i.method,action:r},r,o))},currentTarget:i}]})}}for(Kl=0;Kl<lh.length;Kl++)Xl=lh[Kl],Ah=Xl.toLowerCase(),Eh=Xl[0].toUpperCase()+Xl.slice(1),ia(Ah,"on"+Eh);var Xl,Ah,Eh,Kl;ia(aS,"onAnimationEnd");ia(nS,"onAnimationIteration");ia(iS,"onAnimationStart");ia("dblclick","onDoubleClick");ia("focusin","onFocus");ia("focusout","onBlur");ia(I2,"onTransitionRun");ia(M2,"onTransitionStart");ia(T2,"onTransitionCancel");ia(rS,"onTransitionEnd");Or("onMouseEnter",["mouseout","mouseover"]);Or("onMouseLeave",["mouseout","mouseover"]);Or("onPointerEnter",["pointerout","pointerover"]);Or("onPointerLeave",["pointerout","pointerover"]);vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vi("onBeforeInput",["compositionend","keypress","textInput","paste"]);vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ys="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(" "),uA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ys));function Qv(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],i=n.event;n=n.listeners;e:{var r=void 0;if(t)for(var l=n.length-1;0<=l;l--){var s=n[l],o=s.instance,u=s.currentTarget;if(s=s.listener,o!==r&&i.isPropagationStopped())break e;r=s,i.currentTarget=u;try{r(i)}catch(c){Tu(c)}i.currentTarget=null,r=o}else for(l=0;l<n.length;l++){if(s=n[l],o=s.instance,u=s.currentTarget,s=s.listener,o!==r&&i.isPropagationStopped())break e;r=s,i.currentTarget=u;try{r(i)}catch(c){Tu(c)}i.currentTarget=null,r=o}}}}function te(e,t){var a=t[Jd];a===void 0&&(a=t[Jd]=new Set);var n=e+"__bubble";a.has(n)||(jv(t,e,2,!1),a.add(n))}function Fd(e,t,a){var n=0;t&&(n|=4),jv(a,e,n,t)}var iu="_reactListening"+Math.random().toString(36).slice(2);function Em(e){if(!e[iu]){e[iu]=!0,Ob.forEach(function(a){a!=="selectionchange"&&(uA.has(a)||Fd(a,!1,e),Fd(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[iu]||(t[iu]=!0,Fd("selectionchange",!1,t))}}function jv(e,t,a,n){switch(r0(t)){case 2:var i=OA;break;case 8:i=PA;break;default:i=zm}a=i.bind(null,t,a,e),i=void 0,!nh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Ud(e,t,a,n,i){var r=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var s=n.stateNode.containerInfo;if(s===i)break;if(l===4)for(l=n.return;l!==null;){var o=l.tag;if((o===3||o===4)&&l.stateNode.containerInfo===i)return;l=l.return}for(;s!==null;){if(l=br(s),l===null)return;if(o=l.tag,o===5||o===6||o===26||o===27){n=r=l;continue e}s=s.parentNode}}n=n.return}Qb(function(){var u=r,c=Kh(a),f=[];e:{var d=lS.get(e);if(d!==void 0){var h=ec,g=e;switch(e){case"keypress":if(cu(a)===0)break e;case"keydown":case"keyup":h=i2;break;case"focusin":g="focus",h=Sd;break;case"focusout":g="blur",h=Sd;break;case"beforeblur":case"afterblur":h=Sd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=cy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=jT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=s2;break;case aS:case nS:case iS:h=XT;break;case rS:h=u2;break;case"scroll":case"scrollend":h=GT;break;case"wheel":h=f2;break;case"copy":case"cut":case"paste":h=ZT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=dy;break;case"toggle":case"beforetoggle":h=h2}var b=(t&4)!==0,S=!b&&(e==="scroll"||e==="scrollend"),p=b?d!==null?d+"Capture":null:d;b=[];for(var x=u,y;x!==null;){var w=x;if(y=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||y===null||p===null||(w=cs(x,p),w!=null&&b.push(bs(x,w,y))),S)break;x=x.return}0<b.length&&(d=new h(d,g,null,a,c),f.push({event:d,listeners:b}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&a!==ah&&(g=a.relatedTarget||a.fromElement)&&(br(g)||g[Yr]))break e;if(h||d){if(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,h){if(g=a.relatedTarget||a.toElement,h=u,g=g?br(g):null,g!==null&&(S=Ls(g),b=g.tag,g!==S||b!==5&&b!==27&&b!==6))g=null}else h=null,g=u;if(h!==g){if(b=cy,w="onMouseLeave",p="onMouseEnter",x="mouse",e==="pointerout"||e==="pointerover")b=dy,w="onPointerLeave",p="onPointerEnter",x="pointer";if(S=h==null?d:Vl(h),y=g==null?d:Vl(g),d=new b(w,x+"leave",h,a,c),d.target=S,d.relatedTarget=y,w=null,br(c)===u&&(b=new b(p,x+"enter",g,a,c),b.target=y,b.relatedTarget=S,w=b),S=w,h&&g)t:{b=cA,p=h,x=g,y=0;for(w=p;w;w=b(w))y++;w=0;for(var T=x;T;T=b(T))w++;for(;0<y-w;)p=b(p),y--;for(;0<w-y;)x=b(x),w--;for(;y--;){if(p===x||x!==null&&p===x.alternate){b=p;break t}p=b(p),x=b(x)}b=null}else b=null;h!==null&&ab(f,d,h,b,!1),g!==null&&S!==null&&ab(f,S,g,b,!0)}}}e:{if(d=u?Vl(u):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var I=gy;else if(py(d))if(Zb)I=L2;else{I=v2;var M=S2}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?u&&Yh(u.elementType)&&(I=gy):I=C2;if(I&&(I=I(e,u))){Wb(f,I,a,c);break e}M&&M(e,d,u),e==="focusout"&&u&&d.type==="number"&&u.memoizedProps.value!=null&&th(d,"number",d.value)}switch(M=u?Vl(u):window,e){case"focusin":if(py(M)||M.contentEditable==="true")Cr=M,ih=u,Jl=null;break;case"focusout":Jl=ih=Cr=null;break;case"mousedown":rh=!0;break;case"contextmenu":case"mouseup":case"dragend":rh=!1,Sy(f,a,c);break;case"selectionchange":if(k2)break;case"keydown":case"keyup":Sy(f,a,c)}var R;if(Zh)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else vr?Kb(e,a)&&(A="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(A="onCompositionStart");if(A&&(Yb&&a.locale!=="ko"&&(vr||A!=="onCompositionStart"?A==="onCompositionEnd"&&vr&&(R=jb()):(bn=c,Xh=("value"in bn)?bn.value:bn.textContent,vr=!0)),M=Qu(u,A),0<M.length&&(A=new fy(A,e,null,a,c),f.push({event:A,listeners:M}),R?A.data=R:(R=Xb(a),R!==null&&(A.data=R)))),R=p2?g2(e,a):x2(e,a))A=Qu(u,"onBeforeInput"),0<A.length&&(M=new fy("onBeforeInput","beforeinput",null,a,c),f.push({event:M,listeners:A}),M.data=R);oA(f,e,u,a,c)}Qv(f,t)})}function bs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Qu(e,t){for(var a=t+"Capture",n=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=cs(e,a),i!=null&&n.unshift(bs(e,i,r)),i=cs(e,t),i!=null&&n.push(bs(e,i,r))),e.tag===3)return n;e=e.return}return[]}function cA(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e?e:null}function ab(e,t,a,n,i){for(var r=t._reactName,l=[];a!==null&&a!==n;){var s=a,o=s.alternate,u=s.stateNode;if(s=s.tag,o!==null&&o===n)break;s!==5&&s!==26&&s!==27||u===null||(o=u,i?(u=cs(a,r),u!=null&&l.unshift(bs(a,u,o))):i||(u=cs(a,r),u!=null&&l.push(bs(a,u,o)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var fA=/\r\n?/g,dA=/\u0000|\uFFFD/g;function nb(e){return(typeof e==="string"?e:""+e).replace(fA,`
|
|
9
|
+
`).replace(dA,"")}function Yv(e,t){return t=nb(t),nb(e)===t?!0:!1}function me(e,t,a,n,i,r){switch(a){case"children":typeof n==="string"?t==="body"||t==="textarea"&&n===""||Pr(e,n):(typeof n==="number"||typeof n==="bigint")&&t!=="body"&&Pr(e,""+n);break;case"className":Zo(e,"class",n);break;case"tabIndex":Zo(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Zo(e,a,n);break;case"style":Gb(e,n,r);break;case"data":if(t!=="object"){Zo(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n==="function"||typeof n==="symbol"||typeof n==="boolean"){e.removeAttribute(a);break}n=ou(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n==="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r==="function"&&(a==="formAction"?(t!=="input"&&me(e,t,"name",i.name,i,null),me(e,t,"formEncType",i.formEncType,i,null),me(e,t,"formMethod",i.formMethod,i,null),me(e,t,"formTarget",i.formTarget,i,null)):(me(e,t,"encType",i.encType,i,null),me(e,t,"method",i.method,i,null),me(e,t,"target",i.target,i,null)));if(n==null||typeof n==="symbol"||typeof n==="boolean"){e.removeAttribute(a);break}n=ou(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Fa);break;case"onScroll":n!=null&&te("scroll",e);break;case"onScrollEnd":n!=null&&te("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!=="object"||!("__html"in n))throw Error(D(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(D(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!=="function"&&typeof n!=="symbol";break;case"muted":e.muted=n&&typeof n!=="function"&&typeof n!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n==="function"||typeof n==="boolean"||typeof n==="symbol"){e.removeAttribute("xlink:href");break}a=ou(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!=="function"&&typeof n!=="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!=="function"&&typeof n!=="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!=="function"&&typeof n!=="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!=="function"&&typeof n!=="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n==="function"||typeof n==="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":te("beforetoggle",e),te("toggle",e),su(e,"popover",n);break;case"xlinkActuate":Ra(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ra(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ra(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ra(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ra(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ra(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":su(e,"is",n);break;case"innerText":case"textContent":break;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=HT.get(a)||a,su(e,a,n)}}function Dh(e,t,a,n,i,r){switch(a){case"style":Gb(e,n,r);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!=="object"||!("__html"in n))throw Error(D(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(D(60));e.innerHTML=a}}break;case"children":typeof n==="string"?Pr(e,n):(typeof n==="number"||typeof n==="bigint")&&Pr(e,""+n);break;case"onScroll":n!=null&&te("scroll",e);break;case"onScrollEnd":n!=null&&te("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Fa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pb.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),r=e[Ct]||null,r=r!=null?r[a]:null,typeof r==="function"&&e.removeEventListener(t,r,i),typeof n==="function")){typeof r!=="function"&&r!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,i);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):su(e,a,n)}}}function nt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":te("error",e),te("load",e);var n=!1,i=!1,r;for(r in a)if(a.hasOwnProperty(r)){var l=a[r];if(l!=null)switch(r){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:me(e,t,r,l,a,null)}}i&&me(e,t,"srcSet",a.srcSet,a,null),n&&me(e,t,"src",a.src,a,null);return;case"input":te("invalid",e);var s=r=l=i=null,o=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":i=c;break;case"type":l=c;break;case"checked":o=c;break;case"defaultChecked":u=c;break;case"value":r=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(D(137,t));break;default:me(e,t,n,c,a,null)}}Ub(e,r,s,o,u,l,i,!1);return;case"select":te("invalid",e),n=l=r=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":l=s;break;case"multiple":n=s;default:me(e,t,i,s,a,null)}t=r,a=l,e.multiple=!!n,t!=null?Er(e,!!n,t,!1):a!=null&&Er(e,!!n,a,!0);return;case"textarea":te("invalid",e),r=i=n=null;for(l in a)if(a.hasOwnProperty(l)&&(s=a[l],s!=null))switch(l){case"value":n=s;break;case"defaultValue":i=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(D(91));break;default:me(e,t,l,s,a,null)}Vb(e,n,i,r);return;case"option":for(o in a)if(a.hasOwnProperty(o)&&(n=a[o],n!=null))switch(o){case"selected":e.selected=n&&typeof n!=="function"&&typeof n!=="symbol";break;default:me(e,t,o,n,a,null)}return;case"dialog":te("beforetoggle",e),te("toggle",e),te("cancel",e),te("close",e);break;case"iframe":case"object":te("load",e);break;case"video":case"audio":for(n=0;n<ys.length;n++)te(ys[n],e);break;case"image":te("error",e),te("load",e);break;case"details":te("toggle",e);break;case"embed":case"source":case"link":te("error",e),te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:me(e,t,u,n,a,null)}return;default:if(Yh(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Dh(e,t,c,n,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null&&me(e,t,s,n,a,null))}function hA(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,l=null,s=null,o=null,u=null,c=null;for(h in a){var f=a[h];if(a.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":o=f;default:n.hasOwnProperty(h)||me(e,t,h,null,n,f)}}for(var d in n){var h=n[d];if(f=a[d],n.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":r=h;break;case"name":i=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":l=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,t));break;default:h!==f&&me(e,t,d,h,n,f)}}eh(e,l,s,o,u,c,r,i);return;case"select":h=l=s=d=null;for(r in a)if(o=a[r],a.hasOwnProperty(r)&&o!=null)switch(r){case"value":break;case"multiple":h=o;default:n.hasOwnProperty(r)||me(e,t,r,null,n,o)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":d=r;break;case"defaultValue":s=r;break;case"multiple":l=r;default:r!==o&&me(e,t,i,r,n,o)}t=s,a=l,n=h,d!=null?Er(e,!!a,d,!1):!!n!==!!a&&(t!=null?Er(e,!!a,t,!0):Er(e,!!a,a?[]:"",!1));return;case"textarea":h=d=null;for(s in a)if(i=a[s],a.hasOwnProperty(s)&&i!=null&&!n.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:me(e,t,s,null,n,i)}for(l in n)if(i=n[l],r=a[l],n.hasOwnProperty(l)&&(i!=null||r!=null))switch(l){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(D(91));break;default:i!==r&&me(e,t,l,i,n,r)}Hb(e,d,h);return;case"option":for(var g in a)if(d=a[g],a.hasOwnProperty(g)&&d!=null&&!n.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:me(e,t,g,null,n,d)}for(o in n)if(d=n[o],h=a[o],n.hasOwnProperty(o)&&d!==h&&(d!=null||h!=null))switch(o){case"selected":e.selected=d&&typeof d!=="function"&&typeof d!=="symbol";break;default:me(e,t,o,d,n,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in a)d=a[b],a.hasOwnProperty(b)&&d!=null&&!n.hasOwnProperty(b)&&me(e,t,b,null,n,d);for(u in n)if(d=n[u],h=a[u],n.hasOwnProperty(u)&&d!==h&&(d!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(D(137,t));break;default:me(e,t,u,d,n,h)}return;default:if(Yh(t)){for(var S in a)d=a[S],a.hasOwnProperty(S)&&d!==void 0&&!n.hasOwnProperty(S)&&Dh(e,t,S,void 0,n,d);for(c in n)d=n[c],h=a[c],!n.hasOwnProperty(c)||d===h||d===void 0&&h===void 0||Dh(e,t,c,d,n,h);return}}for(var p in a)d=a[p],a.hasOwnProperty(p)&&d!=null&&!n.hasOwnProperty(p)&&me(e,t,p,null,n,d);for(f in n)d=n[f],h=a[f],!n.hasOwnProperty(f)||d===h||d==null&&h==null||me(e,t,f,d,n,h)}function ib(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mA(){if(typeof performance.getEntriesByType==="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var i=a[n],r=i.transferSize,l=i.initiatorType,s=i.duration;if(r&&s&&ib(l)){l=0,s=i.responseEnd;for(n+=1;n<a.length;n++){var o=a[n],u=o.startTime;if(u>s)break;var{transferSize:c,initiatorType:f}=o;c&&ib(f)&&(o=o.responseEnd,l+=c*(o<s?1:(s-u)/(o-u)))}if(--n,t+=8*(r+l)/(i.duration/1000),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==="number")?e:5}var Rh=null,Bh=null;function ju(e){return e.nodeType===9?e:e.ownerDocument}function rb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Kv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function zh(e,t){return e==="textarea"||e==="noscript"||typeof t.children==="string"||typeof t.children==="number"||typeof t.children==="bigint"||typeof t.dangerouslySetInnerHTML==="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Hd=null;function pA(){var e=window.event;if(e&&e.type==="popstate"){if(e===Hd)return!1;return Hd=e,!0}return Hd=null,!1}var Xv=typeof setTimeout==="function"?setTimeout:void 0,gA=typeof clearTimeout==="function"?clearTimeout:void 0,lb=typeof Promise==="function"?Promise:void 0,xA=typeof queueMicrotask==="function"?queueMicrotask:typeof lb<"u"?function(e){return lb.resolve(null).then(e).catch(yA)}:Xv;function yA(e){setTimeout(function(){throw e})}function On(e){return e==="head"}function sb(e,t){var a=t,n=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(i),jr(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")os(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,os(a);for(var r=a.firstChild;r;){var{nextSibling:l,nodeName:s}=r;r[Ms]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&r.rel.toLowerCase()==="stylesheet"||a.removeChild(r),r=l}}else a==="body"&&os(e.ownerDocument.body);a=i}while(a);jr(t)}function ob(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$")if(e===0)break;else e--;else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function _h(e){var t=e.firstChild;t&&t.nodeType===10&&(t=t.nextSibling);for(;t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":_h(a),jh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function bA(e,t,a,n){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(!n)if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;else if(!e[Ms])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;else if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}if(e=Wt(e.nextSibling),e===null)break}return null}function SA(e,t,a){if(t==="")return null;for(;e.nodeType!==3;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a)return null;if(e=Wt(e.nextSibling),e===null)return null}return e}function Wv(e,t){for(;e.nodeType!==8;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t)return null;if(e=Wt(e.nextSibling),e===null)return null}return e}function Nh(e){return e.data==="$?"||e.data==="$~"}function Oh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function vA(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Wt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ph=null;function ub(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Wt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function cb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Zv(e,t,a){switch(t=ju(a),e){case"html":if(e=t.documentElement,!e)throw Error(D(452));return e;case"head":if(e=t.head,!e)throw Error(D(453));return e;case"body":if(e=t.body,!e)throw Error(D(454));return e;default:throw Error(D(451))}}function os(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jh(e)}var Zt=new Map,fb=new Set;function Yu(e){return typeof e.getRootNode==="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wa=ue.d;ue.d={f:CA,r:LA,D:wA,C:kA,L:IA,m:MA,X:AA,S:TA,M:EA};function CA(){var e=Wa.f(),t=fc();return e||t}function LA(e){var t=Kr(e);t!==null&&t.tag===5&&t.type==="form"?GS(t):Wa.r(e)}var Jr=typeof document>"u"?null:document;function Jv(e,t,a){var n=Jr;if(n&&typeof t==="string"&&t){var i=jt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a==="string"&&(i+='[crossorigin="'+a+'"]'),fb.has(i)||(fb.add(i),e={rel:e,crossOrigin:a,href:t},n.querySelector(i)===null&&(t=n.createElement("link"),nt(t,"link",e),Xe(t),n.head.appendChild(t)))}}function wA(e){Wa.D(e),Jv("dns-prefetch",e,null)}function kA(e,t){Wa.C(e,t),Jv("preconnect",e,t)}function IA(e,t,a){Wa.L(e,t,a);var n=Jr;if(n&&e&&t){var i='link[rel="preload"][as="'+jt(t)+'"]';t==="image"?a&&a.imageSrcSet?(i+='[imagesrcset="'+jt(a.imageSrcSet)+'"]',typeof a.imageSizes==="string"&&(i+='[imagesizes="'+jt(a.imageSizes)+'"]')):i+='[href="'+jt(e)+'"]':i+='[href="'+jt(e)+'"]';var r=i;switch(t){case"style":r=Qr(e);break;case"script":r=$r(e)}Zt.has(r)||(e=we({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Zt.set(r,e),n.querySelector(i)!==null||t==="style"&&n.querySelector(Bs(r))||t==="script"&&n.querySelector(zs(r))||(t=n.createElement("link"),nt(t,"link",e),Xe(t),n.head.appendChild(t)))}}function MA(e,t){Wa.m(e,t);var a=Jr;if(a&&e){var n=t&&typeof t.as==="string"?t.as:"script",i='link[rel="modulepreload"][as="'+jt(n)+'"][href="'+jt(e)+'"]',r=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=$r(e)}if(!Zt.has(r)&&(e=we({rel:"modulepreload",href:e},t),Zt.set(r,e),a.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(zs(r)))return}n=a.createElement("link"),nt(n,"link",e),Xe(n),a.head.appendChild(n)}}}function TA(e,t,a){Wa.S(e,t,a);var n=Jr;if(n&&e){var i=Ar(n).hoistableStyles,r=Qr(e);t=t||"default";var l=i.get(r);if(!l){var s={loading:0,preload:null};if(l=n.querySelector(Bs(r)))s.loading=5;else{e=we({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Zt.get(r))&&Dm(e,a);var o=l=n.createElement("link");Xe(o),nt(o,"link",e),o._p=new Promise(function(u,c){o.onload=u,o.onerror=c}),o.addEventListener("load",function(){s.loading|=1}),o.addEventListener("error",function(){s.loading|=2}),s.loading|=4,bu(l,t,n)}l={type:"stylesheet",instance:l,count:1,state:s},i.set(r,l)}}}function AA(e,t){Wa.X(e,t);var a=Jr;if(a&&e){var n=Ar(a).hoistableScripts,i=$r(e),r=n.get(i);r||(r=a.querySelector(zs(i)),r||(e=we({src:e,async:!0},t),(t=Zt.get(i))&&Rm(e,t),r=a.createElement("script"),Xe(r),nt(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(i,r))}}function EA(e,t){Wa.M(e,t);var a=Jr;if(a&&e){var n=Ar(a).hoistableScripts,i=$r(e),r=n.get(i);r||(r=a.querySelector(zs(i)),r||(e=we({src:e,async:!0,type:"module"},t),(t=Zt.get(i))&&Rm(e,t),r=a.createElement("script"),Xe(r),nt(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(i,r))}}function db(e,t,a,n){var i=(i=Ln.current)?Yu(i):null;if(!i)throw Error(D(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence==="string"&&typeof a.href==="string"?(t=Qr(a.href),a=Ar(i).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href==="string"&&typeof a.precedence==="string"){e=Qr(a.href);var r=Ar(i).hoistableStyles,l=r.get(e);if(l||(i=i.ownerDocument||i,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,l),(r=i.querySelector(Bs(e)))&&!r._p&&(l.instance=r,l.state.loading=5),Zt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Zt.set(e,a),r||DA(i,e,a,l.state))),t&&n===null)throw Error(D(528,""));return l}if(t&&n!==null)throw Error(D(529,""));return null;case"script":return t=a.async,a=a.src,typeof a==="string"&&t&&typeof t!=="function"&&typeof t!=="symbol"?(t=$r(a),a=Ar(i).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,e))}}function Qr(e){return'href="'+jt(e)+'"'}function Bs(e){return'link[rel="stylesheet"]['+e+"]"}function $v(e){return we({},e,{"data-precedence":e.precedence,precedence:null})}function DA(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),nt(t,"link",a),Xe(t),e.head.appendChild(t))}function $r(e){return'[src="'+jt(e)+'"]'}function zs(e){return"script[async]"+e}function hb(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+jt(a.href)+'"]');if(n)return t.instance=n,Xe(n),n;var i=we({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Xe(n),nt(n,"style",i),bu(n,a.precedence,e),t.instance=n;case"stylesheet":i=Qr(a.href);var r=e.querySelector(Bs(i));if(r)return t.state.loading|=4,t.instance=r,Xe(r),r;n=$v(a),(i=Zt.get(i))&&Dm(n,i),r=(e.ownerDocument||e).createElement("link"),Xe(r);var l=r;return l._p=new Promise(function(s,o){l.onload=s,l.onerror=o}),nt(r,"link",n),t.state.loading|=4,bu(r,a.precedence,e),t.instance=r;case"script":if(r=$r(a.src),i=e.querySelector(zs(r)))return t.instance=i,Xe(i),i;if(n=a,i=Zt.get(r))n=we({},a),Rm(n,i);return e=e.ownerDocument||e,i=e.createElement("script"),Xe(i),nt(i,"link",n),e.head.appendChild(i),t.instance=i;case"void":return null;default:throw Error(D(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,bu(n,a.precedence,e));return t.instance}function bu(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,r=i,l=0;l<n.length;l++){var s=n[l];if(s.dataset.precedence===t)r=s;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Dm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Rm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Su=null;function mb(e,t,a){if(Su===null){var n=new Map,i=Su=new Map;i.set(a,n)}else i=Su,n=i.get(a),n||(n=new Map,i.set(a,n));if(n.has(e))return n;n.set(e,null),a=a.getElementsByTagName(e);for(i=0;i<a.length;i++){var r=a[i];if(!(r[Ms]||r[et]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var l=r.getAttribute(t)||"";l=e+l;var s=n.get(l);s?s.push(r):n.set(l,[r])}}return n}function pb(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function RA(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!=="string"||typeof t.href!=="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!=="string"||typeof t.href!=="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence==="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!=="function"&&typeof t.async!=="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==="string")return!0}return!1}function e0(e){return e.type==="stylesheet"&&(e.state.loading&3)===0?!1:!0}function BA(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!=="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=Qr(n.href),r=t.querySelector(Bs(i));if(r){t=r._p,t!==null&&typeof t==="object"&&typeof t.then==="function"&&(e.count++,e=Ku.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=r,Xe(r);return}r=t.ownerDocument||t,n=$v(n),(i=Zt.get(i))&&Dm(n,i),r=r.createElement("link"),Xe(r);var l=r;l._p=new Promise(function(s,o){l.onload=s,l.onerror=o}),nt(r,"link",n),a.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ku.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Vd=0;function zA(e,t){return e.stylesheets&&e.count===0&&vu(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&vu(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},60000+t);0<e.imgBytes&&Vd===0&&(Vd=62500*mA());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vu(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Vd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xu=null;function vu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xu=new Map,t.forEach(_A,e),Xu=null,Ku.call(e))}function _A(e,t){if(!(t.state.loading&4)){var a=Xu.get(e);if(a)var n=a.get(null);else{a=new Map,Xu.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var l=i[r];if(l.nodeName==="LINK"||l.getAttribute("media")!=="not all")a.set(l.dataset.precedence,l),n=l}n&&a.set(null,n)}i=t.instance,l=i.getAttribute("data-precedence"),r=a.get(l)||n,r===n&&a.set(null,i),a.set(l,i),this.count++,n=Ku.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ss={$$typeof:qa,Provider:null,Consumer:null,_currentValue:fi,_currentValue2:fi,_threadCount:0};function NA(e,t,a,n,i,r,l,s,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gd(0),this.hiddenUpdates=gd(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function t0(e,t,a,n,i,r,l,s,o,u,c,f){return e=new NA(e,t,a,l,o,u,c,f,s),t=1,r===!0&&(t|=24),r=Dt(3,null,null,t),e.current=r,r.stateNode=e,t=im(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:n,isDehydrated:a,cache:t},sm(r),e}function a0(e){if(!e)return kr;return e=kr,e}function n0(e,t,a,n,i,r){i=a0(i),n.context===null?n.context=i:n.pendingContext=i,n=kn(t),n.payload={element:a},r=r===void 0?null:r,r!==null&&(n.callback=r),a=In(e,n,t),a!==null&&(vt(a,e,t),es(a,e,t))}function gb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Bm(e,t){gb(e,t),(e=e.alternate)&&gb(e,t)}function i0(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&vt(t,e,67108864),Bm(e,67108864)}}function xb(e){if(e.tag===13||e.tag===31){var t=Nt();t=Gh(t);var a=wi(e,t);a!==null&&vt(a,e,t),Bm(e,t)}}var Wu=!0;function OA(e,t,a,n){var i=j.T;j.T=null;var r=ue.p;try{ue.p=2,zm(e,t,a,n)}finally{ue.p=r,j.T=i}}function PA(e,t,a,n){var i=j.T;j.T=null;var r=ue.p;try{ue.p=8,zm(e,t,a,n)}finally{ue.p=r,j.T=i}}function zm(e,t,a,n){if(Wu){var i=qh(n);if(i===null)Ud(e,t,n,Zu,a),yb(e,n);else if(FA(i,e,t,a,n))n.stopPropagation();else if(yb(e,n),t&4&&-1<qA.indexOf(e)){for(;i!==null;){var r=Kr(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var l=si(r.pendingLanes);if(l!==0){var s=r;s.pendingLanes|=2;for(s.entangledLanes|=2;l;){var o=1<<31-_t(l);s.entanglements[1]|=o,l&=~o}ya(r),(oe&6)===0&&(Fu=Bt()+500,Rs(0,!1))}}break;case 31:case 13:s=wi(r,2),s!==null&&vt(s,r,2),fc(),Bm(r,2)}if(r=qh(n),r===null&&Ud(e,t,n,Zu,a),r===i)break;i=r}i!==null&&n.stopPropagation()}else Ud(e,t,n,null,a)}}function qh(e){return e=Kh(e),_m(e)}var Zu=null;function _m(e){if(Zu=null,e=br(e),e!==null){var t=Ls(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=wb(t),e!==null)return e;e=null}else if(a===31){if(e=kb(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Zu=e,null}function r0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(IT()){case Ab:return 2;case Eb:return 8;case Iu:case MT:return 32;case Db:return 268435456;default:return 32}default:return 32}}var Fh=!1,An=null,En=null,Dn=null,vs=new Map,Cs=new Map,xn=[],qA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yb(e,t){switch(e){case"focusin":case"focusout":An=null;break;case"dragenter":case"dragleave":En=null;break;case"mouseover":case"mouseout":Dn=null;break;case"pointerover":case"pointerout":vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cs.delete(t.pointerId)}}function Fl(e,t,a,n,i,r){if(e===null||e.nativeEvent!==r)return e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Kr(t),t!==null&&i0(t)),e;return e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e}function FA(e,t,a,n,i){switch(t){case"focusin":return An=Fl(An,e,t,a,n,i),!0;case"dragenter":return En=Fl(En,e,t,a,n,i),!0;case"mouseover":return Dn=Fl(Dn,e,t,a,n,i),!0;case"pointerover":var r=i.pointerId;return vs.set(r,Fl(vs.get(r)||null,e,t,a,n,i)),!0;case"gotpointercapture":return r=i.pointerId,Cs.set(r,Fl(Cs.get(r)||null,e,t,a,n,i)),!0}return!1}function l0(e){var t=br(e.target);if(t!==null){var a=Ls(t);if(a!==null){if(t=a.tag,t===13){if(t=wb(a),t!==null){e.blockedOn=t,ny(e.priority,function(){xb(a)});return}}else if(t===31){if(t=kb(a),t!==null){e.blockedOn=t,ny(e.priority,function(){xb(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=qh(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);ah=n,a.target.dispatchEvent(n),ah=null}else return t=Kr(a),t!==null&&i0(t),e.blockedOn=a,!1;t.shift()}return!0}function bb(e,t,a){Cu(e)&&a.delete(t)}function UA(){Fh=!1,An!==null&&Cu(An)&&(An=null),En!==null&&Cu(En)&&(En=null),Dn!==null&&Cu(Dn)&&(Dn=null),vs.forEach(bb),Cs.forEach(bb)}function ru(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,fr(cr,UA)))}var lu=null;function Sb(e){lu!==e&&(lu=e,fr(cr,function(){lu===e&&(lu=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],i=e[t+2];if(typeof n!=="function")if(_m(n||a)===null)continue;else break;var r=Kr(a);r!==null&&(e.splice(t,3),t-=3,yh(r,{pending:!0,data:i,method:a.method,action:n},n,i))}}))}function jr(e){function t(o){return ru(o,e)}An!==null&&ru(An,e),En!==null&&ru(En,e),Dn!==null&&ru(Dn,e),vs.forEach(t),Cs.forEach(t);for(var a=0;a<xn.length;a++){var n=xn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<xn.length&&(a=xn[0],a.blockedOn===null);)l0(a),a.blockedOn===null&&xn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var i=a[n],r=a[n+1],l=i[Ct]||null;if(typeof r==="function")l||Sb(a);else if(l){var s=null;if(r&&r.hasAttribute("formAction")){if(i=r,l=r[Ct]||null)s=l.formAction;else if(_m(i)!==null)continue}else s=l.action;typeof s==="function"?a[n+1]=s:(a.splice(n,3),n-=3),Sb(a)}}}function s0(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(l){return i=l})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var n=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Nm(e){this._internalRoot=e}mc.prototype.render=Nm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));var a=t.current,n=Nt();n0(a,n,e,t,null,null)};mc.prototype.unmount=Nm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;n0(e.current,2,null,e,null,null),fc(),t[Yr]=null}};function mc(e){this._internalRoot=e}mc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Nb();e={blockedOn:null,target:e,priority:t};for(var a=0;a<xn.length&&t!==0&&t<xn[a].priority;a++);xn.splice(a,0,e),a===0&&l0(e)}};var vb=Ju.version;if(vb!=="19.2.8")throw Error(D(527,vb,"19.2.8"));ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0){if(typeof e.render==="function")throw Error(D(188));throw e=Object.keys(e).join(","),Error(D(268,e))}return e=bT(t),e=e!==null?Ib(e):null,e=e===null?null:e.stateNode,e};var HA={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){if(gr=__REACT_DEVTOOLS_GLOBAL_HOOK__,!gr.isDisabled&&gr.supportsFiber)try{ws=gr.inject(HA),zt=gr}catch(e){}}var gr;VA.createRoot=function(e,t){if(!Lb(e))throw Error(D(299));var a=!1,n="",i=JS,r=$S,l=ev;return t!==null&&t!==void 0&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=t0(e,1,!1,null,null,a,n,null,i,r,l,s0),e[Yr]=t.current,Em(e),new Nm(t)};VA.hydrateRoot=function(e,t,a){if(!Lb(e))throw Error(D(299));var n=!1,i="",r=JS,l=$S,s=ev,o=null;return a!==null&&a!==void 0&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(r=a.onUncaughtError),a.onCaughtError!==void 0&&(l=a.onCaughtError),a.onRecoverableError!==void 0&&(s=a.onRecoverableError),a.formState!==void 0&&(o=a.formState)),t=t0(e,1,!0,t,a!=null?a:null,n,i,o,r,l,s,s0),t.context=a0(null),a=t.current,n=Nt(),n=Gh(n),i=kn(n),i.callback=null,In(a,i,n),a=n,t.current.lanes=a,Is(t,a),ya(t),e[Yr]=t.current,Em(e),new mc(t)};VA.version="19.2.8"});var f0=ca(function(BO,c0){function u0(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u0)}catch(e){console.error(e)}}u0(),c0.exports=o0()});var U0=ca(function(a_t,F0){var N0=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,pE=/\n/g,gE=/^\s*/,xE=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yE=/^:\s*/,bE=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SE=/^[;\s]*/,vE=/^\s+|\s+$/g,CE=`
|
|
10
|
+
`,O0="/",P0="*",Ni="",LE="comment",wE="declaration";function kE(e,t){if(typeof e!=="string")throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,n=1;function i(g){var b=g.match(pE);if(b)a+=b.length;var S=g.lastIndexOf(CE);n=~S?g.length-S:n+g.length}function r(){var g={line:a,column:n};return function(b){return b.position=new l(g),u(),b}}function l(g){this.start=g,this.end={line:a,column:n},this.source=t.source}l.prototype.content=e;function s(g){var b=Error(t.source+":"+a+":"+n+": "+g);if(b.reason=g,b.filename=t.source,b.line=a,b.column=n,b.source=e,t.silent);else throw b}function o(g){var b=g.exec(e);if(!b)return;var S=b[0];return i(S),e=e.slice(S.length),b}function u(){o(gE)}function c(g){var b;g=g||[];while(b=f())if(b!==!1)g.push(b);return g}function f(){var g=r();if(O0!=e.charAt(0)||P0!=e.charAt(1))return;var b=2;while(Ni!=e.charAt(b)&&(P0!=e.charAt(b)||O0!=e.charAt(b+1)))++b;if(b+=2,Ni===e.charAt(b-1))return s("End of comment missing");var S=e.slice(2,b-2);return n+=2,i(S),e=e.slice(b),n+=2,g({type:LE,comment:S})}function d(){var g=r(),b=o(xE);if(!b)return;if(f(),!o(yE))return s("property missing ':'");var S=o(bE),p=g({type:wE,property:q0(b[0].replace(N0,Ni)),value:S?q0(S[0].replace(N0,Ni)):Ni});return o(SE),p}function h(){var g=[];c(g);var b;while(b=d())if(b!==!1)g.push(b),c(g);return g}return u(),h()}function q0(e){return e?e.replace(vE,Ni):Ni}F0.exports=kE});var H0=ca(function(to){var IE=to&&to.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(to,"__esModule",{value:!0});to.default=TE;var ME=IE(U0());function TE(e,t){let a=null;if(!e||typeof e!=="string")return a;let n=(0,ME.default)(e),i=typeof t==="function";return n.forEach((r)=>{if(r.type!=="declaration")return;let{property:l,value:s}=r;if(i)t(l,s,r);else if(s)a=a||{},a[l]=s}),a}});var j0=ca(function(G0){Object.defineProperty(G0,"__esModule",{value:!0});G0.camelCase=void 0;var AE=/^--[a-zA-Z0-9_-]+$/,EE=/-([a-z])/g,DE=/^[^-]+$/,RE=/^-(webkit|moz|ms|o|khtml)-/,BE=/^-(ms)-/,zE=function(e){return!e||DE.test(e)||AE.test(e)},_E=function(e,t){return t.toUpperCase()},V0=function(e,t){return"".concat(t,"-")},NE=function(e,t){if(t===void 0)t={};if(zE(e))return e;if(e=e.toLowerCase(),t.reactCompat)e=e.replace(BE,V0);else e=e.replace(RE,V0);return e.replace(EE,_E)};G0.camelCase=NE});var K0=ca(function(Km,Y0){var OE=Km&&Km.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},PE=OE(H0()),qE=j0();function Ym(e,t){var a={};if(!e||typeof e!=="string")return a;return(0,PE.default)(e,function(n,i){if(n&&i)a[(0,qE.camelCase)(n,t)]=i}),a}Ym.default=Ym;Y0.exports=Ym});var xC=ca(function(Kqt,gC){var Kc=Object.prototype.hasOwnProperty,pC=Object.prototype.toString,uC=Object.defineProperty,cC=Object.getOwnPropertyDescriptor,fC=function(t){if(typeof Array.isArray==="function")return Array.isArray(t);return pC.call(t)==="[object Array]"},dC=function(t){if(!t||pC.call(t)!=="[object Object]")return!1;var a=Kc.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Kc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var i;for(i in t);return typeof i>"u"||Kc.call(t,i)},hC=function(t,a){if(uC&&a.name==="__proto__")uC(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0});else t[a.name]=a.newValue},mC=function(t,a){if(a==="__proto__"){if(!Kc.call(t,a))return;else if(cC)return cC(t,a).value}return t[a]};gC.exports=function e(){var t,a,n,i,r,l,s=arguments[0],o=1,u=arguments.length,c=!1;if(typeof s==="boolean")c=s,s=arguments[1]||{},o=2;if(s==null||typeof s!=="object"&&typeof s!=="function")s={};for(;o<u;++o)if(t=arguments[o],t!=null){for(a in t)if(n=mC(s,a),i=mC(t,a),s!==i){if(c&&i&&(dC(i)||(r=fC(i)))){if(r)r=!1,l=n&&fC(n)?n:[];else l=n&&dC(n)?n:{};hC(s,{name:a,newValue:e(c,l,i)})}else if(typeof i<"u")hC(s,{name:a,newValue:i})}}return s}});var TI=qe(Je(),1),AI=qe(f0(),1);var un=qe(Je(),1);var gc=qe(Je(),1);var d0=(e)=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pc=(...e)=>e.filter((t,a,n)=>Boolean(t)&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var _s=qe(Je(),1);var h0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var m0=_s.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:i="",children:r,iconNode:l,...s},o)=>_s.createElement("svg",{ref:o,...h0,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:pc("lucide",i),...s},[...l.map(([u,c])=>_s.createElement(u,c)),...Array.isArray(r)?r:[r]]));var _=(e,t)=>{let a=gc.forwardRef(({className:n,...i},r)=>gc.createElement(m0,{ref:r,iconNode:t,className:pc(`lucide-${d0(e)}`,n),...i}));return a.displayName=`${e}`,a};var Pn=_("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);var qt=_("ChartCandlestick",[["path",{d:"M9 5v4",key:"14uxtq"}],["rect",{width:"4",height:"6",x:"7",y:"9",rx:"1",key:"f4fvz0"}],["path",{d:"M9 15v2",key:"r5rk32"}],["path",{d:"M17 3v2",key:"1l2re6"}],["rect",{width:"4",height:"8",x:"15",y:"5",rx:"1",key:"z38je5"}],["path",{d:"M17 13v3",key:"5l0wba"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]]);var wt=_("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var ba=_("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var ra=_("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);var Za=_("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var qn=_("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var ot=_("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var Fn=_("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var Un=_("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var Sa=_("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);var va=_("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var Ii=_("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var Mi=_("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var Ns=_("ChartSpline",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]]);var kt=_("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Ja=_("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var Ti=_("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Os=_("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);var Ai=_("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var Ps=_("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var Ei=_("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var Di=_("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var $a=_("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);var qs=_("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var Fs=_("FolderCode",[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]]);var Us=_("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var Hn=_("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);var Hs=_("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);var Ri=_("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);var Vs=_("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);var Bi=_("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);var el=_("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);var Gs=_("PanelTop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);var Qs=_("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var la=_("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var tl=_("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var js=_("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var Ys=_("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var Ca=_("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Ks=_("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var al=_("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var Xs=_("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);var Ws=_("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var en=_("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var nl=_("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var zi=_("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);var sa=_("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var xg=qe(Je(),1);var p0=(e)=>{let t,a=new Set,n=(u,c)=>{let f=typeof u==="function"?u(t):u;if(!Object.is(f,t)){let d=t;t=(c!=null?c:typeof f!=="object"||f===null)?f:Object.assign({},t,f),a.forEach((h)=>h(t,d))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>o,subscribe:(u)=>(a.add(u),()=>a.delete(u))},o=t=e(n,i,s);return s},g0=(e)=>e?p0(e):p0;var Zs=qe(Je(),1);var XA=(e)=>e;function WA(e,t=XA){let a=Zs.default.useSyncExternalStore(e.subscribe,Zs.default.useCallback(()=>t(e.getState()),[e,t]),Zs.default.useCallback(()=>t(e.getInitialState()),[e,t]));return Zs.default.useDebugValue(a),a}var x0=(e)=>{let t=g0(e),a=(n)=>WA(t,n);return Object.assign(a,t),a},il=(e)=>e?x0(e):x0;var Js=65,b0="vibek.webui.timelineCompactness";function S0(e){return Math.min(100,Math.max(0,e))}function ZA(){try{let e=globalThis.localStorage?.getItem(b0);if(e===null||e.trim()==="")return Js;let t=Number(e);return Number.isFinite(t)?S0(t):Js}catch{return Js}}function JA(e){try{globalThis.localStorage?.setItem(b0,String(e))}catch{}}var $A=ZA(),Z=il((e,t)=>({ready:!1,transcripts:{market:[],strategy:[]},connection:"connecting",authEvents:{market:[],strategy:[]},backtestResults:{},search:"",timelineCompactness:$A,applyMessage(a){switch(a.type){case"snapshot":{let{transcript:n,...i}=a.snapshot.agents.market,{transcript:r,...l}=a.snapshot.agents.strategy;e({ready:!0,agentStates:{market:i,strategy:l},transcripts:{market:n,strategy:r},strategy:a.snapshot.strategy,lastError:void 0,notification:void 0,notificationAgent:void 0});return}case"agent_state":{let n=t().agentStates;if(!n)return;let i=n[a.agent];if(a.snapshot.revision<i.revision)return;let r=i.pendingUi?.kind==="auth"&&i.pendingUi.id!==a.snapshot.pendingUi?.id;e({agentStates:{...n,[a.agent]:a.snapshot},...r?{authEvents:{...t().authEvents,[a.agent]:[]}}:{}});return}case"agent_transcript_append":Om(e,t,a.agent,(n)=>[...n,a.entry]);return;case"agent_transcript_delta":t().applyTranscriptDeltas([a]);return;case"agent_transcript_update":Om(e,t,a.agent,(n)=>eE(n,a.entry));return;case"agent_transcript_reset":Om(e,t,a.agent,()=>a.entries);return;case"strategy_state":{let n=t().strategy;if(!n||a.strategy.revision<n.revision)return;e({strategy:a.strategy});return}case"backtest_result":e((n)=>({backtestResults:{...n.backtestResults,[a.value.file]:a.value}}));return;case"notification":e({notification:a.notification,notificationAgent:a.agent});return;case"auth_event":e((n)=>({authEvents:{...n.authEvents,[a.agent]:[...n.authEvents[a.agent],a.event].slice(-12)}}));return;case"server_stopping":e({connection:"disconnected",lastError:"WebUI 服务已停止"});return;case"command_result":return}},applyTranscriptDeltas(a){if(a.length===0)return;e((n)=>{if(!n.ready)return n;let i=n.transcripts.market,r=n.transcripts.strategy;for(let l of a)if(l.agent==="market")i=y0(i,l);else r=y0(r,l);if(i===n.transcripts.market&&r===n.transcripts.strategy)return n;return{transcripts:{market:i,strategy:r}}})},setConnection(a){e({connection:a})},setSearch(a){e({search:a})},setTimelineCompactness(a){if(!Number.isFinite(a))return;let n=S0(a);e({timelineCompactness:n}),JA(n)},reportError(a){e({lastError:a})},dismissNotification(a){if(a&&t().notification?.id!==a)return;e({notification:void 0,notificationAgent:void 0})},clearAuthEvents(a){e((n)=>({authEvents:a?{...n.authEvents,[a]:[]}:{market:[],strategy:[]}}))}}));function Om(e,t,a,n){let i=t();if(!i.ready)return;let r=i.transcripts[a],l=n(r);if(l===r)return;e({transcripts:{...i.transcripts,[a]:l}})}function y0(e,t){let a=e.findIndex((s)=>s.id===t.entryId&&s.kind==="assistant"),n=e[a];if(a<0||!n||n.kind!=="assistant")return e;if(!Number.isSafeInteger(t.blockIndex)||t.blockIndex<0||t.blockIndex>n.blocks.length)return e;let i=n.blocks[t.blockIndex];if(i&&i.type!==t.blockType)return e;if(i&&t.delta==="")return e;let r=[...n.blocks];if(i)r[t.blockIndex]={...i,content:`${i.content}${t.delta}`};else r.push({type:t.blockType,content:t.delta});let l=[...e];return l[a]={...n,blocks:r},l}function eE(e,t){let a=e.findIndex((i)=>i.id===t.id);if(a<0)return e;let n=[...e];return n[a]=t,n}var ke=il((e)=>({connection:"connecting",phase:"stopped",tradingDay:null,statusRevision:0,subscriptions:[],timeframe:"1min",bars:[],lastCumulativeVolume:null,loading:!1,applyMessage(t){switch(t.type){case"market_connection":e({connection:t.state});return;case"market_status":e((a)=>({phase:t.phase,tradingDay:t.tradingDay,statusRevision:a.statusRevision+1}));return;case"market_snapshot":e((a)=>v0(a,t.ticks));return;case"market_tick":e((a)=>v0(a,[t.tick]));return;case"subscription_revoked":e((a)=>{let n=new Set(t.instrumentIDs),i=a.selectedInstrumentID!==void 0&&n.has(a.selectedInstrumentID);return{subscriptions:a.subscriptions.filter((r)=>!n.has(r.instrumentID)),...i?{selectedInstrumentID:void 0,bars:[],latest:void 0,lastCumulativeVolume:null,error:"当前合约已不在 daemon 订阅列表中"}:{}}});return;default:return}},setSubscriptions(t){e((a)=>{let n=new Set(t.subscriptions.map((r)=>r.instrumentID)),i=a.selectedInstrumentID&&n.has(a.selectedInstrumentID)?a.selectedInstrumentID:void 0;return{phase:t.phase,tradingDay:t.tradingDay,subscriptions:t.subscriptions,selectedInstrumentID:i,...i?{}:{bars:[],latest:void 0,lastCumulativeVolume:null}}})},selectInstrument(t){let a=t?.toUpperCase();e((n)=>n.selectedInstrumentID===a?n:{selectedInstrumentID:a,bars:[],latest:void 0,lastCumulativeVolume:null,error:void 0})},setTimeframe(t){e((a)=>a.timeframe===t?a:{timeframe:t,bars:[],loading:!1,error:void 0})},setBars(t,a,n){e((i)=>i.selectedInstrumentID!==t||i.timeframe!==a?i:{bars:nE(n,i.bars),loading:!1})},setLoading(t){e({loading:t})},setError(t){e({error:t,loading:!1})}}));function v0(e,t){let{bars:a,latest:n,lastCumulativeVolume:i}=e,r=!1;for(let l of t){if(l.instrumentID!==e.selectedInstrumentID)continue;if(n&&l.eventTimeMs<n.eventTimeMs)continue;let o=(!n||n.tradingDay===l.tradingDay)&&i!==null&&l.volume>=i?l.volume-i:0;a=tE(a,l,o,e.timeframe),n=l,i=l.volume,r=!0}return r?{bars:a,latest:n,lastCumulativeVolume:i}:{}}function tE(e,t,a,n="1min"){let i=aE[n],r=t.aggregationTimeMs??t.eventTimeMs,l=Math.floor(r/(i*1000))*i,s=e.at(-1);if(s&&l<s.barTime)return[...e];if(s?.barTime===l)return[...e.slice(0,-1),{...s,high:Math.max(s.high,t.lastPrice),low:Math.min(s.low,t.lastPrice),close:t.lastPrice,volume:s.volume+a}];return[...e,{code:t.instrumentID,timeframe:n,barTime:l,open:t.lastPrice,high:t.lastPrice,low:t.lastPrice,close:t.lastPrice,volume:a}].slice(-500)}var aE={"1min":60,"5min":300,"15min":900};function nE(e,t){let a=new Map;for(let n of e)a.set(n.barTime,n);for(let n of t){let i=a.get(n.barTime);a.set(n.barTime,i?{...n,open:i.open,high:Math.max(i.high,n.high),low:Math.min(i.low,n.low),volume:Math.max(i.volume,n.volume)}:n)}return[...a.values()].sort((n,i)=>n.barTime-i.barTime).slice(-500)}var L0="vibek.webui.theme",C0="solstice",xc={solstice:{id:"solstice",name:"清曜绿洲",subtitle:"日光 · 清晰 · 专注",browserChrome:"#f4f7f4",swatches:["#167a63","#e5f4ef","#d54b58"],chart:{background:"#ffffff",text:"#5d6c66",grid:"#e8efeb",border:"#d7e1dc",separator:"#c2d0c8",crosshair:"#789188",candleUp:"#d54b58",candleDown:"#1a967a",volumeUp:"rgba(213, 75, 88, 0.52)",volumeDown:"rgba(26, 150, 122, 0.52)",priceLine:"#5d6c66"}},midnight:{id:"midnight",name:"午夜终端",subtitle:"深色 · 低眩光 · 长时间盯盘",browserChrome:"#0b1117",swatches:["#49c5a3","#17232d","#ff6f76"],chart:{background:"#0f171f",text:"#9aaab1",grid:"#20313a",border:"#30434d",separator:"#354954",crosshair:"#8da3ac",candleUp:"#ff6f76",candleDown:"#49c5a3",volumeUp:"rgba(255, 111, 118, 0.5)",volumeDown:"rgba(73, 197, 163, 0.5)",priceLine:"#9aaab1"}},cobalt:{id:"cobalt",name:"极夜钴蓝",subtitle:"冷静 · 精准 · 高对比",browserChrome:"#101822",swatches:["#56b6d9","#1c2c3d","#ff7b74"],chart:{background:"#121e2c",text:"#a8b8c9",grid:"#24374c",border:"#3a5067",separator:"#3d5870",crosshair:"#91afc5",candleUp:"#ff7b74",candleDown:"#68c6a4",volumeUp:"rgba(255, 123, 116, 0.5)",volumeDown:"rgba(104, 198, 164, 0.5)",priceLine:"#a8b8c9"}},ember:{id:"ember",name:"余烬纸张",subtitle:"暖色 · 稳定 · 细节丰富",browserChrome:"#f6f1ea",swatches:["#b85f3b","#f9e6db","#c44945"],chart:{background:"#fffaf4",text:"#78685e",grid:"#efe3d8",border:"#e5d8ca",separator:"#d3c0ad",crosshair:"#9d8372",candleUp:"#c44945",candleDown:"#287d6d",volumeUp:"rgba(196, 73, 69, 0.5)",volumeDown:"rgba(40, 125, 109, 0.5)",priceLine:"#78685e"}}},w0=Object.values(xc);function k0(e){return e!==null&&e in xc}function iE(){try{let e=globalThis.localStorage?.getItem(L0);return k0(e)?e:C0}catch{return C0}}function I0(e){if(typeof document>"u")return;document.documentElement.dataset.theme=e,document.querySelector('meta[name="theme-color"]')?.setAttribute("content",xc[e].browserChrome)}function rE(e){try{globalThis.localStorage?.setItem(L0,e)}catch{}}var M0=iE();I0(M0);var Vn=il((e)=>({theme:M0,setTheme(t){if(!k0(t))return;e({theme:t}),rE(t),I0(t)}}));function Gn(e){return xc[e]}var ef=qe(Je(),1);function Se(){}function yc(){}function T0(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var lE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oE={};function bc(e,t){return((t||oE).jsx?sE:lE).test(e)}var uE=/[ \t\n\f\r]/g;function Pm(e){return typeof e==="object"?e.type==="text"?A0(e.value):!1:A0(e)}function A0(e){return e.replace(uE,"")===""}class Qn{constructor(e,t,a){if(this.normal=t,this.property=e,a)this.space=a}}Qn.prototype.normal={};Qn.prototype.property={};Qn.prototype.space=void 0;function qm(e,t){let a={},n={};for(let i of e)Object.assign(a,i.property),Object.assign(n,i.normal);return new Qn(a,n,t)}function $s(e){return e.toLowerCase()}class it{constructor(e,t){this.attribute=t,this.property=e}}it.prototype.attribute="";it.prototype.booleanish=!1;it.prototype.boolean=!1;it.prototype.commaOrSpaceSeparated=!1;it.prototype.commaSeparated=!1;it.prototype.defined=!1;it.prototype.mustUseProperty=!1;it.prototype.number=!1;it.prototype.overloadedBoolean=!1;it.prototype.property="";it.prototype.spaceSeparated=!1;it.prototype.space=void 0;var eo={};Ex(eo,{boolean:()=>K,booleanish:()=>De,commaOrSpaceSeparated:()=>It,commaSeparated:()=>tn,number:()=>N,overloadedBoolean:()=>Sc,spaceSeparated:()=>ce});var cE=0,K=_i(),De=_i(),Sc=_i(),N=_i(),ce=_i(),tn=_i(),It=_i();function _i(){return 2**++cE}var Fm=Object.keys(eo);class rl extends it{constructor(e,t,a,n){let i=-1;super(e,t);if(E0(this,"space",n),typeof a==="number")while(++i<Fm.length){let r=Fm[i];E0(this,Fm[i],(a&eo[r])===eo[r])}}}rl.prototype.defined=!0;function E0(e,t,a){if(a)e[t]=a}function Jt(e){let t={},a={};for(let[n,i]of Object.entries(e.properties)){let r=new rl(n,e.transform(e.attributes||{},n),i,e.space);if(e.mustUseProperty&&e.mustUseProperty.includes(n))r.mustUseProperty=!0;t[n]=r,a[$s(n)]=n,a[$s(r.attribute)]=n}return new Qn(t,a,e.space)}var Um=Jt({properties:{ariaActiveDescendant:null,ariaAtomic:De,ariaAutoComplete:null,ariaBusy:De,ariaChecked:De,ariaColCount:N,ariaColIndex:N,ariaColSpan:N,ariaControls:ce,ariaCurrent:null,ariaDescribedBy:ce,ariaDetails:null,ariaDisabled:De,ariaDropEffect:ce,ariaErrorMessage:null,ariaExpanded:De,ariaFlowTo:ce,ariaGrabbed:De,ariaHasPopup:null,ariaHidden:De,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ce,ariaLevel:N,ariaLive:null,ariaModal:De,ariaMultiLine:De,ariaMultiSelectable:De,ariaOrientation:null,ariaOwns:ce,ariaPlaceholder:null,ariaPosInSet:N,ariaPressed:De,ariaReadOnly:De,ariaRelevant:null,ariaRequired:De,ariaRoleDescription:ce,ariaRowCount:N,ariaRowIndex:N,ariaRowSpan:N,ariaSelected:De,ariaSetSize:N,ariaSort:null,ariaValueMax:N,ariaValueMin:N,ariaValueNow:N,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vc(e,t){return t in e?e[t]:t}function Cc(e,t){return vc(e,t.toLowerCase())}var D0=Jt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tn,acceptCharset:ce,accessKey:ce,action:null,allow:null,allowFullScreen:K,allowPaymentRequest:K,allowUserMedia:K,alpha:K,alt:null,as:null,async:K,autoCapitalize:null,autoComplete:ce,autoFocus:K,autoPlay:K,blocking:ce,capture:null,charSet:null,checked:K,cite:null,className:ce,closedBy:null,colorSpace:null,cols:N,colSpan:N,command:null,commandFor:null,content:null,contentEditable:De,controls:K,controlsList:ce,coords:N|tn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:K,defer:K,dir:null,dirName:null,disabled:K,download:Sc,draggable:De,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:K,formTarget:null,headers:ce,height:N,hidden:Sc,high:N,href:null,hrefLang:null,htmlFor:ce,httpEquiv:ce,id:null,imageSizes:null,imageSrcSet:null,inert:K,inputMode:null,integrity:null,is:null,isMap:K,itemId:null,itemProp:ce,itemRef:ce,itemScope:K,itemType:ce,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:K,low:N,manifest:null,max:null,maxLength:N,media:null,method:null,min:null,minLength:N,multiple:K,muted:K,name:null,nonce:null,noModule:K,noValidate:K,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:K,optimum:N,pattern:null,ping:ce,placeholder:null,playsInline:K,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:K,referrerPolicy:null,rel:ce,required:K,reversed:K,rows:N,rowSpan:N,sandbox:ce,scope:null,scoped:K,seamless:K,selected:K,shadowRootClonable:K,shadowRootCustomElementRegistry:K,shadowRootDelegatesFocus:K,shadowRootMode:null,shadowRootSerializable:K,shape:null,size:N,sizes:null,slot:null,span:N,spellCheck:De,src:null,srcDoc:null,srcLang:null,srcSet:null,start:N,step:null,style:null,tabIndex:N,target:null,title:null,translate:null,type:null,typeMustMatch:K,useMap:null,value:De,width:N,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ce,axis:null,background:null,bgColor:null,border:N,borderColor:null,bottomMargin:N,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:K,declare:K,event:null,face:null,frame:null,frameBorder:null,hSpace:N,leftMargin:N,link:null,longDesc:null,lowSrc:null,marginHeight:N,marginWidth:N,noResize:K,noHref:K,noShade:K,noWrap:K,object:null,profile:null,prompt:null,rev:null,rightMargin:N,rules:null,scheme:null,scrolling:De,standby:null,summary:null,text:null,topMargin:N,valueType:null,version:null,vAlign:null,vLink:null,vSpace:N,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:K,disablePictureInPicture:K,disableRemotePlayback:K,exportParts:tn,part:ce,prefix:null,property:null,results:N,security:null,unselectable:null},space:"html",transform:Cc});var R0=Jt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:It,accentHeight:N,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:N,amplitude:N,arabicForm:null,ascent:N,attributeName:null,attributeType:null,azimuth:N,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:N,by:null,calcMode:null,capHeight:N,className:ce,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:N,diffuseConstant:N,direction:null,display:null,dur:null,divisor:N,dominantBaseline:null,download:K,dx:null,dy:null,edgeMode:null,editable:null,elevation:N,enableBackground:null,end:null,event:null,exponent:N,externalResourcesRequired:null,fill:null,fillOpacity:N,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:tn,g2:tn,glyphName:tn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:N,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:N,horizOriginX:N,horizOriginY:N,id:null,ideographic:N,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:N,k:N,k1:N,k2:N,k3:N,k4:N,kernelMatrix:It,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:N,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:N,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:N,overlineThickness:N,paintOrder:null,panose1:null,path:null,pathLength:N,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ce,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:N,pointsAtY:N,pointsAtZ:N,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:It,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:It,rev:It,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:It,requiredFeatures:It,requiredFonts:It,requiredFormats:It,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:N,specularExponent:N,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:N,strikethroughThickness:N,string:null,stroke:null,strokeDashArray:It,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:N,strokeOpacity:N,strokeWidth:null,style:null,surfaceScale:N,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:It,tabIndex:N,tableValues:null,target:null,targetX:N,targetY:N,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:It,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:N,underlineThickness:N,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:N,values:null,vAlphabetic:N,vMathematical:N,vectorEffect:null,vHanging:N,vIdeographic:N,version:null,vertAdvY:N,vertOriginX:N,vertOriginY:N,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:N,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vc});var Hm=Jt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Vm=Jt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cc});var Gm=Jt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Qm={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var fE=/[A-Z]/g,B0=/-[a-z]/g,dE=/^data[-\w.:]+$/i;function jm(e,t){let a=$s(t),n=t,i=it;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&dE.test(t)){if(t.charAt(4)==="-"){let r=t.slice(5).replace(B0,mE);n="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{let r=t.slice(4);if(!B0.test(r)){let l=r.replace(fE,hE);if(l.charAt(0)!=="-")l="-"+l;t="data"+l}}i=rl}return new i(n,t)}function hE(e){return"-"+e.toLowerCase()}function mE(e){return e.charAt(1).toUpperCase()}var z0=qm([Um,D0,Hm,Vm,Gm],"html"),Lc=qm([Um,R0,Hm,Vm,Gm],"svg");function _0(e){return e.join(" ").trim()}var J0=qe(K0(),1);var wc=X0("end"),ll=X0("start");function X0(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line==="number"&&n.line>0&&typeof n.column==="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==="number"&&n.offset>-1?n.offset:void 0}}}function Xm(e){let t=ll(e),a=wc(e);if(t&&a)return{start:t,end:a}}function jn(e){if(!e||typeof e!=="object")return"";if("position"in e||"type"in e)return W0(e.position);if("start"in e||"end"in e)return W0(e);if("line"in e||"column"in e)return Wm(e);return""}function Wm(e){return Z0(e&&e.line)+":"+Z0(e&&e.column)}function W0(e){return Wm(e&&e.start)+"-"+Wm(e&&e.end)}function Z0(e){return e&&typeof e==="number"?e:1}class Ge extends Error{constructor(e,t,a){super();if(typeof t==="string")a=t,t=void 0;let n="",i={},r=!1;if(t)if("line"in t&&"column"in t)i={place:t};else if("start"in t&&"end"in t)i={place:t};else if("type"in t)i={ancestors:[t],place:t.position};else i={...t};if(typeof e==="string")n=e;else if(!i.cause&&e)r=!0,n=e.message,i.cause=e;if(!i.ruleId&&!i.source&&typeof a==="string"){let s=a.indexOf(":");if(s===-1)i.ruleId=a;else i.source=a.slice(0,s),i.ruleId=a.slice(s+1)}if(!i.place&&i.ancestors&&i.ancestors){let s=i.ancestors[i.ancestors.length-1];if(s)i.place=s.position}let l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=l?l.line:void 0,this.name=jn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=r&&i.cause&&typeof i.cause.stack==="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;var Zm={}.hasOwnProperty,FE=new Map,UE=/[A-Z]/g,HE=new Set(["table","tbody","thead","tfoot","tr"]),VE=new Set(["td","th"]),$0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jm(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");n=ZE(a,t.jsxDEV)}else{if(typeof t.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");n=WE(a,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lc:z0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},r=e1(i,e,void 0);if(r&&typeof r!=="string")return r;return i.create(e,i.Fragment,{children:r||void 0},void 0)}function e1(e,t,a){if(t.type==="element")return GE(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return YE(e,t,a);if(t.type==="mdxjsEsm")return jE(e,t);if(t.type==="root")return KE(e,t,a);if(t.type==="text")return XE(e,t)}function GE(e,t,a){let n=e.schema,i=n;if(t.tagName.toLowerCase()==="svg"&&n.space==="html")i=Lc,e.schema=i;e.ancestors.push(t);let r=a1(e,t.tagName,!1),l=JE(e,t),s=ep(e,t);if(HE.has(t.tagName))s=s.filter(function(o){return typeof o==="string"?!Pm(o):!0});return t1(e,l,r,t),$m(l,s),e.ancestors.pop(),e.schema=n,e.create(t,r,l,a)}function QE(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return Se(n.type==="ExpressionStatement"),e.evaluater.evaluateExpression(n.expression)}ao(e,t.position)}function jE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ao(e,t.position)}function YE(e,t,a){let n=e.schema,i=n;if(t.name==="svg"&&n.space==="html")i=Lc,e.schema=i;e.ancestors.push(t);let r=t.name===null?e.Fragment:a1(e,t.name,!0),l=$E(e,t),s=ep(e,t);return t1(e,l,r,t),$m(l,s),e.ancestors.pop(),e.schema=n,e.create(t,r,l,a)}function KE(e,t,a){let n={};return $m(n,ep(e,t)),e.create(t,e.Fragment,n,a)}function XE(e,t){return t.value}function t1(e,t,a,n){if(typeof a!=="string"&&a!==e.Fragment&&e.passNode)t.node=n}function $m(e,t){if(t.length>0){let a=t.length>1?t:t[0];if(a)e.children=a}}function WE(e,t,a){return n;function n(i,r,l,s){let u=Array.isArray(l.children)?a:t;return s?u(r,l,s):u(r,l)}}function ZE(e,t){return a;function a(n,i,r,l){let s=Array.isArray(r.children),o=ll(n);return t(i,r,l,s,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function JE(e,t){let a={},n,i;for(i in t.properties)if(i!=="children"&&Zm.call(t.properties,i)){let r=eD(e,i,t.properties[i]);if(r){let[l,s]=r;if(e.tableCellAlignToStyle&&l==="align"&&typeof s==="string"&&VE.has(t.tagName))n=s;else a[l]=s}}if(n){let r=a.style||(a.style={});r[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function $E(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let r=n.data.estree.body[0];Se(r.type==="ExpressionStatement");let l=r.expression;Se(l.type==="ObjectExpression");let s=l.properties[0];Se(s.type==="SpreadElement"),Object.assign(a,e.evaluater.evaluateExpression(s.argument))}else ao(e,t.position);else{let i=n.name,r;if(n.value&&typeof n.value==="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let s=n.value.data.estree.body[0];Se(s.type==="ExpressionStatement"),r=e.evaluater.evaluateExpression(s.expression)}else ao(e,t.position);else r=n.value===null?!0:n.value;a[i]=r}return a}function ep(e,t){let a=[],n=-1,i=e.passKeys?new Map:FE;while(++n<t.children.length){let r=t.children[n],l;if(e.passKeys){let o=r.type==="element"?r.tagName:r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement"?r.name:void 0;if(o){let u=i.get(o)||0;l=o+"-"+u,i.set(o,u+1)}}let s=e1(e,r,l);if(s!==void 0)a.push(s)}return a}function eD(e,t,a){let n=jm(e.schema,t);if(a===null||a===void 0||typeof a==="number"&&Number.isNaN(a))return;if(Array.isArray(a))a=n.commaSeparated?T0(a):_0(a);if(n.property==="style"){let i=typeof a==="object"?a:tD(e,String(a));if(e.stylePropertyNameCase==="css")i=aD(i);return["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?Qm[n.property]||n.property:n.attribute,a]}function tD(e,t){try{return J0.default(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,i=new Ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=$0+"#cannot-parse-style-attribute",i}}function a1(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let i=t.split("."),r=-1,l;while(++r<i.length){let s=bc(i[r])?{type:"Identifier",name:i[r]}:{type:"Literal",value:i[r]};l=l?{type:"MemberExpression",object:l,property:s,computed:Boolean(r&&s.type==="Literal"),optional:!1}:s}Se(l,"always a result"),n=l}else n=bc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let i=n.value;return Zm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);ao(e)}function ao(e,t){let a=new Ge("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=$0+"#cannot-handle-mdx-estrees-without-createevaluater",a}function aD(e){let t={},a;for(a in e)if(Zm.call(e,a))t[nD(a)]=e[a];return t}function nD(e){let t=e.replace(UE,iD);if(t.slice(0,3)==="ms-")t="-"+t;return t}function iD(e){return"-"+e.toLowerCase()}var no={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var rD=Symbol.for("react.transitional.element"),lD=Symbol.for("react.fragment");function n1(e,t,a){var n=null;if(a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:rD,type:e,key:n,ref:t!==void 0?t:null,props:a}}var ht=lD,m=n1,C=n1;var Dp=qe(Je(),1);var sD={};function Oi(e,t){let a=t||sD,n=typeof a.includeImageAlt==="boolean"?a.includeImageAlt:!0,i=typeof a.includeHtml==="boolean"?a.includeHtml:!0;return r1(e,n,i)}function r1(e,t,a){if(oD(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return i1(e.children,t,a)}if(Array.isArray(e))return i1(e,t,a);return""}function i1(e,t,a){let n=[],i=-1;while(++i<e.length)n[i]=r1(e[i],t,a);return n.join("")}function oD(e){return Boolean(e&&typeof e==="object")}var l1=document.createElement("i");function sl(e){let t="&"+e+";";l1.innerHTML=t;let a=l1.textContent;if(a.charCodeAt(a.length-1)===59&&e!=="semi")return!1;return a===t?!1:a}function Pe(e,t,a,n){let i=e.length,r=0,l;if(t<0)t=-t>i?0:i+t;else t=t>i?i:t;if(a=a>0?a:0,n.length<1e4)l=Array.from(n),l.unshift(t,a),e.splice(...l);else{if(a)e.splice(t,a);while(r<n.length)l=n.slice(r,r+1e4),l.unshift(t,0),e.splice(...l),r+=1e4,t+=1e4}}function mt(e,t){if(e.length>0)return Pe(e,e.length,0,t),e;return t}var s1={}.hasOwnProperty;function kc(e){let t={},a=-1;while(++a<e.length)uD(t,e[a]);return t}function uD(e,t){let a;for(a in t){let i=(s1.call(e,a)?e[a]:void 0)||(e[a]={}),r=t[a],l;if(r)for(l in r){if(!s1.call(i,l))i[l]=[];let s=r[l];cD(i[l],Array.isArray(s)?s:s?[s]:[])}}}function cD(e,t){let a=-1,n=[];while(++a<t.length)(t[a].add==="after"?e:n).push(t[a]);Pe(e,0,0,n)}function Ic(e,t){let a=Number.parseInt(e,t);if(a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111)return"�";return String.fromCodePoint(a)}function ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Ye=Yn(/[A-Za-z]/),Re=Yn(/[\dA-Za-z]/),o1=Yn(/[#-'*+\--9=?A-Z^-~]/);function Pi(e){return e!==null&&(e<32||e===127)}var io=Yn(/\d/),u1=Yn(/[\dA-Fa-f]/),c1=Yn(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function ee(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var qi=Yn(/\p{P}|\p{S}/u),La=Yn(/\s/);function Yn(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function $t(e){let t=[],a=-1,n=0,i=0;while(++a<e.length){let r=e.charCodeAt(a),l="";if(r===37&&Re(e.charCodeAt(a+1))&&Re(e.charCodeAt(a+2)))i=2;else if(r<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(r)))l=String.fromCharCode(r)}else if(r>55295&&r<57344){let s=e.charCodeAt(a+1);if(r<56320&&s>56319&&s<57344)l=String.fromCharCode(r,s),i=1;else l="�"}else l=String.fromCharCode(r);if(l)t.push(e.slice(n,a),encodeURIComponent(l)),n=a+i+1,l="";if(i)a+=i,i=0}return t.join("")+e.slice(n)}function G(e,t,a,n){let i=n?n-1:Number.POSITIVE_INFINITY,r=0;return l;function l(o){if(Q(o))return e.enter(a),s(o);return t(o)}function s(o){if(Q(o)&&r++<i)return e.consume(o),s;return e.exit(a),t(o)}}var f1={tokenize:fD};function fD(e){let t=e.attempt(this.parser.constructs.contentInitial,n,i),a;return t;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),G(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),r(s)}function r(s){let o=e.enter("chunkText",{contentType:"text",previous:a});if(a)a.next=o;return a=o,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}if(U(s))return e.consume(s),e.exit("chunkText"),r;return e.consume(s),l}}var h1={tokenize:dD},d1={tokenize:hD};function dD(e){let t=this,a=[],n=0,i,r,l;return s;function s(y){if(n<a.length){let w=a[n];return t.containerState=w[1],e.attempt(w[0].continuation,o,u)(y)}return u(y)}function o(y){if(n++,t.containerState._closeFlow){if(t.containerState._closeFlow=void 0,i)x();let w=t.events.length,T=w,I;while(T--)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){I=t.events[T][1].end;break}p(n);let M=w;while(M<t.events.length)t.events[M][1].end={...I},M++;return Pe(t.events,T+1,0,t.events.slice(w)),t.events.length=M,u(y)}return s(y)}function u(y){if(n===a.length){if(!i)return d(y);if(i.currentConstruct&&i.currentConstruct.concrete)return g(y);t.interrupt=Boolean(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(d1,c,f)(y)}function c(y){if(i)x();return p(n),d(y)}function f(y){return t.parser.lazy[t.now().line]=n!==a.length,l=t.now().offset,g(y)}function d(y){return t.containerState={},e.attempt(d1,h,g)(y)}function h(y){return n++,a.push([t.currentConstruct,t.containerState]),d(y)}function g(y){if(y===null){if(i)x();p(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),b(y)}function b(y){if(y===null){S(e.exit("chunkFlow"),!0),p(0),e.consume(y);return}if(U(y))return e.consume(y),S(e.exit("chunkFlow")),n=0,t.interrupt=void 0,s;return e.consume(y),b}function S(y,w){let T=t.sliceStream(y);if(w)T.push(null);if(y.previous=r,r)r.next=y;if(r=y,i.defineSkip(y.start),i.write(T),t.parser.lazy[y.start.line]){let I=i.events.length;while(I--)if(i.events[I][1].start.offset<l&&(!i.events[I][1].end||i.events[I][1].end.offset>l))return;let M=t.events.length,R=M,A,v;while(R--)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(A){v=t.events[R][1].end;break}A=!0}p(n),I=M;while(I<t.events.length)t.events[I][1].end={...v},I++;Pe(t.events,R+1,0,t.events.slice(M)),t.events.length=I}}function p(y){let w=a.length;while(w-- >y){let T=a[w];t.containerState=T[1],T[0].exit.call(t,e)}a.length=y}function x(){i.write([null]),r=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hD(e,t,a){return G(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function an(e){if(e===null||ee(e)||La(e))return 1;if(qi(e))return 2}function Kn(e,t,a){let n=[],i=-1;while(++i<e.length){let r=e[i].resolveAll;if(r&&!n.includes(r))t=r(t,a),n.push(r)}return t}var ro={name:"attention",resolveAll:mD,tokenize:pD};function mD(e,t){let a=-1,n,i,r,l,s,o,u,c;while(++a<e.length)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){n=a;while(n--)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let f={...e[n][1].end},d={...e[a][1].start};if(m1(f,-o),m1(d,o),l={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:d},r={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},i={type:o>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[n][1].end={...l.start},e[a][1].start={...s.end},u=[],e[n][1].end.offset-e[n][1].start.offset)u=mt(u,[["enter",e[n][1],t],["exit",e[n][1],t]]);if(u=mt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",r,t]]),u=mt(u,Kn(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=mt(u,[["exit",r,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[a][1].end.offset-e[a][1].start.offset)c=2,u=mt(u,[["enter",e[a][1],t],["exit",e[a][1],t]]);else c=0;Pe(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}a=-1;while(++a<e.length)if(e[a][1].type==="attentionSequence")e[a][1].type="data";return e}function pD(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,i=an(n),r;return l;function l(o){return r=o,e.enter("attentionSequence"),s(o)}function s(o){if(o===r)return e.consume(o),s;let u=e.exit("attentionSequence"),c=an(o),f=!c||c===2&&i||a.includes(o),d=!i||i===2&&c||a.includes(n);return u._open=Boolean(r===42?f:f&&(i||!d)),u._close=Boolean(r===42?d:d&&(c||!f)),t(o)}}function m1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var tp={name:"autolink",tokenize:gD};function gD(e,t,a){let n=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r}function r(h){if(Ye(h))return e.consume(h),l;if(h===64)return a(h);return u(h)}function l(h){if(h===43||h===45||h===46||Re(h))return n=1,s(h);return u(h)}function s(h){if(h===58)return e.consume(h),n=0,o;if((h===43||h===45||h===46||Re(h))&&n++<32)return e.consume(h),s;return n=0,u(h)}function o(h){if(h===62)return e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t;if(h===null||h===32||h===60||Pi(h))return a(h);return e.consume(h),o}function u(h){if(h===64)return e.consume(h),c;if(o1(h))return e.consume(h),u;return a(h)}function c(h){return Re(h)?f(h):a(h)}function f(h){if(h===46)return e.consume(h),n=0,c;if(h===62)return e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t;return d(h)}function d(h){if((h===45||Re(h))&&n++<63){let g=h===45?d:f;return e.consume(h),g}return a(h)}}var wa={partial:!0,tokenize:xD};function xD(e,t,a){return n;function n(r){return Q(r)?G(e,i,"linePrefix")(r):i(r)}function i(r){return r===null||U(r)?t(r):a(r)}}var Mc={continuation:{tokenize:bD},exit:SD,name:"blockQuote",tokenize:yD};function yD(e,t,a){let n=this;return i;function i(l){if(l===62){let s=n.containerState;if(!s.open)e.enter("blockQuote",{_container:!0}),s.open=!0;return e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),r}return a(l)}function r(l){if(Q(l))return e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t;return e.exit("blockQuotePrefix"),t(l)}}function bD(e,t,a){let n=this;return i;function i(l){if(Q(l))return G(e,r,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l);return r(l)}function r(l){return e.attempt(Mc,t,a)(l)}}function SD(e){e.exit("blockQuote")}var Tc={name:"characterEscape",tokenize:vD};function vD(e,t,a){return n;function n(r){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(r),e.exit("escapeMarker"),i}function i(r){if(c1(r))return e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t;return a(r)}}var Ac={name:"characterReference",tokenize:CD};function CD(e,t,a){let n=this,i=0,r,l;return s;function s(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),o}function o(f){if(f===35)return e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u;return e.enter("characterReferenceValue"),r=31,l=Re,c(f)}function u(f){if(f===88||f===120)return e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=u1,c;return e.enter("characterReferenceValue"),r=7,l=io,c(f)}function c(f){if(f===59&&i){let d=e.exit("characterReferenceValue");if(l===Re&&!sl(n.sliceSerialize(d)))return a(f);return e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t}if(l(f)&&i++<r)return e.consume(f),c;return a(f)}}var p1={partial:!0,tokenize:wD},Ec={concrete:!0,name:"codeFenced",tokenize:LD};function LD(e,t,a){let n=this,i={partial:!0,tokenize:T},r=0,l=0,s;return o;function o(I){return u(I)}function u(I){let M=n.events[n.events.length-1];return r=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,s=I,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(I)}function c(I){if(I===s)return l++,e.consume(I),c;if(l<3)return a(I);return e.exit("codeFencedFenceSequence"),Q(I)?G(e,f,"whitespace")(I):f(I)}function f(I){if(I===null||U(I))return e.exit("codeFencedFence"),n.interrupt?t(I):e.check(p1,b,w)(I);return e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(I)}function d(I){if(I===null||U(I))return e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(I);if(Q(I))return e.exit("chunkString"),e.exit("codeFencedFenceInfo"),G(e,h,"whitespace")(I);if(I===96&&I===s)return a(I);return e.consume(I),d}function h(I){if(I===null||U(I))return f(I);return e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(I)}function g(I){if(I===null||U(I))return e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(I);if(I===96&&I===s)return a(I);return e.consume(I),g}function b(I){return e.attempt(i,w,S)(I)}function S(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p}function p(I){return r>0&&Q(I)?G(e,x,"linePrefix",r+1)(I):x(I)}function x(I){if(I===null||U(I))return e.check(p1,b,w)(I);return e.enter("codeFlowValue"),y(I)}function y(I){if(I===null||U(I))return e.exit("codeFlowValue"),x(I);return e.consume(I),y}function w(I){return e.exit("codeFenced"),t(I)}function T(I,M,R){let A=0;return v;function v(V){return I.enter("lineEnding"),I.consume(V),I.exit("lineEnding"),F}function F(V){return I.enter("codeFencedFence"),Q(V)?G(I,H,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):H(V)}function H(V){if(V===s)return I.enter("codeFencedFenceSequence"),B(V);return R(V)}function B(V){if(V===s)return A++,I.consume(V),B;if(A>=l)return I.exit("codeFencedFenceSequence"),Q(V)?G(I,q,"whitespace")(V):q(V);return R(V)}function q(V){if(V===null||U(V))return I.exit("codeFencedFence"),M(V);return R(V)}}}function wD(e,t,a){let n=this;return i;function i(l){if(l===null)return a(l);return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r}function r(l){return n.parser.lazy[n.now().line]?a(l):t(l)}}var lo={name:"codeIndented",tokenize:ID},kD={partial:!0,tokenize:MD};function ID(e,t,a){let n=this;return i;function i(u){return e.enter("codeIndented"),G(e,r,"linePrefix",5)(u)}function r(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?l(u):a(u)}function l(u){if(u===null)return o(u);if(U(u))return e.attempt(kD,l,o)(u);return e.enter("codeFlowValue"),s(u)}function s(u){if(u===null||U(u))return e.exit("codeFlowValue"),l(u);return e.consume(u),s}function o(u){return e.exit("codeIndented"),t(u)}}function MD(e,t,a){let n=this;return i;function i(l){if(n.parser.lazy[n.now().line])return a(l);if(U(l))return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i;return G(e,r,"linePrefix",5)(l)}function r(l){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):U(l)?i(l):a(l)}}var ap={name:"codeText",previous:AD,resolve:TD,tokenize:ED};function TD(e){let t=e.length-4,a=3,n,i;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){n=a;while(++n<t)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}n=a-1,t++;while(++n<=t)if(i===void 0){if(n!==t&&e[n][1].type!=="lineEnding")i=n}else if(n===t||e[n][1].type==="lineEnding"){if(e[i][1].type="codeTextData",n!==i+2)e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2;i=void 0}return e}function AD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ED(e,t,a){let n=this,i=0,r,l;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){if(d===96)return e.consume(d),i++,o;return e.exit("codeTextSequence"),u(d)}function u(d){if(d===null)return a(d);if(d===32)return e.enter("space"),e.consume(d),e.exit("space"),u;if(d===96)return l=e.enter("codeTextSequence"),r=0,f(d);if(U(d))return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u;return e.enter("codeTextData"),c(d)}function c(d){if(d===null||d===32||d===96||U(d))return e.exit("codeTextData"),u(d);return e.consume(d),c}function f(d){if(d===96)return e.consume(d),r++,f;if(r===i)return e.exit("codeTextSequence"),e.exit("codeText"),t(d);return l.type="codeTextData",c(d)}}class np{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(e<this.left.length)return this.left[e];return this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let a=t===null||t===void 0?Number.POSITIVE_INFINITY:t;if(a<this.left.length)return this.left.slice(e,a);if(e>this.left.length)return this.right.slice(this.right.length-a+this.left.length,this.right.length-e+this.left.length).reverse();return this.left.slice(e).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(e,t,a){let n=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);if(a)so(this.left,a);return i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),so(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),so(this.right,e.reverse())}setCursor(e){if(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)return;if(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);so(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);so(this.left,t.reverse())}}}function so(e,t){let a=0;if(t.length<1e4)e.push(...t);else while(a<t.length)e.push(...t.slice(a,a+1e4)),a+=1e4}function Dc(e){let t={},a=-1,n,i,r,l,s,o,u,c=new np(e);while(++a<c.length){while(a in t)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"){if(o=n[1]._tokenizer.events,r=0,r<o.length&&o[r][1].type==="lineEndingBlank")r+=2;if(r<o.length&&o[r][1].type==="content")while(++r<o.length){if(o[r][1].type==="content")break;if(o[r][1].type==="chunkText")o[r][1]._isInFirstContentOfListItem=!0,r++}}if(n[0]==="enter"){if(n[1].contentType)Object.assign(t,DD(c,a)),a=t[a],u=!0}else if(n[1]._container){r=a,i=void 0;while(r--)if(l=c.get(r),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank"){if(l[0]==="enter"){if(i)c.get(i)[1].type="lineEndingBlank";l[1].type="lineEnding",i=r}}else if(l[1].type==="linePrefix"||l[1].type==="listItemIndent");else break;if(i)n[1].end={...c.get(i)[1].start},s=c.slice(i,a),s.unshift(n),c.splice(i,a-i+1,s)}}return Pe(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function DD(e,t){let a=e.get(t)[1],n=e.get(t)[2],i=t-1,r=[],l=a._tokenizer;if(!l){if(l=n.parser[a.contentType](a.start),a._contentTypeTextTrailing)l._contentTypeTextTrailing=!0}let s=l.events,o=[],u={},c,f,d=-1,h=a,g=0,b=0,S=[b];while(h){while(e.get(++i)[1]!==h);if(r.push(i),!h._tokenizer){if(c=n.sliceStream(h),!h.next)c.push(null);if(f)l.defineSkip(h.start);if(h._isInFirstContentOfListItem)l._gfmTasklistFirstContentOfListItem=!0;if(l.write(c),h._isInFirstContentOfListItem)l._gfmTasklistFirstContentOfListItem=void 0}f=h,h=h.next}h=a;while(++d<s.length)if(s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line)b=d+1,S.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next;if(l.events=[],h)h._tokenizer=void 0,h.previous=void 0;else S.pop();d=S.length;while(d--){let p=s.slice(S[d],S[d+1]),x=r.pop();o.push([x,x+p.length-1]),e.splice(x,2,p)}o.reverse(),d=-1;while(++d<o.length)u[g+o[d][0]]=g+o[d][1],g+=o[d][1]-o[d][0]-1;return u}var ip={resolve:BD,tokenize:zD},RD={partial:!0,tokenize:_D};function BD(e){return Dc(e),e}function zD(e,t){let a;return n;function n(s){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){if(s===null)return r(s);if(U(s))return e.check(RD,l,r)(s);return e.consume(s),i}function r(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function l(s){return e.consume(s),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,i}}function _D(e,t,a){let n=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),G(e,r,"linePrefix")}function r(l){if(l===null||U(l))return a(l);let s=n.events[n.events.length-1];if(!n.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4)return t(l);return e.interrupt(n.parser.constructs.flow,a,t)(l)}}function Rc(e,t,a,n,i,r,l,s,o){let u=o||Number.POSITIVE_INFINITY,c=0;return f;function f(p){if(p===60)return e.enter(n),e.enter(i),e.enter(r),e.consume(p),e.exit(r),d;if(p===null||p===32||p===41||Pi(p))return a(p);return e.enter(n),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(p)}function d(p){if(p===62)return e.enter(r),e.consume(p),e.exit(r),e.exit(i),e.exit(n),t;return e.enter(s),e.enter("chunkString",{contentType:"string"}),h(p)}function h(p){if(p===62)return e.exit("chunkString"),e.exit(s),d(p);if(p===null||p===60||U(p))return a(p);return e.consume(p),p===92?g:h}function g(p){if(p===60||p===62||p===92)return e.consume(p),h;return h(p)}function b(p){if(!c&&(p===null||p===41||ee(p)))return e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(n),t(p);if(c<u&&p===40)return e.consume(p),c++,b;if(p===41)return e.consume(p),c--,b;if(p===null||p===32||p===40||Pi(p))return a(p);return e.consume(p),p===92?S:b}function S(p){if(p===40||p===41||p===92)return e.consume(p),b;return b(p)}}function Bc(e,t,a,n,i,r){let l=this,s=0,o;return u;function u(h){return e.enter(n),e.enter(i),e.consume(h),e.exit(i),e.enter(r),c}function c(h){if(s>999||h===null||h===91||h===93&&!o||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs)return a(h);if(h===93)return e.exit(r),e.enter(i),e.consume(h),e.exit(i),e.exit(n),t;if(U(h))return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c;return e.enter("chunkString",{contentType:"string"}),f(h)}function f(h){if(h===null||h===91||h===93||U(h)||s++>999)return e.exit("chunkString"),c(h);if(e.consume(h),!o)o=!Q(h);return h===92?d:f}function d(h){if(h===91||h===92||h===93)return e.consume(h),s++,f;return f(h)}}function zc(e,t,a,n,i,r){let l;return s;function s(d){if(d===34||d===39||d===40)return e.enter(n),e.enter(i),e.consume(d),e.exit(i),l=d===40?41:d,o;return a(d)}function o(d){if(d===l)return e.enter(i),e.consume(d),e.exit(i),e.exit(n),t;return e.enter(r),u(d)}function u(d){if(d===l)return e.exit(r),o(l);if(d===null)return a(d);if(U(d))return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),G(e,u,"linePrefix");return e.enter("chunkString",{contentType:"string"}),c(d)}function c(d){if(d===l||d===null||U(d))return e.exit("chunkString"),u(d);return e.consume(d),d===92?f:c}function f(d){if(d===l||d===92)return e.consume(d),c;return c(d)}}function Fi(e,t){let a;return n;function n(i){if(U(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a=!0,n;if(Q(i))return G(e,n,a?"linePrefix":"lineSuffix")(i);return t(i)}}var rp={name:"definition",tokenize:OD},ND={partial:!0,tokenize:PD};function OD(e,t,a){let n=this,i;return r;function r(h){return e.enter("definition"),l(h)}function l(h){return Bc.call(n,e,s,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){if(i=ut(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),h===58)return e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),o;return a(h)}function o(h){return ee(h)?Fi(e,u)(h):u(h)}function u(h){return Rc(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(ND,f,f)(h)}function f(h){return Q(h)?G(e,d,"whitespace")(h):d(h)}function d(h){if(h===null||U(h))return e.exit("definition"),n.parser.defined.push(i),t(h);return a(h)}}function PD(e,t,a){return n;function n(s){return ee(s)?Fi(e,i)(s):a(s)}function i(s){return zc(e,r,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function r(s){return Q(s)?G(e,l,"whitespace")(s):l(s)}function l(s){return s===null||U(s)?t(s):a(s)}}var lp={name:"hardBreakEscape",tokenize:qD};function qD(e,t,a){return n;function n(r){return e.enter("hardBreakEscape"),e.consume(r),i}function i(r){if(U(r))return e.exit("hardBreakEscape"),t(r);return a(r)}}var sp={name:"headingAtx",resolve:FD,tokenize:UD};function FD(e,t){let a=e.length-2,n=3,i,r;if(e[n][1].type==="whitespace")n+=2;if(a-2>n&&e[a][1].type==="whitespace")a-=2;if(e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace"))a-=n+1===a?2:4;if(a>n)i={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},r={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},Pe(e,n,a-n+1,[["enter",i,t],["enter",r,t],["exit",r,t],["exit",i,t]]);return e}function UD(e,t,a){let n=0;return i;function i(c){return e.enter("atxHeading"),r(c)}function r(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){if(c===35&&n++<6)return e.consume(c),l;if(c===null||ee(c))return e.exit("atxHeadingSequence"),s(c);return a(c)}function s(c){if(c===35)return e.enter("atxHeadingSequence"),o(c);if(c===null||U(c))return e.exit("atxHeading"),t(c);if(Q(c))return G(e,s,"whitespace")(c);return e.enter("atxHeadingText"),u(c)}function o(c){if(c===35)return e.consume(c),o;return e.exit("atxHeadingSequence"),s(c)}function u(c){if(c===null||c===35||ee(c))return e.exit("atxHeadingText"),s(c);return e.consume(c),u}}var g1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],op=["pre","script","style","textarea"];var up={concrete:!0,name:"htmlFlow",resolveTo:GD,tokenize:QD},HD={partial:!0,tokenize:YD},VD={partial:!0,tokenize:jD};function GD(e){let t=e.length;while(t--)if(e[t][0]==="enter"&&e[t][1].type==="htmlFlow")break;if(t>1&&e[t-2][1].type==="linePrefix")e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2);return e}function QD(e,t,a){let n=this,i,r,l,s,o;return u;function u(k){return c(k)}function c(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),f}function f(k){if(k===33)return e.consume(k),d;if(k===47)return e.consume(k),r=!0,b;if(k===63)return e.consume(k),i=3,n.interrupt?t:L;if(Ye(k))return e.consume(k),l=String.fromCharCode(k),S;return a(k)}function d(k){if(k===45)return e.consume(k),i=2,h;if(k===91)return e.consume(k),i=5,s=0,g;if(Ye(k))return e.consume(k),i=4,n.interrupt?t:L;return a(k)}function h(k){if(k===45)return e.consume(k),n.interrupt?t:L;return a(k)}function g(k){if(k==="CDATA[".charCodeAt(s++)){if(e.consume(k),s===6)return n.interrupt?t:H;return g}return a(k)}function b(k){if(Ye(k))return e.consume(k),l=String.fromCharCode(k),S;return a(k)}function S(k){if(k===null||k===47||k===62||ee(k)){let ea=k===47,ai=l.toLowerCase();if(!ea&&!r&&op.includes(ai))return i=1,n.interrupt?t(k):H(k);if(g1.includes(l.toLowerCase())){if(i=6,ea)return e.consume(k),p;return n.interrupt?t(k):H(k)}return i=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(k):r?x(k):y(k)}if(k===45||Re(k))return e.consume(k),l+=String.fromCharCode(k),S;return a(k)}function p(k){if(k===62)return e.consume(k),n.interrupt?t:H;return a(k)}function x(k){if(Q(k))return e.consume(k),x;return v(k)}function y(k){if(k===47)return e.consume(k),v;if(k===58||k===95||Ye(k))return e.consume(k),w;if(Q(k))return e.consume(k),y;return v(k)}function w(k){if(k===45||k===46||k===58||k===95||Re(k))return e.consume(k),w;return T(k)}function T(k){if(k===61)return e.consume(k),I;if(Q(k))return e.consume(k),T;return y(k)}function I(k){if(k===null||k===60||k===61||k===62||k===96)return a(k);if(k===34||k===39)return e.consume(k),o=k,M;if(Q(k))return e.consume(k),I;return R(k)}function M(k){if(k===o)return e.consume(k),o=null,A;if(k===null||U(k))return a(k);return e.consume(k),M}function R(k){if(k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||ee(k))return T(k);return e.consume(k),R}function A(k){if(k===47||k===62||Q(k))return y(k);return a(k)}function v(k){if(k===62)return e.consume(k),F;return a(k)}function F(k){if(k===null||U(k))return H(k);if(Q(k))return e.consume(k),F;return a(k)}function H(k){if(k===45&&i===2)return e.consume(k),Y;if(k===60&&i===1)return e.consume(k),se;if(k===62&&i===4)return e.consume(k),Te;if(k===63&&i===3)return e.consume(k),L;if(k===93&&i===5)return e.consume(k),O;if(U(k)&&(i===6||i===7))return e.exit("htmlFlowData"),e.check(HD,J,B)(k);if(k===null||U(k))return e.exit("htmlFlowData"),B(k);return e.consume(k),H}function B(k){return e.check(VD,q,J)(k)}function q(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),V}function V(k){if(k===null||U(k))return B(k);return e.enter("htmlFlowData"),H(k)}function Y(k){if(k===45)return e.consume(k),L;return H(k)}function se(k){if(k===47)return e.consume(k),l="",_e;return H(k)}function _e(k){if(k===62){let ea=l.toLowerCase();if(op.includes(ea))return e.consume(k),Te;return H(k)}if(Ye(k)&&l.length<8)return e.consume(k),l+=String.fromCharCode(k),_e;return H(k)}function O(k){if(k===93)return e.consume(k),L;return H(k)}function L(k){if(k===62)return e.consume(k),Te;if(k===45&&i===2)return e.consume(k),L;return H(k)}function Te(k){if(k===null||U(k))return e.exit("htmlFlowData"),J(k);return e.consume(k),Te}function J(k){return e.exit("htmlFlow"),t(k)}}function jD(e,t,a){let n=this;return i;function i(l){if(U(l))return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r;return a(l)}function r(l){return n.parser.lazy[n.now().line]?a(l):t(l)}}function YD(e,t,a){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wa,t,a)}}var cp={name:"htmlText",tokenize:KD};function KD(e,t,a){let n=this,i,r,l;return s;function s(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),o}function o(L){if(L===33)return e.consume(L),u;if(L===47)return e.consume(L),T;if(L===63)return e.consume(L),y;if(Ye(L))return e.consume(L),R;return a(L)}function u(L){if(L===45)return e.consume(L),c;if(L===91)return e.consume(L),r=0,g;if(Ye(L))return e.consume(L),x;return a(L)}function c(L){if(L===45)return e.consume(L),h;return a(L)}function f(L){if(L===null)return a(L);if(L===45)return e.consume(L),d;if(U(L))return l=f,se(L);return e.consume(L),f}function d(L){if(L===45)return e.consume(L),h;return f(L)}function h(L){return L===62?Y(L):L===45?d(L):f(L)}function g(L){if(L==="CDATA[".charCodeAt(r++))return e.consume(L),r===6?b:g;return a(L)}function b(L){if(L===null)return a(L);if(L===93)return e.consume(L),S;if(U(L))return l=b,se(L);return e.consume(L),b}function S(L){if(L===93)return e.consume(L),p;return b(L)}function p(L){if(L===62)return Y(L);if(L===93)return e.consume(L),p;return b(L)}function x(L){if(L===null||L===62)return Y(L);if(U(L))return l=x,se(L);return e.consume(L),x}function y(L){if(L===null)return a(L);if(L===63)return e.consume(L),w;if(U(L))return l=y,se(L);return e.consume(L),y}function w(L){return L===62?Y(L):y(L)}function T(L){if(Ye(L))return e.consume(L),I;return a(L)}function I(L){if(L===45||Re(L))return e.consume(L),I;return M(L)}function M(L){if(U(L))return l=M,se(L);if(Q(L))return e.consume(L),M;return Y(L)}function R(L){if(L===45||Re(L))return e.consume(L),R;if(L===47||L===62||ee(L))return A(L);return a(L)}function A(L){if(L===47)return e.consume(L),Y;if(L===58||L===95||Ye(L))return e.consume(L),v;if(U(L))return l=A,se(L);if(Q(L))return e.consume(L),A;return Y(L)}function v(L){if(L===45||L===46||L===58||L===95||Re(L))return e.consume(L),v;return F(L)}function F(L){if(L===61)return e.consume(L),H;if(U(L))return l=F,se(L);if(Q(L))return e.consume(L),F;return A(L)}function H(L){if(L===null||L===60||L===61||L===62||L===96)return a(L);if(L===34||L===39)return e.consume(L),i=L,B;if(U(L))return l=H,se(L);if(Q(L))return e.consume(L),H;return e.consume(L),q}function B(L){if(L===i)return e.consume(L),i=void 0,V;if(L===null)return a(L);if(U(L))return l=B,se(L);return e.consume(L),B}function q(L){if(L===null||L===34||L===39||L===60||L===61||L===96)return a(L);if(L===47||L===62||ee(L))return A(L);return e.consume(L),q}function V(L){if(L===47||L===62||ee(L))return A(L);return a(L)}function Y(L){if(L===62)return e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t;return a(L)}function se(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),_e}function _e(L){return Q(L)?G(e,O,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):O(L)}function O(L){return e.enter("htmlTextData"),l(L)}}var Ui={name:"labelEnd",resolveAll:JD,resolveTo:$D,tokenize:eR},XD={tokenize:tR},WD={tokenize:aR},ZD={tokenize:nR};function JD(e){let t=-1,a=[];while(++t<e.length){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",t+=i}}if(e.length!==a.length)Pe(e,0,e.length,a);return e}function $D(e,t){let a=e.length,n=0,i,r,l,s;while(a--)if(i=e[a][1],r){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;if(e[a][0]==="enter"&&i.type==="labelLink")i._inactive=!0}else if(l){if(e[a][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced){if(r=a,i.type!=="labelLink"){n=2;break}}}else if(i.type==="labelEnd")l=a;let o={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[r+n+2][1].end},end:{...e[l-2][1].start}};return s=[["enter",o,t],["enter",u,t]],s=mt(s,e.slice(r+1,r+n+3)),s=mt(s,[["enter",c,t]]),s=mt(s,Kn(t.parser.constructs.insideSpan.null,e.slice(r+n+4,l-3),t)),s=mt(s,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),s=mt(s,e.slice(l+1)),s=mt(s,[["exit",o,t]]),Pe(e,r,e.length,s),e}function eR(e,t,a){let n=this,i=n.events.length,r,l;while(i--)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){r=n.events[i][1];break}return s;function s(d){if(!r)return a(d);if(r._inactive)return f(d);return l=n.parser.defined.includes(ut(n.sliceSerialize({start:r.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),o}function o(d){if(d===40)return e.attempt(XD,c,l?c:f)(d);if(d===91)return e.attempt(WD,c,l?u:f)(d);return l?c(d):f(d)}function u(d){return e.attempt(ZD,c,f)(d)}function c(d){return t(d)}function f(d){return r._balanced=!0,a(d)}}function tR(e,t,a){return n;function n(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return ee(f)?Fi(e,r)(f):r(f)}function r(f){if(f===41)return c(f);return Rc(e,l,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return ee(f)?Fi(e,o)(f):c(f)}function s(f){return a(f)}function o(f){if(f===34||f===39||f===40)return zc(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(f);return c(f)}function u(f){return ee(f)?Fi(e,c)(f):c(f)}function c(f){if(f===41)return e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t;return a(f)}}function aR(e,t,a){let n=this;return i;function i(s){return Bc.call(n,e,r,l,"reference","referenceMarker","referenceString")(s)}function r(s){return n.parser.defined.includes(ut(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(s):a(s)}function l(s){return a(s)}}function nR(e,t,a){return n;function n(r){return e.enter("reference"),e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),i}function i(r){if(r===93)return e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t;return a(r)}}var fp={name:"labelStartImage",resolveAll:Ui.resolveAll,tokenize:iR};function iR(e,t,a){let n=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),r}function r(s){if(s===91)return e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),l;return a(s)}function l(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(s):t(s)}}var dp={name:"labelStartLink",resolveAll:Ui.resolveAll,tokenize:rR};function rR(e,t,a){let n=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),r}function r(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var oo={name:"lineEnding",tokenize:lR};function lR(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),G(e,t,"linePrefix")}}var Hi={name:"thematicBreak",tokenize:sR};function sR(e,t,a){let n=0,i;return r;function r(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,s(u)}function s(u){if(u===i)return e.enter("thematicBreakSequence"),o(u);if(n>=3&&(u===null||U(u)))return e.exit("thematicBreak"),t(u);return a(u)}function o(u){if(u===i)return e.consume(u),n++,o;return e.exit("thematicBreakSequence"),Q(u)?G(e,s,"whitespace")(u):s(u)}}var ct={continuation:{tokenize:fR},exit:hR,name:"list",tokenize:cR},oR={partial:!0,tokenize:mR},uR={partial:!0,tokenize:dR};function cR(e,t,a){let n=this,i=n.events[n.events.length-1],r=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(h){let g=n.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||h===n.containerState.marker:io(h)){if(!n.containerState.type)n.containerState.type=g,e.enter(g,{_container:!0});if(g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Hi,a,u)(h):u(h);if(!n.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(h)}return a(h)}function o(h){if(io(h)&&++l<10)return e.consume(h),o;if((!n.interrupt||l<2)&&(n.containerState.marker?h===n.containerState.marker:h===41||h===46))return e.exit("listItemValue"),u(h);return a(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||h,e.check(wa,n.interrupt?a:c,e.attempt(oR,d,f))}function c(h){return n.containerState.initialBlankLine=!0,r++,d(h)}function f(h){if(Q(h))return e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d;return a(h)}function d(h){return n.containerState.size=r+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function fR(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(wa,i,r);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,G(e,t,"listItemIndent",n.containerState.size+1)(s)}function r(s){if(n.containerState.furtherBlankLines||!Q(s))return n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,l(s);return n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(uR,t,l)(s)}function l(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,G(e,e.attempt(ct,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function dR(e,t,a){let n=this;return G(e,i,"listItemIndent",n.containerState.size+1);function i(r){let l=n.events[n.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===n.containerState.size?t(r):a(r)}}function hR(e){e.exit(this.containerState.type)}function mR(e,t,a){let n=this;return G(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(r){let l=n.events[n.events.length-1];return!Q(r)&&l&&l[1].type==="listItemPrefixWhitespace"?t(r):a(r)}}var _c={name:"setextUnderline",resolveTo:pR,tokenize:gR};function pR(e,t){let a=e.length,n,i,r;while(a--)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}if(e[a][1].type==="paragraph")i=a}else{if(e[a][1].type==="content")e.splice(a,1);if(!r&&e[a][1].type==="definition")r=a}let l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};if(e[i][1].type="setextHeadingText",r)e.splice(i,0,["enter",l,t]),e.splice(r+1,0,["exit",e[n][1],t]),e[n][1].end={...e[r][1].end};else e[n][1]=l;return e.push(["exit",l,t]),e}function gR(e,t,a){let n=this,i;return r;function r(u){let c=n.events.length,f;while(c--)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}if(!n.parser.lazy[n.now().line]&&(n.interrupt||f))return e.enter("setextHeadingLine"),i=u,l(u);return a(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){if(u===i)return e.consume(u),s;return e.exit("setextHeadingLineSequence"),Q(u)?G(e,o,"lineSuffix")(u):o(u)}function o(u){if(u===null||U(u))return e.exit("setextHeadingLine"),t(u);return a(u)}}var x1={tokenize:xR};function xR(e){let t=this,a=e.attempt(wa,n,e.attempt(this.parser.constructs.flowInitial,i,G(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ip,i)),"linePrefix")));return a;function n(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function i(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var y1={resolveAll:C1()},b1=v1("string"),S1=v1("text");function v1(e){return{resolveAll:C1(e==="text"?yR:void 0),tokenize:t};function t(a){let n=this,i=this.parser.constructs[e],r=a.attempt(i,l,s);return l;function l(c){return u(c)?r(c):s(c)}function s(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),o}function o(c){if(u(c))return a.exit("data"),r(c);return a.consume(c),o}function u(c){if(c===null)return!0;let f=i[c],d=-1;if(f)while(++d<f.length){let h=f[d];if(!h.previous||h.previous.call(n,n.previous))return!0}return!1}}}function C1(e){return t;function t(a,n){let i=-1,r;while(++i<=a.length)if(r===void 0){if(a[i]&&a[i][1].type==="data")r=i,i++}else if(!a[i]||a[i][1].type!=="data"){if(i!==r+2)a[r][1].end=a[i-1][1].end,a.splice(r+2,i-r-2),i=r+2;r=void 0}return e?e(a,n):a}}function yR(e,t){let a=0;while(++a<=e.length)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],i=t.sliceStream(n),r=i.length,l=-1,s=0,o;while(r--){let u=i[r];if(typeof u==="string"){l=u.length;while(u.charCodeAt(l-1)===32)s++,l--;if(l)break;l=-1}else if(u===-2)o=!0,s++;else if(u===-1);else{r++;break}}if(t._contentTypeTextTrailing&&a===e.length)s=0;if(s){let u={type:a===e.length||o||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?l:n.start._bufferIndex+l,_index:n.start._index+r,line:n.end.line,column:n.end.column-s,offset:n.end.offset-s},end:{...n.end}};if(n.end={...u.start},n.start.offset===n.end.offset)Object.assign(n,u);else e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2}a++}return e}var hp={};Ex(hp,{attentionMarkers:()=>IR,contentInitial:()=>SR,disable:()=>MR,document:()=>bR,flow:()=>CR,flowInitial:()=>vR,insideSpan:()=>kR,string:()=>LR,text:()=>wR});var bR={[42]:ct,[43]:ct,[45]:ct,[48]:ct,[49]:ct,[50]:ct,[51]:ct,[52]:ct,[53]:ct,[54]:ct,[55]:ct,[56]:ct,[57]:ct,[62]:Mc},SR={[91]:rp},vR={[-2]:lo,[-1]:lo,[32]:lo},CR={[35]:sp,[42]:Hi,[45]:[_c,Hi],[60]:up,[61]:_c,[95]:Hi,[96]:Ec,[126]:Ec},LR={[38]:Ac,[92]:Tc},wR={[-5]:oo,[-4]:oo,[-3]:oo,[33]:fp,[38]:Ac,[42]:ro,[60]:[tp,cp],[91]:dp,[92]:[lp,Tc],[93]:Ui,[95]:ro,[96]:ap},kR={null:[ro,y1]},IR={null:[42,95]},MR={null:[]};function L1(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},i={},r=[],l=[],s=[],o=!0,u={attempt:A(M),check:A(R),consume:w,enter:T,exit:I,interrupt:A(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:S,parser:e,previous:null,sliceSerialize:g,sliceStream:b,write:h},f=t.tokenize.call(c,u),d;if(t.resolveAll)r.push(t);return c;function h(B){if(l=mt(l,B),x(),l[l.length-1]!==null)return[];return v(t,0),c.events=Kn(r,c.events,c),c.events}function g(B,q){return AR(b(B),q)}function b(B){return TR(l,B)}function S(){let{_bufferIndex:B,_index:q,line:V,column:Y,offset:se}=n;return{_bufferIndex:B,_index:q,line:V,column:Y,offset:se}}function p(B){i[B.line]=B.column,H()}function x(){let B;while(n._index<l.length){let q=l[n._index];if(typeof q==="string"){if(B=n._index,n._bufferIndex<0)n._bufferIndex=0;while(n._index===B&&n._bufferIndex<q.length)y(q.charCodeAt(n._bufferIndex))}else y(q)}}function y(B){o=void 0,d=B,f=f(B)}function w(B){if(U(B))n.line++,n.column=1,n.offset+=B===-3?2:1,H();else if(B!==-1)n.column++,n.offset++;if(n._bufferIndex<0)n._index++;else if(n._bufferIndex++,n._bufferIndex===l[n._index].length)n._bufferIndex=-1,n._index++;c.previous=B,o=!0}function T(B,q){let V=q||{};return V.type=B,V.start=S(),c.events.push(["enter",V,c]),s.push(V),V}function I(B){let q=s.pop();return q.end=S(),c.events.push(["exit",q,c]),q}function M(B,q){v(B,q.from)}function R(B,q){q.restore()}function A(B,q){return V;function V(Y,se,_e){let O,L,Te,J;return Array.isArray(Y)?ea(Y):("tokenize"in Y)?ea([Y]):k(Y);function k(Ze){return Tl;function Tl(Ta){let ni=Ta!==null&&Ze[Ta],ir=Ta!==null&&Ze.null,Ff=[...Array.isArray(ni)?ni:ni?[ni]:[],...Array.isArray(ir)?ir:ir?[ir]:[]];return ea(Ff)(Ta)}}function ea(Ze){if(O=Ze,L=0,Ze.length===0)return _e;return ai(Ze[L])}function ai(Ze){return Tl;function Tl(Ta){if(J=F(),Te=Ze,!Ze.partial)c.currentConstruct=Ze;if(Ze.name&&c.parser.constructs.disable.null.includes(Ze.name))return Po(Ta);return Ze.tokenize.call(q?Object.assign(Object.create(c),q):c,u,qf,Po)(Ta)}}function qf(Ze){return o=!0,B(Te,J),se}function Po(Ze){if(o=!0,J.restore(),++L<O.length)return ai(O[L]);return _e}}}function v(B,q){if(B.resolveAll&&!r.includes(B))r.push(B);if(B.resolve)Pe(c.events,q,c.events.length-q,B.resolve(c.events.slice(q),c));if(B.resolveTo)c.events=B.resolveTo(c.events,c)}function F(){let B=S(),q=c.previous,V=c.currentConstruct,Y=c.events.length,se=Array.from(s);return{from:Y,restore:_e};function _e(){n=B,c.previous=q,c.currentConstruct=V,c.events.length=Y,s=se,H()}}function H(){if(n.line in i&&n.column<2)n.column=i[n.line],n.offset+=i[n.line]-1}}function TR(e,t){let a=t.start._index,n=t.start._bufferIndex,i=t.end._index,r=t.end._bufferIndex,l;if(a===i)l=[e[a].slice(n,r)];else{if(l=e.slice(a,i),n>-1){let s=l[0];if(typeof s==="string")l[0]=s.slice(n);else l.shift()}if(r>0)l.push(e[i].slice(0,r))}return l}function AR(e,t){let a=-1,n=[],i;while(++a<e.length){let r=e[a],l;if(typeof r==="string")l=r;else switch(r){case-5:{l="\r";break}case-4:{l=`
|
|
11
|
+
`;break}case-3:{l=`\r
|
|
12
|
+
`;break}case-2:{l=t?" ":"\t";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(r)}i=r===-2,n.push(l)}return n.join("")}function mp(e){let n={constructs:kc([hp,...(e||{}).extensions||[]]),content:i(f1),defined:[],document:i(h1),flow:i(x1),lazy:{},string:i(b1),text:i(S1)};return n;function i(r){return l;function l(s){return L1(n,r,s)}}}function pp(e){while(!Dc(e));return e}var w1=/[\0\t\n\r]/g;function gp(){let e=1,t="",a=!0,n;return i;function i(r,l,s){let o=[],u,c,f,d,h;if(r=t+(typeof r==="string"?r.toString():new TextDecoder(l||void 0).decode(r)),f=0,t="",a){if(r.charCodeAt(0)===65279)f++;a=void 0}while(f<r.length){if(w1.lastIndex=f,u=w1.exec(r),d=u&&u.index!==void 0?u.index:r.length,h=r.charCodeAt(d),!u){t=r.slice(f);break}if(h===10&&f===d&&n)o.push(-3),n=void 0;else{if(n)o.push(-5),n=void 0;if(f<d)o.push(r.slice(f,d)),e+=d-f;switch(h){case 0:{o.push(65533),e++;break}case 9:{c=Math.ceil(e/4)*4,o.push(-2);while(e++<c)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:n=!0,e=1}}f=d+1}if(s){if(n)o.push(-5);if(t)o.push(t);o.push(null)}return o}}var ER=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function k1(e){return e.replace(ER,DR)}function DR(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let i=a.charCodeAt(1),r=i===120||i===88;return Ic(a.slice(r?2:1),r?16:10)}return sl(a)||e}var M1={}.hasOwnProperty;function xp(e,t,a){if(t&&typeof t==="object")a=t,t=void 0;return RR(a)(pp(mp(a).document().write(gp()(e,t,!0))))}function RR(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(Tx),autolinkProtocol:A,autolinkEmail:A,atxHeading:r(kx),blockQuote:r(Ta),characterEscape:A,characterReference:A,codeFenced:r(ni),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(ni,l),codeText:r(ir,l),codeTextData:A,data:A,codeFlowValue:A,definition:r(Ff),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(DI),hardBreakEscape:r(Ix),hardBreakTrailing:r(Ix),htmlFlow:r(Mx,l),htmlFlowData:A,htmlText:r(Mx,l),htmlTextData:A,image:r(RI),label:l,link:r(Tx),listItem:r(BI),listItemValue:d,listOrdered:r(Ax,f),listUnordered:r(Ax),paragraph:r(zI),reference:k,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(kx),strong:r(_I),thematicBreak:r(OI)},exit:{atxHeading:o(),atxHeadingSequence:T,autolink:o(),autolinkEmail:Tl,autolinkProtocol:Ze,blockQuote:o(),characterEscapeValue:v,characterReferenceMarkerHexadecimal:ai,characterReferenceMarkerNumeric:ai,characterReferenceValue:qf,characterReference:Po,codeFenced:o(S),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:v,codeIndented:o(p),codeText:o(V),codeTextData:v,data:v,definition:o(),definitionDestinationString:w,definitionLabelString:x,definitionTitleString:y,emphasis:o(),hardBreakEscape:o(H),hardBreakTrailing:o(H),htmlFlow:o(B),htmlFlowData:v,htmlText:o(q),htmlTextData:v,image:o(se),label:O,labelText:_e,lineEnding:F,link:o(Y),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:ea,resourceDestinationString:L,resourceTitleString:Te,resource:J,setextHeading:o(R),setextHeadingLineSequence:M,setextHeadingText:I,strong:o(),thematicBreak:o()}};T1(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(E){let P={type:"root",children:[]},X={stack:[P],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:c,data:a},ie=[],ge=-1;while(++ge<E.length)if(E[ge][1].type==="listOrdered"||E[ge][1].type==="listUnordered")if(E[ge][0]==="enter")ie.push(ge);else{let ta=ie.pop();ge=i(E,ta,ge)}ge=-1;while(++ge<E.length){let ta=t[E[ge][0]];if(M1.call(ta,E[ge][1].type))ta[E[ge][1].type].call(Object.assign({sliceSerialize:E[ge][2].sliceSerialize},X),E[ge][1])}if(X.tokenStack.length>0){let ta=X.tokenStack[X.tokenStack.length-1];(ta[1]||I1).call(X,void 0,ta[0])}P.position={start:Xn(E.length>0?E[0][1].start:{line:1,column:1,offset:0}),end:Xn(E.length>0?E[E.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;while(++ge<t.transforms.length)P=t.transforms[ge](P)||P;return P}function i(E,P,X){let ie=P-1,ge=-1,ta=!1,ii,Aa,Al,El;while(++ie<=X){let Tt=E[ie];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(Tt[0]==="enter")ge++;else ge--;El=void 0;break}case"lineEndingBlank":{if(Tt[0]==="enter"){if(ii&&!El&&!ge&&!Al)Al=ie;El=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:El=void 0}if(!ge&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||ge===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(ii){let rr=ie;Aa=void 0;while(rr--){let Ea=E[rr];if(Ea[1].type==="lineEnding"||Ea[1].type==="lineEndingBlank"){if(Ea[0]==="exit")continue;if(Aa)E[Aa][1].type="lineEndingBlank",ta=!0;Ea[1].type="lineEnding",Aa=rr}else if(Ea[1].type==="linePrefix"||Ea[1].type==="blockQuotePrefix"||Ea[1].type==="blockQuotePrefixWhitespace"||Ea[1].type==="blockQuoteMarker"||Ea[1].type==="listItemIndent");else break}if(Al&&(!Aa||Al<Aa))ii._spread=!0;ii.end=Object.assign({},Aa?E[Aa][1].start:Tt[1].end),E.splice(Aa||ie,0,["exit",ii,Tt[2]]),ie++,X++}if(Tt[1].type==="listItemPrefix"){let rr={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};ii=rr,E.splice(ie,0,["enter",rr,Tt[2]]),ie++,X++,Al=void 0,El=!0}}}return E[P][1]._spread=ta,X}function r(E,P){return X;function X(ie){if(s.call(this,E(ie),ie),P)P.call(this,ie)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(E,P,X){this.stack[this.stack.length-1].children.push(E),this.stack.push(E),this.tokenStack.push([P,X||void 0]),E.position={start:Xn(P.start),end:void 0}}function o(E){return P;function P(X){if(E)E.call(this,X);u.call(this,X)}}function u(E,P){let X=this.stack.pop(),ie=this.tokenStack.pop();if(!ie)throw Error("Cannot close `"+E.type+"` ("+jn({start:E.start,end:E.end})+"): it’s not open");else if(ie[0].type!==E.type)if(P)P.call(this,E,ie[0]);else(ie[1]||I1).call(this,E,ie[0]);X.position.end=Xn(E.end)}function c(){return Oi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function d(E){if(this.data.expectingFirstListItemValue){let P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(E),10),this.data.expectingFirstListItemValue=void 0}}function h(){let E=this.resume(),P=this.stack[this.stack.length-1];P.lang=E}function g(){let E=this.resume(),P=this.stack[this.stack.length-1];P.meta=E}function b(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function S(){let E=this.resume(),P=this.stack[this.stack.length-1];P.value=E.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){let E=this.resume(),P=this.stack[this.stack.length-1];P.value=E.replace(/(\r?\n|\r)$/g,"")}function x(E){let P=this.resume(),X=this.stack[this.stack.length-1];X.label=P,X.identifier=ut(this.sliceSerialize(E)).toLowerCase()}function y(){let E=this.resume(),P=this.stack[this.stack.length-1];P.title=E}function w(){let E=this.resume(),P=this.stack[this.stack.length-1];P.url=E}function T(E){let P=this.stack[this.stack.length-1];if(!P.depth){let X=this.sliceSerialize(E).length;P.depth=X}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function M(E){let P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(E).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function A(E){let X=this.stack[this.stack.length-1].children,ie=X[X.length-1];if(!ie||ie.type!=="text")ie=NI(),ie.position={start:Xn(E.start),end:void 0},X.push(ie);this.stack.push(ie)}function v(E){let P=this.stack.pop();P.value+=this.sliceSerialize(E),P.position.end=Xn(E.end)}function F(E){let P=this.stack[this.stack.length-1];if(this.data.atHardBreak){let X=P.children[P.children.length-1];X.position.end=Xn(E.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(P.type))A.call(this,E),v.call(this,E)}function H(){this.data.atHardBreak=!0}function B(){let E=this.resume(),P=this.stack[this.stack.length-1];P.value=E}function q(){let E=this.resume(),P=this.stack[this.stack.length-1];P.value=E}function V(){let E=this.resume(),P=this.stack[this.stack.length-1];P.value=E}function Y(){let E=this.stack[this.stack.length-1];if(this.data.inReference){let P=this.data.referenceType||"shortcut";E.type+="Reference",E.referenceType=P,delete E.url,delete E.title}else delete E.identifier,delete E.label;this.data.referenceType=void 0}function se(){let E=this.stack[this.stack.length-1];if(this.data.inReference){let P=this.data.referenceType||"shortcut";E.type+="Reference",E.referenceType=P,delete E.url,delete E.title}else delete E.identifier,delete E.label;this.data.referenceType=void 0}function _e(E){let P=this.sliceSerialize(E),X=this.stack[this.stack.length-2];X.label=k1(P),X.identifier=ut(P).toLowerCase()}function O(){let E=this.stack[this.stack.length-1],P=this.resume(),X=this.stack[this.stack.length-1];if(this.data.inReference=!0,X.type==="link"){let ie=E.children;X.children=ie}else X.alt=P}function L(){let E=this.resume(),P=this.stack[this.stack.length-1];P.url=E}function Te(){let E=this.resume(),P=this.stack[this.stack.length-1];P.title=E}function J(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function ea(E){let P=this.resume(),X=this.stack[this.stack.length-1];X.label=P,X.identifier=ut(this.sliceSerialize(E)).toLowerCase(),this.data.referenceType="full"}function ai(E){this.data.characterReferenceType=E.type}function qf(E){let P=this.sliceSerialize(E),X=this.data.characterReferenceType,ie;if(X)ie=Ic(P,X==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else ie=sl(P);let ge=this.stack[this.stack.length-1];ge.value+=ie}function Po(E){let P=this.stack.pop();P.position.end=Xn(E.end)}function Ze(E){v.call(this,E);let P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(E)}function Tl(E){v.call(this,E);let P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(E)}function Ta(){return{type:"blockquote",children:[]}}function ni(){return{type:"code",lang:null,meta:null,value:""}}function ir(){return{type:"inlineCode",value:""}}function Ff(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function DI(){return{type:"emphasis",children:[]}}function kx(){return{type:"heading",depth:0,children:[]}}function Ix(){return{type:"break"}}function Mx(){return{type:"html",value:""}}function RI(){return{type:"image",title:null,url:"",alt:null}}function Tx(){return{type:"link",title:null,url:"",children:[]}}function Ax(E){return{type:"list",ordered:E.type==="listOrdered",start:null,spread:E._spread,children:[]}}function BI(E){return{type:"listItem",spread:E._spread,checked:null,children:[]}}function zI(){return{type:"paragraph",children:[]}}function _I(){return{type:"strong",children:[]}}function NI(){return{type:"text",value:""}}function OI(){return{type:"thematicBreak"}}}function Xn(e){return{line:e.line,column:e.column,offset:e.offset}}function T1(e,t){let a=-1;while(++a<t.length){let n=t[a];if(Array.isArray(n))T1(e,n);else BR(e,n)}}function BR(e,t){let a;for(a in t)if(M1.call(t,a))switch(a){case"canContainEols":{let n=t[a];if(n)e[a].push(...n);break}case"transforms":{let n=t[a];if(n)e[a].push(...n);break}case"enter":case"exit":{let n=t[a];if(n)Object.assign(e[a],n);break}}}function I1(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+jn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jn({start:t.start,end:t.end})+") is open");else throw Error("Cannot close document, a token (`"+t.type+"`, "+jn({start:t.start,end:t.end})+") is still open")}function Nc(e){let t=this;t.parser=a;function a(n){return xp(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Oc=-1,ol=0,Vi=1,ul=2,uo=3,co=4,fo=5,ho=6,Pc=7,qc=8;var E1=typeof self==="object"?self:globalThis,A1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+e)}return new E1[e](t)},zR=(e,t)=>{let a=(i,r)=>(e.set(r,i),i),n=(i)=>{if(e.has(i))return e.get(i);let[r,l]=t[i];switch(r){case ol:case Oc:return a(l,i);case Vi:{let s=a([],i);for(let o of l)s.push(n(o));return s}case ul:{let s=a({},i);for(let[o,u]of l)s[n(o)]=n(u);return s}case uo:return a(new Date(l),i);case co:{let{source:s,flags:o}=l;return a(new RegExp(s,o),i)}case fo:{let s=a(new Map,i);for(let[o,u]of l)s.set(n(o),n(u));return s}case ho:{let s=a(new Set,i);for(let o of l)s.add(n(o));return s}case Pc:{let{name:s,message:o}=l;return a(typeof E1[s]==="function"?A1(s,o):Error(o),i)}case qc:return a(BigInt(l),i);case"BigInt":return a(Object(BigInt(l)),i);case"ArrayBuffer":return a(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:s}=new Uint8Array(l);return a(new DataView(s),l)}}return a(A1(r,l),i)};return n},yp=(e)=>zR(new Map,e)(0);var Gi="",{toString:_R}={},{keys:NR}=Object,mo=(e)=>{let t=typeof e;if(t!=="object"||!e)return[ol,t];let a=_R.call(e).slice(8,-1);switch(a){case"Array":return[Vi,Gi];case"Object":return[ul,Gi];case"Date":return[uo,Gi];case"RegExp":return[co,Gi];case"Map":return[fo,Gi];case"Set":return[ho,Gi];case"DataView":return[Vi,a]}if(a.includes("Array"))return[Vi,a];if(e instanceof Error)return[Pc,e.name||"Error"];return[ul,a]},Fc=([e,t])=>e===ol&&(t==="function"||t==="symbol"),OR=(e,t,a,n)=>{let i=(l,s)=>{let o=n.push(l)-1;return a.set(s,o),o},r=(l)=>{if(a.has(l))return a.get(l);let[s,o]=mo(l);switch(s){case ol:{let c=l;switch(o){case"bigint":s=qc,c=l.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+o);c=null;break;case"undefined":return i([Oc],l)}return i([s,c],l)}case Vi:{if(o){let d=l;if(o==="DataView")d=new Uint8Array(l.buffer);else if(o==="ArrayBuffer")d=new Uint8Array(l);return i([o,[...d]],l)}let c=[],f=i([s,c],l);for(let d of l)c.push(r(d));return f}case ul:{if(o)switch(o){case"BigInt":return i([o,l.toString()],l);case"Boolean":case"Number":case"String":return i([o,l.valueOf()],l)}if(t&&"toJSON"in l)return r(l.toJSON());let c=[],f=i([s,c],l);for(let d of NR(l))if(e||!Fc(mo(l[d])))c.push([r(d),r(l[d])]);return f}case uo:return i([s,isNaN(l.getTime())?Gi:l.toISOString()],l);case co:{let{source:c,flags:f}=l;return i([s,{source:c,flags:f}],l)}case fo:{let c=[],f=i([s,c],l);for(let[d,h]of l)if(e||!(Fc(mo(d))||Fc(mo(h))))c.push([r(d),r(h)]);return f}case ho:{let c=[],f=i([s,c],l);for(let d of l)if(e||!Fc(mo(d)))c.push(r(d));return f}}let{message:u}=l;return i([s,{name:o,message:u}],l)};return r},bp=(e,{json:t,lossy:a}={})=>{let n=[];return OR(!(t||a),!!t,new Map,n)(e),n};var cl=typeof structuredClone==="function"?(e,t)=>t&&(("json"in t)||("lossy"in t))?yp(bp(e,t)):structuredClone(e):(e,t)=>yp(bp(e,t));function PR(e,t){let a=[{type:"text",value:"↩"}];if(t>1)a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]});return a}function qR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function D1(e){let t=typeof e.options.clobberPrefix==="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||PR,n=e.options.footnoteBackLabel||qR,i=e.options.footnoteLabel||"Footnotes",r=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[],o=-1;while(++o<e.footnoteOrder.length){let u=e.footnoteById.get(e.footnoteOrder[o]);if(!u)continue;let c=e.all(u),f=String(u.identifier).toUpperCase(),d=$t(f.toLowerCase()),h=0,g=[],b=e.footnoteCounts.get(f);while(b!==void 0&&++h<=b){if(g.length>0)g.push({type:"text",value:" "});let x=typeof a==="string"?a:a(o,h);if(typeof x==="string")x={type:"text",value:x};g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof n==="string"?n:n(o,h),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}let S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){let x=S.children[S.children.length-1];if(x&&x.type==="text")x.value+=" ";else S.children.push({type:"text",value:" "});S.children.push(...g)}else c.push(...g);let p={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(c,!0)};e.patch(u,p),s.push(p)}if(s.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...cl(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
13
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
14
|
+
`}]}}var Wn=function(e){if(e===null||e===void 0)return VR;if(typeof e==="function")return Uc(e);if(typeof e==="object")return Array.isArray(e)?FR(e):UR(e);if(typeof e==="string")return HR(e);throw Error("Expected function, string, or object as test")};function FR(e){let t=[],a=-1;while(++a<e.length)t[a]=Wn(e[a]);return Uc(n);function n(...i){let r=-1;while(++r<t.length)if(t[r].apply(this,i))return!0;return!1}}function UR(e){let t=e;return Uc(a);function a(n){let i=n,r;for(r in e)if(i[r]!==t[r])return!1;return!0}}function HR(e){return Uc(t);function t(a){return a&&a.type===e}}function Uc(e){return t;function t(a,n,i){return Boolean(GR(a)&&e.call(this,a,typeof n==="number"?n:void 0,i||void 0))}}function VR(){return!0}function GR(e){return e!==null&&typeof e==="object"&&"type"in e}function R1(e){return e}var B1=[],Hc=!0,Qi=!1,Vc="skip";function po(e,t,a,n){let i;if(typeof t==="function"&&typeof a!=="function")n=a,a=t;else i=t;let r=Wn(i),l=n?-1:1;s(e,void 0,[])();function s(o,u,c){let f=o&&typeof o==="object"?o:{};if(typeof f.type==="string"){let h=typeof f.tagName==="string"?f.tagName:typeof f.name==="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+R1(o.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=B1,g,b,S;if(!t||r(o,u,c[c.length-1]||void 0)){if(h=QR(a(o,c)),h[0]===Qi)return h}if("children"in o&&o.children){let p=o;if(p.children&&h[0]!==Vc){b=(n?p.children.length:-1)+l,S=c.concat(p);while(b>-1&&b<p.children.length){let x=p.children[b];if(g=s(x,b,S)(),g[0]===Qi)return g;b=typeof g[1]==="number"?g[1]:b+l}}}return h}}}function QR(e){if(Array.isArray(e))return e;if(typeof e==="number")return[Hc,e];return e===null||e===void 0?B1:[e]}function ji(e,t,a,n){let i,r,l;if(typeof t==="function"&&typeof a!=="function")r=void 0,l=t,i=a;else r=t,l=a,i=n;po(e,r,s,i);function s(o,u){let c=u[u.length-1],f=c?c.children.indexOf(o):void 0;return l(o,f,c)}}function z1(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function _1(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
15
|
+
`}]}function N1(e,t){let a=t.value?t.value+`
|
|
16
|
+
`:"",n={},i=t.lang?t.lang.split(/\s+/):[];if(i.length>0)n.className=["language-"+i[0]];let r={type:"element",tagName:"code",properties:n,children:[{type:"text",value:a}]};if(t.meta)r.data={meta:t.meta};return e.patch(t,r),r=e.applyData(t,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(t,r),r}function O1(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function P1(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function q1(e,t){let a=typeof e.options.clobberPrefix==="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=$t(n.toLowerCase()),r=e.footnoteOrder.indexOf(n),l,s=e.footnoteCounts.get(n);if(s===void 0)s=0,e.footnoteOrder.push(n),l=e.footnoteOrder.length;else l=r+1;s+=1,e.footnoteCounts.set(n,s);let o={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+i,id:a+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,o);let u={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,u),e.applyData(t,u)}function F1(e,t){let a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function U1(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}return}function Gc(e,t){let a=t.referenceType,n="]";if(a==="collapsed")n+="[]";else if(a==="full")n+="["+(t.label||t.identifier)+"]";if(t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];let i=e.all(t),r=i[0];if(r&&r.type==="text")r.value="["+r.value;else i.unshift({type:"text",value:"["});let l=i[i.length-1];if(l&&l.type==="text")l.value+=n;else i.push({type:"text",value:n});return i}function H1(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Gc(e,t);let i={src:$t(n.url||""),alt:t.alt};if(n.title!==null&&n.title!==void 0)i.title=n.title;let r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,r),e.applyData(t,r)}function V1(e,t){let a={src:$t(t.url)};if(t.alt!==null&&t.alt!==void 0)a.alt=t.alt;if(t.title!==null&&t.title!==void 0)a.title=t.title;let n={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,n),e.applyData(t,n)}function G1(e,t){let a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);let n={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,n),e.applyData(t,n)}function Q1(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Gc(e,t);let i={href:$t(n.url||"")};if(n.title!==null&&n.title!==void 0)i.title=n.title;let r={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j1(e,t){let a={href:$t(t.url)};if(t.title!==null&&t.title!==void 0)a.title=t.title;let n={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y1(e,t,a){let n=e.all(t),i=a?jR(a):K1(t),r={},l=[];if(typeof t.checked==="boolean"){let c=n[0],f;if(c&&c.type==="element"&&c.tagName==="p")f=c;else f={type:"element",tagName:"p",properties:{},children:[]},n.unshift(f);if(f.children.length>0)f.children.unshift({type:"text",value:" "});f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let s=-1;while(++s<n.length){let c=n[s];if(i||s!==0||c.type!=="element"||c.tagName!=="p")l.push({type:"text",value:`
|
|
17
|
+
`});if(c.type==="element"&&c.tagName==="p"&&!i)l.push(...c.children);else l.push(c)}let o=n[n.length-1];if(o&&(i||o.type!=="element"||o.tagName!=="p"))l.push({type:"text",value:`
|
|
18
|
+
`});let u={type:"element",tagName:"li",properties:r,children:l};return e.patch(t,u),e.applyData(t,u)}function jR(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;while(!t&&++n<a.length)t=K1(a[n])}return t}function K1(e){let t=e.spread;return t===null||t===void 0?e.children.length>1:t}function X1(e,t){let a={},n=e.all(t),i=-1;if(typeof t.start==="number"&&t.start!==1)a.start=t.start;while(++i<n.length){let l=n[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}let r={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(n,!0)};return e.patch(t,r),e.applyData(t,r)}function W1(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Z1(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function J1(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function $1(e,t){let a=e.all(t),n=a.shift(),i=[];if(n){let l={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],l),i.push(l)}if(a.length>0){let l={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},s=ll(t.children[1]),o=wc(t.children[t.children.length-1]);if(s&&o)l.position={start:s,end:o};i.push(l)}let r={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,r),e.applyData(t,r)}function eC(e,t,a){let n=a?a.children:void 0,r=(n?n.indexOf(t):1)===0?"th":"td",l=a&&a.type==="table"?a.align:void 0,s=l?l.length:t.children.length,o=-1,u=[];while(++o<s){let f=t.children[o],d={},h=l?l[o]:void 0;if(h)d.align=h;let g={type:"element",tagName:r,properties:d,children:[]};if(f)g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g);u.push(g)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function tC(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function nC(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),i=0,r=[];while(n)r.push(aC(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=a.exec(t);return r.push(aC(t.slice(i),i>0,!1)),r.join("")}function aC(e,t,a){let n=0,i=e.length;if(t){let r=e.codePointAt(n);while(r===9||r===32)n++,r=e.codePointAt(n)}if(a){let r=e.codePointAt(i-1);while(r===9||r===32)i--,r=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function iC(e,t){let a={type:"text",value:nC(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function rC(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var lC={blockquote:z1,break:_1,code:N1,delete:O1,emphasis:P1,footnoteReference:q1,heading:F1,html:U1,imageReference:H1,image:V1,inlineCode:G1,linkReference:Q1,link:j1,listItem:Y1,list:X1,paragraph:W1,root:Z1,strong:J1,table:$1,tableCell:tC,tableRow:eC,text:iC,thematicBreak:rC,toml:Qc,yaml:Qc,definition:Qc,footnoteDefinition:Qc};function Qc(){return}var Sp={}.hasOwnProperty,YR={};function oC(e,t){let a=t||YR,n=new Map,i=new Map,r=new Map,l={...lC,...a.handlers},s={all:u,applyData:XR,definitionById:n,footnoteById:i,footnoteCounts:r,footnoteOrder:[],handlers:l,one:o,options:a,patch:KR,wrap:ZR};return ji(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let f=c.type==="definition"?n:i,d=String(c.identifier).toUpperCase();if(!f.has(d))f.set(d,c)}}),s;function o(c,f){let d=c.type,h=s.handlers[d];if(Sp.call(s.handlers,d)&&h)return h(s,c,f);if(s.options.passThrough&&s.options.passThrough.includes(d)){if("children"in c){let{children:b,...S}=c,p=cl(S);return p.children=s.all(c),p}return cl(c)}return(s.options.unknownHandler||WR)(s,c,f)}function u(c){let f=[];if("children"in c){let d=c.children,h=-1;while(++h<d.length){let g=s.one(d[h],c);if(g){if(h&&d[h-1].type==="break"){if(!Array.isArray(g)&&g.type==="text")g.value=sC(g.value);if(!Array.isArray(g)&&g.type==="element"){let b=g.children[0];if(b&&b.type==="text")b.value=sC(b.value)}}if(Array.isArray(g))f.push(...g);else f.push(g)}}}return f}}function KR(e,t){if(e.position)t.position=Xm(e)}function XR(e,t){let a=t;if(e&&e.data){let n=e.data.hName,i=e.data.hChildren,r=e.data.hProperties;if(typeof n==="string")if(a.type==="element")a.tagName=n;else{let l="children"in a?a.children:[a];a={type:"element",tagName:n,properties:{},children:l}}if(a.type==="element"&&r)Object.assign(a.properties,cl(r));if("children"in a&&a.children&&i!==null&&i!==void 0)a.children=i}return a}function WR(e,t){let a=t.data||{},n="value"in t&&!(Sp.call(a,"hProperties")||Sp.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZR(e,t){let a=[],n=-1;if(t)a.push({type:"text",value:`
|
|
19
|
+
`});while(++n<e.length){if(n)a.push({type:"text",value:`
|
|
20
|
+
`});a.push(e[n])}if(t&&e.length>0)a.push({type:"text",value:`
|
|
21
|
+
`});return a}function sC(e){let t=0,a=e.charCodeAt(t);while(a===9||a===32)t++,a=e.charCodeAt(t);return e.slice(t)}function jc(e,t){let a=oC(e,t),n=a.one(e,void 0),i=D1(a),r=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};if(i)Se("children"in r),r.children.push({type:"text",value:`
|
|
22
|
+
`},i);return r}function Yc(e,t){if(e&&"run"in e)return async function(a,n){let i=jc(a,{file:n,...t});await e.run(i,n)};return function(a,n){return jc(a,{file:n,...e||t})}}function vp(e){if(e)throw e}var Wc=qe(xC(),1);function go(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Cp(){let e=[],t={run:a,use:n};return t;function a(...i){let r=-1,l=i.pop();if(typeof l!=="function")throw TypeError("Expected function as last argument, not "+l);s(null,...i);function s(o,...u){let c=e[++r],f=-1;if(o){l(o);return}while(++f<i.length)if(u[f]===null||u[f]===void 0)u[f]=i[f];if(i=u,c)yC(c,s)(...u);else l(null,...u)}}function n(i){if(typeof i!=="function")throw TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function yC(e,t){let a;return n;function n(...l){let s=e.length>l.length,o;if(s)l.push(i);try{o=e.apply(this,l)}catch(u){let c=u;if(s&&a)throw c;return i(c)}if(!s)if(o&&o.then&&typeof o.then==="function")o.then(r,i);else if(o instanceof Error)i(o);else r(o)}function i(l,...s){if(!a)a=!0,t(l,...s)}function r(l){i(null,l)}}var oa={basename:JR,dirname:$R,extname:eB,join:tB,sep:"/"};function JR(e,t){if(t!==void 0&&typeof t!=="string")throw TypeError('"ext" argument must be a string');xo(e);let a=0,n=-1,i=e.length,r;if(t===void 0||t.length===0||t.length>e.length){while(i--)if(e.codePointAt(i)===47){if(r){a=i+1;break}}else if(n<0)r=!0,n=i+1;return n<0?"":e.slice(a,n)}if(t===e)return"";let l=-1,s=t.length-1;while(i--)if(e.codePointAt(i)===47){if(r){a=i+1;break}}else{if(l<0)r=!0,l=i+1;if(s>-1)if(e.codePointAt(i)===t.codePointAt(s--)){if(s<0)n=i}else s=-1,n=l}if(a===n)n=l;else if(n<0)n=e.length;return e.slice(a,n)}function $R(e){if(xo(e),e.length===0)return".";let t=-1,a=e.length,n;while(--a)if(e.codePointAt(a)===47){if(n){t=a;break}}else if(!n)n=!0;return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eB(e){xo(e);let t=e.length,a=-1,n=0,i=-1,r=0,l;while(t--){let s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}if(a<0)l=!0,a=t+1;if(s===46){if(i<0)i=t;else if(r!==1)r=1}else if(i>-1)r=-1}if(i<0||a<0||r===0||r===1&&i===a-1&&i===n+1)return"";return e.slice(i,a)}function tB(...e){let t=-1,a;while(++t<e.length)if(xo(e[t]),e[t])a=a===void 0?e[t]:a+"/"+e[t];return a===void 0?".":aB(a)}function aB(e){xo(e);let t=e.codePointAt(0)===47,a=nB(e,!t);if(a.length===0&&!t)a=".";if(a.length>0&&e.codePointAt(e.length-1)===47)a+="/";return t?"/"+a:a}function nB(e,t){let a="",n=0,i=-1,r=0,l=-1,s,o;while(++l<=e.length){if(l<e.length)s=e.codePointAt(l);else if(s===47)break;else s=47;if(s===47){if(i===l-1||r===1);else if(i!==l-1&&r===2){if(a.length<2||n!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(o=a.lastIndexOf("/"),o!==a.length-1){if(o<0)a="",n=0;else a=a.slice(0,o),n=a.length-1-a.lastIndexOf("/");i=l,r=0;continue}}else if(a.length>0){a="",n=0,i=l,r=0;continue}}if(t)a=a.length>0?a+"/..":"..",n=2}else{if(a.length>0)a+="/"+e.slice(i+1,l);else a=e.slice(i+1,l);n=l-i-1}i=l,r=0}else if(s===46&&r>-1)r++;else r=-1}return a}function xo(e){if(typeof e!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(e))}var bC={cwd:iB};function iB(){return"/"}function fl(e){return Boolean(e!==null&&typeof e==="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function SC(e){if(typeof e==="string")e=new URL(e);else if(!fl(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return rB(e)}function rB(e){if(e.hostname!==""){let n=TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,a=-1;while(++a<t.length)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let n=t.codePointAt(a+2);if(n===70||n===102){let i=TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}var Lp=["history","path","basename","stem","extname","dirname"];class dl{constructor(e){let t;if(!e)t={};else if(fl(e))t={path:e};else if(typeof e==="string"||lB(e))t={value:e};else t=e;this.cwd="cwd"in t?"":bC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;while(++a<Lp.length){let i=Lp[a];if(i in t&&t[i]!==void 0&&t[i]!==null)this[i]=i==="history"?[...t[i]]:t[i]}let n;for(n in t)if(!Lp.includes(n))this[n]=t[n]}get basename(){return typeof this.path==="string"?oa.basename(this.path):void 0}set basename(e){kp(e,"basename"),wp(e,"basename"),this.path=oa.join(this.dirname||"",e)}get dirname(){return typeof this.path==="string"?oa.dirname(this.path):void 0}set dirname(e){vC(this.basename,"dirname"),this.path=oa.join(e||"",this.basename)}get extname(){return typeof this.path==="string"?oa.extname(this.path):void 0}set extname(e){if(wp(e,"extname"),vC(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=oa.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){if(fl(e))e=SC(e);if(kp(e,"path"),this.path!==e)this.history.push(e)}get stem(){return typeof this.path==="string"?oa.basename(this.path,this.extname):void 0}set stem(e){kp(e,"stem"),wp(e,"stem"),this.path=oa.join(this.dirname||"",e+(this.extname||""))}fail(e,t,a){let n=this.message(e,t,a);throw n.fatal=!0,n}info(e,t,a){let n=this.message(e,t,a);return n.fatal=void 0,n}message(e,t,a){let n=new Ge(e,t,a);if(this.path)n.name=this.path+":"+n.name,n.file=this.path;return n.fatal=!1,this.messages.push(n),n}toString(e){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function wp(e,t){if(e&&e.includes(oa.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+oa.sep+"`")}function kp(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function vC(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function lB(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var CC=function(e){let n=this.constructor.prototype,i=n[e],r=function(){return i.apply(r,arguments)};return Object.setPrototypeOf(r,n),r};var sB={}.hasOwnProperty;class Ap extends CC{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Cp()}copy(){let e=new Ap,t=-1;while(++t<this.attachers.length){let a=this.attachers[t];e.use(...a)}return e.data(Wc.default(!0,{},this.namespace)),e}data(e,t){if(typeof e==="string"){if(arguments.length===2)return Tp("data",this.frozen),this.namespace[e]=t,this;return sB.call(this.namespace,e)&&this.namespace[e]||void 0}if(e)return Tp("data",this.frozen),this.namespace=e,this;return this.namespace}freeze(){if(this.frozen)return this;let e=this;while(++this.freezeIndex<this.attachers.length){let[t,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;if(a[0]===!0)a[0]=void 0;let n=t.call(e,...a);if(typeof n==="function")this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=Xc(e),a=this.parser||this.Parser;return Ip("parse",a),a(String(t),t)}process(e,t){let a=this;return this.freeze(),Ip("process",this.parser||this.Parser),Mp("process",this.compiler||this.Compiler),t?n(void 0,t):new Promise(n);function n(i,r){let l=Xc(e),s=a.parse(l);a.run(s,l,function(u,c,f){if(u||!c||!f)return o(u);let d=c,h=a.stringify(d,f);if(uB(h))f.value=h;else f.result=h;o(u,f)});function o(u,c){if(u||!c)r(u);else if(i)i(c);else Se(t,"`done` is defined if `resolve` is not"),t(void 0,c)}}}processSync(e){let t=!1,a;return this.freeze(),Ip("processSync",this.parser||this.Parser),Mp("processSync",this.compiler||this.Compiler),this.process(e,n),wC("processSync","process",t),Se(a,"we either bailed on an error or have a tree"),a;function n(i,r){t=!0,vp(i),a=r}}run(e,t,a){LC(e),this.freeze();let n=this.transformers;if(!a&&typeof t==="function")a=t,t=void 0;return a?i(void 0,a):new Promise(i);function i(r,l){Se(typeof t!=="function","`file` can’t be a `done` anymore, we checked");let s=Xc(t);n.run(e,s,o);function o(u,c,f){let d=c||e;if(u)l(u);else if(r)r(d);else Se(a,"`done` is defined if `resolve` is not"),a(void 0,d,f)}}}runSync(e,t){let a=!1,n;return this.run(e,t,i),wC("runSync","run",a),Se(n,"we either bailed on an error or have a tree"),n;function i(r,l){vp(r),n=l,a=!0}}stringify(e,t){this.freeze();let a=Xc(t),n=this.compiler||this.Compiler;return Mp("stringify",n),LC(e),n(e,a)}use(e,...t){let a=this.attachers,n=this.namespace;if(Tp("use",this.frozen),e===null||e===void 0);else if(typeof e==="function")s(e,t);else if(typeof e==="object")if(Array.isArray(e))l(e);else r(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(o){if(typeof o==="function")s(o,[]);else if(typeof o==="object")if(Array.isArray(o)){let[u,...c]=o;s(u,c)}else r(o);else throw TypeError("Expected usable value, not `"+o+"`")}function r(o){if(!("plugins"in o)&&!("settings"in o))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(l(o.plugins),o.settings)n.settings=Wc.default(!0,n.settings,o.settings)}function l(o){let u=-1;if(o===null||o===void 0);else if(Array.isArray(o))while(++u<o.length){let c=o[u];i(c)}else throw TypeError("Expected a list of plugins, not `"+o+"`")}function s(o,u){let c=-1,f=-1;while(++c<a.length)if(a[c][0]===o){f=c;break}if(f===-1)a.push([o,...u]);else if(u.length>0){let[d,...h]=u,g=a[f][1];if(go(g)&&go(d))d=Wc.default(!0,g,d);a[f]=[o,d,...h]}}}}var Ep=new Ap().freeze();function Ip(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `parser`")}function Mp(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `compiler`")}function Tp(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function LC(e){if(!go(e)||typeof e.type!=="string")throw TypeError("Expected node, got `"+e+"`")}function wC(e,t,a){if(!a)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xc(e){return oB(e)?e:new dl(e)}function oB(e){return Boolean(e&&typeof e==="object"&&"message"in e&&"messages"in e)}function uB(e){return typeof e==="string"||cB(e)}function cB(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var fB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kC=[],IC={allowDangerousHtml:!0},dB=/^(https?|ircs?|mailto|xmpp)$/i,hB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Rp(e){let t=mB(e),a=pB(e);return gB(t.runSync(t.parse(a),a),e)}function mB(e){let t=e.rehypePlugins||kC,a=e.remarkPlugins||kC,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...IC}:IC;return Ep().use(Nc).use(a).use(Yc,n).use(t)}function pB(e){let t=e.children||"",a=new dl;if(typeof t==="string")a.value=t;else yc("Unexpected value `"+t+"` for `children` prop, expected `string`");return a}function gB(e,t){let{allowedElements:a,allowElement:n,components:i,disallowedElements:r,skipHtml:l,unwrapDisallowed:s}=t,o=t.urlTransform||MC;for(let c of hB)if(Object.hasOwn(t,c.from))yc("Unexpected `"+c.from+"` prop, "+(c.to?"use `"+c.to+"` instead":"remove it")+" (see <"+fB+"#"+c.id+"> for more info)");if(a&&r)yc("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");if(t.className)e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]};return ji(e,u),Jm(e,{Fragment:ht,components:i,ignoreInvalidStyle:!0,jsx:m,jsxs:C,passKeys:!0,passNode:!0});function u(c,f,d){if(c.type==="raw"&&d&&typeof f==="number"){if(l)d.children.splice(f,1);else d.children[f]={type:"text",value:c.value};return f}if(c.type==="element"){let h;for(h in no)if(Object.hasOwn(no,h)&&Object.hasOwn(c.properties,h)){let g=c.properties[h],b=no[h];if(b===null||b.includes(c.tagName))c.properties[h]=o(String(g||""),h,c)}}if(c.type==="element"){let h=a?!a.includes(c.tagName):r?r.includes(c.tagName):!1;if(!h&&n&&typeof f==="number")h=!n(c,f,d);if(h&&d&&typeof f==="number"){if(s&&c.children)d.children.splice(f,1,...c.children);else d.children.splice(f,1);return f}}}}function MC(e){let t=e.indexOf(":"),a=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");if(t===-1||i!==-1&&t>i||a!==-1&&t>a||n!==-1&&t>n||dB.test(e.slice(0,t)))return e;return""}function Bp(e,t){let a=String(e);if(typeof t!=="string")throw TypeError("Expected character");let n=0,i=a.indexOf(t);while(i!==-1)n++,i=a.indexOf(t,i+t.length);return n}function zp(e){if(typeof e!=="string")throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _p(e,t,a){let i=Wn((a||{}).ignore||[]),r=xB(t),l=-1;while(++l<r.length)po(e,"text",s);function s(u,c){let f=-1,d;while(++f<c.length){let h=c[f],g=d?d.children:void 0;if(i(h,g?g.indexOf(h):void 0,d))return;d=h}if(d)return o(u,c)}function o(u,c){let f=c[c.length-1],d=r[l][0],h=r[l][1],g=0,S=f.children.indexOf(u),p=!1,x=[];d.lastIndex=0;let y=d.exec(u.value);while(y){let w=y.index,T={index:y.index,input:y.input,stack:[...c,u]},I=h(...y,T);if(typeof I==="string")I=I.length>0?{type:"text",value:I}:void 0;if(I===!1)d.lastIndex=w+1;else{if(g!==w)x.push({type:"text",value:u.value.slice(g,w)});if(Array.isArray(I))x.push(...I);else if(I)x.push(I);g=w+y[0].length,p=!0}if(!d.global)break;y=d.exec(u.value)}if(p){if(g<u.value.length)x.push({type:"text",value:u.value.slice(g)});f.children.splice(S,1,...x)}else x=[u];return S+x.length}}function xB(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],n=-1;while(++n<a.length){let i=a[n];t.push([yB(i[0]),bB(i[1])])}return t}function yB(e){return typeof e==="string"?new RegExp(zp(e),"g"):e}function bB(e){return typeof e==="function"?e:function(){return e}}var Np="phrasing",Op=["autolink","link","image","label"];function qp(){return{transforms:[kB],enter:{literalAutolink:SB,literalAutolinkEmail:Pp,literalAutolinkHttp:Pp,literalAutolinkWww:Pp},exit:{literalAutolink:wB,literalAutolinkEmail:LB,literalAutolinkHttp:vB,literalAutolinkWww:CB}}}function Fp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Np,notInConstruct:Op},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Np,notInConstruct:Op},{character:":",before:"[ps]",after:"\\/",inConstruct:Np,notInConstruct:Op}]}}function SB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Pp(e){this.config.enter.autolinkProtocol.call(this,e)}function vB(e){this.config.exit.autolinkProtocol.call(this,e)}function CB(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];Se(t.type==="link"),t.url="http://"+this.sliceSerialize(e)}function LB(e){this.config.exit.autolinkEmail.call(this,e)}function wB(e){this.exit(e)}function kB(e){_p(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,IB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,MB]],{ignore:["link","linkReference"]})}function IB(e,t,a,n,i){let r="";if(!TC(i))return!1;if(/^w/i.test(t))a=t+a,t="",r="http://";if(!TB(a))return!1;let l=AB(a+n);if(!l[0])return!1;let s={type:"link",title:null,url:r+t+l[0],children:[{type:"text",value:t+l[0]}]};if(l[1])return[s,{type:"text",value:l[1]}];return s}function MB(e,t,a,n){if(!TC(n,!0)||/[-\d_]$/.test(a))return!1;return{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function TB(e){let t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}function AB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],n=a.indexOf(")"),i=Bp(e,"("),r=Bp(e,")");while(n!==-1&&i>r)e+=a.slice(0,n+1),a=a.slice(n+1),n=a.indexOf(")"),r++;return[e,a]}function TC(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||La(a)||qi(a))&&(!t||a!==47)}AC.peek=PB;function EB(){this.buffer()}function DB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RB(){this.buffer()}function BB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zB(e){let t=this.resume(),a=this.stack[this.stack.length-1];Se(a.type==="footnoteReference"),a.identifier=ut(this.sliceSerialize(e)).toLowerCase(),a.label=t}function _B(e){this.exit(e)}function NB(e){let t=this.resume(),a=this.stack[this.stack.length-1];Se(a.type==="footnoteDefinition"),a.identifier=ut(this.sliceSerialize(e)).toLowerCase(),a.label=t}function OB(e){this.exit(e)}function PB(){return"["}function AC(e,t,a,n){let i=a.createTracker(n),r=i.move("[^"),l=a.enter("footnoteReference"),s=a.enter("reference");return r+=i.move(a.safe(a.associationId(e),{after:"]",before:r})),s(),l(),r+=i.move("]"),r}function Up(){return{enter:{gfmFootnoteCallString:EB,gfmFootnoteCall:DB,gfmFootnoteDefinitionLabelString:RB,gfmFootnoteDefinition:BB},exit:{gfmFootnoteCallString:zB,gfmFootnoteCall:_B,gfmFootnoteDefinitionLabelString:NB,gfmFootnoteDefinition:OB}}}function Hp(e){let t=!1;if(e&&e.firstLineBlank)t=!0;return{handlers:{footnoteDefinition:a,footnoteReference:AC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,i,r,l){let s=r.createTracker(l),o=s.move("[^"),u=r.enter("footnoteDefinition"),c=r.enter("label");if(o+=s.move(r.safe(r.associationId(n),{before:o,after:"]"})),c(),o+=s.move("]:"),n.children&&n.children.length>0)s.shift(4),o+=s.move((t?`
|
|
23
|
+
`:" ")+r.indentLines(r.containerFlow(n,s.current()),t?EC:qB));return u(),o}}function qB(e,t,a){return t===0?e:EC(e,t,a)}function EC(e,t,a){return(a?"":" ")+e}var FB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];DC.peek=VB;function Vp(){return{canContainEols:["delete"],enter:{strikethrough:UB},exit:{strikethrough:HB}}}function Gp(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:FB}],handlers:{delete:DC}}}function UB(e){this.enter({type:"delete",children:[]},e)}function HB(e){this.exit(e)}function DC(e,t,a,n){let i=a.createTracker(n),r=a.enter("strikethrough"),l=i.move("~~");return l+=a.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),r(),l}function VB(){return"~"}function GB(e){return e.length}function BC(e,t){let a=t||{},n=(a.align||[]).concat(),i=a.stringLength||GB,r=[],l=[],s=[],o=[],u=0,c=-1;while(++c<e.length){let b=[],S=[],p=-1;if(e[c].length>u)u=e[c].length;while(++p<e[c].length){let x=QB(e[c][p]);if(a.alignDelimiters!==!1){let y=i(x);if(S[p]=y,o[p]===void 0||y>o[p])o[p]=y}b.push(x)}l[c]=b,s[c]=S}let f=-1;if(typeof n==="object"&&"length"in n)while(++f<u)r[f]=RC(n[f]);else{let b=RC(n);while(++f<u)r[f]=b}f=-1;let d=[],h=[];while(++f<u){let b=r[f],S="",p="";if(b===99)S=":",p=":";else if(b===108)S=":";else if(b===114)p=":";let x=a.alignDelimiters===!1?1:Math.max(1,o[f]-S.length-p.length),y=S+"-".repeat(x)+p;if(a.alignDelimiters!==!1){if(x=S.length+x+p.length,x>o[f])o[f]=x;h[f]=x}d[f]=y}l.splice(1,0,d),s.splice(1,0,h),c=-1;let g=[];while(++c<l.length){let b=l[c],S=s[c];f=-1;let p=[];while(++f<u){let x=b[f]||"",y="",w="";if(a.alignDelimiters!==!1){let T=o[f]-(S[f]||0),I=r[f];if(I===114)y=" ".repeat(T);else if(I===99)if(T%2)y=" ".repeat(T/2+0.5),w=" ".repeat(T/2-0.5);else y=" ".repeat(T/2),w=y;else w=" ".repeat(T)}if(a.delimiterStart!==!1&&!f)p.push("|");if(a.padding!==!1&&!(a.alignDelimiters===!1&&x==="")&&(a.delimiterStart!==!1||f))p.push(" ");if(a.alignDelimiters!==!1)p.push(y);if(p.push(x),a.alignDelimiters!==!1)p.push(w);if(a.padding!==!1)p.push(" ");if(a.delimiterEnd!==!1||f!==u-1)p.push("|")}g.push(a.delimiterEnd===!1?p.join("").replace(/ +$/,""):p.join(""))}return g.join(`
|
|
24
|
+
`)}function QB(e){return e===null||e===void 0?"":String(e)}function RC(e){let t=typeof e==="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function zC(e,t,a,n){let i=a.enter("blockquote"),r=a.createTracker(n);r.move("> "),r.shift(2);let l=a.indentLines(a.containerFlow(e,r.current()),jB);return i(),l}function jB(e,t,a){return">"+(a?"":" ")+e}function NC(e,t){return _C(e,t.inConstruct,!0)&&!_C(e,t.notInConstruct,!1)}function _C(e,t,a){if(typeof t==="string")t=[t];if(!t||t.length===0)return a;let n=-1;while(++n<t.length)if(e.includes(t[n]))return!0;return!1}function Qp(e,t,a,n){let i=-1;while(++i<a.unsafe.length)if(a.unsafe[i].character===`
|
|
25
|
+
`&&NC(a.stack,a.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return"\\\n"}function OC(e,t){let a=String(e),n=a.indexOf(t),i=n,r=0,l=0;if(typeof t!=="string")throw TypeError("Expected substring");while(n!==-1){if(n===i){if(++r>l)l=r}else r=1;i=n+t.length,n=a.indexOf(t,i)}return l}function PC(e,t){return Boolean(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qC(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function FC(e,t,a,n){let i=qC(a),r=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(PC(e,a)){let f=a.enter("codeIndented"),d=a.indentLines(r,YB);return f(),d}let s=a.createTracker(n),o=i.repeat(Math.max(OC(r,i)+1,3)),u=a.enter("codeFenced"),c=s.move(o);if(e.lang){let f=a.enter(`codeFencedLang${l}`);c+=s.move(a.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),f()}if(e.lang&&e.meta){let f=a.enter(`codeFencedMeta${l}`);c+=s.move(" "),c+=s.move(a.safe(e.meta,{before:c,after:`
|
|
26
|
+
`,encode:["`"],...s.current()})),f()}if(c+=s.move(`
|
|
27
|
+
`),r)c+=s.move(r+`
|
|
28
|
+
`);return c+=s.move(o),u(),c}function YB(e,t,a){return(a?"":" ")+e}function hl(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function UC(e,t,a,n){let i=hl(a),r=i==='"'?"Quote":"Apostrophe",l=a.enter("definition"),s=a.enter("label"),o=a.createTracker(n),u=o.move("[");if(u+=o.move(a.safe(a.associationId(e),{before:u,after:"]",...o.current()})),u+=o.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url))s=a.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(a.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">");else s=a.enter("destinationRaw"),u+=o.move(a.safe(e.url,{before:u,after:e.title?" ":`
|
|
29
|
+
`,...o.current()}));if(s(),e.title)s=a.enter(`title${r}`),u+=o.move(" "+i),u+=o.move(a.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),s();return l(),u}function HC(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Zn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ml(e,t,a){let n=an(e),i=an(t);if(n===void 0)return i===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(n===1)return i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jp.peek=KB;function jp(e,t,a,n){let i=HC(a),r=a.enter("emphasis"),l=a.createTracker(n),s=l.move(i),o=l.move(a.containerPhrasing(e,{after:i,before:s,...l.current()})),u=o.charCodeAt(0),c=ml(n.before.charCodeAt(n.before.length-1),u,i);if(c.inside)o=Zn(u)+o.slice(1);let f=o.charCodeAt(o.length-1),d=ml(n.after.charCodeAt(0),f,i);if(d.inside)o=o.slice(0,-1)+Zn(f);let h=l.move(i);return r(),a.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+o+h}function KB(e,t,a){return a.options.emphasis||"*"}function VC(e,t){let a=!1;return ji(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return a=!0,Qi}),Boolean((!e.depth||e.depth<3)&&Oi(e)&&(t.options.setext||a))}function GC(e,t,a,n){let i=Math.max(Math.min(6,e.depth||1),1),r=a.createTracker(n);if(VC(e,a)){let c=a.enter("headingSetext"),f=a.enter("phrasing"),d=a.containerPhrasing(e,{...r.current(),before:`
|
|
30
|
+
`,after:`
|
|
31
|
+
`});return f(),c(),d+`
|
|
32
|
+
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
|
|
33
|
+
`))+1))}let l="#".repeat(i),s=a.enter("headingAtx"),o=a.enter("phrasing");r.move(l+" ");let u=a.containerPhrasing(e,{before:"# ",after:`
|
|
34
|
+
`,...r.current()});if(/^[\t ]/.test(u))u=Zn(u.charCodeAt(0))+u.slice(1);if(u=u?l+" "+u:l,a.options.closeAtx)u+=" "+l;return o(),s(),u}Yp.peek=XB;function Yp(e){return e.value||""}function XB(){return"<"}Kp.peek=WB;function Kp(e,t,a,n){let i=hl(a),r=i==='"'?"Quote":"Apostrophe",l=a.enter("image"),s=a.enter("label"),o=a.createTracker(n),u=o.move("![");if(u+=o.move(a.safe(e.alt,{before:u,after:"]",...o.current()})),u+=o.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url))s=a.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(a.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">");else s=a.enter("destinationRaw"),u+=o.move(a.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}));if(s(),e.title)s=a.enter(`title${r}`),u+=o.move(" "+i),u+=o.move(a.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),s();return u+=o.move(")"),l(),u}function WB(){return"!"}Xp.peek=ZB;function Xp(e,t,a,n){let i=e.referenceType,r=a.enter("imageReference"),l=a.enter("label"),s=a.createTracker(n),o=s.move("!["),u=a.safe(e.alt,{before:o,after:"]",...s.current()});o+=s.move(u+"]["),l();let c=a.stack;a.stack=[],l=a.enter("reference");let f=a.safe(a.associationId(e),{before:o,after:"]",...s.current()});if(l(),a.stack=c,r(),i==="full"||!u||u!==f)o+=s.move(f+"]");else if(i==="shortcut")o=o.slice(0,-1);else o+=s.move("]");return o}function ZB(){return"!"}Wp.peek=JB;function Wp(e,t,a){let n=e.value||"",i="`",r=-1;while(new RegExp("(^|[^`])"+i+"([^`]|$)").test(n))i+="`";if(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n)))n=" "+n+" ";while(++r<a.unsafe.length){let l=a.unsafe[r],s=a.compilePattern(l),o;if(!l.atBreak)continue;while(o=s.exec(n)){let u=o.index;if(n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13)u--;n=n.slice(0,u)+" "+n.slice(o.index+1)}}return i+n+i}function JB(){return"`"}function Zp(e,t){let a=Oi(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Jp.peek=$B;function Jp(e,t,a,n){let i=hl(a),r=i==='"'?"Quote":"Apostrophe",l=a.createTracker(n),s,o;if(Zp(e,a)){let c=a.stack;a.stack=[],s=a.enter("autolink");let f=l.move("<");return f+=l.move(a.containerPhrasing(e,{before:f,after:">",...l.current()})),f+=l.move(">"),s(),a.stack=c,f}s=a.enter("link"),o=a.enter("label");let u=l.move("[");if(u+=l.move(a.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url))o=a.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(a.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">");else o=a.enter("destinationRaw"),u+=l.move(a.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}));if(o(),e.title)o=a.enter(`title${r}`),u+=l.move(" "+i),u+=l.move(a.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o();return u+=l.move(")"),s(),u}function $B(e,t,a){return Zp(e,a)?"<":"["}$p.peek=ez;function $p(e,t,a,n){let i=e.referenceType,r=a.enter("linkReference"),l=a.enter("label"),s=a.createTracker(n),o=s.move("["),u=a.containerPhrasing(e,{before:o,after:"]",...s.current()});o+=s.move(u+"]["),l();let c=a.stack;a.stack=[],l=a.enter("reference");let f=a.safe(a.associationId(e),{before:o,after:"]",...s.current()});if(l(),a.stack=c,r(),i==="full"||!u||u!==f)o+=s.move(f+"]");else if(i==="shortcut")o=o.slice(0,-1);else o+=s.move("]");return o}function ez(){return"["}function pl(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function QC(e){let t=pl(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function jC(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Zc(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function YC(e,t,a,n){let i=a.enter("list"),r=a.bulletCurrent,l=e.ordered?jC(a):pl(a),s=e.ordered?l==="."?")":".":QC(a),o=t&&a.bulletLastUsed?l===a.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&c&&(!c.children||!c.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0)o=!0;if(Zc(a)===l&&c){let f=-1;while(++f<e.children.length){let d=e.children[f];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){o=!0;break}}}}if(o)l=s;a.bulletCurrent=l;let u=a.containerFlow(e,n);return a.bulletLastUsed=l,a.bulletCurrent=r,i(),u}function KC(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function XC(e,t,a,n){let i=KC(a),r=a.bulletCurrent||pl(a);if(t&&t.type==="list"&&t.ordered)r=(typeof t.start==="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+r;let l=r.length+1;if(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))l=Math.ceil(l/4)*4;let s=a.createTracker(n);s.move(r+" ".repeat(l-r.length)),s.shift(l);let o=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,s.current()),c);return o(),u;function c(f,d,h){if(d)return(h?"":" ".repeat(l))+f;return(h?r:r+" ".repeat(l-r.length))+f}}function WC(e,t,a,n){let i=a.enter("paragraph"),r=a.enter("phrasing"),l=a.containerPhrasing(e,n);return r(),i(),l}var eg=Wn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZC(e,t,a,n){return(e.children.some(function(l){return eg(l)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}function JC(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tg.peek=tz;function tg(e,t,a,n){let i=JC(a),r=a.enter("strong"),l=a.createTracker(n),s=l.move(i+i),o=l.move(a.containerPhrasing(e,{after:i,before:s,...l.current()})),u=o.charCodeAt(0),c=ml(n.before.charCodeAt(n.before.length-1),u,i);if(c.inside)o=Zn(u)+o.slice(1);let f=o.charCodeAt(o.length-1),d=ml(n.after.charCodeAt(0),f,i);if(d.inside)o=o.slice(0,-1)+Zn(f);let h=l.move(i+i);return r(),a.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+o+h}function tz(e,t,a){return a.options.strong||"*"}function $C(e,t,a,n){return a.safe(e.value,n)}function eL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function tL(e,t,a){let n=(Zc(a)+(a.options.ruleSpaces?" ":"")).repeat(eL(a));return a.options.ruleSpaces?n.slice(0,-1):n}var yo={blockquote:zC,break:Qp,code:FC,definition:UC,emphasis:jp,hardBreak:Qp,heading:GC,html:Yp,image:Kp,imageReference:Xp,inlineCode:Wp,link:Jp,linkReference:$p,list:YC,listItem:XC,paragraph:WC,root:ZC,strong:tg,text:$C,thematicBreak:tL};function ng(){return{enter:{table:az,tableData:aL,tableHeader:aL,tableRow:iz},exit:{codeText:rz,table:nz,tableData:ag,tableHeader:ag,tableRow:ag}}}function az(e){let t=e._align;Se(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function nz(e){this.exit(e),this.data.inTable=void 0}function iz(e){this.enter({type:"tableRow",children:[]},e)}function ag(e){this.exit(e)}function aL(e){this.enter({type:"tableCell",children:[]},e)}function rz(e){let t=this.resume();if(this.data.inTable)t=t.replace(/\\([\\|])/g,lz);let a=this.stack[this.stack.length-1];Se(a.type==="inlineCode"),a.value=t,this.exit(e)}function lz(e,t){return t==="|"?t:e}function ig(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,i=t.stringLength,r=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
35
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:l,tableCell:o,tableRow:s}};function l(h,g,b,S){return u(c(h,b,S),h.align)}function s(h,g,b,S){let p=f(h,b,S),x=u([p]);return x.slice(0,x.indexOf(`
|
|
36
|
+
`))}function o(h,g,b,S){let p=b.enter("tableCell"),x=b.enter("phrasing"),y=b.containerPhrasing(h,{...S,before:r,after:r});return x(),p(),y}function u(h,g){return BC(h,{align:g,alignDelimiters:n,padding:a,stringLength:i})}function c(h,g,b){let S=h.children,p=-1,x=[],y=g.enter("table");while(++p<S.length)x[p]=f(S[p],g,b);return y(),x}function f(h,g,b){let S=h.children,p=-1,x=[],y=g.enter("tableRow");while(++p<S.length)x[p]=o(S[p],h,g,b);return y(),x}function d(h,g,b){let S=yo.inlineCode(h,g,b);if(b.stack.includes("tableCell"))S=S.replace(/\|/g,"\\$&");return S}}function rg(){return{exit:{taskListCheckValueChecked:nL,taskListCheckValueUnchecked:nL,paragraph:sz}}}function lg(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oz}}}function nL(e){let t=this.stack[this.stack.length-2];Se(t.type==="listItem"),t.checked=e.type==="taskListCheckValueChecked"}function sz(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked==="boolean"){let a=this.stack[this.stack.length-1];Se(a.type==="paragraph");let n=a.children[0];if(n&&n.type==="text"){let i=t.children,r=-1,l;while(++r<i.length){let s=i[r];if(s.type==="paragraph"){l=s;break}}if(l===a){if(n.value=n.value.slice(1),n.value.length===0)a.children.shift();else if(a.position&&n.position&&typeof n.position.start.offset==="number")n.position.start.column++,n.position.start.offset++,a.position.start=Object.assign({},n.position.start)}}}this.exit(e)}function oz(e,t,a,n){let i=e.children[0],r=typeof e.checked==="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=a.createTracker(n);if(r)s.move(l);let o=yo.listItem(e,t,a,{...n,...s.current()});if(r)o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u);return o;function u(c){return c+l}}function sg(){return[qp(),Up(),Vp(),ng(),rg()]}function og(e){return{extensions:[Fp(),Hp(e),Gp(),ig(e),lg()]}}var uz={tokenize:mz,partial:!0},iL={tokenize:pz,partial:!0},rL={tokenize:gz,partial:!0},lL={tokenize:xz,partial:!0},cz={tokenize:yz,partial:!0},sL={name:"wwwAutolink",tokenize:dz,previous:uL},oL={name:"protocolAutolink",tokenize:hz,previous:cL},nn={name:"emailAutolink",tokenize:fz,previous:fL},ka={};function cg(){return{text:ka}}var Yi=48;while(Yi<123)if(ka[Yi]=nn,Yi++,Yi===58)Yi=65;else if(Yi===91)Yi=97;ka[43]=nn;ka[45]=nn;ka[46]=nn;ka[95]=nn;ka[72]=[nn,oL];ka[104]=[nn,oL];ka[87]=[nn,sL];ka[119]=[nn,sL];function fz(e,t,a){let n=this,i,r;return l;function l(f){if(!ug(f)||!fL.call(n,n.previous)||fg(n.events))return a(f);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(f)}function s(f){if(ug(f))return e.consume(f),s;if(f===64)return e.consume(f),o;return a(f)}function o(f){if(f===46)return e.check(cz,c,u)(f);if(f===45||f===95||Re(f))return r=!0,e.consume(f),o;return c(f)}function u(f){return e.consume(f),i=!0,o}function c(f){if(r&&i&&Ye(n.previous))return e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f);return a(f)}}function dz(e,t,a){let n=this;return i;function i(l){if(l!==87&&l!==119||!uL.call(n,n.previous)||fg(n.events))return a(l);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(uz,e.attempt(iL,e.attempt(rL,r),a),a)(l)}function r(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function hz(e,t,a){let n=this,i="",r=!1;return l;function l(f){if((f===72||f===104)&&cL.call(n,n.previous)&&!fg(n.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),s;return a(f)}function s(f){if(Ye(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),s;if(f===58){let d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(f),o}return a(f)}function o(f){if(f===47){if(e.consume(f),r)return u;return r=!0,o}return a(f)}function u(f){return f===null||Pi(f)||ee(f)||La(f)||qi(f)?a(f):e.attempt(iL,e.attempt(rL,c),a)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function mz(e,t,a){let n=0;return i;function i(l){if((l===87||l===119)&&n<3)return n++,e.consume(l),i;if(l===46&&n===3)return e.consume(l),r;return a(l)}function r(l){return l===null?a(l):t(l)}}function pz(e,t,a){let n,i,r;return l;function l(u){if(u===46||u===95)return e.check(lL,o,s)(u);if(u===null||ee(u)||La(u)||u!==45&&qi(u))return o(u);return r=!0,e.consume(u),l}function s(u){if(u===95)n=!0;else i=n,n=void 0;return e.consume(u),l}function o(u){if(i||n||!r)return a(u);return t(u)}}function gz(e,t){let a=0,n=0;return i;function i(l){if(l===40)return a++,e.consume(l),i;if(l===41&&n<a)return r(l);if(l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126)return e.check(lL,t,r)(l);if(l===null||ee(l)||La(l))return t(l);return e.consume(l),i}function r(l){if(l===41)n++;return e.consume(l),i}}function xz(e,t,a){return n;function n(s){if(s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126)return e.consume(s),n;if(s===38)return e.consume(s),r;if(s===93)return e.consume(s),i;if(s===60||s===null||ee(s)||La(s))return t(s);return a(s)}function i(s){if(s===null||s===40||s===91||ee(s)||La(s))return t(s);return n(s)}function r(s){return Ye(s)?l(s):a(s)}function l(s){if(s===59)return e.consume(s),n;if(Ye(s))return e.consume(s),l;return a(s)}}function yz(e,t,a){return n;function n(r){return e.consume(r),i}function i(r){return Re(r)?a(r):t(r)}}function uL(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ee(e)}function cL(e){return!Ye(e)}function fL(e){return!(e===47||ug(e))}function ug(e){return e===43||e===45||e===46||e===95||Re(e)}function fg(e){let t=e.length,a=!1;while(t--){let n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){a=!0;break}if(n._gfmAutolinkLiteralWalkedInto){a=!1;break}}if(e.length>0&&!a)e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return a}var bz={tokenize:Iz,partial:!0};function dg(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:Lz,continuation:{tokenize:wz},exit:kz}},text:{[91]:{name:"gfmFootnoteCall",tokenize:Cz},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Sz,resolveTo:vz}}}}function Sz(e,t,a){let n=this,i=n.events.length,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),l;while(i--){let o=n.events[i][1];if(o.type==="labelImage"){l=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return s;function s(o){if(!l||!l._balanced)return a(o);let u=ut(n.sliceSerialize({start:l.end,end:n.now()}));if(u.codePointAt(0)!==94||!r.includes(u.slice(1)))return a(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function vz(e,t){let a=e.length,n;while(a--)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){n=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[a+1],e[a+2],["enter",i,t],e[a+3],e[a+4],["enter",r,t],["exit",r,t],["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(a,e.length-a+1,...o),e}function Cz(e,t,a){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),r=0,l;return s;function s(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),o}function o(f){if(f!==94)return a(f);return e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u}function u(f){if(r>999||f===93&&!l||f===null||f===91||ee(f))return a(f);if(f===93){e.exit("chunkString");let d=e.exit("gfmFootnoteCallString");if(!i.includes(ut(n.sliceSerialize(d))))return a(f);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}if(!ee(f))l=!0;return r++,e.consume(f),f===92?c:u}function c(f){if(f===91||f===92||f===93)return e.consume(f),r++,u;return u(f)}}function Lz(e,t,a){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),r,l=0,s;return o;function o(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){if(g===94)return e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c;return a(g)}function c(g){if(l>999||g===93&&!s||g===null||g===91||ee(g))return a(g);if(g===93){e.exit("chunkString");let b=e.exit("gfmFootnoteDefinitionLabelString");return r=ut(n.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}if(!ee(g))s=!0;return l++,e.consume(g),g===92?f:c}function f(g){if(g===91||g===92||g===93)return e.consume(g),l++,c;return c(g)}function d(g){if(g===58){if(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),!i.includes(r))i.push(r);return G(e,h,"gfmFootnoteDefinitionWhitespace")}return a(g)}function h(g){return t(g)}}function wz(e,t,a){return e.check(wa,t,e.attempt(bz,t,a))}function kz(e){e.exit("gfmFootnoteDefinition")}function Iz(e,t,a){let n=this;return G(e,i,"gfmFootnoteDefinitionIndent",5);function i(r){let l=n.events[n.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(r):a(r)}}function hg(e){let a=(e||{}).singleTilde,n={name:"strikethrough",tokenize:r,resolveAll:i};if(a===null||a===void 0)a=!0;return{text:{[126]:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(l,s){let o=-1;while(++o<l.length)if(l[o][0]==="enter"&&l[o][1].type==="strikethroughSequenceTemporary"&&l[o][1]._close){let u=o;while(u--)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[o][1].end.offset-l[o][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[o][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[o][1].end)},f={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[o][1].start)},d=[["enter",c,s],["enter",l[u][1],s],["exit",l[u][1],s],["enter",f,s]],h=s.parser.constructs.insideSpan.null;if(h)Pe(d,d.length,0,Kn(h,l.slice(u+1,o),s));Pe(d,d.length,0,[["exit",f,s],["enter",l[o][1],s],["exit",l[o][1],s],["exit",c,s]]),Pe(l,u-1,o-u+3,d),o=u+d.length-2;break}}o=-1;while(++o<l.length)if(l[o][1].type==="strikethroughSequenceTemporary")l[o][1].type="data";return l}function r(l,s,o){let u=this.previous,c=this.events,f=0;return d;function d(g){if(u===126&&c[c.length-1][1].type!=="characterEscape")return o(g);return l.enter("strikethroughSequenceTemporary"),h(g)}function h(g){let b=an(u);if(g===126){if(f>1)return o(g);return l.consume(g),f++,h}if(f<2&&!a)return o(g);let S=l.exit("strikethroughSequenceTemporary"),p=an(g);return S._open=!p||p===2&&Boolean(b),S._close=!b||b===2&&Boolean(p),s(g)}}}class mg{constructor(){this.map=[]}add(e,t,a){Mz(this,e,t,a)}consume(e){if(this.map.sort(function(i,r){return i[0]-r[0]}),this.map.length===0)return;let t=this.map.length,a=[];while(t>0)t-=1,a.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];a.push(e.slice()),e.length=0;let n=a.pop();while(n){for(let i of n)e.push(i);n=a.pop()}this.map.length=0}}function Mz(e,t,a,n){let i=0;if(a===0&&n.length===0)return;while(i<e.map.length){if(e.map[i][0]===t){e.map[i][1]+=a,e.map[i][2].push(...n);return}i+=1}e.map.push([t,a,n])}function dL(e,t){let a=!1,n=[];while(t<e.length){let i=e[t];if(a){if(i[0]==="enter"){if(i[1].type==="tableContent")n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let r=n.length-1;n[r]=n[r]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else if(i[0]==="enter"&&i[1].type==="tableDelimiterRow")a=!0;t+=1}return n}function pg(){return{flow:{null:{name:"table",tokenize:Tz,resolveAll:Az}}}}function Tz(e,t,a){let n=this,i=0,r=0,l;return s;function s(v){let F=n.events.length-1;while(F>-1){let q=n.events[F][1].type;if(q==="lineEnding"||q==="linePrefix")F--;else break}let H=F>-1?n.events[F][1].type:null,B=H==="tableHead"||H==="tableRow"?I:o;if(B===I&&n.parser.lazy[n.now().line])return a(v);return B(v)}function o(v){return e.enter("tableHead"),e.enter("tableRow"),u(v)}function u(v){if(v===124)return c(v);return l=!0,r+=1,c(v)}function c(v){if(v===null)return a(v);if(U(v)){if(r>1)return r=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h;return a(v)}if(Q(v))return G(e,c,"whitespace")(v);if(r+=1,l)l=!1,i+=1;if(v===124)return e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),l=!0,c;return e.enter("data"),f(v)}function f(v){if(v===null||v===124||ee(v))return e.exit("data"),c(v);return e.consume(v),v===92?d:f}function d(v){if(v===92||v===124)return e.consume(v),f;return f(v)}function h(v){if(n.interrupt=!1,n.parser.lazy[n.now().line])return a(v);if(e.enter("tableDelimiterRow"),l=!1,Q(v))return G(e,g,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v);return g(v)}function g(v){if(v===45||v===58)return S(v);if(v===124)return l=!0,e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),b;return T(v)}function b(v){if(Q(v))return G(e,S,"whitespace")(v);return S(v)}function S(v){if(v===58)return r+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(v),e.exit("tableDelimiterMarker"),p;if(v===45)return r+=1,p(v);if(v===null||U(v))return w(v);return T(v)}function p(v){if(v===45)return e.enter("tableDelimiterFiller"),x(v);return T(v)}function x(v){if(v===45)return e.consume(v),x;if(v===58)return l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(v),e.exit("tableDelimiterMarker"),y;return e.exit("tableDelimiterFiller"),y(v)}function y(v){if(Q(v))return G(e,w,"whitespace")(v);return w(v)}function w(v){if(v===124)return g(v);if(v===null||U(v)){if(!l||i!==r)return T(v);return e.exit("tableDelimiterRow"),e.exit("tableHead"),t(v)}return T(v)}function T(v){return a(v)}function I(v){return e.enter("tableRow"),M(v)}function M(v){if(v===124)return e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),M;if(v===null||U(v))return e.exit("tableRow"),t(v);if(Q(v))return G(e,M,"whitespace")(v);return e.enter("data"),R(v)}function R(v){if(v===null||v===124||ee(v))return e.exit("data"),M(v);return e.consume(v),v===92?A:R}function A(v){if(v===92||v===124)return e.consume(v),R;return R(v)}}function Az(e,t){let a=-1,n=!0,i=0,r=[0,0,0,0],l=[0,0,0,0],s=!1,o=0,u,c,f,d=new mg;while(++a<e.length){let h=e[a],g=h[1];if(h[0]==="enter"){if(g.type==="tableHead"){if(s=!1,o!==0)hL(d,t,o,u,c),c=void 0,o=0;u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},d.add(a,0,[["enter",u,t]])}else if(g.type==="tableRow"||g.type==="tableDelimiterRow"){if(n=!0,f=void 0,r=[0,0,0,0],l=[0,a+1,0,0],s)s=!1,c={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},d.add(a,0,[["enter",c,t]]);i=g.type==="tableDelimiterRow"?2:c?3:1}else if(i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")){if(n=!1,l[2]===0){if(r[1]!==0)l[0]=l[1],f=Jc(d,t,r,i,void 0,f),r=[0,0,0,0];l[2]=a}}else if(g.type==="tableCellDivider")if(n)n=!1;else{if(r[1]!==0)l[0]=l[1],f=Jc(d,t,r,i,void 0,f);r=l,l=[r[1],a,0,0]}}else if(g.type==="tableHead")s=!0,o=a;else if(g.type==="tableRow"||g.type==="tableDelimiterRow"){if(o=a,r[1]!==0)l[0]=l[1],f=Jc(d,t,r,i,a,f);else if(l[1]!==0)f=Jc(d,t,l,i,a,f);i=0}else if(i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller"))l[3]=a}if(o!==0)hL(d,t,o,u,c);d.consume(t.events),a=-1;while(++a<t.events.length){let h=t.events[a];if(h[0]==="enter"&&h[1].type==="table")h[1]._align=dL(t.events,a)}return e}function Jc(e,t,a,n,i,r){let l=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",s="tableContent";if(a[0]!==0)r.end=Object.assign({},gl(t.events,a[0])),e.add(a[0],0,[["exit",r,t]]);let o=gl(t.events,a[1]);if(r={type:l,start:Object.assign({},o),end:Object.assign({},o)},e.add(a[1],0,[["enter",r,t]]),a[2]!==0){let u=gl(t.events,a[2]),c=gl(t.events,a[3]),f={type:"tableContent",start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",f,t]]),n!==2){let d=t.events[a[2]],h=t.events[a[3]];if(d[1].end=Object.assign({},h[1].end),d[1].type="chunkText",d[1].contentType="text",a[3]>a[2]+1){let g=a[2]+1,b=a[3]-a[2]-1;e.add(g,b,[])}}e.add(a[3]+1,0,[["exit",f,t]])}if(i!==void 0)r.end=Object.assign({},gl(t.events,i)),e.add(i,0,[["exit",r,t]]),r=void 0;return r}function hL(e,t,a,n,i){let r=[],l=gl(t.events,a);if(i)i.end=Object.assign({},l),r.push(["exit",i,t]);n.end=Object.assign({},l),r.push(["exit",n,t]),e.add(a+1,0,r)}function gl(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var Ez={name:"tasklistCheck",tokenize:Dz};function gg(){return{text:{[91]:Ez}}}function Dz(e,t,a){let n=this;return i;function i(o){if(n.previous!==null||!n._gfmTasklistFirstContentOfListItem)return a(o);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),r}function r(o){if(ee(o))return e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),l;if(o===88||o===120)return e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),l;return a(o)}function l(o){if(o===93)return e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s;return a(o)}function s(o){if(U(o))return t(o);if(Q(o))return e.check({tokenize:Rz},t,a)(o);return a(o)}}function Rz(e,t,a){return G(e,n,"whitespace");function n(i){return i===null?a(i):t(i)}}function mL(e){return kc([cg(),dg(),hg(e),pg(),gg()])}var Bz={};function $c(e){let t=this,a=e||Bz,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),r=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),l=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(mL(a)),r.push(sg()),l.push(og(a))}function tf(){return C("div",{className:"brand",children:[m("span",{className:"brand-mark",children:"V"}),C("span",{className:"brand-copy",children:[m("strong",{children:"VIBEK"}),m("small",{children:"TRADING WORKSPACE"})]})]})}var zz=[$c],_z={a:(e)=>m("a",{...e,target:"_blank",rel:"noreferrer"}),code:(e)=>m("code",{className:e.className,children:e.children})},bo=ef.memo(function({children:t}){return m("div",{className:"markdown",children:m(Rp,{remarkPlugins:zz,components:_z,children:t})})});function ua({title:e,icon:t,onClose:a,width:n="medium",children:i}){return ef.useEffect(()=>{let r=(l)=>{if(l.key==="Escape")a()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[a]),m("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:(r)=>{if(r.target===r.currentTarget)a()},children:C("section",{className:`dialog ${n}`,role:"dialog","aria-modal":"true","aria-label":e,children:[C("header",{children:[m("span",{children:t}),m("h2",{children:e}),m(Qe,{label:"关闭",icon:m(sa,{size:18}),onClick:a})]}),m("div",{className:"dialog-content",children:i})]})})}function Qe({label:e,icon:t,onClick:a,disabled:n,active:i,expanded:r,className:l=""}){return m("button",{type:"button",className:`icon-button${i?" active":""}${l?` ${l}`:""}`,"aria-label":e,"aria-expanded":r,title:e,onClick:a,disabled:n,children:t})}function af({label:e,value:t}){return C("div",{className:"code-block",children:[m("span",{children:e}),m("pre",{children:t})]})}function gL({workspace:e,setWorkspace:t,run:a,exportSession:n,openCapabilities:i,openThemeSettings:r,themeOpen:l,confirm:s}){let o=e,u=Z((S)=>S.agentStates[o]),c=Z((S)=>S.search),[f,d]=xg.useState(!1),[h,g]=xg.useState(!1),b=(S)=>{if(g(!1),S==="capabilities")i();if(S==="new"||S==="shutdown")s(S);if(S==="compact")a({type:"compact",agent:o});if(S==="export")n();if(S==="login")a({type:"login",agent:o});if(S==="logout")a({type:"logout",agent:o})};return C("header",{className:"topbar",children:[C("div",{className:"topbar-left",children:[m(tf,{}),C("nav",{className:"workspace-tabs","aria-label":"工作区",children:[C("button",{className:e==="market"?"active":"",onClick:()=>t("market"),children:[m(qt,{size:16}),"行情"]}),C("button",{className:e==="strategy"?"active":"",onClick:()=>t("strategy"),children:[m($a,{size:16}),"策略"]})]})]}),C("div",{className:"topbar-controls",children:[e==="strategy"&&f&&C("label",{className:"search-field",children:[m(Ca,{size:15}),m("input",{autoFocus:!0,value:c,onChange:(S)=>Z.getState().setSearch(S.target.value),placeholder:"搜索会话"}),c&&m(Qe,{label:"清除搜索",icon:m(sa,{size:15}),onClick:()=>Z.getState().setSearch("")})]}),e==="strategy"&&m(Qe,{label:"搜索会话",icon:m(Ca,{size:18}),active:f,onClick:()=>d((S)=>!S)}),m(Qe,{label:"切换主题",icon:m(el,{size:18}),active:l,expanded:l,onClick:()=>{g(!1),r()}}),C("div",{className:"menu-anchor",children:[m(Qe,{label:"会话菜单",icon:m(qn,{size:20}),active:h,onClick:()=>g((S)=>!S)}),h&&m(Nz,{assistant:!0,authenticated:u.runtime.authenticated,busy:u.runtime.busy,onAction:b})]})]})]})}function xL(){let e=Z((r)=>r.connection),t=ke((r)=>r.connection),a=ke((r)=>r.phase),n=ke((r)=>r.tradingDay),i=ke((r)=>r.selectedInstrumentID);return C("footer",{className:"statusbar",children:[C("span",{className:`connection ${e}`,children:[m("i",{}),"WebUI ",pL(e)]}),C("span",{className:`connection ${t}`,children:[m("i",{}),"daemon ",pL(t)]}),m("span",{className:"workspace",children:i??"行情"}),m("span",{children:Oz(a)}),m("span",{children:n?`交易日 ${n}`:"交易日 --"})]})}function yL({agent:e,onClose:t}){let a=Z((n)=>n.agentStates[e].capabilities);return m(ua,{title:"后端能力",icon:m(al,{size:19}),onClose:t,width:"wide",children:C("div",{className:"capability-grid",children:[C("section",{children:[C("h3",{children:[m(zi,{size:16})," 工具"]}),m("div",{className:"tag-list",children:a.tools.map((n)=>m("span",{children:n},n))})]}),C("section",{children:[C("h3",{children:[m(Sa,{size:16})," Skills"]}),a.skills.map((n)=>C("div",{className:"capability-item",children:[m("strong",{children:n.name}),m("p",{children:n.description})]},n.name))]}),C("section",{children:[C("h3",{children:[m(Ai,{size:16})," Prompts"]}),a.prompts.map((n)=>C("div",{className:"capability-item",children:[C("strong",{children:["/",n.name]}),m("p",{children:n.description})]},n.name))]})]})})}function bL({onClose:e}){let t=Vn((n)=>n.theme),a=Vn((n)=>n.setTheme);return m(ua,{title:"界面主题",icon:m(el,{size:19}),onClose:e,width:"wide",children:m("div",{className:"theme-dialog",children:m("div",{className:"theme-options",role:"radiogroup","aria-label":"界面主题",children:w0.map((n)=>{let i=n.id===t;return C("button",{type:"button",className:`theme-card${i?" selected":""}`,role:"radio","aria-checked":i,onClick:()=>a(n.id),children:[C("span",{className:"theme-preview",style:{backgroundColor:n.swatches[1]},"aria-hidden":"true",children:[m("i",{className:"theme-preview-bar",style:{backgroundColor:n.swatches[0]}}),m("i",{className:"theme-preview-candle up",style:{backgroundColor:n.swatches[2],color:n.swatches[2]}}),m("i",{className:"theme-preview-candle down",style:{backgroundColor:n.chart.candleDown,color:n.chart.candleDown}}),m("i",{className:"theme-preview-line",style:{backgroundColor:n.swatches[0]}})]}),C("span",{className:"theme-card-copy",children:[m("strong",{children:n.name}),m("small",{children:n.subtitle}),m("span",{className:"theme-swatches","aria-hidden":"true",children:n.swatches.map((r)=>m("i",{style:{backgroundColor:r}},r))})]}),m("span",{className:"theme-check","aria-hidden":"true",children:i&&m(kt,{size:15})})]},n.id)})})})})}function SL({kind:e,onCancel:t,onConfirm:a}){let n=e==="shutdown";return C(ua,{title:n?"停止 WebUI":"开启新会话",icon:n?m(ra,{size:19}):m(js,{size:19}),onClose:t,width:"small",children:[m("p",{className:"confirm-copy",children:n?"当前浏览器连接将断开。":"当前会话记录将被清空;策略文件不会改变。"}),C("div",{className:"dialog-footer",children:[m("button",{className:"button ghost",onClick:t,children:"取消"}),m("button",{className:`button ${n?"danger":"primary"}`,onClick:a,children:n?"停止服务":"新建会话"})]})]})}function Nz({assistant:e,authenticated:t,busy:a,onAction:n}){return C("div",{className:"action-menu",children:[e&&C("button",{onClick:()=>n(t?"logout":"login"),disabled:a,children:[t?m(Vs,{size:16}):m(Ri,{size:16}),t?"退出提供商":"登录提供商"]}),e&&C("button",{onClick:()=>n("new"),disabled:a,children:[m(la,{size:16}),"新会话"]}),e&&C("button",{onClick:()=>n("compact"),disabled:a,children:[m(en,{size:16}),"压缩上下文"]}),e&&C("button",{onClick:()=>n("export"),disabled:a,children:[m(Ei,{size:16}),"导出会话"]}),C("button",{onClick:()=>n("capabilities"),children:[m(al,{size:16}),"后端能力"]}),m("hr",{}),C("button",{className:"danger-text",onClick:()=>n("shutdown"),disabled:a,children:[m(ra,{size:16}),"停止 WebUI"]})]})}function pL(e){if(e==="connected")return"已连接";if(e==="reconnecting")return"重连中";if(e==="connecting")return"连接中";return"已断开"}function Oz(e){if(e==="running")return"行情运行中";if(e==="starting")return"行情启动中";if(e==="faulted")return"行情故障";return"行情已停止"}var vo=qe(Je(),1);function vL(e){return e.questions.map(()=>({selected:[],custom:"",customEnabled:!1,notes:""}))}function CL(e,t,a){if(!e.multiSelect)return{...t,selected:[a],customEnabled:!1};let n=t.selected.includes(a)?t.selected.filter((i)=>i!==a):[...t.selected,a];return{...t,selected:n}}function LL(e,t){if(e.multiSelect)return{...t,customEnabled:!t.customEnabled};return{...t,selected:[],customEnabled:!0}}function yg(e,t){let a=t.customEnabled&&t.custom.trim()!=="";if(e.multiSelect)return t.selected.length>0||a;return a||!t.customEnabled&&t.selected.length===1}function wL(e,t){return{answers:e.questions.map((n,i)=>{let r=t[i];if(!r||!yg(n,r))throw Error(`Question ${i+1} is incomplete`);let l=r.notes.trim()||void 0;if(n.multiSelect){let s=r.customEnabled?r.custom.trim()||void 0:void 0;return{questionIndex:i,question:n.question,kind:"multi",answer:null,selected:r.selected,...s?{custom:s}:{},...l?{notes:l}:{}}}if(r.customEnabled)return{questionIndex:i,question:n.question,kind:"custom",answer:r.custom.trim(),...l?{notes:l}:{}};return{questionIndex:i,question:n.question,kind:"option",answer:r.selected[0],...l?{notes:l}:{}}}),cancelled:!1}}class So{values=new Map;register(e,t){if(this.values.has(e))throw Error(`Renderer already registered: ${String(e)}`);return this.values.set(e,t),()=>{if(this.values.get(e)===t)this.values.delete(e)}}resolve(e){return this.values.get(e)}}var kL=new So;function nf(e,t){return kL.register(e,t)}function bg({agent:e,request:t,run:a}){let n=(r)=>a({type:"ui_response",agent:e,requestId:t.id,response:r}),i=kL.resolve(t.kind);if(!i)return null;return m(i,{agent:e,request:t,respond:n})}function Pz({request:e,respond:t}){return m(IL,{title:e.title,icon:m(Hn,{size:19}),items:e.providers,value:(a)=>a.id,label:(a)=>a.name,detail:(a)=>`${a.authType==="oauth"?"OAuth":"API Key"}${a.authenticated?" · 已配置":""}`,onCancel:()=>void t({cancelled:!0}),onSelect:(a)=>void t({value:a.id})})}function qz({request:e,respond:t}){return m(IL,{title:e.title,icon:m(Mi,{size:19}),items:e.models,value:(a)=>a.ref,label:(a)=>a.name,detail:(a)=>`${a.provider} / ${a.id}${a.supportsThinking?" · 支持思考":""}`,current:e.current,onCancel:()=>void t({cancelled:!0}),onSelect:(a)=>void t({value:a.ref})})}function IL({title:e,icon:t,items:a,value:n,label:i,detail:r,current:l,onCancel:s,onSelect:o}){let[u,c]=vo.useState(""),f=a.filter((d)=>`${i(d)} ${r(d)}`.toLowerCase().includes(u.toLowerCase()));return C(ua,{title:e,icon:t,onClose:s,width:"medium",children:[C("label",{className:"dialog-search",children:[m(Ca,{size:16}),m("input",{autoFocus:!0,value:u,onChange:(d)=>c(d.target.value),placeholder:"筛选"})]}),C("div",{className:"selection-list",children:[f.map((d)=>C("button",{className:l===n(d)?"selected":"",onClick:()=>o(d),children:[C("span",{children:[m("strong",{children:i(d)}),m("small",{children:r(d)})]}),l===n(d)&&m(kt,{size:17})]},n(d))),f.length===0&&m("p",{className:"no-results",children:"没有匹配项"})]})]})}function Fz({agent:e,request:t,respond:a}){let n=Z((o)=>o.authEvents[e]),[i,r]=vo.useState(""),l=t.prompt,s=(o)=>{if(o.preventDefault(),l.type!=="select"&&i.trim()==="")return;a({value:i}),r("")};return C(ua,{title:`登录 ${t.providerId}`,icon:m(Hn,{size:19}),onClose:()=>void a({cancelled:!0}),width:"medium",children:[C("form",{className:"auth-form",onSubmit:s,children:[m("p",{children:l.message}),l.type==="select"?m("div",{className:"selection-list compact",children:l.options.map((o)=>m("button",{type:"button",onClick:()=>void a({value:o.id}),children:C("span",{children:[m("strong",{children:o.label}),o.description&&m("small",{children:o.description})]})},o.id))}):C("div",{className:"auth-input-row",children:[m("input",{autoFocus:!0,type:l.type==="secret"?"password":"text",value:i,onChange:(o)=>r(o.target.value),placeholder:l.placeholder,autoComplete:"off"}),C("button",{className:"button primary",disabled:!i.trim(),children:[m(kt,{size:16})," 确认"]})]})]}),n.length>0&&m(Uz,{events:n})]})}function Uz({events:e}){return m("div",{className:"auth-events",children:e.map((t,a)=>{if(t.type==="device_code")return C("div",{className:"device-code",children:[m("small",{children:"设备代码"}),m("strong",{children:t.userCode}),C("a",{href:t.verificationUri,target:"_blank",rel:"noreferrer",children:["打开验证页面 ",m(Di,{size:13})]})]},a);if(t.type==="auth_url")return C("div",{children:[m("p",{children:t.instructions||"在浏览器中继续授权"}),C("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["打开授权页面 ",m(Di,{size:13})]})]},a);return C("div",{children:[m("p",{children:t.message}),t.links?.map((n)=>C("a",{href:n.url,target:"_blank",rel:"noreferrer",children:[n.label||n.url," ",m(Di,{size:13})]},n.url))]},a)})})}function Hz({request:e,respond:t}){let[a,n]=vo.useState(0),[i,r]=vo.useState(()=>vL(e.params)),l=e.params.questions[a],s=i[a],o=e.params.questions.map((h,g)=>{let b=i[g];return b?yg(h,b):!1}),u=o.every(Boolean),c=(h)=>{r((g)=>g.map((b,S)=>S===a?h:b))},f=(h)=>{if(s)c({...s,...h})},d=()=>{if(!u)return;t({questionnaire:wL(e.params,i)})};if(!l||!s)return null;return C(ua,{title:"需要你的选择",icon:m(Bi,{size:19}),onClose:()=>void t({cancelled:!0}),width:"wide",children:[m("div",{className:"question-tabs","aria-label":"问题进度",children:e.params.questions.map((h,g)=>C("button",{className:g===a?"active":"",onClick:()=>n(g),children:[m("span",{children:o[g]?m(kt,{size:13}):g+1}),h.header]},h.question))}),C("section",{className:"question-body",children:[C("div",{className:"question-heading",children:[m("small",{children:l.multiSelect?"可多选":"单选"}),m("h2",{children:l.question})]}),C("div",{className:"question-options",children:[l.options.map((h)=>{let g=s.selected.includes(h.label);return C("label",{className:g?"checked":"",children:[m("input",{type:l.multiSelect?"checkbox":"radio",checked:g,onChange:()=>c(CL(l,s,h.label))}),m("span",{className:"choice-control",children:g&&m(kt,{size:13})}),C("span",{children:[m("strong",{children:h.label}),m("small",{children:h.description})]})]},h.label)}),C("label",{className:`custom-choice${s.customEnabled?" checked":""}`,children:[m("input",{type:l.multiSelect?"checkbox":"radio",checked:s.customEnabled,onChange:()=>c(LL(l,s))}),m("span",{className:"choice-control",children:s.customEnabled&&m(kt,{size:13})}),C("span",{children:[m("strong",{children:"自定义"}),m("small",{children:l.multiSelect?"补充一个未列出的选择":"输入不同的选择"})]})]})]}),s.customEnabled&&m("textarea",{className:"question-textarea",autoFocus:!0,value:s.custom,onChange:(h)=>f({custom:h.target.value}),placeholder:"你的选择"}),C("label",{className:"notes-field",children:[C("span",{children:["补充说明 ",m("small",{children:"可选"})]}),m("textarea",{value:s.notes,onChange:(h)=>f({notes:h.target.value})})]}),m(Vz,{question:l,draft:s})]}),C("div",{className:"dialog-footer questionnaire-footer",children:[m("button",{className:"button ghost",onClick:()=>void t({cancelled:!0}),children:"取消"}),C("span",{children:[o.filter(Boolean).length," / ",o.length]}),a<e.params.questions.length-1?C("button",{className:"button primary",disabled:!o[a],onClick:()=>n(a+1),children:["下一题 ",m(Ja,{className:"rotate-left",size:16})]}):C("button",{className:"button primary",disabled:!u,onClick:d,children:[m(kt,{size:16})," 提交选择"]})]})]})}function Vz({question:e,draft:t}){if(t.customEnabled||e.multiSelect)return null;let a=e.options.find((n)=>n.label===t.selected[0])?.preview;if(!a)return null;return C("div",{className:"question-preview",children:[C("div",{className:"preview-label",children:[m(Gs,{size:14})," 预览"]}),m(bo,{children:a})]})}nf("provider",Pz);nf("model",qz);nf("auth",Fz);nf("questionnaire",Hz);class ML{onFlush;schedule;pending=new Map;cancelScheduled;constructor(e,t=jz){this.onFlush=e;this.schedule=t}push(e){let t=Qz(e),a=this.pending.get(t);if(a)a.delta+=e.delta;else this.pending.set(t,Gz(e));if(!this.cancelScheduled)this.cancelScheduled=this.schedule(()=>{this.cancelScheduled=void 0,this.flush()})}flushAgent(e){let t=[];for(let[a,n]of this.pending){if(n.agent!==e)continue;t.push(n),this.pending.delete(a)}if(this.cancelIfEmpty(),t.length>0)this.onFlush(t)}discardEntry(e,t){for(let[a,n]of this.pending)if(n.agent===e&&n.entryId===t)this.pending.delete(a);this.cancelIfEmpty()}discardAgent(e){for(let[t,a]of this.pending)if(a.agent===e)this.pending.delete(t);this.cancelIfEmpty()}clear(){this.pending.clear(),this.cancelScheduled?.(),this.cancelScheduled=void 0}flush(){if(this.pending.size===0)return;let e=[...this.pending.values()];this.pending.clear(),this.cancelScheduled?.(),this.cancelScheduled=void 0,this.onFlush(e)}cancelIfEmpty(){if(this.pending.size>0)return;this.cancelScheduled?.(),this.cancelScheduled=void 0}}class Sg{callbacks;socket;stopped=!1;generation=0;reconnectAttempt=0;reconnectTimer;pending=new Map;transcriptDeltas;constructor(e){this.callbacks=e;this.transcriptDeltas=new ML((t)=>e.onTranscriptDeltas(t))}start(){this.stopped=!1,this.transcriptDeltas.clear();let e=++this.generation;this.socket?.close(),this.socket=void 0,this.callbacks.onConnection("connecting"),this.connect(e)}stop(){this.stopped=!0,this.generation+=1,clearTimeout(this.reconnectTimer),this.transcriptDeltas.clear(),this.socket?.close(),this.rejectPending("连接已关闭"),this.callbacks.onConnection("disconnected")}send(e){if(this.socket?.readyState!==WebSocket.OPEN)return Promise.reject(Error("WebUI 尚未连接"));let t=crypto.randomUUID(),a={...e,id:t};return new Promise((n,i)=>{let r=setTimeout(()=>{this.pending.delete(t),i(Error("操作等待超时"))},1800000);this.pending.set(t,{resolve:n,reject:i,timer:r}),this.socket?.send(JSON.stringify(a))})}async connect(e){try{let t=await fetch("/v1/bootstrap",{cache:"no-store",credentials:"same-origin"});if(!t.ok)throw Error(`初始化失败 (${t.status})`);let a=await t.json();if(typeof a.token!=="string")throw Error("初始化响应无效");if(this.stopped||e!==this.generation)return;let n=location.protocol==="https:"?"wss:":"ws:",i=new WebSocket(`${n}//${location.host}/v1/events?token=${encodeURIComponent(a.token)}`);this.socket=i,i.addEventListener("open",()=>{if(e!==this.generation){i.close();return}this.reconnectAttempt=0,this.callbacks.onConnection("connected")}),i.addEventListener("message",(r)=>this.receive(r.data)),i.addEventListener("close",()=>{if(e!==this.generation||this.socket!==i)return;if(this.socket=void 0,this.transcriptDeltas.clear(),this.rejectPending("连接已中断"),!this.stopped)this.scheduleReconnect(e)}),i.addEventListener("error",()=>i.close())}catch(t){if(e!==this.generation)return;if(this.callbacks.onError(t instanceof Error?t.message:String(t)),!this.stopped)this.scheduleReconnect(e)}}receive(e){if(typeof e!=="string")return;let t;try{t=JSON.parse(e)}catch{this.callbacks.onError("收到无法解析的服务端消息");return}if(t.type==="command_result")this.resolveCommand(t);if(t.type==="agent_transcript_delta"){this.transcriptDeltas.push(t);return}this.prepareTranscriptMessage(t),this.callbacks.onMessage(t)}prepareTranscriptMessage(e){switch(e.type){case"snapshot":case"server_stopping":this.transcriptDeltas.clear();return;case"agent_transcript_reset":this.transcriptDeltas.discardAgent(e.agent);return;case"agent_transcript_update":this.transcriptDeltas.discardEntry(e.agent,e.entry.id);return;case"agent_transcript_append":this.transcriptDeltas.flushAgent(e.agent);return;default:return}}resolveCommand(e){let t=this.pending.get(e.id);if(!t)return;if(clearTimeout(t.timer),this.pending.delete(e.id),e.success)t.resolve(e.data);else t.reject(Error(e.error))}scheduleReconnect(e){clearTimeout(this.reconnectTimer),this.callbacks.onConnection("reconnecting");let t=Math.min(1e4,500*2**this.reconnectAttempt);this.reconnectAttempt+=1,this.reconnectTimer=setTimeout(()=>{if(e===this.generation)this.connect(e)},t)}rejectPending(e){for(let t of this.pending.values())clearTimeout(t.timer),t.reject(Error(e));this.pending.clear()}}function Gz(e){return{agent:e.agent,entryId:e.entryId,blockIndex:e.blockIndex,blockType:e.blockType,delta:e.delta}}function Qz(e){return`${e.agent}\x00${e.entryId}\x00${e.blockIndex}\x00${e.blockType}`}function jz(e){let t=setTimeout(e,32);return()=>clearTimeout(t)}var Me=qe(Je(),1);function fe(e){var{width:t,height:a}=e;if(t<0)throw Error("Negative width is not allowed for Size");if(a<0)throw Error("Negative height is not allowed for Size");return{width:t,height:a}}function Ia(e,t){return e.width===t.width&&e.height===t.height}var Yz=function(){function e(t){var a=this;this._resolutionListener=function(){return a._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t){var a=this,n={next:t};return this._observers.push(n),{unsubscribe:function(){a._observers=a._observers.filter(function(i){return i!==n})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){if(this._resolutionMediaQueryList!==null)this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach(function(a){return a.next(t._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function TL(e){return new Yz(e)}var Kz=function(){function e(t,a,n){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=fe({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=a!==null&&a!==void 0?a:function(r){return r},this._allowResizeObserver=(i=n===null||n===void 0?void 0:n.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var t,a;if(this._canvasElement===null)throw Error("Object is disposed");(t=this._canvasElementResizeObserver)===null||t===void 0||t.disconnect(),this._canvasElementResizeObserver=null,(a=this._devicePixelRatioObservable)===null||a===void 0||a.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return fe({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=fe(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(a){return a!==t})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(a){return a!==t})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize===null)return;var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)},e.prototype._resizeBitmap=function(t){var a=this.bitmapSize;if(Ia(a,t))return;this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(a,t)},e.prototype._emitBitmapSizeChanged=function(t,a){var n=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(n,t,a)})},e.prototype._suggestNewBitmapSize=function(t){var a=this._suggestedBitmapSize,n=fe(this._transformBitmapSize(t,this._canvasElementClientSize)),i=Ia(this.bitmapSize,n)?null:n;if(a===null&&i===null)return;if(a!==null&&i!==null&&Ia(a,i))return;this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(a,i)},e.prototype._emitSuggestedBitmapSizeChanged=function(t,a){var n=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(n,t,a)})},e.prototype._chooseAndInitObserver=function(){var t=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}Xz().then(function(a){return a?t._initResizeObserver():t._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var t=this;if(this._canvasElement===null)return;var a=AL(this._canvasElement);if(a===null)throw Error("No window is associated with the canvas");this._devicePixelRatioObservable=TL(a),this._devicePixelRatioObservable.subscribe(function(){return t._invalidateBitmapSize()}),this._invalidateBitmapSize()},e.prototype._invalidateBitmapSize=function(){var t,a;if(this._canvasElement===null)return;var n=AL(this._canvasElement);if(n===null)return;var i=(a=(t=this._devicePixelRatioObservable)===null||t===void 0?void 0:t.value)!==null&&a!==void 0?a:n.devicePixelRatio,r=this._canvasElement.getClientRects(),l=r[0]!==void 0?Wz(r[0],i):fe({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(l)},e.prototype._initResizeObserver=function(){var t=this;if(this._canvasElement===null)return;this._canvasElementResizeObserver=new ResizeObserver(function(a){var n=a.find(function(l){return l.target===t._canvasElement});if(!n||!n.devicePixelContentBoxSize||!n.devicePixelContentBoxSize[0])return;var i=n.devicePixelContentBoxSize[0],r=fe({width:i.inlineSize,height:i.blockSize});t._suggestNewBitmapSize(r)}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"})},e}();function vg(e,t){if(t.type==="device-pixel-content-box")return new Kz(e,t.transform,t.options);throw Error("Unsupported binding target")}function AL(e){return e.ownerDocument.defaultView}function Xz(){return new Promise(function(e){var t=new ResizeObserver(function(a){e(a.every(function(n){return"devicePixelContentBoxSize"in n})),t.disconnect()});t.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function Wz(e,t){return fe({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var EL=function(){function e(t,a,n){if(a.width===0||a.height===0)throw TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=a,n.width===0||n.height===0)throw TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=n,this._context=t}return e.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function rn(e,t){var a=e.canvasElementClientSize;if(a.width===0||a.height===0)return null;var n=e.bitmapSize;if(n.width===0||n.height===0)return null;var i=e.canvasElement.getContext("2d",t);if(i===null)return null;return new EL(i,a,n)}/*!
|
|
37
|
+
* @license
|
|
38
|
+
* TradingView Lightweight Charts™ v5.2.1
|
|
39
|
+
* Copyright (c) 2026 TradingView, Inc.
|
|
40
|
+
* Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
|
|
41
|
+
*/var vw={title:"",visible:!0,hitTestTolerance:3,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:0.01}},DL,RL;function Wi(e,t){let a=function(n,i){switch(n){case 0:default:return[];case 1:return[i,i];case 2:return[2*i,2*i];case 3:return[6*i,6*i];case 4:return[i,4*i]}}(t,e.lineWidth);return e.setLineDash(a),a}function Cw(e,t,a,n){e.beginPath();let i=e.lineWidth%2?0.5:0;e.moveTo(a,t+i),e.lineTo(n,t+i),e.stroke()}function lt(e,t){if(!e)throw Error("Assertion failed"+(t?": "+t:""))}function Mt(e){if(e===void 0)throw Error("Value is undefined");return e}function z(e){if(e===null)throw Error("Value is null");return e}function $n(e){return z(Mt(e))}(function(e){e[e.Simple=0]="Simple",e[e.WithSteps=1]="WithSteps",e[e.Curved=2]="Curved"})(DL||(DL={})),function(e){e[e.Solid=0]="Solid",e[e.Dotted=1]="Dotted",e[e.Dashed=2]="Dashed",e[e.LargeDashed=3]="LargeDashed",e[e.SparseDotted=4]="SparseDotted"}(RL||(RL={}));class Be{constructor(){this.t=[]}i(e,t,a){let n={h:e,l:t,o:a===!0};this.t.push(n)}_(e){let t=this.t.findIndex((a)=>e===a.h);t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter((t)=>t.l!==e)}p(e,t,a){let n=[...this.t];this.t=this.t.filter((i)=>!i.o),n.forEach((i)=>i.h(e,t,a))}v(){return this.t.length>0}m(){this.t=[]}}function Ft(e,...t){for(let a of t)for(let n in a)a[n]!==void 0&&Object.prototype.hasOwnProperty.call(a,n)&&!["__proto__","constructor","prototype"].includes(n)&&(typeof a[n]!="object"||e[n]===void 0||Array.isArray(a[n])?e[n]=a[n]:Ft(e[n],a[n]));return e}function Zi(e){return typeof e=="number"&&isFinite(e)}function Ao(e){return typeof e=="number"&&e%1==0}function Ro(e){return typeof e=="string"}function rf(e){return typeof e=="boolean"}function ln(e){let t=e;if(!t||typeof t!="object")return t;let a,n,i;for(n in a=Array.isArray(t)?[]:{},t)t.hasOwnProperty(n)&&(i=t[n],a[n]=i&&typeof i=="object"?ln(i):i);return a}function BL(e){return e!==null}function Eo(e){return e===null?void 0:e}var Lw="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function Do(e,t,a){return t===void 0&&(t=Lw),`${a=a!==void 0?`${a} `:""}${e}px ${t}`}class ww{constructor(e){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",I:0,V:0,B:0,A:0,L:0},this.O=e}N(){let e=this.M,t=this.F(),a=this.W();return e.P===t&&e.T===a||(e.P=t,e.T=a,e.k=Do(t,a),e.A=0.20833333333333334*t,e.I=e.A,e.V=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}}function Cg(e){return e<0?0:e>255?255:Math.round(e)||0}function zL(e){return 0.199*e[0]+0.687*e[1]+0.114*e[2]}class kw{constructor(e,t){this.j=new Map,this.q=e,t&&(this.j=t)}Y(e,t){if(e==="transparent")return e;let a=this.K(e),n=a[3];return`rgba(${a[0]}, ${a[1]}, ${a[2]}, ${t*n})`}G(e){let t=this.K(e);return{Z:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,X:zL(t)>160?"black":"white"}}J(e){return zL(this.K(e))}tt(e,t,a){let[n,i,r,l]=this.K(e),[s,o,u,c]=this.K(t),f=[Cg(n+a*(s-n)),Cg(i+a*(o-i)),Cg(r+a*(u-r)),(d=l+a*(c-l),d<=0||d>1?Math.min(Math.max(d,0),1):Math.round(1e4*d)/1e4)];var d;return`rgba(${f[0]}, ${f[1]}, ${f[2]}, ${f[3]})`}K(e){let t=this.j.get(e);if(t)return t;let a=function(r){let l=document.createElement("div");l.style.display="none",document.body.appendChild(l),l.style.color=r;let s=window.getComputedStyle(l).color;return document.body.removeChild(l),s}(e),n=a.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.q.length)for(let r of this.q){let l=r(e);if(l)return this.j.set(e,l),l}throw Error(`Failed to parse color: ${e}`)}let i=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(e,i),i}}class Iw{constructor(){this.it=[]}nt(e){this.it=e}st(e,t,a){this.it.forEach((n)=>{n.st(e,t,a)})}}class on{st(e,t,a){e.useBitmapCoordinateSpace((n)=>this.et(n,t,a))}}class Mw extends on{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:a}){if(this.rt===null||this.rt.lt===null)return;let n=this.rt.lt,i=this.rt,r=Math.max(1,Math.floor(t))%2/2,l=(s)=>{e.beginPath();for(let o=n.to-1;o>=n.from;--o){let u=i.ot[o],c=Math.round(u._t*t)+r,f=u.ut*a,d=s*a+r;e.moveTo(c,f),e.arc(c,f,d,0,2*Math.PI)}e.fill()};i.ct>0&&(e.fillStyle=i.dt,l(i.ft+i.ct)),e.fillStyle=i.vt,l(i.ft)}}function Zz(){return{ot:[{_t:0,ut:0,wt:0,Mt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}var Jz={from:0,to:1};class Tw{constructor(e,t,a){this.gt=new Iw,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=t,this.yt=a,this.gt.nt(this.bt)}Pt(e){this.kt(),this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.gt}kt(){let e=this.yt.Dt();e.length!==this.bt.length&&(this.St=e.map(Zz),this.bt=this.St.map((t)=>{let a=new Mw;return a.ht(t),a}),this.gt.nt(this.bt))}Rt(){let e=this.Ct.N().mode===2||!this.Ct.It(),t=this.yt.Vt(),a=this.Ct.Bt(),n=this.O.Et();this.kt(),t.forEach((i,r)=>{let l=this.St[r],s=i.At(a),o=i.Lt();!e&&s!==null&&i.It()&&o!==null?(l.vt=s.zt,l.ft=s.ft,l.ct=s.Ot,l.ot[0].Mt=s.Mt,l.ot[0].ut=i.Ft().Nt(s.Mt,o.Wt),l.dt=s.Ht??this.O.Ut(l.ot[0].ut/i.Ft().$t()),l.ot[0].wt=a,l.ot[0]._t=n.jt(a),l.lt=Jz):l.lt=null})}}class Aw extends on{constructor(e){super(),this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:a,verticalPixelRatio:n}){if(this.qt===null)return;let i=this.qt.Yt.It,r=this.qt.Kt.It;if(!i&&!r)return;let l=Math.round(this.qt._t*a),s=Math.round(this.qt.ut*n);e.lineCap="butt",i&&l>=0&&(e.lineWidth=Math.floor(this.qt.Yt.ct*a),e.strokeStyle=this.qt.Yt.R,e.fillStyle=this.qt.Yt.R,Wi(e,this.qt.Yt.Gt),function(o,u,c,f){o.beginPath();let d=o.lineWidth%2?0.5:0;o.moveTo(u+d,c),o.lineTo(u+d,f),o.stroke()}(e,l,0,t.height)),r&&s>=0&&(e.lineWidth=Math.floor(this.qt.Kt.ct*n),e.strokeStyle=this.qt.Kt.R,e.fillStyle=this.qt.Kt.R,Wi(e,this.qt.Kt.Gt),Cw(e,s,0,t.width))}}class Ew{constructor(e,t){this.xt=!0,this.Zt={Yt:{ct:1,Gt:0,R:"",It:!1},Kt:{ct:1,Gt:0,R:"",It:!1},_t:0,ut:0},this.Xt=new Aw(this.Zt),this.Jt=e,this.yt=t}Pt(){this.xt=!0}Tt(e){return this.xt&&(this.Rt(),this.xt=!1),this.Xt}Rt(){let e=this.Jt.It(),t=this.yt.Qt().N().crosshair,a=this.Zt;if(t.mode===2)return a.Kt.It=!1,void(a.Yt.It=!1);a.Kt.It=e&&this.Jt.ti(this.yt),a.Yt.It=e&&this.Jt.ii(),a.Kt.ct=t.horzLine.width,a.Kt.Gt=t.horzLine.style,a.Kt.R=t.horzLine.color,a.Yt.ct=t.vertLine.width,a.Yt.Gt=t.vertLine.style,a.Yt.R=t.vertLine.color,a._t=this.Jt.ni(),a.ut=this.Jt.si()}}function $z(e,t,a,n,i,r){e.fillRect(t+r,a,n-2*r,r),e.fillRect(t+r,a+i-r,n-2*r,r),e.fillRect(t,a,r,i),e.fillRect(t+n-r,a,r,i)}function Lf(e,t,a,n,i,r){e.save(),e.globalCompositeOperation="copy",e.fillStyle=r,e.fillRect(t,a,n,i),e.restore()}function _L(e,t,a,n,i,r){e.beginPath(),e.roundRect?e.roundRect(t,a,n,i,r):(e.lineTo(t+n-r[1],a),r[1]!==0&&e.arcTo(t+n,a,t+n,a+r[1],r[1]),e.lineTo(t+n,a+i-r[2]),r[2]!==0&&e.arcTo(t+n,a+i,t+n-r[2],a+i,r[2]),e.lineTo(t+r[3],a+i),r[3]!==0&&e.arcTo(t,a+i,t,a+i-r[3],r[3]),e.lineTo(t,a+r[0]),r[0]!==0&&e.arcTo(t,a,t+r[0],a,r[0]))}function NL(e,t,a,n,i,r,l=0,s=[0,0,0,0],o=""){if(e.save(),!l||!o||o===r)return _L(e,t,a,n,i,s),e.fillStyle=r,e.fill(),void e.restore();let u=l/2;var c;_L(e,t+u,a+u,n-l,i-l,(c=-u,s.map((f)=>f===0?f:f+c))),r!=="transparent"&&(e.fillStyle=r,e.fill()),o!=="transparent"&&(e.lineWidth=l,e.strokeStyle=o,e.closePath(),e.stroke()),e.restore()}function Dw(e,t,a,n,i,r,l){e.save(),e.globalCompositeOperation="copy";let s=e.createLinearGradient(0,0,0,i);s.addColorStop(0,r),s.addColorStop(1,l),e.fillStyle=s,e.fillRect(t,a,n,i),e.restore()}class Pg{constructor(e,t){this.ht(e,t)}ht(e,t){this.qt=e,this.ei=t}$t(e,t){return this.qt.It?e.P+e.A+e.I:0}st(e,t,a,n){if(!this.qt.It||this.qt.ri.length===0)return;let i=this.qt.R,r=this.ei.Z,l=e.useBitmapCoordinateSpace((s)=>{let o=s.context;o.font=t.k;let u=this.hi(s,t,a,n),c=u.ai;return u.li?NL(o,c.oi,c._i,c.ui,c.ci,r,c.di,[c.ft,0,0,c.ft],r):NL(o,c.fi,c._i,c.ui,c.ci,r,c.di,[0,c.ft,c.ft,0],r),this.qt.pi&&(o.fillStyle=i,o.fillRect(c.fi,c.mi,c.wi-c.fi,c.Mi)),this.qt.gi&&(o.fillStyle=t.D,o.fillRect(u.li?c.bi-c.di:0,c._i,c.di,c.Si-c._i)),u});e.useMediaCoordinateSpace(({context:s})=>{let o=l.xi;s.font=t.k,s.textAlign=l.li?"right":"left",s.textBaseline="middle",s.fillStyle=i,s.fillText(this.qt.ri,o.Ci,(o._i+o.Si)/2+o.yi)})}hi(e,t,a,n){let{context:i,bitmapSize:r,mediaSize:l,horizontalPixelRatio:s,verticalPixelRatio:o}=e,u=this.qt.pi||!this.qt.Pi?t.C:0,c=this.qt.ki?t.S:0,f=t.A+this.ei.Ti,d=t.I+this.ei.Ri,h=t.V,g=t.B,b=this.qt.ri,S=t.P,p=a.Di(i,b),x=Math.ceil(a.Ii(i,b)),y=S+f+d,w=t.S+h+g+x+u,T=Math.max(1,Math.floor(o)),I=Math.round(y*o);I%2!=T%2&&(I+=1);let M=c>0?Math.max(1,Math.floor(c*s)):0,R=Math.round(w*s),A=Math.round(u*s),v=this.ei.Vi??this.ei.Bi??this.ei.Ei,F=Math.round(v*o)-Math.floor(0.5*o),H=Math.floor(F+T/2-I/2),B=H+I,q=n==="right",V=q?l.width-c:c,Y=q?r.width-M:M,se,_e,O;return q?(se=Y-R,_e=Y-A,O=V-u-h-c):(se=Y+R,_e=Y+A,O=V+u+h),{li:q,ai:{_i:H,mi:F,Si:B,ui:R,ci:I,ft:2*s,di:M,oi:se,fi:Y,wi:_e,Mi:T,bi:r.width},xi:{_i:H/o,Si:B/o,Ci:O,yi:p}}}}class Bo{constructor(e){this.Ai={Ei:0,Z:"#000",Ri:0,Ti:0},this.Li={ri:"",It:!1,pi:!0,Pi:!1,Ht:"",R:"#FFF",gi:!1,ki:!1},this.zi={ri:"",It:!1,pi:!1,Pi:!0,Ht:"",R:"#FFF",gi:!0,ki:!0},this.xt=!0,this.Oi=new(e||Pg)(this.Li,this.Ai),this.Ni=new(e||Pg)(this.zi,this.Ai)}ri(){return this.Fi(),this.Li.ri}Ei(){return this.Fi(),this.Ai.Ei}Pt(){this.xt=!0}$t(e,t=!1){return Math.max(this.Oi.$t(e,t),this.Ni.$t(e,t))}Wi(){return this.Ai.Vi??null}Hi(){return this.Ai.Vi??this.Ai.Bi??this.Ei()}Ui(e){this.Ai.Bi=e??void 0}$i(){return this.Fi(),this.Li.It||this.zi.It}ji(){return this.Fi(),this.Li.It}Tt(e){return this.Fi(),this.Li.pi=this.Li.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Oi}qi(){return this.Fi(),this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Ni}Fi(){this.xt&&(this.Li.pi=!0,this.zi.pi=!1,this.Yi(this.Li,this.zi,this.Ai))}}class Rw extends Bo{constructor(e,t,a){super(),this.Jt=e,this.Ki=t,this.Gi=a}Yi(e,t,a){if(e.It=!1,this.Jt.N().mode===2)return;let n=this.Jt.N().horzLine;if(!n.labelVisible)return;let i=this.Ki.Lt();if(!this.Jt.It()||this.Ki.Zi()||i===null)return;let r=this.Ki.Xi().G(n.labelBackgroundColor);a.Z=r.Z,e.R=r.X;let l=0.16666666666666666*this.Ki.P();a.Ti=l,a.Ri=l;let s=this.Gi(this.Ki);a.Ei=s.Ei,e.ri=this.Ki.Ji(s.Mt,i),e.It=!0}}var e_=/[1-9]/g;class Zg{constructor(){this.qt=null}ht(e){this.qt=e}st(e,t){if(this.qt===null||this.qt.It===!1||this.qt.ri.length===0)return;let a=e.useMediaCoordinateSpace(({context:f})=>(f.font=t.k,Math.round(t.Qi.Ii(f,z(this.qt).ri,e_))));if(a<=0)return;let n=t.tn,i=a+2*n,r=i/2,l=this.qt.nn,s=this.qt.Ei,o=Math.floor(s-r)+0.5;o<0?(s+=Math.abs(0-o),o=Math.floor(s-r)+0.5):o+i>l&&(s-=Math.abs(l-(o+i)),o=Math.floor(s-r)+0.5);let u=o+i,c=Math.ceil(0+t.S+t.C+t.A+t.P+t.I);e.useBitmapCoordinateSpace(({context:f,horizontalPixelRatio:d,verticalPixelRatio:h})=>{let g=z(this.qt);f.fillStyle=g.Z;let b=Math.round(o*d),S=Math.round(0*h),p=Math.round(u*d),x=Math.round(c*h),y=Math.round(2*d);if(f.beginPath(),f.moveTo(b,S),f.lineTo(b,x-y),f.arcTo(b,x,b+y,x,y),f.lineTo(p-y,x),f.arcTo(p,x,p,x-y,y),f.lineTo(p,S),f.fill(),g.pi){let w=Math.round(g.Ei*d),T=S,I=Math.round((T+t.C)*h);f.fillStyle=g.R;let M=Math.max(1,Math.floor(d)),R=Math.floor(0.5*d);f.fillRect(w-R,T,M,I-T)}}),e.useMediaCoordinateSpace(({context:f})=>{let d=z(this.qt),h=0+t.S+t.C+t.A+t.P/2;f.font=t.k,f.textAlign="left",f.textBaseline="middle",f.fillStyle=d.R;let g=t.Qi.Di(f,"Apr0");f.translate(o+n,h+g),f.fillText(d.ri,0,0)})}}class Bw{constructor(e,t,a){this.xt=!0,this.Xt=new Zg,this.Zt={It:!1,Z:"#4c525e",R:"white",ri:"",nn:0,Ei:NaN,pi:!0},this.Ct=e,this.sn=t,this.Gi=a}Pt(){this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Xt.ht(this.Zt),this.Xt}Rt(){let e=this.Zt;if(e.It=!1,this.Ct.N().mode===2)return;let t=this.Ct.N().vertLine;if(!t.labelVisible)return;let a=this.sn.Et();if(a.Zi())return;e.nn=a.nn();let n=this.Gi();if(n===null)return;e.Ei=n.Ei;let i=a.en(this.Ct.Bt());e.ri=a.rn(z(i)),e.It=!0;let r=this.sn.Xi().G(t.labelBackgroundColor);e.Z=r.Z,e.R=r.X,e.pi=a.N().ticksVisible}}class Jg{constructor(){this.hn=null,this.an=0}ln(){return this.an}_n(e){this.an=e}Ft(){return this.hn}un(e){this.hn=e}cn(e){return[]}dn(){return[]}It(){return!0}}var Ji;(function(e){e[e.Normal=0]="Normal",e[e.Magnet=1]="Magnet",e[e.Hidden=2]="Hidden",e[e.MagnetOHLC=3]="MagnetOHLC"})(Ji||(Ji={}));class zw extends Jg{constructor(e,t){super(),this.yt=null,this.fn=NaN,this.pn=0,this.vn=!1,this.mn=new Map,this.wn=!1,this.Mn=new WeakMap,this.gn=new WeakMap,this.bn=NaN,this.Sn=NaN,this.xn=NaN,this.Cn=NaN,this.sn=e,this.yn=t,this.Pn=((n,i)=>(r)=>{let l=i(),s=n();if(r===z(this.yt).kn())return{Mt:s,Ei:l};{let o=z(r.Lt());return{Mt:r.Tn(l,o),Ei:l}}})(()=>this.fn,()=>this.Sn);let a=((n,i)=>()=>{let r=this.sn.Et().Rn(n()),l=i();return r&&Number.isFinite(l)?{wt:r,Ei:l}:null})(()=>this.pn,()=>this.ni());this.Dn=new Bw(this,e,a)}N(){return this.yn}In(e,t){this.xn=e,this.Cn=t}Vn(){this.xn=NaN,this.Cn=NaN}Bn(){return this.xn}En(){return this.Cn}An(e,t,a){this.wn||(this.wn=!0),this.vn=!0,this.Ln(e,t,a)}Bt(){return this.pn}ni(){return this.bn}si(){return this.Sn}It(){return this.vn}zn(){this.vn=!1,this.On(),this.fn=NaN,this.bn=NaN,this.Sn=NaN,this.yt=null,this.Vn(),this.Nn()}Fn(e){if(!this.yn.doNotSnapToHiddenSeriesIndices)return e;let t=this.sn,a=t.Et(),n=null,i=null;for(let o of t.Wn()){let u=o.Un().Hn(e,-1);if(u){if(u.$n===e)return e;(n===null||u.$n>n)&&(n=u.$n)}let c=o.Un().Hn(e,1);if(c){if(c.$n===e)return e;(i===null||c.$n<i)&&(i=c.$n)}}let r=[n,i].filter(BL);if(r.length===0)return e;let l=a.jt(e),s=r.map((o)=>Math.abs(l-a.jt(o)));return r[s.indexOf(Math.min(...s))]}jn(e){let t=this.Mn.get(e);t||(t=new Ew(this,e),this.Mn.set(e,t));let a=this.gn.get(e);return a||(a=new Tw(this.sn,this,e),this.gn.set(e,a)),[t,a]}ti(e){return e===this.yt&&this.yn.horzLine.visible}ii(){return this.yn.vertLine.visible}qn(e,t){this.vn&&this.yt===e||this.mn.clear();let a=[];return this.yt===e&&a.push(this.Yn(this.mn,t,this.Pn)),a}dn(){return this.vn?[this.Dn]:[]}Kn(){return this.yt}Nn(){this.sn.Gn().forEach((e)=>{this.Mn.get(e)?.Pt(),this.gn.get(e)?.Pt()}),this.mn.forEach((e)=>e.Pt()),this.Dn.Pt()}Zn(e){return e&&!e.kn().Zi()?e.kn():null}Ln(e,t,a){this.Xn(e,t,a)&&this.Nn()}Xn(e,t,a){let n=this.bn,i=this.Sn,r=this.fn,l=this.pn,s=this.yt,o=this.Zn(a);this.pn=e,this.bn=isNaN(e)?NaN:this.sn.Et().jt(e),this.yt=a;let u=o!==null?o.Lt():null;return o!==null&&u!==null?(this.fn=t,this.Sn=o.Nt(t,u)):(this.fn=NaN,this.Sn=NaN),n!==this.bn||i!==this.Sn||l!==this.pn||r!==this.fn||s!==this.yt}On(){let e=this.sn.Jn().map((a)=>a.Un().Qn()).filter(BL),t=e.length===0?null:Math.max(...e);this.pn=t!==null?t:NaN}Yn(e,t,a){let n=e.get(t);return n===void 0&&(n=new Rw(this,t,a),e.set(t,n)),n}}function wf(e){return e==="left"||e==="right"}class rt{constructor(e){this.ts=new Map,this.ns=[],this.ss=e}es(e,t){let a=function(n,i){return n===void 0?i:{rs:Math.max(n.rs,i.rs),hs:n.hs||i.hs}}(this.ts.get(e),t);this.ts.set(e,a)}ls(){return this.ss}_s(e){let t=this.ts.get(e);return t===void 0?{rs:this.ss}:{rs:Math.max(this.ss,t.rs),hs:t.hs}}us(){this.cs(),this.ns=[{ds:0}]}fs(e){this.cs(),this.ns=[{ds:1,Wt:e}]}ps(e){this.vs(),this.ns.push({ds:5,Wt:e})}cs(){this.vs(),this.ns.push({ds:6})}ws(){this.cs(),this.ns=[{ds:4}]}Ms(e){this.cs(),this.ns.push({ds:2,Wt:e})}gs(e){this.cs(),this.ns.push({ds:3,Wt:e})}bs(){return this.ns}Ss(e){for(let t of e.ns)this.xs(t);this.ss=Math.max(this.ss,e.ss),e.ts.forEach((t,a)=>{this.es(a,t)})}static Cs(){return new rt(2)}static ys(){return new rt(3)}xs(e){switch(e.ds){case 0:this.us();break;case 1:this.fs(e.Wt);break;case 2:this.Ms(e.Wt);break;case 3:this.gs(e.Wt);break;case 4:this.ws();break;case 5:this.ps(e.Wt);break;case 6:this.vs()}}vs(){let e=this.ns.findIndex((t)=>t.ds===5);e!==-1&&this.ns.splice(e,1)}}class $g{formatTickmarks(e){return e.map((t)=>this.format(t))}}var OL=".";function sn(e,t){if(!Zi(e))return"n/a";if(!Ao(t))throw TypeError("invalid length");if(t<0||t>16)throw TypeError("invalid length");if(t===0)return e.toString();return("0000000000000000"+e.toString()).slice(-t)}class zo extends $g{constructor(e,t){if(super(),t||(t=1),Zi(e)&&Ao(e)||(e=100),e<0)throw TypeError("invalid base");this.Ki=e,this.Ps=t,this.ks()}format(e){let t=e<0?"−":"";return e=Math.abs(e),t+this.Ts(e)}ks(){if(this.Rs=0,this.Ki>0&&this.Ps>0){let e=this.Ki;for(;e>1;)e/=10,this.Rs++}}Ts(e){let t=this.Ki/this.Ps,a=Math.floor(e),n="",i=this.Rs!==void 0?this.Rs:NaN;if(t>1){let r=+(Math.round(e*t)-a*t).toFixed(this.Rs);r>=t&&(r-=t,a+=1),n=OL+sn(+r.toFixed(this.Rs)*this.Ps,i)}else a=Math.round(a*t)/t,i>0&&(n=OL+sn(0,i));return a.toFixed(0)+n}}class ex extends zo{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}}class _w extends $g{constructor(e){super(),this.Ds=e}format(e){let t="";return e<0&&(t="-",e=-e),e<995?t+this.Is(e):e<999995?t+this.Is(e/1000)+"K":e<999999995?(e=1000*Math.round(e/1000),t+this.Is(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),t+this.Is(e/1e9)+"B")}Is(e){let t,a=Math.pow(10,this.Ds);return t=(e=Math.round(e*a)/a)>=0.000000000000001&&e<1?e.toFixed(this.Ds).replace(/\.?0+$/,""):String(e),t.replace(/(\.[1-9]*)0+$/,(n,i)=>i)}}var t_=/[2-9]/g;class Cl{constructor(e=50){this.Vs=0,this.Bs=1,this.Es=1,this.As={},this.Ls=new Map,this.zs=e}Os(){this.Vs=0,this.Ls.clear(),this.Bs=1,this.Es=1,this.As={}}Ii(e,t,a){return this.Ns(e,t,a).width}Di(e,t,a){let n=this.Ns(e,t,a);return((n.actualBoundingBoxAscent||0)-(n.actualBoundingBoxDescent||0))/2}Ns(e,t,a){let n=a||t_,i=String(t).replace(n,"0");if(this.Ls.has(i))return Mt(this.Ls.get(i)).Fs;if(this.Vs===this.zs){let l=this.As[this.Es];delete this.As[this.Es],this.Ls.delete(l),this.Es++,this.Vs--}e.save(),e.textBaseline="middle";let r=e.measureText(i);return e.restore(),r.width===0&&t.length||(this.Ls.set(i,{Fs:r,Ws:this.Bs}),this.As[this.Bs]=i,this.Vs++,this.Bs++),r}}class Nw{constructor(e){this.Hs=null,this.M=null,this.Us="right",this.$s=e}js(e,t,a){this.Hs=e,this.M=t,this.Us=a}st(e){this.M!==null&&this.Hs!==null&&this.Hs.st(e,this.M,this.$s,this.Us)}}class tx{constructor(e,t,a){this.qs=e,this.$s=new Cl(50),this.Ys=t,this.O=a,this.F=-1,this.Xt=new Nw(this.$s)}Tt(){let e=this.O.Ks(this.Ys);if(e===null)return null;let t=e.Gs(this.Ys)?e.Zs():this.Ys.Ft();if(t===null)return null;let a=e.Xs(t);if(a==="overlay")return null;let n=this.O.Js();return n.P!==this.F&&(this.F=n.P,this.$s.Os()),this.Xt.js(this.qs.qi(),n,a),this.Xt}}class Ow extends on{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}Qs(e,t){if(!this.qt?.It)return null;let{ut:a,ct:n,te:i}=this.qt;return t>=a-n-7&&t<=a+n+7?{ie:this.qt,ne:Math.abs(t-a),se:2,ee:"price-line",te:i}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:a,verticalPixelRatio:n}){if(this.qt===null)return;if(this.qt.It===!1)return;let i=Math.round(this.qt.ut*n);i<0||i>t.height||(e.lineCap="butt",e.strokeStyle=this.qt.R,e.lineWidth=Math.floor(this.qt.ct*a),Wi(e,this.qt.Gt),Cw(e,i,0,t.width))}}class kf{constructor(e){this.re={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Gt:0,It:!1},this.he=new Ow,this.xt=!0,this.ae=e,this.le=e.Qt(),this.he.ht(this.re)}Pt(){this.xt=!0}Tt(){return this.ae.It()?(this.xt&&(this.oe(),this.xt=!1),this.he):null}}class Pw extends kf{constructor(e){super(e)}oe(){this.re.It=!1;let e=this.ae.Ft(),t=e._e()._e;if(t!==2&&t!==3)return;let a=this.ae.N();if(!a.baseLineVisible||!this.ae.It())return;let n=this.ae.Lt();n!==null&&(this.re.It=!0,this.re.ut=e.Nt(n.Wt,n.Wt),this.re.R=a.baseLineColor,this.re.ct=a.baseLineWidth,this.re.Gt=a.baseLineStyle)}}class qw extends on{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}ue(){return this.qt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:a}){let n=this.qt;if(n===null)return;let i=Math.max(1,Math.floor(t)),r=i%2/2,l=Math.round(n.ce.x*t)+r,s=n.ce.y*a;e.fillStyle=n.de,e.beginPath();let o=Math.max(2,1.5*n.fe)*t;e.arc(l,s,o,0,2*Math.PI,!1),e.fill(),e.fillStyle=n.pe,e.beginPath(),e.arc(l,s,n.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=i,e.strokeStyle=n.ve,e.beginPath(),e.arc(l,s,n.ft*t+i/2,0,2*Math.PI,!1),e.stroke()}}var a_=[{me:0,we:0.25,Me:4,ge:10,be:0.25,Se:0,xe:0.4,Ce:0.8},{me:0.25,we:0.525,Me:10,ge:14,be:0,Se:0,xe:0.8,Ce:0},{me:0.525,we:1,Me:14,ge:14,be:0,Se:0,xe:0,Ce:0}];class Fw{constructor(e){this.Xt=new qw,this.xt=!0,this.ye=!0,this.Pe=performance.now(),this.ke=this.Pe-1,this.Te=e}Re(){this.ke=this.Pe-1,this.Pt()}De(){if(this.Pt(),this.Te.N().lastPriceAnimation===2){let e=performance.now(),t=this.ke-e;if(t>0)return void(t<650&&(this.ke+=2600));this.Pe=e,this.ke=e+2600}}Pt(){this.xt=!0}Ie(){this.ye=!0}It(){return this.Te.N().lastPriceAnimation!==0}Ve(){switch(this.Te.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.ke}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ye=!1):this.ye&&(this.Be(),this.ye=!1),this.Xt}Rt(){this.Xt.ht(null);let e=this.Te.Qt().Et(),t=e.Ee(),a=this.Te.Lt();if(t===null||a===null)return;let n=this.Te.Ae(!0);if(n.Le||!t.ze(n.$n))return;let i={x:e.jt(n.$n),y:this.Te.Ft().Nt(n.Mt,a.Wt)},r=n.R,l=this.Te.N().lineWidth,s=this.Oe(this.Ne(),r);this.Xt.ht({de:r,fe:l,pe:s.pe,ve:s.ve,ft:s.ft,ce:i})}Be(){let e=this.Xt.ue();if(e!==null){let t=this.Oe(this.Ne(),e.de);e.pe=t.pe,e.ve=t.ve,e.ft=t.ft}}Ne(){return this.Ve()?performance.now()-this.Pe:2599}Fe(e,t,a,n){let i=a+(n-a)*t;return this.Te.Qt().Xi().Y(e,i)}Oe(e,t){let a=e%2600/2600,n;for(let o of a_)if(a>=o.me&&a<=o.we){n=o;break}lt(n!==void 0,"Last price animation internal logic error");let i=(a-n.me)/(n.we-n.me);return{pe:this.Fe(t,i,n.be,n.Se),ve:this.Fe(t,i,n.xe,n.Ce),ft:(r=i,l=n.Me,s=n.ge,l+(s-l)*r)};var r,l,s}}class Uw extends kf{constructor(e){super(e)}oe(){let e=this.re;e.It=!1;let t=this.ae.N();if(!t.priceLineVisible||!this.ae.It())return;let a=this.ae.Ae(t.priceLineSource===0);a.Le||(e.It=!0,e.ut=a.Ei,e.R=this.ae.We(a.R),e.ct=t.priceLineWidth,e.Gt=t.priceLineStyle)}}class Hw extends Bo{constructor(e){super(),this.Jt=e}Yi(e,t,a){e.It=!1,t.It=!1;let n=this.Jt;if(!n.It())return;let i=n.N(),r=i.lastValueVisible,l=n.He()!=="",s=i.seriesLastValueMode===0,o=n.Ae(!1);if(o.Le)return;r&&(e.ri=this.Ue(o,r,s),e.It=e.ri.length!==0),(l||s)&&(t.ri=this.$e(o,r,l,s),t.It=t.ri.length>0);let u=n.We(o.R),c=this.Jt.Qt().Xi().G(u);a.Z=c.Z,a.Ei=o.Ei,t.Ht=n.Qt().Ut(o.Ei/n.Ft().$t()),e.Ht=u,e.R=c.X,t.R=c.X}$e(e,t,a,n){let i="",r=this.Jt.He();return a&&r.length!==0&&(i+=`${r} `),t&&n&&(i+=this.Jt.Ft().je()?e.qe:e.Ye),i.trim()}Ue(e,t,a){return t?a?this.Jt.Ft().je()?e.Ye:e.qe:e.ri:""}}function PL(e,t,a,n){let i=Number.isFinite(t),r=Number.isFinite(a);return i&&r?e(t,a):i||r?i?t:a:n}class pt{constructor(e,t){this.Ke=e,this.Ge=t}Ze(e){return e!==null&&(this.Ke===e.Ke&&this.Ge===e.Ge)}Xe(){return new pt(this.Ke,this.Ge)}Je(){return this.Ke}Qe(){return this.Ge}tr(){return this.Ge-this.Ke}Zi(){return this.Ge===this.Ke||Number.isNaN(this.Ge)||Number.isNaN(this.Ke)}Ss(e){return e===null?this:new pt(PL(Math.min,this.Je(),e.Je(),-1/0),PL(Math.max,this.Qe(),e.Qe(),1/0))}ir(e){if(!Zi(e))return;if(this.Ge-this.Ke===0)return;let t=0.5*(this.Ge+this.Ke),a=this.Ge-t,n=this.Ke-t;a*=e,n*=e,this.Ge=t+a,this.Ke=t+n}nr(e){Zi(e)&&(this.Ge+=e,this.Ke+=e)}sr(){return{minValue:this.Ke,maxValue:this.Ge}}static er(e){return e===null?null:new pt(e.minValue,e.maxValue)}}class bf{constructor(e,t){this.rr=e,this.hr=t||null}ar(){return this.rr}lr(){return this.hr}sr(){return{priceRange:this.rr===null?null:this.rr.sr(),margins:this.hr||void 0}}static er(e){return e===null?null:new bf(pt.er(e.priceRange),e.margins)}}var n_=[2,4,8,16,32,64,128,256,512],i_="Custom series with conflation reducer must have a priceValueBuilder method";class Vw extends kf{constructor(e,t){super(e),this._r=t}oe(){let e=this.re;e.It=!1;let t=this._r.N();if(!this.ae.It()||!t.lineVisible)return;let a=this._r.ur();a!==null&&(e.It=!0,e.ut=a,e.R=t.color,e.ct=t.lineWidth,e.Gt=t.lineStyle,e.te=this._r.N().id)}}class Gw extends Bo{constructor(e,t){super(),this.Te=e,this._r=t}Yi(e,t,a){e.It=!1,t.It=!1;let n=this._r.N(),i=n.axisLabelVisible,r=n.title!=="",l=this.Te;if(!i||!l.It())return;let s=this._r.ur();if(s===null)return;r&&(t.ri=n.title,t.It=!0),t.Ht=l.Qt().Ut(s/l.Ft().$t()),e.ri=this.cr(n.price),e.It=!0;let o=this.Te.Qt().Xi().G(n.axisLabelColor||n.color);a.Z=o.Z;let u=n.axisLabelTextColor||o.X;e.R=u,t.R=u,a.Ei=s}cr(e){let t=this.Te.Lt();return t===null?"":this.Te.Ft().Ji(e,t.Wt)}}class Qw{constructor(e,t){this.Te=e,this.yn=t,this.dr=new Vw(e,this),this.qs=new Gw(e,this),this.pr=new tx(this.qs,e,e.Qt())}vr(e){Ft(this.yn,e),this.Pt(),this.Te.Qt().mr()}N(){return this.yn}wr(){return this.dr}Mr(){return this.pr}gr(){return this.qs}Pt(){this.dr.Pt(),this.qs.Pt()}ur(){let e=this.Te,t=e.Ft();if(e.Qt().Et().Zi()||t.Zi())return null;let a=e.Lt();return a===null?null:t.Nt(this.yn.price,a.Wt)}}class jw{constructor(){this.br=new WeakMap}Sr(e,t,a){let n=1/t*a;if(e>=n)return 1;let i=n/e,r=Math.pow(2,Math.floor(Math.log2(i)));return Math.min(r,512)}Cr(e,t,a,n=!1,i){if(e.length===0||t<=1)return e;let r=this.yr(t);if(r<=1)return e;let l=this.Pr(e),s=l.kr.get(r);return s!==void 0||(s=this.Tr(e,r,a,n,i,l.kr),l.kr.set(r,s)),s}Rr(e,t,a,n,i=!1,r){if(a<1||e.length===0)return e;let l=this.Pr(e),s=l.kr.get(a);if(!s)return this.Cr(e,a,n,i,r);let o=this.Dr(e,t,a,s,i,n,r);return l.kr.set(a,o),o}yr(e){if(e<=2)return 2;for(let t of n_)if(e<=t)return t;return 512}Ir(e){if(e.length===0)return 0;let t=e[0],a=e[e.length-1];return 31*e.length+17*t.$n+13*a.$n}Tr(e,t,a,n=!1,i,r=new Map){if(t===2)return this.Vr(e,2,a,n,i);let l=t/2,s=r.get(l);return s||(s=this.Tr(e,l,a,n,i,r),r.set(l,s)),this.Br(s,a,n,i)}Vr(e,t,a,n=!1,i){let r=this.Er(e,t,a,n,i);return this.Ar(r,n)}Br(e,t,a=!1,n){let i=this.Er(e,2,t,a,n);return this.Ar(i,a)}Er(e,t,a,n=!1,i){let r=[];for(let l=0;l<e.length;l+=t)if(e.length-l>=t){let s=this.Lr(e[l],e[l+1],a,n,i);s.zr=!1,r.push(s)}else if(r.length===0)r.push(this.Or(e[l],!0));else{let s=r[r.length-1];r[r.length-1]=this.Nr(s,e[l],a,n,i)}return r}Fr(e,t){return(e??1)+(t??1)}Lr(e,t,a,n=!1,i){if(!n||!a||!i){let o=e.Wt[1]>t.Wt[1]?e.Wt[1]:t.Wt[1],u=e.Wt[2]<t.Wt[2]?e.Wt[2]:t.Wt[2];return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:o,Yr:u,Kr:t.Wt[3],Gr:this.Fr(e.Gr,t.Gr),Zr:void 0,zr:!1}}let r=a(this.Xr(e,i),this.Xr(t,i)),l=i(r),s=l.length?l[l.length-1]:0;return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:Math.max(e.Wt[1],s),Yr:Math.min(e.Wt[2],s),Kr:s,Gr:this.Fr(e.Gr,t.Gr),Zr:r,zr:!1}}Nr(e,t,a,n=!1,i){if(!n||!a||!i)return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:e.qr>t.Wt[1]?e.qr:t.Wt[1],Yr:e.Yr<t.Wt[2]?e.Yr:t.Wt[2],Kr:t.Wt[3],Gr:e.Gr+(t.Gr??1),Zr:e.Zr,zr:!1};let r=e.Zr,l=this.Xr(t,i),s=r?{data:r,index:e.Wr,originalTime:e.Ur,time:e.Ur,priceValues:i(r)}:null,o=s?a(s,l):l.data,u=s?i(o):l.priceValues,c=u.length?u[u.length-1]:0;return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:Math.max(e.qr,c),Yr:Math.min(e.Yr,c),Kr:c,Gr:e.Gr+(t.Gr??1),Zr:o,zr:!1}}Jr(e,t,a,n,i,r,l=!1,s){let o=t===n?i:e[t];if(a-t==1)return this.Or(o,!0);let u=t+1===n?i:e[t+1],c=this.Lr(o,u,r,l,s);for(let f=t+2;f<a;f++){let d=f===n?i:e[f];c=this.Nr(c,d,r,l,s)}return c}Xr(e,t){let a=e.ue??{};return{data:e.ue,index:e.$n,originalTime:e.Qr,time:e.wt,priceValues:t(a)}}th(e,t=!1){let a=t===!0,n=!!e.Zr;return{...{$n:e.Wr,wt:e.Ur,Qr:e.Ur,Wt:[a?e.Kr:e.jr,e.qr,e.Yr,e.Kr],Gr:e.Gr},ue:a?n?e.Zr:{wt:e.Ur}:void 0}}Ar(e,t=!1){return e.map((a)=>this.th(a,t))}Dr(e,t,a,n,i=!1,r,l){if(n.length===0)return n;let s=e.length-1,o=Math.floor(s/a)*a;if(Math.min(o+a,e.length)-o<a&&e.length>a){let u=e.slice();return u[u.length-1]=t,this.Cr(u,a,r,i,l)}if(Math.floor((s-1)/a)===Math.floor(s/a)||n.length===1){let u=Math.min(o+a,e.length),c=u-o;if(c<=0)return n;let f=c===1?this.Or(o===s?t:e[o],!0):this.Jr(e,o,u,s,t,r,i,l);return n[n.length-1]=this.th(f,i),n}{let u=e.slice();return u[u.length-1]=t,this.Cr(u,a,r,i,l)}}Or(e,t=!1){return{Wr:e.$n,Hr:e.$n,Ur:e.wt,$r:e.wt,jr:e.Wt[0],qr:e.Wt[1],Yr:e.Wt[2],Kr:e.Wt[3],Gr:e.Gr??1,Zr:e.ue,zr:t}}Pr(e){let t=this.ih(e),a=this.Ir(e);return t.nh!==a&&(t.kr.clear(),t.nh=a),t}ih(e){let t=this.br.get(e);return t===void 0&&(t={nh:this.Ir(e),kr:new Map},this.br.set(e,t)),t}}class Yw extends Jg{constructor(e){super(),this.sn=e}Qt(){return this.sn}}var r_={Bar:(e,t,a,n)=>{let{upColor:i,downColor:r}=t,l=z(e(a,n)),s=$n(l.Wt[0])<=$n(l.Wt[3]);return{sh:l.R??(s?i:r)}},Candlestick:(e,t,a,n)=>{let{upColor:i,downColor:r,borderUpColor:l,borderDownColor:s,wickUpColor:o,wickDownColor:u}=t,c=z(e(a,n)),f=$n(c.Wt[0])<=$n(c.Wt[3]);return{sh:c.R??(f?i:r),eh:c.Ht??(f?l:s),rh:c.hh??(f?o:u)}},Custom:(e,t,a,n)=>({sh:z(e(a,n)).R??t.color}),Area:(e,t,a,n)=>{let i=z(e(a,n));return{sh:i.vt??t.lineColor,vt:i.vt??t.lineColor,ah:i.ah??t.topColor,oh:i.oh??t.bottomColor}},Baseline:(e,t,a,n)=>{let i=z(e(a,n));return{sh:i.Wt[3]>=t.baseValue.price?t.topLineColor:t.bottomLineColor,_h:i._h??t.topLineColor,uh:i.uh??t.bottomLineColor,dh:i.dh??t.topFillColor1,fh:i.fh??t.topFillColor2,ph:i.ph??t.bottomFillColor1,mh:i.mh??t.bottomFillColor2}},Line:(e,t,a,n)=>{let i=z(e(a,n));return{sh:i.R??t.color,vt:i.R??t.color}},Histogram:(e,t,a,n)=>({sh:z(e(a,n)).R??t.color})};class Kw{constructor(e){this.wh=(t,a)=>a!==void 0?a.Wt:this.Te.Un().Mh(t),this.Te=e,this.gh=r_[e.bh()]}Sh(e,t){return this.gh(this.wh,this.Te.N(),e,t)}}function Xw(e,t,a,n,i=0,r=t.length){let l=r-i;for(;0<l;){let s=l>>1,o=i+s;n(t[o],a)===e?(i=o+1,l-=s+1):l=s}return i}var $i=Xw.bind(null,!0),ax=Xw.bind(null,!1),qL;(function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.None=0]="None",e[e.NearestRight=1]="NearestRight"})(qL||(qL={}));var Jn=30;class Ww{constructor(){this.xh=[],this.Ch=new Map,this.yh=new Map,this.Ph=[]}kh(){return this.Th()>0?this.xh[this.xh.length-1]:null}Rh(){return this.Th()>0?this.Dh(0):null}Qn(){return this.Th()>0?this.Dh(this.xh.length-1):null}Th(){return this.xh.length}Zi(){return this.Th()===0}ze(e){return this.Ih(e,0)!==null}Mh(e){return this.Hn(e)}Hn(e,t=0){let a=this.Ih(e,t);return a===null?null:{...this.Vh(a),$n:this.Dh(a)}}Bh(){return this.xh}Eh(e,t,a){if(this.Zi())return null;let n=null;for(let i of a)n=lf(n,this.Ah(e,t,i));return n}ht(e){this.yh.clear(),this.Ch.clear(),this.xh=e,this.Ph=e.map((t)=>t.$n)}Lh(){return this.Ph}Dh(e){return this.xh[e].$n}Vh(e){return this.xh[e]}Ih(e,t){let a=this.zh(e);if(a===null&&t!==0)switch(t){case-1:return this.Oh(e);case 1:return this.Nh(e);default:throw TypeError("Unknown search mode")}return a}Oh(e){let t=this.Fh(e);return t>0&&(t-=1),t!==this.xh.length&&this.Dh(t)<e?t:null}Nh(e){let t=this.Wh(e);return t!==this.xh.length&&e<this.Dh(t)?t:null}zh(e){let t=this.Fh(e);return t===this.xh.length||e<this.xh[t].$n?null:t}Fh(e){return $i(this.xh,e,(t,a)=>t.$n<a)}Wh(e){return ax(this.xh,e,(t,a)=>t.$n>a)}Hh(e,t,a){let n=null;for(let i=e;i<t;i++){let r=this.xh[i].Wt[a];Number.isNaN(r)||(n===null?n={Uh:r,$h:r}:(r<n.Uh&&(n.Uh=r),r>n.$h&&(n.$h=r)))}return n}Ah(e,t,a){if(this.Zi())return null;let n=null,i=z(this.Rh()),r=z(this.Qn()),l=Math.max(e,i),s=Math.min(t,r),o=Math.ceil(l/Jn)*Jn,u=Math.max(o,Math.floor(s/Jn)*Jn);{let f=this.Fh(l),d=this.Wh(Math.min(s,o,t));n=lf(n,this.Hh(f,d,a))}let c=this.Ch.get(a);c===void 0&&(c=new Map,this.Ch.set(a,c));for(let f=Math.max(o+1,l);f<u;f+=Jn){let d=Math.floor(f/Jn),h=c.get(d);if(h===void 0){let g=this.Fh(d*Jn),b=this.Wh((d+1)*Jn-1);h=this.Hh(g,b,a),c.set(d,h)}n=lf(n,h)}{let f=this.Fh(u),d=this.Wh(s);n=lf(n,this.Hh(f,d,a))}return n}}function lf(e,t){if(e===null)return t;if(t===null)return e;return{Uh:Math.min(e.Uh,t.Uh),$h:Math.max(e.$h,t.$h)}}function Lg(){return new Ww}var Sf={setLineStyle:Wi};class Zw{constructor(e){this.jh=e}st(e,t,a){this.jh.draw(e,Sf)}qh(e,t,a){this.jh.drawBackground?.(e,Sf)}}class Jw{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Gh;let t=new Zw(e);return this.Ls={Kh:e,Gh:t},t}Zh(){return this.Yh.zOrder?.()??"normal"}}class nx{constructor(e){this.Xh=null,this.Jh=e}Qh(){return this.Jh}Nn(){this.Jh.updateAllViews?.()}jn(){let e=this.Jh.paneViews?.()??[];if(this.Xh?.Kh===e)return this.Xh.Gh;let t=e.map((a)=>new Jw(a));return this.Xh={Kh:e,Gh:t},t}Qs(e,t){return this.Jh.hitTest?.(e,t)??null}}var l_=class extends nx{cn(){return[]}};class $w{constructor(e){this.jh=e}st(e,t,a){this.jh.draw(e,Sf)}qh(e,t,a){this.jh.drawBackground?.(e,Sf)}}class qg{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Gh;let t=new $w(e);return this.Ls={Kh:e,Gh:t},t}Zh(){return this.Yh.zOrder?.()??"normal"}}function ek(e){return{ri:e.text(),Ei:e.coordinate(),Vi:e.fixedCoordinate?.(),R:e.textColor(),Z:e.backColor(),It:e.visible?.()??!0,pi:e.tickVisible?.()??!0}}class tk{constructor(e,t){this.Xt=new Zg,this.ta=e,this.ia=t}Tt(){return this.Xt.ht({nn:this.ia.nn(),...ek(this.ta)}),this.Xt}}class ak extends Bo{constructor(e,t){super(),this.ta=e,this.Ki=t}Yi(e,t,a){let n=ek(this.ta);a.Z=n.Z,e.R=n.R;let i=0.16666666666666666*this.Ki.P();a.Ti=i,a.Ri=i,a.Ei=n.Ei,a.Vi=n.Vi,e.ri=n.ri,e.It=n.It,e.pi=n.pi}}class nk extends nx{constructor(e,t){super(e),this.na=null,this.sa=null,this.ea=null,this.ra=null,this.Te=t}dn(){let e=this.Jh.timeAxisViews?.()??[];if(this.na?.Kh===e)return this.na.Gh;let t=this.Te.Qt().Et(),a=e.map((n)=>new tk(n,t));return this.na={Kh:e,Gh:a},a}qn(){let e=this.Jh.priceAxisViews?.()??[];if(this.sa?.Kh===e)return this.sa.Gh;let t=this.Te.Ft(),a=e.map((n)=>new ak(n,t));return this.sa={Kh:e,Gh:a},a}ha(){let e=this.Jh.priceAxisPaneViews?.()??[];if(this.ea?.Kh===e)return this.ea.Gh;let t=e.map((a)=>new qg(a));return this.ea={Kh:e,Gh:t},t}aa(){let e=this.Jh.timeAxisPaneViews?.()??[];if(this.ra?.Kh===e)return this.ra.Gh;let t=e.map((a)=>new qg(a));return this.ra={Kh:e,Gh:t},t}la(e,t){return this.Jh.autoscaleInfo?.(e,t)??null}}function sf(e,t,a,n){e.forEach((i)=>{t(i).forEach((r)=>{r.Zh()===a&&n.push(r)})})}function of(e){return e.jn()}function s_(e){return e.ha()}function o_(e){return e.aa()}var u_=["Area","Line","Baseline"];class _o extends Yw{constructor(e,t,a,n,i){super(e),this.qt=Lg(),this.dr=new Uw(this),this.oa=[],this._a=new Pw(this),this.ua=null,this.ca=null,this.da=null,this.fa=[],this.pa=new jw,this.va=new Map,this.ma=null,this.yn=a,this.wa=t;let r=new Hw(this);if(this.mn=[r],this.pr=new tx(r,this,e),u_.includes(this.wa)&&(this.ua=new Fw(this)),this.Ma(),this.Yh=n(this,this.Qt(),i),this.wa==="Custom"){let l=this.Yh;l.ga&&this.ba(l.ga)}}m(){this.da!==null&&clearTimeout(this.da)}We(e){return this.yn.priceLineColor||e}Ae(e){let t={Le:!0},a=this.Ft();if(this.Qt().Et().Zi()||a.Zi()||this.qt.Zi())return t;let n=this.Qt().Et().Ee(),i=this.Lt();if(n===null||i===null)return t;let r,l;if(e){let c=this.qt.kh();if(c===null)return t;r=c,l=c.$n}else{let c=this.qt.Hn(n.bi(),-1);if(c===null)return t;if(r=this.qt.Mh(c.$n),r===null)return t;l=c.$n}let s=r.Wt[3],o=this.Sa().Sh(l,{Wt:r}),u=a.Nt(s,i.Wt);return{Le:!1,Mt:s,ri:a.Ji(s,i.Wt),qe:a.xa(s),Ye:a.Ca(s,i.Wt),R:o.sh,Ei:u,$n:l}}Sa(){return this.ca!==null||(this.ca=new Kw(this)),this.ca}N(){return this.yn}vr(e){let t=this.Qt(),{priceScaleId:a,visible:n,priceFormat:i}=e;a!==void 0&&a!==this.yn.priceScaleId&&t.ya(this,a),n!==void 0&&n!==this.yn.visible&&t.Pa();let r=e.conflationThresholdFactor!==void 0;Ft(this.yn,e),Object.prototype.hasOwnProperty.call(e,"autoscaleInfoProvider")&&e.autoscaleInfoProvider===void 0&&(this.yn.autoscaleInfoProvider=void 0),r&&(this.va.clear(),this.Qt().mr()),i!==void 0&&(this.Ma(),t.ka()),t.Ta(this),t.Ra(),this.Yh.Pt("options")}ht(e,t){this.qt.ht(e),this.va.clear();let a=this.Qt().Et().N();a.enableConflation&&a.precomputeConflationOnInit&&this.Da(a.precomputeConflationPriority),this.Ia(),this.ua!==null&&(t&&t.Va?this.ua.De():e.length===0&&this.ua.Re());let n=this.Qt().Ks(this);this.Qt().Ba(n),this.Qt().Ta(this),this.Qt().Ra(),this.Qt().mr()}Ia(){this.Yh.Pt("data")}Ea(e){let t=new Qw(this,e);return this.oa.push(t),this.Qt().Ta(this),t}Aa(e){let t=this.oa.indexOf(e);t!==-1&&this.oa.splice(t,1),this.Qt().Ta(this)}La(){return this.oa}bh(){return this.wa}Lt(){let e=this.za();return e===null?null:{Wt:e.Wt[3],Oa:e.wt}}za(){let e=this.Qt().Et().Ee();if(e===null)return null;let t=e.Na();return this.qt.Hn(t,1)}Un(){return this.qt}ba(e){this.ma=e,this.va.clear()}Fa(){return!!this.Qt().Et().N().enableConflation&&this.Wa()>1}Rr(e){if(!this.Fa())return;let t=this.Wa();if(!this.va.has(t))return;let a=this.wa==="Custom",n=a&&this.ma||void 0,i=a&&this.Yh.Ha?(s)=>{let o=s,u=this.Yh.Ha(o);return Array.isArray(u)?u:[typeof u=="number"?u:0]}:void 0,r=this.pa.Rr(this.qt.Bh(),e,t,n,a,i),l=Lg();l.ht(r),this.va.set(t,l)}Ua(){let e=this.Qt().Et().N().enableConflation;if(this.wa==="Custom"&&this.ma===null)return this.qt;if(!e)return this.qt;let t=this.Wa(),a=this.va.get(t);if(a)return a;return this.$a(t),this.va.get(t)??this.qt}ja(e){let t=this.qt.Mh(e);return t===null?null:this.wa==="Bar"||this.wa==="Candlestick"||this.wa==="Custom"?{jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3]}:t.Wt[3]}qa(e){let t=[];sf(this.fa,of,"top",t);let a=this.ua;return a!==null&&a.It()?(this.da===null&&a.Ve()&&(this.da=setTimeout(()=>{this.da=null,this.Qt().Ya()},0)),a.Ie(),t.unshift(a),t):t}jn(){let e=[];this.Ka()||e.push(this._a),e.push(this.Yh,this.dr);let t=this.oa.map((a)=>a.wr());return e.push(...t),sf(this.fa,of,"normal",e),e}Ga(){let e=this.Yh.Ga?.()??null;if(e===null)return null;let t=[];this.Ka()||t.push(this._a),t.push(...e.Za),sf(this.fa,of,"normal",t);let a=[];a.push(...e.qa,this.dr);let n=this.oa.map((i)=>i.wr());return a.push(...n),{Za:t,qa:a}}Xa(){return this.Ja(of,"bottom")}Qa(e){return this.Ja(s_,e)}tl(e){return this.Ja(o_,e)}il(e,t){return this.fa.map((a)=>a.Qs(e,t)).filter((a)=>a!==null)}cn(){return[this.pr,...this.oa.map((e)=>e.Mr())]}qn(e,t){if(t!==this.hn&&!this.Ka())return[];let a=[...this.mn];for(let n of this.oa)a.push(n.gr());return this.fa.forEach((n)=>{a.push(...n.qn())}),a}dn(){let e=[];return this.fa.forEach((t)=>{e.push(...t.dn())}),e}la(e,t){if(this.yn.autoscaleInfoProvider!==void 0){let a=this.yn.autoscaleInfoProvider(()=>{let n=this.nl(e,t);return n===null?null:n.sr()});return bf.er(a)}return this.nl(e,t)}Kh(){let e=this.yn.priceFormat;return e.base??1/e.minMove}sl(){return this.el}Nn(){this.Yh.Pt();for(let e of this.mn)e.Pt();for(let e of this.oa)e.Pt();this.dr.Pt(),this._a.Pt(),this.ua?.Pt(),this.fa.forEach((e)=>e.Nn())}Ft(){return z(super.Ft())}At(e){if(!((this.wa==="Line"||this.wa==="Area"||this.wa==="Baseline")&&this.yn.crosshairMarkerVisible))return null;let t=this.qt.Mh(e);if(t===null)return null;return{Mt:t.Wt[3],ft:this.rl(),Ht:this.hl(),Ot:this.al(),zt:this.ll(e)}}He(){return this.yn.title}It(){return this.yn.visible}ol(e){this.fa.push(new nk(e,this))}_l(e){this.fa=this.fa.filter((t)=>t.Qh()!==e)}ul(){if(this.wa==="Custom")return(e)=>this.Yh.Ha(e)}cl(){if(this.wa==="Custom")return(e)=>this.Yh.dl(e)}fl(){return this.qt.Lh()}Ka(){return!wf(this.Ft().pl())}nl(e,t){if(!Ao(e)||!Ao(t)||this.qt.Zi())return null;let a=this.wa==="Line"||this.wa==="Area"||this.wa==="Baseline"||this.wa==="Histogram"?[3]:[2,1],n=this.qt.Eh(e,t,a),i=n!==null?new pt(n.Uh,n.$h):null,r=null;if(this.bh()==="Histogram"){let l=this.yn.base,s=new pt(l,l);i=i!==null?i.Ss(s):s}return this.fa.forEach((l)=>{let s=l.la(e,t);if(s?.priceRange){let o=new pt(s.priceRange.minValue,s.priceRange.maxValue);i=i!==null?i.Ss(o):o}s?.margins&&(r=s.margins)}),new bf(i,r)}rl(){switch(this.wa){case"Line":case"Area":case"Baseline":return this.yn.crosshairMarkerRadius}return 0}hl(){switch(this.wa){case"Line":case"Area":case"Baseline":{let e=this.yn.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}al(){switch(this.wa){case"Line":case"Area":case"Baseline":return this.yn.crosshairMarkerBorderWidth}return 0}ll(e){switch(this.wa){case"Line":case"Area":case"Baseline":{let t=this.yn.crosshairMarkerBackgroundColor;if(t.length!==0)return t}}return this.Sa().Sh(e).sh}Ma(){switch(this.yn.priceFormat.type){case"custom":{let e=this.yn.priceFormat.formatter;this.el={format:e,formatTickmarks:this.yn.priceFormat.tickmarksFormatter??((t)=>t.map(e))};break}case"volume":this.el=new _w(this.yn.priceFormat.precision);break;case"percent":this.el=new ex(this.yn.priceFormat.precision);break;default:{let e=Math.pow(10,this.yn.priceFormat.precision);this.el=new zo(e,this.yn.priceFormat.minMove*e)}}this.hn!==null&&this.hn.vl()}Ja(e,t){let a=[];return sf(this.fa,e,t,a),a}Wa(){let{ml:e,wl:t,Ml:a}=this.gl();return this.pa.Sr(e,t,a)}gl(){let e=this.Qt().Et(),t=e.ml(),a=window.devicePixelRatio||1,n=e.N().conflationThresholdFactor;return{ml:t,wl:a,Ml:this.yn.conflationThresholdFactor??n??1}}bl(e){let t=this.qt.Bh(),a;if(this.wa==="Custom"&&this.ma!==null){let i=this.ul();if(!i)throw Error(i_);a=this.pa.Cr(t,e,this.ma,!0,(r)=>i(r))}else a=this.pa.Cr(t,e);let n=Lg();return n.ht(a),n}$a(e){let t=this.bl(e);this.va.set(e,t)}Da(e){if(this.wa==="Custom"&&(this.ma===null||!this.ul()))return;this.va.clear();let t=this.Qt().Et().Sl();for(let a of t){let n=()=>{this.xl(a)},i=typeof window=="object"&&window||typeof self=="object"&&self;i?.yl?.Cl?i.yl.Cl(()=>{n()},{se:e}):Promise.resolve().then(()=>n())}}xl(e){if(this.va.has(e))return;if(this.qt.Bh().length===0)return;let t=this.bl(e);this.va.set(e,t)}}var c_=[3],f_=[0,1,2,3];class ik{constructor(e){this.yn=e}Pl(e,t,a){let n=e;if(this.yn.mode===0)return n;let i=a.kn(),r=i.Lt();if(r===null)return n;let l=i.Nt(e,r),s=a.kl().filter((u)=>u instanceof _o).reduce((u,c)=>{if(a.Gs(c)||!c.It())return u;let f=c.Ft(),d=c.Un();if(f.Zi()||!d.ze(t))return u;let h=d.Mh(t);if(h===null)return u;let g=$n(c.Lt()),b=this.yn.mode===3?f_:c_;return u.concat(b.map((S)=>f.Nt(h.Wt[S],g.Wt)))},[]);if(s.length===0)return n;s.sort((u,c)=>Math.abs(u-l)-Math.abs(c-l));let o=s[0];return n=i.Tn(o,r),n}}function Io(e,t,a){return Math.min(Math.max(e,t),a)}function uf(e,t,a){return t-e<=a}function If(e){let t=Math.ceil(e);return t%2==0?t-1:t}class rk extends on{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:a,verticalPixelRatio:n}){if(this.qt===null)return;let i=Math.max(1,Math.floor(a));e.lineWidth=i,function(r,l){r.save(),r.lineWidth%2&&r.translate(0.5,0.5),l(),r.restore()}(e,()=>{let r=z(this.qt);if(r.Tl){e.strokeStyle=r.Rl,Wi(e,r.Dl),e.beginPath();for(let l of r.Il){let s=Math.round(l.Vl*a);e.moveTo(s,-i),e.lineTo(s,t.height+i)}e.stroke()}if(r.Bl){e.strokeStyle=r.El,Wi(e,r.Al),e.beginPath();for(let l of r.Ll){let s=Math.round(l.Vl*n);e.moveTo(-i,s),e.lineTo(t.width+i,s)}e.stroke()}})}}class lk{constructor(e){this.Xt=new rk,this.xt=!0,this.yt=e}Pt(){this.xt=!0}Tt(){if(this.xt){let e=this.yt.Qt().N().grid,t={Bl:e.horzLines.visible,Tl:e.vertLines.visible,El:e.horzLines.color,Rl:e.vertLines.color,Al:e.horzLines.style,Dl:e.vertLines.style,Ll:this.yt.kn().zl(),Il:(this.yt.Qt().Et().zl()||[]).map((a)=>({Vl:a.coord}))};this.Xt.ht(t),this.xt=!1}return this.Xt}}class sk{constructor(e){this.Yh=new lk(e)}wr(){return this.Yh}}var wg={Ol:4,Nl:0.0001};function bl(e,t){let a=100*(e-t)/t;return t<0?-a:a}function d_(e,t){let a=bl(e.Je(),t),n=bl(e.Qe(),t);return new pt(a,n)}function Mo(e,t){let a=100*(e-t)/t+100;return t<0?-a:a}function h_(e,t){let a=Mo(e.Je(),t),n=Mo(e.Qe(),t);return new pt(a,n)}function vf(e,t){let a=Math.abs(e);if(a<0.000000000000001)return 0;let n=Math.log10(a+t.Nl)+t.Ol;return e<0?-n:n}function To(e,t){let a=Math.abs(e);if(a<0.000000000000001)return 0;let n=Math.pow(10,a-t.Ol)-t.Nl;return e<0?-n:n}function Co(e,t){if(e===null)return null;let a=vf(e.Je(),t),n=vf(e.Qe(),t);return new pt(a,n)}function Sl(e,t){if(e===null)return null;let a=To(e.Je(),t),n=To(e.Qe(),t);return new pt(a,n)}function kg(e){if(e===null)return wg;let t=Math.abs(e.Qe()-e.Je());if(t>=1||t<0.000000000000001)return wg;let a=Math.ceil(Math.abs(Math.log10(t))),n=wg.Ol+a;return{Ol:n,Nl:1/Math.pow(10,n)}}class pf{constructor(e,t){if(this.Fl=e,this.Wl=t,function(a){if(a<0)return!1;if(a>1000000000000000000)return!0;for(let n=a;n>1;n/=10)if(n%10!=0)return!1;return!0}(this.Fl))this.Hl=[2,2.5,2];else{this.Hl=[];for(let a=this.Fl;a!==1;){if(a%2==0)this.Hl.push(2),a/=2;else{if(a%5!=0)throw Error("unexpected base");this.Hl.push(2,2.5),a/=5}if(this.Hl.length>100)throw Error("something wrong with base")}}}Ul(e,t,a){let n=this.Fl===0?0:1/this.Fl,i=Math.pow(10,Math.max(0,Math.ceil(Math.log10(e-t)))),r=0,l=this.Wl[0];for(;;){let c=uf(i,n,0.00000000000001)&&i>n+0.00000000000001,f=uf(i,a*l,0.00000000000001),d=uf(i,1,0.00000000000001);if(!(c&&f&&d))break;i/=l,l=this.Wl[++r%this.Wl.length]}if(i<=n+0.00000000000001&&(i=n),i=Math.max(1,i),this.Hl.length>0&&(s=i,o=1,u=0.00000000000001,Math.abs(s-o)<u))for(r=0,l=this.Hl[0];uf(i,a*l,0.00000000000001)&&i>n+0.00000000000001;)i/=l,l=this.Hl[++r%this.Hl.length];var s,o,u;return i}}class Fg{constructor(e,t,a,n){this.$l=[],this.Ki=e,this.Fl=t,this.jl=a,this.ql=n}Ul(e,t){if(e<t)throw Error("high < low");let a=this.Ki.$t(),n=(e-t)*this.Yl()/a,i=new pf(this.Fl,[2,2.5,2]),r=new pf(this.Fl,[2,2,2.5]),l=new pf(this.Fl,[2.5,2,2]),s=[];return s.push(i.Ul(e,t,n),r.Ul(e,t,n),l.Ul(e,t,n)),function(o){if(o.length<1)throw Error("array is empty");let u=o[0];for(let c=1;c<o.length;++c)o[c]<u&&(u=o[c]);return u}(s)}Kl(){let e=this.Ki,t=e.Lt();if(t===null)return void(this.$l=[]);let a=e.$t(),n=this.jl(a-1,t),i=this.jl(0,t),r=this.Ki.N().entireTextOnly?this.Gl()/2:0,l=r,s=a-1-r,o=Math.max(n,i),u=Math.min(n,i);if(o===u)return void(this.$l=[]);let c=this.Ul(o,u);if(this.Zl(t,c,o,u,l,s),e.Xl()&&this.Jl(c,u,o)){let h=this.Ki.Ql();this.io(t,c,l,s,h,2*h)}let f=this.$l.map((h)=>h.no),d=this.Ki.so(f);for(let h=0;h<this.$l.length;h++)this.$l[h].eo=d[h]}zl(){return this.$l}Gl(){return this.Ki.P()}Yl(){return Math.ceil(this.Gl()*this.Ki.N().tickMarkDensity)}Zl(e,t,a,n,i,r){let l=this.$l,s=this.Ki,o=a%t;o+=o<0?t:0;let u=a>=n?1:-1,c=null,f=0;for(let d=a-o;d>n;d-=t){let h=this.ql(d,e,!0);c!==null&&Math.abs(h-c)<this.Yl()||(h<i||h>r||(f<l.length?(l[f].Vl=h,l[f].eo=s.ro(d),l[f].no=d):l.push({Vl:h,eo:s.ro(d),no:d}),f++,c=h,s.ho()&&(t=this.Ul(d*u,n))))}l.length=f}io(e,t,a,n,i,r){let l=this.$l,s=this.ao(e,a,i,r),o=this.ao(e,n,-r,-i),u=this.ql(0,e,!0)-this.ql(t,e,!0);l.length>0&&l[0].Vl-s.Vl<u/2&&l.shift(),l.length>0&&o.Vl-l[l.length-1].Vl<u/2&&l.pop(),l.unshift(s),l.push(o)}ao(e,t,a,n){let i=(a+n)/2,r=this.jl(t+a,e),l=this.jl(t+n,e),s=Math.min(r,l),o=Math.max(r,l),u=Math.max(0.1,this.Ul(o,s)),c=this.jl(t+i,e),f=c-c%u,d=this.ql(f,e,!0);return{eo:this.Ki.ro(f),Vl:d,no:f}}Jl(e,t,a){let n=$n(this.Ki.ar());return this.Ki.ho()&&(n=Sl(n,this.Ki.lo())),n.Je()-t<e&&a-n.Qe()<e}}function ok(e){return e.slice().sort((t,a)=>z(t.ln())-z(a.ln()))}var FL;(function(e){e[e.Normal=0]="Normal",e[e.Logarithmic=1]="Logarithmic",e[e.Percentage=2]="Percentage",e[e.IndexedTo100=3]="IndexedTo100"})(FL||(FL={}));var UL=new ex,HL=new zo(100,1);class uk{constructor(e,t,a,n,i){this.oo=0,this._o=null,this.rr=null,this.uo=null,this.co={do:!1,fo:null},this.po=!1,this.vo=0,this.mo=0,this.wo=new Be,this.Mo=new Be,this.bo=[],this.So=null,this.xo=null,this.Co=null,this.yo=null,this.Po=null,this.el=HL,this.ko=kg(null),this.To=e,this.yn=t,this.Ro=a,this.Do=n,this.Io=i,this.Vo=new Fg(this,100,this.Bo.bind(this),this.Eo.bind(this))}pl(){return this.To}N(){return this.yn}vr(e){if(Ft(this.yn,e),this.vl(),e.mode!==void 0&&this.Ao({_e:e.mode}),e.scaleMargins!==void 0){let t=Mt(e.scaleMargins.top),a=Mt(e.scaleMargins.bottom);if(t<0||t>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(a<0||a>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${a}`);if(t+a>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${t+a}`);this.Lo(),this.Co=null}}zo(){return this.yn.autoScale}Oo(){return this.po}ho(){return this.yn.mode===1}je(){return this.yn.mode===2}No(){return this.yn.mode===3}lo(){return this.ko}_e(){return{hs:this.yn.autoScale,Fo:this.yn.invertScale,_e:this.yn.mode}}Ao(e){let t=this._e(),a=null;e.hs!==void 0&&(this.yn.autoScale=e.hs),e._e!==void 0&&(this.yn.mode=e._e,e._e!==2&&e._e!==3||(this.yn.autoScale=!0),this.co.do=!1),t._e===1&&e._e!==t._e&&(!function(i,r){if(i===null)return!1;let l=To(i.Je(),r),s=To(i.Qe(),r);return isFinite(l)&&isFinite(s)}(this.rr,this.ko)?this.yn.autoScale=!0:(a=Sl(this.rr,this.ko),a!==null&&this.Wo(a))),e._e===1&&e._e!==t._e&&(a=Co(this.rr,this.ko),a!==null&&this.Wo(a));let n=t._e!==this.yn.mode;n&&(t._e===2||this.je())&&this.vl(),n&&(t._e===3||this.No())&&this.vl(),e.Fo!==void 0&&t.Fo!==e.Fo&&(this.yn.invertScale=e.Fo,this.Ho()),this.Mo.p(t,this._e())}Uo(){return this.Mo}P(){return this.Ro.fontSize}$t(){return this.oo}$o(e){this.oo!==e&&(this.oo=e,this.Lo(),this.Co=null)}jo(){if(this._o)return this._o;let e=this.$t()-this.qo()-this.Yo();return this._o=e,e}ar(){return this.Ko(),this.rr}Wo(e,t){let a=this.rr;(t||a===null&&e!==null||a!==null&&!a.Ze(e))&&(this.Co=null,this.rr=e)}Go(e){this.Wo(e),this.Zo(e!==null)}Zi(){return this.Ko(),this.oo===0||!this.rr||this.rr.Zi()}Xo(e){return this.Fo()?e:this.$t()-1-e}Nt(e,t){return this.je()?e=bl(e,t):this.No()&&(e=Mo(e,t)),this.Eo(e,t)}Jo(e,t,a){this.Ko();let n=this.Yo(),i=z(this.ar()),r=i.Je(),l=i.Qe(),s=this.jo()-1,o=this.Fo(),u=s/(l-r),c=a===void 0?0:a.from,f=a===void 0?e.length:a.to,d=this.Qo();for(let h=c;h<f;h++){let g=e[h],b=g.Mt;if(isNaN(b))continue;let S=b;d!==null&&(S=d(g.Mt,t));let p=n+u*(S-r),x=o?p:this.oo-1-p;g.ut=x}}t_(e,t,a){this.Ko();let n=this.Yo(),i=z(this.ar()),r=i.Je(),l=i.Qe(),s=this.jo()-1,o=this.Fo(),u=s/(l-r),c=a===void 0?0:a.from,f=a===void 0?e.length:a.to,d=this.Qo();for(let h=c;h<f;h++){let g=e[h],b=g.jr,S=g.qr,p=g.Yr,x=g.Kr;d!==null&&(b=d(g.jr,t),S=d(g.qr,t),p=d(g.Yr,t),x=d(g.Kr,t));let y=n+u*(b-r),w=o?y:this.oo-1-y;g.i_=w,y=n+u*(S-r),w=o?y:this.oo-1-y,g.n_=w,y=n+u*(p-r),w=o?y:this.oo-1-y,g.s_=w,y=n+u*(x-r),w=o?y:this.oo-1-y,g.e_=w}}Tn(e,t){let a=this.Bo(e,t);return this.r_(a,t)}r_(e,t){let a=e;return this.je()?a=function(n,i){return i<0&&(n=-n),n/100*i+i}(a,t):this.No()&&(a=function(n,i){return n-=100,i<0&&(n=-n),n/100*i+i}(a,t)),a}kl(){return this.bo}Dt(){return this.xo||(this.xo=ok(this.bo)),this.xo}h_(e){this.bo.indexOf(e)===-1&&(this.bo.push(e),this.vl(),this.a_())}l_(e){let t=this.bo.indexOf(e);if(t===-1)throw Error("source is not attached to scale");this.bo.splice(t,1),this.bo.length===0&&(this.Ao({hs:!0}),this.Wo(null)),this.vl(),this.a_()}Lt(){let e=null;for(let t of this.bo){let a=t.Lt();a!==null&&((e===null||a.Oa<e.Oa)&&(e=a))}return e===null?null:e.Wt}Fo(){return this.yn.invertScale}zl(){let e=this.Lt()===null;if(this.Co!==null&&(e||this.Co.o_===e))return this.Co.zl;this.Vo.Kl();let t=this.Vo.zl();return this.Co={zl:t,o_:e},this.wo.p(),t}__(){return this.wo}u_(e){this.je()||this.No()||this.yo===null&&this.uo===null&&(this.Zi()||(this.yo=this.oo-e,this.uo=z(this.ar()).Xe()))}c_(e){if(this.je()||this.No())return;if(this.yo===null)return;this.Ao({hs:!1}),(e=this.oo-e)<0&&(e=0);let t=(this.yo+0.2*(this.oo-1))/(e+0.2*(this.oo-1)),a=z(this.uo).Xe();t=Math.max(t,0.1),a.ir(t),this.Wo(a)}d_(){this.je()||this.No()||(this.yo=null,this.uo=null)}f_(e){this.zo()||this.Po===null&&this.uo===null&&(this.Zi()||(this.Po=e,this.uo=z(this.ar()).Xe()))}p_(e){if(this.zo())return;if(this.Po===null)return;let t=z(this.ar()).tr()/(this.jo()-1),a=e-this.Po;this.Fo()&&(a*=-1);let n=a*t,i=z(this.uo).Xe();i.nr(n),this.Wo(i,!0),this.Co=null}v_(){this.zo()||this.Po!==null&&(this.Po=null,this.uo=null)}sl(){return this.el||this.vl(),this.el}Ji(e,t){switch(this.yn.mode){case 2:return this.m_(bl(e,t));case 3:return this.sl().format(Mo(e,t));default:return this.cr(e)}}ro(e){switch(this.yn.mode){case 2:return this.m_(e);case 3:return this.sl().format(e);default:return this.cr(e)}}so(e){switch(this.yn.mode){case 2:return this.w_(e);case 3:return this.sl().formatTickmarks(e);default:return this.M_(e)}}xa(e){return this.cr(e,z(this.So).sl())}Ca(e,t){return e=bl(e,t),this.m_(e,UL)}g_(){return this.bo}b_(e){this.co={fo:e,do:!1}}Nn(){this.bo.forEach((e)=>e.Nn())}Xl(){return this.yn.ensureEdgeTickMarksVisible&&this.zo()}Ql(){return this.P()/2}vl(){this.Co=null;let e=1/0;this.So=null;for(let a of this.bo)a.ln()<e&&(e=a.ln(),this.So=a);let t=100;this.So!==null&&(t=Math.round(this.So.Kh())),this.el=HL,this.je()?(this.el=UL,t=100):this.No()?(this.el=new zo(100,1),t=100):this.So!==null&&(this.el=this.So.sl()),this.Vo=new Fg(this,t,this.Bo.bind(this),this.Eo.bind(this)),this.Vo.Kl()}a_(){this.xo=null}S_(){return this.So===null||this.je()||this.No()?1:1/this.So.Kh()}Xi(){return this.Io}Zo(e){this.po=e}qo(){return this.Fo()?this.yn.scaleMargins.bottom*this.$t()+this.mo:this.yn.scaleMargins.top*this.$t()+this.vo}Yo(){return this.Fo()?this.yn.scaleMargins.top*this.$t()+this.vo:this.yn.scaleMargins.bottom*this.$t()+this.mo}Ko(){this.co.do||(this.co.do=!0,this.x_())}Lo(){this._o=null}Eo(e,t){if(this.Ko(),this.Zi())return 0;e=this.ho()&&e?vf(e,this.ko):e;let a=z(this.ar()),n=this.Yo()+(this.jo()-1)*(e-a.Je())/a.tr();return this.Xo(n)}Bo(e,t){if(this.Ko(),this.Zi())return 0;let a=this.Xo(e),n=z(this.ar()),i=n.Je()+n.tr()*((a-this.Yo())/(this.jo()-1));return this.ho()?To(i,this.ko):i}Ho(){this.Co=null,this.Vo.Kl()}x_(){if(this.Oo()&&!this.zo())return;let e=this.co.fo;if(e===null)return;let t=null,a=this.g_(),n=0,i=0;for(let s of a){if(!s.It())continue;let o=s.Lt();if(o===null)continue;let u=s.la(e.Na(),e.bi()),c=u&&u.ar();if(c!==null){switch(this.yn.mode){case 1:c=Co(c,this.ko);break;case 2:c=d_(c,o.Wt);break;case 3:c=h_(c,o.Wt)}if(t=t===null?c:t.Ss(z(c)),u!==null){let f=u.lr();f!==null&&(n=Math.max(n,f.above),i=Math.max(i,f.below))}}}if(this.Xl()&&(n=Math.max(n,this.Ql()),i=Math.max(i,this.Ql())),n===this.vo&&i===this.mo||(this.vo=n,this.mo=i,this.Co=null,this.Lo()),t!==null){if(t.Je()===t.Qe()){let s=5*this.S_();this.ho()&&(t=Sl(t,this.ko)),t=new pt(t.Je()-s,t.Qe()+s),this.ho()&&(t=Co(t,this.ko))}if(this.ho()){let s=Sl(t,this.ko),o=kg(s);if(r=o,l=this.ko,r.Ol!==l.Ol||r.Nl!==l.Nl){let u=this.uo!==null?Sl(this.uo,this.ko):null;this.ko=o,t=Co(s,o),u!==null&&(this.uo=Co(u,o))}}this.Wo(t)}else this.rr===null&&(this.Wo(new pt(-0.5,0.5)),this.ko=kg(null));var r,l}Qo(){return this.je()?bl:this.No()?Mo:this.ho()?(e)=>vf(e,this.ko):null}C_(e,t,a){return t===void 0?(a===void 0&&(a=this.sl()),a.format(e)):t(e)}y_(e,t,a){return t===void 0?(a===void 0&&(a=this.sl()),a.formatTickmarks(e)):t(e)}cr(e,t){return this.C_(e,this.Do.priceFormatter,t)}M_(e,t){let a=this.Do.priceFormatter;return this.y_(e,this.Do.tickmarksPriceFormatter??(a?(n)=>n.map(a):void 0),t)}m_(e,t){return this.C_(e,this.Do.percentageFormatter,t)}w_(e,t){let a=this.Do.percentageFormatter;return this.y_(e,this.Do.tickmarksPercentageFormatter??(a?(n)=>n.map(a):void 0),t)}}function VL(e){return e instanceof _o}class Cf{constructor(e,t){this.bo=[],this.P_=new Map,this.oo=0,this.k_=0,this.T_=1,this.xo=null,this.R_=null,this.D_=!1,this.I_=new Be,this.fa=[],this.ia=e,this.sn=t,this.V_=new sk(this);let a=t.N();this.B_=this.E_("left",a.leftPriceScale),this.A_=this.E_("right",a.rightPriceScale),this.B_.Uo().i(this.L_.bind(this,this.B_),this),this.A_.Uo().i(this.L_.bind(this,this.A_),this),this.z_(a)}z_(e){if(e.leftPriceScale&&this.B_.vr(e.leftPriceScale),e.rightPriceScale&&this.A_.vr(e.rightPriceScale),e.localization&&(this.B_.vl(),this.A_.vl()),e.overlayPriceScales){let t=Array.from(this.P_.values());for(let a of t){let n=z(a[0].Ft());n.vr(e.overlayPriceScales),e.localization&&n.vl()}}}O_(e){switch(e){case"left":return this.B_;case"right":return this.A_}return this.P_.has(e)?Mt(this.P_.get(e))[0].Ft():null}m(){this.Qt().N_().u(this),this.B_.Uo().u(this),this.A_.Uo().u(this),this.bo.forEach((e)=>{e.m&&e.m()}),this.fa=this.fa.filter((e)=>{let t=e.Qh();return t.detached&&t.detached(),!1}),this.I_.p()}F_(){return this.T_}W_(e){this.T_=e}Qt(){return this.sn}nn(){return this.k_}$t(){return this.oo}H_(e){this.k_=e,this.U_()}$o(e){this.oo=e,this.B_.$o(e),this.A_.$o(e),this.bo.forEach((t)=>{if(this.Gs(t)){let a=t.Ft();a!==null&&a.$o(e)}}),this.U_()}j_(e){this.D_=e}q_(){return this.D_}Y_(){return this.bo.filter(VL)}kl(){return this.bo}Gs(e){let t=e.Ft();return t===null||this.B_!==t&&this.A_!==t}h_(e,t,a){this.K_(e,t,a?e.ln():this.bo.length)}l_(e,t){let a=this.bo.indexOf(e);lt(a!==-1,"removeDataSource: invalid data source"),this.bo.splice(a,1),t||this.bo.forEach((r,l)=>r._n(l));let n=z(e.Ft()).pl();if(this.P_.has(n)){let r=Mt(this.P_.get(n)),l=r.indexOf(e);l!==-1&&(r.splice(l,1),r.length===0&&this.P_.delete(n))}let i=e.Ft();i&&i.kl().indexOf(e)>=0&&(i.l_(e),this.G_(i)),this.Z_()}Xs(e){return e===this.B_?"left":e===this.A_?"right":"overlay"}X_(){return this.B_}J_(){return this.A_}Q_(e,t){e.u_(t)}tu(e,t){e.c_(t),this.U_()}iu(e){e.d_()}nu(e,t){e.f_(t)}su(e,t){e.p_(t),this.U_()}eu(e){e.v_()}U_(){this.bo.forEach((e)=>{e.Nn()})}kn(){let[e,t]=this.ru(),a=null;return e.N().visible&&e.kl().length!==0?a=e:t.N().visible&&t.kl().length!==0?a=t:this.bo.length!==0&&(a=this.bo[0].Ft()),a===null&&(a=this.Zs()??e),a}Zs(){let[e,t]=this.ru();return e.N().visible?e:t.N().visible?t:null}G_(e){e!==null&&e.zo()&&this.hu(e)}au(e){let t=this.ia.Ee();e.Ao({hs:!0}),t!==null&&e.b_(t),this.U_()}lu(){this.hu(this.B_),this.hu(this.A_)}ou(){this.G_(this.B_),this.G_(this.A_),this.bo.forEach((e)=>{this.Gs(e)&&this.G_(e.Ft())}),this.U_(),this.sn.mr()}Dt(){return this.xo===null&&(this.xo=ok(this.bo)),this.xo}_u(){let e=this.Dt(),t=this.sn.cu()?.uu,a=this.sn.N().hoveredSeriesOnTop,n=this.R_;if(n!==null&&n.Kh===e&&n.du===t&&n.fu===a)return n.pu;let i=function(r,l,s){if(!s)return r;let o=r.indexOf(l);if(o===-1||o===r.length-1)return r;let u=[];for(let c=0;c<r.length;c++)c!==o&&u.push(r[c]);return u.push(r[o]),u}(e,t,a);return this.R_={Kh:e,du:t,fu:a,pu:i},i}vu(e,t){t=Io(t,0,this.bo.length-1);let a=this.bo.indexOf(e);lt(a!==-1,"setSeriesOrder: invalid data source"),this.bo.splice(a,1),this.bo.splice(t,0,e),this.bo.forEach((n,i)=>n._n(i)),this.Z_();for(let n of[this.B_,this.A_])n.a_(),n.vl();this.sn.mr()}Vt(){return this.Dt().filter(VL)}mu(){return this.I_}wu(){return this.V_}ol(e){this.fa.push(new l_(e))}_l(e){this.fa=this.fa.filter((t)=>t.Qh()!==e),e.detached&&e.detached(),this.sn.mr()}Mu(){return this.fa}il(e,t){return this.fa.map((a)=>a.Qs(e,t)).filter((a)=>a!==null)}hu(e){let t=e.g_();if(t&&t.length>0&&!this.ia.Zi()){let a=this.ia.Ee();a!==null&&e.b_(a)}e.Nn()}K_(e,t,a){let n=this.O_(t);if(n===null&&(n=this.E_(t,this.sn.N().overlayPriceScales)),this.bo.splice(a,0,e),!wf(t)){let i=this.P_.get(t)||[];i.push(e),this.P_.set(t,i)}e._n(a),n.h_(e),e.un(n),this.G_(n),this.Z_()}Z_(){this.xo=null,this.R_=null}ru(){return this.sn.N().defaultVisiblePriceScaleId==="left"?[this.B_,this.A_]:[this.A_,this.B_]}L_(e,t,a){t._e!==a._e&&this.hu(e)}E_(e,t){let a={visible:!0,autoScale:!0,...ln(t)},n=new uk(e,a,this.sn.N().layout,this.sn.N().localization,this.sn.Xi());return n.$o(this.$t()),n}}function Ug(e,t){return t===null||(e.se===2&&t.se!==2||(t.se!==2||e.se===2)&&(e.ne!==t.ne&&e.ne<t.ne))}function ck(e){return{te:e.te,ie:e.ie}}function m_(e){return{ne:e.distance??0,se:e.hitTestPriority??(e.itemType==="marker"?2:0),ee:e.itemType??"primitive",gu:e.cursorStyle,te:e.externalId}}function cf(e){return{uu:e.uu,bu:ck(e.Su),gu:e.Su.gu,ee:e.Su.ee??"primitive"}}function p_(e,t,a,n){let i=null;for(let r of e){let l=r.Qs?.(t,a,n)??null;if(l===null){let s=r.Tt(n);l=s!==null&&s.Qs?s.Qs(t,a):null}if(l!==null){let s={xu:r,Su:l};(i===null||Ug(s.Su,i.Su))&&(i=s)}}return i}function g_(e){return e.jn!==void 0}function fk(e,t,a){let n=[e,...e.Dt()].reverse(),i=function(s,o,u){let c,f,d;for(let b of s){let S=b.il?.(o,u)??[];for(let p of S){let x=m_(p);h=p.zOrder,g=c?.zOrder,(!g||h==="top"&&g!=="top"||h==="normal"&&g==="bottom"||p.zOrder===c?.zOrder&&f!==void 0&&Ug(x,f)||p.zOrder===c?.zOrder&&f===void 0)&&(c=p,f=x,d=b)}}var h,g;return c&&d&&f?{Su:f,Cu:c,uu:d}:null}(n,t,a);if(i?.Cu.zOrder==="top")return cf(i);let r=null,l=null;for(let s of n){if(i&&i.uu===s&&i.Cu.zOrder!=="bottom"&&!i.Cu.isBackground)return r??cf(i);if(g_(s)){let o=p_(s.jn(e),t,a,e);if(o!==null){let u={uu:s,xu:o.xu,bu:ck(o.Su),gu:o.Su.gu,ee:o.Su.ee??"primitive"};(r===null||Ug(o.Su,l))&&(r=u,l=o.Su)}}if(i&&i.uu===s&&i.Cu.zOrder!=="bottom"&&i.Cu.isBackground)return r??cf(i)}return r!==null?r:i?.Cu?cf(i):null}class dk{constructor(e,t,a=50){this.Vs=0,this.Bs=1,this.Es=1,this.Ls=new Map,this.As=new Map,this.yu=e,this.Pu=t,this.zs=a}ku(e){let t=e.time,a=this.Pu.cacheKey(t),n=this.Ls.get(a);if(n!==void 0)return n.Tu;if(this.Vs===this.zs){let r=this.As.get(this.Es);this.As.delete(this.Es),this.Ls.delete(Mt(r)),this.Es++,this.Vs--}let i=this.yu(e);return this.Ls.set(a,{Tu:i,Ws:this.Bs}),this.As.set(this.Bs,a),this.Vs++,this.Bs++,i}}class Xi{constructor(e,t){lt(e<=t,"right should be >= left"),this.Ru=e,this.Du=t}Na(){return this.Ru}bi(){return this.Du}Iu(){return this.Du-this.Ru+1}ze(e){return this.Ru<=e&&e<=this.Du}Ze(e){return this.Ru===e.Na()&&this.Du===e.bi()}}function GL(e,t){return e===null||t===null?e===t:e.Ze(t)}class hk{constructor(){this.Vu=new Map,this.Ls=null,this.Bu=!1}Eu(e){this.Bu=e,this.Ls=null}Au(e,t){this.Lu(t),this.Ls=null;for(let a=t;a<e.length;++a){let n=e[a],i=this.Vu.get(n.timeWeight);i===void 0&&(i=[],this.Vu.set(n.timeWeight,i)),i.push({index:a,time:n.time,weight:n.timeWeight,originalTime:n.originalTime})}}zu(e,t,a,n,i){let r=Math.ceil(t/e);return this.Ls!==null&&this.Ls.Ou===r&&i===this.Ls.Nu&&a===this.Ls.Fu||(this.Ls={Nu:i,Fu:a,zl:this.Wu(r,a,n),Ou:r}),this.Ls.zl}Lu(e){if(e===0)return void this.Vu.clear();let t=[];this.Vu.forEach((a,n)=>{e<=a[0].index?t.push(n):a.splice($i(a,e,(i)=>i.index<e),1/0)});for(let a of t)this.Vu.delete(a)}Wu(e,t,a){let n=[],i=(r)=>!t||a.has(r.index);for(let r of Array.from(this.Vu.keys()).sort((l,s)=>s-l)){if(!this.Vu.get(r))continue;let l=n;n=[];let s=l.length,o=0,u=Mt(this.Vu.get(r)),c=u.length,f=1/0,d=-1/0;for(let h=0;h<c;h++){let g=u[h],b=g.index;for(;o<s;){let S=l[o],p=S.index;if(!(p<b&&i(S))){f=p;break}o++,n.push(S),d=p,f=1/0}if(f-b>=e&&b-d>=e&&i(g))n.push(g),d=b;else if(this.Bu)return l}for(;o<s;o++)i(l[o])&&n.push(l[o])}return n}}class vl{constructor(e){this.Hu=e}Uu(){return this.Hu===null?null:new Xi(Math.floor(this.Hu.Na()),Math.ceil(this.Hu.bi()))}$u(){return this.Hu}static ju(){return new vl(null)}}function x_(e,t){return e.weight>t.weight?e:t}class mk{constructor(e,t,a,n){this.k_=0,this.qu=null,this.Yu=[],this.Po=null,this.yo=null,this.Ku=new hk,this.Gu=new Map,this.Zu=vl.ju(),this.Xu=!0,this.Ju=new Be,this.Qu=new Be,this.tc=new Be,this.nc=null,this.sc=null,this.ec=new Map,this.rc=-1,this.hc=[],this.ac=1,this.yn=t,this.Do=a,this.lc=t.rightOffset,this.oc=t.barSpacing,this.sn=e,this._c(t),this.Pu=n,this.uc(),this.Ku.Eu(t.uniformDistribution),this.cc(),this.dc()}N(){return this.yn}fc(e){Ft(this.Do,e),this.vc(),this.uc()}vr(e,t){Ft(this.yn,e),this.yn.fixLeftEdge&&this.mc(),this.yn.fixRightEdge&&this.wc(),e.barSpacing!==void 0&&this.sn.Ms(e.barSpacing),e.rightOffset!==void 0&&this.sn.gs(e.rightOffset),this._c(e),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.sn.Ms(e.barSpacing??this.oc),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.yn.ignoreWhitespaceIndices&&this.dc(),this.vc(),this.uc(),e.enableConflation===void 0&&e.conflationThresholdFactor===void 0||this.cc(),this.tc.p()}Rn(e){return this.Yu[e]?.time??null}en(e){return this.Yu[e]??null}Mc(e,t){if(this.Yu.length<1)return null;if(this.Pu.key(e)>this.Pu.key(this.Yu[this.Yu.length-1].time))return t?this.Yu.length-1:null;let a=$i(this.Yu,this.Pu.key(e),(n,i)=>this.Pu.key(n.time)<i);return this.Pu.key(e)<this.Pu.key(this.Yu[a].time)?t?a:null:a}Zi(){return this.k_===0||this.Yu.length===0||this.qu===null}gc(){return this.Yu.length>0}Ee(){return this.bc(),this.Zu.Uu()}Sc(){return this.bc(),this.Zu.$u()}xc(){let e=this.Ee();if(e===null)return null;let t={from:e.Na(),to:e.bi()};return this.Cc(t)}Cc(e){let t=Math.round(e.from),a=Math.round(e.to),n=z(this.yc()),i=z(this.Pc());return{from:z(this.en(Math.max(n,t))),to:z(this.en(Math.min(i,a)))}}kc(e){return{from:z(this.Mc(e.from,!0)),to:z(this.Mc(e.to,!0))}}nn(){return this.k_}H_(e){if(!isFinite(e)||e<=0)return;if(this.k_===e)return;let t=this.Sc(),a=this.k_;if(this.k_=e,this.Xu=!0,this.yn.lockVisibleTimeRangeOnResize&&a!==0){let n=this.oc*e/a;this.oc=n}if(this.yn.fixLeftEdge&&t!==null&&t.Na()<=0){let n=a-e;this.lc-=Math.round(n/this.oc)+1,this.Xu=!0}this.Tc(),this.Rc()}jt(e){if(this.Zi()||!Ao(e))return 0;let t=this.Dc()+this.lc-e;return this.k_-(t+0.5)*this.oc-1}Ic(e,t){let a=this.Dc(),n=t===void 0?0:t.from,i=t===void 0?e.length:t.to;for(let r=n;r<i;r++){let l=e[r].wt,s=a+this.lc-l,o=this.k_-(s+0.5)*this.oc-1;e[r]._t=o}}Vc(e,t){let a=Math.ceil(this.Bc(e));return t&&this.yn.ignoreWhitespaceIndices&&!this.Ec(a)?this.Ac(a):a}gs(e){this.Xu=!0,this.lc=e,this.Rc(),this.sn.Lc(),this.sn.mr()}ml(){return this.oc}Ms(e){let t=this.oc;if(this.zc(e),this.yn.rightOffsetPixels!==void 0&&t!==0){let a=this.lc*t/this.oc;this.lc=a}this.Rc(),this.sn.Lc(),this.sn.mr()}Oc(){return this.lc}zl(){if(this.Zi())return null;if(this.sc!==null)return this.sc;let e=this.oc,t=5*(this.sn.N().layout.fontSize+4)/8*(this.yn.tickMarkMaxCharacterLength||8),a=Math.round(t/e),n=z(this.Ee()),i=Math.max(n.Na(),n.Na()-a),r=Math.max(n.bi(),n.bi()-a),l=this.Ku.zu(e,t,this.yn.ignoreWhitespaceIndices,this.ec,this.rc),s=this.yc()+a,o=this.Pc()-a,u=this.Nc(),c=this.yn.fixLeftEdge||u,f=this.yn.fixRightEdge||u,d=0;for(let h of l){if(!(i<=h.index&&h.index<=r))continue;let g;d<this.hc.length?(g=this.hc[d],g.coord=this.jt(h.index),g.label=this.Fc(h),g.weight=h.weight):(g={needAlignCoordinate:!1,coord:this.jt(h.index),label:this.Fc(h),weight:h.weight},this.hc.push(g)),this.oc>t/2&&!u?g.needAlignCoordinate=!1:g.needAlignCoordinate=c&&h.index<=s||f&&h.index>=o,d++}return this.hc.length=d,this.sc=this.hc,this.hc}Wc(){let e;this.Xu=!0,this.Ms(this.yn.barSpacing),e=this.yn.rightOffsetPixels!==void 0?this.yn.rightOffsetPixels/this.ml():this.yn.rightOffset,this.gs(e)}Hc(e){this.Xu=!0,this.qu=e,this.Rc(),this.mc()}Uc(e,t){let a=this.Bc(e),n=this.ml(),i=n+t*(n/10);this.Ms(i),this.yn.rightBarStaysOnScroll||this.gs(this.Oc()+(a-this.Bc(e)))}u_(e){this.Po&&this.v_(),this.yo===null&&this.nc===null&&(this.Zi()||(this.yo=e,this.$c()))}c_(e){if(this.nc===null)return;let t=Io(this.k_-e,0,this.k_),a=Io(this.k_-z(this.yo),0,this.k_);t!==0&&a!==0&&this.Ms(this.nc.ml*t/a)}d_(){this.yo!==null&&(this.yo=null,this.jc())}f_(e){this.Po===null&&this.nc===null&&(this.Zi()||(this.Po=e,this.$c()))}p_(e){if(this.Po===null)return;let t=(this.Po-e)/this.ml();this.lc=z(this.nc).Oc+t,this.Xu=!0,this.Rc()}v_(){this.Po!==null&&(this.Po=null,this.jc())}qc(){this.Yc(this.yn.rightOffset)}Yc(e,t=400){if(!isFinite(e))throw RangeError("offset is required and must be finite number");if(!isFinite(t)||t<=0)throw RangeError("animationDuration (optional) must be finite positive number");let a=this.lc,n=performance.now();this.sn.ps({Kc:(i)=>(i-n)/t>=1,Gc:(i)=>{let r=(i-n)/t;return r>=1?e:a+(e-a)*r}})}Pt(e,t){this.Xu=!0,this.Yu=e,this.Ku.Au(e,t),this.Rc()}Zc(){return this.Ju}Xc(){return this.Qu}Jc(){return this.tc}Dc(){return this.qu||0}Qc(e,t){let a=e.Iu(),n=t&&this.yn.rightOffsetPixels||0;this.zc((this.k_-n)/a),this.lc=e.bi()-this.Dc(),t&&(this.lc=n?n/this.ml():this.yn.rightOffset),this.Rc(),this.Xu=!0,this.sn.Lc(),this.sn.mr()}td(){let e=this.yc(),t=this.Pc();if(e===null||t===null)return;let a=!this.yn.rightOffsetPixels&&this.yn.rightOffset||0;this.Qc(new Xi(e,t+a),!0)}nd(e){let t=new Xi(e.from,e.to);this.Qc(t)}rn(e){return this.Do.timeFormatter!==void 0?this.Do.timeFormatter(e.originalTime):this.Pu.formatHorzItem(e.time)}dc(){if(!this.yn.ignoreWhitespaceIndices)return;this.ec.clear();let e=this.sn.Jn();for(let t of e)for(let a of t.fl())this.ec.set(a,!0);this.rc++}sd(){return this.ac}Sl(){let e=1/(window.devicePixelRatio||1),t=this.yn.minBarSpacing;if(t>=e)return[1];let a=[1],n=2;for(;n<=512;)t<e/n&&a.push(n),n*=2;return a}Nc(){let e=this.sn.N().handleScroll,t=this.sn.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}yc(){return this.Yu.length===0?null:0}Pc(){return this.Yu.length===0?null:this.Yu.length-1}ed(e){return(this.k_-1-e)/this.oc}Bc(e){let t=this.ed(e),a=this.Dc()+this.lc-t;return Math.round(1e6*a)/1e6}zc(e){let t=this.oc;this.oc=e,this.Tc(),t!==this.oc&&(this.Xu=!0,this.rd(),this.cc())}bc(){if(!this.Xu)return;if(this.Xu=!1,this.Zi())return void this.hd(vl.ju());let e=this.Dc(),t=this.k_/this.oc,a=this.lc+e,n=new Xi(a-t+1,a);this.hd(new vl(n))}Tc(){let e=Io(this.oc,this.ad(),this.ld());this.oc!==e&&(this.oc=e,this.Xu=!0)}ld(){return this.yn.maxBarSpacing>0?this.yn.maxBarSpacing:0.5*this.k_}ad(){return this.yn.fixLeftEdge&&this.yn.fixRightEdge&&this.Yu.length!==0?this.k_/this.Yu.length:this.yn.minBarSpacing}cc(){if(!this.yn.enableConflation)return void(this.ac=1);let e=1/(window.devicePixelRatio||1)*(this.yn.conflationThresholdFactor??1);if(this.oc>=e)return void(this.ac=1);let t=e/this.oc,a=Math.pow(2,Math.floor(Math.log2(t)));this.ac=Math.min(a,512)}Rc(){let e=this.od();e!==null&&this.lc<e&&(this.lc=e,this.Xu=!0);let t=this._d();this.lc>t&&(this.lc=t,this.Xu=!0)}od(){let e=this.yc(),t=this.qu;if(e===null||t===null)return null;return e-t-1+(this.yn.fixLeftEdge?this.k_/this.oc:Math.min(2,this.Yu.length))}_d(){return this.yn.fixRightEdge?0:this.k_/this.oc-Math.min(2,this.Yu.length)}$c(){this.nc={ml:this.ml(),Oc:this.Oc()}}jc(){this.nc=null}Fc(e){let t=this.Gu.get(e.weight);return t===void 0&&(t=new dk((a)=>this.ud(a),this.Pu),this.Gu.set(e.weight,t)),t.ku(e)}ud(e){return this.Pu.formatTickmark(e,this.Do)}hd(e){let t=this.Zu;this.Zu=e,GL(t.Uu(),this.Zu.Uu())||this.Ju.p(),GL(t.$u(),this.Zu.$u())||this.Qu.p(),this.rd()}rd(){this.sc=null}vc(){this.rd(),this.Gu.clear()}uc(){this.Pu.updateFormatter(this.Do)}mc(){if(!this.yn.fixLeftEdge)return;let e=this.yc();if(e===null)return;let t=this.Ee();if(t===null)return;let a=t.Na()-e;if(a<0){let n=this.lc-a-1;this.gs(n)}this.Tc()}wc(){this.Rc(),this.Tc()}Ec(e){return!this.yn.ignoreWhitespaceIndices||(this.ec.get(e)||!1)}Ac(e){let t=function*(n){let i=Math.round(n),r=i<n,l=1;for(;;)r?(yield i+l,yield i-l):(yield i-l,yield i+l),l++}(e),a=this.Pc();for(;a;){let n=t.next().value;if(this.ec.get(n))return n;if(n<0||n>a)break}return e}_c(e){if(e.rightOffsetPixels!==void 0){let t=e.rightOffsetPixels/(e.barSpacing||this.oc);this.sn.gs(t)}}}var QL,jL,YL,er,ei;(function(e){e[e.OnTouchEnd=0]="OnTouchEnd",e[e.OnNextTap=1]="OnNextTap"})(QL||(QL={}));class pk{constructor(e,t,a){this.dd=[],this.fd=[],this.pd=null,this.k_=0,this.vd=null,this.md=new Be,this.wd=new Be,this.Md=null,this.gd=e,this.yn=t,this.Pu=a,this.Io=new kw(this.yn.layout.colorParsers),this.bd=new ww(this),this.ia=new mk(this,t.timeScale,this.yn.localization,a),this.Ct=new zw(this,t.crosshair),this.Sd=new ik(t.crosshair),t.addDefaultPane&&(this.xd(0),this.dd[0].W_(2)),this.Cd=this.yd(0),this.Pd=this.yd(1)}ka(){this.kd(rt.ys())}mr(){this.kd(rt.Cs())}Ya(){this.kd(new rt(1))}Ta(e){let t=this.Td(e);this.kd(t)}cu(){return this.vd}Rd(e){if(this.vd?.uu===e?.uu&&this.vd?.bu?.te===e?.bu?.te&&this.vd?.bu?.ie===e?.bu?.ie&&this.vd?.gu===e?.gu&&this.vd?.ee===e?.ee)return;let t=this.vd;this.vd=e,t!==null&&this.Ta(t.uu),e!==null&&e.uu!==t?.uu&&this.Ta(e.uu)}N(){return this.yn}vr(e){Ft(this.yn,e),this.dd.forEach((t)=>t.z_(e)),e.timeScale!==void 0&&this.ia.vr(e.timeScale),e.localization!==void 0&&this.ia.fc(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.md.p(),this.Cd=this.yd(0),this.Pd=this.yd(1),this.ka()}Dd(e,t,a=0){let n=this.dd[a];if(n===void 0)return;if(e==="left")return Ft(this.yn,{leftPriceScale:t}),n.z_({leftPriceScale:t}),this.md.p(),void this.ka();if(e==="right")return Ft(this.yn,{rightPriceScale:t}),n.z_({rightPriceScale:t}),this.md.p(),void this.ka();let i=this.Id(e,a);i!==null&&(i.Ft.vr(t),this.md.p())}Id(e,t){let a=this.dd[t];if(a===void 0)return null;let n=a.O_(e);return n!==null?{Kn:a,Ft:n}:null}Et(){return this.ia}Gn(){return this.dd}Vd(){return this.Ct}Bd(){return this.wd}Ed(e,t){e.$o(t),this.Lc()}H_(e){this.k_=e,this.ia.H_(this.k_),this.dd.forEach((t)=>t.H_(e)),this.Lc()}Ad(e){this.dd.length!==1&&(lt(e>=0&&e<this.dd.length,"Invalid pane index"),this.dd.splice(e,1),this.ka())}Ld(e,t){if(this.dd.length<2)return;lt(e>=0&&e<this.dd.length,"Invalid pane index");let a=this.dd[e],n=this.dd.reduce((c,f)=>c+f.F_(),0),i=this.dd.reduce((c,f)=>c+f.$t(),0),r=i-30*(this.dd.length-1);t=Math.min(r,Math.max(30,t));let l=n/i,s=a.$t();a.W_(t*l);let o=t-s,u=this.dd.length-1;for(let c of this.dd)if(c!==a){let f=Math.min(r,Math.max(30,c.$t()-o/u));o-=c.$t()-f,u-=1;let d=f*l;c.W_(d)}this.ka()}zd(e,t){lt(e>=0&&e<this.dd.length&&t>=0&&t<this.dd.length,"Invalid pane index");let a=this.dd[e],n=this.dd[t];this.dd[e]=n,this.dd[t]=a,this.ka()}Od(e,t){if(lt(e>=0&&e<this.dd.length&&t>=0&&t<this.dd.length,"Invalid pane index"),e===t)return;let[a]=this.dd.splice(e,1);this.dd.splice(t,0,a),this.ka()}Q_(e,t,a){e.Q_(t,a)}tu(e,t,a){e.tu(t,a),this.Ra(),this.kd(this.Nd(e,2))}iu(e,t){e.iu(t),this.kd(this.Nd(e,2))}nu(e,t,a){t.zo()||e.nu(t,a)}su(e,t,a){t.zo()||(e.su(t,a),this.Ra(),this.kd(this.Nd(e,2)))}eu(e,t){t.zo()||(e.eu(t),this.kd(this.Nd(e,2)))}au(e,t){e.au(t),this.kd(this.Nd(e,2))}Fd(e){this.ia.u_(e)}Wd(e,t){let a=this.Et();if(a.Zi()||t===0)return;let n=a.nn();e=Math.max(1,Math.min(e,n)),a.Uc(e,t),this.Lc()}Hd(e){this.Ud(0),this.$d(e),this.jd()}qd(e){this.ia.c_(e),this.Lc()}Yd(){this.ia.d_(),this.mr()}Ud(e){this.ia.f_(e)}$d(e){this.ia.p_(e),this.Lc()}jd(){this.ia.v_(),this.mr()}Jn(){return this.fd}Wn(){return this.pd===null&&(this.pd=this.fd.filter((e)=>e.It())),this.pd}Pa(){this.pd=null}Kd(e,t,a,n,i){this.Ct.In(e,t);let r=NaN,l=this.ia.Vc(e,!0),s=this.ia.Ee();s!==null&&(l=Math.min(Math.max(s.Na(),l),s.bi())),l=this.Ct.Fn(l);let o=n.kn(),u=o.Lt();if(u!==null&&(r=o.Tn(t,u)),r=this.Sd.Pl(r,l,n),this.Ct.An(l,r,n),this.Ya(),!i){let c=fk(n,e,t);this.Rd(c&&{uu:c.uu,bu:c.bu,gu:c.gu||null,ee:c.ee}),this.wd.p(this.Ct.Bt(),{x:e,y:t},a)}}Gd(e,t,a){let n=a.kn(),i=n.Lt(),r=n.Nt(e,z(i)),l=this.ia.Mc(t,!0),s=this.ia.jt(z(l));this.Kd(s,r,null,a,!0)}Zd(e){this.Vd().zn(),this.Ya(),e||this.wd.p(null,null,null)}Ra(){let e=this.Ct.Kn();if(e!==null){let t=this.Ct.Bn(),a=this.Ct.En();this.Kd(t,a,null,e)}this.Ct.Nn()}Xd(e,t,a){let n=this.ia.Rn(0);t!==void 0&&a!==void 0&&this.ia.Pt(t,a);let i=this.ia.Rn(0),r=this.ia.Dc(),l=this.ia.Ee();if(l!==null&&n!==null&&i!==null){let s=l.ze(r),o=this.Pu.key(n)>this.Pu.key(i),u=e!==null&&e>r&&!o,c=this.ia.N().allowShiftVisibleRangeOnWhitespaceReplacement,f=s&&(a!==void 0||c)&&this.ia.N().shiftVisibleRangeOnNewBar;if(u&&!f){let d=e-r;this.ia.gs(this.ia.Oc()-d)}}this.ia.Hc(e)}Ba(e){e!==null&&e.ou()}Ks(e){if(function(a){return a instanceof Cf}(e))return e;let t=this.dd.find((a)=>a.Dt().includes(e));return t===void 0?null:t}Lc(){this.dd.forEach((e)=>e.ou()),this.Ra()}m(){this.dd.forEach((e)=>e.m()),this.dd.length=0,this.yn.localization.priceFormatter=void 0,this.yn.localization.percentageFormatter=void 0,this.yn.localization.timeFormatter=void 0}Jd(){return this.bd}Js(){return this.bd.N()}N_(){return this.md}Qd(e,t){let a=this.xd(t);this.tf(e,a),this.fd.push(e),this.Pa(),this.fd.length===1?this.ka():this.mr()}if(e){let t=this.Ks(e),a=this.fd.indexOf(e);lt(a!==-1,"Series not found");let n=z(t);this.fd.splice(a,1),n.l_(e),e.m&&e.m(),this.Pa(),this.ia.dc(),this.nf(n)}ya(e,t){let a=z(this.Ks(e));a.l_(e,!0),a.h_(e,t,!0)}td(){let e=rt.Cs();e.us(),this.kd(e)}sf(e){let t=rt.Cs();t.fs(e),this.kd(t)}ws(){let e=rt.Cs();e.ws(),this.kd(e)}Ms(e){let t=rt.Cs();t.Ms(e),this.kd(t)}gs(e){let t=rt.Cs();t.gs(e),this.kd(t)}ps(e){let t=rt.Cs();t.ps(e),this.kd(t)}cs(){let e=rt.Cs();e.cs(),this.kd(e)}ef(){let e=this.yn.defaultVisiblePriceScaleId,t=this.yn.leftPriceScale.visible;return t!==this.yn.rightPriceScale.visible?t?"left":"right":e}rf(e,t){if(lt(t>=0,"Index should be greater or equal to 0"),t===this.hf(e))return;let a=z(this.Ks(e));a.l_(e);let n=this.xd(t);this.tf(e,n);let i=!1;a.kl().length===0&&(i=this.nf(a)),i||this.ka()}af(){return this.Pd}$(){return this.Cd}Ut(e){let t=this.Pd,a=this.Cd;if(t===a)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.Md===null||this.Md.ah!==a||this.Md.oh!==t)this.Md={ah:a,oh:t,lf:new Map};else{let i=this.Md.lf.get(e);if(i!==void 0)return i}let n=this.Io.tt(a,t,e/100);return this.Md.lf.set(e,n),n}_f(e){return this.dd.indexOf(e)}Xi(){return this.Io}uf(){return this.cf()}cf(e){let t=new Cf(this.ia,this);this.dd.push(t);let a=e??this.dd.length-1,n=rt.ys();return n.es(a,{rs:0,hs:!0}),this.kd(n),t}xd(e){return lt(e>=0,"Index should be greater or equal to 0"),(e=Math.min(this.dd.length,e))<this.dd.length?this.dd[e]:this.cf(e)}hf(e){return this.dd.findIndex((t)=>t.Y_().includes(e))}Nd(e,t){let a=new rt(t);if(e!==null){let n=this.dd.indexOf(e);a.es(n,{rs:t})}return a}Td(e,t){return t===void 0&&(t=2),this.Nd(this.Ks(e),t)}kd(e){this.gd&&this.gd(e),this.dd.forEach((t)=>t.wu().wr().Pt())}tf(e,t){let a=e.N().priceScaleId,n=a!==void 0?a:this.ef();t.h_(e,n),wf(n)||e.vr(e.N())}yd(e){let t=this.yn.layout;return t.background.type==="gradient"?e===0?t.background.topColor:t.background.bottomColor:t.background.color}nf(e){return!e.q_()&&e.kl().length===0&&this.dd.length>1&&(this.dd.splice(this._f(e),1),this.ka(),!0)}}function gk(e){if(e>=1)return 0;let t=0;for(;t<8;t++){let a=Math.round(e);if(Math.abs(a-e)<0.00000001)return t;e*=10}return t}function Hg(e){return!Zi(e)&&!Ro(e)}function xk(e){return Zi(e)}(function(e){e[e.Disabled=0]="Disabled",e[e.Continuous=1]="Continuous",e[e.OnDataUpdate=2]="OnDataUpdate"})(jL||(jL={})),function(e){e[e.LastBar=0]="LastBar",e[e.LastVisible=1]="LastVisible"}(YL||(YL={})),function(e){e.Solid="solid",e.VerticalGradient="gradient"}(er||(er={})),function(e){e[e.Year=0]="Year",e[e.Month=1]="Month",e[e.DayOfMonth=2]="DayOfMonth",e[e.Time=3]="Time",e[e.TimeWithSeconds=4]="TimeWithSeconds"}(ei||(ei={}));var KL=(e)=>e.getUTCFullYear();function y_(e,t,a){return t.replace(/yyyy/g,((n)=>sn(KL(n),4))(e)).replace(/yy/g,((n)=>sn(KL(n)%100,2))(e)).replace(/MMMM/g,((n,i)=>new Date(n.getUTCFullYear(),n.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(e,a)).replace(/MMM/g,((n,i)=>new Date(n.getUTCFullYear(),n.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(e,a)).replace(/MM/g,((n)=>sn(((i)=>i.getUTCMonth()+1)(n),2))(e)).replace(/dd/g,((n)=>sn(((i)=>i.getUTCDate())(n),2))(e))}class ix{constructor(e="yyyy-MM-dd",t="default"){this.df=e,this.ff=t}ku(e){return y_(e,this.df,this.ff)}}class yk{constructor(e){this.pf=e||"%h:%m:%s"}ku(e){return this.pf.replace("%h",sn(e.getUTCHours(),2)).replace("%m",sn(e.getUTCMinutes(),2)).replace("%s",sn(e.getUTCSeconds(),2))}}var b_={vf:"yyyy-MM-dd",mf:"%h:%m:%s",wf:" ",Mf:"default"};class bk{constructor(e={}){let t={...b_,...e};this.gf=new ix(t.vf,t.Mf),this.bf=new yk(t.mf),this.Sf=t.wf}ku(e){return`${this.gf.ku(e)}${this.Sf}${this.bf.ku(e)}`}}function ff(e){return 60*e*60*1000}function Ig(e){return 60*e*1000}var df=[{xf:(XL=1,1000*XL),Cf:10},{xf:Ig(1),Cf:20},{xf:Ig(5),Cf:21},{xf:Ig(30),Cf:22},{xf:ff(1),Cf:30},{xf:ff(3),Cf:31},{xf:ff(6),Cf:32},{xf:ff(12),Cf:33}],XL;function WL(e,t){if(e.getUTCFullYear()!==t.getUTCFullYear())return 70;if(e.getUTCMonth()!==t.getUTCMonth())return 60;if(e.getUTCDate()!==t.getUTCDate())return 50;for(let a=df.length-1;a>=0;--a)if(Math.floor(t.getTime()/df[a].xf)!==Math.floor(e.getTime()/df[a].xf))return df[a].Cf;return 0}function Mg(e){let t=e;if(Ro(e)&&(t=rx(e)),!Hg(t))throw Error("time must be of type BusinessDay");let a=new Date(Date.UTC(t.year,t.month-1,t.day,0,0,0,0));return{yf:Math.round(a.getTime()/1000),Pf:t}}function ZL(e){if(!xk(e))throw Error("time must be of type isUTCTimestamp");return{yf:e}}function rx(e){let t=new Date(e);if(isNaN(t.getTime()))throw Error(`Invalid date string=${e}, expected format=yyyy-mm-dd`);return{day:t.getUTCDate(),month:t.getUTCMonth()+1,year:t.getUTCFullYear()}}function JL(e){Ro(e.time)&&(e.time=rx(e.time))}class Vg{options(){return this.yn}setOptions(e){this.yn=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(t){t.forEach(JL)}(e):JL(e)}createConverterToInternalObj(e){return z(function(t){return t.length===0?null:Hg(t[0].time)||Ro(t[0].time)?Mg:ZL}(e))}key(e){return typeof e=="object"&&"yf"in e?e.yf:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){let t=e;return t.Pf===void 0?new Date(1000*t.yf).getTime():new Date(Date.UTC(t.Pf.year,t.Pf.month-1,t.Pf.day)).getTime()}convertHorzItemToInternal(e){return xk(t=e)?ZL(t):Hg(t)?Mg(t):Mg(rx(t));var t}updateFormatter(e){if(!this.yn)return;let t=e.dateFormat;this.yn.timeScale.timeVisible?this.kf=new bk({vf:t,mf:this.yn.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",wf:" ",Mf:e.locale}):this.kf=new ix(t,e.locale)}formatHorzItem(e){let t=e;return this.kf.ku(new Date(1000*t.yf))}formatTickmark(e,t){let a=function(i,r,l){switch(i){case 0:case 10:return r?l?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return r?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(e.weight,this.yn.timeScale.timeVisible,this.yn.timeScale.secondsVisible),n=this.yn.timeScale;if(n.tickMarkFormatter!==void 0){let i=n.tickMarkFormatter(e.originalTime,a,t.locale);if(i!==null)return i}return function(i,r,l){let s={};switch(r){case 0:s.year="numeric";break;case 1:s.month="short";break;case 2:s.day="numeric";break;case 3:s.hour12=!1,s.hour="2-digit",s.minute="2-digit";break;case 4:s.hour12=!1,s.hour="2-digit",s.minute="2-digit",s.second="2-digit"}let o=i.Pf===void 0?new Date(1000*i.yf):new Date(Date.UTC(i.Pf.year,i.Pf.month-1,i.Pf.day));return new Date(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate(),o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()).toLocaleString(l,s)}(e.time,a,t.locale)}maxTickMarkWeight(e){let t=e.reduce(x_,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(a,n=0){if(a.length===0)return;let i=n===0?null:a[n-1].time.yf,r=i!==null?new Date(1000*i):null,l=0;for(let s=n;s<a.length;++s){let o=a[s],u=new Date(1000*o.time.yf);r!==null&&(o.timeWeight=WL(u,r)),l+=o.time.yf-(i||o.time.yf),i=o.time.yf,r=u}if(n===0&&a.length>1){let s=Math.ceil(l/(a.length-1)),o=new Date(1000*(a[0].time.yf-s));a[0].timeWeight=WL(new Date(1000*a[0].time.yf),o)}})(e,t)}static Tf(e){return Ft({localization:{dateFormat:"dd MMM 'yy"}},e??{})}}var Ll=typeof window<"u";function $L(){return!!Ll&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function Tg(){return!!Ll&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function S_(e,t){switch(e){case"custom":return t!==void 0?"custom-object":"series";case"price-line":return"custom-price-line";case"marker":return"series-marker";case"primitive":return"primitive";default:return"series"}}function Gg(e){return e+e%2}function v_(e){Ll&&window.chrome!==void 0&&e.addEventListener("mousedown",(t)=>{if(t.button===1)return t.preventDefault(),!1})}class No{constructor(e,t,a){this.Rf=0,this.Df=null,this.If={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Vf=0,this.Bf=null,this.Ef={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Af=null,this.Lf=!1,this.zf=null,this.Of=null,this.Nf=!1,this.Ff=!1,this.Wf=!1,this.Hf=null,this.Uf=null,this.$f=null,this.jf=null,this.qf=null,this.Yf=null,this.Kf=null,this.Gf=0,this.Zf=!1,this.Xf=!1,this.Jf=!1,this.Qf=0,this.tp=null,this.ip=!Tg(),this.np=(n)=>{this.sp(n)},this.ep=(n)=>{if(this.rp(n)){let i=this.hp(n);if(++this.Vf,this.Bf&&this.Vf>1){let{ap:r}=this.lp(Ma(n),this.Ef);r<30&&!this.Wf&&this.op(i,this.up._p),this.cp()}}else{let i=this.hp(n);if(++this.Rf,this.Df&&this.Rf>1){let{ap:r}=this.lp(Ma(n),this.If);r<5&&!this.Ff&&this.dp(i,this.up.fp),this.pp()}}},this.vp=e,this.up=t,this.yn=a,this.mp()}m(){this.Hf!==null&&(this.Hf(),this.Hf=null),this.Uf!==null&&(this.Uf(),this.Uf=null),this.jf!==null&&(this.jf(),this.jf=null),this.qf!==null&&(this.qf(),this.qf=null),this.Yf!==null&&(this.Yf(),this.Yf=null),this.$f!==null&&(this.$f(),this.$f=null),this.wp(),this.pp()}Mp(e){this.jf&&this.jf();let t=this.gp.bind(this);if(this.jf=()=>{this.vp.removeEventListener("mousemove",t)},this.vp.addEventListener("mousemove",t),this.rp(e))return;let a=this.hp(e);this.dp(a,this.up.bp),this.ip=!0}pp(){this.Df!==null&&clearTimeout(this.Df),this.Rf=0,this.Df=null,this.If={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}cp(){this.Bf!==null&&clearTimeout(this.Bf),this.Vf=0,this.Bf=null,this.Ef={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}gp(e){if(this.Jf||this.Of!==null)return;if(this.rp(e))return;let t=this.hp(e);this.dp(t,this.up.Sp),this.ip=!0}xp(e){let t=Ag(e.changedTouches,z(this.tp));if(t===null)return;if(this.Qf=hf(e),this.Kf!==null)return;if(this.Xf)return;this.Zf=!0;let a=this.lp(Ma(t),z(this.Of)),{Cp:n,yp:i,ap:r}=a;if(this.Nf||!(r<5)){if(!this.Nf){let l=0.5*n,s=i>=l&&!this.yn.Pp(),o=l>i&&!this.yn.kp();s||o||(this.Xf=!0),this.Nf=!0,this.Wf=!0,this.wp(),this.cp()}if(!this.Xf){let l=this.hp(e,t);this.op(l,this.up.Tp),xl(e)}}}Rp(e){if(e.button!==0)return;let t=this.lp(Ma(e),z(this.zf)),{ap:a}=t;if(a>=5&&(this.Ff=!0,this.pp()),this.Ff){let n=this.hp(e);this.dp(n,this.up.Dp)}}lp(e,t){let a=Math.abs(t._t-e._t),n=Math.abs(t.ut-e.ut);return{Cp:a,yp:n,ap:a+n}}Ip(e){let t=Ag(e.changedTouches,z(this.tp));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.tp=null,this.Qf=hf(e),this.wp(),this.Of=null,this.Yf&&(this.Yf(),this.Yf=null);let a=this.hp(e,t);if(this.op(a,this.up.Vp),++this.Vf,this.Bf&&this.Vf>1){let{ap:n}=this.lp(Ma(t),this.Ef);n<30&&!this.Wf&&this.op(a,this.up._p),this.cp()}else this.Wf||(this.op(a,this.up.Bp),this.up.Bp&&xl(e));this.Vf===0&&xl(e),e.touches.length===0&&this.Lf&&(this.Lf=!1,xl(e))}sp(e){if(e.button!==0)return;let t=this.hp(e);if(this.zf=null,this.Jf=!1,this.qf&&(this.qf(),this.qf=null),$L())this.vp.ownerDocument.documentElement.removeEventListener("mouseleave",this.np);if(!this.rp(e))if(this.dp(t,this.up.Ep),++this.Rf,this.Df&&this.Rf>1){let{ap:a}=this.lp(Ma(e),this.If);a<5&&!this.Ff&&this.dp(t,this.up.fp),this.pp()}else this.Ff||this.dp(t,this.up.Ap)}wp(){this.Af!==null&&(clearTimeout(this.Af),this.Af=null)}Lp(e){if(this.tp!==null)return;let t=e.changedTouches[0];this.tp=t.identifier,this.Qf=hf(e);let a=this.vp.ownerDocument.documentElement;this.Wf=!1,this.Nf=!1,this.Xf=!1,this.Of=Ma(t),this.Yf&&(this.Yf(),this.Yf=null);{let i=this.xp.bind(this),r=this.Ip.bind(this);this.Yf=()=>{a.removeEventListener("touchmove",i),a.removeEventListener("touchend",r)},a.addEventListener("touchmove",i,{passive:!1}),a.addEventListener("touchend",r,{passive:!1}),this.wp(),this.Af=setTimeout(this.zp.bind(this,e),240)}let n=this.hp(e,t);this.op(n,this.up.Op),this.Bf||(this.Vf=0,this.Bf=setTimeout(this.cp.bind(this),500),this.Ef=Ma(t))}Np(e){if(e.button!==0)return;let t=this.vp.ownerDocument.documentElement;$L()&&t.addEventListener("mouseleave",this.np),this.Ff=!1,this.zf=Ma(e),this.qf&&(this.qf(),this.qf=null);{let n=this.Rp.bind(this),i=this.sp.bind(this);this.qf=()=>{t.removeEventListener("mousemove",n),t.removeEventListener("mouseup",i)},t.addEventListener("mousemove",n),t.addEventListener("mouseup",i)}if(this.Jf=!0,this.rp(e))return;let a=this.hp(e);this.dp(a,this.up.Fp),this.Df||(this.Rf=0,this.Df=setTimeout(this.pp.bind(this),500),this.If=Ma(e))}mp(){this.vp.addEventListener("mouseenter",this.Mp.bind(this)),this.vp.addEventListener("touchcancel",this.wp.bind(this));{let e=this.vp.ownerDocument,t=(a)=>{this.up.Wp&&(a.composed&&this.vp.contains(a.composedPath()[0])||a.target&&this.vp.contains(a.target)||this.up.Wp())};this.Uf=()=>{e.removeEventListener("touchstart",t)},this.Hf=()=>{e.removeEventListener("mousedown",t)},e.addEventListener("mousedown",t),e.addEventListener("touchstart",t,{passive:!0})}Tg()&&(this.$f=()=>{this.vp.removeEventListener("dblclick",this.ep)},this.vp.addEventListener("dblclick",this.ep)),this.vp.addEventListener("mouseleave",this.Hp.bind(this)),this.vp.addEventListener("touchstart",this.Lp.bind(this),{passive:!0}),v_(this.vp),this.vp.addEventListener("mousedown",this.Np.bind(this)),this.Up(),this.vp.addEventListener("touchmove",()=>{},{passive:!1})}Up(){this.up.$p===void 0&&this.up.jp===void 0&&this.up.qp===void 0||(this.vp.addEventListener("touchstart",(e)=>this.Yp(e.touches),{passive:!0}),this.vp.addEventListener("touchmove",(e)=>{if(e.touches.length===2&&this.Kf!==null&&this.up.jp!==void 0){let t=ew(e.touches[0],e.touches[1])/this.Gf;this.up.jp(this.Kf,t),xl(e)}},{passive:!1}),this.vp.addEventListener("touchend",(e)=>{this.Yp(e.touches)}))}Yp(e){e.length===1&&(this.Zf=!1),e.length!==2||this.Zf||this.Lf?this.Kp():this.Gp(e)}Gp(e){let t=this.vp.getBoundingClientRect()||{left:0,top:0};this.Kf={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.Gf=ew(e[0],e[1]),this.up.$p!==void 0&&this.up.$p(),this.wp()}Kp(){this.Kf!==null&&(this.Kf=null,this.up.qp!==void 0&&this.up.qp())}Hp(e){if(this.jf&&this.jf(),this.rp(e))return;if(!this.ip)return;let t=this.hp(e);this.dp(t,this.up.Zp),this.ip=!Tg()}zp(e){let t=Ag(e.touches,z(this.tp));if(t===null)return;let a=this.hp(e,t);this.op(a,this.up.Xp),this.Wf=!0,this.Lf=!0}rp(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:hf(e)<this.Qf+500}op(e,t){t&&t.call(this.up,e)}dp(e,t){t&&t.call(this.up,e)}hp(e,t){let a=t||e,n=this.vp.getBoundingClientRect()||{left:0,top:0};return{clientX:a.clientX,clientY:a.clientY,pageX:a.pageX,pageY:a.pageY,screenX:a.screenX,screenY:a.screenY,localX:a.clientX-n.left,localY:a.clientY-n.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Jp:!e.type.startsWith("mouse")&&e.type!=="contextmenu"&&e.type!=="click",Qp:e.type,tv:a.target,xu:e.view,iv:()=>{e.type!=="touchstart"&&xl(e)}}}}function ew(e,t){let a=e.clientX-t.clientX,n=e.clientY-t.clientY;return Math.sqrt(a*a+n*n)}function xl(e){e.cancelable&&e.preventDefault()}function Ma(e){return{_t:e.pageX,ut:e.pageY}}function hf(e){return e.timeStamp||performance.now()}function Ag(e,t){for(let a=0;a<e.length;++a)if(e[a].identifier===t)return e[a];return null}class Sk{constructor(e,t,a){this.nv=null,this.sv=null,this.ev=!0,this.rv=null,this.hv=e,this.av=e.lv()[t],this.ov=e.lv()[a],this._v=document.createElement("tr"),this._v.style.height="1px",this.uv=document.createElement("td"),this.uv.style.position="relative",this.uv.style.padding="0",this.uv.style.margin="0",this.uv.setAttribute("colspan","3"),this.cv(),this._v.appendChild(this.uv),this.ev=this.hv.N().layout.panes.enableResize,this.ev?this.dv():(this.nv=null,this.sv=null)}m(){this.sv!==null&&this.sv.m()}fv(){return this._v}pv(){return fe({width:this.av.pv().width,height:1})}vv(){return fe({width:this.av.vv().width,height:1*window.devicePixelRatio})}mv(e,t,a){let n=this.vv();e.fillStyle=this.hv.N().layout.panes.separatorColor,e.fillRect(t,a,n.width,n.height)}Pt(){this.cv(),this.hv.N().layout.panes.enableResize!==this.ev&&(this.ev=this.hv.N().layout.panes.enableResize,this.ev?this.dv():(this.nv!==null&&(this.uv.removeChild(this.nv.wv),this.uv.removeChild(this.nv.Mv),this.nv=null),this.sv!==null&&(this.sv.m(),this.sv=null)))}dv(){let e=document.createElement("div"),t=e.style;t.position="fixed",t.display="none",t.zIndex="49",t.top="0",t.left="0",t.width="100%",t.height="100%",t.cursor="row-resize",this.uv.appendChild(e);let a=document.createElement("div"),n=a.style;n.position="absolute",n.zIndex="50",n.top="-4px",n.height="9px",n.width="100%",n.backgroundColor="",n.cursor="row-resize",this.uv.appendChild(a);let i={bp:this.gv.bind(this),Zp:this.bv.bind(this),Fp:this.Sv.bind(this),Op:this.Sv.bind(this),Dp:this.xv.bind(this),Tp:this.xv.bind(this),Ep:this.Cv.bind(this),Vp:this.Cv.bind(this)};this.sv=new No(a,i,{Pp:()=>!1,kp:()=>!0}),this.nv={Mv:a,wv:e}}cv(){this.uv.style.background=this.hv.N().layout.panes.separatorColor}gv(e){this.nv!==null&&(this.nv.Mv.style.backgroundColor=this.hv.N().layout.panes.separatorHoverColor)}bv(e){this.nv!==null&&this.rv===null&&(this.nv.Mv.style.backgroundColor="")}Sv(e){if(this.nv===null)return;let t=this.av.yv().F_()+this.ov.yv().F_(),a=t/(this.av.pv().height+this.ov.pv().height),n=30*a;t<=2*n||(this.rv={Pv:e.pageY,kv:this.av.yv().F_(),Tv:t-n,Rv:t,Dv:a,Iv:n},this.nv.wv.style.display="block")}xv(e){let t=this.rv;if(t===null)return;let a=(e.pageY-t.Pv)*t.Dv,n=Io(t.kv+a,t.Iv,t.Tv);this.av.yv().W_(n),this.ov.yv().W_(t.Rv-n),this.hv.Qt().ka()}Cv(e){this.rv!==null&&this.nv!==null&&(this.rv=null,this.nv.wv.style.display="none")}}function Eg(e,t){return e.Vv-t.Vv}function Dg(e,t,a){let n=(e.Vv-t.Vv)/(e.wt-t.wt);return Math.sign(n)*Math.min(Math.abs(n),a)}class vk{constructor(e,t,a,n){this.Bv=null,this.Ev=null,this.Av=null,this.Lv=null,this.zv=null,this.Ov=0,this.Nv=0,this.Fv=e,this.Wv=t,this.Hv=a,this.Ps=n}Uv(e,t){if(this.Bv!==null){if(this.Bv.wt===t)return void(this.Bv.Vv=e);if(Math.abs(this.Bv.Vv-e)<this.Ps)return}this.Lv=this.Av,this.Av=this.Ev,this.Ev=this.Bv,this.Bv={wt:t,Vv:e}}me(e,t){if(this.Bv===null||this.Ev===null)return;if(t-this.Bv.wt>50)return;let a=0,n=Dg(this.Bv,this.Ev,this.Wv),i=Eg(this.Bv,this.Ev),r=[n],l=[i];if(a+=i,this.Av!==null){let o=Dg(this.Ev,this.Av,this.Wv);if(Math.sign(o)===Math.sign(n)){let u=Eg(this.Ev,this.Av);if(r.push(o),l.push(u),a+=u,this.Lv!==null){let c=Dg(this.Av,this.Lv,this.Wv);if(Math.sign(c)===Math.sign(n)){let f=Eg(this.Av,this.Lv);r.push(c),l.push(f),a+=f}}}}let s=0;for(let o=0;o<r.length;++o)s+=l[o]/a*r[o];Math.abs(s)<this.Fv||(this.zv={Vv:e,wt:t},this.Nv=s,this.Ov=function(o,u){let c=Math.log(u);return Math.log(1*c/-o)/c}(Math.abs(s),this.Hv))}Gc(e){let t=z(this.zv),a=e-t.wt;return t.Vv+this.Nv*(Math.pow(this.Hv,a)-1)/Math.log(this.Hv)}Kc(e){return this.zv===null||this.$v(e)===this.Ov}$v(e){let t=e-z(this.zv).wt;return Math.min(t,this.Ov)}}class Ck{constructor(e,t){this.jv=void 0,this.qv=void 0,this.Yv=void 0,this.vn=!1,this.Kv=e,this.Gv=t,this.Zv()}Pt(){this.Zv()}Xv(){this.jv&&this.Kv.removeChild(this.jv),this.qv&&this.Kv.removeChild(this.qv),this.jv=void 0,this.qv=void 0}Jv(){return this.vn!==this.Qv()||this.Yv!==this.tm()}tm(){return this.Gv.Qt().Xi().J(this.Gv.N().layout.textColor)>160?"dark":"light"}Qv(){return this.Gv.N().layout.attributionLogo}im(){let e=new URL(location.href);return e.hostname?"&utm_source="+e.hostname+e.pathname:""}Zv(){this.Jv()&&(this.Xv(),this.vn=this.Qv(),this.vn&&(this.Yv=this.tm(),this.qv=document.createElement("style"),this.qv.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.jv=document.createElement("a"),this.jv.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.im()}`,this.jv.title="Charting by TradingView",this.jv.id="tv-attr-logo",this.jv.target="_blank",this.jv.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.jv.toggleAttribute("data-dark",this.Yv==="dark"),this.Kv.appendChild(this.qv),this.Kv.appendChild(this.jv)))}}function tr(e,t){let a=z(e.ownerDocument).createElement("canvas");e.appendChild(a);let n=vg(a,{type:"device-pixel-content-box",options:{allowResizeObserver:!0},transform:(i,r)=>({width:Math.max(i.width,r.width),height:Math.max(i.height,r.height)})});return n.resizeCanvasElement(t),n}function ar(e){e.width=1,e.height=1,e.getContext("2d")?.clearRect(0,0,1,1)}function gf(e,t,a,n){e.qh&&e.qh(t,a,n)}function wo(e,t,a,n){e.st(t,a,n)}function Qg(e,t,a,n){Lk(e(a,n),t,n)}function Lk(e,t,a){for(let n of e){let i=n.Tt(a);i!==null&&t(i)}}function Rg(e,t){return(a)=>{if(!function(n){return n.Ft!==void 0}(a))return[];return(a.Ft()?.pl()??"")!==t?[]:a.Qa?.(e)??[]}}function tw(e,t,a,n){if(!e.length)return;let i=0,r=e[0].$t(n,!0),l=t===1?a/2-(e[0].Hi()-r/2):e[0].Hi()-r/2-a/2;l=Math.max(0,l);for(let s=1;s<e.length;s++){let o=e[s],u=e[s-1],c=u.$t(n,!1),f=o.Hi(),d=u.Hi();if(t===1?f>d-c:f<d+c){let h=d-c*t;o.Ui(h);let g=h-t*c/2;if((t===1?g<0:g>a)&&l>0){let b=t===1?-1-g:g-a,S=Math.min(b,l);for(let p=i;p<e.length;p++)e[p].Ui(e[p].Hi()+t*S);l-=S}}else i=s,l=t===1?d-c-f:f-(d+c)}}class jg{constructor(e,t,a,n){this.Ki=null,this.nm=null,this.sm=!1,this.rm=new Cl(200),this.hm=null,this.am=0,this.lm=!1,this.om=()=>{this.lm||this.yt._m().Qt().mr()},this.um=()=>{this.lm||this.yt._m().Qt().mr()},this.yt=e,this.yn=t,this.Ro=t.layout,this.bd=a,this.dm=n==="left",this.fm=Rg("normal",n),this.pm=Rg("top",n),this.vm=Rg("bottom",n),this.uv=document.createElement("div"),this.uv.style.height="100%",this.uv.style.overflow="hidden",this.uv.style.width="25px",this.uv.style.left="0",this.uv.style.position="relative",this.wm=tr(this.uv,fe({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om);let i=this.wm.canvasElement;i.style.position="absolute",i.style.zIndex="1",i.style.left="0",i.style.top="0",this.Mm=tr(this.uv,fe({width:16,height:16})),this.Mm.subscribeSuggestedBitmapSizeChanged(this.um);let r=this.Mm.canvasElement;r.style.position="absolute",r.style.zIndex="2",r.style.left="0",r.style.top="0";let l={Fp:this.Sv.bind(this),Op:this.Sv.bind(this),Dp:this.xv.bind(this),Tp:this.xv.bind(this),Wp:this.gm.bind(this),Ep:this.Cv.bind(this),Vp:this.Cv.bind(this),fp:this.bm.bind(this),_p:this.bm.bind(this),bp:this.Sm.bind(this),Zp:this.bv.bind(this)};this.sv=new No(this.Mm.canvasElement,l,{Pp:()=>!this.yn.handleScroll.vertTouchDrag,kp:()=>!0})}m(){this.sv.m(),this.Mm.unsubscribeSuggestedBitmapSizeChanged(this.um),ar(this.Mm.canvasElement),this.Mm.dispose(),this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),ar(this.wm.canvasElement),this.wm.dispose(),this.Ki!==null&&this.Ki.__().u(this),this.Ki=null}fv(){return this.uv}P(){return this.Ro.fontSize}xm(){let e=this.bd.N();return this.hm!==e.k&&(this.rm.Os(),this.hm=e.k),e}Cm(){if(this.Ki===null)return 0;let e=0,t=this.xm(),a=z(this.wm.canvasElement.getContext("2d",{colorSpace:this.yt._m().N().layout.colorSpace}));a.save();let n=this.Ki.zl();a.font=this.ym(),n.length>0&&(e=Math.max(this.rm.Ii(a,n[0].eo),this.rm.Ii(a,n[n.length-1].eo)));let i=this.Pm();for(let o=i.length;o--;){let u=this.rm.Ii(a,i[o].ri());u>e&&(e=u)}let r=this.Ki.Lt();if(r!==null&&this.nm!==null&&((l=this.yn.crosshair).mode!==2&&l.horzLine.visible&&l.horzLine.labelVisible)){let o=this.Ki.Tn(1,r),u=this.Ki.Tn(this.nm.height-2,r);e=Math.max(e,this.rm.Ii(a,this.Ki.Ji(Math.floor(Math.min(o,u))+0.11111111111111,r)),this.rm.Ii(a,this.Ki.Ji(Math.ceil(Math.max(o,u))-0.11111111111111,r)))}var l;a.restore();let s=e||34;return Gg(Math.ceil(t.S+t.C+t.V+t.B+5+s))}km(e){this.nm!==null&&Ia(this.nm,e)||(this.nm=e,this.lm=!0,this.wm.resizeCanvasElement(e),this.Mm.resizeCanvasElement(e),this.lm=!1,this.uv.style.width=`${e.width}px`,this.uv.style.height=`${e.height}px`)}Tm(){return z(this.nm).width}un(e){this.Ki!==e&&(this.Ki!==null&&this.Ki.__().u(this),this.Ki=e,e.__().i(this.wo.bind(this),this))}Ft(){return this.Ki}Os(){let e=this.yt.yv();this.yt._m().Qt().au(e,z(this.Ft()))}Rm(e){if(this.nm===null)return;let t={colorSpace:this.yt._m().N().layout.colorSpace};if(e!==1){this.Dm(),this.wm.applySuggestedBitmapSize();let n=rn(this.wm,t);n!==null&&(n.useBitmapCoordinateSpace((i)=>{this.Im(i),this.Vm(i)}),this.yt.Bm(n,this.vm),this.Em(n),this.yt.Bm(n,this.fm),this.Am(n))}this.Mm.applySuggestedBitmapSize();let a=rn(this.Mm,t);a!==null&&(a.useBitmapCoordinateSpace(({context:n,bitmapSize:i})=>{n.clearRect(0,0,i.width,i.height)}),this.Lm(a),this.yt.Bm(a,this.pm))}vv(){return this.wm.bitmapSize}mv(e,t,a,n){let i=this.vv();if(i.width>0&&i.height>0&&(e.drawImage(this.wm.canvasElement,t,a),n)){let r=this.Mm.canvasElement;e.drawImage(r,t,a)}}Pt(){this.Ki?.zl()}Sv(e){if(this.Ki===null||this.Ki.Zi()||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt._m().Qt(),a=this.yt.yv();this.sm=!0,t.Q_(a,this.Ki,e.localY)}xv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt._m().Qt(),a=this.yt.yv(),n=this.Ki;t.tu(a,n,e.localY)}gm(){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt._m().Qt(),t=this.yt.yv(),a=this.Ki;this.sm&&(this.sm=!1,e.iu(t,a))}Cv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt._m().Qt(),a=this.yt.yv();this.sm=!1,t.iu(a,this.Ki)}bm(e){this.yn.handleScale.axisDoubleClickReset.price&&this.Os()}Sm(e){if(this.Ki===null)return;!this.yt._m().Qt().N().handleScale.axisPressedMouseMove.price||this.Ki.je()||this.Ki.No()||this.zm(1)}bv(e){this.zm(0)}Pm(){let e=[],t=this.Ki===null?void 0:this.Ki;return((a)=>{for(let n=0;n<a.length;++n){let i=a[n].qn(this.yt.yv(),t);for(let r=0;r<i.length;r++)e.push(i[r])}})(this.yt.yv().Dt()),e}Im({context:e,bitmapSize:t}){let{width:a,height:n}=t,i=this.yt.yv().Qt(),r=i.$(),l=i.af();r===l?Lf(e,0,0,a,n,r):Dw(e,0,0,a,n,r,l)}Vm({context:e,bitmapSize:t,horizontalPixelRatio:a}){if(this.nm===null||this.Ki===null||!this.Ki.N().borderVisible)return;e.fillStyle=this.Ki.N().borderColor;let n=Math.max(1,Math.floor(this.xm().S*a)),i;i=this.dm?t.width-n:0,e.fillRect(i,0,n,t.height)}Em(e){if(this.nm===null||this.Ki===null)return;let t=this.Ki.zl(),a=this.Ki.N(),n=this.xm(),i=this.dm?this.nm.width-n.C:0;a.borderVisible&&a.ticksVisible&&e.useBitmapCoordinateSpace(({context:r,horizontalPixelRatio:l,verticalPixelRatio:s})=>{r.fillStyle=a.borderColor;let o=Math.max(1,Math.floor(s)),u=Math.floor(0.5*s),c=Math.round(n.C*l);r.beginPath();for(let f of t)r.rect(Math.floor(i*l),Math.round(f.Vl*s)-u,c,o);r.fill()}),e.useMediaCoordinateSpace(({context:r})=>{r.font=this.ym(),r.fillStyle=a.textColor??this.Ro.textColor,r.textAlign=this.dm?"right":"left",r.textBaseline="middle";let l=this.dm?Math.round(i-n.V):Math.round(i+n.C+n.V),s=t.map((o)=>this.rm.Di(r,o.eo));for(let o=t.length;o--;){let u=t[o];r.fillText(u.eo,l,u.Vl+s[o])}})}Dm(){if(this.nm===null||this.Ki===null)return;let e=this.nm.height/2,t=[],a=this.Ki.Dt().slice(),n=this.yt.yv(),i=this.xm();this.Ki===n.Zs()&&this.yt.yv().Dt().forEach((s)=>{n.Gs(s)&&a.push(s)});let r=this.Ki.kl()[0],l=this.Ki;a.forEach((s)=>{let o=s.qn(n,l);o.forEach((u)=>{u.$i()&&u.Wi()===null&&(u.Ui(null),t.push(u))}),r===s&&o.length>0&&(e=o[0].Ei())}),this.Ki.N().alignLabels&&this.Om(t,i,e)}Om(e,t,a){if(this.nm===null)return;let n=e.filter((r)=>r.Ei()<=a),i=e.filter((r)=>r.Ei()>a);n.sort((r,l)=>l.Ei()-r.Ei()),n.length&&i.length&&i.push(n[0]),i.sort((r,l)=>r.Ei()-l.Ei());for(let r of e){let l=Math.floor(r.$t(t)/2),s=r.Ei();s>-l&&s<l&&r.Ui(l),s>this.nm.height-l&&s<this.nm.height+l&&r.Ui(this.nm.height-l)}tw(n,1,this.nm.height,t),tw(i,-1,this.nm.height,t)}Am(e){if(this.nm===null)return;let t=this.Pm(),a=this.xm(),n=this.dm?"right":"left";t.forEach((i)=>{if(i.ji())i.Tt(z(this.Ki)).st(e,a,this.rm,n)})}Lm(e){if(this.nm===null||this.Ki===null)return;let t=this.yt._m().Qt(),a=[],n=this.yt.yv(),i=t.Vd().qn(n,this.Ki);i.length&&a.push(i);let r=this.xm(),l=this.dm?"right":"left";a.forEach((s)=>{s.forEach((o)=>{o.Tt(z(this.Ki)).st(e,r,this.rm,l)})})}zm(e){this.uv.style.cursor=e===1?"ns-resize":"default"}wo(){let e=this.Cm();this.am<e&&this.yt._m().Qt().ka(),this.am=e}ym(){return Do(this.Ro.fontSize,this.Ro.fontFamily)}}function C_(e,t){return e.Xa?.(t)??[]}function Bg(e,t){return e.jn?.(t)??[]}function aw(e,t){return e.cn?.(t)??[]}function L_(e,t){return e.qa?.(t)??[]}class lx{constructor(e,t){this.nm=fe({width:0,height:0}),this.Nm=null,this.Fm=null,this.Wm=null,this.Hm=null,this.Um=!1,this.$m=new Be,this.jm=new Be,this.qm=0,this.Ym=!1,this.Km=null,this.Gm=!1,this.Zm=null,this.Xm=null,this.lm=!1,this.om=()=>{this.lm||this.Jm===null||this.sn().mr()},this.um=()=>{this.lm||this.Jm===null||this.sn().mr()},this.Gv=e,this.Jm=t,this.Jm.mu().i(this.Qm.bind(this),this,!0),this.tw=document.createElement("td"),this.tw.style.padding="0",this.tw.style.position="relative";let a=document.createElement("div");a.style.width="100%",a.style.height="100%",a.style.position="relative",a.style.overflow="hidden",this.iw=document.createElement("td"),this.iw.style.padding="0",this.nw=document.createElement("td"),this.nw.style.padding="0",this.tw.appendChild(a),this.wm=tr(a,fe({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om);let n=this.wm.canvasElement;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.Mm=tr(a,fe({width:16,height:16})),this.Mm.subscribeSuggestedBitmapSizeChanged(this.um);let i=this.Mm.canvasElement;i.style.position="absolute",i.style.zIndex="2",i.style.left="0",i.style.top="0",this._v=document.createElement("tr"),this._v.appendChild(this.iw),this._v.appendChild(this.tw),this._v.appendChild(this.nw),this.sw(),this.sv=new No(this.Mm.canvasElement,this,{Pp:()=>this.Km===null&&!this.Gv.N().handleScroll.vertTouchDrag,kp:()=>this.Km===null&&!this.Gv.N().handleScroll.horzTouchDrag})}m(){this.Nm!==null&&this.Nm.m(),this.Fm!==null&&this.Fm.m(),this.Wm=null,this.Mm.unsubscribeSuggestedBitmapSizeChanged(this.um),ar(this.Mm.canvasElement),this.Mm.dispose(),this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),ar(this.wm.canvasElement),this.wm.dispose(),this.Jm!==null&&(this.Jm.mu().u(this),this.Jm.m()),this.sv.m()}yv(){return z(this.Jm)}ew(e){this.Jm!==null&&this.Jm.mu().u(this),this.Jm=e,this.Jm!==null&&this.Jm.mu().i(lx.prototype.Qm.bind(this),this,!0),this.sw(),this.Gv.lv().indexOf(this)===this.Gv.lv().length-1?(this.Wm=this.Wm??new Ck(this.tw,this.Gv),this.Wm.Pt()):(this.Wm?.Xv(),this.Wm=null)}_m(){return this.Gv}fv(){return this._v}sw(){if(this.Jm!==null&&(this.rw(),this.sn().Jn().length!==0)){if(this.Nm!==null){let e=this.Jm.X_();this.Nm.un(z(e))}if(this.Fm!==null){let e=this.Jm.J_();this.Fm.un(z(e))}}}hw(){this.Nm!==null&&this.Nm.Pt(),this.Fm!==null&&this.Fm.Pt()}F_(){return this.Jm!==null?this.Jm.F_():0}W_(e){this.Jm&&this.Jm.W_(e)}bp(e){if(!this.Jm)return;this.aw();let{localX:t,localY:a}=e;this.lw(t,a,e)}Fp(e){this.aw(),this.ow(),this.lw(e.localX,e.localY,e)}Sp(e){if(!this.Jm)return;this.aw();let{localX:t,localY:a}=e;this.lw(t,a,e)}Ap(e){this.Jm!==null&&(this.aw(),this.lw(e.localX,e.localY,e),this._w(e))}fp(e){this.Jm!==null&&this.uw(this.jm,e)}_p(e){this.fp(e)}Dp(e){this.aw(),this.cw(e),this.lw(e.localX,e.localY,e)}Ep(e){this.Jm!==null&&(this.aw(),this.Ym=!1,this.dw(e))}Bp(e){this.Jm!==null&&this._w(e)}Xp(e){if(this.Ym=!0,this.Km===null){let t={x:e.localX,y:e.localY};this.fw(t,t,e)}}Zp(e){this.Jm!==null&&(this.aw(),this.Jm.Qt().Rd(null),this.pw())}mw(){return this.$m}ww(){return this.jm}$p(){this.qm=1,this.sn().cs()}jp(e,t){if(!this.Gv.N().handleScale.pinch)return;let a=5*(t-this.qm);this.qm=t,this.sn().Wd(e._t,a)}Op(e){this.Ym=!1,this.Gm=this.Km!==null,this.ow();let t=this.sn().Vd();this.Km!==null&&t.It()&&(this.Zm={x:t.ni(),y:t.si()},this.Km={x:e.localX,y:e.localY})}Tp(e){if(this.Jm===null)return;let{localX:t,localY:a}=e;if(this.Km===null)this.cw(e);else{this.Gm=!1;let n=z(this.Zm),i=n.x+(t-this.Km.x),r=n.y+(a-this.Km.y);this.lw(i,r,e)}}Vp(e){this._m().N().trackingMode.exitMode===0&&(this.Gm=!0),this.Mw(),this.dw(e)}Qs(e,t){let a=this.Jm;return a===null?null:fk(a,e,t)}gw(e,t){z(t==="left"?this.Nm:this.Fm).km(fe({width:e,height:this.nm.height}))}pv(){return this.nm}km(e){Ia(this.nm,e)||(this.nm=e,this.lm=!0,this.wm.resizeCanvasElement(e),this.Mm.resizeCanvasElement(e),this.lm=!1,this.tw.style.width=e.width+"px",this.tw.style.height=e.height+"px")}bw(){let e=z(this.Jm);e.G_(e.X_()),e.G_(e.J_());for(let t of e.kl())if(e.Gs(t)){let a=t.Ft();a!==null&&e.G_(a),t.Nn()}for(let t of e.Mu())t.Nn()}vv(){return this.wm.bitmapSize}mv(e,t,a,n){let i=this.vv();if(i.width>0&&i.height>0&&(e.drawImage(this.wm.canvasElement,t,a),n)){let r=this.Mm.canvasElement;e!==null&&e.drawImage(r,t,a)}}Rm(e){if(e===0)return;if(this.Jm===null)return;e>1&&this.bw(),this.Nm!==null&&this.Nm.Rm(e),this.Fm!==null&&this.Fm.Rm(e);let t={colorSpace:this.Gv.N().layout.colorSpace};if(e!==1){this.wm.applySuggestedBitmapSize();let n=rn(this.wm,t);n!==null&&(n.useBitmapCoordinateSpace((i)=>{this.Im(i)}),this.Jm&&(this.Sw(n,C_),this.xw(n),this.Sw(n,Bg),this.Sw(n,aw)))}this.Mm.applySuggestedBitmapSize();let a=rn(this.Mm,t);a!==null&&(a.useBitmapCoordinateSpace(({context:n,bitmapSize:i})=>{n.clearRect(0,0,i.width,i.height)}),this.Cw(a),this.Sw(a,L_),this.Sw(a,aw))}yw(){return this.Nm}Pw(){return this.Fm}Bm(e,t){this.Sw(e,t)}Qm(){this.Jm!==null&&this.Jm.mu().u(this),this.Jm=null}_w(e){this.uw(this.$m,e)}uw(e,t){let{localX:a,localY:n}=t;e.v()&&e.p(this.sn().Et().Vc(a),{x:a,y:n},t)}Im({context:e,bitmapSize:t}){let{width:a,height:n}=t,i=this.sn(),r=i.$(),l=i.af();r===l?Lf(e,0,0,a,n,l):Dw(e,0,0,a,n,r,l)}xw(e){let t=z(this.Jm),a=t.wu().wr().Tt(t);a!==null&&a.st(e,!1)}Cw(e){this.kw(e,Bg,wo,this.sn().Vd())}Sw(e,t){let a=z(this.Jm),n=t===Bg?this.Tw():null,i=n===null?null:this.Rw(n,a),r=a.Mu();if(i===null||n===null){let o=a._u();return this.Dw(e,t,gf,r,o),void this.Dw(e,t,wo,r,o)}let l=a.Dt(),s=(o)=>o===n?i.Za:void 0;this.Dw(e,t,gf,r,l,s),this.Dw(e,t,wo,r,l,s),this.kw(e,t,gf,n,i.qa),this.kw(e,t,wo,n,i.qa)}Dw(e,t,a,n,i,r){for(let l of n)this.kw(e,t,a,l);if(r!==void 0)for(let l of i)this.kw(e,t,a,l,r(l));else for(let l of i)this.kw(e,t,a,l)}Tw(){let e=z(this.Jm),t=e.Qt().cu()?.uu;if(!e.Qt().N().hoveredSeriesOnTop||t===void 0)return null;for(let a of e.Dt())if(a===t)return a;return null}Rw(e,t){let a=e.Ga?.(t)??null;return a===null||a.qa.length===0?null:a}kw(e,t,a,n,i){let r=z(this.Jm),l=r.Qt().cu(),s=l!==null&&l.uu===n,o=l!==null&&s&&l.bu!==void 0?l.bu.ie:void 0,u=(c)=>a(c,e,s,o);i===void 0?Qg(t,u,n,r):Lk(i,u,r)}rw(){if(this.Jm===null)return;let e=this.Gv,t=this.Jm.X_().N().visible,a=this.Jm.J_().N().visible;t||this.Nm===null||(this.iw.removeChild(this.Nm.fv()),this.Nm.m(),this.Nm=null),a||this.Fm===null||(this.nw.removeChild(this.Fm.fv()),this.Fm.m(),this.Fm=null);let n=e.Qt().Jd();t&&this.Nm===null&&(this.Nm=new jg(this,e.N(),n,"left"),this.iw.appendChild(this.Nm.fv())),a&&this.Fm===null&&(this.Fm=new jg(this,e.N(),n,"right"),this.nw.appendChild(this.Fm.fv()))}Iw(e){return e.Jp&&this.Ym||this.Km!==null}lw(e,t,a){e=Math.max(0,Math.min(e,this.nm.width-1)),t=Math.max(0,Math.min(t,this.nm.height-1)),this.sn().Kd(e,t,a,z(this.Jm))}pw(){this.sn().Zd()}Mw(){this.Gm&&(this.Km=null,this.pw())}fw(e,t,a){this.Km=e,this.Gm=!1,this.lw(t.x,t.y,a);let n=this.sn().Vd();this.Zm={x:n.ni(),y:n.si()}}sn(){return this.Gv.Qt()}dw(e){if(!this.Um)return;let t=this.sn(),a=this.yv();if(t.eu(a,a.kn()),this.Hm=null,this.Um=!1,t.jd(),this.Xm!==null){let n=performance.now(),i=t.Et();this.Xm.me(i.Oc(),n),this.Xm.Kc(n)||t.ps(this.Xm)}}aw(){this.Km=null}ow(){if(!this.Jm)return;if(this.sn().cs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)z(document.activeElement).blur();else{let e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Jm.kn().Zi()&&this.sn().Et().Zi()}cw(e){if(this.Jm===null)return;let t=this.sn(),a=t.Et();if(a.Zi())return;let n=this.Gv.N(),i=n.handleScroll,r=n.kineticScroll;if((!i.pressedMouseMove||e.Jp)&&(!i.horzTouchDrag&&!i.vertTouchDrag||!e.Jp))return;let l=this.Jm.kn(),s=performance.now();if(this.Hm!==null||this.Iw(e)||(this.Hm={x:e.clientX,y:e.clientY,yf:s,Vw:e.localX,Bw:e.localY}),this.Hm!==null&&!this.Um&&(this.Hm.x!==e.clientX||this.Hm.y!==e.clientY)){if(e.Jp&&r.touch||!e.Jp&&r.mouse){let o=a.ml();this.Xm=new vk(0.2/o,7/o,0.997,15/o),this.Xm.Uv(a.Oc(),this.Hm.yf)}else this.Xm=null;l.Zi()||t.nu(this.Jm,l,e.localY),t.Ud(e.localX),this.Um=!0}this.Um&&(l.Zi()||t.su(this.Jm,l,e.localY),t.$d(e.localX),this.Xm!==null&&this.Xm.Uv(a.Oc(),s))}}class Yg{constructor(e,t,a,n,i){this.xt=!0,this.nm=fe({width:0,height:0}),this.om=()=>this.Rm(3),this.dm=e==="left",this.bd=a.Jd,this.yn=t,this.Ew=n,this.Aw=i,this.uv=document.createElement("div"),this.uv.style.width="25px",this.uv.style.height="100%",this.uv.style.overflow="hidden",this.wm=tr(this.uv,fe({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om)}m(){this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),ar(this.wm.canvasElement),this.wm.dispose()}fv(){return this.uv}pv(){return this.nm}km(e){Ia(this.nm,e)||(this.nm=e,this.wm.resizeCanvasElement(e),this.uv.style.width=`${e.width}px`,this.uv.style.height=`${e.height}px`,this.xt=!0)}Rm(e){if(e<3&&!this.xt)return;if(this.nm.width===0||this.nm.height===0)return;this.xt=!1,this.wm.applySuggestedBitmapSize();let t=rn(this.wm,{colorSpace:this.yn.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace((a)=>{this.Im(a),this.Vm(a)})}vv(){return this.wm.bitmapSize}mv(e,t,a){let n=this.vv();n.width>0&&n.height>0&&e.drawImage(this.wm.canvasElement,t,a)}Vm({context:e,bitmapSize:t,horizontalPixelRatio:a,verticalPixelRatio:n}){if(!this.Ew())return;e.fillStyle=this.yn.timeScale.borderColor;let i=Math.floor(this.bd.N().S*a),r=Math.floor(this.bd.N().S*n),l=this.dm?t.width-i:0;e.fillRect(l,0,i,r)}Im({context:e,bitmapSize:t}){Lf(e,0,0,t.width,t.height,this.Aw())}}function sx(e){return(t)=>t.tl?.(e)??[]}var w_=sx("normal"),k_=sx("top"),I_=sx("bottom");class wk{constructor(e,t){this.Lw=null,this.zw=null,this.M=null,this.Ow=!1,this.nm=fe({width:0,height:0}),this.Nw=new Be,this.rm=new Cl(5),this.lm=!1,this.om=()=>{this.lm||this.Gv.Qt().mr()},this.um=()=>{this.lm||this.Gv.Qt().mr()},this.Gv=e,this.Pu=t,this.yn=e.N().layout,this.jv=document.createElement("tr"),this.Fw=document.createElement("td"),this.Fw.style.padding="0",this.Ww=document.createElement("td"),this.Ww.style.padding="0",this.uv=document.createElement("td"),this.uv.style.height="25px",this.uv.style.padding="0",this.Hw=document.createElement("div"),this.Hw.style.width="100%",this.Hw.style.height="100%",this.Hw.style.position="relative",this.Hw.style.overflow="hidden",this.uv.appendChild(this.Hw),this.wm=tr(this.Hw,fe({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om);let a=this.wm.canvasElement;a.style.position="absolute",a.style.zIndex="1",a.style.left="0",a.style.top="0",this.Mm=tr(this.Hw,fe({width:16,height:16})),this.Mm.subscribeSuggestedBitmapSizeChanged(this.um);let n=this.Mm.canvasElement;n.style.position="absolute",n.style.zIndex="2",n.style.left="0",n.style.top="0",this.jv.appendChild(this.Fw),this.jv.appendChild(this.uv),this.jv.appendChild(this.Ww),this.Uw(),this.Gv.Qt().N_().i(this.Uw.bind(this),this),this.sv=new No(this.Mm.canvasElement,this,{Pp:()=>!0,kp:()=>!this.Gv.N().handleScroll.horzTouchDrag})}m(){this.sv.m(),this.Lw!==null&&this.Lw.m(),this.zw!==null&&this.zw.m(),this.Mm.unsubscribeSuggestedBitmapSizeChanged(this.um),ar(this.Mm.canvasElement),this.Mm.dispose(),this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),ar(this.wm.canvasElement),this.wm.dispose()}fv(){return this.jv}$w(){return this.Lw}jw(){return this.zw}Fp(e){if(this.Ow)return;this.Ow=!0;let t=this.Gv.Qt();!t.Et().Zi()&&this.Gv.N().handleScale.axisPressedMouseMove.time&&t.Fd(e.localX)}Op(e){this.Fp(e)}Wp(){let e=this.Gv.Qt();!e.Et().Zi()&&this.Ow&&(this.Ow=!1,this.Gv.N().handleScale.axisPressedMouseMove.time&&e.Yd())}Dp(e){let t=this.Gv.Qt();!t.Et().Zi()&&this.Gv.N().handleScale.axisPressedMouseMove.time&&t.qd(e.localX)}Tp(e){this.Dp(e)}Ep(){this.Ow=!1;let e=this.Gv.Qt();e.Et().Zi()&&!this.Gv.N().handleScale.axisPressedMouseMove.time||e.Yd()}Vp(){this.Ep()}fp(){this.Gv.N().handleScale.axisDoubleClickReset.time&&this.Gv.Qt().ws()}_p(){this.fp()}bp(){this.Gv.Qt().N().handleScale.axisPressedMouseMove.time&&this.zm(1)}Zp(){this.zm(0)}pv(){return this.nm}qw(){return this.Nw}Yw(e,t,a){Ia(this.nm,e)||(this.nm=e,this.lm=!0,this.wm.resizeCanvasElement(e),this.Mm.resizeCanvasElement(e),this.lm=!1,this.uv.style.width=`${e.width}px`,this.uv.style.height=`${e.height}px`,this.Nw.p(e)),this.Lw!==null&&this.Lw.km(fe({width:t,height:e.height})),this.zw!==null&&this.zw.km(fe({width:a,height:e.height}))}Kw(){let e=this.Gw();return Math.ceil(e.S+e.C+e.P+e.A+e.I+e.Zw)}Pt(){this.Gv.Qt().Et().zl()}vv(){return this.wm.bitmapSize}mv(e,t,a,n){let i=this.vv();if(i.width>0&&i.height>0&&(e.drawImage(this.wm.canvasElement,t,a),n)){let r=this.Mm.canvasElement;e.drawImage(r,t,a)}}Rm(e){if(e===0)return;let t={colorSpace:this.yn.colorSpace};if(e!==1){this.wm.applySuggestedBitmapSize();let n=rn(this.wm,t);n!==null&&(n.useBitmapCoordinateSpace((i)=>{this.Im(i),this.Vm(i),this.Xw(n,I_)}),this.Em(n),this.Xw(n,w_)),this.Lw!==null&&this.Lw.Rm(e),this.zw!==null&&this.zw.Rm(e)}this.Mm.applySuggestedBitmapSize();let a=rn(this.Mm,t);a!==null&&(a.useBitmapCoordinateSpace(({context:n,bitmapSize:i})=>{n.clearRect(0,0,i.width,i.height)}),this.Jw([...this.Gv.Qt().Jn(),this.Gv.Qt().Vd()],a),this.Xw(a,k_))}Xw(e,t){let a=this.Gv.Qt().Jn();for(let n of a)Qg(t,(i)=>gf(i,e,!1,void 0),n,void 0);for(let n of a)Qg(t,(i)=>wo(i,e,!1,void 0),n,void 0)}Im({context:e,bitmapSize:t}){Lf(e,0,0,t.width,t.height,this.Gv.Qt().af())}Vm({context:e,bitmapSize:t,verticalPixelRatio:a}){if(this.Gv.N().timeScale.borderVisible){e.fillStyle=this.Qw();let n=Math.max(1,Math.floor(this.Gw().S*a));e.fillRect(0,0,t.width,n)}}Em(e){let t=this.Gv.Qt().Et(),a=t.zl();if(!a||a.length===0)return;let n=this.Pu.maxTickMarkWeight(a),i=this.Gw(),r=t.N();r.borderVisible&&r.ticksVisible&&e.useBitmapCoordinateSpace(({context:l,horizontalPixelRatio:s,verticalPixelRatio:o})=>{l.strokeStyle=this.Qw(),l.fillStyle=this.Qw();let u=Math.max(1,Math.floor(s)),c=Math.floor(0.5*s);l.beginPath();let f=Math.round(i.C*o);for(let d=a.length;d--;){let h=Math.round(a[d].coord*s);l.rect(h-c,0,u,f)}l.fill()}),e.useMediaCoordinateSpace(({context:l})=>{let s=i.S+i.C+i.A+i.P/2;l.textAlign="center",l.textBaseline="middle",l.fillStyle=this.H(),l.font=this.ym();for(let o of a)if(o.weight<n){let u=o.needAlignCoordinate?this.tM(l,o.coord,o.label):o.coord;l.fillText(o.label,u,s)}this.Gv.N().timeScale.allowBoldLabels&&(l.font=this.iM());for(let o of a)if(o.weight>=n){let u=o.needAlignCoordinate?this.tM(l,o.coord,o.label):o.coord;l.fillText(o.label,u,s)}})}tM(e,t,a){let n=this.rm.Ii(e,a),i=n/2,r=Math.floor(t-i)+0.5;return r<0?t+=Math.abs(0-r):r+n>this.nm.width&&(t-=Math.abs(this.nm.width-(r+n))),t}Jw(e,t){let a=this.Gw();for(let n of e)for(let i of n.dn())i.Tt().st(t,a)}Qw(){return this.Gv.N().timeScale.borderColor}H(){return this.yn.textColor}F(){return this.yn.fontSize}ym(){return Do(this.F(),this.yn.fontFamily)}iM(){return Do(this.F(),this.yn.fontFamily,"bold")}Gw(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,I:NaN,tn:NaN,C:5,P:NaN,k:"",Qi:new Cl,Zw:0});let e=this.M,t=this.ym();if(e.k!==t){let a=this.F();e.P=a,e.k=t,e.A=3*a/12,e.I=3*a/12,e.tn=9*a/12,e.L=0,e.Zw=4*a/12,e.Qi.Os()}return this.M}zm(e){this.uv.style.cursor=e===1?"ew-resize":"default"}Uw(){let e=this.Gv.Qt(),t=e.N();t.leftPriceScale.visible||this.Lw===null||(this.Fw.removeChild(this.Lw.fv()),this.Lw.m(),this.Lw=null),t.rightPriceScale.visible||this.zw===null||(this.Ww.removeChild(this.zw.fv()),this.zw.m(),this.zw=null);let a={Jd:this.Gv.Qt().Jd()},n=()=>t.leftPriceScale.borderVisible&&e.Et().N().borderVisible,i=()=>e.af();t.leftPriceScale.visible&&this.Lw===null&&(this.Lw=new Yg("left",t,a,n,i),this.Fw.appendChild(this.Lw.fv())),t.rightPriceScale.visible&&this.zw===null&&(this.zw=new Yg("right",t,a,n,i),this.Ww.appendChild(this.zw.fv()))}}var M_=!!Ll&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((e)=>e.brand.includes("Chromium"))&&!!Ll&&(navigator?.userAgentData?.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);class kk{constructor(e,t,a){var n;this.nM=[],this.sM=[],this.eM=0,this.oo=0,this.k_=0,this.rM=0,this.hM=0,this.aM=null,this.lM=!1,this.$m=new Be,this.jm=new Be,this.wd=new Be,this.oM=null,this._M=null,this.Kv=e,this.yn=t,this.Pu=a,this.jv=document.createElement("div"),this.jv.classList.add("tv-lightweight-charts"),this.jv.style.overflow="hidden",this.jv.style.direction="ltr",this.jv.style.width="100%",this.jv.style.height="100%",(n=this.jv).style.userSelect="none",n.style.webkitUserSelect="none",n.style.msUserSelect="none",n.style.MozUserSelect="none",n.style.webkitTapHighlightColor="transparent",this.uM=document.createElement("table"),this.uM.setAttribute("cellspacing","0"),this.jv.appendChild(this.uM),this.cM=this.dM.bind(this),zg(this.yn)&&this.fM(!0),this.sn=new pk(this.gd.bind(this),this.yn,a),this.Qt().Bd().i(this.pM.bind(this),this),this.vM=new wk(this,this.Pu),this.uM.appendChild(this.vM.fv());let i=t.autoSize&&this.mM(),r=this.yn.width,l=this.yn.height;if(i||r===0||l===0){let s=e.getBoundingClientRect();r=r||s.width,l=l||s.height}this.wM(r,l),this.MM(),e.appendChild(this.jv),this.gM(),this.sn.Et().Jc().i(this.sn.ka.bind(this.sn),this),this.sn.N_().i(this.sn.ka.bind(this.sn),this)}Qt(){return this.sn}N(){return this.yn}lv(){return this.nM}bM(){return this.vM}m(){this.fM(!1),this.eM!==0&&window.cancelAnimationFrame(this.eM),this.sn.Bd().u(this),this.sn.Et().Jc().u(this),this.sn.N_().u(this),this.sn.m();for(let e of this.nM)this.uM.removeChild(e.fv()),e.mw().u(this),e.ww().u(this),e.m();this.nM=[];for(let e of this.sM)this.SM(e);this.sM=[],z(this.vM).m(),this.jv.parentElement!==null&&this.jv.parentElement.removeChild(this.jv),this.wd.m(),this.$m.m(),this.jm.m(),this.xM()}wM(e,t,a=!1){if(this.oo===t&&this.k_===e)return;let n=function(l){let s=Math.floor(l.width),o=Math.floor(l.height);return fe({width:s-s%2,height:o-o%2})}(fe({width:e,height:t}));this.oo=n.height,this.k_=n.width;let i=this.oo+"px",r=this.k_+"px";if(this.CM()||(z(this.jv).style.height=i,z(this.jv).style.width=r),this.uM.style.height=i,this.uM.style.width=r,a){this.eM!==0&&(window.cancelAnimationFrame(this.eM),this.eM=0),this.lM=!1;let l=rt.ys();this.aM!==null&&(l.Ss(this.aM),this.aM=null),this.yM(l,performance.now())}else this.sn.ka()}Rm(e){e===void 0&&(e=rt.ys());for(let t=0;t<this.nM.length;t++)this.nM[t].Rm(e._s(t).rs);this.yn.timeScale.visible&&this.vM.Rm(e.ls())}vr(e){let t=zg(this.yn);this.sn.vr(e);let a=zg(this.yn);a!==t&&this.fM(a),e.layout?.panes&&this.PM(),this.gM(),this.kM(e)}mw(){return this.$m}ww(){return this.jm}Bd(){return this.wd}TM(e=!1){this.aM!==null&&(this.yM(this.aM,performance.now()),this.aM=null);let t=this.RM(null),a=document.createElement("canvas");a.width=t.width,a.height=t.height;let n=z(a.getContext("2d"));return this.RM(n,e),a}DM(e){if(e==="left"&&!this.IM())return 0;if(e==="right"&&!this.VM())return 0;if(this.nM.length===0)return 0;return z(e==="left"?this.nM[0].yw():this.nM[0].Pw()).Tm()}CM(){return this.yn.autoSize&&this.oM!==null}Mv(){return this.jv}BM(e){this._M=e,this._M?this.Mv().style.setProperty("cursor",e):this.Mv().style.removeProperty("cursor")}EM(){return this._M}AM(e){return Mt(this.nM[e]).pv()}PM(){this.sM.forEach((e)=>{e.Pt()})}kM(e){(e.autoSize!==void 0||!this.oM||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.oM&&this.mM(),e.autoSize===!1&&this.oM!==null&&this.xM(),e.autoSize||e.width===void 0&&e.height===void 0||this.wM(e.width||this.k_,e.height||this.oo))}RM(e,t){let a=0,n=0,i=this.nM[0],r=(s,o)=>{let u=0;for(let c=0;c<this.nM.length;c++){let f=this.nM[c],d=z(s==="left"?f.yw():f.Pw()),h=d.vv();if(e!==null&&d.mv(e,o,u,t),u+=h.height,c<this.nM.length-1){let g=this.sM[c],b=g.vv();e!==null&&g.mv(e,o,u),u+=b.height}}};if(this.IM())r("left",0),a+=z(i.yw()).vv().width;for(let s=0;s<this.nM.length;s++){let o=this.nM[s],u=o.vv();if(e!==null&&o.mv(e,a,n,t),n+=u.height,s<this.nM.length-1){let c=this.sM[s],f=c.vv();e!==null&&c.mv(e,a,n),n+=f.height}}if(a+=i.vv().width,this.VM())r("right",a),a+=z(i.Pw()).vv().width;let l=(s,o,u)=>{z(s==="left"?this.vM.$w():this.vM.jw()).mv(z(e),o,u)};if(this.yn.timeScale.visible){let s=this.vM.vv();if(e!==null){let o=0;this.IM()&&(l("left",o,n),o=z(i.yw()).vv().width),this.vM.mv(e,o,n,t),o+=s.width,this.VM()&&l("right",o,n)}n+=s.height}return fe({width:a,height:n})}LM(){let e=0,t=0,a=0;for(let b of this.nM)this.IM()&&(t=Math.max(t,z(b.yw()).Cm(),this.yn.leftPriceScale.minimumWidth)),this.VM()&&(a=Math.max(a,z(b.Pw()).Cm(),this.yn.rightPriceScale.minimumWidth)),e+=b.F_();t=Gg(t),a=Gg(a);let n=this.k_,i=this.oo,r=Math.max(n-t-a,0),l=1*this.sM.length,s=this.yn.timeScale.visible,o=s?Math.max(this.vM.Kw(),this.yn.timeScale.minimumHeight):0;var u;o=(u=o)+u%2;let c=l+o,f=i<c?0:i-c,d=f/e,h=0,g=window.devicePixelRatio||1;for(let b=0;b<this.nM.length;++b){let S=this.nM[b];S.ew(this.sn.Gn()[b]);let p=0,x=0;x=b===this.nM.length-1?Math.ceil((f-h)*g)/g:Math.round(S.F_()*d*g)/g,p=Math.max(x,2),h+=p,S.km(fe({width:r,height:p})),this.IM()&&S.gw(t,"left"),this.VM()&&S.gw(a,"right"),S.yv()&&this.sn.Ed(S.yv(),p)}this.vM.Yw(fe({width:s?r:0,height:o}),s?t:0,s?a:0),this.sn.H_(r),this.rM!==t&&(this.rM=t),this.hM!==a&&(this.hM=a)}fM(e){e?this.jv.addEventListener("wheel",this.cM,{passive:!1}):this.jv.removeEventListener("wheel",this.cM)}zM(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return M_?1/window.devicePixelRatio:1}dM(e){if(!(e.deltaX!==0&&this.yn.handleScroll.mouseWheel||e.deltaY!==0&&this.yn.handleScale.mouseWheel))return;let t=this.zM(e),a=t*e.deltaX/100,n=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),n!==0&&this.yn.handleScale.mouseWheel){let i=Math.sign(n)*Math.min(1,Math.abs(n)),r=e.clientX-this.jv.getBoundingClientRect().left;this.Qt().Wd(r,i)}a!==0&&this.yn.handleScroll.mouseWheel&&this.Qt().Hd(-80*a)}yM(e,t){let a=e.ls();a===3&&this.OM(),a!==3&&a!==2||(this.NM(e),this.FM(e,t),this.vM.Pt(),this.nM.forEach((n)=>{n.hw()}),this.aM?.ls()===3&&(this.aM.Ss(e),this.OM(),this.NM(this.aM),this.FM(this.aM,t),e=this.aM,this.aM=null)),this.Rm(e)}FM(e,t){for(let a of e.bs())this.xs(a,t)}NM(e){let t=this.sn.Gn();for(let a=0;a<t.length;a++)e._s(a).hs&&t[a].lu()}xs(e,t){let a=this.sn.Et();switch(e.ds){case 0:a.td();break;case 1:a.nd(e.Wt);break;case 2:a.Ms(e.Wt);break;case 3:a.gs(e.Wt);break;case 4:a.Wc();break;case 5:e.Wt.Kc(t)||a.gs(e.Wt.Gc(t))}}gd(e){this.aM!==null?this.aM.Ss(e):this.aM=e,this.lM||(this.lM=!0,this.eM=window.requestAnimationFrame((t)=>{if(this.lM=!1,this.eM=0,this.aM!==null){let a=this.aM;this.aM=null,this.yM(a,t);for(let n of a.bs())if(n.ds===5&&!n.Wt.Kc(t)){this.Qt().ps(n.Wt);break}}}))}OM(){this.MM()}SM(e){this.uM.removeChild(e.fv()),e.m()}MM(){let e=this.sn.Gn(),t=e.length,a=this.nM.length;for(let n=t;n<a;n++){let i=Mt(this.nM.pop());this.uM.removeChild(i.fv()),i.mw().u(this),i.ww().u(this),i.m();let r=this.sM.pop();r!==void 0&&this.SM(r)}for(let n=a;n<t;n++){let i=new lx(this,e[n]);if(i.mw().i(this.WM.bind(this,i),this),i.ww().i(this.HM.bind(this,i),this),this.nM.push(i),n>0){let r=new Sk(this,n-1,n);this.sM.push(r),this.uM.insertBefore(r.fv(),this.vM.fv())}this.uM.insertBefore(i.fv(),this.vM.fv())}for(let n=0;n<t;n++){let i=e[n],r=this.nM[n];r.yv()!==i?r.ew(i):r.sw()}this.gM(),this.LM()}UM(e,t,a,n){let i=new Map;if(e!==null)this.sn.Jn().forEach((u)=>{let c=u.Un().Hn(e);c!==null&&i.set(u,c)});let r;if(e!==null){let u=this.sn.Et().en(e)?.originalTime;u!==void 0&&(r=u)}let l=this.Qt().cu(),s=this.$M(n),o=function(u,c){let f=u!==null&&u.uu instanceof _o?u.uu:void 0,d=u?.bu?.te,h=c!==void 0&&c!==-1?c:void 0;return u===null||u.ee===void 0?{jM:f,qM:d}:{jM:f,qM:d,YM:{ds:u.ee,KM:(g=u.uu,b=u.ee,g instanceof Cf?"pane-primitive":b==="marker"||b==="primitive"?"series-primitive":"series"),GM:S_(u.ee,d),Y_:f,ZM:d,XM:h}};var g,b}(l,s);return{Qr:r,$n:e??void 0,JM:t??void 0,XM:s!==-1?s:void 0,jM:o.jM,QM:i,qM:o.qM,YM:o.YM,tg:a??void 0}}$M(e){let t=-1;if(e)t=this.nM.indexOf(e);else{let a=this.Qt().Vd().Kn();a!==null&&(t=this.Qt().Gn().indexOf(a))}return t}WM(e,t,a,n){this.$m.p(()=>this.UM(t,a,n,e))}HM(e,t,a,n){this.jm.p(()=>this.UM(t,a,n,e))}pM(e,t,a){this.BM(this.Qt().cu()?.gu??null),this.wd.p(()=>this.UM(e,t,a))}gM(){let e=this.yn.timeScale.visible?"":"none";this.vM.fv().style.display=e}IM(){return this.nM[0].yv().X_().N().visible}VM(){return this.nM[0].yv().J_().N().visible}mM(){return"ResizeObserver"in window&&(this.oM=new ResizeObserver((e)=>{let t=e[e.length-1];if(!t)return;let a=t.contentRect.width,n=t.contentRect.height;this.wM(a,n,!0)}),this.oM.observe(this.Kv,{box:"border-box"}),!0)}xM(){this.oM!==null&&this.oM.disconnect(),this.oM=null}}function zg(e){return Boolean(e.handleScroll.mouseWheel||e.handleScale.mouseWheel)}function T_(e){return e.open===void 0&&e.value===void 0}function A_(e){return function(t){return t.open!==void 0}(e)||function(t){return t.value!==void 0}(e)}function nw(e,t,a,n){let i=a.value,r={$n:t,wt:e,Wt:[i,i,i,i],Qr:n};return a.color!==void 0&&(r.R=a.color),r}function E_(e,t,a,n){let i=a.value,r={$n:t,wt:e,Wt:[i,i,i,i],Qr:n};return a.lineColor!==void 0&&(r.vt=a.lineColor),a.topColor!==void 0&&(r.ah=a.topColor),a.bottomColor!==void 0&&(r.oh=a.bottomColor),r}function D_(e,t,a,n){let i=a.value,r={$n:t,wt:e,Wt:[i,i,i,i],Qr:n};return a.topLineColor!==void 0&&(r._h=a.topLineColor),a.bottomLineColor!==void 0&&(r.uh=a.bottomLineColor),a.topFillColor1!==void 0&&(r.dh=a.topFillColor1),a.topFillColor2!==void 0&&(r.fh=a.topFillColor2),a.bottomFillColor1!==void 0&&(r.ph=a.bottomFillColor1),a.bottomFillColor2!==void 0&&(r.mh=a.bottomFillColor2),r}function R_(e,t,a,n){let i={$n:t,wt:e,Wt:[a.open,a.high,a.low,a.close],Qr:n};return a.color!==void 0&&(i.R=a.color),i}function B_(e,t,a,n){let i={$n:t,wt:e,Wt:[a.open,a.high,a.low,a.close],Qr:n};return a.color!==void 0&&(i.R=a.color),a.borderColor!==void 0&&(i.Ht=a.borderColor),a.wickColor!==void 0&&(i.hh=a.wickColor),i}function z_(e,t,a,n,i){let r=Mt(i)(a),l=Math.max(...r),s=Math.min(...r),o=r[r.length-1],u=[o,l,s,o],{time:c,color:f,...d}=a;return{$n:t,wt:e,Wt:u,Qr:n,ue:d,R:f}}function yl(e){return e.Wt!==void 0}function iw(e,t){return t.customValues!==void 0&&(e.ig=t.customValues),e}function Ki(e){return(t,a,n,i,r,l)=>function(s,o){return o?o(s):T_(s)}(n,l)?iw({wt:t,$n:a,Qr:i},n):iw(e(t,a,n,i,r),n)}function rw(e){return{Candlestick:Ki(B_),Bar:Ki(R_),Area:Ki(E_),Baseline:Ki(D_),Histogram:Ki(nw),Line:Ki(nw),Custom:Ki(z_)}[e]}function lw(e){return{$n:0,ng:new Map,Oa:e}}function sw(e,t){if(e!==void 0&&e.length!==0)return{sg:t.key(e[0].wt),eg:t.key(e[e.length-1].wt)}}function ow(e){let t;return e.forEach((a)=>{t===void 0&&(t=a.Qr)}),Mt(t)}class Ik{constructor(e){this.rg=new Map,this.hg=new Map,this.ag=new Map,this.lg=[],this.Pu=e}m(){this.rg.clear(),this.hg.clear(),this.ag.clear(),this.lg=[]}og(e,t){let a=this.rg.size!==0,n=!1,i=this.hg.get(e);if(i!==void 0)if(this.hg.size===1)a=!1,n=!0,this.rg.clear();else for(let s of this.lg)s.pointData.ng.delete(e)&&(n=!0);let r=[];if(t.length!==0){let s=t.map((d)=>d.time),o=this.Pu.createConverterToInternalObj(t),u=rw(e.bh()),c=e.ul(),f=e.cl();r=t.map((d,h)=>{let g=o(d.time),b=this.Pu.key(g),S=this.rg.get(b);S===void 0&&(S=lw(g),this.rg.set(b,S),n=!0);let p=u(g,S.$n,d,s[h],c,f);return S.ng.set(e,p),p})}a&&this._g(),this.ug(e,r);let l=-1;if(n){let s=[];this.rg.forEach((o)=>{s.push({timeWeight:0,time:o.Oa,pointData:o,originalTime:ow(o.ng)})}),s.sort((o,u)=>this.Pu.key(o.time)-this.Pu.key(u.time)),l=this.cg(s)}return this.dg(e,l,function(s,o,u){let c=sw(s,u),f=sw(o,u);if(c!==void 0&&f!==void 0)return{fg:!1,Va:c.eg>=f.eg&&c.sg>=f.sg}}(this.hg.get(e),i,this.Pu))}if(e){return this.og(e,[])}pg(e,t,a){if(a&&e.Fa())throw Error("Historical updates are not supported when conflation is enabled. Conflation requires data to be processed in order.");let n=t;(function(S){S.Qr===void 0&&(S.Qr=S.time)})(n),this.Pu.preprocessData(t);let i=this.Pu.createConverterToInternalObj([t])(t.time),r=this.ag.get(e);if(!a&&r!==void 0&&this.Pu.key(i)<this.Pu.key(r))throw Error(`Cannot update oldest data, last time=${r}, new time=${i}`);let l=this.rg.get(this.Pu.key(i));if(a&&l===void 0)throw Error("Cannot update non-existing data point when historicalUpdate is true");let s=l===void 0;l===void 0&&(l=lw(i),this.rg.set(this.Pu.key(i),l));let o=rw(e.bh()),u=e.ul(),c=e.cl(),f=o(i,l.$n,t,n.Qr,u,c),d=!a&&!s&&r!==void 0&&this.Pu.key(i)===this.Pu.key(r);l.ng.set(e,f),a?this.vg(e,f,l.$n):d&&e.Fa()&&yl(f)?(e.Rr(f),this.mg(e,f)):this.mg(e,f);let h={Va:yl(f),fg:a};if(!s)return this.dg(e,-1,h);let g={timeWeight:0,time:l.Oa,pointData:l,originalTime:ow(l.ng)},b=$i(this.lg,this.Pu.key(g.time),(S,p)=>this.Pu.key(S.time)<p);this.lg.splice(b,0,g);for(let S=b;S<this.lg.length;++S)mf(this.lg[S].pointData,S);return this.Pu.fillWeightsForPoints(this.lg,b),this.dg(e,b,h)}wg(e,t){let a=this.hg.get(e);if(a===void 0||t<=0)return[[],this.Mg()];t=Math.min(t,a.length);let n=a.splice(-t).reverse();a.length===0?this.ag.delete(e):this.ag.set(e,a[a.length-1].wt);for(let i of n){let r=this.rg.get(this.Pu.key(i.wt));if(r&&(r.ng.delete(e),r.ng.size===0)){this.rg.delete(this.Pu.key(r.Oa)),this.lg.splice(r.$n,1);for(let l=r.$n;l<this.lg.length;++l)mf(this.lg[l].pointData,l)}}return[n,this.dg(e,this.lg.length-1,{fg:!1,Va:!1})]}mg(e,t){let a=this.hg.get(e);a===void 0&&(a=[],this.hg.set(e,a));let n=a.length!==0?a[a.length-1]:null;n===null||this.Pu.key(t.wt)>this.Pu.key(n.wt)?yl(t)&&a.push(t):yl(t)?a[a.length-1]=t:a.splice(-1,1),this.ag.set(e,t.wt)}vg(e,t,a){let n=this.hg.get(e);if(n===void 0)return;let i=$i(n,a,(r,l)=>r.$n<l);yl(t)?n[i]=t:n.splice(i,1)}ug(e,t){t.length!==0?(this.hg.set(e,t.filter(yl)),this.ag.set(e,t[t.length-1].wt)):(this.hg.delete(e),this.ag.delete(e))}_g(){for(let e of this.lg)e.pointData.ng.size===0&&this.rg.delete(this.Pu.key(e.time))}cg(e){let t=-1;for(let a=0;a<this.lg.length&&a<e.length;++a){let n=this.lg[a],i=e[a];if(this.Pu.key(n.time)!==this.Pu.key(i.time)){t=a;break}i.timeWeight=n.timeWeight,mf(i.pointData,a)}if(t===-1&&this.lg.length!==e.length&&(t=Math.min(this.lg.length,e.length)),t===-1)return-1;for(let a=t;a<e.length;++a)mf(e[a].pointData,a);return this.Pu.fillWeightsForPoints(e,t),this.lg=e,t}gg(){if(this.hg.size===0)return null;let e=0;return this.hg.forEach((t)=>{t.length!==0&&(e=Math.max(e,t[t.length-1].$n))}),e}dg(e,t,a){let n=this.Mg();if(t!==-1)this.hg.forEach((i,r)=>{n.Y_.set(r,{ue:i,bg:r===e?a:void 0})}),this.hg.has(e)||n.Y_.set(e,{ue:[],bg:a}),n.Et.Sg=this.lg,n.Et.xg=t;else{let i=this.hg.get(e);n.Y_.set(e,{ue:i||[],bg:a})}return n}Mg(){return{Y_:new Map,Et:{Dc:this.gg()}}}}function mf(e,t){e.$n=t,e.ng.forEach((a)=>{a.$n=t})}function __(e,t){return e._t<t}function N_(e,t){return t<e._t}function Kg(e,t,a,n){return $i(e,t,__,a,n)}function Xg(e,t,a,n){return ax(e,t,N_,a,n)}function xf(e,t,a){return{ne:e,se:t,ee:a}}function uw(e,t,a,n){return e>=t-n&&e<=a+n}function ko(e,t,a,n,i,r){let l=i-a,s=r-n;if(l===0&&s===0)return Math.hypot(e-a,t-n);let o=((e-a)*l+(t-n)*s)/(l*l+s*s),u=Math.max(0,Math.min(1,o)),c=a+l*u,f=n+s*u;return Math.hypot(e-c,t-f)}var _g=[0,0];function O_(e,t,a){return t===void 0||t.wt!==e.wt-1?e._t-a/2:(t._t+e._t)/2}function P_(e,t,a){return t===void 0||t.wt!==e.wt+1?e._t+a/2:(e._t+t._t)/2}function ox(e,t,a,n,i,r,l){if(t===null||t.from>=t.to||e.length===0)return null;let s=i/2+r,o=Kg(e,a-s,t.from,t.to),u=Xg(e,a+s,o,t.to);if(o>=u)return null;let c=Number.POSITIVE_INFINITY;for(let f=o;f<u;f++){let d=e[f],h=f>t.from?e[f-1]:void 0,g=f<t.to-1?e[f+1]:void 0,b=O_(d,h,i)-r,S=P_(d,g,i)+r;if(a<b||a>S)continue;l(d,_g);let p=_g[0],x=_g[1],y=Math.min(p,x),w=Math.max(p,x),T=y-r,I=w+r;if(n>=y&&n<=w)c=Math.min(c,0);else if(n>=T&&n<=I){let M=Math.min(Math.abs(n-y),Math.abs(w-n));c=Math.min(c,M)}}return Number.isFinite(c)?xf(c,0,"series-range"):null}function q_(e,t){return e.wt<t}function F_(e,t){return t<e.wt}function Mk(e,t,a){let n=t.Na(),i=t.bi(),r=$i(e,n,q_),l=ax(e,i,F_);if(!a)return{from:r,to:l};let s=r,o=l;return r>0&&r<e.length&&e[r].wt>=n&&(s=r-1),l>0&&l<e.length&&e[l-1].wt<=i&&(o=l+1),{from:s,to:o}}class Mf{constructor(e,t,a){this.Cg=!0,this.yg=!0,this.Pg=!0,this.kg=[],this.Tg=null,this.Rg=-1,this.ae=e,this.le=t,this.Dg=a}Pt(e){this.Cg=!0,e==="data"&&(this.yg=!0),e==="options"&&(this.Pg=!0)}Tt(){return this.ae.It()?(this.Ig(),this.Tg===null?null:this.Vg):null}Qs(e,t){return this.ae.It()?(this.Ig(),this.Tg===null?null:this.Bg(e,t)):null}Bg(e,t){return null}Eg(){this.kg=this.kg.map((e)=>({...e,...this.ae.Sa().Sh(e.wt)}))}Ag(){this.Tg=null}Ig(){let e=this.le.Et(),t=e.N().enableConflation?e.sd():0;t!==this.Rg&&(this.yg=!0,this.Rg=t),this.yg&&(this.Lg(),this.yg=!1),this.Pg&&(this.Eg(),this.Pg=!1),this.Cg&&(this.zg(),this.Cg=!1)}zg(){let e=this.ae.Ft(),t=this.le.Et();if(this.Ag(),t.Zi()||e.Zi())return;let a=t.Ee();if(a===null)return;if(this.ae.Un().Th()===0)return;let n=this.ae.Lt();n!==null&&(this.Tg=Mk(this.kg,a,this.Dg),this.Og(e,t,n.Wt),this.Ng())}}class Tk{constructor(e,t){this.Fg=e,this.Ki=t}st(e,t,a){this.Fg.draw(e,this.Ki,t,a)}}function U_(e){switch(e){case"point":return 2;case"range":return 0;default:return 1}}class Ak extends Mf{constructor(e,t,a){super(e,t,!1),this.Yh=a,this.Fg=this.Yh.renderer(),this.Vg=new Tk(this.Fg,(n)=>this.Wg(n))}get ga(){return this.Yh.conflationReducer}Ha(e){return this.Yh.priceValueBuilder(e)}dl(e){return this.Yh.isWhitespace(e)}Bg(e,t){let a=this.Fg.hitTest?.(e,t,(r)=>this.Wg(r));if(a!=null)return{ne:(n=a).distance,se:U_(n.type),ee:"custom",gu:n.cursorStyle,te:n.objectId,ie:n.hitTestData};var n;let i=ox(this.kg,this.Tg,e,t,this.le.Et().ml(),this.ae.N().hitTestTolerance,(r,l)=>{let s=r.Hg,o=NaN,u=NaN;if(s!==void 0&&!this.Yh.isWhitespace(s))for(let c of this.Yh.priceValueBuilder(s)){let f=this.Wg(c);f!==null&&(o=Number.isNaN(o)?f:Math.min(o,f),u=Number.isNaN(u)?f:Math.max(u,f))}l[0]=o,l[1]=u});return i===null?null:{...i,ee:"custom"}}Lg(){let e=this.ae.Sa();this.kg=this.ae.Ua().Bh().map((t)=>({wt:t.$n,_t:NaN,...e.Sh(t.$n),Hg:t.ue}))}Og(e,t){t.Ic(this.kg,Eo(this.Tg))}Ng(){this.Yh.update({bars:this.kg.map(H_),barSpacing:this.le.Et().ml(),visibleRange:this.Tg,conflationFactor:this.le.Et().sd()},this.ae.N())}Wg(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}}function H_(e){return{x:e._t,time:e.wt,originalData:e.Hg,barColor:e.sh}}var V_={color:"#2196f3"},G_=(e,t,a)=>{let n=$n(a);return new Ak(e,t,n)};function ux(e){let t={value:e.Wt[3],time:e.Qr};return e.ig!==void 0&&(t.customValues=e.ig),t}function cw(e){let t=ux(e);return e.R!==void 0&&(t.color=e.R),t}function Q_(e){let t=ux(e);return e.vt!==void 0&&(t.lineColor=e.vt),e.ah!==void 0&&(t.topColor=e.ah),e.oh!==void 0&&(t.bottomColor=e.oh),t}function j_(e){let t=ux(e);return e._h!==void 0&&(t.topLineColor=e._h),e.uh!==void 0&&(t.bottomLineColor=e.uh),e.dh!==void 0&&(t.topFillColor1=e.dh),e.fh!==void 0&&(t.topFillColor2=e.fh),e.ph!==void 0&&(t.bottomFillColor1=e.ph),e.mh!==void 0&&(t.bottomFillColor2=e.mh),t}function Ek(e){let t={open:e.Wt[0],high:e.Wt[1],low:e.Wt[2],close:e.Wt[3],time:e.Qr};return e.ig!==void 0&&(t.customValues=e.ig),t}function Y_(e){let t=Ek(e);return e.R!==void 0&&(t.color=e.R),t}function K_(e){let t=Ek(e),{R:a,Ht:n,hh:i}=e;return a!==void 0&&(t.color=a),n!==void 0&&(t.borderColor=n),i!==void 0&&(t.wickColor=i),t}function yf(e){return{Area:Q_,Line:cw,Baseline:j_,Histogram:cw,Bar:Y_,Candlestick:K_,Custom:X_}[e]}function X_(e){let t=e.Qr;return{...e.ue,time:t}}var W_={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1,doNotSnapToHiddenSeriesIndices:!1},Z_={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},J_={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Lw,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},Ng={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:0.1,top:0.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1,tickMarkDensity:2.5},$_={rightOffset:0,barSpacing:6,minBarSpacing:0.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1,enableConflation:!1,conflationThresholdFactor:1,precomputeConflationOnInit:!1,precomputeConflationPriority:"background"};function fw(){return{addDefaultPane:!0,hoveredSeriesOnTop:!0,width:0,height:0,autoSize:!1,layout:J_,crosshair:W_,grid:Z_,overlayPriceScales:{...Ng},leftPriceScale:{...Ng,visible:!1},rightPriceScale:{...Ng,visible:!0},defaultVisiblePriceScaleId:"right",timeScale:$_,localization:{locale:Ll?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class cx{constructor(e,t,a){this.hv=e,this.Ug=t,this.$g=a??0}applyOptions(e){this.hv.Qt().Dd(this.Ug,e,this.$g)}options(){return this.Ki().N()}width(){return wf(this.Ug)?this.hv.DM(this.Ug):0}setVisibleRange(e){this.setAutoScale(!1),this.Ki().Go(new pt(e.from,e.to))}getVisibleRange(){let e,t,a=this.Ki().ar();if(a===null)return null;if(this.Ki().ho()){let n=this.Ki().S_(),i=gk(n);a=Sl(a,this.Ki().lo()),e=Number((Math.round(a.Je()/n)*n).toFixed(i)),t=Number((Math.round(a.Qe()/n)*n).toFixed(i))}else e=a.Je(),t=a.Qe();return{from:e,to:t}}setAutoScale(e){this.applyOptions({autoScale:e})}Ki(){return z(this.hv.Qt().Id(this.Ug,this.$g)).Ft}}class Dk{constructor(e,t,a,n){this.hv=e,this.yt=a,this.jg=t,this.qg=n}getHeight(){return this.yt.$t()}setHeight(e){let t=this.hv.Qt(),a=t._f(this.yt);t.Ld(a,e)}getStretchFactor(){return this.yt.F_()}setStretchFactor(e){this.yt.W_(e),this.hv.Qt().ka()}paneIndex(){return this.hv.Qt()._f(this.yt)}moveTo(e){let t=this.paneIndex();t!==e&&(lt(e>=0&&e<this.hv.lv().length,"Invalid pane index"),this.hv.Qt().Od(t,e))}getSeries(){return this.yt.Y_().map((e)=>this.jg(e))??[]}getHTMLElement(){let e=this.hv.lv();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].fv():null}attachPrimitive(e){this.yt.ol(e),e.attached&&e.attached({chart:this.qg,requestUpdate:()=>this.yt.Qt().ka()})}detachPrimitive(e){this.yt._l(e)}priceScale(e){if(this.yt.O_(e)===null)throw Error(`Cannot find price scale with id: ${e}`);return new cx(this.hv,e,this.paneIndex())}setPreserveEmptyPane(e){this.yt.j_(e)}preserveEmptyPane(){return this.yt.q_()}addCustomSeries(e,t={},a=0){return this.qg.addCustomSeries(e,t,a)}addSeries(e,t={}){return this.qg.addSeries(e,t,this.paneIndex())}}var eN={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class Wg{constructor(e){this._r=e}applyOptions(e){this._r.vr(e)}options(){return this._r.N()}Yg(){return this._r}}class Rk{constructor(e,t,a,n,i,r){this.Kg=new Be,this.ae=e,this.Gg=t,this.Zg=a,this.Pu=i,this.qg=n,this.Xg=r}m(){this.Kg.m()}priceFormatter(){return this.ae.sl()}priceToCoordinate(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}coordinateToPrice(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Tn(e,t.Wt)}barsInLogicalRange(e){if(e===null)return null;let t=new vl(new Xi(e.from,e.to)).Uu(),a=this.ae.Un();if(a.Zi())return null;let n=a.Hn(t.Na(),1),i=a.Hn(t.bi(),-1),r=z(a.Rh()),l=z(a.Qn());if(n!==null&&i!==null&&n.$n>i.$n)return{barsBefore:e.from-r,barsAfter:l-e.to};let s={barsBefore:n===null||n.$n===r?e.from-r:n.$n-r,barsAfter:i===null||i.$n===l?l-e.to:l-i.$n};return n!==null&&i!==null&&(s.from=n.Qr,s.to=i.Qr),s}setData(e){this.Pu,this.ae.bh(),this.Gg.Jg(this.ae,e),this.Qg("full")}update(e,t=!1){this.ae.bh(),this.Gg.tb(this.ae,e,t),this.Qg("update")}pop(e=1){let t=this.Gg.ib(this.ae,e);t.length!==0&&this.Qg("update");let a=yf(this.seriesType());return t.map((n)=>a(n))}dataByIndex(e,t){let a=this.ae.Un().Hn(e,t);if(a===null)return null;return yf(this.seriesType())(a)}data(){let e=yf(this.seriesType());return this.ae.Un().Bh().map((t)=>e(t))}subscribeDataChanged(e){this.Kg.i(e)}unsubscribeDataChanged(e){this.Kg._(e)}applyOptions(e){this.ae.vr(e)}options(){return ln(this.ae.N())}priceScale(){return this.Zg.priceScale(this.ae.Ft().pl(),this.getPane().paneIndex())}createPriceLine(e){let t=Ft(ln(eN),e),a=this.ae.Ea(t);return new Wg(a)}removePriceLine(e){this.ae.Aa(e.Yg())}priceLines(){return this.ae.La().map((e)=>new Wg(e))}seriesType(){return this.ae.bh()}lastValueData(e){let t=this.ae.Ae(e);return t.Le?{noData:!0}:{noData:!1,price:t.Mt,color:t.R}}attachPrimitive(e){this.ae.ol(e),e.attached&&e.attached({chart:this.qg,series:this,requestUpdate:()=>this.ae.Qt().ka(),horzScaleBehavior:this.Pu})}detachPrimitive(e){this.ae._l(e),e.detached&&e.detached(),this.ae.Qt().ka()}getPane(){let e=this.ae,t=z(this.ae.Qt().Ks(e));return this.Xg(t)}moveToPane(e){this.ae.Qt().rf(this.ae,e)}seriesOrder(){let e=this.ae.Qt().Ks(this.ae);return e===null?-1:e.Y_().indexOf(this.ae)}setSeriesOrder(e){let t=this.ae.Qt().Ks(this.ae);t!==null&&t.vu(this.ae,e)}Qg(e){this.Kg.v()&&this.Kg.p(e)}}class Bk{constructor(e,t,a){this.nb=new Be,this.Qu=new Be,this.Nw=new Be,this.sn=e,this.ia=e.Et(),this.vM=t,this.ia.Zc().i(this.sb.bind(this)),this.ia.Xc().i(this.eb.bind(this)),this.vM.qw().i(this.rb.bind(this)),this.Pu=a}m(){this.ia.Zc().u(this),this.ia.Xc().u(this),this.vM.qw().u(this),this.nb.m(),this.Qu.m(),this.Nw.m()}scrollPosition(){return this.ia.Oc()}scrollToPosition(e,t){t?this.ia.Yc(e,1000):this.sn.gs(e)}scrollToRealTime(){this.ia.qc()}getVisibleRange(){let e=this.ia.xc();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){let t={from:this.Pu.convertHorzItemToInternal(e.from),to:this.Pu.convertHorzItemToInternal(e.to)},a=this.ia.kc(t);this.sn.sf(a)}getVisibleLogicalRange(){let e=this.ia.Sc();return e===null?null:{from:e.Na(),to:e.bi()}}setVisibleLogicalRange(e){lt(e.from<=e.to,"The from index cannot be after the to index."),this.sn.sf(e)}resetTimeScale(){this.sn.ws()}fitContent(){this.sn.td()}logicalToCoordinate(e){let t=this.sn.Et();return t.Zi()?null:t.jt(e)}coordinateToLogical(e){return this.ia.Zi()?null:this.ia.Vc(e)}timeToIndex(e,t){let a=this.Pu.convertHorzItemToInternal(e);return this.ia.Mc(a,t)}timeToCoordinate(e){let t=this.timeToIndex(e,!1);return t===null?null:this.ia.jt(t)}coordinateToTime(e){let t=this.sn.Et(),a=t.Vc(e),n=t.en(a);return n===null?null:n.originalTime}width(){return this.vM.pv().width}height(){return this.vM.pv().height}subscribeVisibleTimeRangeChange(e){this.nb.i(e)}unsubscribeVisibleTimeRangeChange(e){this.nb._(e)}subscribeVisibleLogicalRangeChange(e){this.Qu.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.Qu._(e)}subscribeSizeChange(e){this.Nw.i(e)}unsubscribeSizeChange(e){this.Nw._(e)}applyOptions(e){this.ia.vr(e)}options(){return{...ln(this.ia.N()),barSpacing:this.ia.ml()}}sb(){this.nb.v()&&this.nb.p(this.getVisibleRange())}eb(){this.Qu.v()&&this.Qu.p(this.getVisibleLogicalRange())}rb(e){this.Nw.p(e.width,e.height)}}function dw(e){return function(t){if(rf(t.handleScale)){let n=t.handleScale;t.handleScale={axisDoubleClickReset:{time:n,price:n},axisPressedMouseMove:{time:n,price:n},mouseWheel:n,pinch:n}}else if(t.handleScale!==void 0){let{axisPressedMouseMove:n,axisDoubleClickReset:i}=t.handleScale;rf(n)&&(t.handleScale.axisPressedMouseMove={time:n,price:n}),rf(i)&&(t.handleScale.axisDoubleClickReset={time:i,price:i})}let a=t.handleScroll;rf(a)&&(t.handleScroll={horzTouchDrag:a,vertTouchDrag:a,mouseWheel:a,pressedMouseMove:a})}(e),e}class zk{constructor(e,t,a){this.hb=new Map,this.ab=new Map,this.lb=new Be,this.ob=new Be,this._b=new Be,this.dd=new WeakMap,this.ub=new Ik(t);let n=a===void 0?ln(fw()):Ft(ln(fw()),dw(a));this.cb=t,this.hv=new kk(e,n,t),this.hv.mw().i((r)=>{this.lb.v()&&this.lb.p(this.fb(r()))},this),this.hv.ww().i((r)=>{this.ob.v()&&this.ob.p(this.fb(r()))},this),this.hv.Bd().i((r)=>{this._b.v()&&this._b.p(this.fb(r()))},this);let i=this.hv.Qt();this.pb=new Bk(i,this.hv.bM(),this.cb)}remove(){this.hv.mw().u(this),this.hv.ww().u(this),this.hv.Bd().u(this),this.pb.m(),this.hv.m(),this.hb.clear(),this.ab.clear(),this.lb.m(),this.ob.m(),this._b.m(),this.ub.m()}resize(e,t,a){this.autoSizeActive()||this.hv.wM(e,t,a)}addCustomSeries(e,t={},a=0){let n=((i)=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...V_,...i.defaultOptions()},mb:G_,wb:i}))($n(e));return this.Mb(n,t,a)}addSeries(e,t={},a=0){return this.Mb(e,t,a)}removeSeries(e){let t=Mt(this.hb.get(e)),a=this.ub.if(t);this.hv.Qt().if(t),this.gb(a),this.hb.delete(e),this.ab.delete(t)}Jg(e,t){this.gb(this.ub.og(e,t))}tb(e,t,a){this.gb(this.ub.pg(e,t,a))}ib(e,t){let[a,n]=this.ub.wg(e,t);return a.length!==0&&this.gb(n),a}subscribeClick(e){this.lb.i(e)}unsubscribeClick(e){this.lb._(e)}subscribeCrosshairMove(e){this._b.i(e)}unsubscribeCrosshairMove(e){this._b._(e)}subscribeDblClick(e){this.ob.i(e)}unsubscribeDblClick(e){this.ob._(e)}priceScale(e,t=0){return new cx(this.hv,e,t)}timeScale(){return this.pb}applyOptions(e){this.hv.vr(dw(e))}options(){return this.hv.N()}takeScreenshot(e=!1,t=!1){let a,n;try{t||(a=this.hv.Qt().N().crosshair.mode,this.hv.vr({crosshair:{mode:2}})),n=this.hv.TM(e)}finally{t||a===void 0||this.hv.Qt().vr({crosshair:{mode:a}})}return n}addPane(e=!1){let t=this.hv.Qt().uf();return t.j_(e),this.bb(t)}removePane(e){this.hv.Qt().Ad(e)}swapPanes(e,t){this.hv.Qt().zd(e,t)}autoSizeActive(){return this.hv.CM()}chartElement(){return this.hv.Mv()}panes(){return this.hv.Qt().Gn().map((e)=>this.bb(e))}paneSize(e=0){let t=this.hv.AM(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,a){let n=this.hb.get(a);if(n===void 0)return;let i=this.hv.Qt().Ks(n);i!==null&&this.hv.Qt().Gd(e,t,i)}clearCrosshairPosition(){this.hv.Qt().Zd(!0)}horzBehaviour(){return this.cb}Mb(e,t={},a=0){lt(e.mb!==void 0),function(s){if(s===void 0||s.type==="custom")return;let o=s;o.minMove!==void 0&&o.precision===void 0&&(o.precision=gk(o.minMove))}(t.priceFormat),e.type==="Candlestick"&&function(s){s.borderColor!==void 0&&(s.borderUpColor=s.borderColor,s.borderDownColor=s.borderColor),s.wickColor!==void 0&&(s.wickUpColor=s.wickColor,s.wickDownColor=s.wickColor)}(t);let n=Ft(ln(vw),ln(e.defaultOptions),t),i=e.mb,r=new _o(this.hv.Qt(),e.type,n,i,e.wb);this.hv.Qt().Qd(r,a);let l=new Rk(r,this,this,this,this.cb,(s)=>this.bb(s));return this.hb.set(l,r),this.ab.set(r,l),l}gb(e){let t=this.hv.Qt();for(let a of e.Y_.keys())a.Ia();t.Xd(e.Et.Dc,e.Et.Sg,e.Et.xg),e.Y_.forEach((a,n)=>n.ht(a.ue,a.bg)),t.Et().dc(),t.Lc()}Sb(e){return Mt(this.ab.get(e))}xb(e){return e!==void 0&&this.ab.has(e)?this.Sb(e):void 0}fb(e){let t=new Map;e.QM.forEach((i,r)=>{let l=r.bh(),s=yf(l)(i);if(l!=="Custom")lt(A_(s));else{let o=r.cl();lt(!o||o(s)===!1)}t.set(this.Sb(r),s)});let a=this.xb(e.jM),n=e.YM===void 0?void 0:{type:e.YM.ds,sourceKind:e.YM.KM,objectKind:e.YM.GM,series:this.xb(e.YM.Y_),objectId:e.YM.ZM,paneIndex:e.YM.XM};return{time:e.Qr,logical:e.$n,point:e.JM,paneIndex:e.XM,hoveredInfo:n,hoveredSeries:a,hoveredObjectId:e.qM,seriesData:t,sourceEvent:e.tg}}bb(e){let t=this.dd.get(e);return t||(t=new Dk(this.hv,(a)=>this.Sb(a),e,this),this.dd.set(e,t)),t}}function tN(e){if(Ro(e)){let t=document.getElementById(e);return lt(t!==null,`Cannot find element in DOM with id=${e}`),t}return e}function aN(e,t,a){let n=tN(e),i=new zk(n,t,a);return t.setOptions(i.options()),i}function Tf(e,t){return aN(e,new Vg,Vg.Tf(t))}function Lo(e,t,a,n){return Math.hypot(a-e,n-t)}function nN(e,t,a,n,i,r,l,s=0){if(t.length===0||n.from>=t.length||n.to<=0)return;let{context:o,horizontalPixelRatio:u,verticalPixelRatio:c}=e,f=t[n.from],d=r(e,f),h=f;if(n.to-n.from<2){let g=i/2;o.beginPath();let b={_t:f._t-g,ut:f.ut},S={_t:f._t+g,ut:f.ut};o.moveTo(b._t*u,b.ut*c),o.lineTo(S._t*u,S.ut*c),l(e,d,b,S)}else{let g=s>0,b=0,S=(x,y)=>{if(l(e,d,h,y),o.beginPath(),d=x,h=y,g){let w=b%s;o.lineDashOffset=w,b=w}},p=h;o.beginPath(),o.moveTo(f._t*u,f.ut*c);for(let x=n.from+1;x<n.to;++x){p=t[x];let y=p._t*u,w=p.ut*c,T=r(e,p);switch(a){case 0:if(o.lineTo(y,w),g){let I=t[x-1],M=I._t*u,R=I.ut*c;b+=Lo(M,R,y,w)}break;case 1:{let I=t[x-1],M=I.ut*c;o.lineTo(y,M),g&&(b+=Math.abs(p._t-I._t)*u),T!==d&&(S(T,p),o.lineTo(y,M)),o.lineTo(y,w),g&&(b+=Math.abs(p.ut-I.ut)*c);break}case 2:{let[I,M]=fx(t,x-1,x),R=I._t*u,A=I.ut*c,v=M._t*u,F=M.ut*c;if(o.bezierCurveTo(R,A,v,F,y,w),g){let H=t[x-1],B=H._t*u,q=H.ut*c,V=Lo(B,q,y,w),Y=Lo(B,q,R,A)+Lo(R,A,v,F)+Lo(v,F,y,w);b+=(V+Y)/2}break}}a!==1&&T!==d&&(S(T,p),o.moveTo(y,w))}(h!==p||h===p&&a===1)&&l(e,d,h,p),g&&(o.lineDashOffset=0)}}var hw=6;function Og(e,t){return{_t:e._t-t._t,ut:e.ut-t.ut}}function mw(e,t){return{_t:e._t/t,ut:e.ut/t}}function fx(e,t,a){let n=Math.max(0,t-1),i=Math.min(e.length-1,a+1);var r,l;return[(r=e[t],l=mw(Og(e[a],e[n]),hw),{_t:r._t+l._t,ut:r.ut+l.ut}),Og(e[a],mw(Og(e[i],e[t]),hw))]}function iN(e,t){let a=e.context;a.strokeStyle=t,a.stroke()}class _k extends on{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;let{ot:t,lt:a,Cb:n,yb:i,ct:r,Gt:l,Pb:s}=this.rt;if(a===null)return;let o=e.context;o.lineCap="butt",o.lineWidth=r*e.verticalPixelRatio;let u=Wi(o,l);o.lineJoin="round";let c=this.kb.bind(this),f=function(d){return d.reduce((h,g)=>h+g,0)}(u);i!==void 0&&nN(e,t,i,a,n,c,iN,f),s&&function(d,h,g,b,S){if(b.to-b.from<=0)return;let{horizontalPixelRatio:p,verticalPixelRatio:x,context:y}=d,w=null,T=Math.max(1,Math.floor(p))%2/2,I=g*x+T;for(let M=b.to-1;M>=b.from;--M){let R=h[M];if(R){let A=S(d,R);A!==w&&(w!==null&&y.fill(),y.beginPath(),y.fillStyle=A,w=A);let v=Math.round(R._t*p)+T,F=R.ut*x;y.moveTo(v,F),y.arc(v,F,I,0,2*Math.PI)}}y.fill()}(e,t,s,a,c)}}class Nk extends _k{kb(e,t){return t.vt}}function pw(e,t,a,n,i){let r=1-i;return r*r*r*e+3*r*r*i*t+3*r*i*i*a+i*i*i*n}function rN(e,t,a,n,i){if(a===2){let[r,l]=fx(n,i-1,i);return[Math.min(e._t,t._t,r._t,l._t),Math.max(e._t,t._t,r._t,l._t)]}return[Math.min(e._t,t._t),Math.max(e._t,t._t)]}function lN(e,t,a,n,i,r,l,s){switch(i){case 1:{let o=ko(e,t,a._t,a.ut,n._t,a.ut),u=ko(e,t,n._t,a.ut,n._t,n.ut),c=Math.min(o,u);return c<=s?c:null}case 2:{let[o,u]=fx(r,l-1,l),c=function(f,d,h){let g=Number.POSITIVE_INFINITY,b=h[0];for(let S=1;S<=12;S++){let p=S/12,x={_t:pw(h[0]._t,h[1]._t,h[2]._t,h[3]._t,p),ut:pw(h[0].ut,h[1].ut,h[2].ut,h[3].ut,p)};g=Math.min(g,ko(f,d,b._t,b.ut,x._t,x.ut)),b=x}return g}(e,t,[a,o,u,n]);return c<=s?c:null}default:{let o=ko(e,t,a._t,a.ut,n._t,n.ut);return o<=s?o:null}}}class dx extends Mf{constructor(e,t){super(e,t,!0)}Og(e,t,a){t.Ic(this.kg,Eo(this.Tg)),e.Jo(this.kg,a,Eo(this.Tg))}Tb(e,t){return{wt:e,Mt:t,_t:NaN,ut:NaN}}Lg(){let e=this.ae.Sa();this.kg=this.ae.Ua().Bh().map((t)=>{let a;if((t.Gr??1)>1){let n=t.Wt[1],i=t.Wt[2],r=t.Wt[3];a=Math.abs(n-r)>Math.abs(i-r)?n:i}else a=t.Wt[3];return this.Rb(t.$n,a,e)})}}class Ok extends dx{Bg(e,t){let a=this.ae.N();return function(n,i,r,l,s,o,u,c=0,f=0){if(i===null||i.from>=i.to||n.length===0)return null;let d=Math.max(o/2,u??0)+f,h=Number.POSITIVE_INFINITY;if(u!==void 0){let y=u+f,w=Kg(n,r-y,i.from,i.to),T=Xg(n,r+y,w,i.to);for(let I=w;I<T;I++){let M=n[I];if(!uw(r,M._t,M._t,u+f))continue;let R=Math.hypot(r-M._t,l-M.ut);R<=u+f&&(h=Math.min(h,R))}}if(i.to-i.from<2){let y=n[i.from],w=Math.max(c/2,d),T=ko(r,l,y._t-w,y.ut,y._t+w,y.ut);return T<=d&&(h=Math.min(h,T)),Number.isFinite(h)?xf(h,2,"series-point"):null}let g=Number.POSITIVE_INFINITY,b=Kg(n,r-d,i.from,i.to),S=Xg(n,r+d,b,i.to),p=Math.max(i.from+1,b),x=Math.min(i.to,S+1);for(let y=p;y<x;y++){let w=n[y-1],T=n[y],[I,M]=rN(w,T,s,n,y);if(!uw(r,I,M,d))continue;let R=lN(r,l,w,T,s,n,y,d);R!==null&&(g=Math.min(g,R))}return Number.isFinite(h)?xf(h,2,"series-point"):Number.isFinite(g)?xf(g,1,"series-line"):null}(this.kg,this.Tg,e,t,a.lineType,a.lineVisible?a.lineWidth:1,a.pointMarkersVisible?a.pointMarkersRadius||a.lineWidth/2+2:void 0,this.le.Et().ml(),a.hitTestTolerance)}}class Pk extends Ok{constructor(){super(...arguments),this.Vg=new Nk}Rb(e,t,a){return{...this.Tb(e,t),...a.Sh(e)}}Ng(){let e=this.ae.N(),t={ot:this.kg,Gt:e.lineStyle,yb:e.lineVisible?e.lineType:void 0,ct:e.lineWidth,Pb:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0,lt:this.Tg,Cb:this.le.Et().ml()};this.Vg.ht(t)}}var Af={type:"Line",isBuiltIn:!0,defaultOptions:{color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},mb:(e,t)=>new Pk(e,t)};class qk extends Mf{constructor(e,t){super(e,t,!1)}Bg(e,t){return ox(this.kg,this.Tg,e,t,this.le.Et().ml(),this.ae.N().hitTestTolerance,(a,n)=>{n[0]=a.n_,n[1]=a.s_})}Og(e,t,a){t.Ic(this.kg,Eo(this.Tg)),e.t_(this.kg,a,Eo(this.Tg))}fS(e,t,a){return{wt:e,jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3],_t:NaN,i_:NaN,n_:NaN,s_:NaN,e_:NaN}}Lg(){let e=this.ae.Sa();this.kg=this.ae.Ua().Bh().map((t)=>this.Rb(t.$n,t,e))}}class Fk extends on{constructor(){super(...arguments),this.qt=null,this.oS=0}ht(e){this.qt=e}et(e){if(this.qt===null||this.qt.Un.length===0||this.qt.lt===null)return;let{horizontalPixelRatio:t}=e;if(this.oS=function(i,r){if(i>=2.5&&i<=4)return Math.floor(3*r);let l=1-0.2*Math.atan(Math.max(4,i)-4)/(0.5*Math.PI),s=Math.floor(i*l*r),o=Math.floor(i*r),u=Math.min(s,o);return Math.max(Math.floor(r),u)}(this.qt.ml,t),this.oS>=2)Math.floor(t)%2!=this.oS%2&&this.oS--;let a=this.qt.Un;this.qt.pS&&this.vS(e,a,this.qt.lt),this.qt.gi&&this.Vm(e,a,this.qt.lt);let n=this.mS(t);(!this.qt.gi||this.oS>2*n)&&this.wS(e,a,this.qt.lt)}vS(e,t,a){if(this.qt===null)return;let{context:n,horizontalPixelRatio:i,verticalPixelRatio:r}=e,l="",s=Math.min(Math.floor(i),Math.floor(this.qt.ml*i));s=Math.max(Math.floor(i),Math.min(s,this.oS));let o=Math.floor(0.5*s),u=null;for(let c=a.from;c<a.to;c++){let f=t[c];f.rh!==l&&(n.fillStyle=f.rh,l=f.rh);let d=Math.round(Math.min(f.i_,f.e_)*r),h=Math.round(Math.max(f.i_,f.e_)*r),g=Math.round(f.n_*r),b=Math.round(f.s_*r),S=Math.round(i*f._t)-o,p=S+s-1;u!==null&&(S=Math.max(u+1,S),S=Math.min(S,p));let x=p-S+1;n.fillRect(S,g,x,d-g),n.fillRect(S,h+1,x,b-h),u=p}}mS(e){let t=Math.floor(1*e);this.oS<=2*t&&(t=Math.floor(0.5*(this.oS-1)));let a=Math.max(Math.floor(e),t);return this.oS<=2*a?Math.max(Math.floor(e),Math.floor(1*e)):a}Vm(e,t,a){if(this.qt===null)return;let{context:n,horizontalPixelRatio:i,verticalPixelRatio:r}=e,l="",s=this.mS(i),o=null;for(let u=a.from;u<a.to;u++){let c=t[u];c.eh!==l&&(n.fillStyle=c.eh,l=c.eh);let f=Math.round(c._t*i)-Math.floor(0.5*this.oS),d=f+this.oS-1,h=Math.round(Math.min(c.i_,c.e_)*r),g=Math.round(Math.max(c.i_,c.e_)*r);if(o!==null&&(f=Math.max(o+1,f),f=Math.min(f,d)),this.qt.ml*i>2*s)$z(n,f,h,d-f+1,g-h+1,s);else{let b=d-f+1;n.fillRect(f,h,b,g-h+1)}o=d}}wS(e,t,a){if(this.qt===null)return;let{context:n,horizontalPixelRatio:i,verticalPixelRatio:r}=e,l="",s=this.mS(i);for(let o=a.from;o<a.to;o++){let u=t[o],c=Math.round(Math.min(u.i_,u.e_)*r),f=Math.round(Math.max(u.i_,u.e_)*r),d=Math.round(u._t*i)-Math.floor(0.5*this.oS),h=d+this.oS-1;if(u.sh!==l){let g=u.sh;n.fillStyle=g,l=g}this.qt.gi&&(d+=s,c+=s,h-=s,f-=s),c>f||n.fillRect(d,c,h-d+1,f-c+1)}}}class Uk extends qk{constructor(){super(...arguments),this.Vg=new Fk}Rb(e,t,a){return{...this.fS(e,t,a),...a.Sh(e)}}Ng(){let e=this.ae.N();this.Vg.ht({Un:this.kg,ml:this.le.Et().ml(),pS:e.wickVisible,gi:e.borderVisible,lt:this.Tg})}}var Ef={type:"Candlestick",isBuiltIn:!0,defaultOptions:{upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},mb:(e,t)=>new Uk(e,t)};class Hk extends on{constructor(){super(...arguments),this.qt=null,this.MS=[]}ht(e){this.qt=e,this.MS=[]}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:a}){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return;this.MS.length||this.gS(t);let n=Math.max(1,Math.floor(a)),i=Math.round(this.qt.bS*a)-Math.floor(n/2),r=i+n;for(let l=this.qt.lt.from;l<this.qt.lt.to;l++){let s=this.qt.ot[l],o=this.MS[l-this.qt.lt.from],u=Math.round(s.ut*a),c,f;e.fillStyle=s.sh,u<=i?(c=u,f=r):(c=i,f=u-Math.floor(n/2)+n),e.fillRect(o.Na,c,o.bi-o.Na+1,f-c)}}gS(e){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return void(this.MS=[]);let t=Math.ceil(this.qt.ml*e)<=1?0:Math.max(1,Math.floor(e)),a=Math.round(this.qt.ml*e)-t;this.MS=Array(this.qt.lt.to-this.qt.lt.from);for(let i=this.qt.lt.from;i<this.qt.lt.to;i++){let r=this.qt.ot[i],l=Math.round(r._t*e),s,o;if(a%2){let u=(a-1)/2;s=l-u,o=l+u}else{let u=a/2;s=l-u,o=l+u-1}this.MS[i-this.qt.lt.from]={Na:s,bi:o,SS:l,ce:r._t*e,wt:r.wt}}for(let i=this.qt.lt.from+1;i<this.qt.lt.to;i++){let r=this.MS[i-this.qt.lt.from],l=this.MS[i-this.qt.lt.from-1];r.wt===l.wt+1&&(r.Na-l.bi!==t+1&&(l.SS>l.ce?l.bi=r.Na-t-1:r.Na=l.bi+t+1))}let n=Math.ceil(this.qt.ml*e);for(let i=this.qt.lt.from;i<this.qt.lt.to;i++){let r=this.MS[i-this.qt.lt.from];r.bi<r.Na&&(r.bi=r.Na);let l=r.bi-r.Na+1;n=Math.min(l,n)}if(t>0&&n<4)for(let i=this.qt.lt.from;i<this.qt.lt.to;i++){let r=this.MS[i-this.qt.lt.from];r.bi-r.Na+1>n&&(r.SS>r.ce?r.bi-=1:r.Na+=1)}}}class Vk extends dx{constructor(){super(...arguments),this.Vg=new Hk}Bg(e,t){let a=this.ae.Ft().Nt(this.ae.N().base,z(this.ae.Lt()).Wt);return a===null?null:ox(this.kg,this.Tg,e,t,this.le.Et().ml(),this.ae.N().hitTestTolerance,(n,i)=>{i[0]=n.ut,i[1]=a})}Rb(e,t,a){return{...this.Tb(e,t),...a.Sh(e)}}Ng(){let e={ot:this.kg,ml:this.le.Et().ml(),lt:this.Tg,bS:this.ae.Ft().Nt(this.ae.N().base,z(this.ae.Lt()).Wt)};this.Vg.ht(e)}}var Df={type:"Histogram",isBuiltIn:!0,defaultOptions:{color:"#26a69a",base:0},mb:(e,t)=>new Vk(e,t)};class Gk{constructor(e,t){this.ae=e,this.Jh=t,this.CS()}detach(){this.ae.detachPrimitive(this.Jh)}getSeries(){return this.ae}applyOptions(e){this.Jh&&this.Jh.vr&&this.Jh.vr(e)}CS(){this.ae.attachPrimitive(this.Jh)}}var sN={autoScale:!0,zOrder:"normal"};function Qk(e,t){return If(Math.min(Math.max(e,12),30)*t)}function wl(e,t){let a=e==="circle"?0.8:e==="square"?0.7:1;return If(Math.max(t,12)*a)}function jk(e){return function(t){let a=Math.ceil(t);return a%2!=0?a-1:a}(Qk(e,1))}function Yk(e){return Math.max(Qk(e,0.1),3)}function gw(e,t,a){return t?e:a?Math.ceil(e/2):0}function xw(e,t,a,n){let i=(wl("arrowUp",n)-1)/2*a.YS,r=(If(n/2)-1)/2*a.YS;t.beginPath(),e?(t.moveTo(a._t-i,a.ut),t.lineTo(a._t,a.ut-i),t.lineTo(a._t+i,a.ut),t.lineTo(a._t+r,a.ut),t.lineTo(a._t+r,a.ut+i),t.lineTo(a._t-r,a.ut+i),t.lineTo(a._t-r,a.ut)):(t.moveTo(a._t-i,a.ut),t.lineTo(a._t,a.ut+i),t.lineTo(a._t+i,a.ut),t.lineTo(a._t+r,a.ut),t.lineTo(a._t+r,a.ut-i),t.lineTo(a._t-r,a.ut-i),t.lineTo(a._t-r,a.ut)),t.fill()}function yw(e,t,a,n,i,r){let l=(wl("arrowUp",n)-1)/2,s=(If(n/2)-1)/2;if(i>=t-s-2&&i<=t+s+2&&r>=(e?a:a-l)-2&&r<=(e?a+l:a)+2)return!0;return(()=>{if(i<t-l-3||i>t+l+3||r<(e?a-l-3:a)||r>(e?a:a+l+3))return!1;let o=Math.abs(i-t);return Math.abs(r-a)+3>=o/2})()}class Kk{constructor(){this.qt=null,this.$s=new Cl,this.F=-1,this.W="",this.hm="",this.KS="normal"}ht(e){this.qt=e}js(e,t,a){this.F===e&&this.W===t||(this.F=e,this.W=t,this.hm=Do(e,t),this.$s.Os()),this.KS=a}Qs(e,t){if(this.qt===null||this.qt.lt===null)return null;for(let a=this.qt.lt.from;a<this.qt.lt.to;a++){let n=this.qt.ot[a];if(n&&uN(n,e,t))return{zOrder:"normal",externalId:n.te??"",itemType:"marker"}}return null}draw(e){this.KS!=="aboveSeries"&&e.useBitmapCoordinateSpace((t)=>{this.et(t)})}drawBackground(e){this.KS==="aboveSeries"&&e.useBitmapCoordinateSpace((t)=>{this.et(t)})}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:a}){if(this.qt!==null&&this.qt.lt!==null){e.textBaseline="middle",e.font=this.hm;for(let n=this.qt.lt.from;n<this.qt.lt.to;n++){let i=this.qt.ot[n];i.ri!==void 0&&(i.ri.nn=this.$s.Ii(e,i.ri.GS),i.ri.$t=this.F,i.ri._t=i._t-i.ri.nn/2),oN(i,e,t,a)}}}}function oN(e,t,a,n){t.fillStyle=e.R,e.ri!==void 0&&function(i,r,l,s,o,u){i.save(),i.scale(o,u),i.fillText(r,l,s),i.restore()}(t,e.ri.GS,e.ri._t,e.ri.ut,a,n),function(i,r,l){if(i.Th===0)return;switch(i.ZS){case"arrowDown":return void xw(!1,r,l,i.Th);case"arrowUp":return void xw(!0,r,l,i.Th);case"circle":return void function(s,o,u){let c=(wl("circle",u)-1)/2;s.beginPath(),s.arc(o._t,o.ut,c*o.YS,0,2*Math.PI,!1),s.fill()}(r,l,i.Th);case"square":return void function(s,o,u){let c=wl("square",u),f=(c-1)*o.YS/2,d=o._t-f,h=o.ut-f;s.fillRect(d,h,c*o.YS,c*o.YS)}(r,l,i.Th)}i.ZS}(e,t,function(i,r,l){let s=Math.max(1,Math.floor(r))%2/2;return{_t:Math.round(i._t*r)+s,ut:i.ut*l,YS:r}}(e,a,n))}function uN(e,t,a){return!(e.ri===void 0||!function(n,i,r,l,s,o){let u=l/2;return s>=n&&s<=n+r&&o>=i-u&&o<=i+u}(e.ri._t,e.ri.ut,e.ri.nn,e.ri.$t,t,a))||function(n,i,r){if(n.Th===0)return!1;switch(n.ZS){case"arrowDown":return yw(!0,n._t,n.ut,n.Th,i,r);case"arrowUp":return yw(!1,n._t,n.ut,n.Th,i,r);case"circle":return function(l,s,o,u,c){let f=2+wl("circle",o)/2,d=l-u,h=s-c;return Math.sqrt(d*d+h*h)<=f}(n._t,n.ut,n.Th,i,r);case"square":return function(l,s,o,u,c){let f=wl("square",o),d=(f-1)/2,h=l-d,g=s-d;return u>=h&&u<=h+f&&c>=g&&c<=g+f}(n._t,n.ut,n.Th,i,r)}}(e,t,a)}function bw(e){return e==="atPriceTop"||e==="atPriceBottom"||e==="atPriceMiddle"}function cN(e,t,a,n,i,r,l,s){let o=function(g,b,S){if(bw(b.position)&&b.price!==void 0)return b.price;if("value"in(p=g)&&typeof p.value=="number")return g.value;var p;if(function(x){return"open"in x&&"high"in x&&"low"in x&&"close"in x}(g)){if(b.position==="inBar")return g.close;if(b.position==="aboveBar")return S?g.low:g.high;if(b.position==="belowBar")return S?g.high:g.low}}(a,t,l.priceScale().options().invertScale);if(o===void 0)return;let u=bw(t.position),c=s.timeScale(),f=Zi(t.size)?Math.max(t.size,0):1,d=jk(c.options().barSpacing)*f,h=d/2;switch(e.Th=d,t.position){case"inBar":case"atPriceMiddle":return e.ut=z(l.priceToCoordinate(o)),void(e.ri!==void 0&&(e.ri.ut=e.ut+h+r+0.6*i));case"aboveBar":case"atPriceTop":{let g=u?0:n.XS;return e.ut=z(l.priceToCoordinate(o))-h-g,e.ri!==void 0&&(e.ri.ut=e.ut-h-0.6*i,n.XS+=1.2*i),void(u||(n.XS+=d+r))}case"belowBar":case"atPriceBottom":{let g=u?0:n.JS;return e.ut=z(l.priceToCoordinate(o))+h+g,e.ri!==void 0&&(e.ri.ut=e.ut+h+r+0.6*i,n.JS+=1.2*i),void(u||(n.JS+=d+r))}}}class Xk{constructor(e,t,a){this.QS=[],this.xt=!0,this.tx=!0,this.Xt=new Kk,this.Te=e,this.Gv=t,this.qt={ot:[],lt:null},this.yn=a}renderer(){if(!this.Te.options().visible)return null;this.xt&&this.Ig();let e=this.Gv.options().layout;return this.Xt.js(e.fontSize,e.fontFamily,this.yn.zOrder),this.Xt.ht(this.qt),this.Xt}ix(e){this.QS=e,this.Pt("data")}Pt(e){this.xt=!0,e==="data"&&(this.tx=!0)}nx(e){this.xt=!0,this.yn=e}zOrder(){return this.yn.zOrder==="aboveSeries"?"top":this.yn.zOrder}Ig(){let e=this.Gv.timeScale(),t=this.QS;this.tx&&(this.qt.ot=t.map((o)=>({wt:o.time,_t:0,ut:0,Th:0,ZS:o.shape,R:o.color,te:o.id,sx:o.sx,ri:void 0})),this.tx=!1);let a=this.Gv.options().layout;this.qt.lt=null;let n=e.getVisibleLogicalRange();if(n===null)return;let i=new Xi(Math.floor(n.from),Math.ceil(n.to));if(this.Te.dataByIndex(0,1)===null)return;if(this.qt.ot.length===0)return;let r=NaN,l=Yk(e.options().barSpacing),s={XS:l,JS:l};this.qt.lt=Mk(this.qt.ot,i,!0);for(let o=this.qt.lt.from;o<this.qt.lt.to;o++){let u=t[o];u.time!==r&&(s.XS=l,s.JS=l,r=u.time);let c=this.qt.ot[o];c._t=z(e.logicalToCoordinate(u.time)),u.text!==void 0&&u.text.length>0&&(c.ri={GS:u.text,_t:0,ut:0,nn:0,$t:0});let f=this.Te.dataByIndex(u.time,0);f!==null&&cN(c,u,f,s,a.fontSize,l,this.Te,this.Gv)}this.xt=!1}}function Sw(e){return{...sN,...e}}class Wk{constructor(e){this.Yh=null,this.QS=[],this.hx=[],this.lx=null,this.Te=null,this.Gv=null,this.ox=!0,this._x=null,this.ux=null,this.vx=null,this.mx=!0,this.yn=Sw(e)}attached(e){this.wx(),this.Gv=e.chart,this.Te=e.series,this.Yh=new Xk(this.Te,z(this.Gv),this.yn),this.jS=e.requestUpdate,this.Te.subscribeDataChanged((t)=>this.Qg(t)),this.mx=!0,this.DS()}DS(){this.jS&&this.jS()}detached(){this.Te&&this.lx&&this.Te.unsubscribeDataChanged(this.lx),this.Gv=null,this.Te=null,this.Yh=null,this.lx=null}ix(e){this.mx=!0,this.QS=e,this.wx(),this.ox=!0,this.ux=null,this.DS()}Mx(){return this.QS}paneViews(){return this.Yh?[this.Yh]:[]}updateAllViews(){this.gx()}hitTest(e,t){return this.Yh?this.Yh.renderer()?.Qs(e,t)??null:null}autoscaleInfo(e,t){if(this.yn.autoScale&&this.Yh){let a=this.bx();if(a)return{priceRange:null,margins:a}}return null}vr(e){this.yn=Sw({...this.yn,...e}),this.DS&&this.DS()}bx(){let e=z(this.Gv).timeScale().options().barSpacing;if(this.ox||e!==this.vx){if(this.vx=e,this.QS.length>0){let t=Yk(e),a=1.5*jk(e)+2*t,n=this.Sx();this._x={above:gw(a,n.aboveBar,n.inBar),below:gw(a,n.belowBar,n.inBar)}}else this._x=null;this.ox=!1}return this._x}Sx(){return this.ux===null&&(this.ux=this.QS.reduce((e,t)=>(e[t.position]||(e[t.position]=!0),e),{inBar:!1,aboveBar:!1,belowBar:!1,atPriceTop:!1,atPriceBottom:!1,atPriceMiddle:!1})),this.ux}wx(){if(!this.mx||!this.Gv||!this.Te)return;let e=this.Gv.timeScale(),t=this.Te?.data();if(e.getVisibleLogicalRange()==null||!this.Te||t.length===0)return void(this.hx=[]);let a=e.timeToIndex(z(t[0].time),!0);this.hx=this.QS.map((n,i)=>{let r=e.timeToIndex(n.time,!0),l=r<a?1:-1,s=z(this.Te).dataByIndex(r,l),o={time:e.timeToIndex(z(s).time,!1),position:n.position,shape:n.shape,color:n.color,id:n.id,sx:i,text:n.text,size:n.size,price:n.price,Qr:n.time};if(n.position==="atPriceTop"||n.position==="atPriceBottom"||n.position==="atPriceMiddle"){if(n.price===void 0)throw Error(`Price is required for position ${n.position}`);return{...o,position:n.position,price:n.price}}return{...o,position:n.position,price:n.price}}),this.mx=!1}gx(e){this.Yh&&(this.wx(),this.Yh.ix(this.hx),this.Yh.nx(this.yn),this.Yh.Pt(e))}Qg(e){this.mx=!0,this.DS()}}class Zk extends Gk{constructor(e,t,a){super(e,t),a&&this.setMarkers(a)}setMarkers(e){this.Jh.ix(e)}markers(){return this.Jh.Mx()}}function Jk(e,t,a){let n=new Zk(e,new Wk(a??{}));return t&&n.setMarkers(t),n}var FHt={...vw,color:"#2196f3"};var ye=qe(Je(),1);var $k=[{name:"login",description:"登录模型提供商",argumentHint:"[provider]"},{name:"logout",description:"移除模型提供商凭证",argumentHint:"[provider]"},{name:"model",description:"切换模型",argumentHint:"[provider/model-id]"},{name:"new",description:"开启新会话"},{name:"compact",description:"压缩当前上下文"},{name:"export",description:"导出会话 HTML",argumentHint:"[path]"},{name:"help",description:"列出可用指令"},{name:"exit",description:"关闭 WebUI 服务"}];var eI=qe(Je(),1);var tI=new So;var aI=eI.memo(function({entry:t}){let a=tI.resolve(t.name)??fN,n=hN(t.name),i=mN(t),r=pN(t.status);return C("details",{className:`timeline-item tool-call ${t.status}`,"aria-label":`${n}${i?` ${i}`:""},${r}`,children:[C("summary",{children:[m("strong",{children:n}),m("code",{children:i??""}),m("small",{children:r}),m(Ti,{size:14})]}),m("div",{className:"tool-details",children:a(t)})]})});function fN(e){return C(ht,{children:[m(af,{label:"参数",value:JSON.stringify(e.args,null,2)}),nI(e)]})}function dN(e){let t=iI(e.args,"command");return C(ht,{children:[m(af,{label:t?"命令":"参数",value:t??JSON.stringify(e.args,null,2)}),nI(e)]})}function nI(e){return C(ht,{children:[e.output?.text&&m(af,{label:"输出",value:e.output.text}),e.output?.imageTypes.map((t)=>C("span",{className:"image-output",children:["图像输出 · ",t]},t))]})}function iI(e,t){if(typeof e!=="object"||e===null||Array.isArray(e))return;let a=e[t];return typeof a==="string"?a:void 0}function hN(e){return e.split(/[-_]/).filter(Boolean).map((t)=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ")}function mN(e){for(let t of["path","file_path","filePath","command","pattern","query"]){let a=iI(e.args,t);if(a)return a}return}function pN(e){if(e==="running")return"执行中";if(e==="error")return"失败";return"完成"}tI.register("bash",dN);var Bf=ye.memo(function({agent:t,run:a,variant:n="default"}){let i=Z((S)=>S.agentStates[t]),r=Z((S)=>S.transcripts[t]),l=Z((S)=>S.search.trim().toLowerCase()),s=t==="strategy"?l:"",o=Z((S)=>S.timelineCompactness),u=ye.useRef(null),[c,f]=ye.useState(!0),d=ye.useMemo(()=>s?r.filter((S)=>vN(S).includes(s)):r,[s,r]),h=!s&&i.runtime.streaming&&!r.some((S)=>S.kind==="assistant"&&S.streaming),g=n==="market";return ye.useEffect(()=>{if(c)u.current?.scrollTo({top:u.current.scrollHeight})},[d,c]),C("main",{className:"transcript",ref:u,onScroll:()=>{let S=u.current;if(!S)return;f(S.scrollHeight-S.scrollTop-S.clientHeight<100)},style:CN(o),children:[C("div",{className:"transcript-inner",children:[d.length===0&&C("div",{className:"empty-state",children:[m(Sa,{size:24}),m("h1",{children:s?"没有匹配内容":g?"行情助手已就绪":"策略工作台已就绪"}),!s&&!g&&m("div",{className:"empty-actions",children:!i.runtime.authenticated&&C("button",{onClick:()=>void a({type:"login",agent:t}),children:[m(Hn,{size:16})," 配置模型"]})})]}),d.map((S)=>m(xN,{entry:S},S.id)),h&&m("div",{className:"assistant-wait timeline-item running",children:"正在准备响应..."})]}),!c&&C("button",{className:"jump-latest",onClick:()=>u.current?.scrollTo({top:u.current.scrollHeight,behavior:"smooth"}),children:[m(Ja,{size:16})," 最新消息"]})]})}),zf=ye.memo(function({agent:t,run:a,openCapabilities:n}){let i=Z((O)=>O.agentStates[t]),r=Z((O)=>O.notificationAgent===void 0||O.notificationAgent===t?O.notification:void 0),l=Z((O)=>O.dismissNotification),s=Z((O)=>O.timelineCompactness),o=Z((O)=>O.setTimelineCompactness),[u,c]=ye.useState(""),[f,d]=ye.useState([]),[h,g]=ye.useState(-1),[b,S]=ye.useState(0),[p,x]=ye.useState(!1),[y,w]=ye.useState(!1),[T,I]=ye.useState(!1),M=ye.useRef(null),R=ye.useRef(null),A=ye.useMemo(()=>{if(!u.startsWith("/")||u.includes(" "))return[];let O=u.slice(1).toLowerCase();return $k.filter((L)=>L.name.startsWith(O)).slice(0,6)},[u]),v=Z((O)=>O.transcripts[t].filter((L)=>L.kind==="user").length),F=i.models.find((O)=>O.ref===i.runtime.currentModel),H=i.stats.contextPercent===null?"--":`${Math.round(i.stats.contextPercent)}%`,B=`上下文 ${i.stats.contextTokens===null?"--":Rf(i.stats.contextTokens)} / ${i.stats.contextWindow?Rf(i.stats.contextWindow):"--"} tokens`;ye.useEffect(()=>S(0),[u]);let q=y||i.runtime.cancelling;ye.useEffect(()=>{if(i.runtime.cancelling)w(!1);if(q)M.current?.focus()},[i.runtime.cancelling,q]),ye.useEffect(()=>{if(!r)return;let O=r.kind==="success"?3000:r.kind==="info"?5000:6000,L=window.setTimeout(()=>l(r.id),O);return()=>window.clearTimeout(L)},[l,r]),ye.useEffect(()=>{if(!p)return;let O=(Te)=>{if(Te.key==="Escape")x(!1)},L=(Te)=>{if(R.current&&!R.current.contains(Te.target))x(!1)};return window.addEventListener("keydown",O),document.addEventListener("pointerdown",L),()=>{window.removeEventListener("keydown",O),document.removeEventListener("pointerdown",L)}},[p]);let V=async()=>{let O=u.trim();if(!O||T||i.runtime.busy&&!q)return;I(!0),c(""),d((L)=>[O,...L.filter((Te)=>Te!==O)].slice(0,50)),g(-1);try{await a({type:"submit",agent:t,text:O})}finally{I(!1),M.current?.focus()}},Y=()=>{if(q||!i.runtime.busy)return;w(!0),a({type:"cancel",agent:t}).finally(()=>w(!1))},se=(O,L)=>{c(`/${O}${L?" ":""}`),requestAnimationFrame(()=>M.current?.focus())},_e=(O)=>{if(O.nativeEvent.isComposing)return;if(A.length>0&&(O.key==="ArrowDown"||O.key==="ArrowUp")){O.preventDefault();let L=O.key==="ArrowDown"?1:-1;S((Te)=>(Te+L+A.length)%A.length);return}if(O.key==="Tab"&&A[b]){O.preventDefault(),se(A[b].name,A[b].argumentHint);return}if(O.key==="Enter"&&!O.shiftKey){if(O.preventDefault(),A[b]&&u.startsWith("/")&&!u.includes(" "))se(A[b].name,A[b].argumentHint);else V();return}if((O.key==="ArrowUp"||O.key==="ArrowDown")&&(u===""||h>=0)){O.preventDefault();let L=O.key==="ArrowUp"?Math.min(f.length-1,h+1):Math.max(-1,h-1);g(L),c(L<0?"":f[L]??"")}};return m("section",{className:"composer-wrap",children:C("div",{className:"composer-shell",children:[C("div",{className:`composer${i.runtime.busy?" busy":""}`,children:[A.length>0&&m("div",{className:"command-menu",children:A.map((O,L)=>C("button",{className:L===b?"active":"",onMouseDown:(Te)=>Te.preventDefault(),onClick:()=>se(O.name,O.argumentHint),children:[m(Ai,{size:15}),C("strong",{children:["/",O.name]}),m("span",{children:O.description}),m("small",{children:O.argumentHint})]},O.name))}),m("textarea",{ref:M,value:u,onChange:(O)=>c(O.target.value),onKeyDown:_e,disabled:T||i.runtime.busy&&!q,placeholder:i.runtime.authenticated?"输入消息或 / 命令":"登录后开始会话,或输入 /login",rows:1}),C("div",{className:"composer-toolbar",children:[m("div",{className:"composer-toolbar-left",children:C("span",{className:"composer-workspace",title:i.workspace,children:[m(Fs,{size:16}),C("span",{children:[m("small",{children:"工作区"}),m("strong",{children:LN(i.workspace)})]})]})}),C("div",{className:"composer-toolbar-right",children:[C("div",{className:"timeline-density-anchor",ref:R,children:[C("button",{type:"button",className:`timeline-density-toggle${p?" active":""}`,"aria-label":`设置时间线紧凑度(当前 ${s}%)`,"aria-expanded":p,title:"设置时间线紧凑度",onClick:()=>x((O)=>!O),children:[s,"%"]}),p&&C("div",{className:"timeline-density-popover",children:[m("div",{className:"timeline-density-heading",children:m("span",{children:"时间线紧凑度"})}),m("input",{"aria-label":"时间线紧凑度",type:"range",min:"0",max:"100",step:"5",value:s,onChange:(O)=>o(Number(O.target.value))})]})]}),C("label",{className:"select-control composer-control model-control",title:"当前模型",children:[C("select",{"aria-label":"模型",value:i.runtime.currentModel??"",disabled:i.runtime.busy||i.models.length===0,onChange:(O)=>void a({type:"select_model",agent:t,modelRef:O.target.value}),children:[!i.runtime.currentModel&&m("option",{value:"",children:"选择模型"}),i.runtime.currentModel&&!F&&m("option",{value:i.runtime.currentModel,children:i.runtime.currentModel}),i.models.map((O)=>m("option",{value:O.ref,children:O.name},O.ref))]}),m(Ja,{size:14})]}),C("label",{className:"select-control composer-control thinking-control",title:"思考等级",children:[m("select",{"aria-label":"思考等级",value:i.runtime.thinkingLevel,disabled:i.runtime.busy||i.runtime.thinkingLevels.length<2,onChange:(O)=>void a({type:"set_thinking",agent:t,level:O.target.value}),children:i.runtime.thinkingLevels.map((O)=>m("option",{value:O,children:wN(O)},O))}),m(Ja,{size:14})]}),m("span",{className:"composer-context",title:B,"aria-label":B,children:C("span",{children:[m("span",{className:"composer-context-label",children:"上下文 "}),H]})}),!i.runtime.authenticated&&C("button",{className:"button primary composer-login",onClick:()=>void a({type:"login",agent:t}),disabled:i.runtime.busy,children:[m(Ri,{size:16})," 登录"]}),i.runtime.busy&&!q?m(Qe,{label:"取消生成",className:"stop-button",icon:m(ra,{size:20}),onClick:Y}):m(Qe,{label:T?"正在发送":"发送",className:"send-button",icon:T?m(ot,{className:"spin",size:19}):m(Ks,{size:19}),disabled:T||!u.trim(),onClick:()=>void V()})]})]})]}),m("div",{className:"composer-meta","aria-label":r?"操作提示":"会话统计",children:r?m(gN,{notification:r}):C(ht,{children:[C("span",{className:`runtime-status ${i.runtime.statusKind}`,children:[i.runtime.busy?m(ot,{className:"spin",size:13}):m(Ii,{size:13}),q?"正在取消...":i.runtime.status||(i.runtime.authenticated?"会话就绪":"等待登录")]}),C("span",{children:[m(Bi,{size:13})," ",v," 轮"]}),C("button",{type:"button",onClick:n,"aria-label":`查看 ${i.capabilities.tools.length} 个工具`,children:[m(zi,{size:13})," ",i.capabilities.tools.length," 工具"]}),C("span",{children:["输入 ",Rf(i.stats.inputTokens)," · 输出 ",Rf(i.stats.outputTokens)]}),C("span",{children:["费用 $",i.stats.cost.toFixed(4)]})]})})]})})});function gN({notification:e}){let t=e.kind==="success"?m(ba,{size:13}):e.kind==="warning"?m(va,{size:13}):e.kind==="error"?m(wt,{size:13}):m(Us,{size:13});return C("div",{className:`composer-notification ${e.kind}`,role:e.kind==="error"?"alert":"status",title:e.text,children:[t,m("span",{children:e.text})]})}var xN=ye.memo(function({entry:t}){if(t.kind==="user")return m("article",{className:"message user-message timeline-item","aria-label":"你的消息",children:m("div",{className:"message-body",children:m("p",{children:t.text})})});if(t.kind==="assistant")return m(yN,{entry:t});return m(aI,{entry:t})});function yN({entry:e}){if(e.blocks.length===0&&!e.error)return null;return m("article",{className:`message assistant-message${e.streaming?" streaming":""}`,"aria-label":"AI 回复",children:C("div",{className:"message-body",children:[e.blocks.map((t,a)=>m(bN,{block:t,streaming:e.streaming},a)),e.error&&m("div",{className:"timeline-item error",children:C("div",{className:"inline-error",children:[m(wt,{size:15})," ",e.error]})})]})})}var bN=ye.memo(function({block:t,streaming:a}){return t.type==="thinking"?m(SN,{content:t.content,streaming:a}):m("div",{className:"timeline-item assistant-output",children:m(bo,{children:t.content})})});function SN({content:e,streaming:t}){return C("details",{className:`timeline-item thinking-block${t?" running":" done"}`,children:[C("summary",{children:[m("span",{children:t?"思考中":"思考"}),m(Ti,{size:14})]}),m("div",{children:m(bo,{children:e})})]})}var rI=new WeakMap;function vN(e){let t=rI.get(e);if(t!==void 0)return t;let a=e.kind==="user"?e.text.toLowerCase():e.kind==="assistant"?e.blocks.map((n)=>n.content).join(" ").toLowerCase():`${e.name} ${JSON.stringify(e.args)} ${e.output?.text??""}`.toLowerCase();return rI.set(e,a),a}function CN(e){let t=Number.isFinite(e)?Math.min(100,Math.max(0,e))/100:Js/100,a=(i,r)=>`${(i+(r-i)*t).toFixed(2)}px`,n=(i,r)=>(i+(r-i)*t).toFixed(2);return{"--timeline-line-height":n(1.72,1.38),"--timeline-thinking-line-height":n(1.62,1.34),"--timeline-code-line-height":n(1.55,1.3),"--timeline-heading-line-height":n(1.35,1.2),"--timeline-summary-line-height":n(1.4,1.2),"--timeline-item-padding":a(4,0.5),"--timeline-dot-offset":a(12,7.5),"--timeline-dot-left":a(3,5),"--timeline-dot-size":a(9,5),"--timeline-dot-ring":a(3,1.5),"--timeline-summary-height":a(26,18),"--timeline-summary-gap":a(7,3),"--thinking-content-margin":a(3,0),"--thinking-content-padding-top":a(3,0),"--thinking-content-padding-bottom":a(5,2),"--tool-details-gap":a(8,3),"--tool-details-margin":a(4,0),"--tool-details-padding-bottom":a(8,2),"--timeline-markdown-gap":a(13,7),"--timeline-inline-code-padding":a(2,1),"--timeline-markdown-pre-padding":a(14,7),"--timeline-table-cell-padding":a(7,3),"--timeline-code-padding-top":a(10,5),"--timeline-code-pre-padding":a(10,5),"--timeline-inline-error-margin":a(10,5),"--timeline-inline-error-padding":a(9,5),"--assistant-wait-height":a(34,24)}}function LN(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function wN(e){return{off:"关闭",minimal:"极简",low:"低",medium:"中",high:"高",xhigh:"极高"}[e]??e}function Rf(e){if(e<1000)return String(e);if(e<1e6)return`${lI(e/1000)}k`;return`${lI(e/1e6)}m`}function lI(e){return e.toFixed(1).replace(/\.0$/,"")}function sI(e,t,a){return!a&&e!==t}function oI(e,t,a){if(t.length===0||a.length===0)return e;let n=new Map(a.map((i,r)=>[i,r]));for(let i=0;i<t.length;i+=1){let r=n.get(t[i]);if(r===void 0)continue;let l=r-i;return l===0?e:{from:e.from+l,to:e.to+l}}return e}var kN={"1min":60,"5min":300,"15min":900};function _f(e,t){return e+kN[t]}var st=qe(Je(),1);var hx=["#dc2626","#ea580c","#a16207","#16a34a","#0891b2","#2563eb","#8b5cf6","#c026d3"],uI="vibek.webui.strategySmaIndicators";function mx(e){let[t,a]=st.useState(()=>e?TN(e):[]);st.useEffect(()=>{if(e)EN(e,t)},[t,e]);let n=st.useCallback((r)=>{a((l)=>IN(l,r))},[]),i=st.useCallback((r)=>{a((l)=>l.filter((s)=>s.period!==r))},[]);return{indicators:t,add:n,remove:i}}function IN(e,t,a=Math.random){if(!Of(t)||e.some((n)=>n.period===t))return[...e];return[...e,{period:t,color:DN(e,a)}]}function MN(e,t){if(!Of(t)||e.length<t)return[];let a=[],n=0;for(let i=0;i<e.length;i+=1){if(n+=e[i].close,i>=t)n-=e[i-t].close;if(i>=t-1)a.push({time:e[i].time,value:n/t})}return a}function Oo(e,t,a,n){let i=new Set(a.map((r)=>r.period));for(let[r,l]of t){if(i.has(r))continue;e.removeSeries(l),t.delete(r)}for(let r of a){let l=t.get(r.period);if(!l)l=e.addSeries(Af,{color:r.color,lineWidth:1,priceLineVisible:!1,lastValueVisible:!1,crosshairMarkerVisible:!1}),t.set(r.period,l);else l.applyOptions({color:r.color});l.setData(MN(n,r.period))}}function Nf({controller:e,align:t="start"}){let[a,n]=st.useState(!1),[i,r]=st.useState(""),[l,s]=st.useState(),o=st.useRef(null),u=st.useRef(null),c=st.useId(),f=st.useId();st.useEffect(()=>{if(!a)return;u.current?.focus();let h=(b)=>{if(b.key==="Escape")n(!1)},g=(b)=>{if(o.current&&!o.current.contains(b.target))n(!1)};return window.addEventListener("keydown",h),document.addEventListener("pointerdown",g),()=>{window.removeEventListener("keydown",h),document.removeEventListener("pointerdown",g)}},[a]);let d=(h)=>{h.preventDefault();let g=Number(i);if(!Of(g)){s("周期必须是正整数");return}if(e.indicators.some((b)=>b.period===g)){s(`SMA${g} 已添加`);return}e.add(g),r(""),s(void 0),u.current?.focus()};return C("div",{ref:o,className:`sma-tool ${t}`,children:[C("button",{type:"button",className:`sma-tool-toggle${a?" active":""}`,"aria-label":"管理 SMA","aria-controls":c,"aria-expanded":a,title:"管理 SMA",onClick:()=>{n((h)=>!h),s(void 0)},children:[m(Ns,{size:14}),m("span",{children:"SMA"}),e.indicators.length>0&&m("small",{children:e.indicators.length})]}),a&&C("div",{id:c,className:"sma-tool-popover",role:"dialog","aria-label":"SMA 指标",children:[C("form",{className:"sma-tool-form",onSubmit:d,children:[m("input",{ref:u,type:"number",min:"1",step:"1",inputMode:"numeric",value:i,"aria-label":"SMA 周期","aria-invalid":Boolean(l),"aria-describedby":l?f:void 0,placeholder:"周期",onChange:(h)=>{r(h.target.value),s(void 0)}}),m("button",{type:"submit",className:"sma-tool-add","aria-label":"添加 SMA",title:"添加 SMA",children:m(la,{size:15})})]}),l&&m("p",{id:f,className:"sma-tool-error",role:"alert",children:l}),e.indicators.length>0&&m("ul",{className:"sma-tool-list","aria-label":"已添加的 SMA",children:e.indicators.map((h)=>C("li",{children:[m("i",{style:{backgroundColor:h.color}}),C("span",{children:["SMA",h.period]}),m("button",{type:"button","aria-label":`删除 SMA${h.period}`,title:`删除 SMA${h.period}`,onClick:()=>e.remove(h.period),children:m(sa,{size:13})})]},h.period))})]})]})}function Of(e){return Number.isSafeInteger(e)&&e>0}function TN(e){try{let t=globalThis.localStorage?.getItem(e);if(!t)return[];let a=JSON.parse(t);if(!Array.isArray(a))return[];let n=new Set;return a.filter((i)=>{if(!AN(i)||n.has(i.period))return!1;return n.add(i.period),!0})}catch{return[]}}function AN(e){if(!e||typeof e!=="object")return!1;let t=e;return typeof t.period==="number"&&Of(t.period)&&hx.some((a)=>a===t.color)}function EN(e,t){try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch{}}function DN(e,t){let a=new Set(e.map((s)=>s.color)),n=hx.filter((s)=>!a.has(s)),i=n.length>0?n:hx,r=Math.floor(t()*i.length),l=Math.max(0,Math.min(i.length-1,r));return i[l]}var RN=500,BN=[{value:"1min",label:"1m"},{value:"5min",label:"5m"},{value:"15min",label:"15m"}];function fI({run:e,sma:t,openCapabilities:a=()=>{return}}){let n=ke((v)=>v.connection),i=ke((v)=>v.subscriptions),r=ke((v)=>v.selectedInstrumentID),l=ke((v)=>v.timeframe),s=ke((v)=>v.bars),o=ke((v)=>v.latest),u=ke((v)=>v.loading),c=ke((v)=>v.error),f=ke((v)=>v.statusRevision),[d,h]=Me.useState(""),g=Me.useCallback(async(v,F)=>{let H=ke.getState();H.setLoading(!0);let B=await e({type:"get_market_bars",instrumentID:v,timeframe:F,limit:RN});if(B?.timeframe===F){H.setBars(B.instrumentID,F,B.bars);return}let q=ke.getState();if(q.selectedInstrumentID===v&&q.timeframe===F)q.setError(`无法加载 ${Pf(F)} K 线`)},[e]),b=Me.useCallback(async(v)=>{let F=ke.getState(),H=F.selectedInstrumentID;if(F.selectInstrument(v),F.setLoading(!0),!await e({type:"market_subscribe",instrumentIDs:[v]})){F.setError("无法订阅当前合约行情");return}if(await g(v,ke.getState().timeframe),H&&H!==v)await e({type:"market_unsubscribe",instrumentIDs:[H]})},[g,e]),S=Me.useCallback((v)=>{let F=ke.getState();if(F.timeframe===v)return;if(F.setTimeframe(v),F.selectedInstrumentID)g(F.selectedInstrumentID,v)},[g]);Me.useEffect(()=>{let v=!0;return(async()=>{let F=await e({type:"get_market_subscriptions"});if(!v||!F)return;let H=ke.getState().selectedInstrumentID;ke.getState().setSubscriptions(F);let B=F.subscriptions.find((q)=>q.status==="active")??F.subscriptions[0];if(H&&F.subscriptions.some((q)=>q.instrumentID===H))await b(H);else if(B)await b(B.instrumentID)})(),()=>{v=!1}},[n,e,b,f]),Me.useEffect(()=>()=>{let v=ke.getState().selectedInstrumentID;if(v)e({type:"market_unsubscribe",instrumentIDs:[v]})},[e]);let p=Me.useMemo(()=>{let v=d.trim().toUpperCase();return v?i.filter((F)=>F.instrumentID.includes(v)||F.vtSymbol.includes(v)):i},[d,i]),x=i.find((v)=>v.instrumentID===r),y=s.at(-1),w=s.at(-2),T=o?.lastPrice??y?.close,I=w?.close,M=T!==void 0&&I!==void 0?T-I:void 0,R=M===void 0||M===0?"":M>0?"up":"down",A=PN(o?.priceTick??0.01);return C("main",{className:"market-workspace",children:[C("aside",{className:"market-instruments",children:[C("header",{className:"market-panel-header",children:[C("div",{children:[m(Hs,{size:16}),m("strong",{children:"行情订阅"}),m("span",{children:i.length})]}),C("label",{className:"market-search",children:[m(Ca,{size:14}),m("input",{value:d,onChange:(v)=>h(v.target.value),placeholder:"搜索合约"})]})]}),C("div",{className:"instrument-list",children:[p.map((v)=>C("button",{className:v.instrumentID===r?"selected":"",onClick:()=>void b(v.instrumentID),children:[C("span",{children:[m("strong",{children:v.instrumentID}),m("small",{children:v.exchangeID})]}),m("i",{className:`subscription-dot ${v.status}`}),m("em",{children:ON(v.status)})]},v.instrumentID)),p.length===0&&m(cI,{text:n==="connected"?"暂无可用行情订阅":"daemon 行情未连接"})]})]}),C("section",{className:"market-chart-panel",children:[C("header",{className:"market-chart-header",children:[C("div",{className:"market-symbol",children:[m(qt,{size:18}),C("span",{children:[m("strong",{children:x?.instrumentID??"K 线"}),m("small",{children:x?.exchangeID??"选择合约"})]}),m("div",{className:"market-timeframes",role:"group","aria-label":"K 线周期",children:BN.map((v)=>m("button",{className:v.value===l?"selected":"","aria-pressed":v.value===l,title:Pf(v.value),onClick:()=>S(v.value),children:v.label},v.value))}),m(Nf,{controller:t})]}),y&&C("div",{className:"market-ohlc",children:[C("span",{children:["开 ",m("b",{children:kl(y.open,A)})]}),C("span",{children:["高 ",m("b",{className:"up",children:kl(y.high,A)})]}),C("span",{children:["低 ",m("b",{className:"down",children:kl(y.low,A)})]}),C("span",{children:["收 ",m("b",{children:kl(y.close,A)})]}),C("span",{children:["量 ",m("b",{children:qN(y.volume)})]})]}),C("div",{className:"market-last",children:[m("strong",{className:R,children:T===void 0?"--":kl(T,A)}),m("span",{className:R,children:M===void 0?"--":`${FN(M,A)} ${UN(M/I*100)}`}),m("small",{children:o?HN(o.eventTimeMs):y?VN(_f(y.barTime,l)):"--"})]})]}),C("div",{className:"market-chart-body",children:[r&&m(_N,{instrumentID:r,timeframe:l,bars:s,loading:u,sma:t}),!r&&m(cI,{text:"从订阅列表选择合约"}),r&&s.length===0&&!u&&C("div",{className:"chart-empty",children:[m(nl,{size:20}),m("span",{children:`暂无 ${Pf(l)} K 线数据`})]})]}),C("footer",{className:"market-chart-footer",children:[C("span",{children:[s.length," 根"]}),c&&m("span",{className:"market-error",children:c}),m("span",{children:"CTP 快照 · 约 500ms"})]})]}),m(zN,{run:e,openCapabilities:a})]})}function zN({run:e,openCapabilities:t}){let a=Z((r)=>r.agentStates?.market.runtime),n=a?.busy?"处理中":a?.authenticated?"在线":"待登录",i=a?.statusKind??"idle";return C("aside",{className:"market-assistant","aria-label":"AI 助手",children:[C("header",{className:"market-assistant-header",children:[C("div",{className:"market-assistant-title",children:[m("span",{className:"market-assistant-icon",children:m(Mi,{size:17})}),C("span",{children:[m("strong",{children:"AI 助手"}),m("small",{children:"当前会话"})]})]}),C("span",{className:`market-assistant-status ${i}`,children:[m("i",{}),n]})]}),m("div",{className:"market-assistant-transcript",children:m(Bf,{agent:"market",run:e,variant:"market"})}),m("div",{className:"market-assistant-composer",children:m(zf,{agent:"market",run:e,openCapabilities:t})})]})}function _N({instrumentID:e,timeframe:t,bars:a,loading:n,sma:i}){let r=Vn((S)=>S.theme),l=`${e}:${t}`,s=Me.useRef(null),o=Me.useRef(null),u=Me.useRef(null),c=Me.useRef(null),f=Me.useRef(new Map),d=Me.useRef(""),h=Me.useRef([]),[g,b]=Me.useState("");return Me.useEffect(()=>{let S=s.current;if(!S)return;let p=Gn(Vn.getState().theme).chart,x=Tf(S,{width:S.clientWidth,height:S.clientHeight,layout:{background:{type:er.Solid,color:p.background},textColor:p.text,fontFamily:"Inter, ui-sans-serif, system-ui, sans-serif",fontSize:11,attributionLogo:!0,panes:{separatorColor:p.separator,separatorHoverColor:p.crosshair,enableResize:!0}},grid:{vertLines:{color:p.grid},horzLines:{color:p.grid}},crosshair:{mode:Ji.Normal,vertLine:{color:p.crosshair},horzLine:{color:p.crosshair}},rightPriceScale:{borderColor:p.border,minimumWidth:72},timeScale:{borderColor:p.border,timeVisible:!0,secondsVisible:!1,rightOffset:5,barSpacing:8,minBarSpacing:3,tickMarkFormatter:(I)=>GN(I)},localization:{locale:"zh-CN",timeFormatter:(I)=>QN(I)}}),y=x.addSeries(Ef,{upColor:p.candleUp,downColor:p.candleDown,borderUpColor:p.candleUp,borderDownColor:p.candleDown,wickUpColor:p.candleUp,wickDownColor:p.candleDown,priceLineColor:p.priceLine}),w=x.addSeries(Df,{priceFormat:{type:"volume"},priceLineVisible:!1,lastValueVisible:!1},1);x.panes()[1]?.setHeight(Math.max(80,Math.round(S.clientHeight*0.22))),o.current=x,u.current=y,c.current=w;let T=new ResizeObserver((I)=>{let M=I[0];if(!M)return;let R=Math.floor(M.contentRect.width),A=Math.floor(M.contentRect.height);if(R<=0||A<=0)return;x.applyOptions({width:R,height:A}),x.panes()[1]?.setHeight(Math.max(80,Math.round(A*0.22)))});return T.observe(S),()=>{T.disconnect(),x.remove(),o.current=null,u.current=null,c.current=null,f.current.clear()}},[]),Me.useEffect(()=>{let S=o.current,p=u.current;if(!S||!p)return;NN(S,p,Gn(r).chart)},[r]),Me.useEffect(()=>{let S=o.current,p=S?.timeScale().getVisibleLogicalRange(),x=h.current,y=a.map((M)=>M.barTime),w=Gn(r).chart,T=a.map((M)=>({time:_f(M.barTime,t),open:M.open,high:M.high,low:M.low,close:M.close})),I=a.map((M)=>({time:_f(M.barTime,t),value:M.volume,color:M.close>=M.open?w.volumeUp:w.volumeDown}));if(u.current?.setData(T),c.current?.setData(I),S)Oo(S,f.current,i.indicators,T);if(h.current=y,a.length===0){d.current="",b("");return}if(sI(d.current,l,n))d.current=l,o.current?.timeScale().setVisibleLogicalRange({from:Math.max(0,a.length-120),to:a.length+5}),b(l);else if(d.current===l&&p)o.current?.timeScale().setVisibleLogicalRange(oI(p,x,y))},[a,n,l,i.indicators,r,t]),C(ht,{children:[m("div",{ref:s,className:"kline-chart","aria-label":`${e} ${Pf(t)} K 线`}),g!==l&&(n||a.length>0)&&C("div",{className:"chart-empty",children:[m(ot,{className:"spin",size:20}),m("span",{children:"正在加载 K 线"})]})]})}function NN(e,t,a){e.applyOptions({layout:{background:{type:er.Solid,color:a.background},textColor:a.text,panes:{separatorColor:a.separator,separatorHoverColor:a.crosshair}},grid:{vertLines:{color:a.grid},horzLines:{color:a.grid}},crosshair:{mode:Ji.Normal,vertLine:{color:a.crosshair},horzLine:{color:a.crosshair}},rightPriceScale:{borderColor:a.border},timeScale:{borderColor:a.border}}),t.applyOptions({upColor:a.candleUp,downColor:a.candleDown,borderUpColor:a.candleUp,borderDownColor:a.candleDown,wickUpColor:a.candleUp,wickDownColor:a.candleDown,priceLineColor:a.priceLine})}function cI({text:e}){return C("div",{className:"market-empty",children:[m(nl,{size:20}),m("span",{children:e})]})}function ON(e){if(e==="active")return"运行中";if(e==="pending")return"确认中";return"未运行"}function Pf(e){if(e==="1min")return"1 分钟";if(e==="5min")return"5 分钟";return"15 分钟"}function PN(e){let t=String(e);if(t.includes("e-"))return Number(t.split("e-")[1]);return t.includes(".")?t.length-t.indexOf(".")-1:0}function kl(e,t){return e.toFixed(t)}function qN(e){return new Intl.NumberFormat("zh-CN").format(e)}function FN(e,t){return`${e>0?"+":""}${kl(e,t)}`}function UN(e){return`${e>0?"+":""}${e.toFixed(2)}%`}function HN(e){let t=new Date(e);return`${jN.format(t)}.${String(t.getUTCMilliseconds()).padStart(3,"0")}`}function VN(e){return YN.format(new Date(e*1000))}function GN(e){return KN.format(new Date(dI(e)*1000))}function QN(e){return XN.format(new Date(dI(e)*1000))}function dI(e){if(typeof e==="number")return e;if(typeof e==="string")return Math.floor(new Date(e).getTime()/1000);return Math.floor(Date.UTC(e.year,e.month-1,e.day)/1000)}var jN=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),YN=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}),KN=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",hour12:!1}),XN=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});var le=qe(Je(),1);function xx(e){if(!hI(e)||e.schema!=="vibek.backtest-contract/v1")return!1;try{return WN(e),!0}catch{return!1}}function WN(e){let t=gx(e.margin,"合约规格缺少 margin"),a=gx(e.commission,"合约规格缺少 commission");return ZN({schema:"vibek.backtest-contract/v1",vtSymbol:JN(e.vtSymbol,"vtSymbol"),priceTick:Il(e.priceTick,"priceTick"),multiplier:Il(e.multiplier,"multiplier"),margin:{longRatio:Il(t.longRatio,"margin.longRatio"),shortRatio:Il(t.shortRatio,"margin.shortRatio")},commission:{open:px(a.open,"commission.open"),close:px(a.close,"commission.close"),closeToday:px(a.closeToday,"commission.closeToday")}})}function ZN(e){let t=e.vtSymbol.trim().toUpperCase();if(!/^[A-Z]+\d+\.[A-Z]+$/.test(t))throw Error(`合约代码非法: ${e.vtSymbol}`);if(e.priceTick<=0)throw Error("priceTick 必须大于 0");if(!Number.isInteger(e.multiplier)||e.multiplier<=0)throw Error("multiplier 必须是正整数");if(e.margin.longRatio<=0||e.margin.shortRatio<=0)throw Error("多空保证金率必须大于 0");for(let[a,n]of Object.entries(e.commission))if(n.ratioByMoney<0||n.perLot<0)throw Error(`${a} 手续费率不能为负数`);return{...e,vtSymbol:t}}function px(e,t){let a=gx(e,`合约规格缺少 ${t}`);return{ratioByMoney:Il(a.ratioByMoney,`${t}.ratioByMoney`),perLot:Il(a.perLot,`${t}.perLot`)}}function gx(e,t){if(!hI(e))throw Error(t);return e}function Il(e,t){if(!eO(e))throw Error(`${t} 必须是有限数字`);return e}function JN(e,t){if(!$N(e))throw Error(`${t} 必须是非空字符串`);return e}function hI(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function $N(e){return typeof e==="string"&&e.length>0}function eO(e){return typeof e==="number"&&Number.isFinite(e)}var mI=["1min","5min","15min"],tO={"1min":60000,"5min":300000,"15min":900000};function yx(e,t){let a=tO[t];return Math.floor(e/a)*a}function pI(e,t){if(t==="1min")return e.map((n)=>({...n}));let a=[];for(let n of e){let i=yx(n.timestampMs,t),r=a[a.length-1];if(!r||r.timestampMs!==i){a.push({...n,timestampMs:i});continue}if(r.high=Math.max(r.high,n.high),r.low=Math.min(r.low,n.low),r.close=n.close,r.volume+=n.volume,n.boundaryReason===void 0)delete r.boundaryReason;else r.boundaryReason=n.boundaryReason}return a}function gI(e,t){if(t==="1min")return e.map((n)=>({...n}));let a=[];for(let n of e){let i=yx(n.timestampMs,t),r={...n,timestampMs:i},l=a[a.length-1];if(!l||l.timestampMs!==i)a.push(r);else a[a.length-1]=r}return a}function xI(e,t){let a=new Map;for(let n of e){let i=yx(n.timestampMs,t),r=`${i}:${n.side}`,l=a.get(r);if(l)l.trades.push(n);else a.set(r,{timestampMs:i,side:n.side,trades:[n]})}return[...a.values()].sort((n,i)=>n.timestampMs-i.timestampMs||n.side.localeCompare(i.side))}var aO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",year:"numeric"}),nO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit"}),iO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit"}),rO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",hour12:!1}),lO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),sO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});function yI(e,t){let a=new Date(SI(e)*1000);switch(t){case ei.Year:return aO.format(a);case ei.Month:return nO.format(a);case ei.DayOfMonth:return iO.format(a);case ei.TimeWithSeconds:return lO.format(a);case ei.Time:return rO.format(a)}}function bI(e){return sO.format(new Date(SI(e)*1000))}function SI(e){if(typeof e==="number")return e;if(typeof e==="string")return Math.floor(new Date(e).getTime()/1000);return Math.floor(Date.UTC(e.year,e.month-1,e.day)/1000)}var oO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),uO=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),cO=new Intl.NumberFormat("zh-CN",{maximumFractionDigits:8,minimumFractionDigits:0}),fO={open:"开仓",close:"平仓",closeToday:"平今",closeYesterday:"平昨"};function dO(e){let t=e.reduce((a,n)=>({quantity:a.quantity+n.quantity,notional:a.notional+n.price*n.quantity,commission:a.commission+n.commission,slippageCost:a.slippageCost+n.slippageCost}),{quantity:0,notional:0,commission:0,slippageCost:0});return{quantity:t.quantity,averagePrice:t.quantity>0?t.notional/t.quantity:0,commission:t.commission,slippageCost:t.slippageCost}}function vI({buyColor:e,groups:t,sellColor:a}){return m("div",{className:"backtest-trade-tooltip",role:"tooltip","aria-label":"成交详情",children:t.map((n)=>{let i=dO(n.trades),r=n.trades[0],l=n.side==="buy"?"买入":"卖出",s=n.trades.some((f)=>f.origin==="marginLiquidation")?`强平${l}`:l,o=[...new Set(n.trades.map((f)=>fO[f.offset]))].join("/"),u=n.trades.length===1?`${Ml(i.quantity)}手 @ ${Ml(r.price)}`:`${n.trades.length}笔 ${Ml(i.quantity)}手 · 均价 ${Ml(i.averagePrice)}`,c={"--trade-color":n.side==="buy"?e:a};return C("p",{style:c,children:[m("time",{dateTime:new Date(r.timestampMs).toISOString(),children:hO(n.trades)})," ",m("strong",{children:s})," · ",o," · ",u," · ","手续费 ",Ml(i.commission)," / 滑点 ",Ml(i.slippageCost)]},`${n.timestampMs}:${n.side}`)})})}function hO(e){let t=e[0].timestampMs,a=t;for(let i of e)t=Math.min(t,i.timestampMs),a=Math.max(a,i.timestampMs);let n=oO.format(new Date(t));return t===a?n:`${n}–${uO.format(new Date(a))}`}function Ml(e){return cO.format(e)}function wI({run:e,openCapabilities:t,sma:a}){let n=Z((J)=>J.strategy),i=Z((J)=>J.agentStates.strategy.runtime.busy),r=Z((J)=>J.agentStates.strategy.workspace),l=n.files.find((J)=>J.file===n.activeFile),s=Z((J)=>l?J.backtestResults[l.file]:void 0),[o,u]=le.useState(),[c,f]=le.useState(),[d,h]=le.useState("charts"),[g,b]=le.useState("1min"),[S,p]=le.useState(!0),[x,y]=le.useState(!1),[w,T]=le.useState(),[I,M]=le.useState("recorded"),[R,A]=le.useState(""),[v,F]=le.useState(1e6),[H,B]=le.useState(1),[q,V]=le.useState(wO()),[Y,se]=le.useState(!1);le.useEffect(()=>{if(u(void 0),!l)return;let J=!0;if(e({type:"get_strategy_code",file:l.file}).then((k)=>{if(J&&CI(k))u(k)}),l.latestBacktest)e({type:"get_backtest_result",file:l.file});return()=>{J=!1}},[l?.file,l?.sourceHashSha256,e]),le.useEffect(()=>{if(!l||s?.file!==l.file)return;V(s.result.input.contract),F(s.result.input.account.initialCapital),B(s.result.input.costs.slippageTicks)},[l?.file,s]);let _e=()=>{if(!l)return;let J={source:I==="recorded"?{type:"recorded"}:{type:"csv",path:R.trim()},initialCapital:v,slippageTicks:H,contract:q};e({type:"run_backtest",file:l.file,request:J})},O=async()=>{if(!q.vtSymbol.trim()||Y)return;se(!0);try{let J=await e({type:"get_backtest_contract",vtSymbol:q.vtSymbol.trim()});if(xx(J))V(J)}finally{se(!1)}},L=async()=>{if(!l)return;let J=await e({type:"download_backtest",file:l.file});if(!J?.downloadUrl)return;let k=document.createElement("a");k.href=J.downloadUrl,k.click()},Te=async()=>{if(!l)return;try{if(!navigator.clipboard)throw Error("Clipboard API unavailable");await navigator.clipboard.writeText(LO(r,l.file)),f(l.file)}catch{Z.getState().reportError("复制策略路径失败,请检查浏览器剪贴板权限")}};return C("main",{className:`strategy-workspace${S?"":" inspector-only"}`,children:[C("aside",{className:"strategy-files","aria-label":"策略文件",hidden:!S,children:[C("header",{children:[C("div",{children:[m($a,{size:17}),m("strong",{children:"策略文件"}),m("span",{children:n.files.length})]}),C("div",{children:[m(Qe,{label:"刷新策略",icon:m(tl,{size:15}),onClick:()=>void e({type:"refresh_strategies"})}),m(Qe,{label:"新建策略",icon:m(la,{size:17}),onClick:()=>y(!0)})]})]}),C("div",{className:"strategy-file-list",children:[n.files.map((J)=>m("button",{className:J.file===n.activeFile?"selected":"",onClick:()=>void e({type:"select_strategy",file:J.file}),children:C("span",{children:[m("strong",{children:J.file}),m("small",{children:CO(J)})]})},J.file)),n.files.length===0&&C("button",{className:"strategy-create-first",onClick:()=>y(!0),children:[m(la,{size:17}),"新建策略"]})]})]}),C("section",{className:"strategy-conversation","aria-label":"策略 AI",hidden:!S,children:[C("header",{className:"strategy-panel-header",children:[C("span",{children:[m(Pn,{size:16}),m("strong",{children:l?.file??"未选择策略"})]}),l&&C("div",{className:"strategy-panel-actions",children:[m(Qe,{label:c===l.file?"已复制策略路径":"复制策略路径",icon:c===l.file?m(kt,{size:15}):m(Ps,{size:15}),active:c===l.file,onClick:()=>void Te()}),m(Qe,{label:`删除 ${l.file}`,icon:m(en,{size:15}),className:"strategy-delete-button",disabled:i||n.run.status==="running",onClick:()=>T(l.file)})]})]}),l?C(ht,{children:[m(Bf,{agent:"strategy",run:e}),m(zf,{agent:"strategy",run:e,openCapabilities:t})]}):C("div",{className:"strategy-no-selection",children:[m($a,{size:24}),m("span",{children:"新建或选择策略"})]})]}),C("section",{className:"strategy-inspector","aria-label":"策略检查器",children:[C("header",{className:"strategy-inspector-header",children:[C("div",{className:"strategy-view-tabs",role:"tablist","aria-label":"策略视图",children:[C("button",{type:"button",id:"strategy-charts-tab",role:"tab","aria-controls":"strategy-charts-panel","aria-selected":d==="charts",className:d==="charts"?"active":"",onClick:()=>h("charts"),children:[m(qt,{size:15}),"图表"]}),C("button",{type:"button",id:"strategy-report-tab",role:"tab","aria-controls":"strategy-report-panel","aria-selected":d==="report",className:d==="report"?"active":"",onClick:()=>h("report"),children:[m(qs,{size:15}),"报告"]}),C("button",{type:"button",id:"strategy-code-tab",role:"tab","aria-controls":"strategy-code-panel","aria-selected":d==="code",className:d==="code"?"active":"",onClick:()=>h("code"),children:[m(Za,{size:15}),"代码"]})]}),C("div",{className:"strategy-inspector-actions",children:[m(mO,{active:l,runState:n.run,source:I,csvPath:R,initialCapital:v,slippageTicks:H,contract:q,contractLoading:Y,hasResult:Boolean(l?.latestBacktest),setSource:M,setCsvPath:A,setInitialCapital:F,setSlippageTicks:B,setContract:V,resolveContract:()=>void O(),runBacktest:_e,cancel:()=>l&&void e({type:"cancel_backtest",file:l.file}),download:()=>void L()}),d==="code"&&l&&m(Qe,{label:"刷新代码",icon:m(Ys,{size:15}),onClick:()=>{e({type:"get_strategy_code",file:l.file}).then((J)=>{if(CI(J))u(J)})}}),m(Qe,{label:S?"收起策略编辑区":"展开策略编辑区",icon:S?m(Fn,{size:16}):m(Un,{size:16}),expanded:S,onClick:()=>p((J)=>!J)})]})]}),C("div",{id:`strategy-${d}-panel`,className:`strategy-tab-panel ${d}`,role:"tabpanel","aria-labelledby":`strategy-${d}-tab`,children:[d==="charts"&&m(pO,{active:l,result:s,runState:n.run,sma:a,timeframe:g,setTimeframe:b}),d==="report"&&m(gO,{active:l,result:s,runState:n.run}),d==="code"&&m(bO,{code:o,active:l})]})]}),x&&m(SO,{run:e,onClose:()=>y(!1)}),w&&m(vO,{file:w,run:e,onClose:()=>T(void 0)})]})}function mO({active:e,runState:t,source:a,csvPath:n,initialCapital:i,slippageTicks:r,contract:l,contractLoading:s,hasResult:o,setSource:u,setCsvPath:c,setInitialCapital:f,setSlippageTicks:d,setContract:h,resolveContract:g,runBacktest:b,cancel:S,download:p}){let[x,y]=le.useState(!1),w=le.useRef(null),T=le.useId(),I=t.status==="running"&&t.file===e?.file,M=t.status==="running",R=Boolean(e&&e.size>0&&i>0&&Number.isInteger(r)&&r>=0&&xx(l)&&(a!=="csv"||n.trim()));return le.useEffect(()=>{if(!x)return;let A=(F)=>{if(F.key==="Escape")y(!1)},v=(F)=>{if(w.current&&!w.current.contains(F.target))y(!1)};return window.addEventListener("keydown",A),document.addEventListener("pointerdown",v),()=>{window.removeEventListener("keydown",A),document.removeEventListener("pointerdown",v)}},[x]),C(ht,{children:[C("div",{ref:w,className:"backtest-settings-anchor",children:[m(Qe,{label:"回测设置",icon:m(Xs,{size:15}),active:x,expanded:x,onClick:()=>y((A)=>!A)}),x&&m("div",{id:T,className:"backtest-settings-popover",role:"dialog","aria-label":"回测设置",children:C("div",{className:"backtest-settings-grid",children:[C("label",{className:"backtest-source",children:[m("span",{children:"数据源"}),C("select",{value:a,disabled:M,onChange:(A)=>u(A.target.value),children:[m("option",{value:"recorded",children:"录制数据"}),m("option",{value:"csv",children:"CSV 文件"})]})]}),a==="csv"&&C("label",{className:"backtest-csv",children:[m("span",{children:"CSV 文件"}),m("input",{value:n,disabled:M,onChange:(A)=>c(A.target.value),placeholder:"/path/to/bars.csv"})]}),m(bx,{children:"账户"}),m(ti,{label:"初始资金",min:0.01,value:i,disabled:M,onChange:f}),m(ti,{label:"滑点 tick",min:0,step:1,value:r,disabled:M,onChange:d}),m(bx,{children:"合约规格"}),C("label",{className:"backtest-contract-symbol",children:[m("span",{children:"合约代码"}),m("input",{value:l.vtSymbol,disabled:M||s,onChange:(A)=>h({...l,vtSymbol:A.target.value}),placeholder:"RB2610.SHFE"})]}),C("button",{type:"button",className:"button backtest-contract-query",disabled:M||s||!l.vtSymbol.trim(),onClick:g,children:[m(tl,{className:s?"spin":"",size:13}),"从账号获取"]}),m(ti,{label:"最小变动",min:0.000001,value:l.priceTick,disabled:M,onChange:(A)=>h({...l,priceTick:A})}),m(ti,{label:"合约乘数",min:1,step:1,value:l.multiplier,disabled:M,onChange:(A)=>h({...l,multiplier:A})}),m(ti,{label:"多头保证金率",min:0.000001,value:l.margin.longRatio,disabled:M,onChange:(A)=>h({...l,margin:{...l.margin,longRatio:A}})}),m(ti,{label:"空头保证金率",min:0.000001,value:l.margin.shortRatio,disabled:M,onChange:(A)=>h({...l,margin:{...l.margin,shortRatio:A}})}),m(bx,{children:"手续费"}),m(Sx,{leg:"open",label:"开仓",contract:l,disabled:M,setContract:h}),m(Sx,{leg:"close",label:"平昨",contract:l,disabled:M,setContract:h}),m(Sx,{leg:"closeToday",label:"平今",contract:l,disabled:M,setContract:h})]})})]}),I?C("button",{type:"button",className:"button backtest-run-action",onClick:S,children:[m(Ws,{size:13}),"取消"]}):C("button",{type:"button",className:"button primary backtest-run-action",disabled:!R||M,onClick:b,children:[m(Qs,{size:14}),"运行"]}),m(Qe,{label:"下载回测 JSON",icon:m(Ei,{size:15}),disabled:!o,onClick:p})]})}function bx({children:e}){return m("div",{className:"backtest-setting-heading",children:e})}function ti({label:e,value:t,min:a,step:n="any",disabled:i,onChange:r}){return C("label",{children:[m("span",{children:e}),m("input",{type:"number",min:a,step:n,value:Number.isFinite(t)?t:"",disabled:i,onChange:(l)=>r(l.target.value===""?Number.NaN:Number(l.target.value))})]})}function Sx({leg:e,label:t,contract:a,disabled:n,setContract:i}){let r=a.commission[e],l=(s)=>{i({...a,commission:{...a.commission,[e]:{...r,...s}}})};return C(ht,{children:[m(ti,{label:`${t} · 按金额`,min:0,value:r.ratioByMoney,disabled:n,onChange:(s)=>l({ratioByMoney:s})}),m(ti,{label:`${t} · 每手`,min:0,value:r.perLot,disabled:n,onChange:(s)=>l({perLot:s})})]})}function pO({active:e,result:t,runState:a,sma:n,timeframe:i,setTimeframe:r}){let l=kI(e,t,a);if(l)return l;return C("div",{className:"backtest-charts",children:[m(II,{value:t}),m("div",{className:"backtest-chart-grid",children:C("section",{className:"backtest-chart-section price-section",children:[C("header",{className:"backtest-section-header backtest-chart-header",children:[C("div",{className:"backtest-chart-tools",children:[m("div",{className:"backtest-timeframes",role:"group","aria-label":"回测 K 线周期",children:mI.map((s)=>m("button",{type:"button",className:s===i?"selected":"","aria-pressed":s===i,onClick:()=>r(s),children:s},s))}),m(Nf,{controller:n})]}),m("h3",{children:"价格、成交、净值与净持仓"})]}),m(xO,{value:t,indicators:n.indicators,timeframe:i})]})})]})}function gO({active:e,result:t,runState:a}){let n=kI(e,t,a);if(n)return n;let i=t.result.metrics,r=t.result.liquidationEstimate;return C("div",{className:"backtest-report",children:[m(II,{value:t}),C("div",{className:"metric-grid",children:[m(ze,{label:"净盈亏",value:gt(i.netPnl),tone:nr(i.netPnl)}),m(ze,{label:"净收益率",value:LI(i.netReturn),tone:nr(i.netReturn)}),m(ze,{label:"期末权益",value:gt(i.endingEquity)}),m(ze,{label:"手续费",value:gt(i.commission)}),m(ze,{label:"滑点成本",value:gt(i.slippageCost)}),m(ze,{label:"毛盈亏",value:gt(i.grossPnl),tone:nr(i.grossPnl)}),m(ze,{label:"已实现",value:gt(i.realizedPnl),tone:nr(i.realizedPnl)}),m(ze,{label:"未实现",value:gt(i.unrealizedPnl),tone:nr(i.unrealizedPnl)}),m(ze,{label:"最大回撤",value:gt(i.maxDrawdown)}),m(ze,{label:"回撤率",value:LI(i.maxDrawdownRate)}),m(ze,{label:"胜率",value:i.winRate===null?"--":`${(i.winRate*100).toFixed(1)}%`}),m(ze,{label:"成交",value:String(i.tradeCount)}),m(ze,{label:"最大保证金",value:gt(i.maxMargin)}),m(ze,{label:"最低可用",value:gt(i.minAvailable),tone:i.minAvailable<0?"down":void 0})]}),m(vx,{title:"末端持仓处置",children:C("div",{className:"liquidation-summary",children:[m(ze,{label:"盯市权益",value:gt(i.endingEquity)}),m(ze,{label:"模拟平仓权益",value:gt(r.estimatedEndingEquity),tone:nr(r.estimatedNetPnl)}),m(ze,{label:"模拟平仓净盈亏",value:gt(r.estimatedNetPnl),tone:nr(r.estimatedNetPnl)}),m(ze,{label:"追加手续费",value:gt(r.additionalCommission)}),m(ze,{label:"追加滑点",value:gt(r.additionalSlippageCost)}),m(ze,{label:"模拟平仓笔数",value:String(r.trades.length)}),m(ze,{label:"保证金拒单",value:String(i.marginRejectedOrderCount),tone:i.marginRejectedOrderCount>0?"down":void 0}),m(ze,{label:"保证金强平",value:i.forcedLiquidation?"是":"否",tone:i.forcedLiquidation?"down":void 0})]})}),m(vx,{title:`成交明细 · ${t.result.trades.length}`,children:m(yO,{value:t})}),m(vx,{title:"诊断",children:C("div",{className:"diagnostics",children:[t.result.diagnostics.notices.map((l,s)=>C("p",{children:[m(wt,{size:13}),l]},`notice-${s}`)),t.result.diagnostics.assumptions.map((l,s)=>C("p",{children:[m(ba,{size:13}),l]},`assumption-${s}`))]})})]})}function kI(e,t,a){if(a.status==="running"&&a.file===e?.file)return C("div",{className:"backtest-empty",children:[m(ot,{className:"spin",size:22}),m("strong",{children:"正在运行回测"})]});if(a.status==="failed"&&a.file===e?.file)return C("div",{className:"backtest-empty error",children:[m(wt,{size:22}),m("strong",{children:"回测失败"}),m("p",{children:a.error})]});if(!e)return C("div",{className:"backtest-empty",children:[m(qt,{size:22}),m("strong",{children:"未选择策略"})]});if(!t)return C("div",{className:"backtest-empty",children:[m(Ii,{size:22}),m("strong",{children:"尚无回测结果"})]});return}function II({value:e}){return C("div",{className:"backtest-summary-line",children:[C("span",{children:[m("strong",{children:e.summary.strategyId}),m("small",{children:e.summary.vtSymbol})]}),C("span",{children:[m(Os,{size:13}),Lx(e.summary.completedAt)]}),m("span",{children:kO(e)}),e.stale&&C("span",{className:"backtest-stale",children:[m(va,{size:13}),"源码已变更"]})]})}function ze({label:e,value:t,tone:a}){return C("div",{className:"metric",children:[m("span",{children:e}),m("strong",{className:a,children:t})]})}function vx({title:e,action:t,children:a}){return C("section",{className:"backtest-section",children:[C("header",{className:"backtest-section-header",children:[m("h3",{children:e}),t]}),a]})}function xO({value:e,indicators:t,timeframe:a}){let n=Vn((f)=>f.theme),i=le.useRef(null),r=le.useRef(null),l=le.useRef([]),s=le.useRef(t),o=le.useRef(new Map),[u,c]=le.useState(null);return s.current=t,le.useEffect(()=>{let f=i.current;if(!f)return;c(null);let d=Gn(n).chart,h=Tf(f,IO(f,d)),g=h.addSeries(Ef,{upColor:d.candleUp,downColor:d.candleDown,borderUpColor:d.candleUp,borderDownColor:d.candleDown,wickUpColor:d.candleUp,wickDownColor:d.candleDown}),b=h.addSeries(Af,{color:d.priceLine,lineWidth:2,title:"净值"},1),S=h.addSeries(Df,{title:"净持仓",color:d.volumeDown,priceLineVisible:!1,lastValueVisible:!0},2),p=pI(e.result.series.bars,a).map((B)=>({time:Math.floor(B.timestampMs/1000),open:B.open,high:B.high,low:B.low,close:B.close})),x=gI(e.result.series.equity,a),y=x.map((B)=>({time:Math.floor(B.timestampMs/1000),value:B.equity})),w=x.map((B)=>({time:Math.floor(B.timestampMs/1000),value:B.netPosition,color:B.netPosition>=0?d.volumeUp:d.volumeDown}));g.setData(p),b.setData(y),S.setData(w),r.current=h,l.current=p,Oo(h,o.current,s.current,p);let T=xI(e.result.trades,a),I=new Map,M=T.length<=24,R=T.map((B)=>{let q=B.trades[0],V=Math.floor(B.timestampMs/1000),Y=I.get(V);if(Y)Y.push(B);else I.set(V,[B]);let se=B.trades.length===1?`${q.offset} ${q.quantity}@${q.price}`:`${B.trades.length}笔 · ${B.trades.reduce((_e,O)=>_e+O.quantity,0)}`;return{time:Math.floor(B.timestampMs/1000),position:B.side==="buy"?"belowBar":"aboveBar",color:B.side==="buy"?d.candleUp:d.candleDown,shape:B.side==="buy"?"arrowUp":"arrowDown",...M?{text:se}:{}}});Jk(g,R);let A=(B)=>{if(typeof B.time!=="number"){c((Y)=>Y===null?Y:null);return}let q=B.time,V=I.get(q);if(!V){c((Y)=>Y===null?Y:null);return}c((Y)=>Y?.timestampSec===q?Y:{timestampSec:q,groups:V})};h.subscribeCrosshairMove(A);let v=()=>{let B=f.clientHeight;h.panes()[2]?.setHeight(Math.max(56,Math.min(84,Math.round(B*0.14)))),h.panes()[1]?.setHeight(Math.max(110,Math.min(150,Math.round(B*0.25))))};v();let F=Math.max(p.length,y.length);h.timeScale().setVisibleLogicalRange({from:Math.max(0,F-180),to:F+8});let H=MO(f,h,v);return()=>{H.disconnect(),h.unsubscribeCrosshairMove(A),r.current=null,l.current=[],o.current.clear(),h.remove()}},[n,a,e]),le.useEffect(()=>{let f=r.current;if(!f)return;let d=f.timeScale().getVisibleLogicalRange();if(Oo(f,o.current,t,l.current),d)f.timeScale().setVisibleLogicalRange(d)},[t]),C("div",{className:"backtest-chart price","aria-label":`${a} 回测 K 线、成交、净值与净持仓`,children:[m("div",{className:"backtest-chart-canvas",ref:i}),u&&m(vI,{buyColor:Gn(n).chart.candleUp,groups:u.groups,sellColor:Gn(n).chart.candleDown})]})}function yO({value:e}){return C("div",{className:"trade-table-wrap",children:[C("table",{className:"trade-table",children:[m("thead",{children:C("tr",{children:[m("th",{children:"时间"}),m("th",{children:"来源"}),m("th",{children:"方向"}),m("th",{children:"开平"}),m("th",{children:"参考价"}),m("th",{children:"成交价"}),m("th",{children:"数量"}),m("th",{children:"手续费"}),m("th",{children:"滑点"}),m("th",{children:"订单"})]})}),m("tbody",{children:e.result.trades.map((t)=>C("tr",{children:[m("td",{children:Lx(t.timestampMs)}),m("td",{children:t.origin==="marginLiquidation"?"强平":"策略"}),m("td",{className:t.side==="buy"?"up":"down",children:t.side==="buy"?"买":"卖"}),m("td",{children:t.offset}),m("td",{children:t.referencePrice}),m("td",{children:t.price}),m("td",{children:t.quantity}),m("td",{children:Cx(t.commission)}),m("td",{children:Cx(t.slippageCost)}),m("td",{children:t.orderId})]},t.tradeId))})]}),e.result.trades.length===0&&m("div",{className:"table-empty",children:"无成交"})]})}function bO({code:e,active:t}){if(!t)return C("div",{className:"strategy-no-selection",children:[m(Za,{size:22}),m("span",{children:"未选择策略"})]});if(!e)return m("div",{className:"strategy-no-selection",children:m(ot,{className:"spin",size:20})});return C("div",{className:"strategy-code",children:[C("div",{children:[m("span",{children:e.file}),C("small",{children:["SHA ",e.sourceHashSha256.slice(0,12)]})]}),m("pre",{children:m("code",{children:e.content})})]})}function SO({run:e,onClose:t}){let[a,n]=le.useState(""),i=async(r)=>{r.preventDefault();let l=a.trim();if(!l)return;if(await e({type:"create_strategy",filename:l.endsWith(".js")?l:`${l}.js`}))t()};return m(ua,{title:"新建策略",icon:m($a,{size:19}),onClose:t,width:"small",children:C("form",{className:"create-strategy-form",onSubmit:(r)=>void i(r),children:[C("label",{children:[m("span",{children:"文件名"}),m("input",{autoFocus:!0,value:a,onChange:(r)=>n(r.target.value),placeholder:"my-strategy.js"})]}),C("div",{className:"dialog-footer",children:[m("button",{type:"button",className:"button ghost",onClick:t,children:"取消"}),C("button",{className:"button primary",disabled:!a.trim(),children:[m(la,{size:15}),"创建"]})]})]})})}function vO({file:e,run:t,onClose:a}){let[n,i]=le.useState(!1),r=async()=>{if(i(!0),await t({type:"delete_strategy",file:e}))a();else i(!1)};return C(ua,{title:"删除策略",icon:m(en,{size:19}),onClose:a,width:"small",children:[C("p",{className:"confirm-copy delete-strategy-copy",children:["确定删除 ",m("code",{children:e}),"?此操作无法撤销。"]}),C("div",{className:"dialog-footer",children:[m("button",{type:"button",className:"button ghost",disabled:n,onClick:a,children:"取消"}),C("button",{type:"button",className:"button danger",disabled:n,onClick:()=>void r(),children:[m(en,{size:15}),"删除"]})]})]})}function CO(e){return`${e.size<1024?`${e.size} B`:`${(e.size/1024).toFixed(1)} KiB`} · ${Lx(e.modifiedAt)}`}function LO(e,t){if(!e)return t;if(e.endsWith("/")||e.endsWith("\\"))return`${e}${t}`;return`${e}${e.includes("\\")?"\\":"/"}${t}`}function CI(e){return typeof e==="object"&&e!==null&&"file"in e&&"content"in e&&"sourceHashSha256"in e}function wO(){return{schema:"vibek.backtest-contract/v1",vtSymbol:"",priceTick:Number.NaN,multiplier:Number.NaN,margin:{longRatio:Number.NaN,shortRatio:Number.NaN},commission:{open:{ratioByMoney:Number.NaN,perLot:Number.NaN},close:{ratioByMoney:Number.NaN,perLot:Number.NaN},closeToday:{ratioByMoney:Number.NaN,perLot:Number.NaN}}}}function nr(e){return e>0?"up":e<0?"down":void 0}function gt(e){return`¥${Cx(e)}`}function LI(e){return`${(e*100).toFixed(2)}%`}function kO(e){let t=e.result.input.source;if(t.type==="sqlite")return"录制数据";if(t.type==="csv")return"CSV";return"其他数据"}function Cx(e){return new Intl.NumberFormat("zh-CN",{maximumFractionDigits:2,minimumFractionDigits:0}).format(e)}function Lx(e){return new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}function IO(e,t){return{width:e.clientWidth,height:e.clientHeight,layout:{background:{type:er.Solid,color:t.background},textColor:t.text,fontFamily:"Inter, ui-sans-serif, system-ui, sans-serif",fontSize:10,attributionLogo:!0,panes:{separatorColor:t.separator,separatorHoverColor:t.crosshair,enableResize:!0}},grid:{vertLines:{color:t.grid},horzLines:{color:t.grid}},crosshair:{mode:Ji.Normal,vertLine:{color:t.crosshair},horzLine:{color:t.crosshair}},rightPriceScale:{borderColor:t.border,minimumWidth:65},timeScale:{borderColor:t.border,timeVisible:!0,secondsVisible:!1,minBarSpacing:2,tickMarkFormatter:(a,n)=>yI(a,n)},localization:{locale:"zh-CN",timeFormatter:(a)=>bI(a)}}}function MO(e,t,a){let n=new ResizeObserver((i)=>{let r=i[0];if(!r||r.contentRect.width<=0||r.contentRect.height<=0)return;t.applyOptions({width:Math.floor(r.contentRect.width),height:Math.floor(r.contentRect.height)}),a?.()});return n.observe(e),n}var wx=new Sg({onMessage:(e)=>{Z.getState().applyMessage(e),ke.getState().applyMessage(e)},onTranscriptDeltas:(e)=>Z.getState().applyTranscriptDeltas(e),onConnection:(e)=>Z.getState().setConnection(e),onError:(e)=>Z.getState().reportError(e)});function MI(){let e=Z((p)=>p.ready),t=Z((p)=>p.agentStates?.market.pendingUi),a=Z((p)=>p.agentStates?.strategy.pendingUi),n=Z((p)=>p.connection),i=Z((p)=>p.lastError),[r,l]=un.useState(!1),[s,o]=un.useState(!1),[u,c]=un.useState(),[f,d]=un.useState("market"),h=mx(),g=mx(uI);un.useEffect(()=>(wx.start(),()=>wx.stop()),[]);let b=un.useCallback(async(p)=>{Z.getState().reportError(void 0);try{return await wx.send(p)}catch(x){let y=x instanceof Error?x.message:String(x),w=Z.getState().notification;if(w?.kind!=="error"||w.text!==y)Z.getState().reportError(y);return}},[]),S=async()=>{let p=await b({type:"export",agent:f});if(!p?.downloadUrl)return;let x=document.createElement("a");x.href=p.downloadUrl,x.click()};if(!e)return C("main",{className:"boot-screen",children:[m(tf,{}),m(ot,{className:"spin",size:22}),m("p",{children:n==="reconnecting"?"正在重新连接...":"正在启动工作台..."}),i&&m("p",{className:"boot-error",children:i})]});return C("div",{className:`app-shell ${f==="market"?"market-mode":"strategy-mode"}`,children:[m(gL,{workspace:f,setWorkspace:d,run:b,exportSession:()=>void S(),openCapabilities:()=>l(!0),openThemeSettings:()=>o(!0),themeOpen:s,confirm:c}),f==="strategy"?m(wI,{run:b,openCapabilities:()=>l(!0),sma:g}):m(fI,{run:b,openCapabilities:()=>l(!0),sma:h}),f==="market"&&m(xL,{}),t&&m(bg,{agent:"market",request:t,run:b}),a&&m(bg,{agent:"strategy",request:a,run:b}),r&&m(yL,{agent:f,onClose:()=>l(!1)}),s&&m(bL,{onClose:()=>o(!1)}),u&&m(SL,{kind:u,onCancel:()=>c(void 0),onConfirm:()=>{let p=u;c(void 0),b(p==="new"?{type:"new_session",agent:f}:{type:"shutdown"})}}),i&&C("div",{className:"toast error",role:"alert",children:[m(wt,{size:17})," ",m("span",{children:i}),m(Qe,{label:"关闭",icon:m(sa,{size:15}),onClick:()=>Z.getState().reportError(void 0)})]})]})}var EI=document.getElementById("root");if(!EI)throw Error("Missing root element");AI.createRoot(EI).render(m(TI.StrictMode,{children:m(MI,{})}));
|