toolroll 0.9.65 → 0.9.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +20 -2
  3. package/dist/agent-fence.d.ts +69 -2
  4. package/dist/agent-fence.js +291 -11
  5. package/dist/agentconfig.js +4 -1
  6. package/dist/batch-checks.js +3 -2
  7. package/dist/browser/THIRD_PARTY_NOTICES.txt +46 -0
  8. package/dist/browser/terminal.js +134 -23
  9. package/dist/browser/workspace.css +1 -1
  10. package/dist/builder.d.ts +4 -0
  11. package/dist/builder.js +54 -12
  12. package/dist/contracts/console-api.d.ts +1 -0
  13. package/dist/contracts/console-api.js +1 -0
  14. package/dist/invoke.d.ts +18 -0
  15. package/dist/invoke.js +137 -14
  16. package/dist/live-terminal.d.ts +24 -13
  17. package/dist/live-terminal.js +79 -42
  18. package/dist/operate.d.ts +2 -0
  19. package/dist/operate.js +60 -2
  20. package/dist/project-delete-ui.d.ts +6 -0
  21. package/dist/project-delete-ui.js +20 -1
  22. package/dist/release-adapters.d.ts +6 -0
  23. package/dist/release-adapters.js +70 -3
  24. package/dist/release.d.ts +7 -1
  25. package/dist/release.js +20 -7
  26. package/dist/result-follow-ups.js +3 -2
  27. package/dist/scope.d.ts +13 -0
  28. package/dist/scope.js +10 -5
  29. package/dist/serve.js +1 -0
  30. package/dist/server/chrome.d.ts +10 -1
  31. package/dist/server/chrome.js +45 -4
  32. package/dist/server/console.css +55 -4
  33. package/dist/server/render-pages.d.ts +28 -3
  34. package/dist/server/render-pages.js +78 -9
  35. package/dist/server/render-tasks.js +2 -1
  36. package/dist/server/route-table.js +1 -0
  37. package/dist/server/settings.js +21 -0
  38. package/dist/server/tasks.js +7 -4
  39. package/dist/store.d.ts +11 -1
  40. package/dist/store.js +33 -2
  41. package/dist/teardown-git.d.ts +22 -0
  42. package/dist/teardown-git.js +136 -2
  43. package/dist/tool-broker.d.ts +12 -0
  44. package/dist/tool-broker.js +66 -2
  45. package/dist/unfenced-test-support.d.ts +2 -0
  46. package/dist/unfenced-test-support.js +11 -0
  47. package/dist/writes-mode.d.ts +9 -0
  48. package/dist/writes-mode.js +8 -0
  49. package/package.json +5 -1
@@ -1,27 +1,27 @@
1
1
  /*! Third-party notices: /assets/THIRD_PARTY_NOTICES.txt */
2
- var _S=Object.create;var zf=Object.defineProperty;var mS=Object.getOwnPropertyDescriptor;var vS=Object.getOwnPropertyNames;var gS=Object.getPrototypeOf,pS=Object.prototype.hasOwnProperty;var ai=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}};var SS=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vS(t))!pS.call(e,r)&&r!==i&&zf(e,r,{get:()=>t[r],enumerable:!(s=mS(t,r))||s.enumerable});return e};var Ql=(e,t,i)=>(i=e!=null?_S(gS(e)):{},SS(t||!e||!e.__esModule?zf(i,"default",{value:e,enumerable:!0}):i,e));var Ff=ai(U=>{"use strict";var yh=Symbol.for("react.transitional.element"),yS=Symbol.for("react.portal"),bS=Symbol.for("react.fragment"),wS=Symbol.for("react.strict_mode"),CS=Symbol.for("react.profiler"),ES=Symbol.for("react.consumer"),xS=Symbol.for("react.context"),TS=Symbol.for("react.forward_ref"),DS=Symbol.for("react.suspense"),MS=Symbol.for("react.memo"),Yf=Symbol.for("react.lazy"),AS=Symbol.for("react.activity"),RS=Symbol.for("react.view_transition"),Lf=Symbol.iterator;function OS(e){return e===null||typeof e!="object"?null:(e=Lf&&e[Lf]||e["@@iterator"],typeof e=="function"?e:null)}var Kf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vf=Object.assign,Pf={};function Sr(e,t,i){this.props=e,this.context=t,this.refs=Pf,this.updater=i||Kf}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 Gf(){}Gf.prototype=Sr.prototype;function bh(e,t,i){this.props=e,this.context=t,this.refs=Pf,this.updater=i||Kf}var wh=bh.prototype=new Gf;wh.constructor=bh;Vf(wh,Sr.prototype);wh.isPureReactComponent=!0;var Hf=Array.isArray;function Sh(){}var oe={H:null,A:null,T:null,S:null},If=Object.prototype.hasOwnProperty;function Ch(e,t,i){var s=i.ref;return{$$typeof:yh,type:e,key:t,ref:s!==void 0?s:null,props:i}}function BS(e,t){return Ch(e.type,t,e.props)}function Eh(e){return typeof e=="object"&&e!==null&&e.$$typeof===yh}function NS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var Uf=/\/+/g;function ph(e,t){return typeof e=="object"&&e!==null&&e.key!=null?NS(""+e.key):t.toString(36)}function kS(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Sh,Sh):(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 pr(e,t,i,s,r){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(n){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case yh:case yS:l=!0;break;case Yf:return l=e._init,pr(l(e._payload),t,i,s,r)}}if(l)return r=r(e),l=s===""?"."+ph(e,0):s,Hf(r)?(i="",l!=null&&(i=l.replace(Uf,"$&/")+"/"),pr(r,t,i,"",function(h){return h})):r!=null&&(Eh(r)&&(r=BS(r,i+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Uf,"$&/")+"/")+l)),t.push(r)),1;l=0;var a=s===""?".":s+":";if(Hf(e))for(var o=0;o<e.length;o++)s=e[o],n=a+ph(s,o),l+=pr(s,t,i,n,r);else if(o=OS(e),typeof o=="function")for(e=o.call(e),o=0;!(s=e.next()).done;)s=s.value,n=a+ph(s,o++),l+=pr(s,t,i,n,r);else if(n==="object"){if(typeof e.then=="function")return pr(kS(e),t,i,s,r);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 Jl(e,t,i){if(e==null)return e;var s=[],r=0;return pr(e,s,"","",function(n){return t.call(i,n,r++)}),s}function zS(e){if(e._status===-1){var t=e._result,i=t();i.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s,i.status===void 0&&(i.status="fulfilled",i.value=s))},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s,i.status===void 0&&(i.status="rejected",i.reason=s))}),e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return e._result.default;throw e._result}var qf=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)};function jf(e){var t=oe.T,i={};i.types=t!==null?t.types:null,oe.T=i;try{var s=e(),r=oe.S;r!==null&&r(i,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(Sh,qf)}catch(n){qf(n)}finally{t!==null&&i.types!==null&&(t.types=i.types),oe.T=t}}function Xf(e){var t=oe.T;if(t!==null){var i=t.types;i===null?t.types=[e]:i.indexOf(e)===-1&&i.push(e)}else jf(Xf.bind(null,e))}var LS={map:Jl,forEach:function(e,t,i){Jl(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return Jl(e,function(){t++}),t},toArray:function(e){return Jl(e,function(t){return t})||[]},only:function(e){if(!Eh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};U.Activity=AS;U.Children=LS;U.Component=Sr;U.Fragment=bS;U.Profiler=CS;U.PureComponent=bh;U.StrictMode=wS;U.Suspense=DS;U.ViewTransition=RS;U.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=oe;U.__COMPILER_RUNTIME={__proto__:null,c:function(e){return oe.H.useMemoCache(e)}};U.addTransitionType=Xf;U.cache=function(e){return function(){return e.apply(null,arguments)}};U.cacheSignal=function(){return null};U.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Vf({},e.props),r=e.key;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)!If.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(s[n]=t[n]);var n=arguments.length-2;if(n===1)s.children=i;else if(1<n){for(var l=Array(n),a=0;a<n;a++)l[a]=arguments[a+2];s.children=l}return Ch(e.type,r,s)};U.createContext=function(e){return e={$$typeof:xS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ES,_context:e},e};U.createElement=function(e,t,i){var s,r={},n=null;if(t!=null)for(s in t.key!==void 0&&(n=""+t.key),t)If.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var l=arguments.length-2;if(l===1)r.children=i;else if(1<l){for(var a=Array(l),o=0;o<l;o++)a[o]=arguments[o+2];r.children=a}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)r[s]===void 0&&(r[s]=l[s]);return Ch(e,n,r)};U.createRef=function(){return{current:null}};U.forwardRef=function(e){return{$$typeof:TS,render:e}};U.isValidElement=Eh;U.lazy=function(e){return{$$typeof:Yf,_payload:{_status:-1,_result:e},_init:zS}};U.memo=function(e,t){return{$$typeof:MS,type:e,compare:t===void 0?null:t}};U.startTransition=jf;U.unstable_useCacheRefresh=function(){return oe.H.useCacheRefresh()};U.use=function(e){return oe.H.use(e)};U.useActionState=function(e,t,i){return oe.H.useActionState(e,t,i)};U.useCallback=function(e,t){return oe.H.useCallback(e,t)};U.useContext=function(e){return oe.H.useContext(e)};U.useDebugValue=function(){};U.useDeferredValue=function(e,t){return oe.H.useDeferredValue(e,t)};U.useEffect=function(e,t){return oe.H.useEffect(e,t)};U.useEffectEvent=function(e){return oe.H.useEffectEvent(e)};U.useId=function(){return oe.H.useId()};U.useImperativeHandle=function(e,t,i){return oe.H.useImperativeHandle(e,t,i)};U.useInsertionEffect=function(e,t){return oe.H.useInsertionEffect(e,t)};U.useLayoutEffect=function(e,t){return oe.H.useLayoutEffect(e,t)};U.useMemo=function(e,t){return oe.H.useMemo(e,t)};U.useOptimistic=function(e,t){return oe.H.useOptimistic(e,t)};U.useReducer=function(e,t,i){return oe.H.useReducer(e,t,i)};U.useRef=function(e){return oe.H.useRef(e)};U.useState=function(e){return oe.H.useState(e)};U.useSyncExternalStore=function(e,t,i){return oe.H.useSyncExternalStore(e,t,i)};U.useTransition=function(){return oe.H.useTransition()};U.version="19.3.0"});var $l=ai((Yx,Wf)=>{"use strict";Wf.exports=Ff()});var n_=ai(_e=>{"use strict";function Mh(e,t){var i=e.length;e.push(t);e:for(;0<i;){var s=i-1>>>1,r=e[s];if(0<ea(r,t))e[s]=t,e[i]=r,i=s;else break e}}function oi(e){return e.length===0?null:e[0]}function ia(e){if(e.length===0)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var s=0,r=e.length,n=r>>>1;s<n;){var l=2*(s+1)-1,a=e[l],o=l+1,h=e[o];if(0>ea(a,i))o<r&&0>ea(h,a)?(e[s]=h,e[o]=i,s=o):(e[s]=a,e[l]=i,s=l);else if(o<r&&0>ea(h,i))e[s]=h,e[o]=i,s=o;else break e}}return t}function ea(e,t){var i=e.sortIndex-t.sortIndex;return i!==0?i:e.id-t.id}_e.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Zf=performance,_e.unstable_now=function(){return Zf.now()}):(xh=Date,Qf=xh.now(),_e.unstable_now=function(){return xh.now()-Qf});var Zf,xh,Qf,Ai=[],es=[],HS=1,qt=null,st=3,Ah=!1,xn=!1,Tn=!1,Rh=!1,e_=typeof setTimeout=="function"?setTimeout:null,t_=typeof clearTimeout=="function"?clearTimeout:null,Jf=typeof setImmediate<"u"?setImmediate:null;function ta(e){for(var t=oi(es);t!==null;){if(t.callback===null)ia(es);else if(t.startTime<=e)ia(es),t.sortIndex=t.expirationTime,Mh(Ai,t);else break;t=oi(es)}}function Oh(e){if(Tn=!1,ta(e),!xn)if(oi(Ai)!==null)xn=!0,br||(br=!0,yr());else{var t=oi(es);t!==null&&Bh(Oh,t.startTime-e)}}var br=!1,Dn=-1,i_=5,s_=-1;function r_(){return Rh?!0:!(_e.unstable_now()-s_<i_)}function Th(){if(Rh=!1,br){var e=_e.unstable_now();s_=e;var t=!0;try{e:{xn=!1,Tn&&(Tn=!1,t_(Dn),Dn=-1),Ah=!0;var i=st;try{t:{for(ta(e),qt=oi(Ai);qt!==null&&!(qt.expirationTime>e&&r_());){var s=qt.callback;if(typeof s=="function"){qt.callback=null,st=qt.priorityLevel;var r=s(qt.expirationTime<=e);if(e=_e.unstable_now(),typeof r=="function"){qt.callback=r,ta(e),t=!0;break t}qt===oi(Ai)&&ia(Ai),ta(e)}else ia(Ai);qt=oi(Ai)}if(qt!==null)t=!0;else{var n=oi(es);n!==null&&Bh(Oh,n.startTime-e),t=!1}}break e}finally{qt=null,st=i,Ah=!1}t=void 0}}finally{t?yr():br=!1}}}var yr;typeof Jf=="function"?yr=function(){Jf(Th)}:typeof MessageChannel<"u"?(Dh=new MessageChannel,$f=Dh.port2,Dh.port1.onmessage=Th,yr=function(){$f.postMessage(null)}):yr=function(){e_(Th,0)};var Dh,$f;function Bh(e,t){Dn=e_(function(){e(_e.unstable_now())},t)}_e.unstable_IdlePriority=5;_e.unstable_ImmediatePriority=1;_e.unstable_LowPriority=4;_e.unstable_NormalPriority=3;_e.unstable_Profiling=null;_e.unstable_UserBlockingPriority=2;_e.unstable_cancelCallback=function(e){e.callback=null};_e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):i_=0<e?Math.floor(1e3/e):5};_e.unstable_getCurrentPriorityLevel=function(){return st};_e.unstable_next=function(e){switch(st){case 1:case 2:case 3:var t=3;break;default:t=st}var i=st;st=t;try{return e()}finally{st=i}};_e.unstable_requestPaint=function(){Rh=!0};_e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=st;st=e;try{return t()}finally{st=i}};_e.unstable_scheduleCallback=function(e,t,i){var s=_e.unstable_now();switch(typeof i=="object"&&i!==null?(i=i.delay,i=typeof i=="number"&&0<i?s+i:s):i=s,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=i+r,e={id:HS++,callback:t,priorityLevel:e,startTime:i,expirationTime:r,sortIndex:-1},i>s?(e.sortIndex=i,Mh(es,e),oi(Ai)===null&&e===oi(es)&&(Tn?(t_(Dn),Dn=-1):Tn=!0,Bh(Oh,i-s))):(e.sortIndex=r,Mh(Ai,e),xn||Ah||(xn=!0,br||(br=!0,yr()))),e};_e.unstable_shouldYield=r_;_e.unstable_wrapCallback=function(e){var t=st;return function(){var i=st;st=t;try{return e.apply(this,arguments)}finally{st=i}}}});var a_=ai((Vx,l_)=>{"use strict";l_.exports=n_()});var c_=ai(rt=>{"use strict";var US=$l();function h_(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 ts(){}var ot={d:{f:ts,r:function(){throw Error(h_(522))},D:ts,C:ts,L:ts,m:ts,X:ts,S:ts,M:ts},p:0,findDOMNode:null},qS=Symbol.for("react.portal"),YS=Symbol.for("react.recoverable"),o_=Symbol.for("react.optimistic_key");function KS(e,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qS,key:s==null?null:s===o_?o_:""+s,children:e,containerInfo:t,implementation:i}}var Mn=US.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function sa(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ot;rt.browser=function(e){return{$$typeof:YS,_reason:e}};rt.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(h_(299));return KS(e,t,null,i)};rt.flushSync=function(e){var t=Mn.T,i=ot.p;try{if(Mn.T=null,ot.p=2,e)return e()}finally{Mn.T=t,ot.p=i,ot.d.f()}};rt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ot.d.C(e,t))};rt.prefetchDNS=function(e){typeof e=="string"&&ot.d.D(e)};rt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,s=sa(i,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?ot.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:n}):i==="script"&&ot.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};rt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=sa(t.as,t.crossOrigin);ot.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&ot.d.M(e)};rt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,s=sa(i,t.crossOrigin);ot.d.L(e,i,{crossOrigin:s,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})}};rt.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=sa(t.as,t.crossOrigin);ot.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else ot.d.m(e)};rt.requestFormReset=function(e){ot.d.r(e)};rt.unstable_batchedUpdates=function(e,t){return e(t)};rt.useFormState=function(e,t,i){return Mn.H.useFormState(e,t,i)};rt.useFormStatus=function(){return Mn.H.useHostTransitionStatus()};rt.version="19.3.0"});var f_=ai((Gx,d_)=>{"use strict";function u_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u_)}catch(e){console.error(e)}}u_(),d_.exports=c_()});var $0=ai(qo=>{"use strict";var ke=a_(),Jm=$l(),VS=f_();function b(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 $m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ml(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function ev(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 tv(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 __(e){if(ml(e)!==e)throw Error(b(188))}function PS(e){var t=e.alternate;if(!t){if(t=ml(e),t===null)throw Error(b(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return __(r),e;if(n===s)return __(r),t;n=n.sibling}throw Error(b(188))}if(i.return!==s.return)i=r,s=n;else{for(var l=!1,a=r.child;a;){if(a===i){l=!0,i=r,s=n;break}if(a===s){l=!0,s=r,i=n;break}a=a.sibling}if(!l){for(a=n.child;a;){if(a===i){l=!0,i=n,s=r;break}if(a===s){l=!0,s=n,i=r;break}a=a.sibling}if(!l)throw Error(b(189))}}if(i.alternate!==s)throw Error(b(190))}if(i.tag!==3)throw Error(b(188));return i.stateNode.current===i?e:t}function iv(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=iv(e),t!==null)return t;e=e.sibling}return null}function bt(e,t,i,s,r,n){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,s,r,n)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&bt(e.child,t,i,s,r,n))return!0;e=e.sibling}return!1}function nr(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m_(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function sv(e){var t=[null,null],i=nr(e);return i===null||rv(t,e,i.child,{foundSelf:!1}),t}function rv(e,t,i,s){for(;i!==null;){if(i===t)s.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(s.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&rv(e,t,i.child,s))return!0;i=i.sibling}return!1}function Ne(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(b(559))}}var Mr=null,cc=null;function GS(e,t,i){return e===i?!0:e===t?(Mr=e,!0):!1}function IS(e,t,i){return e===i?(cc=e,!1):e===t?(cc!==null&&(Mr=e),!0):!1}function v_(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function uc(e,t,i){for(var s=0,r=e;r;r=i(r))s++;r=0;for(var n=t;n;n=i(n))r++;for(;0<s-r;)e=i(e),s--;for(;0<r-s;)t=i(t),r--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var ae=Object.assign,jS=Symbol.for("react.element"),ra=Symbol.for("react.transitional.element"),zn=Symbol.for("react.portal"),Ar=Symbol.for("react.fragment"),nv=Symbol.for("react.strict_mode"),dc=Symbol.for("react.profiler"),lv=Symbol.for("react.consumer"),_i=Symbol.for("react.context"),bu=Symbol.for("react.forward_ref"),fc=Symbol.for("react.suspense"),_c=Symbol.for("react.suspense_list"),wu=Symbol.for("react.memo"),ns=Symbol.for("react.lazy"),mc=Symbol.for("react.activity"),XS=Symbol.for("react.legacy_hidden"),FS=Symbol.for("react.memo_cache_sentinel"),vc=Symbol.for("react.view_transition"),WS=Symbol.for("react.recoverable"),g_=Symbol.iterator;function An(e){return e===null||typeof e!="object"?null:(e=g_&&e[g_]||e["@@iterator"],typeof e=="function"?e:null)}var ZS=Symbol.for("react.client.reference");function gc(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ZS?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ar:return"Fragment";case dc:return"Profiler";case nv:return"StrictMode";case fc:return"Suspense";case _c:return"SuspenseList";case mc:return"Activity";case vc:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case zn:return"Portal";case _i:return e.displayName||"Context";case lv:return(e._context.displayName||"Context")+".Consumer";case bu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wu:return t=e.displayName||null,t!==null?t:gc(e.type)||"Memo";case ns:t=e._payload,e=e._init;try{return gc(e(t))}catch{}}return null}var Ln=Array.isArray,L=Jm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=VS.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,js={pending:!1,data:null,method:null,action:null},pc=[],Rr=-1;function bi(e){return{current:e}}function Je(e){0>Rr||(e.current=pc[Rr],pc[Rr]=null,Rr--)}function ue(e,t){Rr++,pc[Rr]=e.current,e.current=t}var pi=bi(null),$n=bi(null),_s=bi(null),Ga=bi(null);function Ia(e,t){switch(ue(_s,t),ue($n,e),ue(pi,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Om(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Om(t),e=M0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Je(pi),ue(pi,e)}function Zr(){Je(pi),Je($n),Je(_s)}function Sc(e){var t=e.memoizedState;t!==null&&(an._currentValue=t.memoizedState,ue(Ga,e)),t=pi.current;var i=M0(t,e.type);t!==i&&(ue($n,e),ue(pi,i))}function ja(e){$n.current===e&&(Je(pi),Je($n)),Ga.current===e&&(Je(Ga),an._currentValue=js)}var Nh,p_;function ss(e){if(Nh===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Nh=t&&t[1]||"",p_=-1<i.stack.indexOf(`
2
+ var b5=Object.create;var J0=Object.defineProperty;var w5=Object.getOwnPropertyDescriptor;var C5=Object.getOwnPropertyNames;var x5=Object.getPrototypeOf,E5=Object.prototype.hasOwnProperty;var zi=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}};var T5=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of C5(t))!E5.call(e,r)&&r!==i&&J0(e,r,{get:()=>t[r],enumerable:!(s=w5(t,r))||s.enumerable});return e};var io=(e,t,i)=>(i=e!=null?b5(x5(e)):{},T5(t||!e||!e.__esModule?J0(i,"default",{value:e,enumerable:!0}):i,e));var dg=zi(V=>{"use strict";var Yc=Symbol.for("react.transitional.element"),M5=Symbol.for("react.portal"),L5=Symbol.for("react.fragment"),A5=Symbol.for("react.strict_mode"),D5=Symbol.for("react.profiler"),R5=Symbol.for("react.consumer"),B5=Symbol.for("react.context"),k5=Symbol.for("react.forward_ref"),O5=Symbol.for("react.suspense"),N5=Symbol.for("react.memo"),rg=Symbol.for("react.lazy"),z5=Symbol.for("react.activity"),H5=Symbol.for("react.view_transition"),eg=Symbol.iterator;function U5(e){return e===null||typeof e!="object"?null:(e=eg&&e[eg]||e["@@iterator"],typeof e=="function"?e:null)}var ng={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lg=Object.assign,ag={};function un(e,t,i){this.props=e,this.context=t,this.refs=ag,this.updater=i||ng}un.prototype.isReactComponent={};un.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")};un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function og(){}og.prototype=un.prototype;function Gc(e,t,i){this.props=e,this.context=t,this.refs=ag,this.updater=i||ng}var Kc=Gc.prototype=new og;Kc.constructor=Gc;lg(Kc,un.prototype);Kc.isPureReactComponent=!0;var tg=Array.isArray;function Vc(){}var ge={H:null,A:null,T:null,S:null},hg=Object.prototype.hasOwnProperty;function jc(e,t,i){var s=i.ref;return{$$typeof:Yc,type:e,key:t,ref:s!==void 0?s:null,props:i}}function P5(e,t){return jc(e.type,t,e.props)}function $c(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yc}function I5(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var ig=/\/+/g;function Wc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?I5(""+e.key):t.toString(36)}function F5(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Vc,Vc):(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 cn(e,t,i,s,r){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(n){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Yc:case M5:l=!0;break;case rg:return l=e._init,cn(l(e._payload),t,i,s,r)}}if(l)return r=r(e),l=s===""?"."+Wc(e,0):s,tg(r)?(i="",l!=null&&(i=l.replace(ig,"$&/")+"/"),cn(r,t,i,"",function(h){return h})):r!=null&&($c(r)&&(r=P5(r,i+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(ig,"$&/")+"/")+l)),t.push(r)),1;l=0;var a=s===""?".":s+":";if(tg(e))for(var o=0;o<e.length;o++)s=e[o],n=a+Wc(s,o),l+=cn(s,t,i,n,r);else if(o=U5(e),typeof o=="function")for(e=o.call(e),o=0;!(s=e.next()).done;)s=s.value,n=a+Wc(s,o++),l+=cn(s,t,i,n,r);else if(n==="object"){if(typeof e.then=="function")return cn(F5(e),t,i,s,r);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 so(e,t,i){if(e==null)return e;var s=[],r=0;return cn(e,s,"","",function(n){return t.call(i,n,r++)}),s}function q5(e){if(e._status===-1){var t=e._result,i=t();i.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s,i.status===void 0&&(i.status="fulfilled",i.value=s))},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s,i.status===void 0&&(i.status="rejected",i.reason=s))}),e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return e._result.default;throw e._result}var sg=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)};function cg(e){var t=ge.T,i={};i.types=t!==null?t.types:null,ge.T=i;try{var s=e(),r=ge.S;r!==null&&r(i,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(Vc,sg)}catch(n){sg(n)}finally{t!==null&&i.types!==null&&(t.types=i.types),ge.T=t}}function ug(e){var t=ge.T;if(t!==null){var i=t.types;i===null?t.types=[e]:i.indexOf(e)===-1&&i.push(e)}else cg(ug.bind(null,e))}var W5={map:so,forEach:function(e,t,i){so(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return so(e,function(){t++}),t},toArray:function(e){return so(e,function(t){return t})||[]},only:function(e){if(!$c(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};V.Activity=z5;V.Children=W5;V.Component=un;V.Fragment=L5;V.Profiler=D5;V.PureComponent=Gc;V.StrictMode=A5;V.Suspense=O5;V.ViewTransition=H5;V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ge;V.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ge.H.useMemoCache(e)}};V.addTransitionType=ug;V.cache=function(e){return function(){return e.apply(null,arguments)}};V.cacheSignal=function(){return null};V.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=lg({},e.props),r=e.key;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)!hg.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(s[n]=t[n]);var n=arguments.length-2;if(n===1)s.children=i;else if(1<n){for(var l=Array(n),a=0;a<n;a++)l[a]=arguments[a+2];s.children=l}return jc(e.type,r,s)};V.createContext=function(e){return e={$$typeof:B5,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:R5,_context:e},e};V.createElement=function(e,t,i){var s,r={},n=null;if(t!=null)for(s in t.key!==void 0&&(n=""+t.key),t)hg.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var l=arguments.length-2;if(l===1)r.children=i;else if(1<l){for(var a=Array(l),o=0;o<l;o++)a[o]=arguments[o+2];r.children=a}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)r[s]===void 0&&(r[s]=l[s]);return jc(e,n,r)};V.createRef=function(){return{current:null}};V.forwardRef=function(e){return{$$typeof:k5,render:e}};V.isValidElement=$c;V.lazy=function(e){return{$$typeof:rg,_payload:{_status:-1,_result:e},_init:q5}};V.memo=function(e,t){return{$$typeof:N5,type:e,compare:t===void 0?null:t}};V.startTransition=cg;V.unstable_useCacheRefresh=function(){return ge.H.useCacheRefresh()};V.use=function(e){return ge.H.use(e)};V.useActionState=function(e,t,i){return ge.H.useActionState(e,t,i)};V.useCallback=function(e,t){return ge.H.useCallback(e,t)};V.useContext=function(e){return ge.H.useContext(e)};V.useDebugValue=function(){};V.useDeferredValue=function(e,t){return ge.H.useDeferredValue(e,t)};V.useEffect=function(e,t){return ge.H.useEffect(e,t)};V.useEffectEvent=function(e){return ge.H.useEffectEvent(e)};V.useId=function(){return ge.H.useId()};V.useImperativeHandle=function(e,t,i){return ge.H.useImperativeHandle(e,t,i)};V.useInsertionEffect=function(e,t){return ge.H.useInsertionEffect(e,t)};V.useLayoutEffect=function(e,t){return ge.H.useLayoutEffect(e,t)};V.useMemo=function(e,t){return ge.H.useMemo(e,t)};V.useOptimistic=function(e,t){return ge.H.useOptimistic(e,t)};V.useReducer=function(e,t,i){return ge.H.useReducer(e,t,i)};V.useRef=function(e){return ge.H.useRef(e)};V.useState=function(e){return ge.H.useState(e)};V.useSyncExternalStore=function(e,t,i){return ge.H.useSyncExternalStore(e,t,i)};V.useTransition=function(){return ge.H.useTransition()};V.version="19.3.0"});var ro=zi((PM,fg)=>{"use strict";fg.exports=dg()});var Cg=zi(Ce=>{"use strict";function Jc(e,t){var i=e.length;e.push(t);e:for(;0<i;){var s=i-1>>>1,r=e[s];if(0<no(r,t))e[s]=t,e[i]=r,i=s;else break e}}function Hi(e){return e.length===0?null:e[0]}function ao(e){if(e.length===0)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var s=0,r=e.length,n=r>>>1;s<n;){var l=2*(s+1)-1,a=e[l],o=l+1,h=e[o];if(0>no(a,i))o<r&&0>no(h,a)?(e[s]=h,e[o]=i,s=o):(e[s]=a,e[l]=i,s=l);else if(o<r&&0>no(h,i))e[s]=h,e[o]=i,s=o;else break e}}return t}function no(e,t){var i=e.sortIndex-t.sortIndex;return i!==0?i:e.id-t.id}Ce.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(_g=performance,Ce.unstable_now=function(){return _g.now()}):(Xc=Date,gg=Xc.now(),Ce.unstable_now=function(){return Xc.now()-gg});var _g,Xc,gg,ls=[],Ps=[],V5=1,ci=null,Ct=3,eu=!1,wl=!1,Cl=!1,tu=!1,pg=typeof setTimeout=="function"?setTimeout:null,Sg=typeof clearTimeout=="function"?clearTimeout:null,vg=typeof setImmediate<"u"?setImmediate:null;function lo(e){for(var t=Hi(Ps);t!==null;){if(t.callback===null)ao(Ps);else if(t.startTime<=e)ao(Ps),t.sortIndex=t.expirationTime,Jc(ls,t);else break;t=Hi(Ps)}}function iu(e){if(Cl=!1,lo(e),!wl)if(Hi(ls)!==null)wl=!0,fn||(fn=!0,dn());else{var t=Hi(Ps);t!==null&&su(iu,t.startTime-e)}}var fn=!1,xl=-1,yg=5,bg=-1;function wg(){return tu?!0:!(Ce.unstable_now()-bg<yg)}function Zc(){if(tu=!1,fn){var e=Ce.unstable_now();bg=e;var t=!0;try{e:{wl=!1,Cl&&(Cl=!1,Sg(xl),xl=-1),eu=!0;var i=Ct;try{t:{for(lo(e),ci=Hi(ls);ci!==null&&!(ci.expirationTime>e&&wg());){var s=ci.callback;if(typeof s=="function"){ci.callback=null,Ct=ci.priorityLevel;var r=s(ci.expirationTime<=e);if(e=Ce.unstable_now(),typeof r=="function"){ci.callback=r,lo(e),t=!0;break t}ci===Hi(ls)&&ao(ls),lo(e)}else ao(ls);ci=Hi(ls)}if(ci!==null)t=!0;else{var n=Hi(Ps);n!==null&&su(iu,n.startTime-e),t=!1}}break e}finally{ci=null,Ct=i,eu=!1}t=void 0}}finally{t?dn():fn=!1}}}var dn;typeof vg=="function"?dn=function(){vg(Zc)}:typeof MessageChannel<"u"?(Qc=new MessageChannel,mg=Qc.port2,Qc.port1.onmessage=Zc,dn=function(){mg.postMessage(null)}):dn=function(){pg(Zc,0)};var Qc,mg;function su(e,t){xl=pg(function(){e(Ce.unstable_now())},t)}Ce.unstable_IdlePriority=5;Ce.unstable_ImmediatePriority=1;Ce.unstable_LowPriority=4;Ce.unstable_NormalPriority=3;Ce.unstable_Profiling=null;Ce.unstable_UserBlockingPriority=2;Ce.unstable_cancelCallback=function(e){e.callback=null};Ce.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):yg=0<e?Math.floor(1e3/e):5};Ce.unstable_getCurrentPriorityLevel=function(){return Ct};Ce.unstable_next=function(e){switch(Ct){case 1:case 2:case 3:var t=3;break;default:t=Ct}var i=Ct;Ct=t;try{return e()}finally{Ct=i}};Ce.unstable_requestPaint=function(){tu=!0};Ce.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=Ct;Ct=e;try{return t()}finally{Ct=i}};Ce.unstable_scheduleCallback=function(e,t,i){var s=Ce.unstable_now();switch(typeof i=="object"&&i!==null?(i=i.delay,i=typeof i=="number"&&0<i?s+i:s):i=s,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=i+r,e={id:V5++,callback:t,priorityLevel:e,startTime:i,expirationTime:r,sortIndex:-1},i>s?(e.sortIndex=i,Jc(Ps,e),Hi(ls)===null&&e===Hi(Ps)&&(Cl?(Sg(xl),xl=-1):Cl=!0,su(iu,i-s))):(e.sortIndex=r,Jc(ls,e),wl||eu||(wl=!0,fn||(fn=!0,dn()))),e};Ce.unstable_shouldYield=wg;Ce.unstable_wrapCallback=function(e){var t=Ct;return function(){var i=Ct;Ct=t;try{return e.apply(this,arguments)}finally{Ct=i}}}});var Eg=zi((FM,xg)=>{"use strict";xg.exports=Cg()});var Lg=zi(xt=>{"use strict";var Y5=ro();function Mg(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 Is(){}var Mt={d:{f:Is,r:function(){throw Error(Mg(522))},D:Is,C:Is,L:Is,m:Is,X:Is,S:Is,M:Is},p:0,findDOMNode:null},G5=Symbol.for("react.portal"),K5=Symbol.for("react.recoverable"),Tg=Symbol.for("react.optimistic_key");function j5(e,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G5,key:s==null?null:s===Tg?Tg:""+s,children:e,containerInfo:t,implementation:i}}var El=Y5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function oo(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mt;xt.browser=function(e){return{$$typeof:K5,_reason:e}};xt.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Mg(299));return j5(e,t,null,i)};xt.flushSync=function(e){var t=El.T,i=Mt.p;try{if(El.T=null,Mt.p=2,e)return e()}finally{El.T=t,Mt.p=i,Mt.d.f()}};xt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Mt.d.C(e,t))};xt.prefetchDNS=function(e){typeof e=="string"&&Mt.d.D(e)};xt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,s=oo(i,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?Mt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:n}):i==="script"&&Mt.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};xt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=oo(t.as,t.crossOrigin);Mt.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&Mt.d.M(e)};xt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,s=oo(i,t.crossOrigin);Mt.d.L(e,i,{crossOrigin:s,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})}};xt.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=oo(t.as,t.crossOrigin);Mt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else Mt.d.m(e)};xt.requestFormReset=function(e){Mt.d.r(e)};xt.unstable_batchedUpdates=function(e,t){return e(t)};xt.useFormState=function(e,t,i){return El.H.useFormState(e,t,i)};xt.useFormStatus=function(){return El.H.useHostTransitionStatus()};xt.version="19.3.0"});var Rg=zi((WM,Dg)=>{"use strict";function Ag(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ag)}catch(e){console.error(e)}}Ag(),Dg.exports=Lg()});var mS=zi(Vh=>{"use strict";var je=Eg(),vm=ro(),$5=Rg();function D(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 mm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function da(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function pm(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 Sm(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 Bg(e){if(da(e)!==e)throw Error(D(188))}function X5(e){var t=e.alternate;if(!t){if(t=da(e),t===null)throw Error(D(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return Bg(r),e;if(n===s)return Bg(r),t;n=n.sibling}throw Error(D(188))}if(i.return!==s.return)i=r,s=n;else{for(var l=!1,a=r.child;a;){if(a===i){l=!0,i=r,s=n;break}if(a===s){l=!0,s=r,i=n;break}a=a.sibling}if(!l){for(a=n.child;a;){if(a===i){l=!0,i=n,s=r;break}if(a===s){l=!0,s=n,i=r;break}a=a.sibling}if(!l)throw Error(D(189))}}if(i.alternate!==s)throw Error(D(190))}if(i.tag!==3)throw Error(D(188));return i.stateNode.current===i?e:t}function ym(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=ym(e),t!==null)return t;e=e.sibling}return null}function qt(e,t,i,s,r,n){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,s,r,n)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&qt(e.child,t,i,s,r,n))return!0;e=e.sibling}return!1}function jr(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function kg(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function bm(e){var t=[null,null],i=jr(e);return i===null||wm(t,e,i.child,{foundSelf:!1}),t}function wm(e,t,i,s){for(;i!==null;){if(i===t)s.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(s.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&wm(e,t,i.child,s))return!0;i=i.sibling}return!1}function Ke(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(D(559))}}var yn=null,Nu=null;function Z5(e,t,i){return e===i?!0:e===t?(yn=e,!0):!1}function Q5(e,t,i){return e===i?(Nu=e,!1):e===t?(Nu!==null&&(yn=e),!0):!1}function Og(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function zu(e,t,i){for(var s=0,r=e;r;r=i(r))s++;r=0;for(var n=t;n;n=i(n))r++;for(;0<s-r;)e=i(e),s--;for(;0<r-s;)t=i(t),r--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var _e=Object.assign,J5=Symbol.for("react.element"),ho=Symbol.for("react.transitional.element"),Bl=Symbol.for("react.portal"),bn=Symbol.for("react.fragment"),Cm=Symbol.for("react.strict_mode"),Hu=Symbol.for("react.profiler"),xm=Symbol.for("react.consumer"),Wi=Symbol.for("react.context"),Gd=Symbol.for("react.forward_ref"),Uu=Symbol.for("react.suspense"),Pu=Symbol.for("react.suspense_list"),Kd=Symbol.for("react.memo"),Vs=Symbol.for("react.lazy"),Iu=Symbol.for("react.activity"),ew=Symbol.for("react.legacy_hidden"),tw=Symbol.for("react.memo_cache_sentinel"),Fu=Symbol.for("react.view_transition"),iw=Symbol.for("react.recoverable"),Ng=Symbol.iterator;function Tl(e){return e===null||typeof e!="object"?null:(e=Ng&&e[Ng]||e["@@iterator"],typeof e=="function"?e:null)}var sw=Symbol.for("react.client.reference");function qu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===sw?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bn:return"Fragment";case Hu:return"Profiler";case Cm:return"StrictMode";case Uu:return"Suspense";case Pu:return"SuspenseList";case Iu:return"Activity";case Fu:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Bl:return"Portal";case Wi:return e.displayName||"Context";case xm:return(e._context.displayName||"Context")+".Consumer";case Gd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Kd:return t=e.displayName||null,t!==null?t:qu(e.type)||"Memo";case Vs:t=e._payload,e=e._init;try{return qu(e(t))}catch{}}return null}var kl=Array.isArray,q=vm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=$5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Nr={pending:!1,data:null,method:null,action:null},Wu=[],wn=-1;function Xi(e){return{current:e}}function gt(e){0>wn||(e.current=Wu[wn],Wu[wn]=null,wn--)}function pe(e,t){wn++,Wu[wn]=e.current,e.current=t}var Ki=Xi(null),Xl=Xi(null),Js=Xi(null),Xo=Xi(null);function Zo(e,t){switch(pe(Js,t),pe(Xl,e),pe(Ki,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$v(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$v(t),e=Gp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}gt(Ki),pe(Ki,e)}function qn(){gt(Ki),gt(Xl),gt(Js)}function Vu(e){var t=e.memoizedState;t!==null&&(Qn._currentValue=t.memoizedState,pe(Xo,e)),t=Ki.current;var i=Gp(t,e.type);t!==i&&(pe(Xl,e),pe(Ki,i))}function Qo(e){Xl.current===e&&(gt(Ki),gt(Xl)),Xo.current===e&&(gt(Xo),Qn._currentValue=Nr)}var ru,zg;function qs(e){if(ru===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ru=t&&t[1]||"",zg=-1<i.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Nh+e+p_}var kh=!1;function zh(e,t){if(!e||kh)return"";kh=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(_){var c=_}Reflect.construct(e,[],d)}else{try{d.call()}catch(_){c=_}d=!1;try{var f=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),d=!0,new e}finally{d&&(f!==void 0?Object.defineProperty(e.prototype,"props",f):delete e.prototype.props)}}}else{try{throw Error()}catch(_){c=_}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(_){if(_&&c&&typeof _.stack=="string")return[_.stack,c.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=s.DetermineComponentFrameRoot(),l=n[0],a=n[1];if(l&&a){var o=l.split(`
4
+ `+ru+e+zg}var nu=!1;function lu(e,t){if(!e||nu)return"";nu=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(_){var d=_}Reflect.construct(e,[],u)}else{try{u.call()}catch(_){d=_}u=!1;try{var f=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),u=!0,new e}finally{u&&(f!==void 0?Object.defineProperty(e.prototype,"props",f):delete e.prototype.props)}}}else{try{throw Error()}catch(_){d=_}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(_){if(_&&d&&typeof _.stack=="string")return[_.stack,d.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=s.DetermineComponentFrameRoot(),l=n[0],a=n[1];if(l&&a){var o=l.split(`
5
5
  `),h=a.split(`
6
- `);for(r=s=0;s<o.length&&!o[s].includes("DetermineComponentFrameRoot");)s++;for(;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;if(s===o.length||r===h.length)for(s=o.length-1,r=h.length-1;1<=s&&0<=r&&o[s]!==h[r];)r--;for(;1<=s&&0<=r;s--,r--)if(o[s]!==h[r]){if(s!==1||r!==1)do if(s--,r--,0>r||o[s]!==h[r]){var u=`
7
- `+o[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=r);break}}}finally{kh=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ss(i):""}function QS(e,t){switch(e.tag){case 26:case 27:case 5:return ss(e.type);case 16:return ss("Lazy");case 13:return e.child!==t&&t!==null?ss("Suspense Fallback"):ss("Suspense");case 19:return ss("SuspenseList");case 0:case 15:return zh(e.type,!1);case 11:return zh(e.type.render,!1);case 1:return zh(e.type,!0);case 31:return ss("Activity");case 30:return ss("ViewTransition");default:return""}}function S_(e){try{var t="",i=null;do t+=QS(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
6
+ `);for(r=s=0;s<o.length&&!o[s].includes("DetermineComponentFrameRoot");)s++;for(;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;if(s===o.length||r===h.length)for(s=o.length-1,r=h.length-1;1<=s&&0<=r&&o[s]!==h[r];)r--;for(;1<=s&&0<=r;s--,r--)if(o[s]!==h[r]){if(s!==1||r!==1)do if(s--,r--,0>r||o[s]!==h[r]){var c=`
7
+ `+o[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=r);break}}}finally{nu=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?qs(i):""}function rw(e,t){switch(e.tag){case 26:case 27:case 5:return qs(e.type);case 16:return qs("Lazy");case 13:return e.child!==t&&t!==null?qs("Suspense Fallback"):qs("Suspense");case 19:return qs("SuspenseList");case 0:case 15:return lu(e.type,!1);case 11:return lu(e.type.render,!1);case 1:return lu(e.type,!0);case 31:return qs("Activity");case 30:return qs("ViewTransition");default:return""}}function Hg(e){try{var t="",i=null;do t+=rw(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
8
8
  Error generating stack: `+s.message+`
9
- `+s.stack}}var yc=Object.prototype.hasOwnProperty,Cu=ke.unstable_scheduleCallback,Lh=ke.unstable_cancelCallback,JS=ke.unstable_shouldYield,$S=ke.unstable_requestPaint,At=ke.unstable_now,ey=ke.unstable_getCurrentPriorityLevel,av=ke.unstable_ImmediatePriority,ov=ke.unstable_UserBlockingPriority,Xa=ke.unstable_NormalPriority,ty=ke.unstable_LowPriority,hv=ke.unstable_IdlePriority,iy=ke.log,sy=ke.unstable_setDisableYieldValue,vl=null,Rt=null;function os(e){if(typeof iy=="function"&&sy(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(vl,e)}catch{}}var Ot=Math.clz32?Math.clz32:ly,ry=Math.log,ny=Math.LN2;function ly(e){return e>>>=0,e===0?32:31-(ry(e)/ny|0)|0}var na=256,la=262144,aa=4194304;function Ks(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&-e;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 yo(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,l=e.pingedLanes;e=e.warmLanes;var a=s&134217727;return a!==0?(s=a&~n,s!==0?r=Ks(s):(l&=a,l!==0?r=Ks(l):i||(i=a&~e,i!==0&&(r=Ks(i))))):(a=s&~n,a!==0?r=Ks(a):l!==0?r=Ks(l):i||(i=s&~e,i!==0&&(r=Ks(i)))),r===0?0:t!==0&&t!==r&&(t&n)===0&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function gl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function cv(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-Ot(i),r=1<<s;t|=e[s],i&=~r}return t}function ay(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+5e3;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 uv(){var e=aa;return aa<<=1,(aa&62914560)===0&&(aa=4194304),e}function Hh(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function pl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oy(e,t,i,s,r,n){var l=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var a=e.entanglements,o=e.expirationTimes,h=e.hiddenUpdates;for(i=l&~i;0<i;){var u=31-Ot(i),d=1<<u;a[u]=0,o[u]=-1;var c=h[u];if(c!==null)for(h[u]=null,u=0;u<c.length;u++){var f=c[u];f!==null&&(f.lane&=-536870913)}i&=~d}s!==0&&dv(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(l&~t))}function dv(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ot(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function fv(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-Ot(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function _v(e,t){var i=t&-t;return i=(i&42)!==0?1:Eu(i),(i&(e.suspendedLanes|t))!==0?0:i}function Eu(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 xu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function mv(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Z0(e.type))}function y_(e,t){var i=J.p;try{return J.p=e,t()}finally{J.p=i}}var Vi=Math.random().toString(36).slice(2),Ze="__reactFiber$"+Vi,wt="__reactProps$"+Vi,cn="__reactContainer$"+Vi,b_="__reactEvents$"+Vi,hy="__reactListeners$"+Vi,cy="__reactHandles$"+Vi,w_="__reactResources$"+Vi,Sl="__reactMarker$"+Vi,Fa="__reactLoad$"+Vi;function bo(e){delete e[Ze],delete e[wt],delete e[hy],delete e[cy]}function Gs(e){var t;if(t=e[Ze])return t;for(var i=e.parentNode;i;){if(t=i[cn]||i[Ze]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=qm(e);e!==null;){if(i=e[Ze])return i;e=qm(e)}return t}e=i,i=e.parentNode}return null}function un(e){if(e=e[Ze]||e[cn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Hn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(b(33))}function Yr(e){var t=e[w_];return t||(t=e[w_]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Sl]=!0}function vv(e){e[Fa]=void 0}var gv=new Set,pv={};function lr(e,t){Qr(e,t),Qr(e+"Capture",t)}function Qr(e,t){for(pv[e]=t,e=0;e<t.length;e++)gv.add(t[e])}var uy=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]*$"),C_={},E_={};function dy(e){return yc.call(E_,e)?!0:yc.call(C_,e)?!1:uy.test(e)?E_[e]=!0:(C_[e]=!0,!1)}var W=!1;function x_(){var e=W;return W=!1,e}function xa(e,t,i){if(dy(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function oa(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function Ri(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fy(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(l){i=""+l,n.call(this,l)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(l){i=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bc(e){if(!e._valueTracker){var t=Sv(e)?"checked":"value";e._valueTracker=fy(e,t,""+e[t])}}function yv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Sv(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}var _y=/[\n"\\]/g;function Gt(e){return e.replace(_y,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wc(e,t,i,s,r,n,l,a){e.name="",l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.type=l:e.removeAttribute("type"),t!=null?l==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):l!=="submit"&&l!=="reset"||e.removeAttribute("value"),t!=null?l==="number"&&e.value==t?Uh(e,xt(e.value)):Uh(e,xt(t)):i!=null?Uh(e,xt(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+xt(a):e.removeAttribute("name")}function bv(e,t,i,s,r,n,l,a){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){bc(e);return}i=i!=null?""+xt(i):"",t=t!=null?""+xt(t):i,a||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=a?e.checked:!!s,e.defaultChecked=!!s,l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.name=l),bc(e)}function Uh(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Kr(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+xt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function wv(e,t,i){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+xt(i):""}function Cv(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(b(92));if(Ln(s)){if(1<s.length)throw Error(b(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=xt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),bc(e)}function Jr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var my=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 T_(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||my.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Ev(e,t,i){if(t!=null&&typeof t!="object")throw Error(b(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",W=!0);for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&(T_(e,r,s),W=!0)}else for(var n in t)t.hasOwnProperty(n)&&T_(e,n,t[n])}function Tu(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 vy=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"],["maskType","mask-type"],["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"]]),gy=/^[\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 Ta(e){return gy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function mi(){}var Cc=null;function Du(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Or=null,Vr=null;function D_(e){var t=un(e);if(t&&(e=t.stateNode)){var i=e[wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(wc(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Gt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[wt]||null;if(!r)throw Error(b(90));wc(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&yv(s)}break e;case"textarea":wv(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Kr(e,!!i.multiple,t,!1)}}}var qh=!1;function xv(e,t,i){if(qh)return e(t,i);qh=!0;try{var s=e(t);return s}finally{if(qh=!1,(Or!==null||Vr!==null)&&(zo(),Or&&(t=Or,e=Vr,Vr=Or=null,D_(t),e)))for(t=0;t<e.length;t++)D_(e[t])}}function el(e,t){var i=e.stateNode;if(i===null)return null;var s=i[wt]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(b(231,t,typeof i));return i}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ec=!1;if(Li)try{wr={},Object.defineProperty(wr,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",wr,wr),window.removeEventListener("test",wr,wr)}catch{Ec=!1}var wr,hs=null,Mu=null,Da=null;function Tv(){if(Da)return Da;var e,t=Mu,i=t.length,s,r="value"in hs?hs.value:hs.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var l=i-e;for(s=1;s<=l&&t[i-s]===r[n-s];s++);return Da=r.slice(e,1<s?1-s:void 0)}function Ma(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 ha(){return!0}function M_(){return!1}function dt(e){function t(i,s,r,n,l){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(i=e[a],this[a]=i?i(n):n[a]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?ha:M_,this.isPropagationStopped=M_,this}return ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ha)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ha)},persist:function(){},isPersistent:ha}),t}var As={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wo=dt(As),yl=ae({},As,{view:0,detail:0}),py=dt(yl),Yh,Kh,Rn,Co=ae({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Au,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Rn&&(Rn&&e.type==="mousemove"?(Yh=e.screenX-Rn.screenX,Kh=e.screenY-Rn.screenY):Kh=Yh=0,Rn=e),Yh)},movementY:function(e){return"movementY"in e?e.movementY:Kh}}),A_=dt(Co),Sy=ae({},Co,{dataTransfer:0}),yy=dt(Sy),by=ae({},yl,{relatedTarget:0}),Vh=dt(by),wy=ae({},As,{animationName:0,elapsedTime:0,pseudoElement:0}),Cy=dt(wy),Ey=ae({},As,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xy=dt(Ey),Ty=ae({},As,{data:0}),R_=dt(Ty),Dy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},My={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"},Ay={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ry(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ay[e])?!!t[e]:!1}function Au(){return Ry}var Oy=ae({},yl,{key:function(e){if(e.key){var t=Dy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ma(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?My[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Au,charCode:function(e){return e.type==="keypress"?Ma(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ma(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),By=dt(Oy),Ny=ae({},Co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O_=dt(Ny),ky=ae({},As,{submitter:0}),zy=dt(ky),Ly=ae({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Au}),Hy=dt(Ly),Uy=ae({},As,{propertyName:0,elapsedTime:0,pseudoElement:0}),qy=dt(Uy),Yy=ae({},Co,{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}),Ky=dt(Yy),Vy=ae({},As,{newState:0,oldState:0,source:0}),Py=dt(Vy),Gy=[9,13,27,32],Ru=Li&&"CompositionEvent"in window,Yn=null;Li&&"documentMode"in document&&(Yn=document.documentMode);var Iy=Li&&"TextEvent"in window&&!Yn,Dv=Li&&(!Ru||Yn&&8<Yn&&11>=Yn),B_=" ",N_=!1;function Mv(e,t){switch(e){case"keyup":return Gy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Av(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function jy(e,t){switch(e){case"compositionend":return Av(t);case"keypress":return t.which!==32?null:(N_=!0,B_);case"textInput":return e=t.data,e===B_&&N_?null:e;default:return null}}function Xy(e,t){if(Br)return e==="compositionend"||!Ru&&Mv(e,t)?(e=Tv(),Da=Mu=hs=null,Br=!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 Dv&&t.locale!=="ko"?null:t.data;default:return null}}var Fy={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 k_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fy[e.type]:t==="textarea"}function Rv(e,t,i,s){Or?Vr?Vr.push(s):Vr=[s]:Or=s,t=go(t,"onChange"),0<t.length&&(i=new wo("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Kn=null,tl=null;function Wy(e){x0(e,0)}function Eo(e){var t=Hn(e);if(yv(t))return e}function z_(e,t){if(e==="change")return t}var Ov=!1;Li&&(Li?(ua="oninput"in document,ua||(Ph=document.createElement("div"),Ph.setAttribute("oninput","return;"),ua=typeof Ph.oninput=="function"),ca=ua):ca=!1,Ov=ca&&(!document.documentMode||9<document.documentMode));var ca,ua,Ph;function L_(){Kn&&(Kn.detachEvent("onpropertychange",Bv),tl=Kn=null)}function Bv(e){if(e.propertyName==="value"&&Eo(tl)){var t=[];Rv(t,tl,e,Du(e)),xv(Wy,t)}}function Zy(e,t,i){e==="focusin"?(L_(),Kn=t,tl=i,Kn.attachEvent("onpropertychange",Bv)):e==="focusout"&&L_()}function Qy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Eo(tl)}function Jy(e,t){if(e==="click")return Eo(t)}function $y(e,t){if(e==="input"||e==="change")return Eo(t)}function eb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:eb;function il(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!yc.call(t,r)||!Nt(e[r],t[r]))return!1}return!0}function xc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function H_(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function U_(e,t){var i=H_(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=H_(i)}}function Nv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kv(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xc(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=xc(e.document)}return t}function Ou(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 tb=Li&&"documentMode"in document&&11>=document.documentMode,Nr=null,Tc=null,Vn=null,Dc=!1;function q_(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Dc||Nr==null||Nr!==xc(s)||(s=Nr,"selectionStart"in s&&Ou(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Vn&&il(Vn,s)||(Vn=s,s=go(Tc,"onSelect"),0<s.length&&(t=new wo("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Nr)))}function qs(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var kr={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionrun:qs("Transition","TransitionRun"),transitionstart:qs("Transition","TransitionStart"),transitioncancel:qs("Transition","TransitionCancel"),transitionend:qs("Transition","TransitionEnd")},Gh={},zv={};Li&&(zv=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function ar(e){if(Gh[e])return Gh[e];if(!kr[e])return e;var t=kr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in zv)return Gh[e]=t[i];return e}var Lv=ar("animationend"),Hv=ar("animationiteration"),Uv=ar("animationstart"),ib=ar("transitionrun"),sb=ar("transitionstart"),rb=ar("transitioncancel"),qv=ar("transitionend"),Yv=new Map,Mc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Mc.push("scrollEnd");function ri(e,t){Yv.set(e,t),lr(t,[e])}var nb=0;function Hi(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=si.identifierPrefix;var i=nb++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function Y_(e){if(e==null||typeof e=="string")return e;var t=null,i=Wr;if(i!==null)for(var s=0;s<i.length;s++){var r=e[i[s]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Pi(e,t){return e=Y_(e),t=Y_(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Wa=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)},Kt=[],zr=0,Bu=0;function xo(){for(var e=zr,t=Bu=zr=0;t<e;){var i=Kt[t];Kt[t++]=null;var s=Kt[t];Kt[t++]=null;var r=Kt[t];Kt[t++]=null;var n=Kt[t];if(Kt[t++]=null,s!==null&&r!==null){var l=s.pending;l===null?r.next=r:(r.next=l.next,l.next=r),s.pending=r}n!==0&&Kv(i,r,n)}}function To(e,t,i,s){Kt[zr++]=e,Kt[zr++]=t,Kt[zr++]=i,Kt[zr++]=s,Bu|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Nu(e,t,i,s){return To(e,t,i,s),Za(e)}function or(e,t){return To(e,null,null,t),Za(e)}function Kv(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-Ot(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function Za(e){if(50<Jn)throw Jn=0,Ua=null,Error(b(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Lr={};function lb(e,t,i,s){this.tag=e,this.key=i,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(e,t,i,s){return new lb(e,t,i,s)}function ku(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var i=e.alternate;return i===null?(i=St(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Vv(e,t){e.flags&=1206910978;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Aa(e,t,i,s,r,n){var l=0;if(s=e,typeof s=="function")ku(s)&&(l=1);else if(typeof s=="string")l=Bw(e,i,pi.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case mc:return e=St(31,i,t,r),e.elementType=mc,e.lanes=n,e;case Ar:return Xs(i.children,r,n,t);case nv:l=8,r|=24;break;case dc:return e=St(12,i,t,r|2),e.elementType=dc,e.lanes=n,e;case fc:return e=St(13,i,t,r),e.elementType=fc,e.lanes=n,e;case _c:return e=St(19,i,t,r),e.elementType=_c,e.lanes=n,e;case XS:case vc:return e=r|32,e=St(30,i,t,e),e.elementType=vc,e.lanes=n,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _i:l=10;break e;case lv:l=9;break e;case bu:l=11;break e;case wu:l=14;break e;case ns:l=16,s=null;break e}l=29,i=Error(b(130,e===null?"null":typeof e,"")),s=null}return t=St(l,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function Xs(e,t,i,s){return e=St(7,e,s,t),e.lanes=i,e}function Ih(e,t,i){return e=St(6,e,null,t),e.lanes=i,e}function Pv(e){var t=St(18,null,null,0);return t.stateNode=e,t}function jh(e,t,i){return t=St(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var K_=new WeakMap;function It(e,t){if(typeof e=="object"&&e!==null){var i=K_.get(e);return i!==void 0?i:(t={value:e,source:t,stack:S_(t)},K_.set(e,t),t)}return{value:e,source:t,stack:S_(t)}}var Hr=[],Ur=0,Qa=null,sl=0,Vt=[],Pt=0,Es=null,vi=1,gi="";function Bi(e,t){Hr[Ur++]=sl,Hr[Ur++]=Qa,Qa=e,sl=t}function Gv(e,t,i){Vt[Pt++]=vi,Vt[Pt++]=gi,Vt[Pt++]=Es,Es=e;var s=vi;e=gi;var r=32-Ot(s)-1;s&=~(1<<r),i+=1;var n=32-Ot(t)+r;if(30<n){var l=r-r%5;n=(s&(1<<l)-1).toString(32),s>>=l,r-=l,vi=1<<32-Ot(t)+r|i<<r|s,gi=n+e}else vi=1<<n|i<<r|s,gi=e}function Do(e){e.return!==null&&(Bi(e,1),Gv(e,1,0))}function zu(e){for(;e===Qa;)Qa=Hr[--Ur],Hr[Ur]=null,sl=Hr[--Ur],Hr[Ur]=null;for(;e===Es;)Es=Vt[--Pt],Vt[Pt]=null,gi=Vt[--Pt],Vt[Pt]=null,vi=Vt[--Pt],Vt[Pt]=null}function Iv(e,t){Vt[Pt++]=vi,Vt[Pt++]=gi,Vt[Pt++]=Es,vi=t.id,gi=t.overflow,Es=e}var Ve=null,ce=null,V=!1,ms=null,jt=!1,Ac=Error(b(519));function xs(e){var t=Error(b(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rl(It(t,e)),Ac}function V_(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Ze]=e,t[wt]=s,i){case"dialog":G("cancel",t),G("close",t);break;case"iframe":case"object":case"embed":G("load",t);break;case"video":case"audio":for(i=0;i<ol.length;i++)G(ol[i],t);break;case"source":G("error",t);break;case"img":case"image":case"link":G("error",t),G("load",t);break;case"details":G("toggle",t);break;case"input":G("invalid",t),bv(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":G("invalid",t);break;case"textarea":G("invalid",t),Cv(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||D0(t.textContent,i)?(s.popover!=null&&(G("beforetoggle",t),G("toggle",t)),s.onScroll!=null&&G("scroll",t),s.onScrollEnd!=null&&G("scrollend",t),s.onClick!=null&&(t.onclick=mi),t=!0):t=!1,t||xs(e,!0)}function Ja(e){for(Ve=e.return;Ve;)switch(Ve.tag){case 5:case 31:case 13:jt=!1;return;case 27:case 3:jt=!0;return;default:Ve=Ve.return}}function Cr(e){if(e!==Ve)return!1;if(!V)return Ja(e),V=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||fu(e.type,e.memoizedProps)),i=!i),i&&ce&&xs(e),Ja(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));ce=Um(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));ce=Um(e)}else t===27?(t=ce,Rs(e.type)?(e=gu,gu=null,ce=e):ce=t):ce=Ve?Xt(e.stateNode.nextSibling):null;return!0}function Qs(){ce=Ve=null,V=!1}function Xh(){var e=ms;return e!==null&&(gt===null?gt=e:gt.push.apply(gt,e),ms=null),e}function rl(e){ms===null?ms=[e]:ms.push(e)}var Rc=bi(null),hr=null,Ni=null;function cs(e,t,i){ue(Rc,t._currentValue),t._currentValue=i}function zi(e){e._currentValue=Rc.current,Je(Rc)}function Ra(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Oc(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var l=r.child;n=n.firstContext;e:for(;n!==null;){var a=n;n=r;for(var o=0;o<t.length;o++)if(a.context===t[o]){n.lanes|=i,a=n.alternate,a!==null&&(a.lanes|=i),Ra(n.return,i,e),s||(l=null);break e}n=a.next}}else if(r.tag===18){if(l=r.return,l===null)throw Error(b(341));l.lanes|=i,n=l.alternate,n!==null&&(n.lanes|=i),Ra(l,i,e),l=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=i,l=r.alternate,l!==null&&(l.lanes|=i),Ra(r.return,i,e),l=r.child,l=l!==null?l.sibling:null):l=r.child;if(l!==null)l.return=r;else for(l=r;l!==null;){if(l===e){l=null;break}if(r=l.sibling,r!==null){r.return=l.return,l=r;break}l=l.return}r=l}}function Js(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if((r.flags&524288)!==0)n=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var l=r.alternate;if(l===null)throw Error(b(387));if(l=l.memoizedProps,l!==null){var a=r.type;Nt(r.pendingProps.value,l.value)||(e!==null?e.push(a):e=[a])}}else if(r===Ga.current){if(l=r.alternate,l===null)throw Error(b(387));l.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(an):e=[an])}r=r.return}return e!==null&&Oc(t,e,i,s),t.flags|=262144,e!==null}function $a(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $s(e){hr=e,Ni=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qe(e){return jv(hr,e)}function da(e,t){return hr===null&&$s(e),jv(e,t)}function jv(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ni===null){if(e===null)throw Error(b(308));Ni=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ni=Ni.next=t;return i}var ab=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},ob=ke.unstable_scheduleCallback,hb=ke.unstable_NormalPriority,Me={$$typeof:_i,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lu(){return{controller:new ab,data:new Map,refCount:0}}function bl(e){e.refCount--,e.refCount===0&&ob(hb,function(){e.controller.abort()})}function P_(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];i.indexOf(s)===-1&&i.push(s)}}}var Un=null;function cb(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pn=null,Bc=0,er=0,Pr=null;function ub(e,t){if(Pn===null){var i=Pn=[];Bc=0,er=cd(),Pr={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Bc++,t.then(G_,G_),t}function G_(){if(--Bc===0&&(Un=null,Pn!==null)){Pr!==null&&(Pr.status="fulfilled");var e=Pn;Pn=null,er=0,Pr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function db(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var I_=L.S;L.S=function(e,t){if(c0=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ub(e,t),Un!==null)for(var i=rn;i!==null;)P_(i,Un),i=i.next;if(i=e.types,i!==null){for(var s=rn;s!==null;)P_(s,i),s=s.next;if(er!==0){s=Un,s===null&&(s=Un=[]);for(var r=0;r<i.length;r++){var n=i[r];s.indexOf(n)===-1&&s.push(n)}}}I_!==null&&I_(e,t)};var Fs=bi(null);function Hu(){var e=Fs.current;return e!==null?e:le.pooledCache}function Oa(e,t){t===null?ue(Fs,Fs.current):ue(Fs,t.pool)}function Xv(){var e=Hu();return e===null?null:{parent:Me._currentValue,pool:e}}var dn=Error(b(460)),Uu=Error(b(474)),Mo=Error(b(542)),eo={then:function(){}};function j_(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Fv(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(mi,mi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,F_(e),e===void 0&&!("reason"in t)?Error(b(600)):e;default:if(typeof t.status=="string")t.then(mi,mi);else{if(e=le,e!==null&&100<e.shellSuspendCounter)throw Error(b(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,F_(e),e}throw Ws=t,dn}}function Vs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ws=i,dn):i}}var Ws=null;function X_(){if(Ws===null)throw Error(b(459));var e=Ws;return Ws=null,e}function F_(e){if(e===dn||e===Mo)throw Error(b(483))}var Gr=null,nl=0;function fa(e){var t=nl;return nl+=1,Gr===null&&(Gr=[]),Fv(Gr,e,t)}function is(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function _a(e,t){throw t.$$typeof===jS?Error(b(525)):(e=Object.prototype.toString.call(t),Error(b(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Wv(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function i(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function s(m){for(var v=new Map;m!==null;)m.key===null?v.set(m.index,m):v.set(m.key,m),m=m.sibling;return v}function r(m,v){return m=ki(m,v),m.index=0,m.sibling=null,m}function n(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=134217730,v)):(m.flags|=1048576,v)}function l(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function a(m,v,g,S){return v===null||v.tag!==6?(v=Ih(g,m.mode,S),v.return=m,v):(v=r(v,g),v.return=m,v)}function o(m,v,g,S){var C=g.type;return C===Ar?(m=u(m,v,g.props.children,S,g.key),is(m,g),m):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ns&&Vs(C)===v.type)?(v=r(v,g.props),is(v,g),v.return=m,v):(v=Aa(g.type,g.key,g.props,null,m.mode,S),is(v,g),v.return=m,v)}function h(m,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=jh(g,m.mode,S),v.return=m,v):(v=r(v,g.children||[]),v.return=m,v)}function u(m,v,g,S,C){return v===null||v.tag!==7?(v=Xs(g,m.mode,S,C),v.return=m,v):(v=r(v,g),v.return=m,v)}function d(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=Ih(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ra:return g=Aa(v.type,v.key,v.props,null,m.mode,g),is(g,v),g.return=m,g;case zn:return v=jh(v,m.mode,g),v.return=m,v;case ns:return v=Vs(v),d(m,v,g)}if(Ln(v)||An(v))return v=Xs(v,m.mode,g,null),v.return=m,v;if(typeof v.then=="function")return d(m,fa(v),g);if(v.$$typeof===_i)return d(m,da(m,v),g);_a(m,v)}return null}function c(m,v,g,S){var C=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return C!==null?null:a(m,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ra:return g.key===C?o(m,v,g,S):null;case zn:return g.key===C?h(m,v,g,S):null;case ns:return g=Vs(g),c(m,v,g,S)}if(Ln(g)||An(g))return C!==null?null:u(m,v,g,S,null);if(typeof g.then=="function")return c(m,v,fa(g),S);if(g.$$typeof===_i)return c(m,v,da(m,g),S);_a(m,g)}return null}function f(m,v,g,S,C){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return m=m.get(g)||null,a(v,m,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ra:return m=m.get(S.key===null?g:S.key)||null,o(v,m,S,C);case zn:return m=m.get(S.key===null?g:S.key)||null,h(v,m,S,C);case ns:return S=Vs(S),f(m,v,g,S,C)}if(Ln(S)||An(S))return m=m.get(g)||null,u(v,m,S,C,null);if(typeof S.then=="function")return f(m,v,g,fa(S),C);if(S.$$typeof===_i)return f(m,v,g,da(v,S),C);_a(v,S)}return null}function _(m,v,g,S){for(var C=null,A=null,T=v,k=v=0,Z=null;T!==null&&k<g.length;k++){T.index>k?(Z=T,T=null):Z=T.sibling;var K=c(m,T,g[k],S);if(K===null){T===null&&(T=Z);break}e&&T&&K.alternate===null&&t(m,T),v=n(K,v,k),A===null?C=K:A.sibling=K,A=K,T=Z}if(k===g.length)return i(m,T),V&&Bi(m,k),C;if(T===null){for(;k<g.length;k++)T=d(m,g[k],S),T!==null&&(v=n(T,v,k),A===null?C=T:A.sibling=T,A=T);return V&&Bi(m,k),C}for(T=s(T);k<g.length;k++)Z=f(T,m,k,g[k],S),Z!==null&&(e&&(K=Z.alternate,K!==null&&T.delete(K.key===null?k:K.key)),v=n(Z,v,k),A===null?C=Z:A.sibling=Z,A=Z);return e&&T.forEach(function(F){return t(m,F)}),V&&Bi(m,k),C}function p(m,v,g,S){if(g==null)throw Error(b(151));for(var C=null,A=null,T=v,k=v=0,Z=null,K=g.next();T!==null&&!K.done;k++,K=g.next()){T.index>k?(Z=T,T=null):Z=T.sibling;var F=c(m,T,K.value,S);if(F===null){T===null&&(T=Z);break}e&&T&&F.alternate===null&&t(m,T),v=n(F,v,k),A===null?C=F:A.sibling=F,A=F,T=Z}if(K.done)return i(m,T),V&&Bi(m,k),C;if(T===null){for(;!K.done;k++,K=g.next())K=d(m,K.value,S),K!==null&&(v=n(K,v,k),A===null?C=K:A.sibling=K,A=K);return V&&Bi(m,k),C}for(T=s(T);!K.done;k++,K=g.next())K=f(T,m,k,K.value,S),K!==null&&(e&&(Z=K.alternate,Z!==null&&T.delete(Z.key===null?k:Z.key)),v=n(K,v,k),A===null?C=K:A.sibling=K,A=K);return e&&T.forEach(function(wn){return t(m,wn)}),V&&Bi(m,k),C}function y(m,v,g,S){if(typeof g=="object"&&g!==null&&g.type===Ar&&g.key===null&&g.props.ref===void 0&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ra:e:{for(var C=g.key;v!==null;){if(v.key===C){if(C=g.type,C===Ar){if(v.tag===7){i(m,v.sibling),S=r(v,g.props.children),is(S,g),S.return=m,m=S;break e}}else if(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ns&&Vs(C)===v.type){i(m,v.sibling),S=r(v,g.props),is(S,g),S.return=m,m=S;break e}i(m,v);break}else t(m,v);v=v.sibling}g.type===Ar?(S=Xs(g.props.children,m.mode,S,g.key),is(S,g),S.return=m,m=S):(S=Aa(g.type,g.key,g.props,null,m.mode,S),is(S,g),S.return=m,m=S)}return l(m);case zn:e:{for(C=g.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){i(m,v.sibling),S=r(v,g.children||[]),S.return=m,m=S;break e}else{i(m,v);break}else t(m,v);v=v.sibling}S=jh(g,m.mode,S),S.return=m,m=S}return l(m);case ns:return g=Vs(g),y(m,v,g,S)}if(Ln(g))return _(m,v,g,S);if(An(g)){if(C=An(g),typeof C!="function")throw Error(b(150));return g=C.call(g),p(m,v,g,S)}if(typeof g.then=="function")return y(m,v,fa(g),S);if(g.$$typeof===_i)return y(m,v,da(m,g),S);_a(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,v!==null&&v.tag===6?(i(m,v.sibling),S=r(v,g),S.return=m,m=S):(i(m,v),S=Ih(g,m.mode,S),S.return=m,m=S),l(m)):i(m,v)}return function(m,v,g,S){try{nl=0;var C=y(m,v,g,S);return Gr=null,C}catch(T){if(T===dn||T===Mo)throw T;var A=St(29,T,null,m.mode);return A.lanes=S,A.return=m,A}}}var tr=Wv(!0),Zv=Wv(!1),ls=!1;function qu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(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 vs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gs(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Q&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Za(e),Kv(e,null,i),t}return To(e,s,t,i),Za(e)}function Gn(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,fv(e,i)}}function Fh(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var l={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=l:n=n.next=l,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var kc=!1;function In(){if(kc){var e=Pr;if(e!==null)throw e}}function jn(e,t,i,s){kc=!1;var r=e.updateQueue;ls=!1;var n=r.firstBaseUpdate,l=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var o=a,h=o.next;o.next=null,l===null?n=h:l.next=h,l=o;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==l&&(a===null?u.firstBaseUpdate=h:a.next=h,u.lastBaseUpdate=o))}if(n!==null){var d=r.baseState;l=0,u=h=o=null,a=n;do{var c=a.lane&-536870913,f=c!==a.lane;if(f?(X&c)===c:(s&c)===c){c!==0&&c===er&&(kc=!0),u!==null&&(u=u.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var _=e,p=a;c=t;var y=i;switch(p.tag){case 1:if(_=p.payload,typeof _=="function"){d=_.call(y,d,c);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=p.payload,c=typeof _=="function"?_.call(y,d,c):_,c==null)break e;d=ae({},d,c);break e;case 2:ls=!0}}c=a.callback,c!==null&&(e.flags|=64,f&&(e.flags|=8192),f=r.callbacks,f===null?r.callbacks=[c]:f.push(c))}else f={lane:c,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(h=u=f,o=d):u=u.next=f,l|=c;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);u===null&&(o=d),r.baseState=o,r.firstBaseUpdate=h,r.lastBaseUpdate=u,n===null&&(r.shared.lanes=0),Ms|=l,e.lanes=l,e.memoizedState=d}}function Qv(e,t){if(typeof e!="function")throw Error(b(191,e));e.call(t)}function Jv(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Qv(i[e],t)}var Ts=bi(null),to=bi(0);function W_(e,t){e=Ki,ue(to,e),ue(Ts,t),Ki=e|t.baseLanes}function zc(){ue(to,Ki),ue(Ts,Ts.current)}function Yu(){Ki=to.current,Je(Ts),Je(to)}var tt=bi(null),nt=null;function ps(e){var t=e.alternate;ue($e,$e.current&1),ue(tt,e),nt===null&&(t===null||Ts.current!==null||t.memoizedState!==null)&&(nt=e)}function Lc(e){ue($e,$e.current),ue(tt,e),nt===null&&(nt=e)}function $v(e){e.tag===22?(ue($e,$e.current),ue(tt,e),nt===null&&(nt=e)):Ss()}function Ss(){ue($e,$e.current),ue(tt,tt.current)}function Tt(e){Je(tt),nt===e&&(nt=null),Je($e)}var $e=bi(0);function ll(e,t){ue(tt,tt.current),ue($e,t)}function Ku(e){Je($e),Je(tt),nt===e&&(nt=null)}function io(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||vu(i)||_d(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 Ui=0,q=null,re=null,De=null,so=!1,Ir=!1,ir=!1,ro=0,al=0,jr=null,fb=0;function be(){throw Error(b(321))}function Vu(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Nt(e[i],t[i]))return!1;return!0}function Pu(e,t,i,s,r,n){return Ui=n,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?Rg:Og,ir=!1,n=i(s,r),ir=!1,Ir&&(n=tg(t,i,s,r)),eg(e),n}function eg(e){L.H=no;var t=re!==null&&re.next!==null;if(Ui=0,De=re=q=null,so=!1,al=0,jr=null,t)throw Error(b(300));e===null||Ae||(e=e.dependencies,e!==null&&$a(e)&&(Ae=!0))}function tg(e,t,i,s){q=e;var r=0;do{if(Ir&&(jr=null),al=0,Ir=!1,25<=r)throw Error(b(301));if(r+=1,De=re=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}L.H=bb,n=t(i,s)}while(Ir);return n}function _b(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?wl(t):t,e=e.useState()[0],(re!==null?re.memoizedState:null)!==e&&(q.flags|=1024),t}function Gu(){var e=ro!==0;return ro=0,e}function Iu(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function ju(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}Ui=0,De=re=q=null,Ir=!1,al=ro=0,jr=null}function ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?q.memoizedState=De=e:De=De.next=e,De}function xe(){if(re===null){var e=q.alternate;e=e!==null?e.memoizedState:null}else e=re.next;var t=De===null?q.memoizedState:De.next;if(t!==null)De=t,re=e;else{if(e===null)throw q.alternate===null?Error(b(467)):Error(b(310));re=e,e={memoizedState:re.memoizedState,baseState:re.baseState,baseQueue:re.baseQueue,queue:re.queue,next:null},De===null?q.memoizedState=De=e:De=De.next=e}return De}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wl(e){var t=al;return al+=1,jr===null&&(jr=[]),e=Fv(jr,e,t),t=q,(De===null?t.memoizedState:De.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?Rg:Og),e}function Ro(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wl(e);if(e.$$typeof===WS)return;if(e.$$typeof===_i)return Qe(e)}throw Error(b(438,String(e)))}function Xu(e){var t=null,i=q.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=q.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Ao(),q.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=FS;return t.index++,i}function qi(e,t){return typeof t=="function"?t(e):t}function Ba(e){var t=xe();return Fu(t,re,e)}function Fu(e,t,i){var s=e.queue;if(s===null)throw Error(b(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var l=r.next;r.next=n.next,n.next=l}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var a=l=null,o=null,h=t,u=!1;do{var d=h.lane&-536870913;if(d!==h.lane?(X&d)===d:(Ui&d)===d){var c=h.revertLane;if(c===0)o!==null&&(o=o.next={lane:0,revertLane:0,gesture:null,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),d===er&&(u=!0);else if((Ui&c)===c){h=h.next,c===er&&(u=!0);continue}else d={lane:0,revertLane:h.revertLane,gesture:null,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null},o===null?(a=o=d,l=n):o=o.next=d,q.lanes|=c,Ms|=c;d=h.action,ir&&i(n,d),n=h.hasEagerState?h.eagerState:i(n,d)}else c={lane:d,revertLane:h.revertLane,gesture:h.gesture,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null},o===null?(a=o=c,l=n):o=o.next=c,q.lanes|=d,Ms|=d;h=h.next}while(h!==null&&h!==t);if(o===null?l=n:o.next=a,!Nt(n,e.memoizedState)&&(Ae=!0,u&&(i=Pr,i!==null)))throw i;e.memoizedState=n,e.baseState=l,e.baseQueue=o,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Wh(e){var t=xe(),i=t.queue;if(i===null)throw Error(b(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var l=r=r.next;do n=e(n,l.action),l=l.next;while(l!==r);Nt(n,t.memoizedState)||(Ae=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function ig(e,t,i){var s=q,r=xe(),n=V;if(n){if(i===void 0)throw Error(b(407));i=i()}else i=t();var l=!Nt((re||r).memoizedState,i);if(l&&(r.memoizedState=i,Ae=!0),r=r.queue,Wu(ng.bind(null,s,r,e),[e]),e=r.getSnapshot!==t||l||De!==null&&(De.memoizedState.tag&1)!==0,$r(e?9:8,{destroy:void 0},rg.bind(null,s,r,i,t),null),e){if(s.flags|=2048,le===null)throw Error(b(349));n||(Ui&127)!==0||sg(s,t,i)}return i}function sg(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=q.updateQueue,t===null?(t=Ao(),q.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function rg(e,t,i,s){t.value=i,t.getSnapshot=s,lg(t)&&ag(e)}function ng(e,t,i){return i(function(){lg(t)&&ag(e)})}function lg(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Nt(e,i)}catch{return!0}}function ag(e){var t=or(e,2);t!==null&&yt(t,e,2)}function Hc(e){var t=ut();if(typeof e=="function"){var i=e;if(e=i(),ir){os(!0);try{i()}finally{os(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:e},t}function og(e,t,i,s){return e.baseState=i,Fu(e,re,typeof s=="function"?s:qi)}function mb(e,t,i,s,r){if(Bo(e))throw Error(b(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(l){n.listeners.push(l)}};L.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,hg(t,n)):(n.next=i.next,t.pending=i.next=n)}}function hg(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=L.T,l={};l.types=n!==null?n.types:null,L.T=l;try{var a=i(r,s),o=L.S;o!==null&&o(l,a),Z_(e,t,a)}catch(h){Uc(e,t,h)}finally{n!==null&&l.types!==null&&(n.types=l.types),L.T=n}}else try{n=i(r,s),Z_(e,t,n)}catch(h){Uc(e,t,h)}}function Z_(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Q_(e,t,s)},function(s){return Uc(e,t,s)}):Q_(e,t,i)}function Q_(e,t,i){t.status="fulfilled",t.value=i,cg(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,hg(e,i)))}function Uc(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,cg(t),t=t.next;while(t!==s)}e.action=null}function cg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ug(e,t){return t}function J_(e,t){if(V){var i=le.formState;if(i!==null){e:{var s=q;if(V){if(ce){t:{for(var r=ce,n=jt;r.nodeType!==8;){if(!n){r=null;break t}if(r=Xt(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){ce=Xt(r.nextSibling),s=r.data==="F!";break e}}xs(s)}s=!1}s&&(t=i[0])}}return i=ut(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ug,lastRenderedState:t},i.queue=s,i=Dg.bind(null,q,s),s.dispatch=i,s=Hc(!1),n=$u.bind(null,q,!1,s.queue),s=ut(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=mb.bind(null,q,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function $_(e){var t=xe();return dg(t,re,e)}function dg(e,t,i){if(t=Fu(e,t,ug)[0],e=Ba(qi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=wl(t)}catch(l){throw l===dn?Mo:l}else s=t;t=xe();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(q.flags|=2048,$r(9,{destroy:void 0},vb.bind(null,r,i),null)),[s,n,e]}function vb(e,t){e.action=t}function em(e){var t=xe(),i=re;if(i!==null)return dg(t,i,e);xe(),t=t.memoizedState,i=xe();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function $r(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=q.updateQueue,t===null&&(t=Ao(),q.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function fg(){return xe().memoizedState}function Na(e,t,i,s){var r=ut();q.flags|=e,r.memoizedState=$r(1|t,{destroy:void 0},i,s===void 0?null:s)}function Oo(e,t,i,s){var r=xe();s=s===void 0?null:s;var n=r.memoizedState.inst;re!==null&&s!==null&&Vu(s,re.memoizedState.deps)?r.memoizedState=$r(t,n,i,s):(q.flags|=e,r.memoizedState=$r(1|t,n,i,s))}function tm(e,t){Na(8390656,8,e,t)}function Wu(e,t){Oo(2048,8,e,t)}function gb(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=Ao(),q.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function _g(e){var t=xe().memoizedState;return gb({ref:t,nextImpl:e}),function(){if((Q&2)!==0)throw Error(b(440));return t.impl.apply(void 0,arguments)}}function mg(e,t){return Oo(4,2,e,t)}function vg(e,t){return Oo(4,4,e,t)}function gg(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pg(e,t,i){i=i!=null?i.concat([e]):null,Oo(4,4,gg.bind(null,t,e),i)}function Zu(){}function Sg(e,t){var i=xe();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&Vu(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function yg(e,t){var i=xe();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&Vu(t,s[1]))return s[0];if(s=e(),ir){os(!0);try{e()}finally{os(!1)}}return i.memoizedState=[s,t],s}function Qu(e,t,i){return i===void 0||(Ui&1073741824)!==0&&(X&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=d0(),q.lanes|=e,Ms|=e,i)}function bg(e,t,i,s){return Nt(i,t)?i:Ts.current!==null?(e=Qu(e,i,s),Nt(e,t)||(Ae=!0),e):(Ui&106)===0||(Ui&1073741824)!==0&&(X&261930)===0?(Ae=!0,e.memoizedState=i):(e=d0(),q.lanes|=e,Ms|=e,t)}function wg(e,t,i,s,r){var n=J.p;J.p=n!==0&&8>n?n:8;var l=L.T,a={};a.types=l!==null?l.types:null,L.T=a,$u(e,!1,t,i);try{var o=r(),h=L.S;if(h!==null&&h(a,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var u=db(o,s);Xn(e,t,u,Bt(e))}else Xn(e,t,s,Bt(e))}catch(d){Xn(e,t,{then:function(){},status:"rejected",reason:d},Bt())}finally{J.p=n,l!==null&&a.types!==null&&(l.types=a.types),L.T=l}}function pb(){}function qc(e,t,i,s){if(e.tag!==5)throw Error(b(476));var r=Cg(e).queue;wg(e,r,t,js,i===null?pb:function(){return Eg(e),i(s)})}function Cg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:js,baseState:js,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:js},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Eg(e){var t=Cg(e);t.next===null&&(t=e.alternate.memoizedState),Xn(e,t.next.queue,{},Bt())}function Ju(){return Qe(an)}function xg(){return xe().memoizedState}function Tg(){return xe().memoizedState}function Sb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Bt();e=vs(i);var s=gs(t,e,i);s!==null&&(yt(s,t,i),Gn(s,t,i)),t={cache:Lu()},e.payload=t;return}t=t.return}}function yb(e,t,i){var s=Bt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bo(e)?Mg(t,i):(i=Nu(e,t,i,s),i!==null&&(yt(i,e,s),Ag(i,t,s)))}function Dg(e,t,i){var s=Bt();Xn(e,t,i,s)}function Xn(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Bo(e))Mg(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var l=t.lastRenderedState,a=n(l,i);if(r.hasEagerState=!0,r.eagerState=a,Nt(a,l))return To(e,t,r,0),le===null&&xo(),!1}catch{}if(i=Nu(e,t,r,s),i!==null)return yt(i,e,s),Ag(i,t,s),!0}return!1}function $u(e,t,i,s){if(s={lane:2,revertLane:cd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Bo(e)){if(t)throw Error(b(479))}else t=Nu(e,i,s,2),t!==null&&yt(t,e,2)}function Bo(e){var t=e.alternate;return e===q||t!==null&&t===q}function Mg(e,t){Ir=so=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ag(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,fv(e,i)}}var no={readContext:Qe,use:Ro,useCallback:be,useContext:be,useEffect:be,useImperativeHandle:be,useLayoutEffect:be,useInsertionEffect:be,useMemo:be,useReducer:be,useRef:be,useState:be,useDebugValue:be,useDeferredValue:be,useTransition:be,useSyncExternalStore:be,useId:be,useHostTransitionStatus:be,useFormState:be,useActionState:be,useOptimistic:be,useMemoCache:be,useCacheRefresh:be,useEffectEvent:be},Rg={readContext:Qe,use:Ro,useCallback:function(e,t){return ut().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:tm,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Na(4194308,4,gg.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Na(4194308,4,e,t)},useInsertionEffect:function(e,t){Na(4,2,e,t)},useMemo:function(e,t){var i=ut();t=t===void 0?null:t;var s=e();if(ir){os(!0);try{e()}finally{os(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ut();if(i!==void 0){var r=i(t);if(ir){os(!0);try{i(t)}finally{os(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=yb.bind(null,q,e),[s.memoizedState,e]},useRef:function(e){var t=ut();return e={current:e},t.memoizedState=e},useState:function(e){e=Hc(e);var t=e.queue,i=Dg.bind(null,q,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Zu,useDeferredValue:function(e,t){var i=ut();return Qu(i,e,t)},useTransition:function(){var e=Hc(!1);return e=wg.bind(null,q,e.queue,!0,!1),ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=q,r=ut();if(V){if(i===void 0)throw Error(b(407));i=i()}else{if(i=t(),le===null)throw Error(b(349));(X&127)!==0||sg(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,tm(ng.bind(null,s,n,e),[e]),s.flags|=2048,$r(9,{destroy:void 0},rg.bind(null,s,n,i,t),null),i},useId:function(){var e=ut(),t=le.identifierPrefix;if(V){var i=gi,s=vi;i=(s&~(1<<32-Ot(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=ro++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=fb++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ju,useFormState:J_,useActionState:J_,useOptimistic:function(e){var t=ut();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=$u.bind(null,q,!0,i),i.dispatch=t,[e,t]},useMemoCache:Xu,useCacheRefresh:function(){return ut().memoizedState=Sb.bind(null,q)},useEffectEvent:function(e){var t=ut(),i={impl:e};return t.memoizedState=i,function(){if((Q&2)!==0)throw Error(b(440));return i.impl.apply(void 0,arguments)}}},Og={readContext:Qe,use:Ro,useCallback:Sg,useContext:Qe,useEffect:Wu,useImperativeHandle:pg,useInsertionEffect:mg,useLayoutEffect:vg,useMemo:yg,useReducer:Ba,useRef:fg,useState:function(){return Ba(qi)},useDebugValue:Zu,useDeferredValue:function(e,t){var i=xe();return bg(i,re.memoizedState,e,t)},useTransition:function(){var e=Ba(qi)[0],t=xe().memoizedState;return[typeof e=="boolean"?e:wl(e),t]},useSyncExternalStore:ig,useId:xg,useHostTransitionStatus:Ju,useFormState:$_,useActionState:$_,useOptimistic:function(e,t){var i=xe();return og(i,re,e,t)},useMemoCache:Xu,useCacheRefresh:Tg,useEffectEvent:_g},bb={readContext:Qe,use:Ro,useCallback:Sg,useContext:Qe,useEffect:Wu,useImperativeHandle:pg,useInsertionEffect:mg,useLayoutEffect:vg,useMemo:yg,useReducer:Wh,useRef:fg,useState:function(){return Wh(qi)},useDebugValue:Zu,useDeferredValue:function(e,t){var i=xe();return re===null?Qu(i,e,t):bg(i,re.memoizedState,e,t)},useTransition:function(){var e=Wh(qi)[0],t=xe().memoizedState;return[typeof e=="boolean"?e:wl(e),t]},useSyncExternalStore:ig,useId:xg,useHostTransitionStatus:Ju,useFormState:em,useActionState:em,useOptimistic:function(e,t){var i=xe();return re!==null?og(i,re,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Xu,useCacheRefresh:Tg,useEffectEvent:_g};function Zh(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:ae({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Yc={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Bt(),r=vs(s);r.payload=t,i!=null&&(r.callback=i),t=gs(e,r,s),t!==null&&(yt(t,e,s),Gn(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Bt(),r=vs(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=gs(e,r,s),t!==null&&(yt(t,e,s),Gn(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Bt(),s=vs(i);s.tag=2,t!=null&&(s.callback=t),t=gs(e,s,i),t!==null&&(yt(t,e,i),Gn(t,e,i))}};function im(e,t,i,s,r,n,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,l):t.prototype&&t.prototype.isPureReactComponent?!il(i,s)||!il(r,n):!0}function sm(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Yc.enqueueReplaceState(t,t.state,null)}function sr(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=ae({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function Bg(e){Wa(e)}function Ng(e){console.error(e)}function kg(e){Wa(e)}function lo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function rm(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Kc(e,t,i){return i=vs(i),i.tag=3,i.payload={element:null},i.callback=function(){lo(e,t)},i}function zg(e){return e=vs(e),e.tag=3,e}function Lg(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){rm(t,i,s)}}var l=i.stateNode;l!==null&&typeof l.componentDidCatch=="function"&&(e.callback=function(){rm(t,i,s),typeof r!="function"&&(ys===null?ys=new Set([this]):ys.add(this));var a=s.stack;this.componentDidCatch(s.value,{componentStack:a!==null?a:""})})}function wb(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Js(t,i,r,!0),i=tt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return nt===null?mo():i.alternate===null&&we===0&&(we=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===eo?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),sc(e,s,r)),!1;case 22:return i.flags|=65536,s===eo?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),sc(e,s,r)),!1}throw Error(b(435,i.tag))}return sc(e,s,r),mo(),!1}if(V)return t=tt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Ac&&(e=Error(b(422),{cause:s}),rl(It(e,i)))):(s!==Ac&&(t=Error(b(423),{cause:s}),rl(It(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=It(s,i),r=Kc(e.stateNode,s,r),Fh(e,r),we!==4&&(we=2)),!1;var n=Error(b(520),{cause:s});if(n=It(n,i),Qn===null?Qn=[n]:Qn.push(n),we!==4&&(we=2),t===null)return!0;s=It(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=Kc(i.stateNode,s,e),Fh(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(ys===null||!ys.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=zg(r),Lg(r,e,i,s),Fh(i,r),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var ed=Error(b(461)),Ae=!1;function Be(e,t,i,s){t.child=e===null?Zv(t,null,i,s):tr(t,e.child,i,s)}function nm(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var l={};for(var a in s)a!=="ref"&&(l[a]=s[a])}else l=s;return $s(t),s=Pu(e,t,i,l,n,r),a=Gu(),e!==null&&!Ae?(Iu(e,t,r),Yi(e,t,r)):(V&&a&&Do(t),t.flags|=1,Be(e,t,s,r),t.child)}function lm(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!ku(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,Hg(e,t,n,s,r)):(e=Aa(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!id(e,r)){var l=n.memoizedProps;if(i=i.compare,i=i!==null?i:il,i(l,s)&&e.ref===t.ref)return Yi(e,t,r)}return t.flags|=1,e=ki(n,s),e.ref=t.ref,e.return=t,t.child=e}function Hg(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(il(n,s)&&e.ref===t.ref)if(Ae=!1,t.pendingProps=s=n,id(e,r))(e.flags&131072)!==0&&(Ae=!0);else return t.lanes=e.lanes,Yi(e,t,r)}return Vc(e,t,i,s,r)}function Ug(e,t,i,s){var r=s.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return am(e,t,n,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Oa(t,n!==null?n.cachePool:null),n!==null?W_(t,n):zc(),$v(t);else return s=t.lanes=536870912,am(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(Oa(t,n.cachePool),W_(t,n),Ss(),t.memoizedState=null):(e!==null&&Oa(t,null),zc(),Ss());return Be(e,t,r,i),t.child}function Fn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function am(e,t,i,s,r){var n=Hu();return n=n===null?null:{parent:Me._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&Oa(t,null),zc(),$v(t),e!==null&&Js(e,t,s,!0),t.childLanes=r,null}function ka(e,t){return t=No({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function om(e,t,i){return tr(t,e.child,null,i),e=ka(t,t.pendingProps),e.flags|=2,Tt(t),t.memoizedState=null,e}function Cb(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(V){if(s.mode==="hidden")return e=ka(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fn(null,e);if(Lc(t),(e=ce)?(e=U0(e,jt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Es!==null?{id:vi,overflow:gi}:null,retryLane:536870912,hydrationErrors:null},i=Pv(e),i.return=t,t.child=i,Ve=t,ce=null)):e=null,e===null)throw xs(t);return t.lanes=536870912,null}return ka(t,s)}var n=e.memoizedState;if(n!==null){var l=n.dehydrated;if(Lc(t),r)if(t.flags&256)t.flags&=-257,t=om(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(b(558));else if(Ae||Js(e,t,i,!1),r=(i&e.childLanes)!==0,Ae||r){if(Ts.current===null){if(s=le,s!==null&&(l=_v(s,i),l!==0&&l!==n.retryLane))throw n.retryLane=l,or(e,l),yt(s,e,l),ed;mo()}t=om(e,t,i)}else e=n.treeContext,ce=Xt(l.nextSibling),Ve=t,V=!0,ms=null,jt=!1,e!==null&&Iv(t,e),t=ka(t,s),t.flags|=134221824;return t}return e=ki(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xr(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(b(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Vc(e,t,i,s,r){return $s(t),i=Pu(e,t,i,s,void 0,r),s=Gu(),e!==null&&!Ae?(Iu(e,t,r),Yi(e,t,r)):(V&&s&&Do(t),t.flags|=1,Be(e,t,i,r),t.child)}function hm(e,t,i,s,r,n){return $s(t),t.updateQueue=null,i=tg(t,s,i,r),eg(e),s=Gu(),e!==null&&!Ae?(Iu(e,t,n),Yi(e,t,n)):(V&&s&&Do(t),t.flags|=1,Be(e,t,i,n),t.child)}function cm(e,t,i,s,r){if($s(t),t.stateNode===null){var n=Lr,l=i.contextType;typeof l=="object"&&l!==null&&(n=Qe(l)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Yc,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},qu(t),l=i.contextType,n.context=typeof l=="object"&&l!==null?Qe(l):Lr,n.state=t.memoizedState,l=i.getDerivedStateFromProps,typeof l=="function"&&(Zh(t,i,l,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(l=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),l!==n.state&&Yc.enqueueReplaceState(n,n.state,null),jn(t,s,n,r),In(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var a=t.memoizedProps,o=sr(i,a);n.props=o;var h=n.context,u=i.contextType;l=Lr,typeof u=="object"&&u!==null&&(l=Qe(u));var d=i.getDerivedStateFromProps;u=typeof d=="function"||typeof n.getSnapshotBeforeUpdate=="function",a=t.pendingProps!==a,u||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(a||h!==l)&&sm(t,n,s,l),ls=!1;var c=t.memoizedState;n.state=c,jn(t,s,n,r),In(),h=t.memoizedState,a||c!==h||ls?(typeof d=="function"&&(Zh(t,i,d,s),h=t.memoizedState),(o=ls||im(t,i,o,s,c,h,l))?(u||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=h),n.props=s,n.state=h,n.context=l,s=o):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,Nc(e,t),l=t.memoizedProps,u=sr(i,l),n.props=u,d=t.pendingProps,c=n.context,h=i.contextType,o=Lr,typeof h=="object"&&h!==null&&(o=Qe(h)),a=i.getDerivedStateFromProps,(h=typeof a=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l!==d||c!==o)&&sm(t,n,s,o),ls=!1,c=t.memoizedState,n.state=c,jn(t,s,n,r),In();var f=t.memoizedState;l!==d||c!==f||ls||e!==null&&e.dependencies!==null&&$a(e.dependencies)?(typeof a=="function"&&(Zh(t,i,a,s),f=t.memoizedState),(u=ls||im(t,i,u,s,c,f,o)||e!==null&&e.dependencies!==null&&$a(e.dependencies))?(h||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,f,o),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,f,o)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=f),n.props=s,n.state=f,n.context=o,s=u):(typeof n.componentDidUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,xr(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=tr(t,e.child,null,r),t.child=tr(t,null,i,r)):Be(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Yi(e,t,r),e}function um(e,t,i,s){return Qs(),t.flags|=256,Be(e,t,i,s),t.child}var Pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Xv()}}function Ic(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Mt),e}function qg(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,l;if((l=n)||(l=e!==null&&e.memoizedState===null?!1:($e.current&2)!==0),l&&(r=!0,t.flags&=-129),l=(t.flags&32)!==0,t.flags&=-33,e===null){if(V){if(r?ps(t):Ss(),(e=ce)?(e=U0(e,jt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Es!==null?{id:vi,overflow:gi}:null,retryLane:536870912,hydrationErrors:null},i=Pv(e),i.return=t,t.child=i,Ve=t,ce=null)):e=null,e===null)throw xs(t);return _d(e)?t.lanes=32:t.lanes=536870912,null}return n=s.children,s=s.fallback,r?(Ss(),r=t.mode,n=No({mode:"hidden",children:n},r),s=Xs(s,r,i,null),n.return=t,s.return=t,n.sibling=s,t.child=n,s=t.child,s.memoizedState=Gc(i),s.childLanes=Ic(e,l,i),t.memoizedState=Pc,Fn(null,s)):(ps(t),td(t,n))}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(o!==null)return Eb(e,t,n,l,s,o,a,i)}return r?(Ss(),r=s.fallback,n=t.mode,a=e.child,o=a.sibling,s=ki(a,{mode:"hidden",children:s.children}),s.subtreeFlags=a.subtreeFlags&1206910976,o!==null?r=ki(o,r):(r=Xs(r,n,i,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,Fn(null,s),s=t.child,r=e.child.memoizedState,r===null?r=Gc(i):(n=r.cachePool,n!==null?(a=Me._currentValue,n=n.parent!==a?{parent:a,pool:a}:n):n=Xv(),r={baseLanes:r.baseLanes|i,cachePool:n}),s.memoizedState=r,s.childLanes=Ic(e,l,i),t.memoizedState=Pc,Fn(e.child,s)):(ps(t),i=e.child,e=i.sibling,i=ki(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=i,t.memoizedState=null,i)}function td(e,t){return t=No({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function No(e,t){return e=St(22,e,null,t),e.lanes=0,e}function ma(e,t,i){return tr(t,e.child,null,i),e=td(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Eb(e,t,i,s,r,n,l,a){if(i)return t.flags&256?(ps(t),t.flags&=-257,ma(e,t,a)):t.memoizedState!==null?(Ss(),t.child=e.child,t.flags|=128,null):(Ss(),n=r.fallback,l=t.mode,r=No({mode:"visible",children:r.children},l),n=Xs(n,l,a,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,tr(t,e.child,null,a),r=t.child,r.memoizedState=Gc(a),r.childLanes=Ic(e,s,a),t.memoizedState=Pc,Fn(null,r));if(ps(t),_d(n)){if(s=n.nextSibling&&n.nextSibling.dataset,s)var o=s.dgst;return s=o,s!==""&&(r=Error(b(419)),r.stack="",r.digest=s,rl({value:r,source:null,stack:null})),ma(e,t,a)}if(Ae||Js(e,t,a,!1),s=(a&e.childLanes)!==0,Ae||s){if(Ts.current!==null)return ma(e,t,a);if(s=le,s!==null&&(r=_v(s,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,or(e,r),yt(s,e,r),ed;return vu(n)||mo(),ma(e,t,a)}return vu(n)?(t.flags|=192,t.child=e.child,null):(e=l.treeContext,ce=Xt(n.nextSibling),Ve=t,V=!0,ms=null,jt=!1,e!==null&&Iv(t,e),t=td(t,r.children),t.flags|=134221824,t)}function dm(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ra(e.return,t,i)}function fm(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&io(i)===null&&(t=e),e=e.sibling}return t}function va(e,t,i,s,r,n){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=s,l.tail=i,l.tailMode=r,l.treeForkCount=n)}function Qh(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function jc(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var l=$e.current;if(t.flags&128)return ll(t,l),null;var a=(l&2)!==0;if(a?(l=l&1|2,t.flags|=128):l&=1,ll(t,l),r==="backwards"&&e!==null?(Qh(e),Be(e,t,s,i),Qh(e)):Be(e,t,s,i),s=V?sl:0,!a&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dm(e,i,t);else if(e.tag===19)dm(e,i,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(r){case"backwards":i=fm(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null,Qh(t)),va(t,!0,r,null,n,s);break;case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&io(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}va(t,!0,i,null,n,s);break;case"together":va(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:i=fm(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),va(t,!1,r,i,n,s)}return t.child}function _m(e,t,i){var s=t.pendingProps;return cs(t,t.type,s.value),Be(e,t,s.children,i),t.child}function Yi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ms|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Js(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(b(153));if(t.child!==null){for(e=t.child,i=ki(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ki(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function id(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&$a(e)))}function xb(e,t,i){switch(t.tag){case 3:Ia(t,t.stateNode.containerInfo),cs(t,Me,e.memoizedState.cache),Qs();break;case 27:case 5:Sc(t);break;case 4:Ia(t,t.stateNode.containerInfo);break;case 10:cs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lc(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return ps(t),t.flags|=128,null;s=Js(e,t,i,!1);var r=t.child.childLanes;return s||(i&r)!==0?qg(e,t,i):(ps(t),e=Yi(e,t,i),e!==null?e.sibling:null)}ps(t);break;case 19:if(t.flags&128)return jc(e,t,i);if(r=(e.flags&128)!==0,s=(i&t.childLanes)!==0,s||(Js(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return jc(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ll(t,$e.current),s)break;return null;case 22:return t.lanes=0,Ug(e,t,i,t.pendingProps);case 24:cs(t,Me,e.memoizedState.cache)}return Yi(e,t,i)}function Yg(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ae=!0;else{if(!id(e,i)&&(t.flags&128)===0)return Ae=!1,xb(e,t,i);Ae=(e.flags&131072)!==0}else Ae=!1,V&&(t.flags&1048576)!==0&&Gv(t,sl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Vs(t.elementType),t.type=e,typeof e=="function")ku(e)?(s=sr(e,s),t.tag=1,t=cm(null,t,e,s,i)):(t.tag=0,t=Vc(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===bu){t.tag=11,t=nm(null,t,e,s,i);break e}else if(r===wu){t.tag=14,t=lm(null,t,e,s,i);break e}else if(r===_i){t.tag=10,t.type=e,t=_m(null,t,i);break e}}throw t=gc(e)||e,Error(b(306,t,""))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=sr(s,t.pendingProps),cm(e,t,s,r,i);case 3:e:{if(Ia(t,t.stateNode.containerInfo),e===null)throw Error(b(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,Nc(e,t),jn(t,s,null,i);var l=t.memoizedState;if(s=l.cache,cs(t,Me,s),s!==n.cache&&Oc(t,[Me],i,!0),In(),s=l.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=um(e,t,s,i);break e}else if(s!==r){r=It(Error(b(424)),t),rl(r),t=um(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ce=Xt(e.firstChild),Ve=t,V=!0,ms=null,jt=!0,i=Zv(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Qs(),s===r){t=Yi(e,t,i);break e}Be(e,t,s,i)}t=t.child}return t;case 26:return xr(e,t),e===null?(i=Km(t.type,null,t.pendingProps,null))?t.memoizedState=i:V||(t.stateNode=A0(t.type,t.pendingProps,_s.current,t)):t.memoizedState=Km(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Sc(t),e===null&&V&&(s=t.stateNode=q0(t.type,t.pendingProps,_s.current),Ve=t,jt=!0,r=ce,Rs(t.type)?(gu=r,ce=Xt(s.firstChild)):ce=r),Be(e,t,t.pendingProps.children,i),xr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((r=s=ce)&&(s=gw(s,t.type,t.pendingProps,jt),s!==null?(t.stateNode=s,Ve=t,ce=Xt(s.firstChild),jt=!1,r=!0):r=!1),r||xs(t)),Sc(t),r=t.type,n=t.pendingProps,l=e!==null?e.memoizedProps:null,s=n.children,fu(r,n)?s=null:l!==null&&fu(r,l)&&(t.flags|=32),t.memoizedState!==null&&(r=Pu(e,t,_b,null,null,i),an._currentValue=r),xr(e,t),Be(e,t,s,i),t.child;case 6:return e===null&&V&&((e=i=ce)&&(i=pw(i,t.pendingProps,jt),i!==null?(t.stateNode=i,Ve=t,ce=null,e=!0):e=!1),e||xs(t)),null;case 13:return qg(e,t,i);case 4:return Ia(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=tr(t,null,s,i):Be(e,t,s,i),t.child;case 11:return nm(e,t,t.type,t.pendingProps,i);case 7:return s=t.pendingProps,xr(e,t),Be(e,t,s,i),t.child;case 8:return Be(e,t,t.pendingProps.children,i),t.child;case 12:return Be(e,t,t.pendingProps.children,i),t.child;case 10:return _m(e,t,i);case 9:return r=t.type._context,s=t.pendingProps.children,$s(t),r=Qe(r),s=s(r),t.flags|=1,Be(e,t,s,i),t.child;case 14:return lm(e,t,t.type,t.pendingProps,i);case 15:return Hg(e,t,t.type,t.pendingProps,i);case 19:return jc(e,t,i);case 31:return Cb(e,t,i);case 22:return Ug(e,t,i,t.pendingProps);case 24:return $s(t),s=Qe(Me),e===null?(r=Hu(),r===null&&(r=le,n=Lu(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},qu(t),cs(t,Me,r)):((e.lanes&i)!==0&&(Nc(e,t),jn(t,null,null,i),In()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),cs(t,Me,s)):(s=n.cache,cs(t,Me,s),s!==r.cache&&Oc(t,[Me],i,!0))),Be(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:V&&Do(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:xr(e,t),Be(e,t,s.children,i),t.child;case 29:throw t.pendingProps}throw Error(b(156,t.tag))}function Oi(e){e.flags|=4}function Jh(e,t,i,s,r){var n;if((n=(e.mode&32)!==0)&&(n=i===null?Gm(t,s):Gm(t,s)&&(s.src!==i.src||s.srcSet!==i.srcSet)),n){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(m0())e.flags|=8192;else throw Ws=eo,Uu}else e.flags&=-16777217}function mm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!P0(t))if(m0())e.flags|=8192;else throw Ws=eo,Uu}function ga(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?uv():536870912,e.lanes|=t,en|=t)}function On(e,t){if(!V)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function he(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&1206910976,s|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function Tb(e,t,i){var s=t.pendingProps;switch(zu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return he(t),null;case 1:return he(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),zi(Me),Zr(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Cr(t)?Oi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xh())),he(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Oi(t),n!==null?(he(t),mm(t,n)):(he(t),Jh(t,r,null,s,i))):n?n!==e.memoizedState?(Oi(t),he(t),mm(t,n)):(he(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Oi(t),he(t),Jh(t,r,e,s,i)),null;case 27:if(ja(t),i=_s.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Oi(t);else{if(!s){if(t.stateNode===null)throw Error(b(166));return he(t),t.subtreeFlags&=-33554433,null}e=pi.current,Cr(t)?V_(t,e):(e=q0(r,s,i),t.stateNode=e,Oi(t))}return he(t),t.subtreeFlags&=-33554433,null;case 5:if(ja(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Oi(t);else{if(!s){if(t.stateNode===null)throw Error(b(166));return he(t),t.subtreeFlags&=-33554433,null}if(n=pi.current,Cr(t))V_(t,n);else{var l=cl(_s.current);switch(n){case 1:n=l.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=l.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=l.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=l.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=l.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?l.createElement("select",{is:s.is}):l.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?l.createElement(r,{is:s.is}):l.createElement(r)}}n[Ze]=t,n[wt]=s;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)n.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=n;e:switch(et(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Oi(t)}}return he(t),t.subtreeFlags&=-33554433,Jh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Oi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(b(166));if(e=_s.current,Cr(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=Ve,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[Ze]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||D0(e.nodeValue,i)),e||xs(t,!0)}else e=cl(e).createTextNode(s),e[Ze]=t,t.stateNode=e}return he(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Cr(t),i!==null){if(e===null){if(!s)throw Error(b(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(557));e[Ze]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;he(t),e=!1}else i=Xh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Tt(t),t):(Tt(t),null);if((t.flags&128)!==0)throw Error(b(558))}return he(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Cr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(b(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(b(317));r[Ze]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;he(t),r=!1}else r=Xh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Tt(t),t):(Tt(t),null)}return Tt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ga(t,t.updateQueue),he(t),null);case 4:return Zr(),e===null&&ud(t.stateNode.containerInfo),t.flags|=67108864,he(t),null;case 10:return zi(t.type),he(t),null;case 19:if(Ku(t),s=t.memoizedState,s===null)return he(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)On(s,!1);else{if(we!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=io(e),n!==null){for(t.flags|=128,On(s,!1),e=n.updateQueue,t.updateQueue=e,ga(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Vv(i,e),i=i.sibling;return ll(t,$e.current&1|2),V&&Bi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&At()>fo&&(t.flags|=128,r=!0,On(s,!1),t.lanes=4194304)}else{if(!r)if(e=io(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ga(t,e),On(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!n.alternate&&!V)return he(t),null}else 2*At()-s.renderingStartTime>fo&&i!==536870912&&(t.flags|=128,r=!0,On(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}if(s.tail!==null){e=s.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=At(),e.sibling=null,n=$e.current,n=r?n&1|2:n&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!i||V?ll(t,n):(i=n,ue(tt,t),ue($e,i),nt===null&&(nt=t)),V&&Bi(t,s.treeForkCount),e}return he(t),null;case 22:case 23:return Tt(t),Yu(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(he(t),t.subtreeFlags&6&&(t.flags|=8192)):he(t),i=t.updateQueue,i!==null&&ga(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&Je(Fs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),zi(Me),he(t),null;case 25:return null;case 30:return t.flags|=33554432,he(t),null}throw Error(b(156,t.tag))}function Db(e,t){switch(zu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Me),Zr(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ja(t),null;case 31:if(t.memoizedState!==null){if(Tt(t),t.alternate===null)throw Error(b(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(b(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ku(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Zr(),null;case 10:return zi(t.type),null;case 22:case 23:return Tt(t),Yu(),e!==null&&Je(Fs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Me),null;case 25:return null;default:return null}}function Kg(e,t){switch(zu(t),t.tag){case 3:zi(Me),Zr();break;case 26:case 27:case 5:ja(t);break;case 4:Zr();break;case 31:t.memoizedState!==null&&Tt(t);break;case 13:Tt(t);break;case 19:Ku(t);break;case 10:zi(t.type);break;case 22:case 23:Tt(t),Yu(),e!==null&&Je(Fs);break;case 24:zi(Me)}}function Cl(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,l=i.inst;s=n(),l.destroy=s}i=i.next}while(i!==r)}}catch(a){se(t,t.return,a)}}function Ds(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var l=s.inst,a=l.destroy;if(a!==void 0){l.destroy=void 0,r=t;var o=i,h=a;try{h()}catch(u){se(r,o,u)}}}s=s.next}while(s!==n)}}catch(u){se(t,t.return,u)}}function Vg(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Jv(t,i)}catch(s){se(e,e.return,s)}}}function Pg(e,t,i){i.props=sr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){se(e,t,s)}}function di(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var r=e.stateNode,n=Hi(e.memoizedProps,r);(r.ref===null||r.ref.name!==n)&&(r.ref=N0(n)),s=r.ref;break;case 7:if(e.stateNode===null){var l=new kt(e);bt(e.child,!1,mw,l,void 0,void 0),e.stateNode=l}s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(a){se(e,t,a)}}function We(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){se(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){se(e,t,r)}else i.current=null}function ao(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)H0(e.stateNode,t[i])}function vm(e){for(var t=e.return;t!==null&&(rd(t)&&H0(e.stateNode,t.stateNode),!sd(t));)t=t.return}function Wn(e){for(var t=e.return;t!==null&&(rd(t)&&vw(e.stateNode,t.stateNode),!sd(t));)t=t.return}function sd(e){return e.tag===5||e.tag===3||e.tag===27}function rd(e){return e&&e.tag===7&&e.stateNode!==null}function Xc(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){se(e,e.return,r)}}function $h(e,t,i){try{var s=e.stateNode;Qb(s,e.type,i,t),s[wt]=t}catch(r){se(e,e.return,r)}}function Gg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Rs(e.type)||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Rs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fc(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(r,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(r),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=mi)),ao(e,s),W=!0;else if(r!==4&&(r===27&&(ao(e,s),s=null,Rs(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(Fc(e,t,i,s),e=e.sibling;e!==null;)Fc(e,t,i,s),e=e.sibling}function oo(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?i.insertBefore(r,t):i.appendChild(r),ao(e,s),W=!0;else if(r!==4&&(r===27&&(ao(e,s),s=null,Rs(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(oo(e,t,i,s),e=e.sibling;e!==null;)oo(e,t,i,s),e=e.sibling}function Ig(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);et(t,s,i),t[Ze]=e,t[wt]=i}catch(n){se(e,e.return,n)}}var ho=!1,Dt=null;function gm(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(ho=!0)}var fi=null;function pm(){var e=fi;return fi=null,e}var pt=0;function fn(e,t,i,s,r){return pt=0,jg(e.child,t,i,s,r)}function jg(e,t,i,s,r){for(var n=!1;e!==null;){if(e.tag===5){var l=e.stateNode;if(s!==null){var a=_u(l);s.push(a),a.view&&(n=!0)}else n||_u(l).view&&(n=!0);ho=!0,R0(l,pt===0?t:t+"_"+pt,i),pt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||jg(e.child,t,i,s,r)&&(n=!0));e=e.sibling}return n}function yi(e,t){for(;e!==null;)e.tag===5?O0(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||yi(e.child,t)),e=e.sibling}function za(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(za(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(b(544));var i=t.name;t=Pi(t.default,t.share),t!=="none"&&(fn(e,i,t,null,!1)||yi(e.child,!1))}e=e.sibling}}function Wc(e,t){if(e.tag===30){var i=e.stateNode,s=e.memoizedProps,r=Hi(s,i),n=Pi(s.default,i.paired?s.share:s.enter);n!=="none"?fn(e,r,n,null,!1)?(za(e),i.paired||t||tn(e,s.onEnter)):yi(e.child,!1):za(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Wc(e,t),e=e.sibling;else za(e)}function Zc(e){if(Dt!==null&&Dt.size!==0){var t=Dt;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,s=i.name;if(s!=null&&s!=="auto"){var r=t.get(s);if(r!==void 0){var n=Pi(i.default,i.share);if(n!=="none"&&(fn(e,s,n,null,!1)?(n=e.stateNode,r.paired=n,n.paired=r,tn(e,i.onShare)):yi(e.child,!1)),t.delete(s),t.size===0)break}}}Zc(e)}e=e.sibling}}}function Qc(e){if(e.tag===30){var t=e.memoizedProps,i=Hi(t,e.stateNode),s=Dt!==null?Dt.get(i):void 0,r=Pi(t.default,s!==void 0?t.share:t.exit);r!=="none"&&(fn(e,i,r,null,!1)?s!==void 0?(r=e.stateNode,s.paired=r,r.paired=s,Dt.delete(i),tn(e,t.onShare)):tn(e,t.onExit):yi(e.child,!1)),Dt!==null&&Zc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Qc(e),e=e.sibling;else Dt!==null&&Zc(e)}function Xg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Hi(t,e.stateNode);t=Pi(t.default,t.update),e.flags&=-5,t!=="none"&&fn(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Xg(e);e=e.sibling}}function Jc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,yi(e.child,!1))}Jc(e)}e=e.sibling}}function La(e){if(e.tag===30)e.stateNode.paired=null,yi(e.child,!1),Jc(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)La(e),e=e.sibling;else Jc(e)}function Fg(e){for(e=e.child;e!==null;)e.tag===30?yi(e.child,!1):(e.subtreeFlags&33554432)!==0&&Fg(e),e=e.sibling}function nd(e,t,i,s,r,n,l){for(var a=!1;t!==null;){if(t.tag===5){var o=t.stateNode;if(n!==null&&pt<n.length){var h=n[pt],u=_u(o);(h.view||u.view)&&(a=!0);var d;if(d=(e.flags&4)===0)if(u.clip)d=!0;else{d=h.rect;var c=u.rect;d=d.y!==c.y||d.x!==c.x||d.height!==c.height||d.width!==c.width}d&&(e.flags|=4),u.abs?u=!h.abs:(h=h.rect,u=u.rect,u=h.height!==u.height||h.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&R0(o,pt===0?i:i+"_"+pt,r),a&&(e.flags&4)!==0||(fi===null&&(fi=[]),fi.push(o,pt===0?s:s+"_"+pt,t.memoizedProps)),pt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&l?e.flags|=t.flags&32:nd(e,t.child,i,s,r,n,l)&&(a=!0));t=t.sibling}return a}function Wg(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,s=e.stateNode,r=Hi(i,s),n=Pi(i.default,i.update);if(t){s=s.clones;var l=s===null?null:s.map(sw)}else l=e.memoizedState,e.memoizedState=null;s=e;var a=e.child;pt=0,r=nd(s,a,r,r,n,l,!1),(e.flags&4)!==0&&r&&(t||tn(e,i.onUpdate))}else(e.subtreeFlags&33554432)!==0&&Wg(e,t);e=e.sibling}}var qe=!1,$=!1,hi=!1,tc=!1,Sm=typeof WeakSet=="function"?WeakSet:Set,Ye=null,ci=!1,qn=!1,co=!1,$c=!1;function Mb(e,t,i){if(e=e.containerInfo,uu=on,e=kv(e),Ou(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var n=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{s.nodeType,l.nodeType}catch{s=null;break e}var a=0,o=-1,h=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var _;c!==s||n!==0&&c.nodeType!==3||(o=a+n),c!==l||r!==0&&c.nodeType!==3||(h=a+r),c.nodeType===3&&(a+=c.nodeValue.length),(_=c.firstChild)!==null;)f=c,c=_;for(;;){if(c===e)break t;if(f===s&&++u===n&&(o=a),f===l&&++d===r&&(h=a),(_=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=_}s=o===-1||h===-1?null:{start:o,end:h}}else s=null}s=s||{start:0,end:0}}else s=null;for(du={focusedElem:e,selectionRange:s},on=!1,i=(i&335544064)===i,Ye=t,t=i?9270:1024;Ye!==null;){if(e=Ye,i&&(s=e.deletions,s!==null))for(n=0;n<s.length;n++)i&&Qc(s[n]);if(e.alternate===null&&(e.flags&2)!==0)i&&gm(e),pa(i);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&i&&Qc(s),pa(i);continue}else if(s!==null&&s.memoizedState!==null){i&&gm(e),pa(i);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,Ye=s):(i&&Xg(e),pa(i))}}Dt=null}function pa(e){for(;Ye!==null;){var t=Ye,i=e,s=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&s!==null){i=void 0,r=s.memoizedProps,s=s.memoizedState;var n=t.stateNode;try{var l=sr(t.type,r);i=n.getSnapshotBeforeUpdate(l,s),n.__reactInternalSnapshotBeforeUpdate=i}catch(a){se(t,t.return,a)}}break;case 3:if((r&1024)!==0){if(s=t.stateNode.containerInfo,i=s.nodeType,i===9)mu(s);else if(i===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":mu(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&s!==null&&(i=Hi(s.memoizedProps,s.stateNode),r=t.memoizedProps,r=Pi(r.default,r.update),r!=="none"&&fn(s,i,r,s.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(b(163))}if(s=t.sibling,s!==null){s.return=t.return,Ye=s;break}Ye=t.return}}function Zg(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:ui(e,i),s&4&&Cl(5,i);break;case 1:if(ui(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(l){se(i,i.return,l)}else{var r=sr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){se(i,i.return,l)}}s&64&&Vg(i),s&512&&di(i,i.return);break;case 3:if(ui(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Jv(e,t)}catch(l){se(i,i.return,l)}}break;case 27:t===null&&s&4&&Ig(i);case 26:case 5:ui(e,i),t===null&&s&4&&Xc(i),s&512&&di(i,i.return);break;case 12:ui(e,i);break;case 31:ui(e,i),s&4&&e0(e,i);break;case 13:ui(e,i),s&4&&t0(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Yb.bind(null,i),Sw(e,i))));break;case 22:if(s=i.memoizedState!==null||qe,!s){var n=t!==null&&t.memoizedState!==null||$;t=qe,r=$,qe=s,($=n)&&!r?(s=2,(i.subtreeFlags&8772)!==0&&(s|=1),ei(e,i,s)):ui(e,i),qe=t,$=r}break;case 30:ui(e,i),s&512&&di(i,i.return);break;case 7:s&512&&di(i,i.return);default:ui(e,i)}}function eu(e,t){for(e=e.child;e!==null;)Qg(e,t),e=e.sibling}function Qg(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var s=i.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var r=e.stateNode,n=e.memoizedProps.style,l=n!=null&&n.hasOwnProperty("display")?n.display:null;r.style.display=l==null||typeof l=="boolean"?"":(""+l).trim()}}catch(o){se(e,e.return,o)}tu(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,W=!0}catch(o){se(e,e.return,o)}break;case 18:try{var a=e.stateNode;t?zm(a,!0):zm(e.stateNode,!1)}catch(o){se(e,e.return,o)}break;case 22:case 23:e.memoizedState===null&&eu(e,t);break;default:eu(e,t)}}function tu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,s=t;switch(i.tag){case 4:Qg(i,s);break e;case 22:i.memoizedState===null&&tu(i,s);break e;default:tu(i,s)}}e=e.sibling}}function Jg(e){var t=e.alternate;t!==null&&(e.alternate=null,Jg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bo(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 me=null,vt=!1;function $t(e,t,i){for(i=i.child;i!==null;)$g(e,t,i),i=i.sibling}function $g(e,t,i){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(vl,i)}catch{}switch(i.tag){case 26:$||We(i,t),$t(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!$&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:$||We(i,t),Wn(i);var s=me,r=vt;Rs(i.type)&&(me=i.stateNode,vt=!1),$t(e,t,i),Y0(i.stateNode,i.type,i.memoizedProps),me=s,vt=r;break;case 5:$||We(i,t),Wn(i);case 6:if(i.tag===6&&Wn(i),s=me,r=vt,me=null,$t(e,t,i),me=s,vt=r,me!==null)if(vt)try{(me.nodeType===9?me.body:me.nodeName==="HTML"?me.ownerDocument.body:me).removeChild(i.stateNode),W=!0}catch(n){se(i,t,n)}else try{me.removeChild(i.stateNode),W=!0}catch(n){se(i,t,n)}break;case 18:me!==null&&(vt?(e=me,km(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),hn(e)):km(me,i.stateNode));break;case 4:s=me,r=vt,me=i.stateNode.containerInfo,vt=!0,$t(e,t,i),me=s,vt=r;break;case 0:case 11:case 14:case 15:Ds(2,i,t),$||Ds(4,i,t),$t(e,t,i);break;case 1:$||(We(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Pg(i,t,s)),$t(e,t,i);break;case 21:$t(e,t,i);break;case 22:$=(s=$)||i.memoizedState!==null,$t(e,t,i),$=s;break;case 30:We(i,t),$t(e,t,i);break;case 7:$||We(i,t),$t(e,t,i);break;default:$t(e,t,i)}}function e0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hn(e)}catch(i){se(t,t.return,i)}}}function t0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hn(e)}catch(i){se(t,t.return,i)}}function Ab(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sm),t;default:throw Error(b(435,e.tag))}}function Sa(e,t){var i=Ab(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=Kb.bind(null,e,s);s.then(r,r)}})}function ht(e,t,i){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var n=s[r],l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(Rs(o.type)){me=o.stateNode,vt=!1;break e}break;case 5:me=o.stateNode,vt=!1;break e;case 3:case 4:me=o.stateNode.containerInfo,vt=!0;break e}o=o.return}if(me===null)throw Error(b(160));$g(l,a,n),me=null,vt=!1,l=n.alternate,l!==null&&(l.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)i0(t,e,i),t=t.sibling}var ti=null;function i0(e,t,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var n=0;n<s.length;n++){var l=s[n];l.ref.impl=l.nextImpl}ht(t,e,i),ct(e),r&4&&(Ds(3,e,e.return),Cl(3,e),Ds(5,e,e.return));break;case 1:ht(t,e,i),ct(e),r&512&&($||s===null||We(s,s.return)),r&64&&qe&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(n=ti,ht(t,e,i),ct(e),r&512&&($||s===null||We(s,s.return)),r&4)if(r=s!==null?s.memoizedState:null,i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null)if(qe)e.stateNode=A0(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,r=n.ownerDocument||n;t:switch(t){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Sl]||s[Ze]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(t),r.head.insertBefore(s,r.querySelector("head > title"))),et(s,t,i),s[Ze]=e,Ke(s),t=s;break e;case"link":if(n=Pm("link","href",r).get(t+(i.href||""))){for(l=0;l<n.length;l++)if(s=n[l],s.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&s.getAttribute("rel")===(i.rel==null?null:i.rel)&&s.getAttribute("title")===(i.title==null?null:i.title)&&s.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){n.splice(l,1);break t}}s=r.createElement(t),et(s,t,i),r.head.appendChild(s);break;case"meta":if(n=Pm("meta","content",r).get(t+(i.content||""))){for(l=0;l<n.length;l++)if(s=n[l],s.getAttribute("content")===(i.content==null?null:""+i.content)&&s.getAttribute("name")===(i.name==null?null:i.name)&&s.getAttribute("property")===(i.property==null?null:i.property)&&s.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&s.getAttribute("charset")===(i.charSet==null?null:i.charSet)){n.splice(l,1);break t}}s=r.createElement(t),et(s,t,i),r.head.appendChild(s);break;default:throw Error(b(468,t))}s[Ze]=e,Ke(s),t=s}e.stateNode=t}else qe||pu(n,e.type,e.stateNode);else e.stateNode=Vm(n,i,e.memoizedProps);else r!==i?(r===null?(t=s.stateNode,t===null||$||t.parentNode.removeChild(t)):r.count--,i===null?qe||pu(n,e.type,e.stateNode):Vm(n,i,e.memoizedProps)):i===null&&e.stateNode!==null&&$h(e,e.memoizedProps,s.memoizedProps);break;case 27:ht(t,e,i),ct(e),r&512&&($||s===null||We(s,s.return)),s!==null&&r&4&&$h(e,e.memoizedProps,s.memoizedProps);break;case 5:if(n=hi,hi=!1,ht(t,e,i),hi=n,ct(e),r&512&&($||s===null||We(s,s.return)),e.flags&32){t=e.stateNode;try{Jr(t,""),W=!0}catch(u){se(e,e.return,u)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,$h(e,t,s!==null?s.memoizedProps:t)),r&1024&&(tc=!0);break;case 6:if(ht(t,e,i),ct(e),r&4){if(e.stateNode===null)throw Error(b(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,W=!0}catch(u){se(e,e.return,u)}}break;case 3:if(W=!1,Ya=null,n=ti,ti=ul(t.containerInfo),ht(t,e,i),ti=n,ct(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{hn(t.containerInfo)}catch(u){se(e,e.return,u)}tc&&(tc=!1,s0(e)),W=!1;break;case 4:r=hi,hi=qe,s=x_(),n=ti,ti=ul(e.stateNode.containerInfo),ht(t,e,i),ct(e),ti=n,W&&qn&&(co=!0),W=s,hi=r;break;case 12:ht(t,e,i),ct(e);break;case 31:ht(t,e,i),ct(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sa(e,t)));break;case 13:ht(t,e,i),ct(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ko=At()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sa(e,t)));break;case 22:n=e.memoizedState!==null,l=s!==null&&s.memoizedState!==null;var a=qe,o=$,h=hi;qe=a||n,hi=h||n,$=o||l,ht(t,e,i),$=o,hi=h,qe=a,ct(e),r&8192&&(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,!n||s===null||l||qe||$||(t=l||$,i=qe,s=$,qe=n||qe,$=t,rs(e,2),qe=i,$=s),!n&&hi||eu(e,n)),r&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,Sa(e,i))));break;case 19:ht(t,e,i),ct(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sa(e,t)));break;case 30:r&512&&($||s===null||We(s,s.return)),r=x_(),n=qn,l=(i&335544064)===i,a=e.memoizedProps,qn=l&&Pi(a.default,a.update)!=="none",ht(t,e,i),ct(e),l&&s!==null&&W&&(e.flags|=4),qn=n,W=r;break;case 21:break;case 7:r&512&&($||s===null||We(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:ht(t,e,i),ct(e)}}function ct(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Gg(s)){i=s;break}s=s.return}s=null;for(var r=e.return;r!==null;){if(rd(r)){var n=r.stateNode;s===null?s=[n]:s.push(n)}if(sd(r))break;r=r.return}var l=s;if(i==null)throw Error(b(160));switch(i.tag){case 27:var a=i.stateNode,o=ec(e);oo(e,o,a,l);break;case 5:var h=i.stateNode;i.flags&32&&(Jr(h,""),i.flags&=-33);var u=ec(e);oo(e,u,h,l);break;case 3:case 4:var d=i.stateNode.containerInfo,c=ec(e);Fc(e,c,d,l);break;default:throw Error(b(161))}}catch(f){se(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function s0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;s0(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,on=!0,t.reset(),on=!1),e=e.sibling}}function Er(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)r0(t,e),t=t.sibling;else Wg(t,!1)}function r0(e,t){var i=e.alternate;if(i===null)Wc(e,!1);else switch(e.tag){case 3:if($c=ci=!1,pm(),Er(t,e),!ci&&!co){if(e=fi,e!==null)for(var s=0;s<e.length;s+=3){i=e[s];var r=e[s+1];O0(i,e[s+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),$c=!0}fi=null;break;case 5:Er(t,e);break;case 4:s=ci,ci=!1,Er(t,e),ci&&(co=!0),ci=s;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?Wc(e,!1):Er(t,e));break;case 30:s=ci,r=pm(),ci=!1,Er(t,e),ci&&(e.flags|=4);var n=e.memoizedProps,l=e.stateNode;t=Hi(n,l),l=Hi(i.memoizedProps,l);var a=Pi(n.default,n.update);a==="none"?t=!1:(n=i.memoizedState,i.memoizedState=null,i=e.child,pt=0,t=nd(e,i,t,l,a,n,!0),pt!==(n===null?0:n.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(tn(e,e.memoizedProps.onUpdate),fi=r):r!==null&&(r.push.apply(r,fi),fi=r),ci=(e.flags&32)!==0?!0:s;break;default:Er(t,e)}}function ui(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zg(e,t.alternate,t),t=t.sibling}function rs(e,t){for(e=e.child;e!==null;){var i=e,s=t;switch(i.tag){case 0:case 11:case 14:case 15:Ds(4,i,i.return),rs(i,s);break;case 1:We(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&Pg(i,i.return,r),rs(i,s);break;case 27:(s&2)!==0&&Y0(i.stateNode,i.type,i.memoizedProps);case 5:We(i,i.return),i.tag!==5&&i.tag!==27||Wn(i),rs(i,s);break;case 6:Wn(i);break;case 26:We(i,i.return),r=i.stateNode,i.memoizedState!==null||r===null||$||r.parentNode.removeChild(r),rs(i,s);break;case 22:i.memoizedState===null&&rs(i,s);break;case 30:We(i,i.return),rs(i,s);break;case 7:We(i,i.return);default:rs(i,s)}e=e.sibling}}function ei(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,l=n.flags,a=(i&1)!==0;switch(n.tag){case 0:case 11:case 15:ei(r,n,i),Cl(4,n);break;case 1:if(ei(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){se(s,s.return,u)}if(s=n,r=s.updateQueue,r!==null){var o=s.stateNode;try{var h=r.shared.hiddenCallbacks;if(h!==null)for(r.shared.hiddenCallbacks=null,r=0;r<h.length;r++)Qv(h[r],o)}catch(u){se(s,s.return,u)}}a&&l&64&&Vg(n),di(n,n.return);break;case 27:(i&2)!==0&&Ig(n);case 5:n.tag!==5&&n.tag!==27||vm(n),ei(r,n,i),a&&s===null&&l&4&&Xc(n),di(n,n.return);break;case 6:vm(n);break;case 26:o=n.stateNode,n.memoizedState!==null||o===null||qe||pu(ul(o.ownerDocument),n.type,o),ei(r,n,i),a&&s===null&&l&4&&Xc(n),di(n,n.return);break;case 12:ei(r,n,i);break;case 31:ei(r,n,i),a&&l&4&&e0(r,n);break;case 13:ei(r,n,i),a&&l&4&&t0(r,n);break;case 22:n.memoizedState===null&&ei(r,n,i),di(n,n.return);break;case 30:ei(r,n,i),di(n,n.return);break;case 7:di(n,n.return);default:ei(r,n,i)}t=t.sibling}}function ld(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&bl(i))}function ad(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bl(e))}function Yt(e,t,i,s){var r=(i&335544064)===i;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)n0(e,t,i,s),t=t.sibling;else r&&Fg(t)}function n0(e,t,i,s){var r=(i&335544064)===i;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&La(t);var n=t.flags;switch(t.tag){case 0:case 11:case 15:Yt(e,t,i,s),n&2048&&Cl(9,t);break;case 1:Yt(e,t,i,s);break;case 3:Yt(e,t,i,s),r&&$c&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),n&2048&&(n=null,t.alternate!==null&&(n=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==n&&(t.refCount++,n!=null&&bl(n)));break;case 12:if(n&2048){Yt(e,t,i,s),n=t.stateNode;try{var l=t.memoizedProps,a=l.id,o=l.onPostCommit;typeof o=="function"&&o(a,t.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(h){se(t,t.return,h)}}else Yt(e,t,i,s);break;case 31:Yt(e,t,i,s);break;case 13:Yt(e,t,i,s);break;case 23:break;case 22:l=t.stateNode,a=t.alternate,t.memoizedState!==null?(r&&a!==null&&a.memoizedState===null&&La(a),l._visibility&2?Yt(e,t,i,s):Zn(e,t)):(r&&a!==null&&a.memoizedState!==null&&La(t),l._visibility&2?Yt(e,t,i,s):(l._visibility|=2,Tr(e,t,i,s,(t.subtreeFlags&10256)!==0||!1))),n&2048&&ld(a,t);break;case 24:Yt(e,t,i,s),n&2048&&ad(t.alternate,t);break;case 30:r&&(n=t.alternate,n!==null&&(yi(n.child,!0),yi(t.child,!0))),Yt(e,t,i,s);break;default:Yt(e,t,i,s)}}function Tr(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,l=t,a=i,o=s,h=l.flags;switch(l.tag){case 0:case 11:case 15:Tr(n,l,a,o,r),Cl(8,l);break;case 23:break;case 22:var u=l.stateNode;l.memoizedState!==null?u._visibility&2?Tr(n,l,a,o,r):Zn(n,l):(u._visibility|=2,Tr(n,l,a,o,r)),r&&h&2048&&ld(l.alternate,l);break;case 24:Tr(n,l,a,o,r),r&&h&2048&&ad(l.alternate,l);break;default:Tr(n,l,a,o,r)}t=t.sibling}}function Zn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Zn(i,s),r&2048&&ld(s.alternate,s);break;case 24:Zn(i,s),r&2048&&ad(s.alternate,s);break;default:Zn(i,s)}t=t.sibling}}var Ps=8192;function Ys(e,t,i){if(e.subtreeFlags&Ps)for(e=e.child;e!==null;)l0(e,t,i),e=e.sibling}function l0(e,t,i){switch(e.tag){case 26:Ys(e,t,i),e.flags&Ps&&(e.memoizedState!==null?Nw(i,ti,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Im(i,e)));break;case 5:Ys(e,t,i),e.flags&Ps&&(e=e.stateNode,(t&335544128)===t&&Im(i,e));break;case 3:case 4:var s=ti;ti=ul(e.stateNode.containerInfo),Ys(e,t,i),ti=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ps,Ps=16777216,Ys(e,t,i),Ps=s):Ys(e,t,i));break;case 30:if((e.flags&Ps)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var r=e.stateNode;r.paired=null,Dt===null&&(Dt=new Map),Dt.set(s,r)}Ys(e,t,i);break;default:Ys(e,t,i)}}function a0(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 Bn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Ye=s,h0(s,e)}a0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)o0(e),e=e.sibling}function o0(e){switch(e.tag){case 0:case 11:case 15:Bn(e),e.flags&2048&&Ds(9,e,e.return);break;case 3:Bn(e);break;case 12:Bn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ha(e)):Bn(e);break;default:Bn(e)}}function Ha(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Ye=s,h0(s,e)}a0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ds(8,t,t.return),Ha(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ha(t));break;default:Ha(t)}e=e.sibling}}function h0(e,t){for(;Ye!==null;){var i=Ye;switch(i.tag){case 0:case 11:case 15:Ds(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:bl(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Ye=s;else e:for(i=e;Ye!==null;){s=Ye;var r=s.sibling,n=s.return;if(Jg(s),s===i){Ye=null;break e}if(r!==null){r.return=n,Ye=r;break e}Ye=n}}}var Rb={getCacheForType:function(e){var t=Qe(Me),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Qe(Me).controller.signal}},Ob=typeof WeakMap=="function"?WeakMap:Map,Q=0,le=null,I=null,X=0,te=0,Et=null,us=!1,_n=!1,od=!1,Ki=0,we=0,Ms=0,Zs=0,uo=0,Mt=0,en=0,Qn=null,gt=null,iu=!1,ko=0,c0=0,fo=1/0,_o=null,ys=null,ge=0,si=null,rr=null,Si=0,su=0,ru=null,u0=null,Xr=null,Fr=null,Wr=null,Jn=0,Ua=null;function Bt(){return(Q&2)!==0&&X!==0?X&-X:L.T!==null?cd():mv()}function d0(){if(Mt===0)if((X&536870912)===0||V){var e=la;la<<=1,(la&3932160)===0&&(la=262144),Mt=e}else Mt=536870912;return e=tt.current,e!==null&&(e.flags|=32),Mt}function tn(e,t){if(t!=null){var i=e.stateNode,s=i.ref;s===null&&(s=i.ref=N0(Hi(e.memoizedProps,i))),Fr===null&&(Fr=[]),Fr.push(t.bind(null,s))}}function yt(e,t,i){(e===le&&(te===2||te===9)||e.cancelPendingCommit!==null)&&(sn(e,0),ds(e,X,Mt,!1)),pl(e,i),((Q&2)===0||e!==le)&&(e===le&&((Q&2)===0&&(Zs|=i),we===4&&ds(e,X,Mt,!1)),wi(e))}function f0(e,t,i){if((Q&6)!==0)throw Error(b(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||gl(e,t),r=s?kb(e,t):ic(e,t,!0),n=s;do{if(r===0){_n&&!s&&ds(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!Bb(i)){r=ic(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var l=0;else l=e.pendingLanes&-536870913,l=l!==0?l:l&536870912?536870912:0;if(l!==0){t=l;e:{var a=e;r=Qn;var o=a.current.memoizedState.isDehydrated;if(o&&(sn(a,l).flags|=256),l=ic(a,l,!1),l!==2&&l!==6){if(od&&!o){a.errorRecoveryDisabledLanes|=n,Zs|=n,r=4;break e}n=gt,gt=r,n!==null&&(gt===null?gt=n:gt.push.apply(gt,n))}r=l}if(n=!1,r!==2)continue}}if(r===1){sn(e,0),ds(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(b(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:ds(s,t,Mt,!us);break e;case 2:gt=null;break;case 3:case 5:break;default:throw Error(b(329))}if((t&62914560)===t&&(r=ko+300-At(),10<r)){if(ds(s,t,Mt,!us),yo(s,0,!0)!==0)break e;Si=t,s.timeoutHandle=dd(ym.bind(null,s,i,gt,_o,iu,t,Mt,Zs,en,us,n,"Throttled",-0,0),r);break e}ym(s,i,gt,_o,iu,t,Mt,Zs,en,us,n,null,-0,0)}}break}while(!0);wi(e)}function ym(e,t,i,s,r,n,l,a,o,h,u,d,c,f){e.timeoutHandle=-1;var _=t.subtreeFlags,p=(n&335544064)===n;if(d=null,(p||_&8192||(_&16785408)===16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mi},Dt=null,l0(t,n,d),p&&(_=d,p=e.containerInfo,p=(p.nodeType===9?p:p.ownerDocument).__reactViewTransition,p!=null&&(_.count++,_.waitingForViewTransition=!0,_=dl.bind(_),p.finished.then(_,_))),_=(n&62914560)===n?ko-At():(n&4194048)===n?c0-At():0,_=kw(d,_),_!==null)){Si=n,e.cancelPendingCommit=_(wm.bind(null,e,t,n,i,s,r,l,a,o,h,u,d,null,c,f)),ds(e,n,l,!h);return}wm(e,t,n,i,s,r,l,a,o,h,u,d)}function Bb(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],n=r.getSnapshot;r=r.value;try{if(!Nt(n(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 ds(e,t,i,s){t=cv(e,t),t&=~uo,t&=~Zs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-Ot(r),l=1<<n;s[n]=-1,r&=~l}i!==0&&dv(e,i,t)}function zo(){return(Q&6)===0?(El(0,!1),!1):!0}function hd(){if(I!==null){if(te===0)var e=I.return;else e=I,Ni=hr=null,ju(e),Gr=null,nl=0,e=I;for(;e!==null;)Kg(e.alternate,e),e=e.return;I=null}}function sn(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,ew(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Si=0,hd(),le=e,I=i=ki(e.current,null),X=t,te=0,Et=null,us=!1,_n=gl(e,t),od=!1,en=Mt=uo=Zs=Ms=we=0,gt=Qn=null,iu=!1,Ki=cv(e,t),xo(),i}function _0(e,t){q=null,L.H=no,t===dn||t===Mo?(t=X_(),te=3):t===Uu?(t=X_(),te=4):te=t===ed?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Et=t,I===null&&(we=1,lo(e,It(t,e.current)))}function m0(){var e=tt.current;return e===null?!0:(X&4194048)===X?nt===null:(X&62914560)===X||(X&536870912)!==0?e===nt:!1}function v0(){var e=L.H;return L.H=no,e===null?no:e}function g0(){var e=L.A;return L.A=Rb,e}function mo(){we=4,us||(X&4194048)!==X&&tt.current!==null||(_n=!0),(Ms&134217727)===0&&(Zs&134217727)===0||le===null||ds(le,X,Mt,!1)}function ic(e,t,i){var s=Q;Q|=2;var r=v0(),n=g0();(le!==e||X!==t)&&(_o=null,sn(e,t)),t=!1;var l=we;e:do try{if(te!==0&&I!==null){var a=I,o=Et;switch(te){case 8:hd(),l=6;break e;case 3:case 2:case 9:case 6:tt.current===null&&(t=!0);var h=te;if(te=0,Et=null,qr(e,a,o,h),i&&_n){l=0;break e}break;default:h=te,te=0,Et=null,qr(e,a,o,h)}}Nb(),l=we;break}catch(u){_0(e,u)}while(!0);return t&&e.shellSuspendCounter++,Ni=hr=null,Q=s,L.H=r,L.A=n,I===null&&(le=null,X=0,xo()),l}function Nb(){for(;I!==null;)p0(I)}function kb(e,t){var i=Q;Q|=2;var s=v0(),r=g0();le!==e||X!==t?(_o=null,fo=At()+500,sn(e,t)):_n=gl(e,t);e:do try{if(te!==0&&I!==null){t=I;var n=Et;t:switch(te){case 1:te=0,Et=null,qr(e,t,n,1);break;case 2:case 9:if(j_(n)){te=0,Et=null,bm(t);break}t=function(){te!==2&&te!==9||le!==e||(te=7),wi(e)},n.then(t,t);break e;case 3:te=7;break e;case 4:te=5;break e;case 7:j_(n)?(te=0,Et=null,bm(t)):(te=0,Et=null,qr(e,t,n,7));break;case 5:var l=null;switch(I.tag){case 26:l=I.memoizedState;case 5:case 27:var a=I;if(l?P0(l):a.stateNode.complete){te=0,Et=null;var o=a.sibling;if(o!==null)I=o;else{var h=a.return;h!==null?(I=h,Lo(h)):I=null}break t}}te=0,Et=null,qr(e,t,n,5);break;case 6:te=0,Et=null,qr(e,t,n,6);break;case 8:hd(),we=6;break e;default:throw Error(b(462))}}zb();break}catch(u){_0(e,u)}while(!0);return Ni=hr=null,L.H=s,L.A=r,Q=i,I!==null?0:(le=null,X=0,xo(),we)}function zb(){for(;I!==null&&!JS();)p0(I)}function p0(e){var t=Yg(e.alternate,e,Ki);e.memoizedProps=e.pendingProps,t===null?Lo(e):I=t}function bm(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=hm(i,t,t.pendingProps,t.type,void 0,X);break;case 11:t=hm(i,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:ju(t);var s=t;s===Ve&&(V?(Ja(s),s.tag===5&&s.stateNode!=null&&(ce=s.stateNode)):(Ja(s),V=!0));default:Kg(i,t),t=I=Vv(t,Ki),t=Yg(i,t,Ki)}e.memoizedProps=e.pendingProps,t===null?Lo(e):I=t}function qr(e,t,i,s){Ni=hr=null,ju(t),Gr=null,nl=0;var r=t.return;try{if(wb(e,r,t,i,X)){we=1,lo(e,It(i,e.current)),I=null;return}}catch(n){if(r!==null)throw I=r,n;we=1,lo(e,It(i,e.current)),I=null;return}t.flags&32768?(V||s===1?e=!0:_n||(X&536870912)!==0?e=!1:(us=e=!0,(s===2||s===9||s===3||s===6)&&(s=tt.current,s!==null&&s.tag===13&&(s.flags|=16384))),S0(t,e)):Lo(t)}function Lo(e){var t=e;do{if((t.flags&32768)!==0){S0(t,us);return}e=t.return;var i=Tb(t.alternate,t,Ki);if(i!==null){I=i;return}if(t=t.sibling,t!==null){I=t;return}I=t=e}while(t!==null);we===0&&(we=5)}function S0(e,t){do{var i=Db(e.alternate,e);if(i!==null){i.flags&=32767,I=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){I=e;return}I=e=i}while(e!==null);we=6,I=null}function wm(e,t,i,s,r,n,l,a,o,h,u,d){e.cancelPendingCommit=null;do Ho();while(ge!==0);if((Q&6)!==0)throw Error(b(327));if(t!==null){if(t===e.current)throw Error(b(177));e===le&&(I=le=null,X=0),rr=t,si=e,Si=i,ru=r,u0=s,Lb(e,t,i,l,a,o,d)}}function Lb(e,t,i,s,r,n,l){var a=t.lanes|t.childLanes;if(su=a,a|=Bu,oy(e,i,a,s,r,n),Fr=null,(i&335544064)===i?(Wr=cb(e),s=10262):(Wr=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Vb(Xa,function(){return ou(),null})):(e.callbackNode=null,e.callbackPriority=0),ho=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=L.T,L.T=null,r=J.p,J.p=2,n=Q,Q|=4;try{Mb(e,t,i)}finally{Q=n,J.p=r,L.T=s}}ge=1,ho?Xr=lw(l,e.containerInfo,Wr,nu,lu,Ub,au,ou,Hb,null,null):(nu(),lu(),au())}function Hb(e){if(ge!==0){var t=si.onRecoverableError;t(e,{componentStack:null})}}function Ub(){ge===3&&(ge=0,r0(rr,si),ge=4)}function nu(){if(ge===1){ge=0;var e=si,t=rr,i=Si,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=L.T,L.T=null;var r=J.p;J.p=2;var n=Q;Q|=4;try{qn=co=!1,i0(t,e,i),i=du;var l=kv(e.containerInfo),a=i.focusedElem,o=i.selectionRange;if(l!==a&&a&&a.ownerDocument&&Nv(a.ownerDocument.documentElement,a)){if(o!==null&&Ou(a)){var h=o.start,u=o.end;if(u===void 0&&(u=h),"selectionStart"in a)a.selectionStart=h,a.selectionEnd=Math.min(u,a.value.length);else{var d=a.ownerDocument||document,c=d&&d.defaultView||window;if(c.getSelection){var f=c.getSelection(),_=a.textContent.length,p=Math.min(o.start,_),y=o.end===void 0?p:Math.min(o.end,_);!f.extend&&p>y&&(l=y,y=p,p=l);var m=U_(a,p),v=U_(a,y);if(m&&v&&(f.rangeCount!==1||f.anchorNode!==m.node||f.anchorOffset!==m.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var g=d.createRange();g.setStart(m.node,m.offset),f.removeAllRanges(),p>y?(f.addRange(g),f.extend(v.node,v.offset)):(g.setEnd(v.node,v.offset),f.addRange(g))}}}}for(d=[],f=a;f=f.parentNode;)f.nodeType===1&&d.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<d.length;a++){var S=d[a];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}on=!!uu,du=uu=null}finally{Q=n,J.p=r,L.T=s}}e.current=t,ge=2}}function lu(){if(ge===2){ge=0;var e=si,t=rr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=L.T,L.T=null;var s=J.p;J.p=2;var r=Q;Q|=4;try{Zg(e,t.alternate,t)}finally{Q=r,J.p=s,L.T=i}}ge=3}}function au(){if(ge===4||ge===3){ge=0;var e=Xr;Xr=null,$S();var t=si,i=rr,s=Si,r=u0,n=(s&335544064)===s?10262:10256;if((i.subtreeFlags&n)!==0||(i.flags&n)!==0?ge=5:(ge=0,rr=si=null,y0(t,t.pendingLanes)),n=t.pendingLanes,n===0&&(ys=null),xu(s),i=i.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(vl,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=L.T,n=J.p,J.p=2,L.T=null;try{for(var l=t.onRecoverableError,a=0;a<r.length;a++){var o=r[a];l(o.value,{componentStack:o.stack})}}finally{L.T=i,J.p=n}}if(r=Fr,l=Wr,Wr=null,r!==null&&(Fr=null,l===null&&(l=[]),e!==null))for(o=0;o<r.length;o++)i=(0,r[o])(l),i!==void 0&&e.finished.finally(i);(Si&3)!==0&&Ho(),wi(t),n=t.pendingLanes,(s&261930)!==0&&(n&42)!==0?t===Ua?Jn++:(Jn=0,Ua=t):(Jn=0,Ua=null),El(0,!1)}}function y0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bl(t)))}function Ho(){return Xr!==null&&(Xr.skipTransition(),Xr=null),nu(),lu(),au(),ou()}function ou(){if(ge!==5)return!1;var e=si,t=su;su=0;var i=xu(Si),s=L.T,r=J.p;try{J.p=32>i?32:i,L.T=null,i=ru,ru=null;var n=si,l=Si;if(ge=0,rr=si=null,Si=0,(Q&6)!==0)throw Error(b(331));var a=Q;if(Q|=4,o0(n.current),n0(n,n.current,l,i),Q=a,El(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(vl,n)}catch{}return!0}finally{J.p=r,L.T=s,y0(e,t)}}function Cm(e,t,i){t=It(i,t),t=Kc(e.stateNode,t,2),e=gs(e,t,2),e!==null&&(pl(e,2),wi(e))}function se(e,t,i){if(e.tag===3)Cm(e,e,i);else for(;t!==null;){if(t.tag===3){Cm(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ys===null||!ys.has(s))){e=It(i,e),i=zg(2),s=gs(t,i,2),s!==null&&(Lg(i,s,t,e),pl(s,2),wi(s));break}}t=t.return}}function sc(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Ob;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(od=!0,r.add(i),e=qb.bind(null,e,t,i),t.then(e,e))}function qb(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,le===e&&(X&i)===i&&((we===4||we===3&&(X&62914560)===X&&300>At()-ko)&&(Q&2)===0?sn(e,0):uo|=i,en===X&&(en=0)),wi(e)}function b0(e,t){t===0&&(t=uv()),e=or(e,t),e!==null&&(pl(e,t),wi(e))}function Yb(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),b0(e,i)}function Kb(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(b(314))}s!==null&&s.delete(t),b0(e,i)}function Vb(e,t){return Cu(e,t)}var rn=null,Dr=null,hu=!1,vo=!1,rc=!1,fs=0;function wi(e){e!==Dr&&e.next===null&&(Dr===null?rn=Dr=e:Dr=Dr.next=e),vo=!0,hu||(hu=!0,Gb())}function El(e,t){if(!rc&&vo){rc=!0;do for(var i=!1,s=rn;s!==null;){if(!t)if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var l=s.suspendedLanes,a=s.pingedLanes;n=(1<<31-Ot(42|e)+1)-1,n&=r&~(l&~a),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,Em(s,n))}else n=X,n=yo(s,s===le?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||gl(s,n)||(i=!0,Em(s,n));s=s.next}while(i);rc=!1}}function Pb(){w0()}function w0(){vo=hu=!1;var e=0;fs!==0&&$b()&&(e=fs);for(var t=At(),i=null,s=rn;s!==null;){var r=s.next,n=C0(s,t);n===0?(s.next=null,i===null?rn=r:i.next=r,r===null&&(Dr=i)):(i=s,(e!==0||(n&3)!==0)&&(vo=!0)),s=r}ge!==0&&ge!==5||El(e,!1),fs!==0&&(fs=0)}function C0(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var l=31-Ot(n),a=1<<l,o=r[l];o===-1?((a&i)===0||(a&s)!==0)&&(r[l]=ay(a,t)):o<=t&&(e.expiredLanes|=a),n&=~a}if(t=le,i=X,i=yo(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(te===2||te===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Lh(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||gl(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Lh(s),xu(i)){case 2:case 8:i=ov;break;case 32:i=Xa;break;case 268435456:i=hv;break;default:i=Xa}return s=E0.bind(null,e),i=Cu(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Lh(s),e.callbackPriority=2,e.callbackNode=null,2}function E0(e,t){if(ge!==0&&ge!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Ho()&&e.callbackNode!==i)return null;var s=X;return s=yo(e,e===le?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(f0(e,s,t),C0(e,At()),e.callbackNode!=null&&e.callbackNode===i?E0.bind(null,e):null)}function Em(e,t){if(Ho())return null;f0(e,t,!0)}function Gb(){tw(function(){(Q&6)!==0?Cu(av,Pb):w0()})}function cd(){if(fs===0){var e=er;e===0&&(e=na,na<<=1,(na&261888)===0&&(na=256)),fs=e}return fs}function xm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ta(e)}function Ib(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=xm((r[wt]||null).action),l=s.submitter;l&&(t=(t=l[wt]||null)?xm(t.formAction):l.getAttribute("formAction"),t!==null&&(n=t,l=null));var a=new wo("action","action",null,s,r);e.push({event:a,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(fs!==0){var o=new FormData(r,l);qc(i,{pending:!0,data:o,method:r.method,action:n},null,o)}}else typeof n=="function"&&(a.preventDefault(),o=new FormData(r,l),qc(i,{pending:!0,data:o,method:r.method,action:n},n,o))},currentTarget:r}]})}}for(ya=0;ya<Mc.length;ya++)ba=Mc[ya],Tm=ba.toLowerCase(),Dm=ba[0].toUpperCase()+ba.slice(1),ri(Tm,"on"+Dm);var ba,Tm,Dm,ya;ri(Lv,"onAnimationEnd");ri(Hv,"onAnimationIteration");ri(Uv,"onAnimationStart");ri("dblclick","onDoubleClick");ri("focusin","onFocus");ri("focusout","onBlur");ri(ib,"onTransitionRun");ri(sb,"onTransitionStart");ri(rb,"onTransitionCancel");ri(qv,"onTransitionEnd");Qr("onMouseEnter",["mouseout","mouseover"]);Qr("onMouseLeave",["mouseout","mouseover"]);Qr("onPointerEnter",["pointerout","pointerover"]);Qr("onPointerLeave",["pointerout","pointerover"]);lr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));lr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));lr("onBeforeInput",["compositionend","keypress","textInput","paste"]);lr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));lr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));lr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="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(" "),jb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function x0(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var l=s.length-1;0<=l;l--){var a=s[l],o=a.instance,h=a.currentTarget;if(a=a.listener,o!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=h;try{n(r)}catch(u){Wa(u)}r.currentTarget=null,n=o}else for(l=0;l<s.length;l++){if(a=s[l],o=a.instance,h=a.currentTarget,a=a.listener,o!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=h;try{n(r)}catch(u){Wa(u)}r.currentTarget=null,n=o}}}}function G(e,t){var i=t[b_];i===void 0&&(i=t[b_]=new Set);var s=e+"__bubble";i.has(s)||(T0(t,e,2,!1),i.add(s))}function nc(e,t,i){var s=0;t&&(s|=4),T0(i,e,s,t)}var wa="_reactListening"+Math.random().toString(36).slice(2);function ud(e){if(!e[wa]){e[wa]=!0,gv.forEach(function(i){i!=="selectionchange"&&(jb.has(i)||nc(i,!1,e),nc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wa]||(t[wa]=!0,nc("selectionchange",!1,t))}}function T0(e,t,i,s){switch(Z0(t)){case 2:var r=Uw;break;case 8:r=qw;break;default:r=pd}i=r.bind(null,t,i,e),r=void 0,!Ec||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function lc(e,t,i,s,r){var n=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var l=s.tag;if(l===3||l===4){var a=s.stateNode.containerInfo;if(a===r)break;if(l===4)for(l=s.return;l!==null;){var o=l.tag;if((o===3||o===4)&&l.stateNode.containerInfo===r)return;l=l.return}for(;a!==null;){if(l=Gs(a),l===null)return;if(o=l.tag,o===5||o===6||o===26||o===27){s=n=l;continue e}a=a.parentNode}}s=s.return}xv(function(){var h=n,u=Du(i),d=[];e:{var c=Yv.get(e);if(c!==void 0){var f=wo,_=e;switch(e){case"keypress":if(Ma(i)===0)break e;case"keydown":case"keyup":f=By;break;case"focusin":_="focus",f=Vh;break;case"focusout":_="blur",f=Vh;break;case"beforeblur":case"afterblur":f=Vh;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=A_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=yy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Hy;break;case Lv:case Hv:case Uv:f=Cy;break;case qv:f=qy;break;case"scroll":case"scrollend":f=py;break;case"wheel":f=Ky;break;case"copy":case"cut":case"paste":f=xy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=O_;break;case"submit":f=zy;break;case"toggle":case"beforetoggle":f=Py}var p=(t&4)!==0,y=!p&&(e==="scroll"||e==="scrollend"),m=p?c!==null?c+"Capture":null:c;p=[];for(var v=h,g;v!==null;){var S=v;if(g=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||g===null||m===null||(S=el(v,m),S!=null&&p.push(hl(v,S,g))),y)break;v=v.return}0<p.length&&(c=new f(c,_,null,i,u),d.push({event:c,listeners:p}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",c=e==="mouseout"||e==="pointerout",f&&i!==Cc&&(_=i.relatedTarget||i.fromElement)&&(Gs(_)||_[cn]))break e;(c||f)&&(_=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,c?(f=i.relatedTarget||i.toElement,c=h,f=f?Gs(f):null,f!==null&&(y=ml(f),p=f.tag,f!==y||p!==5&&p!==27&&p!==6)&&(f=null)):(c=null,f=h),c!==f&&(p=A_,S="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(p=O_,S="onPointerLeave",m="onPointerEnter",v="pointer"),y=c==null?_:Hn(c),g=f==null?_:Hn(f),_=new p(S,v+"leave",c,i,u),_.target=y,_.relatedTarget=g,S=null,Gs(u)===h&&(p=new p(m,v+"enter",f,i,u),p.target=g,p.relatedTarget=y,S=p),y=S,p=c&&f?uc(c,f,Xb):null,c!==null&&Mm(d,_,c,p,!1),f!==null&&y!==null&&Mm(d,y,f,p,!0)))}e:{if(c=h?Hn(h):window,f=c.nodeName&&c.nodeName.toLowerCase(),f==="select"||f==="input"&&c.type==="file")var C=z_;else if(k_(c))if(Ov)C=$y;else{C=Qy;var A=Zy}else f=c.nodeName,!f||f.toLowerCase()!=="input"||c.type!=="checkbox"&&c.type!=="radio"?h&&Tu(h.elementType)&&(C=z_):C=Jy;if(C&&(C=C(e,h))){Rv(d,C,i,u);break e}A&&A(e,c,h)}switch(A=h?Hn(h):window,e){case"focusin":(k_(A)||A.contentEditable==="true")&&(Nr=A,Tc=h,Vn=null);break;case"focusout":Vn=Tc=Nr=null;break;case"mousedown":Dc=!0;break;case"contextmenu":case"mouseup":case"dragend":Dc=!1,q_(d,i,u);break;case"selectionchange":if(tb)break;case"keydown":case"keyup":q_(d,i,u)}var T;if(Ru)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Br?Mv(e,i)&&(k="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(k="onCompositionStart");k&&(Dv&&i.locale!=="ko"&&(Br||k!=="onCompositionStart"?k==="onCompositionEnd"&&Br&&(T=Tv()):(hs=u,Mu="value"in hs?hs.value:hs.textContent,Br=!0)),A=go(h,k),0<A.length&&(k=new R_(k,e,null,i,u),d.push({event:k,listeners:A}),T?k.data=T:(T=Av(i),T!==null&&(k.data=T)))),(T=Iy?jy(e,i):Xy(e,i))&&(k=go(h,"onBeforeInput"),0<k.length&&(A=new R_("onBeforeInput","beforeinput",null,i,u),d.push({event:A,listeners:k}),A.data=T)),Ib(d,e,h,i,u)}x0(d,t)})}function hl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function go(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=el(e,i),r!=null&&s.unshift(hl(e,r,n)),r=el(e,t),r!=null&&s.push(hl(e,r,n))),e.tag===3)return s;e=e.return}return[]}function Xb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Mm(e,t,i,s,r){for(var n=t._reactName,l=[];i!==null&&i!==s;){var a=i,o=a.alternate,h=a.stateNode;if(a=a.tag,o!==null&&o===s)break;a!==5&&a!==26&&a!==27||h===null||(o=h,r?(h=el(i,n),h!=null&&l.unshift(hl(i,h,o))):r||(h=el(i,n),h!=null&&l.push(hl(i,h,o)))),i=i.return}l.length!==0&&e.push({event:t,listeners:l})}var Fb=/\r\n?/g,Wb=/\u0000|\uFFFD/g;function Am(e){return(typeof e=="string"?e:""+e).replace(Fb,`
10
- `).replace(Wb,"")}function D0(e,t){return t=Am(t),Am(e)===t}function ie(e,t,i,s,r,n){switch(i){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||Jr(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&Jr(e,""+s);else return;break;case"className":oa(e,"class",s);break;case"tabIndex":oa(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":oa(e,i,s);break;case"style":Ev(e,s,n);return;case"data":if(t!=="object"){oa(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ta(s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 n=="function"&&(i==="formAction"?(t!=="input"&&ie(e,t,"name",r.name,r,null),ie(e,t,"formEncType",r.formEncType,r,null),ie(e,t,"formMethod",r.formMethod,r,null),ie(e,t,"formTarget",r.formTarget,r,null)):(ie(e,t,"encType",r.encType,r,null),ie(e,t,"method",r.method,r,null),ie(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ta(s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=mi);return;case"onScroll":s!=null&&G("scroll",e);return;case"onScrollEnd":s!=null&&G("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(b(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(b(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Ta(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":G("beforetoggle",e),G("toggle",e),xa(e,"popover",s);break;case"xlinkActuate":Ri(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ri(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ri(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ri(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ri(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ri(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ri(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ri(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ri(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":xa(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=vy.get(i)||i,xa(e,i,s);else return}W=!0}function cu(e,t,i,s,r,n){switch(i){case"style":Ev(e,s,n);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(b(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(b(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof s=="string")Jr(e,s);else if(typeof s=="number"||typeof s=="bigint")Jr(e,""+s);else return;break;case"onScroll":s!=null&&G("scroll",e);return;case"onScrollEnd":s!=null&&G("scrollend",e);return;case"onClick":s!=null&&(e.onclick=mi);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!pv.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),n=i.slice(2,r?i.length-7:void 0),t=e[wt]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(n,t,r),typeof s=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,s,r);break e}W=!0,i in e?e[i]=s:s===!0?e.setAttribute(i,""):xa(e,i,s)}return}W=!0}function et(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":G("error",e),G("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];if(l!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(b(137,t));default:ie(e,t,n,l,i,null)}}r&&ie(e,t,"srcSet",i.srcSet,i,null),s&&ie(e,t,"src",i.src,i,null);return;case"input":G("invalid",e);var a=n=l=r=null,o=null,h=null;for(s in i)if(i.hasOwnProperty(s)){var u=i[s];if(u!=null)switch(s){case"name":r=u;break;case"type":l=u;break;case"checked":o=u;break;case"defaultChecked":h=u;break;case"value":n=u;break;case"defaultValue":a=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(b(137,t));break;default:ie(e,t,s,u,i,null)}}bv(e,n,a,o,h,l,r,!1);return;case"select":G("invalid",e),s=l=n=null;for(r in i)if(i.hasOwnProperty(r)&&(a=i[r],a!=null))switch(r){case"value":n=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:ie(e,t,r,a,i,null)}t=n,i=l,e.multiple=!!s,t!=null?Kr(e,!!s,t,!1):i!=null&&Kr(e,!!s,i,!0);return;case"textarea":G("invalid",e),n=r=s=null;for(l in i)if(i.hasOwnProperty(l)&&(a=i[l],a!=null))switch(l){case"value":s=a;break;case"defaultValue":r=a;break;case"children":n=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(b(91));break;default:ie(e,t,l,a,i,null)}Cv(e,s,r,n);return;case"option":for(o in i)i.hasOwnProperty(o)&&(s=i[o],s!=null)&&(o==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":ie(e,t,o,s,i,null));return;case"dialog":G("beforetoggle",e),G("toggle",e),G("cancel",e),G("close",e);break;case"iframe":case"object":G("load",e);break;case"video":case"audio":for(s=0;s<ol.length;s++)G(ol[s],e);break;case"image":G("error",e),G("load",e);break;case"details":G("toggle",e);break;case"embed":case"source":case"link":G("error",e),G("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(h in i)if(i.hasOwnProperty(h)&&(s=i[h],s!=null))switch(h){case"children":case"dangerouslySetInnerHTML":throw Error(b(137,t));default:ie(e,t,h,s,i,null)}return;default:if(Tu(t)){for(u in i)i.hasOwnProperty(u)&&(s=i[u],s!==void 0&&cu(e,t,u,s,i,void 0));return}}for(a in i)i.hasOwnProperty(a)&&(s=i[a],s!=null&&ie(e,t,a,s,i,null))}var Zb={};function Qb(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,n=null,l=null,a=null,o=null,h=null,u=null;for(f in i){var d=i[f];if(i.hasOwnProperty(f)&&d!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":o=d;default:s.hasOwnProperty(f)||ie(e,t,f,null,s,d)}}for(var c in s){var f=s[c];if(d=i[c],s.hasOwnProperty(c)&&(f!=null||d!=null))switch(c){case"type":f!==d&&(W=!0),n=f;break;case"name":f!==d&&(W=!0),r=f;break;case"checked":f!==d&&(W=!0),h=f;break;case"defaultChecked":f!==d&&(W=!0),u=f;break;case"value":f!==d&&(W=!0),l=f;break;case"defaultValue":f!==d&&(W=!0),a=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(b(137,t));break;default:f!==d&&ie(e,t,c,f,s,d)}}wc(e,l,a,o,h,u,n,r);return;case"select":f=l=a=c=null;for(n in i)if(o=i[n],i.hasOwnProperty(n)&&o!=null)switch(n){case"value":break;case"multiple":f=o;default:s.hasOwnProperty(n)||ie(e,t,n,null,s,o)}for(r in s)if(n=s[r],o=i[r],s.hasOwnProperty(r)&&(n!=null||o!=null))switch(r){case"value":n!==o&&(W=!0),c=n;break;case"defaultValue":n!==o&&(W=!0),a=n;break;case"multiple":n!==o&&(W=!0),l=n;default:n!==o&&ie(e,t,r,n,s,o)}t=a,i=l,s=f,c!=null?Kr(e,!!i,c,!1):!!s!=!!i&&(t!=null?Kr(e,!!i,t,!0):Kr(e,!!i,i?[]:"",!1));return;case"textarea":f=c=null;for(a in i)if(r=i[a],i.hasOwnProperty(a)&&r!=null&&!s.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:ie(e,t,a,null,s,r)}for(l in s)if(r=s[l],n=i[l],s.hasOwnProperty(l)&&(r!=null||n!=null))switch(l){case"value":r!==n&&(W=!0),c=r;break;case"defaultValue":r!==n&&(W=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(b(91));break;default:r!==n&&ie(e,t,l,r,s,n)}wv(e,c,f);return;case"option":for(var _ in i)c=i[_],i.hasOwnProperty(_)&&c!=null&&!s.hasOwnProperty(_)&&(_==="selected"?e.selected=!1:ie(e,t,_,null,s,c));for(o in s)c=s[o],f=i[o],s.hasOwnProperty(o)&&c!==f&&(c!=null||f!=null)&&(o==="selected"?(c!==f&&(W=!0),e.selected=c&&typeof c!="function"&&typeof c!="symbol"):ie(e,t,o,c,s,f));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 p in i)c=i[p],i.hasOwnProperty(p)&&c!=null&&!s.hasOwnProperty(p)&&ie(e,t,p,null,s,c);for(h in s)if(c=s[h],f=i[h],s.hasOwnProperty(h)&&c!==f&&(c!=null||f!=null))switch(h){case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(b(137,t));break;default:ie(e,t,h,c,s,f)}return;default:if(Tu(t)){for(var y in i)c=i[y],i.hasOwnProperty(y)&&c!==void 0&&!s.hasOwnProperty(y)&&cu(e,t,y,void 0,s,c);for(u in s)c=s[u],f=i[u],!s.hasOwnProperty(u)||c===f||c===void 0&&f===void 0||cu(e,t,u,c,s,f);return}}for(var m in i)c=i[m],i.hasOwnProperty(m)&&c!=null&&!s.hasOwnProperty(m)&&ie(e,t,m,null,s,c);for(d in s)c=s[d],f=i[d],!s.hasOwnProperty(d)||c===f||c==null&&f==null||ie(e,t,d,c,s,f)}function Rm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,l=r.initiatorType,a=r.duration;if(n&&a&&Rm(l)){for(l=0,a=r.responseEnd,s+=1;s<i.length;s++){var o=i[s],h=o.startTime;if(h>a)break;var u=o.transferSize,d=o.initiatorType;u&&Rm(d)&&(o=o.responseEnd,l+=u*(o<a?1:(a-h)/(o-h)))}if(--s,t+=8*(n+l)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var uu=null,du=null;function cl(e){return e.nodeType===9?e:e.ownerDocument}function Om(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 M0(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 A0(e,t,i,s){return i=cl(i).createElement(e),i[Ze]=s,i[wt]=t,et(i,e,t),Ke(i),i}function fu(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 ac=null;function $b(){var e=window.event;return e&&e.type==="popstate"?e===ac?!1:(ac=e,!0):(ac=null,!1)}var dd=typeof setTimeout=="function"?setTimeout:void 0,ew=typeof clearTimeout=="function"?clearTimeout:void 0,Bm=typeof Promise=="function"?Promise:void 0,Nm=typeof requestAnimationFrame=="function"?requestAnimationFrame:dd,tw=typeof queueMicrotask=="function"?queueMicrotask:typeof Bm<"u"?function(e){return Bm.resolve(null).then(e).catch(iw)}:dd;function iw(e){setTimeout(function(){throw e})}function Rs(e){return e==="head"}function km(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),hn(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")hc(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,hc(i);for(var n=i.firstChild;n;){var l=n.nextSibling,a=n.nodeName;n[Sl]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=l}}else i==="body"&&hc(e.ownerDocument.body);i=r}while(i);hn(t)}function zm(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function R0(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var r=s=0;r<t.length;r++){var n=t[r];0<n.width&&0<n.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function O0(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function B0(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function _u(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return B0(t,i,e)}function sw(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var i=getComputedStyle(e);return B0(t,i,e)}function rw(e){return e.documentElement.clientHeight}function nw(e){this.addEventListener("load",e),this.addEventListener("error",e)}function lw(e,t,i,s,r,n,l,a,o){var h=t.nodeType===9?t:t.ownerDocument;try{var u=h.startViewTransition({update:function(){var c=h.defaultView,f=c.navigation&&c.navigation.transition,_=h.fonts.status;s();var p=[];if(_==="loaded"&&(rw(h),h.fonts.status==="loading"&&p.push(h.fonts.ready)),_=p.length,e!==null)for(var y=e.suspenseyImages,m=0,v=0;v<y.length;v++){var g=y[v];if(!g.complete){var S=g.getBoundingClientRect();if(0<S.bottom&&0<S.right&&S.top<c.innerHeight&&S.left<c.innerWidth){if(m+=G0(g),m>Ka){p.length=_;break}g=new Promise(nw.bind(g)),p.push(g)}}}if(0<p.length)return c=Promise.race([Promise.all(p),new Promise(function(C){return setTimeout(C,500)})]).then(r,r),(f?Promise.allSettled([f.finished,c]):c).then(n,n);if(r(),f)return f.finished.then(n,n);n()},types:i});h.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var c=h.documentElement.getAnimations({subtree:!0}),f=0;f<c.length;f++){var _=c[f],p=_.effect,y=p.pseudoElement;if(y!=null&&y.startsWith("::view-transition")){d.push(_),_=p.getKeyframes();for(var m=y=void 0,v=!0,g=0;g<_.length;g++){var S=_[g],C=S.width;if(y===void 0)y=C;else if(y!==C){v=!1;break}if(C=S.height,m===void 0)m=C;else if(m!==C){v=!1;break}delete S.width,delete S.height,S.transform==="none"&&delete S.transform}v&&y!==void 0&&m!==void 0&&(p.setKeyframes(_),v=getComputedStyle(p.target,p.pseudoElement),v.width!==y||v.height!==m)&&(v=_[0],v.width=y,v.height=m,v=_[_.length-1],v.width=y,v.height=m,p.setKeyframes(_))}}l()},function(c){h.__reactViewTransition===u&&(h.__reactViewTransition=null);try{typeof c=="object"&&c!==null&&c.name==="InvalidStateError"&&(c.message==="View transition was skipped because document visibility state is hidden."||c.message==="Skipping view transition because document visibility state has become hidden."||c.message==="Skipping view transition because viewport size changed."||c.message==="Transition was aborted because of invalid state")&&(c=null),c!==null&&o(c)}finally{s(),r(),l()}}),u.finished.finally(function(){for(var c=0;c<d.length;c++)d[c].cancel();h.__reactViewTransition===u&&(h.__reactViewTransition=null),a()}),u}catch{return s(),r(),l(),null}}function Is(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Is.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:ae({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};Is.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),s=[],r=0;r<i.length;r++){var n=i[r].effect;n!==null&&n.target===e&&n.pseudoElement===t&&s.push(i[r])}return s};Is.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function N0(e){return{name:e,group:new Is("group",e),imagePair:new Is("image-pair",e),old:new Is("old",e),new:new Is("new",e)}}function kt(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}kt.prototype.addEventListener=function(e,t,i){var s=null,r=null;if(!(i!=null&&typeof i!="boolean"&&(s=i.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var n=this._eventListeners;if(k0(n,e,t,i)===-1){var l=this,a=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(a=function(o){l.removeEventListener(e,t,i),typeof t=="function"?t.call(this,o):t.handleEvent(o)}),s!==null&&(r=l.removeEventListener.bind(l,e,t,i),s.addEventListener("abort",r,{once:!0}),r=s.removeEventListener.bind(s,"abort",r)),s=nn(i),n.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:a,cleanup:r}),bt(this._fragmentFiber.child,!1,aw,e,a,s)}this._eventListeners=n}};function aw(e,t,i,s){return Ne(e).addEventListener(t,i,s),!1}kt.prototype.removeEventListener=function(e,t,i){var s=this._eventListeners;if(s!==null&&(t=k0(s,e,t,i),t!==-1)){var r=s[t];i=r.attachedListener;var n=r.cleanup;r=nn(r.optionsOrUseCapture),bt(this._fragmentFiber.child,!1,ow,e,i,r),s.splice(t,1),n!==null&&n()}};function ow(e,t,i,s){return Ne(e).removeEventListener(t,i,s),!1}function nn(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Lm(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function k0(e,t,i,s){if(e.length===0)return-1;s=Lm(s);for(var r=0;r<e.length;r++){var n=e[r];if(n.type===t&&n.listener===i&&Lm(n.optionsOrUseCapture)===s)return r}return-1}kt.prototype.dispatchEvent=function(e){var t=nr(this._fragmentFiber);if(t===null)return!0;t=Ne(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var r=0;r<i.length;r++){var n=i[r];s.addEventListener(n.type,n.attachedListener,nn(n.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),i)for(r=0;r<i.length;r++)n=i[r],s.removeEventListener(n.type,n.attachedListener,nn(n.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};kt.prototype.focus=function(e){bt(this._fragmentFiber.child,!0,z0,e,void 0,void 0)};function z0(e,t){return e.tag===6?!1:(e=Ne(e),yw(e,t))}kt.prototype.focusLast=function(e){var t=[];bt(this._fragmentFiber.child,!0,fd,t,void 0,void 0);for(var i=t.length-1;0<=i&&!z0(t[i],e);i--);};function fd(e,t){return t.push(e),!1}kt.prototype.blur=function(){var e=nr(this._fragmentFiber);e!==null&&(e=Ne(e),e=cl(e).activeElement,e!==null&&bt(this._fragmentFiber.child,!1,hw,e,void 0,void 0))};function hw(e,t){return e.tag===6?!1:(e=Ne(e),e===t||e.contains(t)?(t.blur(),!0):!1)}kt.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),bt(this._fragmentFiber.child,!1,cw,e,void 0,void 0)};function cw(e,t){return e.tag===6||(e=Ne(e),t.observe(e)),!1}kt.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),bt(this._fragmentFiber.child,!1,uw,e,void 0,void 0);for(var i=t=0;i<ii.length;i++){var s=ii[i];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ii[t++]=s}ii.length=t}};function uw(e,t){return e.tag===6||(e=Ne(e),t.unobserve(e)),!1}var ii=[],oc=!1;function dw(e,t,i){ii.push({fragmentInstance:e,observer:t,instance:i}),oc||(oc=!0,bw(function(){oc=!1;var s=ii;ii=[];for(var r=0;r<s.length;r++){var n=s[r];n.observer.unobserve(n.instance)}}))}kt.prototype.getClientRects=function(){var e=[];return bt(this._fragmentFiber.child,!1,fw,e,void 0,void 0),e};function fw(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=Ne(e),t.push.apply(t,e.getClientRects());return!1}kt.prototype.getRootNode=function(e){var t=nr(this._fragmentFiber);return t===null?this:Ne(t).getRootNode(e)};kt.prototype.compareDocumentPosition=function(e){var t=nr(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];bt(this._fragmentFiber.child,!1,fd,i,void 0,void 0);var s=Ne(t);if(i.length===0){if(i=s,m_(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var r=s=i.compareDocumentPosition(e);return i===e?r=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=sv(t)[1],i===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=Ne(i).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Ne(i[0]),r=Ne(i[i.length-1]);var n=m_(this._fragmentFiber)?t.parentElement:s;if(n==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,n=n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var l=t.compareDocumentPosition(e),a=r.compareDocumentPosition(e),o=l&Node.DOCUMENT_POSITION_CONTAINED_BY||a&Node.DOCUMENT_POSITION_CONTAINED_BY;return a=s&&n&&l&Node.DOCUMENT_POSITION_FOLLOWING&&a&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||n&&r===e||o||a?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!n&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:l,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||_w(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function _w(e,t,i,s,r){var n=Gs(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!n)e:{for(;n!==null;){if(n.tag===7&&(n===t||n.alternate===t)){i=!0;break e}n=n.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(n===null)return n=r.ownerDocument,r===n||r===n.documentElement||r===n.body;e:{for(n=t,t=nr(t);n!==null;){if(!(n.tag!==5&&n.tag!==3&&n.tag!==27||n!==t&&n.alternate!==t)){n=!0;break e}n=n.return}n=!1}return n}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!n)&&!(t=n===i)&&(t=uc(i,n,v_),t===null?t=!1:(bt(t,!0,GS,n,i),n=Mr,Mr=null,t=n!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!n)&&!(t=n===s)&&(t=uc(s,n,v_),t===null?t=!1:(bt(t,!0,IS,n,s),n=Mr,cc=Mr=null,t=n!==null)),t):!1}function Hm(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}kt.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(b(566));var t=[];bt(this._fragmentFiber.child,!1,fd,t,void 0,void 0);var i=e!==!1;if(t.length===0){var s=sv(this._fragmentFiber);if(s=i?s[1]||s[0]||nr(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=Ne(s),Hm(e,i);return}if(s=Ne(s),s.nodeType!==9){if(s.nodeType===11){i="host"in s?s.host:null,i!==null&&i.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=i?t.length-1:0;s!==(i?-1:t.length);){var r=t[s];r.tag===6?(r=Ne(r),Hm(r,i)):Ne(r).scrollIntoView(e),s+=i?-1:1}};function mw(e,t){return e=Ne(e),L0(e,t),!1}function L0(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function H0(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.addEventListener(r.type,r.attachedListener,nn(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){for(var l=0,a=0;a<ii.length;a++){var o=ii[a];(o.fragmentInstance!==t||o.observer!==n||o.instance!==e)&&(ii[l++]=o)}ii.length=l,n.observe(e)}),L0(e,t))}function vw(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.removeEventListener(r.type,r.attachedListener,nn(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){typeof n.rootMargin=="string"?dw(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function mu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":mu(i),bo(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function gw(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Sl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=Xt(e.nextSibling),e===null)break}return null}function pw(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Xt(e.nextSibling),e===null))return null;return e}function U0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Xt(e.nextSibling),e===null))return null;return e}function vu(e){return e.data==="$?"||e.data==="$~"}function _d(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Sw(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Xt(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 gu=null;function Um(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Xt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function qm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function yw(e,t){function i(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return s}function bw(e){Nm(function(){Nm(function(t){return e(t)})})}function q0(e,t,i){switch(t=cl(i),e){case"html":if(e=t.documentElement,!e)throw Error(b(452));return e;case"head":if(e=t.head,!e)throw Error(b(453));return e;case"body":if(e=t.body,!e)throw Error(b(454));return e;default:throw Error(b(451))}}function Y0(e,t,i){for(var s in i){var r=i[s];i.hasOwnProperty(s)&&r!=null&&ie(e,t,s,null,Zb,r)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===mi&&(e.onclick=null),bo(e)}function hc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bo(e)}var Ft=new Map,Ym=new Set;function ul(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Gi=J.d;J.d={f:ww,r:Cw,D:Ew,C:xw,L:Tw,m:Dw,X:Aw,S:Mw,M:Rw};function ww(){var e=Gi.f(),t=zo();return e||t}function Cw(e){var t=un(e);t!==null&&t.tag===5&&t.type==="form"?Eg(t):Gi.r(e)}var mn=typeof document>"u"?null:document;function K0(e,t,i){var s=mn;if(s&&typeof t=="string"&&t){var r=Gt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),Ym.has(r)||(Ym.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),et(t,"link",e),Ke(t),s.head.appendChild(t)))}}function Ew(e){Gi.D(e),K0("dns-prefetch",e,null)}function xw(e,t){Gi.C(e,t),K0("preconnect",e,t)}function Tw(e,t,i){Gi.L(e,t,i);var s=mn;if(s&&e&&t){var r='link[rel="preload"][as="'+Gt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Gt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Gt(i.imageSizes)+'"]')):r+='[href="'+Gt(e)+'"]';var n=r;switch(t){case"style":n=ln(e);break;case"script":n=vn(e)}if(!(Ft.has(n)||(e=ae({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ft.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(xl(n))||t==="script"&&s.querySelector(Tl(n))))){var l=s.createElement("link");et(l,"link",e),t==="style"&&(l[Fa]=!0,l.onload=l.onerror=function(){vv(l)}),Ke(l),s.head.appendChild(l)}}}function Dw(e,t){Gi.m(e,t);var i=mn;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Gt(s)+'"][href="'+Gt(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vn(e)}if(!Ft.has(n)&&(e=ae({rel:"modulepreload",href:e},t),Ft.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Tl(n)))return}s=i.createElement("link"),et(s,"link",e),Ke(s),i.head.appendChild(s)}}}function Mw(e,t,i){Gi.S(e,t,i);var s=mn;if(s&&e){var r=Yr(s).hoistableStyles,n=ln(e);t=t||"default";var l=r.get(n);if(!l){var a={loading:0,preload:null};if(l=s.querySelector(xl(n)))a.loading=5;else{e=ae({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ft.get(n))&&md(e,i);var o=l=s.createElement("link");Ke(o),et(o,"link",e),o._p=new Promise(function(h,u){o.onload=h,o.onerror=u}),o.addEventListener("load",function(){a.loading|=1}),o.addEventListener("error",function(){a.loading|=2}),a.loading|=4,qa(l,t,s)}l={type:"stylesheet",instance:l,count:1,state:a},r.set(n,l)}}}function Aw(e,t){Gi.X(e,t);var i=mn;if(i&&e){var s=Yr(i).hoistableScripts,r=vn(e),n=s.get(r);n||(n=i.querySelector(Tl(r)),n||(e=ae({src:e,async:!0},t),(t=Ft.get(r))&&vd(e,t),n=i.createElement("script"),Ke(n),et(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function Rw(e,t){Gi.M(e,t);var i=mn;if(i&&e){var s=Yr(i).hoistableScripts,r=vn(e),n=s.get(r);n||(n=i.querySelector(Tl(r)),n||(e=ae({src:e,async:!0,type:"module"},t),(t=Ft.get(r))&&vd(e,t),n=i.createElement("script"),Ke(n),et(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function Km(e,t,i,s){var r=(r=_s.current)?ul(r):null;if(!r)throw Error(b(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=ln(i.href),t=Yr(r).hoistableStyles,s=t.get(i),s||(s={type:"style",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ln(i.href);var n=Yr(r).hoistableStyles,l=n.get(e);if(l||(r=r.ownerDocument||r,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,l),(n=r.querySelector(xl(e)))?n._p||(l.instance=n,l.state.loading=5):(n=Ft.get(e),n||(n={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ft.set(e,n)),Ow(r,e,n,l.state))),t&&s===null)throw Error(b(528,""));return l}if(t&&s!==null)throw Error(b(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=vn(i),t=Yr(r).hoistableScripts,s=t.get(i),s||(s={type:"script",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(b(444,e))}}function ln(e){return'href="'+Gt(e)+'"'}function xl(e){return'link[rel="stylesheet"]['+e+"]"}function V0(e){return ae({},e,{"data-precedence":e.precedence,precedence:null})}function Ow(e,t,i,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Fa]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[Fa]=!0,t.onload=t.onerror=vv.bind(null,t),et(t,"link",i),Ke(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function vn(e){return'[src="'+Gt(e)+'"]'}function Tl(e){return"script[async]"+e}function Vm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Gt(i.href)+'"]');if(s)return t.instance=s,Ke(s),s;var r=ae({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ke(s),et(s,"style",r),qa(s,i.precedence,e),t.instance=s;case"stylesheet":r=ln(i.href);var n=e.querySelector(xl(r));if(n)return t.state.loading|=4,t.instance=n,Ke(n),n;s=V0(i),(r=Ft.get(r))&&md(s,r),n=(e.ownerDocument||e).createElement("link"),Ke(n);var l=n;return l._p=new Promise(function(a,o){l.onload=a,l.onerror=o}),et(n,"link",s),t.state.loading|=4,qa(n,i.precedence,e),t.instance=n;case"script":return n=vn(i.src),(r=e.querySelector(Tl(n)))?(t.instance=r,Ke(r),r):(s=i,(r=Ft.get(n))&&(s=ae({},i),vd(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ke(r),et(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(b(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,qa(s,i.precedence,e));return t.instance}function qa(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,l=0;l<s.length;l++){var a=s[l];if(a.dataset.precedence===t)n=a;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ya=null;function Pm(e,t,i){if(Ya===null){var s=new Map,r=Ya=new Map;r.set(i,s)}else r=Ya,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[Sl]||n[Ze]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var l=n.getAttribute(t)||"";l=e+l;var a=s.get(l);a?a.push(n):s.set(l,[n])}}return s}function pu(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Bw(e,t,i){if(i===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Gm(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function P0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function G0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Im(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=G0(t),e.suspenseyImages.push(t)),e=zw.bind(e),t.decode().then(e,e))}function Nw(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=ln(s.href),n=t.querySelector(xl(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=dl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,Ke(n);return}n=t.ownerDocument||t,s=V0(s),(r=Ft.get(r))&&md(s,r),n=n.createElement("link"),Ke(n);var l=n;l._p=new Promise(function(a,o){l.onload=a,l.onerror=o}),et(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=dl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Ka=0;function kw(e,t){return e.stylesheets&&e.count===0&&Va(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Va(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Ka===0&&(Ka=62500*Jb());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Va(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Ka?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function I0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Va(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function dl(){this.count--,I0(this)}function zw(){this.imgCount--,I0(this)}var po=null;function Va(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,po=new Map,t.forEach(Lw,e),po=null,dl.call(e))}function Lw(e,t){if(!(t.state.loading&4)){var i=po.get(e);if(i)var s=i.get(null);else{i=new Map,po.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var l=r[n];(l.nodeName==="LINK"||l.getAttribute("media")!=="not all")&&(i.set(l.dataset.precedence,l),s=l)}s&&i.set(null,s)}r=t.instance,l=r.getAttribute("data-precedence"),n=i.get(l)||s,n===s&&i.set(null,r),i.set(l,r),this.count++,s=dl.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var an={$$typeof:_i,Provider:null,Consumer:null,_currentValue:js,_currentValue2:js,_threadCount:0};function Hw(e,t,i,s,r,n,l,a,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=Hh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hh(0),this.hiddenUpdates=Hh(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.transitionTypes=null,this.incompleteTransitions=new Map}function j0(e,t,i,s,r,n,l,a,o,h,u,d){return e=new Hw(e,t,i,l,o,h,u,d,a),t=1,n===!0&&(t|=24),n=St(3,null,null,t),e.current=n,n.stateNode=e,t=Lu(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},qu(n),e}function X0(e){return e?(e=Lr,e):Lr}function F0(e,t,i,s,r,n){r=X0(r),s.context===null?s.context=r:s.pendingContext=r,s=vs(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=gs(e,s,t),i!==null&&(yt(i,e,t),Gn(i,e,t))}function jm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function gd(e,t){jm(e,t),(e=e.alternate)&&jm(e,t)}function W0(e){if(e.tag===13||e.tag===31){var t=or(e,67108864);t!==null&&yt(t,e,67108864),gd(e,67108864)}}function Xm(e){if(e.tag===13||e.tag===31){var t=Bt();t=Eu(t);var i=or(e,t);i!==null&&yt(i,e,t),gd(e,t)}}var on=!0;function Uw(e,t,i,s){var r=L.T;L.T=null;var n=J.p;try{J.p=2,pd(e,t,i,s)}finally{J.p=n,L.T=r}}function qw(e,t,i,s){var r=L.T;L.T=null;var n=J.p;try{J.p=8,pd(e,t,i,s)}finally{J.p=n,L.T=r}}function pd(e,t,i,s){if(on){var r=Su(s);if(r===null)lc(e,t,s,So,i),Fm(e,s);else if(Kw(r,e,t,i,s))s.stopPropagation();else if(Fm(e,s),t&4&&-1<Yw.indexOf(e)){for(;r!==null;){var n=un(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var l=Ks(n.pendingLanes);if(l!==0){var a=n;for(a.pendingLanes|=2,a.entangledLanes|=2;l;){var o=1<<31-Ot(l);a.entanglements[1]|=o,l&=~o}wi(n),(Q&6)===0&&(fo=At()+500,El(0,!1))}}break;case 31:case 13:a=or(n,2),a!==null&&yt(a,n,2),zo(),gd(n,2)}if(n=Su(s),n===null&&lc(e,t,s,So,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else lc(e,t,s,null,i)}}function Su(e){return e=Du(e),Sd(e)}var So=null;function Sd(e){if(So=null,e=Gs(e),e!==null){var t=ml(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=ev(t),e!==null)return e;e=null}else if(i===31){if(e=tv(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return So=e,null}function Z0(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ey()){case av:return 2;case ov:return 8;case Xa:case ty:return 32;case hv:return 268435456;default:return 32}default:return 32}}var yu=!1,bs=null,ws=null,Cs=null,fl=new Map,_l=new Map,as=[],Yw="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 Fm(e,t){switch(e){case"focusin":case"focusout":bs=null;break;case"dragenter":case"dragleave":ws=null;break;case"mouseover":case"mouseout":Cs=null;break;case"pointerover":case"pointerout":fl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_l.delete(t.pointerId)}}function Nn(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=un(t),t!==null&&W0(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Kw(e,t,i,s,r){switch(t){case"focusin":return bs=Nn(bs,e,t,i,s,r),!0;case"dragenter":return ws=Nn(ws,e,t,i,s,r),!0;case"mouseover":return Cs=Nn(Cs,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return fl.set(n,Nn(fl.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,_l.set(n,Nn(_l.get(n)||null,e,t,i,s,r)),!0}return!1}function Q0(e){var t=Gs(e.target);if(t!==null){var i=ml(t);if(i!==null){if(t=i.tag,t===13){if(t=ev(i),t!==null){e.blockedOn=t,y_(e.priority,function(){Xm(i)});return}}else if(t===31){if(t=tv(i),t!==null){e.blockedOn=t,y_(e.priority,function(){Xm(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Su(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Cc=s,i.target.dispatchEvent(s),Cc=null}else return t=un(i),t!==null&&W0(t),e.blockedOn=i,!1;t.shift()}return!0}function Wm(e,t,i){Pa(e)&&i.delete(t)}function Vw(){yu=!1,bs!==null&&Pa(bs)&&(bs=null),ws!==null&&Pa(ws)&&(ws=null),Cs!==null&&Pa(Cs)&&(Cs=null),fl.forEach(Wm),_l.forEach(Wm)}function Ca(e,t){e.blockedOn===t&&(e.blockedOn=null,yu||(yu=!0,ke.unstable_scheduleCallback(ke.unstable_NormalPriority,Vw)))}var Ea=null;function Zm(e){Ea!==e&&(Ea=e,ke.unstable_scheduleCallback(ke.unstable_NormalPriority,function(){Ea===e&&(Ea=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Sd(s||i)===null)continue;break}var n=un(i);n!==null&&(e.splice(t,3),t-=3,qc(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function hn(e){function t(o){return Ca(o,e)}bs!==null&&Ca(bs,e),ws!==null&&Ca(ws,e),Cs!==null&&Ca(Cs,e),fl.forEach(t),_l.forEach(t);for(var i=0;i<as.length;i++){var s=as[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<as.length&&(i=as[0],i.blockedOn===null);)Q0(i),i.blockedOn===null&&as.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],l=r[wt]||null;if(typeof n=="function")l||Zm(i);else if(l){var a=null;if(n&&n.hasAttribute("formAction")){if(r=n,l=n[wt]||null)a=l.formAction;else if(Sd(r)!==null)continue}else a=l.action;typeof a=="function"?i[s+1]=a:(i.splice(s,3),s-=3),Zm(i)}}}function J0(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(l){return r=l})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function yd(e){this._internalRoot=e}Uo.prototype.render=yd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(b(409));var i=t.current,s=Bt();F0(i,s,e,t,null,null)};Uo.prototype.unmount=yd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;F0(e.current,2,null,e,null,null),zo(),t[cn]=null}};function Uo(e){this._internalRoot=e}Uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=mv();e={blockedOn:null,target:e,priority:t};for(var i=0;i<as.length&&t!==0&&t<as[i].priority;i++);as.splice(i,0,e),i===0&&Q0(e)}};var Qm=Jm.version;if(Qm!=="19.3.0")throw Error(b(527,Qm,"19.3.0"));J.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(b(188)):(e=Object.keys(e).join(","),Error(b(268,e)));return e=PS(t),e=e!==null?iv(e):null,e=e===null?null:e.stateNode,e};var Pw={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(kn=__REACT_DEVTOOLS_GLOBAL_HOOK__,!kn.isDisabled&&kn.supportsFiber))try{vl=kn.inject(Pw),Rt=kn}catch{}var kn;qo.createRoot=function(e,t){if(!$m(e))throw Error(b(299));var i=!1,s="",r=Bg,n=Ng,l=kg;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=j0(e,1,!1,null,null,i,s,null,r,n,l,J0),e[cn]=t.current,ud(e),new yd(t)};qo.hydrateRoot=function(e,t,i){if(!$m(e))throw Error(b(299));var s=!1,r="",n=Bg,l=Ng,a=kg,o=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(l=i.onCaughtError),i.onRecoverableError!==void 0&&(a=i.onRecoverableError),i.formState!==void 0&&(o=i.formState)),t=j0(e,1,!0,t,i??null,s,r,o,n,l,a,J0),t.context=X0(null),i=t.current,s=Bt(),s=Eu(s),r=vs(s),r.callback=null,gs(i,r,s),i=s,t.current.lanes=i,pl(t,i),wi(t),e[cn]=t.current,ud(e),new Uo(t)};qo.version="19.3.0"});var ip=ai((jx,tp)=>{"use strict";function ep(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ep)}catch(e){console.error(e)}}ep(),tp.exports=$0()});var oS=ai(vh=>{"use strict";var Mx=Symbol.for("react.transitional.element"),Ax=Symbol.for("react.fragment");function aS(e,t,i){var s=null;if(i!==void 0&&(s=""+i),t.key!==void 0&&(s=""+t.key),"key"in t){i={};for(var r in t)r!=="key"&&(i[r]=t[r])}else i=t;return t=i.ref,{$$typeof:Mx,type:e,key:s,ref:t!==void 0?t:null,props:i}}vh.Fragment=Ax;vh.jsx=aS;vh.jsxs=aS});var Bf=ai((x5,hS)=>{"use strict";hS.exports=oS()});var ye=Ql($l(),1),uS=Ql(ip(),1);var l1=Object.defineProperty,Gw=Object.getOwnPropertyDescriptor,Iw=(e,t)=>{for(var i in t)l1(e,i,{get:t[i],enumerable:!0})},Ee=(e,t,i,s)=>{for(var r=s>1?void 0:s?Gw(t,i):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(r=(s?l(t,i,r):l(r))||r);return s&&r&&l1(t,i,r),r},B=(e,t)=>(i,s)=>t(i,s,e),sp="Terminal input",Hd={get:()=>sp,set:e=>sp=e},rp="Too much output to announce, navigate to rows manually to read",Ud={get:()=>rp,set:e=>rp=e};function jw(e){return e.replace(/\r?\n/g,"\r")}function Xw(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function Fw(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function Ww(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");a1(r,t,i,s)}}function a1(e,t,i,s){e=jw(e),e=Xw(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function o1(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function np(e,t,i,s,r){o1(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function zs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ch(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var Zw=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let l=e.charCodeAt(n);if(55296<=l&&l<=56319){if(++n>=i)return this._interim=l,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(l-55296)*1024+a-56320+65536:(t[s++]=l,t[s++]=a);continue}l!==65279&&(t[s++]=l)}return s}},Qw=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,l,a,o=0,h=0;if(this.interim[0]){let c=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let _=0,p;for(;(p=this.interim[++_]&63)&&_<4;)f<<=6,f|=p;let y=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,m=y-_;for(;h<m;){if(h>=i)return 0;if(p=e[h++],(p&192)!==128){h--,c=!0;break}else this.interim[_++]=p,f<<=6,f|=p&63}c||(y===2?f<128?h--:t[s++]=f:y===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let u=i-4,d=h;for(;d<i;){for(;d<u&&!((r=e[d])&128)&&!((n=e[d+1])&128)&&!((l=e[d+2])&128)&&!((a=e[d+3])&128);)t[s++]=r,t[s++]=n,t[s++]=l,t[s++]=a,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((r&224)===192){if(d>=i)return this.interim[0]=r,s;if(n=e[d++],(n&192)!==128){d--;continue}if(o=(r&31)<<6|n&63,o<128){d--;continue}t[s++]=o}else if((r&240)===224){if(d>=i)return this.interim[0]=r,s;if(n=e[d++],(n&192)!==128){d--;continue}if(d>=i)return this.interim[0]=r,this.interim[1]=n,s;if(l=e[d++],(l&192)!==128){d--;continue}if(o=(r&15)<<12|(n&63)<<6|l&63,o<2048||o>=55296&&o<=57343||o===65279)continue;t[s++]=o}else if((r&248)===240){if(d>=i)return this.interim[0]=r,s;if(n=e[d++],(n&192)!==128){d--;continue}if(d>=i)return this.interim[0]=r,this.interim[1]=n,s;if(l=e[d++],(l&192)!==128){d--;continue}if(d>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=l,s;if(a=e[d++],(a&192)!==128){d--;continue}if(o=(r&7)<<18|(n&63)<<12|(l&63)<<6|a&63,o<65536||o>1114111)continue;t[s++]=o}}return s}},h1="",Ls=" ",jl=class c1{constructor(){this.fg=0,this.bg=0,this.extended=new th}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new c1;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},th=class u1{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new u1(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Jt=class d1 extends jl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new th,this.combinedData=""}static fromCharData(t){let i=new d1;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?zs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},lp="di$target",qd="di$dependencies",bd=new Map;function Jw(e){return e[qd]||[]}function Xe(e){if(bd.has(e))return bd.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");$w(t,i,r)};return t._id=e,bd.set(e,t),t}function $w(e,t,i){t[lp]===t?t[qd].push({id:e,index:i}):(t[qd]=[{id:e,index:i}],t[lp]=t)}var _t=Xe("BufferService"),f1=Xe("CoreMouseService"),gr=Xe("CoreService"),eC=Xe("CharsetService"),wf=Xe("InstantiationService"),_1=Xe("LogService"),mt=Xe("OptionsService"),m1=Xe("OscLinkService"),tC=Xe("UnicodeService"),Xl=Xe("DecorationService"),Yd=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Jt,l=i.getTrimmedLength(),a=-1,o=-1,h=!1;for(let u=0;u<l;u++)if(!(o===-1&&!i.hasContent(u))){if(i.loadCell(u,n),n.hasExtendedAttrs()&&n.extended.urlId)if(o===-1){o=u,a=n.extended.urlId;continue}else h=n.extended.urlId!==a;else o!==-1&&(h=!0);if(h||o!==-1&&u===l-1){let d=this._oscLinkService.getLinkData(a)?.uri;if(d){let c={start:{x:o+1,y:e},end:{x:u+(!h&&u===l-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let _=new URL(d);["http:","https:"].includes(_.protocol)||(f=!0)}catch{f=!0}f||s.push({text:d,range:c,activate:(_,p)=>r?r.activate(_,p,c):iC(_,p),hover:(_,p)=>r?.hover?.(_,p,c),leave:(_,p)=>r?.leave?.(_,p,c)})}h=!1,n.hasExtendedAttrs()&&n.extended.urlId?(o=u,a=n.extended.urlId):(o=-1,a=-1)}}t(s)}};Yd=Ee([B(0,_t),B(1,mt),B(2,m1)],Yd);function iC(e,t){if(confirm(`Do you want to navigate to ${t}?
9
+ `+s.stack}}var Yu=Object.prototype.hasOwnProperty,jd=je.unstable_scheduleCallback,au=je.unstable_cancelCallback,nw=je.unstable_shouldYield,lw=je.unstable_requestPaint,Qt=je.unstable_now,aw=je.unstable_getCurrentPriorityLevel,Em=je.unstable_ImmediatePriority,Tm=je.unstable_UserBlockingPriority,Jo=je.unstable_NormalPriority,ow=je.unstable_LowPriority,Mm=je.unstable_IdlePriority,hw=je.log,cw=je.unstable_setDisableYieldValue,fa=null,Jt=null;function Ks(e){if(typeof hw=="function"&&cw(e),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(fa,e)}catch{}}var ei=Math.clz32?Math.clz32:fw,uw=Math.log,dw=Math.LN2;function fw(e){return e>>>=0,e===0?32:31-(uw(e)/dw|0)|0}var co=256,uo=262144,fo=4194304;function Dr(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&-e;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 Eh(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,l=e.pingedLanes;e=e.warmLanes;var a=s&134217727;return a!==0?(s=a&~n,s!==0?r=Dr(s):(l&=a,l!==0?r=Dr(l):i||(i=a&~e,i!==0&&(r=Dr(i))))):(a=s&~n,a!==0?r=Dr(a):l!==0?r=Dr(l):i||(i=s&~e,i!==0&&(r=Dr(i)))),r===0?0:t!==0&&t!==r&&(t&n)===0&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function _a(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Lm(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-ei(i),r=1<<s;t|=e[s],i&=~r}return t}function _w(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+5e3;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 Am(){var e=fo;return fo<<=1,(fo&62914560)===0&&(fo=4194304),e}function ou(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ga(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gw(e,t,i,s,r,n){var l=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var a=e.entanglements,o=e.expirationTimes,h=e.hiddenUpdates;for(i=l&~i;0<i;){var c=31-ei(i),u=1<<c;a[c]=0,o[c]=-1;var d=h[c];if(d!==null)for(h[c]=null,c=0;c<d.length;c++){var f=d[c];f!==null&&(f.lane&=-536870913)}i&=~u}s!==0&&Dm(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(l&~t))}function Dm(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ei(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Rm(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-ei(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function Bm(e,t){var i=t&-t;return i=(i&42)!==0?1:$d(i),(i&(e.suspendedLanes|t))!==0?0:i}function $d(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 Xd(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function km(){var e=ne.p;return e!==0?e:(e=window.event,e===void 0?32:_S(e.type))}function Ug(e,t){var i=ne.p;try{return ne.p=e,t()}finally{ne.p=i}}var Ss=Math.random().toString(36).slice(2),ft="__reactFiber$"+Ss,Wt="__reactProps$"+Ss,tl="__reactContainer$"+Ss,Pg="__reactEvents$"+Ss,vw="__reactListeners$"+Ss,mw="__reactHandles$"+Ss,Ig="__reactResources$"+Ss,va="__reactMarker$"+Ss,eh="__reactLoad$"+Ss;function Th(e){delete e[ft],delete e[Wt],delete e[vw],delete e[mw]}function kr(e){var t;if(t=e[ft])return t;for(var i=e.parentNode;i;){if(t=i[tl]||i[ft]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=sm(e);e!==null;){if(i=e[ft])return i;e=sm(e)}return t}e=i,i=e.parentNode}return null}function il(e){if(e=e[ft]||e[tl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ol(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(D(33))}function Bn(e){var t=e[Ig];return t||(t=e[Ig]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[va]=!0}function Om(e){e[eh]=void 0}var Nm=new Set,zm={};function $r(e,t){Wn(e,t),Wn(e+"Capture",t)}function Wn(e,t){for(zm[e]=t,e=0;e<t.length;e++)Nm.add(t[e])}var pw=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]*$"),Fg={},qg={};function Sw(e){return Yu.call(qg,e)?!0:Yu.call(Fg,e)?!1:pw.test(e)?qg[e]=!0:(Fg[e]=!0,!1)}var se=!1;function Wg(){var e=se;return se=!1,e}function Ro(e,t,i){if(Sw(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function _o(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function as(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,s)}}function jt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yw(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(l){i=""+l,n.call(this,l)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(l){i=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gu(e){if(!e._valueTracker){var t=Hm(e)?"checked":"value";e._valueTracker=yw(e,t,""+e[t])}}function Um(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Hm(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}var bw=/[\n"\\]/g;function gi(e){return e.replace(bw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ku(e,t,i,s,r,n,l,a){e.name="",l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.type=l:e.removeAttribute("type"),t!=null?l==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jt(t)):e.value!==""+jt(t)&&(e.value=""+jt(t)):l!=="submit"&&l!=="reset"||e.removeAttribute("value"),t!=null?l==="number"&&e.value==t?hu(e,jt(e.value)):hu(e,jt(t)):i!=null?hu(e,jt(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+jt(a):e.removeAttribute("name")}function Pm(e,t,i,s,r,n,l,a){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Gu(e);return}i=i!=null?""+jt(i):"",t=t!=null?""+jt(t):i,a||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=a?e.checked:!!s,e.defaultChecked=!!s,l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.name=l),Gu(e)}function hu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function kn(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+jt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Im(e,t,i){if(t!=null&&(t=""+jt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+jt(i):""}function Fm(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(D(92));if(kl(s)){if(1<s.length)throw Error(D(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=jt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Gu(e)}function Vn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ww=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 Vg(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||ww.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function qm(e,t,i){if(t!=null&&typeof t!="object")throw Error(D(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",se=!0);for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&(Vg(e,r,s),se=!0)}else for(var n in t)t.hasOwnProperty(n)&&Vg(e,n,t[n])}function Zd(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 Cw=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"],["maskType","mask-type"],["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"]]),xw=/^[\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 Bo(e){return xw.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vi(){}var ju=null;function Qd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,On=null;function Yg(e){var t=il(e);if(t&&(e=t.stateNode)){var i=e[Wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ku(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+gi(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[Wt]||null;if(!r)throw Error(D(90));Ku(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Um(s)}break e;case"textarea":Im(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&kn(e,!!i.multiple,t,!1)}}}var cu=!1;function Wm(e,t,i){if(cu)return e(t,i);cu=!0;try{var s=e(t);return s}finally{if(cu=!1,(Cn!==null||On!==null)&&(Ih(),Cn&&(t=Cn,e=On,On=Cn=null,Yg(t),e)))for(t=0;t<e.length;t++)Yg(e[t])}}function Zl(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Wt]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(D(231,t,typeof i));return i}var fs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$u=!1;if(fs)try{_n={},Object.defineProperty(_n,"passive",{get:function(){$u=!0}}),window.addEventListener("test",_n,_n),window.removeEventListener("test",_n,_n)}catch{$u=!1}var _n,js=null,Jd=null,ko=null;function Vm(){if(ko)return ko;var e,t=Jd,i=t.length,s,r="value"in js?js.value:js.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var l=i-e;for(s=1;s<=l&&t[i-s]===r[n-s];s++);return ko=r.slice(e,1<s?1-s:void 0)}function Oo(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 go(){return!0}function Gg(){return!1}function Rt(e){function t(i,s,r,n,l){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(i=e[a],this[a]=i?i(n):n[a]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?go:Gg,this.isPropagationStopped=Gg,this}return _e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=go)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=go)},persist:function(){},isPersistent:go}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mh=Rt(_r),ma=_e({},_r,{view:0,detail:0}),Ew=Rt(ma),uu,du,Ml,Lh=_e({},ma,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ef,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ml&&(Ml&&e.type==="mousemove"?(uu=e.screenX-Ml.screenX,du=e.screenY-Ml.screenY):du=uu=0,Ml=e),uu)},movementY:function(e){return"movementY"in e?e.movementY:du}}),Kg=Rt(Lh),Tw=_e({},Lh,{dataTransfer:0}),Mw=Rt(Tw),Lw=_e({},ma,{relatedTarget:0}),fu=Rt(Lw),Aw=_e({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Dw=Rt(Aw),Rw=_e({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bw=Rt(Rw),kw=_e({},_r,{data:0}),jg=Rt(kw),Ow={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nw={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"},zw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zw[e])?!!t[e]:!1}function ef(){return Hw}var Uw=_e({},ma,{key:function(e){if(e.key){var t=Ow[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ef,charCode:function(e){return e.type==="keypress"?Oo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pw=Rt(Uw),Iw=_e({},Lh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$g=Rt(Iw),Fw=_e({},_r,{submitter:0}),qw=Rt(Fw),Ww=_e({},ma,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ef}),Vw=Rt(Ww),Yw=_e({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gw=Rt(Yw),Kw=_e({},Lh,{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}),jw=Rt(Kw),$w=_e({},_r,{newState:0,oldState:0,source:0}),Xw=Rt($w),Zw=[9,13,27,32],tf=fs&&"CompositionEvent"in window,Hl=null;fs&&"documentMode"in document&&(Hl=document.documentMode);var Qw=fs&&"TextEvent"in window&&!Hl,Ym=fs&&(!tf||Hl&&8<Hl&&11>=Hl),Xg=" ",Zg=!1;function Gm(e,t){switch(e){case"keyup":return Zw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Km(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xn=!1;function Jw(e,t){switch(e){case"compositionend":return Km(t);case"keypress":return t.which!==32?null:(Zg=!0,Xg);case"textInput":return e=t.data,e===Xg&&Zg?null:e;default:return null}}function eC(e,t){if(xn)return e==="compositionend"||!tf&&Gm(e,t)?(e=Vm(),ko=Jd=js=null,xn=!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 Ym&&t.locale!=="ko"?null:t.data;default:return null}}var tC={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 Qg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tC[e.type]:t==="textarea"}function jm(e,t,i,s){Cn?On?On.push(s):On=[s]:Cn=s,t=wh(t,"onChange"),0<t.length&&(i=new Mh("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Ul=null,Ql=null;function iC(e){Wp(e,0)}function Ah(e){var t=Ol(e);if(Um(t))return e}function Jg(e,t){if(e==="change")return t}var $m=!1;fs&&(fs?(mo="oninput"in document,mo||(_u=document.createElement("div"),_u.setAttribute("oninput","return;"),mo=typeof _u.oninput=="function"),vo=mo):vo=!1,$m=vo&&(!document.documentMode||9<document.documentMode));var vo,mo,_u;function ev(){Ul&&(Ul.detachEvent("onpropertychange",Xm),Ql=Ul=null)}function Xm(e){if(e.propertyName==="value"&&Ah(Ql)){var t=[];jm(t,Ql,e,Qd(e)),Wm(iC,t)}}function sC(e,t,i){e==="focusin"?(ev(),Ul=t,Ql=i,Ul.attachEvent("onpropertychange",Xm)):e==="focusout"&&ev()}function rC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ah(Ql)}function nC(e,t){if(e==="click")return Ah(t)}function lC(e,t){if(e==="input"||e==="change")return Ah(t)}function aC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ii=typeof Object.is=="function"?Object.is:aC;function Jl(e,t){if(ii(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!Yu.call(t,r)||!ii(e[r],t[r]))return!1}return!0}function Xu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function iv(e,t){var i=tv(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=tv(i)}}function Zm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xu(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Xu(e.document)}return t}function sf(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 oC=fs&&"documentMode"in document&&11>=document.documentMode,En=null,Zu=null,Pl=null,Qu=!1;function sv(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Qu||En==null||En!==Xu(s)||(s=En,"selectionStart"in s&&sf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Pl&&Jl(Pl,s)||(Pl=s,s=wh(Zu,"onSelect"),0<s.length&&(t=new Mh("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=En)))}function Lr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Tn={animationend:Lr("Animation","AnimationEnd"),animationiteration:Lr("Animation","AnimationIteration"),animationstart:Lr("Animation","AnimationStart"),transitionrun:Lr("Transition","TransitionRun"),transitionstart:Lr("Transition","TransitionStart"),transitioncancel:Lr("Transition","TransitionCancel"),transitionend:Lr("Transition","TransitionEnd")},gu={},Jm={};fs&&(Jm=document.createElement("div").style,"AnimationEvent"in window||(delete Tn.animationend.animation,delete Tn.animationiteration.animation,delete Tn.animationstart.animation),"TransitionEvent"in window||delete Tn.transitionend.transition);function Xr(e){if(gu[e])return gu[e];if(!Tn[e])return e;var t=Tn[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Jm)return gu[e]=t[i];return e}var e1=Xr("animationend"),t1=Xr("animationiteration"),i1=Xr("animationstart"),hC=Xr("transitionrun"),cC=Xr("transitionstart"),uC=Xr("transitioncancel"),s1=Xr("transitionend"),r1=new Map,Ju="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Ju.push("scrollEnd");function Bi(e,t){r1.set(e,t),$r(t,[e])}var dC=0;function _s(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Ri.identifierPrefix;var i=dC++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function rv(e){if(e==null||typeof e=="string")return e;var t=null,i=Fn;if(i!==null)for(var s=0;s<i.length;s++){var r=e[i[s]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function ys(e,t){return e=rv(e),t=rv(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var th=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)},di=[],Mn=0,rf=0;function Dh(){for(var e=Mn,t=rf=Mn=0;t<e;){var i=di[t];di[t++]=null;var s=di[t];di[t++]=null;var r=di[t];di[t++]=null;var n=di[t];if(di[t++]=null,s!==null&&r!==null){var l=s.pending;l===null?r.next=r:(r.next=l.next,l.next=r),s.pending=r}n!==0&&n1(i,r,n)}}function Rh(e,t,i,s){di[Mn++]=e,di[Mn++]=t,di[Mn++]=i,di[Mn++]=s,rf|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function nf(e,t,i,s){return Rh(e,t,i,s),ih(e)}function Zr(e,t){return Rh(e,null,null,t),ih(e)}function n1(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-ei(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function ih(e){if(50<$l)throw $l=0,Vo=null,Error(D(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ln={};function fC(e,t,i,s){this.tag=e,this.key=i,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,i,s){return new fC(e,t,i,s)}function lf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function us(e,t){var i=e.alternate;return i===null?(i=It(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function l1(e,t){e.flags&=1206910978;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function No(e,t,i,s,r,n){var l=0;if(s=e,typeof s=="function")lf(s)&&(l=1);else if(typeof s=="string")l=P3(e,i,Ki.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Iu:return e=It(31,i,t,r),e.elementType=Iu,e.lanes=n,e;case bn:return zr(i.children,r,n,t);case Cm:l=8,r|=24;break;case Hu:return e=It(12,i,t,r|2),e.elementType=Hu,e.lanes=n,e;case Uu:return e=It(13,i,t,r),e.elementType=Uu,e.lanes=n,e;case Pu:return e=It(19,i,t,r),e.elementType=Pu,e.lanes=n,e;case ew:case Fu:return e=r|32,e=It(30,i,t,e),e.elementType=Fu,e.lanes=n,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Wi:l=10;break e;case xm:l=9;break e;case Gd:l=11;break e;case Kd:l=14;break e;case Vs:l=16,s=null;break e}l=29,i=Error(D(130,e===null?"null":typeof e,"")),s=null}return t=It(l,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function zr(e,t,i,s){return e=It(7,e,s,t),e.lanes=i,e}function vu(e,t,i){return e=It(6,e,null,t),e.lanes=i,e}function a1(e){var t=It(18,null,null,0);return t.stateNode=e,t}function mu(e,t,i){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var nv=new WeakMap;function vi(e,t){if(typeof e=="object"&&e!==null){var i=nv.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Hg(t)},nv.set(e,t),t)}return{value:e,source:t,stack:Hg(t)}}var An=[],Dn=0,sh=null,ea=0,fi=[],_i=0,hr=null,Yi=1,Gi="";function hs(e,t){An[Dn++]=ea,An[Dn++]=sh,sh=e,ea=t}function o1(e,t,i){fi[_i++]=Yi,fi[_i++]=Gi,fi[_i++]=hr,hr=e;var s=Yi;e=Gi;var r=32-ei(s)-1;s&=~(1<<r),i+=1;var n=32-ei(t)+r;if(30<n){var l=r-r%5;n=(s&(1<<l)-1).toString(32),s>>=l,r-=l,Yi=1<<32-ei(t)+r|i<<r|s,Gi=n+e}else Yi=1<<n|i<<r|s,Gi=e}function Bh(e){e.return!==null&&(hs(e,1),o1(e,1,0))}function af(e){for(;e===sh;)sh=An[--Dn],An[Dn]=null,ea=An[--Dn],An[Dn]=null;for(;e===hr;)hr=fi[--_i],fi[_i]=null,Gi=fi[--_i],fi[_i]=null,Yi=fi[--_i],fi[_i]=null}function h1(e,t){fi[_i++]=Yi,fi[_i++]=Gi,fi[_i++]=hr,Yi=t.id,Gi=t.overflow,hr=e}var it=null,me=null,j=!1,er=null,mi=!1,ed=Error(D(519));function cr(e){var t=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ta(vi(t,e)),ed}function lv(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[ft]=e,t[Wt]=s,i){case"dialog":X("cancel",t),X("close",t);break;case"iframe":case"object":case"embed":X("load",t);break;case"video":case"audio":for(i=0;i<na.length;i++)X(na[i],t);break;case"source":X("error",t);break;case"img":case"image":case"link":X("error",t),X("load",t);break;case"details":X("toggle",t);break;case"input":X("invalid",t),Pm(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":X("invalid",t);break;case"textarea":X("invalid",t),Fm(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Yp(t.textContent,i)?(s.popover!=null&&(X("beforetoggle",t),X("toggle",t)),s.onScroll!=null&&X("scroll",t),s.onScrollEnd!=null&&X("scrollend",t),s.onClick!=null&&(t.onclick=Vi),t=!0):t=!1,t||cr(e,!0)}function rh(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:mi=!1;return;case 27:case 3:mi=!0;return;default:it=it.return}}function gn(e){if(e!==it)return!1;if(!j)return rh(e),j=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Ud(e.type,e.memoizedProps)),i=!i),i&&me&&cr(e),rh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));me=im(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));me=im(e)}else t===27?(t=me,gr(e.type)?(e=qd,qd=null,me=e):me=t):me=it?pi(e.stateNode.nextSibling):null;return!0}function Ir(){me=it=null,j=!1}function pu(){var e=er;return e!==null&&(Ut===null?Ut=e:Ut.push.apply(Ut,e),er=null),e}function ta(e){er===null?er=[e]:er.push(e)}var td=Xi(null),Qr=null,cs=null;function $s(e,t,i){pe(td,t._currentValue),t._currentValue=i}function ds(e){e._currentValue=td.current,gt(td)}function zo(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function id(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var l=r.child;n=n.firstContext;e:for(;n!==null;){var a=n;n=r;for(var o=0;o<t.length;o++)if(a.context===t[o]){n.lanes|=i,a=n.alternate,a!==null&&(a.lanes|=i),zo(n.return,i,e),s||(l=null);break e}n=a.next}}else if(r.tag===18){if(l=r.return,l===null)throw Error(D(341));l.lanes|=i,n=l.alternate,n!==null&&(n.lanes|=i),zo(l,i,e),l=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=i,l=r.alternate,l!==null&&(l.lanes|=i),zo(r.return,i,e),l=r.child,l=l!==null?l.sibling:null):l=r.child;if(l!==null)l.return=r;else for(l=r;l!==null;){if(l===e){l=null;break}if(r=l.sibling,r!==null){r.return=l.return,l=r;break}l=l.return}r=l}}function Fr(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if((r.flags&524288)!==0)n=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var l=r.alternate;if(l===null)throw Error(D(387));if(l=l.memoizedProps,l!==null){var a=r.type;ii(r.pendingProps.value,l.value)||(e!==null?e.push(a):e=[a])}}else if(r===Xo.current){if(l=r.alternate,l===null)throw Error(D(387));l.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Qn):e=[Qn])}r=r.return}return e!==null&&id(t,e,i,s),t.flags|=262144,e!==null}function nh(e){for(e=e.firstContext;e!==null;){if(!ii(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qr(e){Qr=e,cs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _t(e){return c1(Qr,e)}function po(e,t){return Qr===null&&qr(e),c1(e,t)}function c1(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},cs===null){if(e===null)throw Error(D(308));cs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else cs=cs.next=t;return i}var _C=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},gC=je.unstable_scheduleCallback,vC=je.unstable_NormalPriority,Fe={$$typeof:Wi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function of(){return{controller:new _C,data:new Map,refCount:0}}function pa(e){e.refCount--,e.refCount===0&&gC(vC,function(){e.controller.abort()})}function av(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];i.indexOf(s)===-1&&i.push(s)}}}var Nl=null;function mC(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Il=null,sd=0,Wr=0,Nn=null;function pC(e,t){if(Il===null){var i=Il=[];sd=0,Wr=zf(),Nn={status:"pending",value:void 0,then:function(s){i.push(s)}}}return sd++,t.then(ov,ov),t}function ov(){if(--sd===0&&(Nl=null,Il!==null)){Nn!==null&&(Nn.status="fulfilled");var e=Il;Il=null,Wr=0,Nn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function SC(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var hv=q.S;q.S=function(e,t){if(Lp=Qt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&pC(e,t),Nl!==null)for(var i=$n;i!==null;)av(i,Nl),i=i.next;if(i=e.types,i!==null){for(var s=$n;s!==null;)av(s,i),s=s.next;if(Wr!==0){s=Nl,s===null&&(s=Nl=[]);for(var r=0;r<i.length;r++){var n=i[r];s.indexOf(n)===-1&&s.push(n)}}}hv!==null&&hv(e,t)};var Hr=Xi(null);function hf(){var e=Hr.current;return e!==null?e:fe.pooledCache}function Ho(e,t){t===null?pe(Hr,Hr.current):pe(Hr,t.pool)}function u1(){var e=hf();return e===null?null:{parent:Fe._currentValue,pool:e}}var sl=Error(D(460)),cf=Error(D(474)),kh=Error(D(542)),lh={then:function(){}};function cv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function d1(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Vi,Vi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,dv(e),e===void 0&&!("reason"in t)?Error(D(600)):e;default:if(typeof t.status=="string")t.then(Vi,Vi);else{if(e=fe,e!==null&&100<e.shellSuspendCounter)throw Error(D(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,dv(e),e}throw Ur=t,sl}}function Rr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ur=i,sl):i}}var Ur=null;function uv(){if(Ur===null)throw Error(D(459));var e=Ur;return Ur=null,e}function dv(e){if(e===sl||e===kh)throw Error(D(483))}var zn=null,ia=0;function So(e){var t=ia;return ia+=1,zn===null&&(zn=[]),d1(zn,e,t)}function Fs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function yo(e,t){throw t.$$typeof===J5?Error(D(525)):(e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function f1(e){function t(m,v){if(e){var S=m.deletions;S===null?(m.deletions=[v],m.flags|=16):S.push(v)}}function i(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function s(m){for(var v=new Map;m!==null;)m.key===null?v.set(m.index,m):v.set(m.key,m),m=m.sibling;return v}function r(m,v){return m=us(m,v),m.index=0,m.sibling=null,m}function n(m,v,S){return m.index=S,e?(S=m.alternate,S!==null?(S=S.index,S<v?(m.flags|=2,v):S):(m.flags|=134217730,v)):(m.flags|=1048576,v)}function l(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function a(m,v,S,g){return v===null||v.tag!==6?(v=vu(S,m.mode,g),v.return=m,v):(v=r(v,S),v.return=m,v)}function o(m,v,S,g){var T=S.type;return T===bn?(m=c(m,v,S.props.children,g,S.key),Fs(m,S),m):v!==null&&(v.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Vs&&Rr(T)===v.type)?(v=r(v,S.props),Fs(v,S),v.return=m,v):(v=No(S.type,S.key,S.props,null,m.mode,g),Fs(v,S),v.return=m,v)}function h(m,v,S,g){return v===null||v.tag!==4||v.stateNode.containerInfo!==S.containerInfo||v.stateNode.implementation!==S.implementation?(v=mu(S,m.mode,g),v.return=m,v):(v=r(v,S.children||[]),v.return=m,v)}function c(m,v,S,g,T){return v===null||v.tag!==7?(v=zr(S,m.mode,g,T),v.return=m,v):(v=r(v,S),v.return=m,v)}function u(m,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=vu(""+v,m.mode,S),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ho:return S=No(v.type,v.key,v.props,null,m.mode,S),Fs(S,v),S.return=m,S;case Bl:return v=mu(v,m.mode,S),v.return=m,v;case Vs:return v=Rr(v),u(m,v,S)}if(kl(v)||Tl(v))return v=zr(v,m.mode,S,null),v.return=m,v;if(typeof v.then=="function")return u(m,So(v),S);if(v.$$typeof===Wi)return u(m,po(m,v),S);yo(m,v)}return null}function d(m,v,S,g){var T=v!==null?v.key:null;if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return T!==null?null:a(m,v,""+S,g);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ho:return S.key===T?o(m,v,S,g):null;case Bl:return S.key===T?h(m,v,S,g):null;case Vs:return S=Rr(S),d(m,v,S,g)}if(kl(S)||Tl(S))return T!==null?null:c(m,v,S,g,null);if(typeof S.then=="function")return d(m,v,So(S),g);if(S.$$typeof===Wi)return d(m,v,po(m,S),g);yo(m,S)}return null}function f(m,v,S,g,T){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return m=m.get(S)||null,a(v,m,""+g,T);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ho:return m=m.get(g.key===null?S:g.key)||null,o(v,m,g,T);case Bl:return m=m.get(g.key===null?S:g.key)||null,h(v,m,g,T);case Vs:return g=Rr(g),f(m,v,S,g,T)}if(kl(g)||Tl(g))return m=m.get(S)||null,c(v,m,g,T,null);if(typeof g.then=="function")return f(m,v,S,So(g),T);if(g.$$typeof===Wi)return f(m,v,S,po(v,g),T);yo(v,g)}return null}function _(m,v,S,g){for(var T=null,L=null,B=v,O=v=0,I=null;B!==null&&O<S.length;O++){B.index>O?(I=B,B=null):I=B.sibling;var F=d(m,B,S[O],g);if(F===null){B===null&&(B=I);break}e&&B&&F.alternate===null&&t(m,B),v=n(F,v,O),L===null?T=F:L.sibling=F,L=F,B=I}if(O===S.length)return i(m,B),j&&hs(m,O),T;if(B===null){for(;O<S.length;O++)B=u(m,S[O],g),B!==null&&(v=n(B,v,O),L===null?T=B:L.sibling=B,L=B);return j&&hs(m,O),T}for(B=s(B);O<S.length;O++)I=f(B,m,O,S[O],g),I!==null&&(e&&(F=I.alternate,F!==null&&B.delete(F.key===null?O:F.key)),v=n(I,v,O),L===null?T=I:L.sibling=I,L=I);return e&&B.forEach(function(P){return t(m,P)}),j&&hs(m,O),T}function y(m,v,S,g){if(S==null)throw Error(D(151));for(var T=null,L=null,B=v,O=v=0,I=null,F=S.next();B!==null&&!F.done;O++,F=S.next()){B.index>O?(I=B,B=null):I=B.sibling;var P=d(m,B,F.value,g);if(P===null){B===null&&(B=I);break}e&&B&&P.alternate===null&&t(m,B),v=n(P,v,O),L===null?T=P:L.sibling=P,L=P,B=I}if(F.done)return i(m,B),j&&hs(m,O),T;if(B===null){for(;!F.done;O++,F=S.next())F=u(m,F.value,g),F!==null&&(v=n(F,v,O),L===null?T=F:L.sibling=F,L=F);return j&&hs(m,O),T}for(B=s(B);!F.done;O++,F=S.next())F=f(B,m,O,F.value,g),F!==null&&(e&&(I=F.alternate,I!==null&&B.delete(I.key===null?O:I.key)),v=n(F,v,O),L===null?T=F:L.sibling=F,L=F);return e&&B.forEach(function(wt){return t(m,wt)}),j&&hs(m,O),T}function M(m,v,S,g){if(typeof S=="object"&&S!==null&&S.type===bn&&S.key===null&&S.props.ref===void 0&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case ho:e:{for(var T=S.key;v!==null;){if(v.key===T){if(T=S.type,T===bn){if(v.tag===7){i(m,v.sibling),g=r(v,S.props.children),Fs(g,S),g.return=m,m=g;break e}}else if(v.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Vs&&Rr(T)===v.type){i(m,v.sibling),g=r(v,S.props),Fs(g,S),g.return=m,m=g;break e}i(m,v);break}else t(m,v);v=v.sibling}S.type===bn?(g=zr(S.props.children,m.mode,g,S.key),Fs(g,S),g.return=m,m=g):(g=No(S.type,S.key,S.props,null,m.mode,g),Fs(g,S),g.return=m,m=g)}return l(m);case Bl:e:{for(T=S.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===S.containerInfo&&v.stateNode.implementation===S.implementation){i(m,v.sibling),g=r(v,S.children||[]),g.return=m,m=g;break e}else{i(m,v);break}else t(m,v);v=v.sibling}g=mu(S,m.mode,g),g.return=m,m=g}return l(m);case Vs:return S=Rr(S),M(m,v,S,g)}if(kl(S))return _(m,v,S,g);if(Tl(S)){if(T=Tl(S),typeof T!="function")throw Error(D(150));return S=T.call(S),y(m,v,S,g)}if(typeof S.then=="function")return M(m,v,So(S),g);if(S.$$typeof===Wi)return M(m,v,po(m,S),g);yo(m,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,v!==null&&v.tag===6?(i(m,v.sibling),g=r(v,S),g.return=m,m=g):(i(m,v),g=vu(S,m.mode,g),g.return=m,m=g),l(m)):i(m,v)}return function(m,v,S,g){try{ia=0;var T=M(m,v,S,g);return zn=null,T}catch(B){if(B===sl||B===kh)throw B;var L=It(29,B,null,m.mode);return L.lanes=g,L.return=m,L}}}var Vr=f1(!0),_1=f1(!1),Ys=!1;function uf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rd(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 tr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ir(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(re&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=ih(e),n1(e,null,i),t}return Rh(e,s,t,i),ih(e)}function Fl(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Rm(e,i)}}function Su(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var l={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=l:n=n.next=l,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var nd=!1;function ql(){if(nd){var e=Nn;if(e!==null)throw e}}function Wl(e,t,i,s){nd=!1;var r=e.updateQueue;Ys=!1;var n=r.firstBaseUpdate,l=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var o=a,h=o.next;o.next=null,l===null?n=h:l.next=h,l=o;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==l&&(a===null?c.firstBaseUpdate=h:a.next=h,c.lastBaseUpdate=o))}if(n!==null){var u=r.baseState;l=0,c=h=o=null,a=n;do{var d=a.lane&-536870913,f=d!==a.lane;if(f?(ee&d)===d:(s&d)===d){d!==0&&d===Wr&&(nd=!0),c!==null&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var _=e,y=a;d=t;var M=i;switch(y.tag){case 1:if(_=y.payload,typeof _=="function"){u=_.call(M,u,d);break e}u=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=y.payload,d=typeof _=="function"?_.call(M,u,d):_,d==null)break e;u=_e({},u,d);break e;case 2:Ys=!0}}d=a.callback,d!==null&&(e.flags|=64,f&&(e.flags|=8192),f=r.callbacks,f===null?r.callbacks=[d]:f.push(d))}else f={lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(h=c=f,o=u):c=c.next=f,l|=d;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);c===null&&(o=u),r.baseState=o,r.firstBaseUpdate=h,r.lastBaseUpdate=c,n===null&&(r.shared.lanes=0),fr|=l,e.lanes=l,e.memoizedState=u}}function g1(e,t){if(typeof e!="function")throw Error(D(191,e));e.call(t)}function v1(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)g1(i[e],t)}var ur=Xi(null),ah=Xi(0);function fv(e,t){e=ps,pe(ah,e),pe(ur,t),ps=e|t.baseLanes}function ld(){pe(ah,ps),pe(ur,ur.current)}function df(){ps=ah.current,gt(ur),gt(ah)}var pt=Xi(null),Et=null;function sr(e){var t=e.alternate;pe(vt,vt.current&1),pe(pt,e),Et===null&&(t===null||ur.current!==null||t.memoizedState!==null)&&(Et=e)}function ad(e){pe(vt,vt.current),pe(pt,e),Et===null&&(Et=e)}function m1(e){e.tag===22?(pe(vt,vt.current),pe(pt,e),Et===null&&(Et=e)):rr()}function rr(){pe(vt,vt.current),pe(pt,pt.current)}function $t(e){gt(pt),Et===e&&(Et=null),gt(vt)}var vt=Xi(0);function sa(e,t){pe(pt,pt.current),pe(vt,t)}function ff(e){gt(vt),gt(pt),Et===e&&(Et=null)}function oh(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Fd(i)||If(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 gs=0,Y=null,ue=null,Ie=null,hh=!1,Hn=!1,Yr=!1,ch=0,ra=0,Un=null,yC=0;function Re(){throw Error(D(321))}function _f(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!ii(e[i],t[i]))return!1;return!0}function gf(e,t,i,s,r,n){return gs=n,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?j1:$1,Yr=!1,n=i(s,r),Yr=!1,Hn&&(n=S1(t,i,s,r)),p1(e),n}function p1(e){q.H=uh;var t=ue!==null&&ue.next!==null;if(gs=0,Ie=ue=Y=null,hh=!1,ra=0,Un=null,t)throw Error(D(300));e===null||qe||(e=e.dependencies,e!==null&&nh(e)&&(qe=!0))}function S1(e,t,i,s){Y=e;var r=0;do{if(Hn&&(Un=null),ra=0,Hn=!1,25<=r)throw Error(D(301));if(r+=1,Ie=ue=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}q.H=LC,n=t(i,s)}while(Hn);return n}function bC(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?Sa(t):t,e=e.useState()[0],(ue!==null?ue.memoizedState:null)!==e&&(Y.flags|=1024),t}function vf(){var e=ch!==0;return ch=0,e}function mf(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function pf(e){if(hh){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hh=!1}gs=0,Ie=ue=Y=null,Hn=!1,ra=ch=0,Un=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?Y.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function He(){if(ue===null){var e=Y.alternate;e=e!==null?e.memoizedState:null}else e=ue.next;var t=Ie===null?Y.memoizedState:Ie.next;if(t!==null)Ie=t,ue=e;else{if(e===null)throw Y.alternate===null?Error(D(467)):Error(D(310));ue=e,e={memoizedState:ue.memoizedState,baseState:ue.baseState,baseQueue:ue.baseQueue,queue:ue.queue,next:null},Ie===null?Y.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function Oh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var t=ra;return ra+=1,Un===null&&(Un=[]),e=d1(Un,e,t),t=Y,(Ie===null?t.memoizedState:Ie.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?j1:$1),e}function Nh(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===iw)return;if(e.$$typeof===Wi)return _t(e)}throw Error(D(438,String(e)))}function Sf(e){var t=null,i=Y.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Y.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Oh(),Y.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=tw;return t.index++,i}function vs(e,t){return typeof t=="function"?t(e):t}function Uo(e){var t=He();return yf(t,ue,e)}function yf(e,t,i){var s=e.queue;if(s===null)throw Error(D(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var l=r.next;r.next=n.next,n.next=l}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var a=l=null,o=null,h=t,c=!1;do{var u=h.lane&-536870913;if(u!==h.lane?(ee&u)===u:(gs&u)===u){var d=h.revertLane;if(d===0)o!==null&&(o=o.next={lane:0,revertLane:0,gesture:null,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),u===Wr&&(c=!0);else if((gs&d)===d){h=h.next,d===Wr&&(c=!0);continue}else u={lane:0,revertLane:h.revertLane,gesture:null,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null},o===null?(a=o=u,l=n):o=o.next=u,Y.lanes|=d,fr|=d;u=h.action,Yr&&i(n,u),n=h.hasEagerState?h.eagerState:i(n,u)}else d={lane:u,revertLane:h.revertLane,gesture:h.gesture,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null},o===null?(a=o=d,l=n):o=o.next=d,Y.lanes|=u,fr|=u;h=h.next}while(h!==null&&h!==t);if(o===null?l=n:o.next=a,!ii(n,e.memoizedState)&&(qe=!0,c&&(i=Nn,i!==null)))throw i;e.memoizedState=n,e.baseState=l,e.baseQueue=o,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function yu(e){var t=He(),i=t.queue;if(i===null)throw Error(D(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var l=r=r.next;do n=e(n,l.action),l=l.next;while(l!==r);ii(n,t.memoizedState)||(qe=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function y1(e,t,i){var s=Y,r=He(),n=j;if(n){if(i===void 0)throw Error(D(407));i=i()}else i=t();var l=!ii((ue||r).memoizedState,i);if(l&&(r.memoizedState=i,qe=!0),r=r.queue,bf(C1.bind(null,s,r,e),[e]),e=r.getSnapshot!==t||l||Ie!==null&&(Ie.memoizedState.tag&1)!==0,Yn(e?9:8,{destroy:void 0},w1.bind(null,s,r,i,t),null),e){if(s.flags|=2048,fe===null)throw Error(D(349));n||(gs&127)!==0||b1(s,t,i)}return i}function b1(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Y.updateQueue,t===null?(t=Oh(),Y.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function w1(e,t,i,s){t.value=i,t.getSnapshot=s,x1(t)&&E1(e)}function C1(e,t,i){return i(function(){x1(t)&&E1(e)})}function x1(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!ii(e,i)}catch{return!0}}function E1(e){var t=Zr(e,2);t!==null&&Ft(t,e,2)}function od(e){var t=Dt();if(typeof e=="function"){var i=e;if(e=i(),Yr){Ks(!0);try{i()}finally{Ks(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:e},t}function T1(e,t,i,s){return e.baseState=i,yf(e,ue,typeof s=="function"?s:vs)}function wC(e,t,i,s,r){if(Hh(e))throw Error(D(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(l){n.listeners.push(l)}};q.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,M1(t,n)):(n.next=i.next,t.pending=i.next=n)}}function M1(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=q.T,l={};l.types=n!==null?n.types:null,q.T=l;try{var a=i(r,s),o=q.S;o!==null&&o(l,a),_v(e,t,a)}catch(h){hd(e,t,h)}finally{n!==null&&l.types!==null&&(n.types=l.types),q.T=n}}else try{n=i(r,s),_v(e,t,n)}catch(h){hd(e,t,h)}}function _v(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){gv(e,t,s)},function(s){return hd(e,t,s)}):gv(e,t,i)}function gv(e,t,i){t.status="fulfilled",t.value=i,L1(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,M1(e,i)))}function hd(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,L1(t),t=t.next;while(t!==s)}e.action=null}function L1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function A1(e,t){return t}function vv(e,t){if(j){var i=fe.formState;if(i!==null){e:{var s=Y;if(j){if(me){t:{for(var r=me,n=mi;r.nodeType!==8;){if(!n){r=null;break t}if(r=pi(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){me=pi(r.nextSibling),s=r.data==="F!";break e}}cr(s)}s=!1}s&&(t=i[0])}}return i=Dt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A1,lastRenderedState:t},i.queue=s,i=Y1.bind(null,Y,s),s.dispatch=i,s=od(!1),n=Ef.bind(null,Y,!1,s.queue),s=Dt(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=wC.bind(null,Y,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function mv(e){var t=He();return D1(t,ue,e)}function D1(e,t,i){if(t=yf(e,t,A1)[0],e=Uo(vs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Sa(t)}catch(l){throw l===sl?kh:l}else s=t;t=He();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(Y.flags|=2048,Yn(9,{destroy:void 0},CC.bind(null,r,i),null)),[s,n,e]}function CC(e,t){e.action=t}function pv(e){var t=He(),i=ue;if(i!==null)return D1(t,i,e);He(),t=t.memoizedState,i=He();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Yn(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Y.updateQueue,t===null&&(t=Oh(),Y.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function R1(){return He().memoizedState}function Po(e,t,i,s){var r=Dt();Y.flags|=e,r.memoizedState=Yn(1|t,{destroy:void 0},i,s===void 0?null:s)}function zh(e,t,i,s){var r=He();s=s===void 0?null:s;var n=r.memoizedState.inst;ue!==null&&s!==null&&_f(s,ue.memoizedState.deps)?r.memoizedState=Yn(t,n,i,s):(Y.flags|=e,r.memoizedState=Yn(1|t,n,i,s))}function Sv(e,t){Po(8390656,8,e,t)}function bf(e,t){zh(2048,8,e,t)}function xC(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=Oh(),Y.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function B1(e){var t=He().memoizedState;return xC({ref:t,nextImpl:e}),function(){if((re&2)!==0)throw Error(D(440));return t.impl.apply(void 0,arguments)}}function k1(e,t){return zh(4,2,e,t)}function O1(e,t){return zh(4,4,e,t)}function N1(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function z1(e,t,i){i=i!=null?i.concat([e]):null,zh(4,4,N1.bind(null,t,e),i)}function wf(){}function H1(e,t){var i=He();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&_f(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function U1(e,t){var i=He();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&_f(t,s[1]))return s[0];if(s=e(),Yr){Ks(!0);try{e()}finally{Ks(!1)}}return i.memoizedState=[s,t],s}function Cf(e,t,i){return i===void 0||(gs&1073741824)!==0&&(ee&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Dp(),Y.lanes|=e,fr|=e,i)}function P1(e,t,i,s){return ii(i,t)?i:ur.current!==null?(e=Cf(e,i,s),ii(e,t)||(qe=!0),e):(gs&106)===0||(gs&1073741824)!==0&&(ee&261930)===0?(qe=!0,e.memoizedState=i):(e=Dp(),Y.lanes|=e,fr|=e,t)}function I1(e,t,i,s,r){var n=ne.p;ne.p=n!==0&&8>n?n:8;var l=q.T,a={};a.types=l!==null?l.types:null,q.T=a,Ef(e,!1,t,i);try{var o=r(),h=q.S;if(h!==null&&h(a,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=SC(o,s);Vl(e,t,c,ti(e))}else Vl(e,t,s,ti(e))}catch(u){Vl(e,t,{then:function(){},status:"rejected",reason:u},ti())}finally{ne.p=n,l!==null&&a.types!==null&&(l.types=a.types),q.T=l}}function EC(){}function cd(e,t,i,s){if(e.tag!==5)throw Error(D(476));var r=F1(e).queue;I1(e,r,t,Nr,i===null?EC:function(){return q1(e),i(s)})}function F1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Nr,baseState:Nr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:Nr},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function q1(e){var t=F1(e);t.next===null&&(t=e.alternate.memoizedState),Vl(e,t.next.queue,{},ti())}function xf(){return _t(Qn)}function W1(){return He().memoizedState}function V1(){return He().memoizedState}function TC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ti();e=tr(i);var s=ir(t,e,i);s!==null&&(Ft(s,t,i),Fl(s,t,i)),t={cache:of()},e.payload=t;return}t=t.return}}function MC(e,t,i){var s=ti();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Hh(e)?G1(t,i):(i=nf(e,t,i,s),i!==null&&(Ft(i,e,s),K1(i,t,s)))}function Y1(e,t,i){var s=ti();Vl(e,t,i,s)}function Vl(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Hh(e))G1(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var l=t.lastRenderedState,a=n(l,i);if(r.hasEagerState=!0,r.eagerState=a,ii(a,l))return Rh(e,t,r,0),fe===null&&Dh(),!1}catch{}if(i=nf(e,t,r,s),i!==null)return Ft(i,e,s),K1(i,t,s),!0}return!1}function Ef(e,t,i,s){if(s={lane:2,revertLane:zf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Hh(e)){if(t)throw Error(D(479))}else t=nf(e,i,s,2),t!==null&&Ft(t,e,2)}function Hh(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function G1(e,t){Hn=hh=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function K1(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Rm(e,i)}}var uh={readContext:_t,use:Nh,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useLayoutEffect:Re,useInsertionEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useSyncExternalStore:Re,useId:Re,useHostTransitionStatus:Re,useFormState:Re,useActionState:Re,useOptimistic:Re,useMemoCache:Re,useCacheRefresh:Re,useEffectEvent:Re},j1={readContext:_t,use:Nh,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:Sv,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Po(4194308,4,N1.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Po(4194308,4,e,t)},useInsertionEffect:function(e,t){Po(4,2,e,t)},useMemo:function(e,t){var i=Dt();t=t===void 0?null:t;var s=e();if(Yr){Ks(!0);try{e()}finally{Ks(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Dt();if(i!==void 0){var r=i(t);if(Yr){Ks(!0);try{i(t)}finally{Ks(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=MC.bind(null,Y,e),[s.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=od(e);var t=e.queue,i=Y1.bind(null,Y,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:wf,useDeferredValue:function(e,t){var i=Dt();return Cf(i,e,t)},useTransition:function(){var e=od(!1);return e=I1.bind(null,Y,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Y,r=Dt();if(j){if(i===void 0)throw Error(D(407));i=i()}else{if(i=t(),fe===null)throw Error(D(349));(ee&127)!==0||b1(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,Sv(C1.bind(null,s,n,e),[e]),s.flags|=2048,Yn(9,{destroy:void 0},w1.bind(null,s,n,i,t),null),i},useId:function(){var e=Dt(),t=fe.identifierPrefix;if(j){var i=Gi,s=Yi;i=(s&~(1<<32-ei(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=ch++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=yC++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xf,useFormState:vv,useActionState:vv,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ef.bind(null,Y,!0,i),i.dispatch=t,[e,t]},useMemoCache:Sf,useCacheRefresh:function(){return Dt().memoizedState=TC.bind(null,Y)},useEffectEvent:function(e){var t=Dt(),i={impl:e};return t.memoizedState=i,function(){if((re&2)!==0)throw Error(D(440));return i.impl.apply(void 0,arguments)}}},$1={readContext:_t,use:Nh,useCallback:H1,useContext:_t,useEffect:bf,useImperativeHandle:z1,useInsertionEffect:k1,useLayoutEffect:O1,useMemo:U1,useReducer:Uo,useRef:R1,useState:function(){return Uo(vs)},useDebugValue:wf,useDeferredValue:function(e,t){var i=He();return P1(i,ue.memoizedState,e,t)},useTransition:function(){var e=Uo(vs)[0],t=He().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:y1,useId:W1,useHostTransitionStatus:xf,useFormState:mv,useActionState:mv,useOptimistic:function(e,t){var i=He();return T1(i,ue,e,t)},useMemoCache:Sf,useCacheRefresh:V1,useEffectEvent:B1},LC={readContext:_t,use:Nh,useCallback:H1,useContext:_t,useEffect:bf,useImperativeHandle:z1,useInsertionEffect:k1,useLayoutEffect:O1,useMemo:U1,useReducer:yu,useRef:R1,useState:function(){return yu(vs)},useDebugValue:wf,useDeferredValue:function(e,t){var i=He();return ue===null?Cf(i,e,t):P1(i,ue.memoizedState,e,t)},useTransition:function(){var e=yu(vs)[0],t=He().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:y1,useId:W1,useHostTransitionStatus:xf,useFormState:pv,useActionState:pv,useOptimistic:function(e,t){var i=He();return ue!==null?T1(i,ue,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Sf,useCacheRefresh:V1,useEffectEvent:B1};function bu(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:_e({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ud={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=ti(),r=tr(s);r.payload=t,i!=null&&(r.callback=i),t=ir(e,r,s),t!==null&&(Ft(t,e,s),Fl(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=ti(),r=tr(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=ir(e,r,s),t!==null&&(Ft(t,e,s),Fl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ti(),s=tr(i);s.tag=2,t!=null&&(s.callback=t),t=ir(e,s,i),t!==null&&(Ft(t,e,i),Fl(t,e,i))}};function yv(e,t,i,s,r,n,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,l):t.prototype&&t.prototype.isPureReactComponent?!Jl(i,s)||!Jl(r,n):!0}function bv(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&ud.enqueueReplaceState(t,t.state,null)}function Gr(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=_e({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function X1(e){th(e)}function Z1(e){console.error(e)}function Q1(e){th(e)}function dh(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function wv(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function dd(e,t,i){return i=tr(i),i.tag=3,i.payload={element:null},i.callback=function(){dh(e,t)},i}function J1(e){return e=tr(e),e.tag=3,e}function ep(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){wv(t,i,s)}}var l=i.stateNode;l!==null&&typeof l.componentDidCatch=="function"&&(e.callback=function(){wv(t,i,s),typeof r!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var a=s.stack;this.componentDidCatch(s.value,{componentStack:a!==null?a:""})})}function AC(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Fr(t,i,r,!0),i=pt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Et===null?yh():i.alternate===null&&Be===0&&(Be=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===lh?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Lu(e,s,r)),!1;case 22:return i.flags|=65536,s===lh?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Lu(e,s,r)),!1}throw Error(D(435,i.tag))}return Lu(e,s,r),yh(),!1}if(j)return t=pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==ed&&(e=Error(D(422),{cause:s}),ta(vi(e,i)))):(s!==ed&&(t=Error(D(423),{cause:s}),ta(vi(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=vi(s,i),r=dd(e.stateNode,s,r),Su(e,r),Be!==4&&(Be=2)),!1;var n=Error(D(520),{cause:s});if(n=vi(n,i),jl===null?jl=[n]:jl.push(n),Be!==4&&(Be=2),t===null)return!0;s=vi(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=dd(i.stateNode,s,e),Su(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(nr===null||!nr.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=J1(r),ep(r,e,i,s),Su(i,r),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Tf=Error(D(461)),qe=!1;function Ge(e,t,i,s){t.child=e===null?_1(t,null,i,s):Vr(t,e.child,i,s)}function Cv(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var l={};for(var a in s)a!=="ref"&&(l[a]=s[a])}else l=s;return qr(t),s=gf(e,t,i,l,n,r),a=vf(),e!==null&&!qe?(mf(e,t,r),ms(e,t,r)):(j&&a&&Bh(t),t.flags|=1,Ge(e,t,s,r),t.child)}function xv(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!lf(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,tp(e,t,n,s,r)):(e=No(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!Lf(e,r)){var l=n.memoizedProps;if(i=i.compare,i=i!==null?i:Jl,i(l,s)&&e.ref===t.ref)return ms(e,t,r)}return t.flags|=1,e=us(n,s),e.ref=t.ref,e.return=t,t.child=e}function tp(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(Jl(n,s)&&e.ref===t.ref)if(qe=!1,t.pendingProps=s=n,Lf(e,r))(e.flags&131072)!==0&&(qe=!0);else return t.lanes=e.lanes,ms(e,t,r)}return fd(e,t,i,s,r)}function ip(e,t,i,s){var r=s.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return Ev(e,t,n,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ho(t,n!==null?n.cachePool:null),n!==null?fv(t,n):ld(),m1(t);else return s=t.lanes=536870912,Ev(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(Ho(t,n.cachePool),fv(t,n),rr(),t.memoizedState=null):(e!==null&&Ho(t,null),ld(),rr());return Ge(e,t,r,i),t.child}function Yl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ev(e,t,i,s,r){var n=hf();return n=n===null?null:{parent:Fe._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&Ho(t,null),ld(),m1(t),e!==null&&Fr(e,t,s,!0),t.childLanes=r,null}function Io(e,t){return t=Uh({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Tv(e,t,i){return Vr(t,e.child,null,i),e=Io(t,t.pendingProps),e.flags|=2,$t(t),t.memoizedState=null,e}function DC(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(j){if(s.mode==="hidden")return e=Io(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Yl(null,e);if(ad(t),(e=me)?(e=iS(e,mi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hr!==null?{id:Yi,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},i=a1(e),i.return=t,t.child=i,it=t,me=null)):e=null,e===null)throw cr(t);return t.lanes=536870912,null}return Io(t,s)}var n=e.memoizedState;if(n!==null){var l=n.dehydrated;if(ad(t),r)if(t.flags&256)t.flags&=-257,t=Tv(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(D(558));else if(qe||Fr(e,t,i,!1),r=(i&e.childLanes)!==0,qe||r){if(ur.current===null){if(s=fe,s!==null&&(l=Bm(s,i),l!==0&&l!==n.retryLane))throw n.retryLane=l,Zr(e,l),Ft(s,e,l),Tf;yh()}t=Tv(e,t,i)}else e=n.treeContext,me=pi(l.nextSibling),it=t,j=!0,er=null,mi=!1,e!==null&&h1(t,e),t=Io(t,s),t.flags|=134221824;return t}return e=us(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mn(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(D(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function fd(e,t,i,s,r){return qr(t),i=gf(e,t,i,s,void 0,r),s=vf(),e!==null&&!qe?(mf(e,t,r),ms(e,t,r)):(j&&s&&Bh(t),t.flags|=1,Ge(e,t,i,r),t.child)}function Mv(e,t,i,s,r,n){return qr(t),t.updateQueue=null,i=S1(t,s,i,r),p1(e),s=vf(),e!==null&&!qe?(mf(e,t,n),ms(e,t,n)):(j&&s&&Bh(t),t.flags|=1,Ge(e,t,i,n),t.child)}function Lv(e,t,i,s,r){if(qr(t),t.stateNode===null){var n=Ln,l=i.contextType;typeof l=="object"&&l!==null&&(n=_t(l)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ud,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},uf(t),l=i.contextType,n.context=typeof l=="object"&&l!==null?_t(l):Ln,n.state=t.memoizedState,l=i.getDerivedStateFromProps,typeof l=="function"&&(bu(t,i,l,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(l=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),l!==n.state&&ud.enqueueReplaceState(n,n.state,null),Wl(t,s,n,r),ql(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var a=t.memoizedProps,o=Gr(i,a);n.props=o;var h=n.context,c=i.contextType;l=Ln,typeof c=="object"&&c!==null&&(l=_t(c));var u=i.getDerivedStateFromProps;c=typeof u=="function"||typeof n.getSnapshotBeforeUpdate=="function",a=t.pendingProps!==a,c||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(a||h!==l)&&bv(t,n,s,l),Ys=!1;var d=t.memoizedState;n.state=d,Wl(t,s,n,r),ql(),h=t.memoizedState,a||d!==h||Ys?(typeof u=="function"&&(bu(t,i,u,s),h=t.memoizedState),(o=Ys||yv(t,i,o,s,d,h,l))?(c||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=h),n.props=s,n.state=h,n.context=l,s=o):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,rd(e,t),l=t.memoizedProps,c=Gr(i,l),n.props=c,u=t.pendingProps,d=n.context,h=i.contextType,o=Ln,typeof h=="object"&&h!==null&&(o=_t(h)),a=i.getDerivedStateFromProps,(h=typeof a=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l!==u||d!==o)&&bv(t,n,s,o),Ys=!1,d=t.memoizedState,n.state=d,Wl(t,s,n,r),ql();var f=t.memoizedState;l!==u||d!==f||Ys||e!==null&&e.dependencies!==null&&nh(e.dependencies)?(typeof a=="function"&&(bu(t,i,a,s),f=t.memoizedState),(c=Ys||yv(t,i,c,s,d,f,o)||e!==null&&e.dependencies!==null&&nh(e.dependencies))?(h||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,f,o),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,f,o)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=f),n.props=s,n.state=f,n.context=o,s=c):(typeof n.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,mn(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=Vr(t,e.child,null,r),t.child=Vr(t,null,i,r)):Ge(e,t,i,r),t.memoizedState=n.state,e=t.child):e=ms(e,t,r),e}function Av(e,t,i,s){return Ir(),t.flags|=256,Ge(e,t,i,s),t.child}var _d={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gd(e){return{baseLanes:e,cachePool:u1()}}function vd(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Zt),e}function sp(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,l;if((l=n)||(l=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),l&&(r=!0,t.flags&=-129),l=(t.flags&32)!==0,t.flags&=-33,e===null){if(j){if(r?sr(t):rr(),(e=me)?(e=iS(e,mi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hr!==null?{id:Yi,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},i=a1(e),i.return=t,t.child=i,it=t,me=null)):e=null,e===null)throw cr(t);return If(e)?t.lanes=32:t.lanes=536870912,null}return n=s.children,s=s.fallback,r?(rr(),r=t.mode,n=Uh({mode:"hidden",children:n},r),s=zr(s,r,i,null),n.return=t,s.return=t,n.sibling=s,t.child=n,s=t.child,s.memoizedState=gd(i),s.childLanes=vd(e,l,i),t.memoizedState=_d,Yl(null,s)):(sr(t),Mf(t,n))}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(o!==null)return RC(e,t,n,l,s,o,a,i)}return r?(rr(),r=s.fallback,n=t.mode,a=e.child,o=a.sibling,s=us(a,{mode:"hidden",children:s.children}),s.subtreeFlags=a.subtreeFlags&1206910976,o!==null?r=us(o,r):(r=zr(r,n,i,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,Yl(null,s),s=t.child,r=e.child.memoizedState,r===null?r=gd(i):(n=r.cachePool,n!==null?(a=Fe._currentValue,n=n.parent!==a?{parent:a,pool:a}:n):n=u1(),r={baseLanes:r.baseLanes|i,cachePool:n}),s.memoizedState=r,s.childLanes=vd(e,l,i),t.memoizedState=_d,Yl(e.child,s)):(sr(t),i=e.child,e=i.sibling,i=us(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=i,t.memoizedState=null,i)}function Mf(e,t){return t=Uh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Uh(e,t){return e=It(22,e,null,t),e.lanes=0,e}function bo(e,t,i){return Vr(t,e.child,null,i),e=Mf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function RC(e,t,i,s,r,n,l,a){if(i)return t.flags&256?(sr(t),t.flags&=-257,bo(e,t,a)):t.memoizedState!==null?(rr(),t.child=e.child,t.flags|=128,null):(rr(),n=r.fallback,l=t.mode,r=Uh({mode:"visible",children:r.children},l),n=zr(n,l,a,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,Vr(t,e.child,null,a),r=t.child,r.memoizedState=gd(a),r.childLanes=vd(e,s,a),t.memoizedState=_d,Yl(null,r));if(sr(t),If(n)){if(s=n.nextSibling&&n.nextSibling.dataset,s)var o=s.dgst;return s=o,s!==""&&(r=Error(D(419)),r.stack="",r.digest=s,ta({value:r,source:null,stack:null})),bo(e,t,a)}if(qe||Fr(e,t,a,!1),s=(a&e.childLanes)!==0,qe||s){if(ur.current!==null)return bo(e,t,a);if(s=fe,s!==null&&(r=Bm(s,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),Ft(s,e,r),Tf;return Fd(n)||yh(),bo(e,t,a)}return Fd(n)?(t.flags|=192,t.child=e.child,null):(e=l.treeContext,me=pi(n.nextSibling),it=t,j=!0,er=null,mi=!1,e!==null&&h1(t,e),t=Mf(t,r.children),t.flags|=134221824,t)}function Dv(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),zo(e.return,t,i)}function Rv(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&oh(i)===null&&(t=e),e=e.sibling}return t}function wo(e,t,i,s,r,n){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=s,l.tail=i,l.tailMode=r,l.treeForkCount=n)}function wu(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function md(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var l=vt.current;if(t.flags&128)return sa(t,l),null;var a=(l&2)!==0;if(a?(l=l&1|2,t.flags|=128):l&=1,sa(t,l),r==="backwards"&&e!==null?(wu(e),Ge(e,t,s,i),wu(e)):Ge(e,t,s,i),s=j?ea:0,!a&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dv(e,i,t);else if(e.tag===19)Dv(e,i,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(r){case"backwards":i=Rv(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null,wu(t)),wo(t,!0,r,null,n,s);break;case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&oh(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}wo(t,!0,i,null,n,s);break;case"together":wo(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:i=Rv(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),wo(t,!1,r,i,n,s)}return t.child}function Bv(e,t,i){var s=t.pendingProps;return $s(t,t.type,s.value),Ge(e,t,s.children,i),t.child}function ms(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Fr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,i=us(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=us(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Lf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&nh(e)))}function BC(e,t,i){switch(t.tag){case 3:Zo(t,t.stateNode.containerInfo),$s(t,Fe,e.memoizedState.cache),Ir();break;case 27:case 5:Vu(t);break;case 4:Zo(t,t.stateNode.containerInfo);break;case 10:$s(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ad(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return sr(t),t.flags|=128,null;s=Fr(e,t,i,!1);var r=t.child.childLanes;return s||(i&r)!==0?sp(e,t,i):(sr(t),e=ms(e,t,i),e!==null?e.sibling:null)}sr(t);break;case 19:if(t.flags&128)return md(e,t,i);if(r=(e.flags&128)!==0,s=(i&t.childLanes)!==0,s||(Fr(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return md(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),sa(t,vt.current),s)break;return null;case 22:return t.lanes=0,ip(e,t,i,t.pendingProps);case 24:$s(t,Fe,e.memoizedState.cache)}return ms(e,t,i)}function rp(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)qe=!0;else{if(!Lf(e,i)&&(t.flags&128)===0)return qe=!1,BC(e,t,i);qe=(e.flags&131072)!==0}else qe=!1,j&&(t.flags&1048576)!==0&&o1(t,ea,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Rr(t.elementType),t.type=e,typeof e=="function")lf(e)?(s=Gr(e,s),t.tag=1,t=Lv(null,t,e,s,i)):(t.tag=0,t=fd(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===Gd){t.tag=11,t=Cv(null,t,e,s,i);break e}else if(r===Kd){t.tag=14,t=xv(null,t,e,s,i);break e}else if(r===Wi){t.tag=10,t.type=e,t=Bv(null,t,i);break e}}throw t=qu(e)||e,Error(D(306,t,""))}}return t;case 0:return fd(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=Gr(s,t.pendingProps),Lv(e,t,s,r,i);case 3:e:{if(Zo(t,t.stateNode.containerInfo),e===null)throw Error(D(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,rd(e,t),Wl(t,s,null,i);var l=t.memoizedState;if(s=l.cache,$s(t,Fe,s),s!==n.cache&&id(t,[Fe],i,!0),ql(),s=l.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Av(e,t,s,i);break e}else if(s!==r){r=vi(Error(D(424)),t),ta(r),t=Av(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,me=pi(e.firstChild),it=t,j=!0,er=null,mi=!0,i=_1(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Ir(),s===r){t=ms(e,t,i);break e}Ge(e,t,s,i)}t=t.child}return t;case 26:return mn(e,t),e===null?(i=nm(t.type,null,t.pendingProps,null))?t.memoizedState=i:j||(t.stateNode=Kp(t.type,t.pendingProps,Js.current,t)):t.memoizedState=nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Vu(t),e===null&&j&&(s=t.stateNode=sS(t.type,t.pendingProps,Js.current),it=t,mi=!0,r=me,gr(t.type)?(qd=r,me=pi(s.firstChild)):me=r),Ge(e,t,t.pendingProps.children,i),mn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&j&&((r=s=me)&&(s=x3(s,t.type,t.pendingProps,mi),s!==null?(t.stateNode=s,it=t,me=pi(s.firstChild),mi=!1,r=!0):r=!1),r||cr(t)),Vu(t),r=t.type,n=t.pendingProps,l=e!==null?e.memoizedProps:null,s=n.children,Ud(r,n)?s=null:l!==null&&Ud(r,l)&&(t.flags|=32),t.memoizedState!==null&&(r=gf(e,t,bC,null,null,i),Qn._currentValue=r),mn(e,t),Ge(e,t,s,i),t.child;case 6:return e===null&&j&&((e=i=me)&&(i=E3(i,t.pendingProps,mi),i!==null?(t.stateNode=i,it=t,me=null,e=!0):e=!1),e||cr(t)),null;case 13:return sp(e,t,i);case 4:return Zo(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Vr(t,null,s,i):Ge(e,t,s,i),t.child;case 11:return Cv(e,t,t.type,t.pendingProps,i);case 7:return s=t.pendingProps,mn(e,t),Ge(e,t,s,i),t.child;case 8:return Ge(e,t,t.pendingProps.children,i),t.child;case 12:return Ge(e,t,t.pendingProps.children,i),t.child;case 10:return Bv(e,t,i);case 9:return r=t.type._context,s=t.pendingProps.children,qr(t),r=_t(r),s=s(r),t.flags|=1,Ge(e,t,s,i),t.child;case 14:return xv(e,t,t.type,t.pendingProps,i);case 15:return tp(e,t,t.type,t.pendingProps,i);case 19:return md(e,t,i);case 31:return DC(e,t,i);case 22:return ip(e,t,i,t.pendingProps);case 24:return qr(t),s=_t(Fe),e===null?(r=hf(),r===null&&(r=fe,n=of(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},uf(t),$s(t,Fe,r)):((e.lanes&i)!==0&&(rd(e,t),Wl(t,null,null,i),ql()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),$s(t,Fe,s)):(s=n.cache,$s(t,Fe,s),s!==r.cache&&id(t,[Fe],i,!0))),Ge(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:j&&Bh(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:mn(e,t),Ge(e,t,s.children,i),t.child;case 29:throw t.pendingProps}throw Error(D(156,t.tag))}function os(e){e.flags|=4}function Cu(e,t,i,s,r){var n;if((n=(e.mode&32)!==0)&&(n=i===null?om(t,s):om(t,s)&&(s.src!==i.src||s.srcSet!==i.srcSet)),n){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(kp())e.flags|=8192;else throw Ur=lh,cf}else e.flags&=-16777217}function kv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!aS(t))if(kp())e.flags|=8192;else throw Ur=lh,cf}function Co(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Am():536870912,e.lanes|=t,Gn|=t)}function Ll(e,t){if(!j)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&1206910976,s|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function kC(e,t,i){var s=t.pendingProps;switch(af(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ve(t),null;case 1:return ve(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ds(Fe),qn(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(gn(t)?os(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pu())),ve(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(os(t),n!==null?(ve(t),kv(t,n)):(ve(t),Cu(t,r,null,s,i))):n?n!==e.memoizedState?(os(t),ve(t),kv(t,n)):(ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&os(t),ve(t),Cu(t,r,e,s,i)),null;case 27:if(Qo(t),i=Js.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&os(t);else{if(!s){if(t.stateNode===null)throw Error(D(166));return ve(t),t.subtreeFlags&=-33554433,null}e=Ki.current,gn(t)?lv(t,e):(e=sS(r,s,i),t.stateNode=e,os(t))}return ve(t),t.subtreeFlags&=-33554433,null;case 5:if(Qo(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&os(t);else{if(!s){if(t.stateNode===null)throw Error(D(166));return ve(t),t.subtreeFlags&=-33554433,null}if(n=Ki.current,gn(t))lv(t,n);else{var l=aa(Js.current);switch(n){case 1:n=l.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=l.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=l.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=l.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=l.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?l.createElement("select",{is:s.is}):l.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?l.createElement(r,{is:s.is}):l.createElement(r)}}n[ft]=t,n[Wt]=s;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)n.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=n;e:switch(mt(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&os(t)}}return ve(t),t.subtreeFlags&=-33554433,Cu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&os(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(D(166));if(e=Js.current,gn(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=it,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[ft]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Yp(e.nodeValue,i)),e||cr(t,!0)}else e=aa(e).createTextNode(s),e[ft]=t,t.stateNode=e}return ve(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=gn(t),i!==null){if(e===null){if(!s)throw Error(D(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(557));e[ft]=t}else Ir(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ve(t),e=!1}else i=pu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?($t(t),t):($t(t),null);if((t.flags&128)!==0)throw Error(D(558))}return ve(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=gn(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(D(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(D(317));r[ft]=t}else Ir(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ve(t),r=!1}else r=pu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?($t(t),t):($t(t),null)}return $t(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Co(t,t.updateQueue),ve(t),null);case 4:return qn(),e===null&&Hf(t.stateNode.containerInfo),t.flags|=67108864,ve(t),null;case 10:return ds(t.type),ve(t),null;case 19:if(ff(t),s=t.memoizedState,s===null)return ve(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)Ll(s,!1);else{if(Be!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=oh(e),n!==null){for(t.flags|=128,Ll(s,!1),e=n.updateQueue,t.updateQueue=e,Co(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)l1(i,e),i=i.sibling;return sa(t,vt.current&1|2),j&&hs(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Qt()>ph&&(t.flags|=128,r=!0,Ll(s,!1),t.lanes=4194304)}else{if(!r)if(e=oh(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Co(t,e),Ll(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!n.alternate&&!j)return ve(t),null}else 2*Qt()-s.renderingStartTime>ph&&i!==536870912&&(t.flags|=128,r=!0,Ll(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}if(s.tail!==null){e=s.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Qt(),e.sibling=null,n=vt.current,n=r?n&1|2:n&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!i||j?sa(t,n):(i=n,pe(pt,t),pe(vt,i),Et===null&&(Et=t)),j&&hs(t,s.treeForkCount),e}return ve(t),null;case 22:case 23:return $t(t),df(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(ve(t),t.subtreeFlags&6&&(t.flags|=8192)):ve(t),i=t.updateQueue,i!==null&&Co(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&gt(Hr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ds(Fe),ve(t),null;case 25:return null;case 30:return t.flags|=33554432,ve(t),null}throw Error(D(156,t.tag))}function OC(e,t){switch(af(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ds(Fe),qn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Qo(t),null;case 31:if(t.memoizedState!==null){if($t(t),t.alternate===null)throw Error(D(340));Ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));Ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ff(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return qn(),null;case 10:return ds(t.type),null;case 22:case 23:return $t(t),df(),e!==null&&gt(Hr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ds(Fe),null;case 25:return null;default:return null}}function np(e,t){switch(af(t),t.tag){case 3:ds(Fe),qn();break;case 26:case 27:case 5:Qo(t);break;case 4:qn();break;case 31:t.memoizedState!==null&&$t(t);break;case 13:$t(t);break;case 19:ff(t);break;case 10:ds(t.type);break;case 22:case 23:$t(t),df(),e!==null&&gt(Hr);break;case 24:ds(Fe)}}function ya(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,l=i.inst;s=n(),l.destroy=s}i=i.next}while(i!==r)}}catch(a){ce(t,t.return,a)}}function dr(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var l=s.inst,a=l.destroy;if(a!==void 0){l.destroy=void 0,r=t;var o=i,h=a;try{h()}catch(c){ce(r,o,c)}}}s=s.next}while(s!==n)}}catch(c){ce(t,t.return,c)}}function lp(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{v1(t,i)}catch(s){ce(e,e.return,s)}}}function ap(e,t,i){i.props=Gr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ce(e,t,s)}}function Fi(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var r=e.stateNode,n=_s(e.memoizedProps,r);(r.ref===null||r.ref.name!==n)&&(r.ref=Zp(n)),s=r.ref;break;case 7:if(e.stateNode===null){var l=new si(e);qt(e.child,!1,w3,l,void 0,void 0),e.stateNode=l}s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(a){ce(e,t,a)}}function dt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){ce(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){ce(e,t,r)}else i.current=null}function fh(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)tS(e.stateNode,t[i])}function Ov(e){for(var t=e.return;t!==null&&(Df(t)&&tS(e.stateNode,t.stateNode),!Af(t));)t=t.return}function Gl(e){for(var t=e.return;t!==null&&(Df(t)&&C3(e.stateNode,t.stateNode),!Af(t));)t=t.return}function Af(e){return e.tag===5||e.tag===3||e.tag===27}function Df(e){return e&&e.tag===7&&e.stateNode!==null}function pd(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){ce(e,e.return,r)}}function xu(e,t,i){try{var s=e.stateNode;r3(s,e.type,i,t),s[Wt]=t}catch(r){ce(e,e.return,r)}}function op(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gr(e.type)||e.tag===4}function Eu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||op(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&gr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sd(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(r,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(r),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Vi)),fh(e,s),se=!0;else if(r!==4&&(r===27&&(fh(e,s),s=null,gr(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(Sd(e,t,i,s),e=e.sibling;e!==null;)Sd(e,t,i,s),e=e.sibling}function _h(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?i.insertBefore(r,t):i.appendChild(r),fh(e,s),se=!0;else if(r!==4&&(r===27&&(fh(e,s),s=null,gr(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(_h(e,t,i,s),e=e.sibling;e!==null;)_h(e,t,i,s),e=e.sibling}function hp(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);mt(t,s,i),t[ft]=e,t[Wt]=i}catch(n){ce(e,e.return,n)}}var gh=!1,Xt=null;function Nv(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(gh=!0)}var qi=null;function zv(){var e=qi;return qi=null,e}var Pt=0;function rl(e,t,i,s,r){return Pt=0,cp(e.child,t,i,s,r)}function cp(e,t,i,s,r){for(var n=!1;e!==null;){if(e.tag===5){var l=e.stateNode;if(s!==null){var a=Pd(l);s.push(a),a.view&&(n=!0)}else n||Pd(l).view&&(n=!0);gh=!0,jp(l,Pt===0?t:t+"_"+Pt,i),Pt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||cp(e.child,t,i,s,r)&&(n=!0));e=e.sibling}return n}function $i(e,t){for(;e!==null;)e.tag===5?$p(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||$i(e.child,t)),e=e.sibling}function Fo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Fo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(D(544));var i=t.name;t=ys(t.default,t.share),t!=="none"&&(rl(e,i,t,null,!1)||$i(e.child,!1))}e=e.sibling}}function yd(e,t){if(e.tag===30){var i=e.stateNode,s=e.memoizedProps,r=_s(s,i),n=ys(s.default,i.paired?s.share:s.enter);n!=="none"?rl(e,r,n,null,!1)?(Fo(e),i.paired||t||Kn(e,s.onEnter)):$i(e.child,!1):Fo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)yd(e,t),e=e.sibling;else Fo(e)}function bd(e){if(Xt!==null&&Xt.size!==0){var t=Xt;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,s=i.name;if(s!=null&&s!=="auto"){var r=t.get(s);if(r!==void 0){var n=ys(i.default,i.share);if(n!=="none"&&(rl(e,s,n,null,!1)?(n=e.stateNode,r.paired=n,n.paired=r,Kn(e,i.onShare)):$i(e.child,!1)),t.delete(s),t.size===0)break}}}bd(e)}e=e.sibling}}}function wd(e){if(e.tag===30){var t=e.memoizedProps,i=_s(t,e.stateNode),s=Xt!==null?Xt.get(i):void 0,r=ys(t.default,s!==void 0?t.share:t.exit);r!=="none"&&(rl(e,i,r,null,!1)?s!==void 0?(r=e.stateNode,s.paired=r,r.paired=s,Xt.delete(i),Kn(e,t.onShare)):Kn(e,t.onExit):$i(e.child,!1)),Xt!==null&&bd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wd(e),e=e.sibling;else Xt!==null&&bd(e)}function up(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=_s(t,e.stateNode);t=ys(t.default,t.update),e.flags&=-5,t!=="none"&&rl(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&up(e);e=e.sibling}}function Cd(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,$i(e.child,!1))}Cd(e)}e=e.sibling}}function qo(e){if(e.tag===30)e.stateNode.paired=null,$i(e.child,!1),Cd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)qo(e),e=e.sibling;else Cd(e)}function dp(e){for(e=e.child;e!==null;)e.tag===30?$i(e.child,!1):(e.subtreeFlags&33554432)!==0&&dp(e),e=e.sibling}function Rf(e,t,i,s,r,n,l){for(var a=!1;t!==null;){if(t.tag===5){var o=t.stateNode;if(n!==null&&Pt<n.length){var h=n[Pt],c=Pd(o);(h.view||c.view)&&(a=!0);var u;if(u=(e.flags&4)===0)if(c.clip)u=!0;else{u=h.rect;var d=c.rect;u=u.y!==d.y||u.x!==d.x||u.height!==d.height||u.width!==d.width}u&&(e.flags|=4),c.abs?c=!h.abs:(h=h.rect,c=c.rect,c=h.height!==c.height||h.width!==c.width),c&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&jp(o,Pt===0?i:i+"_"+Pt,r),a&&(e.flags&4)!==0||(qi===null&&(qi=[]),qi.push(o,Pt===0?s:s+"_"+Pt,t.memoizedProps)),Pt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&l?e.flags|=t.flags&32:Rf(e,t.child,i,s,r,n,l)&&(a=!0));t=t.sibling}return a}function fp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,s=e.stateNode,r=_s(i,s),n=ys(i.default,i.update);if(t){s=s.clones;var l=s===null?null:s.map(c3)}else l=e.memoizedState,e.memoizedState=null;s=e;var a=e.child;Pt=0,r=Rf(s,a,r,r,n,l,!1),(e.flags&4)!==0&&r&&(t||Kn(e,i.onUpdate))}else(e.subtreeFlags&33554432)!==0&&fp(e,t);e=e.sibling}}var Je=!1,ae=!1,Ui=!1,Tu=!1,Hv=typeof WeakSet=="function"?WeakSet:Set,et=null,Pi=!1,zl=!1,vh=!1,xd=!1;function NC(e,t,i){if(e=e.containerInfo,zd=Jn,e=Qm(e),sf(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var n=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{s.nodeType,l.nodeType}catch{s=null;break e}var a=0,o=-1,h=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var _;d!==s||n!==0&&d.nodeType!==3||(o=a+n),d!==l||r!==0&&d.nodeType!==3||(h=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(_=d.firstChild)!==null;)f=d,d=_;for(;;){if(d===e)break t;if(f===s&&++c===n&&(o=a),f===l&&++u===r&&(h=a),(_=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=_}s=o===-1||h===-1?null:{start:o,end:h}}else s=null}s=s||{start:0,end:0}}else s=null;for(Hd={focusedElem:e,selectionRange:s},Jn=!1,i=(i&335544064)===i,et=t,t=i?9270:1024;et!==null;){if(e=et,i&&(s=e.deletions,s!==null))for(n=0;n<s.length;n++)i&&wd(s[n]);if(e.alternate===null&&(e.flags&2)!==0)i&&Nv(e),xo(i);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&i&&wd(s),xo(i);continue}else if(s!==null&&s.memoizedState!==null){i&&Nv(e),xo(i);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,et=s):(i&&up(e),xo(i))}}Xt=null}function xo(e){for(;et!==null;){var t=et,i=e,s=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&s!==null){i=void 0,r=s.memoizedProps,s=s.memoizedState;var n=t.stateNode;try{var l=Gr(t.type,r);i=n.getSnapshotBeforeUpdate(l,s),n.__reactInternalSnapshotBeforeUpdate=i}catch(a){ce(t,t.return,a)}}break;case 3:if((r&1024)!==0){if(s=t.stateNode.containerInfo,i=s.nodeType,i===9)Id(s);else if(i===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Id(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&s!==null&&(i=_s(s.memoizedProps,s.stateNode),r=t.memoizedProps,r=ys(r.default,r.update),r!=="none"&&rl(s,i,r,s.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(D(163))}if(s=t.sibling,s!==null){s.return=t.return,et=s;break}et=t.return}}function _p(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Ii(e,i),s&4&&ya(5,i);break;case 1:if(Ii(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(l){ce(i,i.return,l)}else{var r=Gr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){ce(i,i.return,l)}}s&64&&lp(i),s&512&&Fi(i,i.return);break;case 3:if(Ii(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{v1(e,t)}catch(l){ce(i,i.return,l)}}break;case 27:t===null&&s&4&&hp(i);case 26:case 5:Ii(e,i),t===null&&s&4&&pd(i),s&512&&Fi(i,i.return);break;case 12:Ii(e,i);break;case 31:Ii(e,i),s&4&&pp(e,i);break;case 13:Ii(e,i),s&4&&Sp(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=KC.bind(null,i),T3(e,i))));break;case 22:if(s=i.memoizedState!==null||Je,!s){var n=t!==null&&t.memoizedState!==null||ae;t=Je,r=ae,Je=s,(ae=n)&&!r?(s=2,(i.subtreeFlags&8772)!==0&&(s|=1),Li(e,i,s)):Ii(e,i),Je=t,ae=r}break;case 30:Ii(e,i),s&512&&Fi(i,i.return);break;case 7:s&512&&Fi(i,i.return);default:Ii(e,i)}}function Ed(e,t){for(e=e.child;e!==null;)gp(e,t),e=e.sibling}function gp(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var s=i.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var r=e.stateNode,n=e.memoizedProps.style,l=n!=null&&n.hasOwnProperty("display")?n.display:null;r.style.display=l==null||typeof l=="boolean"?"":(""+l).trim()}}catch(o){ce(e,e.return,o)}Td(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,se=!0}catch(o){ce(e,e.return,o)}break;case 18:try{var a=e.stateNode;t?Jv(a,!0):Jv(e.stateNode,!1)}catch(o){ce(e,e.return,o)}break;case 22:case 23:e.memoizedState===null&&Ed(e,t);break;default:Ed(e,t)}}function Td(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,s=t;switch(i.tag){case 4:gp(i,s);break e;case 22:i.memoizedState===null&&Td(i,s);break e;default:Td(i,s)}}e=e.sibling}}function vp(e){var t=e.alternate;t!==null&&(e.alternate=null,vp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Th(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 xe=null,Ht=!1;function Mi(e,t,i){for(i=i.child;i!==null;)mp(e,t,i),i=i.sibling}function mp(e,t,i){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(fa,i)}catch{}switch(i.tag){case 26:ae||dt(i,t),Mi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!ae&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ae||dt(i,t),Gl(i);var s=xe,r=Ht;gr(i.type)&&(xe=i.stateNode,Ht=!1),Mi(e,t,i),rS(i.stateNode,i.type,i.memoizedProps),xe=s,Ht=r;break;case 5:ae||dt(i,t),Gl(i);case 6:if(i.tag===6&&Gl(i),s=xe,r=Ht,xe=null,Mi(e,t,i),xe=s,Ht=r,xe!==null)if(Ht)try{(xe.nodeType===9?xe.body:xe.nodeName==="HTML"?xe.ownerDocument.body:xe).removeChild(i.stateNode),se=!0}catch(n){ce(i,t,n)}else try{xe.removeChild(i.stateNode),se=!0}catch(n){ce(i,t,n)}break;case 18:xe!==null&&(Ht?(e=xe,Qv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),el(e)):Qv(xe,i.stateNode));break;case 4:s=xe,r=Ht,xe=i.stateNode.containerInfo,Ht=!0,Mi(e,t,i),xe=s,Ht=r;break;case 0:case 11:case 14:case 15:dr(2,i,t),ae||dr(4,i,t),Mi(e,t,i);break;case 1:ae||(dt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&ap(i,t,s)),Mi(e,t,i);break;case 21:Mi(e,t,i);break;case 22:ae=(s=ae)||i.memoizedState!==null,Mi(e,t,i),ae=s;break;case 30:dt(i,t),Mi(e,t,i);break;case 7:ae||dt(i,t),Mi(e,t,i);break;default:Mi(e,t,i)}}function pp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{el(e)}catch(i){ce(t,t.return,i)}}}function Sp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{el(e)}catch(i){ce(t,t.return,i)}}function zC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hv),t;default:throw Error(D(435,e.tag))}}function Eo(e,t){var i=zC(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=jC.bind(null,e,s);s.then(r,r)}})}function Lt(e,t,i){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var n=s[r],l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(gr(o.type)){xe=o.stateNode,Ht=!1;break e}break;case 5:xe=o.stateNode,Ht=!1;break e;case 3:case 4:xe=o.stateNode.containerInfo,Ht=!0;break e}o=o.return}if(xe===null)throw Error(D(160));mp(l,a,n),xe=null,Ht=!1,l=n.alternate,l!==null&&(l.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yp(t,e,i),t=t.sibling}var Ai=null;function yp(e,t,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var n=0;n<s.length;n++){var l=s[n];l.ref.impl=l.nextImpl}Lt(t,e,i),At(e),r&4&&(dr(3,e,e.return),ya(3,e),dr(5,e,e.return));break;case 1:Lt(t,e,i),At(e),r&512&&(ae||s===null||dt(s,s.return)),r&64&&Je&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(n=Ai,Lt(t,e,i),At(e),r&512&&(ae||s===null||dt(s,s.return)),r&4)if(r=s!==null?s.memoizedState:null,i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null)if(Je)e.stateNode=Kp(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,r=n.ownerDocument||n;t:switch(t){case"title":s=r.getElementsByTagName("title")[0],(!s||s[va]||s[ft]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(t),r.head.insertBefore(s,r.querySelector("head > title"))),mt(s,t,i),s[ft]=e,tt(s),t=s;break e;case"link":if(n=am("link","href",r).get(t+(i.href||""))){for(l=0;l<n.length;l++)if(s=n[l],s.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&s.getAttribute("rel")===(i.rel==null?null:i.rel)&&s.getAttribute("title")===(i.title==null?null:i.title)&&s.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){n.splice(l,1);break t}}s=r.createElement(t),mt(s,t,i),r.head.appendChild(s);break;case"meta":if(n=am("meta","content",r).get(t+(i.content||""))){for(l=0;l<n.length;l++)if(s=n[l],s.getAttribute("content")===(i.content==null?null:""+i.content)&&s.getAttribute("name")===(i.name==null?null:i.name)&&s.getAttribute("property")===(i.property==null?null:i.property)&&s.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&s.getAttribute("charset")===(i.charSet==null?null:i.charSet)){n.splice(l,1);break t}}s=r.createElement(t),mt(s,t,i),r.head.appendChild(s);break;default:throw Error(D(468,t))}s[ft]=e,tt(s),t=s}e.stateNode=t}else Je||Wd(n,e.type,e.stateNode);else e.stateNode=lm(n,i,e.memoizedProps);else r!==i?(r===null?(t=s.stateNode,t===null||ae||t.parentNode.removeChild(t)):r.count--,i===null?Je||Wd(n,e.type,e.stateNode):lm(n,i,e.memoizedProps)):i===null&&e.stateNode!==null&&xu(e,e.memoizedProps,s.memoizedProps);break;case 27:Lt(t,e,i),At(e),r&512&&(ae||s===null||dt(s,s.return)),s!==null&&r&4&&xu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(n=Ui,Ui=!1,Lt(t,e,i),Ui=n,At(e),r&512&&(ae||s===null||dt(s,s.return)),e.flags&32){t=e.stateNode;try{Vn(t,""),se=!0}catch(c){ce(e,e.return,c)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,xu(e,t,s!==null?s.memoizedProps:t)),r&1024&&(Tu=!0);break;case 6:if(Lt(t,e,i),At(e),r&4){if(e.stateNode===null)throw Error(D(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,se=!0}catch(c){ce(e,e.return,c)}}break;case 3:if(se=!1,Go=null,n=Ai,Ai=oa(t.containerInfo),Lt(t,e,i),Ai=n,At(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{el(t.containerInfo)}catch(c){ce(e,e.return,c)}Tu&&(Tu=!1,bp(e)),se=!1;break;case 4:r=Ui,Ui=Je,s=Wg(),n=Ai,Ai=oa(e.stateNode.containerInfo),Lt(t,e,i),At(e),Ai=n,se&&zl&&(vh=!0),se=s,Ui=r;break;case 12:Lt(t,e,i),At(e);break;case 31:Lt(t,e,i),At(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eo(e,t)));break;case 13:Lt(t,e,i),At(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ph=Qt()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eo(e,t)));break;case 22:n=e.memoizedState!==null,l=s!==null&&s.memoizedState!==null;var a=Je,o=ae,h=Ui;Je=a||n,Ui=h||n,ae=o||l,Lt(t,e,i),ae=o,Ui=h,Je=a,At(e),r&8192&&(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,!n||s===null||l||Je||ae||(t=l||ae,i=Je,s=ae,Je=n||Je,ae=t,Ws(e,2),Je=i,ae=s),!n&&Ui||Ed(e,n)),r&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,Eo(e,i))));break;case 19:Lt(t,e,i),At(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eo(e,t)));break;case 30:r&512&&(ae||s===null||dt(s,s.return)),r=Wg(),n=zl,l=(i&335544064)===i,a=e.memoizedProps,zl=l&&ys(a.default,a.update)!=="none",Lt(t,e,i),At(e),l&&s!==null&&se&&(e.flags|=4),zl=n,se=r;break;case 21:break;case 7:r&512&&(ae||s===null||dt(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Lt(t,e,i),At(e)}}function At(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(op(s)){i=s;break}s=s.return}s=null;for(var r=e.return;r!==null;){if(Df(r)){var n=r.stateNode;s===null?s=[n]:s.push(n)}if(Af(r))break;r=r.return}var l=s;if(i==null)throw Error(D(160));switch(i.tag){case 27:var a=i.stateNode,o=Eu(e);_h(e,o,a,l);break;case 5:var h=i.stateNode;i.flags&32&&(Vn(h,""),i.flags&=-33);var c=Eu(e);_h(e,c,h,l);break;case 3:case 4:var u=i.stateNode.containerInfo,d=Eu(e);Sd(e,d,u,l);break;default:throw Error(D(161))}}catch(f){ce(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Jn=!0,t.reset(),Jn=!1),e=e.sibling}}function vn(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)wp(t,e),t=t.sibling;else fp(t,!1)}function wp(e,t){var i=e.alternate;if(i===null)yd(e,!1);else switch(e.tag){case 3:if(xd=Pi=!1,zv(),vn(t,e),!Pi&&!vh){if(e=qi,e!==null)for(var s=0;s<e.length;s+=3){i=e[s];var r=e[s+1];$p(i,e[s+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),xd=!0}qi=null;break;case 5:vn(t,e);break;case 4:s=Pi,Pi=!1,vn(t,e),Pi&&(vh=!0),Pi=s;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?yd(e,!1):vn(t,e));break;case 30:s=Pi,r=zv(),Pi=!1,vn(t,e),Pi&&(e.flags|=4);var n=e.memoizedProps,l=e.stateNode;t=_s(n,l),l=_s(i.memoizedProps,l);var a=ys(n.default,n.update);a==="none"?t=!1:(n=i.memoizedState,i.memoizedState=null,i=e.child,Pt=0,t=Rf(e,i,t,l,a,n,!0),Pt!==(n===null?0:n.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Kn(e,e.memoizedProps.onUpdate),qi=r):r!==null&&(r.push.apply(r,qi),qi=r),Pi=(e.flags&32)!==0?!0:s;break;default:vn(t,e)}}function Ii(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_p(e,t.alternate,t),t=t.sibling}function Ws(e,t){for(e=e.child;e!==null;){var i=e,s=t;switch(i.tag){case 0:case 11:case 14:case 15:dr(4,i,i.return),Ws(i,s);break;case 1:dt(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&ap(i,i.return,r),Ws(i,s);break;case 27:(s&2)!==0&&rS(i.stateNode,i.type,i.memoizedProps);case 5:dt(i,i.return),i.tag!==5&&i.tag!==27||Gl(i),Ws(i,s);break;case 6:Gl(i);break;case 26:dt(i,i.return),r=i.stateNode,i.memoizedState!==null||r===null||ae||r.parentNode.removeChild(r),Ws(i,s);break;case 22:i.memoizedState===null&&Ws(i,s);break;case 30:dt(i,i.return),Ws(i,s);break;case 7:dt(i,i.return);default:Ws(i,s)}e=e.sibling}}function Li(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,l=n.flags,a=(i&1)!==0;switch(n.tag){case 0:case 11:case 15:Li(r,n,i),ya(4,n);break;case 1:if(Li(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){ce(s,s.return,c)}if(s=n,r=s.updateQueue,r!==null){var o=s.stateNode;try{var h=r.shared.hiddenCallbacks;if(h!==null)for(r.shared.hiddenCallbacks=null,r=0;r<h.length;r++)g1(h[r],o)}catch(c){ce(s,s.return,c)}}a&&l&64&&lp(n),Fi(n,n.return);break;case 27:(i&2)!==0&&hp(n);case 5:n.tag!==5&&n.tag!==27||Ov(n),Li(r,n,i),a&&s===null&&l&4&&pd(n),Fi(n,n.return);break;case 6:Ov(n);break;case 26:o=n.stateNode,n.memoizedState!==null||o===null||Je||Wd(oa(o.ownerDocument),n.type,o),Li(r,n,i),a&&s===null&&l&4&&pd(n),Fi(n,n.return);break;case 12:Li(r,n,i);break;case 31:Li(r,n,i),a&&l&4&&pp(r,n);break;case 13:Li(r,n,i),a&&l&4&&Sp(r,n);break;case 22:n.memoizedState===null&&Li(r,n,i),Fi(n,n.return);break;case 30:Li(r,n,i),Fi(n,n.return);break;case 7:Fi(n,n.return);default:Li(r,n,i)}t=t.sibling}}function Bf(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&pa(i))}function kf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pa(e))}function ui(e,t,i,s){var r=(i&335544064)===i;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Cp(e,t,i,s),t=t.sibling;else r&&dp(t)}function Cp(e,t,i,s){var r=(i&335544064)===i;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&qo(t);var n=t.flags;switch(t.tag){case 0:case 11:case 15:ui(e,t,i,s),n&2048&&ya(9,t);break;case 1:ui(e,t,i,s);break;case 3:ui(e,t,i,s),r&&xd&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),n&2048&&(n=null,t.alternate!==null&&(n=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==n&&(t.refCount++,n!=null&&pa(n)));break;case 12:if(n&2048){ui(e,t,i,s),n=t.stateNode;try{var l=t.memoizedProps,a=l.id,o=l.onPostCommit;typeof o=="function"&&o(a,t.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(h){ce(t,t.return,h)}}else ui(e,t,i,s);break;case 31:ui(e,t,i,s);break;case 13:ui(e,t,i,s);break;case 23:break;case 22:l=t.stateNode,a=t.alternate,t.memoizedState!==null?(r&&a!==null&&a.memoizedState===null&&qo(a),l._visibility&2?ui(e,t,i,s):Kl(e,t)):(r&&a!==null&&a.memoizedState!==null&&qo(t),l._visibility&2?ui(e,t,i,s):(l._visibility|=2,pn(e,t,i,s,(t.subtreeFlags&10256)!==0||!1))),n&2048&&Bf(a,t);break;case 24:ui(e,t,i,s),n&2048&&kf(t.alternate,t);break;case 30:r&&(n=t.alternate,n!==null&&($i(n.child,!0),$i(t.child,!0))),ui(e,t,i,s);break;default:ui(e,t,i,s)}}function pn(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,l=t,a=i,o=s,h=l.flags;switch(l.tag){case 0:case 11:case 15:pn(n,l,a,o,r),ya(8,l);break;case 23:break;case 22:var c=l.stateNode;l.memoizedState!==null?c._visibility&2?pn(n,l,a,o,r):Kl(n,l):(c._visibility|=2,pn(n,l,a,o,r)),r&&h&2048&&Bf(l.alternate,l);break;case 24:pn(n,l,a,o,r),r&&h&2048&&kf(l.alternate,l);break;default:pn(n,l,a,o,r)}t=t.sibling}}function Kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Kl(i,s),r&2048&&Bf(s.alternate,s);break;case 24:Kl(i,s),r&2048&&kf(s.alternate,s);break;default:Kl(i,s)}t=t.sibling}}var Br=8192;function Ar(e,t,i){if(e.subtreeFlags&Br)for(e=e.child;e!==null;)xp(e,t,i),e=e.sibling}function xp(e,t,i){switch(e.tag){case 26:Ar(e,t,i),e.flags&Br&&(e.memoizedState!==null?I3(i,Ai,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&hm(i,e)));break;case 5:Ar(e,t,i),e.flags&Br&&(e=e.stateNode,(t&335544128)===t&&hm(i,e));break;case 3:case 4:var s=Ai;Ai=oa(e.stateNode.containerInfo),Ar(e,t,i),Ai=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Br,Br=16777216,Ar(e,t,i),Br=s):Ar(e,t,i));break;case 30:if((e.flags&Br)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var r=e.stateNode;r.paired=null,Xt===null&&(Xt=new Map),Xt.set(s,r)}Ar(e,t,i);break;default:Ar(e,t,i)}}function Ep(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 Al(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];et=s,Mp(s,e)}Ep(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tp(e),e=e.sibling}function Tp(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&dr(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wo(e)):Al(e);break;default:Al(e)}}function Wo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];et=s,Mp(s,e)}Ep(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dr(8,t,t.return),Wo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Wo(t));break;default:Wo(t)}e=e.sibling}}function Mp(e,t){for(;et!==null;){var i=et;switch(i.tag){case 0:case 11:case 15:dr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:pa(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,et=s;else e:for(i=e;et!==null;){s=et;var r=s.sibling,n=s.return;if(vp(s),s===i){et=null;break e}if(r!==null){r.return=n,et=r;break e}et=n}}}var HC={getCacheForType:function(e){var t=_t(Fe),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return _t(Fe).controller.signal}},UC=typeof WeakMap=="function"?WeakMap:Map,re=0,fe=null,Z=null,ee=0,oe=0,Kt=null,Xs=!1,nl=!1,Of=!1,ps=0,Be=0,fr=0,Pr=0,mh=0,Zt=0,Gn=0,jl=null,Ut=null,Md=!1,Ph=0,Lp=0,ph=1/0,Sh=null,nr=null,Te=0,Ri=null,Kr=null,ji=0,Ld=0,Ad=null,Ap=null,Pn=null,In=null,Fn=null,$l=0,Vo=null;function ti(){return(re&2)!==0&&ee!==0?ee&-ee:q.T!==null?zf():km()}function Dp(){if(Zt===0)if((ee&536870912)===0||j){var e=uo;uo<<=1,(uo&3932160)===0&&(uo=262144),Zt=e}else Zt=536870912;return e=pt.current,e!==null&&(e.flags|=32),Zt}function Kn(e,t){if(t!=null){var i=e.stateNode,s=i.ref;s===null&&(s=i.ref=Zp(_s(e.memoizedProps,i))),In===null&&(In=[]),In.push(t.bind(null,s))}}function Ft(e,t,i){(e===fe&&(oe===2||oe===9)||e.cancelPendingCommit!==null)&&(jn(e,0),Zs(e,ee,Zt,!1)),ga(e,i),((re&2)===0||e!==fe)&&(e===fe&&((re&2)===0&&(Pr|=i),Be===4&&Zs(e,ee,Zt,!1)),Zi(e))}function Rp(e,t,i){if((re&6)!==0)throw Error(D(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||_a(e,t),r=s?FC(e,t):Mu(e,t,!0),n=s;do{if(r===0){nl&&!s&&Zs(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!PC(i)){r=Mu(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var l=0;else l=e.pendingLanes&-536870913,l=l!==0?l:l&536870912?536870912:0;if(l!==0){t=l;e:{var a=e;r=jl;var o=a.current.memoizedState.isDehydrated;if(o&&(jn(a,l).flags|=256),l=Mu(a,l,!1),l!==2&&l!==6){if(Of&&!o){a.errorRecoveryDisabledLanes|=n,Pr|=n,r=4;break e}n=Ut,Ut=r,n!==null&&(Ut===null?Ut=n:Ut.push.apply(Ut,n))}r=l}if(n=!1,r!==2)continue}}if(r===1){jn(e,0),Zs(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(D(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Zs(s,t,Zt,!Xs);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(D(329))}if((t&62914560)===t&&(r=Ph+300-Qt(),10<r)){if(Zs(s,t,Zt,!Xs),Eh(s,0,!0)!==0)break e;ji=t,s.timeoutHandle=Uf(Uv.bind(null,s,i,Ut,Sh,Md,t,Zt,Pr,Gn,Xs,n,"Throttled",-0,0),r);break e}Uv(s,i,Ut,Sh,Md,t,Zt,Pr,Gn,Xs,n,null,-0,0)}}break}while(!0);Zi(e)}function Uv(e,t,i,s,r,n,l,a,o,h,c,u,d,f){e.timeoutHandle=-1;var _=t.subtreeFlags,y=(n&335544064)===n;if(u=null,(y||_&8192||(_&16785408)===16785408)&&(u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vi},Xt=null,xp(t,n,u),y&&(_=u,y=e.containerInfo,y=(y.nodeType===9?y:y.ownerDocument).__reactViewTransition,y!=null&&(_.count++,_.waitingForViewTransition=!0,_=ha.bind(_),y.finished.then(_,_))),_=(n&62914560)===n?Ph-Qt():(n&4194048)===n?Lp-Qt():0,_=F3(u,_),_!==null)){ji=n,e.cancelPendingCommit=_(Iv.bind(null,e,t,n,i,s,r,l,a,o,h,c,u,null,d,f)),Zs(e,n,l,!h);return}Iv(e,t,n,i,s,r,l,a,o,h,c,u)}function PC(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],n=r.getSnapshot;r=r.value;try{if(!ii(n(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 Zs(e,t,i,s){t=Lm(e,t),t&=~mh,t&=~Pr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-ei(r),l=1<<n;s[n]=-1,r&=~l}i!==0&&Dm(e,i,t)}function Ih(){return(re&6)===0?(ba(0,!1),!1):!0}function Nf(){if(Z!==null){if(oe===0)var e=Z.return;else e=Z,cs=Qr=null,pf(e),zn=null,ia=0,e=Z;for(;e!==null;)np(e.alternate,e),e=e.return;Z=null}}function jn(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,a3(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ji=0,Nf(),fe=e,Z=i=us(e.current,null),ee=t,oe=0,Kt=null,Xs=!1,nl=_a(e,t),Of=!1,Gn=Zt=mh=Pr=fr=Be=0,Ut=jl=null,Md=!1,ps=Lm(e,t),Dh(),i}function Bp(e,t){Y=null,q.H=uh,t===sl||t===kh?(t=uv(),oe=3):t===cf?(t=uv(),oe=4):oe=t===Tf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,Z===null&&(Be=1,dh(e,vi(t,e.current)))}function kp(){var e=pt.current;return e===null?!0:(ee&4194048)===ee?Et===null:(ee&62914560)===ee||(ee&536870912)!==0?e===Et:!1}function Op(){var e=q.H;return q.H=uh,e===null?uh:e}function Np(){var e=q.A;return q.A=HC,e}function yh(){Be=4,Xs||(ee&4194048)!==ee&&pt.current!==null||(nl=!0),(fr&134217727)===0&&(Pr&134217727)===0||fe===null||Zs(fe,ee,Zt,!1)}function Mu(e,t,i){var s=re;re|=2;var r=Op(),n=Np();(fe!==e||ee!==t)&&(Sh=null,jn(e,t)),t=!1;var l=Be;e:do try{if(oe!==0&&Z!==null){var a=Z,o=Kt;switch(oe){case 8:Nf(),l=6;break e;case 3:case 2:case 9:case 6:pt.current===null&&(t=!0);var h=oe;if(oe=0,Kt=null,Rn(e,a,o,h),i&&nl){l=0;break e}break;default:h=oe,oe=0,Kt=null,Rn(e,a,o,h)}}IC(),l=Be;break}catch(c){Bp(e,c)}while(!0);return t&&e.shellSuspendCounter++,cs=Qr=null,re=s,q.H=r,q.A=n,Z===null&&(fe=null,ee=0,Dh()),l}function IC(){for(;Z!==null;)zp(Z)}function FC(e,t){var i=re;re|=2;var s=Op(),r=Np();fe!==e||ee!==t?(Sh=null,ph=Qt()+500,jn(e,t)):nl=_a(e,t);e:do try{if(oe!==0&&Z!==null){t=Z;var n=Kt;t:switch(oe){case 1:oe=0,Kt=null,Rn(e,t,n,1);break;case 2:case 9:if(cv(n)){oe=0,Kt=null,Pv(t);break}t=function(){oe!==2&&oe!==9||fe!==e||(oe=7),Zi(e)},n.then(t,t);break e;case 3:oe=7;break e;case 4:oe=5;break e;case 7:cv(n)?(oe=0,Kt=null,Pv(t)):(oe=0,Kt=null,Rn(e,t,n,7));break;case 5:var l=null;switch(Z.tag){case 26:l=Z.memoizedState;case 5:case 27:var a=Z;if(l?aS(l):a.stateNode.complete){oe=0,Kt=null;var o=a.sibling;if(o!==null)Z=o;else{var h=a.return;h!==null?(Z=h,Fh(h)):Z=null}break t}}oe=0,Kt=null,Rn(e,t,n,5);break;case 6:oe=0,Kt=null,Rn(e,t,n,6);break;case 8:Nf(),Be=6;break e;default:throw Error(D(462))}}qC();break}catch(c){Bp(e,c)}while(!0);return cs=Qr=null,q.H=s,q.A=r,re=i,Z!==null?0:(fe=null,ee=0,Dh(),Be)}function qC(){for(;Z!==null&&!nw();)zp(Z)}function zp(e){var t=rp(e.alternate,e,ps);e.memoizedProps=e.pendingProps,t===null?Fh(e):Z=t}function Pv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Mv(i,t,t.pendingProps,t.type,void 0,ee);break;case 11:t=Mv(i,t,t.pendingProps,t.type.render,t.ref,ee);break;case 5:pf(t);var s=t;s===it&&(j?(rh(s),s.tag===5&&s.stateNode!=null&&(me=s.stateNode)):(rh(s),j=!0));default:np(i,t),t=Z=l1(t,ps),t=rp(i,t,ps)}e.memoizedProps=e.pendingProps,t===null?Fh(e):Z=t}function Rn(e,t,i,s){cs=Qr=null,pf(t),zn=null,ia=0;var r=t.return;try{if(AC(e,r,t,i,ee)){Be=1,dh(e,vi(i,e.current)),Z=null;return}}catch(n){if(r!==null)throw Z=r,n;Be=1,dh(e,vi(i,e.current)),Z=null;return}t.flags&32768?(j||s===1?e=!0:nl||(ee&536870912)!==0?e=!1:(Xs=e=!0,(s===2||s===9||s===3||s===6)&&(s=pt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Hp(t,e)):Fh(t)}function Fh(e){var t=e;do{if((t.flags&32768)!==0){Hp(t,Xs);return}e=t.return;var i=kC(t.alternate,t,ps);if(i!==null){Z=i;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Be===0&&(Be=5)}function Hp(e,t){do{var i=OC(e.alternate,e);if(i!==null){i.flags&=32767,Z=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=i}while(e!==null);Be=6,Z=null}function Iv(e,t,i,s,r,n,l,a,o,h,c,u){e.cancelPendingCommit=null;do qh();while(Te!==0);if((re&6)!==0)throw Error(D(327));if(t!==null){if(t===e.current)throw Error(D(177));e===fe&&(Z=fe=null,ee=0),Kr=t,Ri=e,ji=i,Ad=r,Ap=s,WC(e,t,i,l,a,o,u)}}function WC(e,t,i,s,r,n,l){var a=t.lanes|t.childLanes;if(Ld=a,a|=rf,gw(e,i,a,s,r,n),In=null,(i&335544064)===i?(Fn=mC(e),s=10262):(Fn=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,$C(Jo,function(){return kd(),null})):(e.callbackNode=null,e.callbackPriority=0),gh=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null,r=ne.p,ne.p=2,n=re,re|=4;try{NC(e,t,i)}finally{re=n,ne.p=r,q.T=s}}Te=1,gh?Pn=f3(l,e.containerInfo,Fn,Dd,Rd,YC,Bd,kd,VC,null,null):(Dd(),Rd(),Bd())}function VC(e){if(Te!==0){var t=Ri.onRecoverableError;t(e,{componentStack:null})}}function YC(){Te===3&&(Te=0,wp(Kr,Ri),Te=4)}function Dd(){if(Te===1){Te=0;var e=Ri,t=Kr,i=ji,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var r=ne.p;ne.p=2;var n=re;re|=4;try{zl=vh=!1,yp(t,e,i),i=Hd;var l=Qm(e.containerInfo),a=i.focusedElem,o=i.selectionRange;if(l!==a&&a&&a.ownerDocument&&Zm(a.ownerDocument.documentElement,a)){if(o!==null&&sf(a)){var h=o.start,c=o.end;if(c===void 0&&(c=h),"selectionStart"in a)a.selectionStart=h,a.selectionEnd=Math.min(c,a.value.length);else{var u=a.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var f=d.getSelection(),_=a.textContent.length,y=Math.min(o.start,_),M=o.end===void 0?y:Math.min(o.end,_);!f.extend&&y>M&&(l=M,M=y,y=l);var m=iv(a,y),v=iv(a,M);if(m&&v&&(f.rangeCount!==1||f.anchorNode!==m.node||f.anchorOffset!==m.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var S=u.createRange();S.setStart(m.node,m.offset),f.removeAllRanges(),y>M?(f.addRange(S),f.extend(v.node,v.offset)):(S.setEnd(v.node,v.offset),f.addRange(S))}}}}for(u=[],f=a;f=f.parentNode;)f.nodeType===1&&u.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<u.length;a++){var g=u[a];g.element.scrollLeft=g.left,g.element.scrollTop=g.top}}Jn=!!zd,Hd=zd=null}finally{re=n,ne.p=r,q.T=s}}e.current=t,Te=2}}function Rd(){if(Te===2){Te=0;var e=Ri,t=Kr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=q.T,q.T=null;var s=ne.p;ne.p=2;var r=re;re|=4;try{_p(e,t.alternate,t)}finally{re=r,ne.p=s,q.T=i}}Te=3}}function Bd(){if(Te===4||Te===3){Te=0;var e=Pn;Pn=null,lw();var t=Ri,i=Kr,s=ji,r=Ap,n=(s&335544064)===s?10262:10256;if((i.subtreeFlags&n)!==0||(i.flags&n)!==0?Te=5:(Te=0,Kr=Ri=null,Up(t,t.pendingLanes)),n=t.pendingLanes,n===0&&(nr=null),Xd(s),i=i.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(fa,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=q.T,n=ne.p,ne.p=2,q.T=null;try{for(var l=t.onRecoverableError,a=0;a<r.length;a++){var o=r[a];l(o.value,{componentStack:o.stack})}}finally{q.T=i,ne.p=n}}if(r=In,l=Fn,Fn=null,r!==null&&(In=null,l===null&&(l=[]),e!==null))for(o=0;o<r.length;o++)i=(0,r[o])(l),i!==void 0&&e.finished.finally(i);(ji&3)!==0&&qh(),Zi(t),n=t.pendingLanes,(s&261930)!==0&&(n&42)!==0?t===Vo?$l++:($l=0,Vo=t):($l=0,Vo=null),ba(0,!1)}}function Up(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,pa(t)))}function qh(){return Pn!==null&&(Pn.skipTransition(),Pn=null),Dd(),Rd(),Bd(),kd()}function kd(){if(Te!==5)return!1;var e=Ri,t=Ld;Ld=0;var i=Xd(ji),s=q.T,r=ne.p;try{ne.p=32>i?32:i,q.T=null,i=Ad,Ad=null;var n=Ri,l=ji;if(Te=0,Kr=Ri=null,ji=0,(re&6)!==0)throw Error(D(331));var a=re;if(re|=4,Tp(n.current),Cp(n,n.current,l,i),re=a,ba(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(fa,n)}catch{}return!0}finally{ne.p=r,q.T=s,Up(e,t)}}function Fv(e,t,i){t=vi(i,t),t=dd(e.stateNode,t,2),e=ir(e,t,2),e!==null&&(ga(e,2),Zi(e))}function ce(e,t,i){if(e.tag===3)Fv(e,e,i);else for(;t!==null;){if(t.tag===3){Fv(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(nr===null||!nr.has(s))){e=vi(i,e),i=J1(2),s=ir(t,i,2),s!==null&&(ep(i,s,t,e),ga(s,2),Zi(s));break}}t=t.return}}function Lu(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new UC;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(Of=!0,r.add(i),e=GC.bind(null,e,t,i),t.then(e,e))}function GC(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,fe===e&&(ee&i)===i&&((Be===4||Be===3&&(ee&62914560)===ee&&300>Qt()-Ph)&&(re&2)===0?jn(e,0):mh|=i,Gn===ee&&(Gn=0)),Zi(e)}function Pp(e,t){t===0&&(t=Am()),e=Zr(e,t),e!==null&&(ga(e,t),Zi(e))}function KC(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Pp(e,i)}function jC(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(D(314))}s!==null&&s.delete(t),Pp(e,i)}function $C(e,t){return jd(e,t)}var $n=null,Sn=null,Od=!1,bh=!1,Au=!1,Qs=0;function Zi(e){e!==Sn&&e.next===null&&(Sn===null?$n=Sn=e:Sn=Sn.next=e),bh=!0,Od||(Od=!0,ZC())}function ba(e,t){if(!Au&&bh){Au=!0;do for(var i=!1,s=$n;s!==null;){if(!t)if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var l=s.suspendedLanes,a=s.pingedLanes;n=(1<<31-ei(42|e)+1)-1,n&=r&~(l&~a),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,qv(s,n))}else n=ee,n=Eh(s,s===fe?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||_a(s,n)||(i=!0,qv(s,n));s=s.next}while(i);Au=!1}}function XC(){Ip()}function Ip(){bh=Od=!1;var e=0;Qs!==0&&l3()&&(e=Qs);for(var t=Qt(),i=null,s=$n;s!==null;){var r=s.next,n=Fp(s,t);n===0?(s.next=null,i===null?$n=r:i.next=r,r===null&&(Sn=i)):(i=s,(e!==0||(n&3)!==0)&&(bh=!0)),s=r}Te!==0&&Te!==5||ba(e,!1),Qs!==0&&(Qs=0)}function Fp(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var l=31-ei(n),a=1<<l,o=r[l];o===-1?((a&i)===0||(a&s)!==0)&&(r[l]=_w(a,t)):o<=t&&(e.expiredLanes|=a),n&=~a}if(t=fe,i=ee,i=Eh(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(oe===2||oe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&au(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||_a(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&au(s),Xd(i)){case 2:case 8:i=Tm;break;case 32:i=Jo;break;case 268435456:i=Mm;break;default:i=Jo}return s=qp.bind(null,e),i=jd(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&au(s),e.callbackPriority=2,e.callbackNode=null,2}function qp(e,t){if(Te!==0&&Te!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(qh()&&e.callbackNode!==i)return null;var s=ee;return s=Eh(e,e===fe?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Rp(e,s,t),Fp(e,Qt()),e.callbackNode!=null&&e.callbackNode===i?qp.bind(null,e):null)}function qv(e,t){if(qh())return null;Rp(e,t,!0)}function ZC(){o3(function(){(re&6)!==0?jd(Em,XC):Ip()})}function zf(){if(Qs===0){var e=Wr;e===0&&(e=co,co<<=1,(co&261888)===0&&(co=256)),Qs=e}return Qs}function Wv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bo(e)}function QC(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=Wv((r[Wt]||null).action),l=s.submitter;l&&(t=(t=l[Wt]||null)?Wv(t.formAction):l.getAttribute("formAction"),t!==null&&(n=t,l=null));var a=new Mh("action","action",null,s,r);e.push({event:a,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Qs!==0){var o=new FormData(r,l);cd(i,{pending:!0,data:o,method:r.method,action:n},null,o)}}else typeof n=="function"&&(a.preventDefault(),o=new FormData(r,l),cd(i,{pending:!0,data:o,method:r.method,action:n},n,o))},currentTarget:r}]})}}for(To=0;To<Ju.length;To++)Mo=Ju[To],Vv=Mo.toLowerCase(),Yv=Mo[0].toUpperCase()+Mo.slice(1),Bi(Vv,"on"+Yv);var Mo,Vv,Yv,To;Bi(e1,"onAnimationEnd");Bi(t1,"onAnimationIteration");Bi(i1,"onAnimationStart");Bi("dblclick","onDoubleClick");Bi("focusin","onFocus");Bi("focusout","onBlur");Bi(hC,"onTransitionRun");Bi(cC,"onTransitionStart");Bi(uC,"onTransitionCancel");Bi(s1,"onTransitionEnd");Wn("onMouseEnter",["mouseout","mouseover"]);Wn("onMouseLeave",["mouseout","mouseover"]);Wn("onPointerEnter",["pointerout","pointerover"]);Wn("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var na="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(" "),JC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(na));function Wp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var l=s.length-1;0<=l;l--){var a=s[l],o=a.instance,h=a.currentTarget;if(a=a.listener,o!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=h;try{n(r)}catch(c){th(c)}r.currentTarget=null,n=o}else for(l=0;l<s.length;l++){if(a=s[l],o=a.instance,h=a.currentTarget,a=a.listener,o!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=h;try{n(r)}catch(c){th(c)}r.currentTarget=null,n=o}}}}function X(e,t){var i=t[Pg];i===void 0&&(i=t[Pg]=new Set);var s=e+"__bubble";i.has(s)||(Vp(t,e,2,!1),i.add(s))}function Du(e,t,i){var s=0;t&&(s|=4),Vp(i,e,s,t)}var Lo="_reactListening"+Math.random().toString(36).slice(2);function Hf(e){if(!e[Lo]){e[Lo]=!0,Nm.forEach(function(i){i!=="selectionchange"&&(JC.has(i)||Du(i,!1,e),Du(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Lo]||(t[Lo]=!0,Du("selectionchange",!1,t))}}function Vp(e,t,i,s){switch(_S(t)){case 2:var r=Y3;break;case 8:r=G3;break;default:r=Vf}i=r.bind(null,t,i,e),r=void 0,!$u||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function Ru(e,t,i,s,r){var n=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var l=s.tag;if(l===3||l===4){var a=s.stateNode.containerInfo;if(a===r)break;if(l===4)for(l=s.return;l!==null;){var o=l.tag;if((o===3||o===4)&&l.stateNode.containerInfo===r)return;l=l.return}for(;a!==null;){if(l=kr(a),l===null)return;if(o=l.tag,o===5||o===6||o===26||o===27){s=n=l;continue e}a=a.parentNode}}s=s.return}Wm(function(){var h=n,c=Qd(i),u=[];e:{var d=r1.get(e);if(d!==void 0){var f=Mh,_=e;switch(e){case"keypress":if(Oo(i)===0)break e;case"keydown":case"keyup":f=Pw;break;case"focusin":_="focus",f=fu;break;case"focusout":_="blur",f=fu;break;case"beforeblur":case"afterblur":f=fu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=Kg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Vw;break;case e1:case t1:case i1:f=Dw;break;case s1:f=Gw;break;case"scroll":case"scrollend":f=Ew;break;case"wheel":f=jw;break;case"copy":case"cut":case"paste":f=Bw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=$g;break;case"submit":f=qw;break;case"toggle":case"beforetoggle":f=Xw}var y=(t&4)!==0,M=!y&&(e==="scroll"||e==="scrollend"),m=y?d!==null?d+"Capture":null:d;y=[];for(var v=h,S;v!==null;){var g=v;if(S=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||S===null||m===null||(g=Zl(v,m),g!=null&&y.push(la(v,g,S))),M)break;v=v.return}0<y.length&&(d=new f(d,_,null,i,c),u.push({event:d,listeners:y}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",f&&i!==ju&&(_=i.relatedTarget||i.fromElement)&&(kr(_)||_[tl]))break e;(d||f)&&(_=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,d?(f=i.relatedTarget||i.toElement,d=h,f=f?kr(f):null,f!==null&&(M=da(f),y=f.tag,f!==M||y!==5&&y!==27&&y!==6)&&(f=null)):(d=null,f=h),d!==f&&(y=Kg,g="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(y=$g,g="onPointerLeave",m="onPointerEnter",v="pointer"),M=d==null?_:Ol(d),S=f==null?_:Ol(f),_=new y(g,v+"leave",d,i,c),_.target=M,_.relatedTarget=S,g=null,kr(c)===h&&(y=new y(m,v+"enter",f,i,c),y.target=S,y.relatedTarget=M,g=y),M=g,y=d&&f?zu(d,f,e3):null,d!==null&&Gv(u,_,d,y,!1),f!==null&&M!==null&&Gv(u,M,f,y,!0)))}e:{if(d=h?Ol(h):window,f=d.nodeName&&d.nodeName.toLowerCase(),f==="select"||f==="input"&&d.type==="file")var T=Jg;else if(Qg(d))if($m)T=lC;else{T=rC;var L=sC}else f=d.nodeName,!f||f.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?h&&Zd(h.elementType)&&(T=Jg):T=nC;if(T&&(T=T(e,h))){jm(u,T,i,c);break e}L&&L(e,d,h)}switch(L=h?Ol(h):window,e){case"focusin":(Qg(L)||L.contentEditable==="true")&&(En=L,Zu=h,Pl=null);break;case"focusout":Pl=Zu=En=null;break;case"mousedown":Qu=!0;break;case"contextmenu":case"mouseup":case"dragend":Qu=!1,sv(u,i,c);break;case"selectionchange":if(oC)break;case"keydown":case"keyup":sv(u,i,c)}var B;if(tf)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else xn?Gm(e,i)&&(O="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(O="onCompositionStart");O&&(Ym&&i.locale!=="ko"&&(xn||O!=="onCompositionStart"?O==="onCompositionEnd"&&xn&&(B=Vm()):(js=c,Jd="value"in js?js.value:js.textContent,xn=!0)),L=wh(h,O),0<L.length&&(O=new jg(O,e,null,i,c),u.push({event:O,listeners:L}),B?O.data=B:(B=Km(i),B!==null&&(O.data=B)))),(B=Qw?Jw(e,i):eC(e,i))&&(O=wh(h,"onBeforeInput"),0<O.length&&(L=new jg("onBeforeInput","beforeinput",null,i,c),u.push({event:L,listeners:O}),L.data=B)),QC(u,e,h,i,c)}Wp(u,t)})}function la(e,t,i){return{instance:e,listener:t,currentTarget:i}}function wh(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=Zl(e,i),r!=null&&s.unshift(la(e,r,n)),r=Zl(e,t),r!=null&&s.push(la(e,r,n))),e.tag===3)return s;e=e.return}return[]}function e3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gv(e,t,i,s,r){for(var n=t._reactName,l=[];i!==null&&i!==s;){var a=i,o=a.alternate,h=a.stateNode;if(a=a.tag,o!==null&&o===s)break;a!==5&&a!==26&&a!==27||h===null||(o=h,r?(h=Zl(i,n),h!=null&&l.unshift(la(i,h,o))):r||(h=Zl(i,n),h!=null&&l.push(la(i,h,o)))),i=i.return}l.length!==0&&e.push({event:t,listeners:l})}var t3=/\r\n?/g,i3=/\u0000|\uFFFD/g;function Kv(e){return(typeof e=="string"?e:""+e).replace(t3,`
10
+ `).replace(i3,"")}function Yp(e,t){return t=Kv(t),Kv(e)===t}function he(e,t,i,s,r,n){switch(i){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||Vn(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&Vn(e,""+s);else return;break;case"className":_o(e,"class",s);break;case"tabIndex":_o(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":_o(e,i,s);break;case"style":qm(e,s,n);return;case"data":if(t!=="object"){_o(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Bo(s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 n=="function"&&(i==="formAction"?(t!=="input"&&he(e,t,"name",r.name,r,null),he(e,t,"formEncType",r.formEncType,r,null),he(e,t,"formMethod",r.formMethod,r,null),he(e,t,"formTarget",r.formTarget,r,null)):(he(e,t,"encType",r.encType,r,null),he(e,t,"method",r.method,r,null),he(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Bo(s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Vi);return;case"onScroll":s!=null&&X("scroll",e);return;case"onScrollEnd":s!=null&&X("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(D(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(D(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Bo(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":X("beforetoggle",e),X("toggle",e),Ro(e,"popover",s);break;case"xlinkActuate":as(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":as(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":as(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":as(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":as(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":as(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":as(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":as(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":as(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ro(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=Cw.get(i)||i,Ro(e,i,s);else return}se=!0}function Nd(e,t,i,s,r,n){switch(i){case"style":qm(e,s,n);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(D(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(D(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof s=="string")Vn(e,s);else if(typeof s=="number"||typeof s=="bigint")Vn(e,""+s);else return;break;case"onScroll":s!=null&&X("scroll",e);return;case"onScrollEnd":s!=null&&X("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Vi);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!zm.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),n=i.slice(2,r?i.length-7:void 0),t=e[Wt]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(n,t,r),typeof s=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,s,r);break e}se=!0,i in e?e[i]=s:s===!0?e.setAttribute(i,""):Ro(e,i,s)}return}se=!0}function mt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":X("error",e),X("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];if(l!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:he(e,t,n,l,i,null)}}r&&he(e,t,"srcSet",i.srcSet,i,null),s&&he(e,t,"src",i.src,i,null);return;case"input":X("invalid",e);var a=n=l=r=null,o=null,h=null;for(s in i)if(i.hasOwnProperty(s)){var c=i[s];if(c!=null)switch(s){case"name":r=c;break;case"type":l=c;break;case"checked":o=c;break;case"defaultChecked":h=c;break;case"value":n=c;break;case"defaultValue":a=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(D(137,t));break;default:he(e,t,s,c,i,null)}}Pm(e,n,a,o,h,l,r,!1);return;case"select":X("invalid",e),s=l=n=null;for(r in i)if(i.hasOwnProperty(r)&&(a=i[r],a!=null))switch(r){case"value":n=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:he(e,t,r,a,i,null)}t=n,i=l,e.multiple=!!s,t!=null?kn(e,!!s,t,!1):i!=null&&kn(e,!!s,i,!0);return;case"textarea":X("invalid",e),n=r=s=null;for(l in i)if(i.hasOwnProperty(l)&&(a=i[l],a!=null))switch(l){case"value":s=a;break;case"defaultValue":r=a;break;case"children":n=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(D(91));break;default:he(e,t,l,a,i,null)}Fm(e,s,r,n);return;case"option":for(o in i)i.hasOwnProperty(o)&&(s=i[o],s!=null)&&(o==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":he(e,t,o,s,i,null));return;case"dialog":X("beforetoggle",e),X("toggle",e),X("cancel",e),X("close",e);break;case"iframe":case"object":X("load",e);break;case"video":case"audio":for(s=0;s<na.length;s++)X(na[s],e);break;case"image":X("error",e),X("load",e);break;case"details":X("toggle",e);break;case"embed":case"source":case"link":X("error",e),X("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(h in i)if(i.hasOwnProperty(h)&&(s=i[h],s!=null))switch(h){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:he(e,t,h,s,i,null)}return;default:if(Zd(t)){for(c in i)i.hasOwnProperty(c)&&(s=i[c],s!==void 0&&Nd(e,t,c,s,i,void 0));return}}for(a in i)i.hasOwnProperty(a)&&(s=i[a],s!=null&&he(e,t,a,s,i,null))}var s3={};function r3(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,n=null,l=null,a=null,o=null,h=null,c=null;for(f in i){var u=i[f];if(i.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":o=u;default:s.hasOwnProperty(f)||he(e,t,f,null,s,u)}}for(var d in s){var f=s[d];if(u=i[d],s.hasOwnProperty(d)&&(f!=null||u!=null))switch(d){case"type":f!==u&&(se=!0),n=f;break;case"name":f!==u&&(se=!0),r=f;break;case"checked":f!==u&&(se=!0),h=f;break;case"defaultChecked":f!==u&&(se=!0),c=f;break;case"value":f!==u&&(se=!0),l=f;break;case"defaultValue":f!==u&&(se=!0),a=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(D(137,t));break;default:f!==u&&he(e,t,d,f,s,u)}}Ku(e,l,a,o,h,c,n,r);return;case"select":f=l=a=d=null;for(n in i)if(o=i[n],i.hasOwnProperty(n)&&o!=null)switch(n){case"value":break;case"multiple":f=o;default:s.hasOwnProperty(n)||he(e,t,n,null,s,o)}for(r in s)if(n=s[r],o=i[r],s.hasOwnProperty(r)&&(n!=null||o!=null))switch(r){case"value":n!==o&&(se=!0),d=n;break;case"defaultValue":n!==o&&(se=!0),a=n;break;case"multiple":n!==o&&(se=!0),l=n;default:n!==o&&he(e,t,r,n,s,o)}t=a,i=l,s=f,d!=null?kn(e,!!i,d,!1):!!s!=!!i&&(t!=null?kn(e,!!i,t,!0):kn(e,!!i,i?[]:"",!1));return;case"textarea":f=d=null;for(a in i)if(r=i[a],i.hasOwnProperty(a)&&r!=null&&!s.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:he(e,t,a,null,s,r)}for(l in s)if(r=s[l],n=i[l],s.hasOwnProperty(l)&&(r!=null||n!=null))switch(l){case"value":r!==n&&(se=!0),d=r;break;case"defaultValue":r!==n&&(se=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(D(91));break;default:r!==n&&he(e,t,l,r,s,n)}Im(e,d,f);return;case"option":for(var _ in i)d=i[_],i.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_)&&(_==="selected"?e.selected=!1:he(e,t,_,null,s,d));for(o in s)d=s[o],f=i[o],s.hasOwnProperty(o)&&d!==f&&(d!=null||f!=null)&&(o==="selected"?(d!==f&&(se=!0),e.selected=d&&typeof d!="function"&&typeof d!="symbol"):he(e,t,o,d,s,f));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 y in i)d=i[y],i.hasOwnProperty(y)&&d!=null&&!s.hasOwnProperty(y)&&he(e,t,y,null,s,d);for(h in s)if(d=s[h],f=i[h],s.hasOwnProperty(h)&&d!==f&&(d!=null||f!=null))switch(h){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(D(137,t));break;default:he(e,t,h,d,s,f)}return;default:if(Zd(t)){for(var M in i)d=i[M],i.hasOwnProperty(M)&&d!==void 0&&!s.hasOwnProperty(M)&&Nd(e,t,M,void 0,s,d);for(c in s)d=s[c],f=i[c],!s.hasOwnProperty(c)||d===f||d===void 0&&f===void 0||Nd(e,t,c,d,s,f);return}}for(var m in i)d=i[m],i.hasOwnProperty(m)&&d!=null&&!s.hasOwnProperty(m)&&he(e,t,m,null,s,d);for(u in s)d=s[u],f=i[u],!s.hasOwnProperty(u)||d===f||d==null&&f==null||he(e,t,u,d,s,f)}function jv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,l=r.initiatorType,a=r.duration;if(n&&a&&jv(l)){for(l=0,a=r.responseEnd,s+=1;s<i.length;s++){var o=i[s],h=o.startTime;if(h>a)break;var c=o.transferSize,u=o.initiatorType;c&&jv(u)&&(o=o.responseEnd,l+=c*(o<a?1:(a-h)/(o-h)))}if(--s,t+=8*(n+l)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var zd=null,Hd=null;function aa(e){return e.nodeType===9?e:e.ownerDocument}function $v(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 Gp(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 Kp(e,t,i,s){return i=aa(i).createElement(e),i[ft]=s,i[Wt]=t,mt(i,e,t),tt(i),i}function Ud(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 Bu=null;function l3(){var e=window.event;return e&&e.type==="popstate"?e===Bu?!1:(Bu=e,!0):(Bu=null,!1)}var Uf=typeof setTimeout=="function"?setTimeout:void 0,a3=typeof clearTimeout=="function"?clearTimeout:void 0,Xv=typeof Promise=="function"?Promise:void 0,Zv=typeof requestAnimationFrame=="function"?requestAnimationFrame:Uf,o3=typeof queueMicrotask=="function"?queueMicrotask:typeof Xv<"u"?function(e){return Xv.resolve(null).then(e).catch(h3)}:Uf;function h3(e){setTimeout(function(){throw e})}function gr(e){return e==="head"}function Qv(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),el(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Ou(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Ou(i);for(var n=i.firstChild;n;){var l=n.nextSibling,a=n.nodeName;n[va]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=l}}else i==="body"&&Ou(e.ownerDocument.body);i=r}while(i);el(t)}function Jv(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function jp(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var r=s=0;r<t.length;r++){var n=t[r];0<n.width&&0<n.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function $p(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Xp(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function Pd(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return Xp(t,i,e)}function c3(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var i=getComputedStyle(e);return Xp(t,i,e)}function u3(e){return e.documentElement.clientHeight}function d3(e){this.addEventListener("load",e),this.addEventListener("error",e)}function f3(e,t,i,s,r,n,l,a,o){var h=t.nodeType===9?t:t.ownerDocument;try{var c=h.startViewTransition({update:function(){var d=h.defaultView,f=d.navigation&&d.navigation.transition,_=h.fonts.status;s();var y=[];if(_==="loaded"&&(u3(h),h.fonts.status==="loading"&&y.push(h.fonts.ready)),_=y.length,e!==null)for(var M=e.suspenseyImages,m=0,v=0;v<M.length;v++){var S=M[v];if(!S.complete){var g=S.getBoundingClientRect();if(0<g.bottom&&0<g.right&&g.top<d.innerHeight&&g.left<d.innerWidth){if(m+=oS(S),m>Ko){y.length=_;break}S=new Promise(d3.bind(S)),y.push(S)}}}if(0<y.length)return d=Promise.race([Promise.all(y),new Promise(function(T){return setTimeout(T,500)})]).then(r,r),(f?Promise.allSettled([f.finished,d]):d).then(n,n);if(r(),f)return f.finished.then(n,n);n()},types:i});h.__reactViewTransition=c;var u=[];return c.ready.then(function(){for(var d=h.documentElement.getAnimations({subtree:!0}),f=0;f<d.length;f++){var _=d[f],y=_.effect,M=y.pseudoElement;if(M!=null&&M.startsWith("::view-transition")){u.push(_),_=y.getKeyframes();for(var m=M=void 0,v=!0,S=0;S<_.length;S++){var g=_[S],T=g.width;if(M===void 0)M=T;else if(M!==T){v=!1;break}if(T=g.height,m===void 0)m=T;else if(m!==T){v=!1;break}delete g.width,delete g.height,g.transform==="none"&&delete g.transform}v&&M!==void 0&&m!==void 0&&(y.setKeyframes(_),v=getComputedStyle(y.target,y.pseudoElement),v.width!==M||v.height!==m)&&(v=_[0],v.width=M,v.height=m,v=_[_.length-1],v.width=M,v.height=m,y.setKeyframes(_))}}l()},function(d){h.__reactViewTransition===c&&(h.__reactViewTransition=null);try{typeof d=="object"&&d!==null&&d.name==="InvalidStateError"&&(d.message==="View transition was skipped because document visibility state is hidden."||d.message==="Skipping view transition because document visibility state has become hidden."||d.message==="Skipping view transition because viewport size changed."||d.message==="Transition was aborted because of invalid state")&&(d=null),d!==null&&o(d)}finally{s(),r(),l()}}),c.finished.finally(function(){for(var d=0;d<u.length;d++)u[d].cancel();h.__reactViewTransition===c&&(h.__reactViewTransition=null),a()}),c}catch{return s(),r(),l(),null}}function Or(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Or.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:_e({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};Or.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),s=[],r=0;r<i.length;r++){var n=i[r].effect;n!==null&&n.target===e&&n.pseudoElement===t&&s.push(i[r])}return s};Or.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Zp(e){return{name:e,group:new Or("group",e),imagePair:new Or("image-pair",e),old:new Or("old",e),new:new Or("new",e)}}function si(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}si.prototype.addEventListener=function(e,t,i){var s=null,r=null;if(!(i!=null&&typeof i!="boolean"&&(s=i.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var n=this._eventListeners;if(Qp(n,e,t,i)===-1){var l=this,a=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(a=function(o){l.removeEventListener(e,t,i),typeof t=="function"?t.call(this,o):t.handleEvent(o)}),s!==null&&(r=l.removeEventListener.bind(l,e,t,i),s.addEventListener("abort",r,{once:!0}),r=s.removeEventListener.bind(s,"abort",r)),s=Xn(i),n.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:a,cleanup:r}),qt(this._fragmentFiber.child,!1,_3,e,a,s)}this._eventListeners=n}};function _3(e,t,i,s){return Ke(e).addEventListener(t,i,s),!1}si.prototype.removeEventListener=function(e,t,i){var s=this._eventListeners;if(s!==null&&(t=Qp(s,e,t,i),t!==-1)){var r=s[t];i=r.attachedListener;var n=r.cleanup;r=Xn(r.optionsOrUseCapture),qt(this._fragmentFiber.child,!1,g3,e,i,r),s.splice(t,1),n!==null&&n()}};function g3(e,t,i,s){return Ke(e).removeEventListener(t,i,s),!1}function Xn(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function em(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Qp(e,t,i,s){if(e.length===0)return-1;s=em(s);for(var r=0;r<e.length;r++){var n=e[r];if(n.type===t&&n.listener===i&&em(n.optionsOrUseCapture)===s)return r}return-1}si.prototype.dispatchEvent=function(e){var t=jr(this._fragmentFiber);if(t===null)return!0;t=Ke(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var r=0;r<i.length;r++){var n=i[r];s.addEventListener(n.type,n.attachedListener,Xn(n.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),i)for(r=0;r<i.length;r++)n=i[r],s.removeEventListener(n.type,n.attachedListener,Xn(n.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};si.prototype.focus=function(e){qt(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag===6?!1:(e=Ke(e),M3(e,t))}si.prototype.focusLast=function(e){var t=[];qt(this._fragmentFiber.child,!0,Pf,t,void 0,void 0);for(var i=t.length-1;0<=i&&!Jp(t[i],e);i--);};function Pf(e,t){return t.push(e),!1}si.prototype.blur=function(){var e=jr(this._fragmentFiber);e!==null&&(e=Ke(e),e=aa(e).activeElement,e!==null&&qt(this._fragmentFiber.child,!1,v3,e,void 0,void 0))};function v3(e,t){return e.tag===6?!1:(e=Ke(e),e===t||e.contains(t)?(t.blur(),!0):!1)}si.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),qt(this._fragmentFiber.child,!1,m3,e,void 0,void 0)};function m3(e,t){return e.tag===6||(e=Ke(e),t.observe(e)),!1}si.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),qt(this._fragmentFiber.child,!1,p3,e,void 0,void 0);for(var i=t=0;i<Di.length;i++){var s=Di[i];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):Di[t++]=s}Di.length=t}};function p3(e,t){return e.tag===6||(e=Ke(e),t.unobserve(e)),!1}var Di=[],ku=!1;function S3(e,t,i){Di.push({fragmentInstance:e,observer:t,instance:i}),ku||(ku=!0,L3(function(){ku=!1;var s=Di;Di=[];for(var r=0;r<s.length;r++){var n=s[r];n.observer.unobserve(n.instance)}}))}si.prototype.getClientRects=function(){var e=[];return qt(this._fragmentFiber.child,!1,y3,e,void 0,void 0),e};function y3(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=Ke(e),t.push.apply(t,e.getClientRects());return!1}si.prototype.getRootNode=function(e){var t=jr(this._fragmentFiber);return t===null?this:Ke(t).getRootNode(e)};si.prototype.compareDocumentPosition=function(e){var t=jr(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];qt(this._fragmentFiber.child,!1,Pf,i,void 0,void 0);var s=Ke(t);if(i.length===0){if(i=s,kg(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var r=s=i.compareDocumentPosition(e);return i===e?r=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=bm(t)[1],i===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=Ke(i).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Ke(i[0]),r=Ke(i[i.length-1]);var n=kg(this._fragmentFiber)?t.parentElement:s;if(n==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,n=n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var l=t.compareDocumentPosition(e),a=r.compareDocumentPosition(e),o=l&Node.DOCUMENT_POSITION_CONTAINED_BY||a&Node.DOCUMENT_POSITION_CONTAINED_BY;return a=s&&n&&l&Node.DOCUMENT_POSITION_FOLLOWING&&a&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||n&&r===e||o||a?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!n&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:l,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||b3(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function b3(e,t,i,s,r){var n=kr(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!n)e:{for(;n!==null;){if(n.tag===7&&(n===t||n.alternate===t)){i=!0;break e}n=n.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(n===null)return n=r.ownerDocument,r===n||r===n.documentElement||r===n.body;e:{for(n=t,t=jr(t);n!==null;){if(!(n.tag!==5&&n.tag!==3&&n.tag!==27||n!==t&&n.alternate!==t)){n=!0;break e}n=n.return}n=!1}return n}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!n)&&!(t=n===i)&&(t=zu(i,n,Og),t===null?t=!1:(qt(t,!0,Z5,n,i),n=yn,yn=null,t=n!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!n)&&!(t=n===s)&&(t=zu(s,n,Og),t===null?t=!1:(qt(t,!0,Q5,n,s),n=yn,Nu=yn=null,t=n!==null)),t):!1}function tm(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}si.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(D(566));var t=[];qt(this._fragmentFiber.child,!1,Pf,t,void 0,void 0);var i=e!==!1;if(t.length===0){var s=bm(this._fragmentFiber);if(s=i?s[1]||s[0]||jr(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=Ke(s),tm(e,i);return}if(s=Ke(s),s.nodeType!==9){if(s.nodeType===11){i="host"in s?s.host:null,i!==null&&i.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=i?t.length-1:0;s!==(i?-1:t.length);){var r=t[s];r.tag===6?(r=Ke(r),tm(r,i)):Ke(r).scrollIntoView(e),s+=i?-1:1}};function w3(e,t){return e=Ke(e),eS(e,t),!1}function eS(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function tS(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.addEventListener(r.type,r.attachedListener,Xn(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){for(var l=0,a=0;a<Di.length;a++){var o=Di[a];(o.fragmentInstance!==t||o.observer!==n||o.instance!==e)&&(Di[l++]=o)}Di.length=l,n.observe(e)}),eS(e,t))}function C3(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.removeEventListener(r.type,r.attachedListener,Xn(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){typeof n.rootMargin=="string"?S3(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Id(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Id(i),Th(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function x3(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=pi(e.nextSibling),e===null)break}return null}function E3(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=pi(e.nextSibling),e===null))return null;return e}function iS(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=pi(e.nextSibling),e===null))return null;return e}function Fd(e){return e.data==="$?"||e.data==="$~"}function If(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function T3(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function pi(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 qd=null;function im(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return pi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function sm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function M3(e,t){function i(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return s}function L3(e){Zv(function(){Zv(function(t){return e(t)})})}function sS(e,t,i){switch(t=aa(i),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 rS(e,t,i){for(var s in i){var r=i[s];i.hasOwnProperty(s)&&r!=null&&he(e,t,s,null,s3,r)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Vi&&(e.onclick=null),Th(e)}function Ou(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Th(e)}var Si=new Map,rm=new Set;function oa(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var bs=ne.d;ne.d={f:A3,r:D3,D:R3,C:B3,L:k3,m:O3,X:z3,S:N3,M:H3};function A3(){var e=bs.f(),t=Ih();return e||t}function D3(e){var t=il(e);t!==null&&t.tag===5&&t.type==="form"?q1(t):bs.r(e)}var ll=typeof document>"u"?null:document;function nS(e,t,i){var s=ll;if(s&&typeof t=="string"&&t){var r=gi(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),rm.has(r)||(rm.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),mt(t,"link",e),tt(t),s.head.appendChild(t)))}}function R3(e){bs.D(e),nS("dns-prefetch",e,null)}function B3(e,t){bs.C(e,t),nS("preconnect",e,t)}function k3(e,t,i){bs.L(e,t,i);var s=ll;if(s&&e&&t){var r='link[rel="preload"][as="'+gi(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+gi(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+gi(i.imageSizes)+'"]')):r+='[href="'+gi(e)+'"]';var n=r;switch(t){case"style":n=Zn(e);break;case"script":n=al(e)}if(!(Si.has(n)||(e=_e({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Si.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(wa(n))||t==="script"&&s.querySelector(Ca(n))))){var l=s.createElement("link");mt(l,"link",e),t==="style"&&(l[eh]=!0,l.onload=l.onerror=function(){Om(l)}),tt(l),s.head.appendChild(l)}}}function O3(e,t){bs.m(e,t);var i=ll;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+gi(s)+'"][href="'+gi(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=al(e)}if(!Si.has(n)&&(e=_e({rel:"modulepreload",href:e},t),Si.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ca(n)))return}s=i.createElement("link"),mt(s,"link",e),tt(s),i.head.appendChild(s)}}}function N3(e,t,i){bs.S(e,t,i);var s=ll;if(s&&e){var r=Bn(s).hoistableStyles,n=Zn(e);t=t||"default";var l=r.get(n);if(!l){var a={loading:0,preload:null};if(l=s.querySelector(wa(n)))a.loading=5;else{e=_e({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Si.get(n))&&Ff(e,i);var o=l=s.createElement("link");tt(o),mt(o,"link",e),o._p=new Promise(function(h,c){o.onload=h,o.onerror=c}),o.addEventListener("load",function(){a.loading|=1}),o.addEventListener("error",function(){a.loading|=2}),a.loading|=4,Yo(l,t,s)}l={type:"stylesheet",instance:l,count:1,state:a},r.set(n,l)}}}function z3(e,t){bs.X(e,t);var i=ll;if(i&&e){var s=Bn(i).hoistableScripts,r=al(e),n=s.get(r);n||(n=i.querySelector(Ca(r)),n||(e=_e({src:e,async:!0},t),(t=Si.get(r))&&qf(e,t),n=i.createElement("script"),tt(n),mt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function H3(e,t){bs.M(e,t);var i=ll;if(i&&e){var s=Bn(i).hoistableScripts,r=al(e),n=s.get(r);n||(n=i.querySelector(Ca(r)),n||(e=_e({src:e,async:!0,type:"module"},t),(t=Si.get(r))&&qf(e,t),n=i.createElement("script"),tt(n),mt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function nm(e,t,i,s){var r=(r=Js.current)?oa(r):null;if(!r)throw Error(D(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=Zn(i.href),t=Bn(r).hoistableStyles,s=t.get(i),s||(s={type:"style",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Zn(i.href);var n=Bn(r).hoistableStyles,l=n.get(e);if(l||(r=r.ownerDocument||r,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,l),(n=r.querySelector(wa(e)))?n._p||(l.instance=n,l.state.loading=5):(n=Si.get(e),n||(n={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Si.set(e,n)),U3(r,e,n,l.state))),t&&s===null)throw Error(D(528,""));return l}if(t&&s!==null)throw Error(D(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=al(i),t=Bn(r).hoistableScripts,s=t.get(i),s||(s={type:"script",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,e))}}function Zn(e){return'href="'+gi(e)+'"'}function wa(e){return'link[rel="stylesheet"]['+e+"]"}function lS(e){return _e({},e,{"data-precedence":e.precedence,precedence:null})}function U3(e,t,i,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[eh]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[eh]=!0,t.onload=t.onerror=Om.bind(null,t),mt(t,"link",i),tt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function al(e){return'[src="'+gi(e)+'"]'}function Ca(e){return"script[async]"+e}function lm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+gi(i.href)+'"]');if(s)return t.instance=s,tt(s),s;var r=_e({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),tt(s),mt(s,"style",r),Yo(s,i.precedence,e),t.instance=s;case"stylesheet":r=Zn(i.href);var n=e.querySelector(wa(r));if(n)return t.state.loading|=4,t.instance=n,tt(n),n;s=lS(i),(r=Si.get(r))&&Ff(s,r),n=(e.ownerDocument||e).createElement("link"),tt(n);var l=n;return l._p=new Promise(function(a,o){l.onload=a,l.onerror=o}),mt(n,"link",s),t.state.loading|=4,Yo(n,i.precedence,e),t.instance=n;case"script":return n=al(i.src),(r=e.querySelector(Ca(n)))?(t.instance=r,tt(r),r):(s=i,(r=Si.get(n))&&(s=_e({},i),qf(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),tt(r),mt(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(D(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Yo(s,i.precedence,e));return t.instance}function Yo(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,l=0;l<s.length;l++){var a=s[l];if(a.dataset.precedence===t)n=a;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ff(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function qf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Go=null;function am(e,t,i){if(Go===null){var s=new Map,r=Go=new Map;r.set(i,s)}else r=Go,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[va]||n[ft]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var l=n.getAttribute(t)||"";l=e+l;var a=s.get(l);a?a.push(n):s.set(l,[n])}}return s}function Wd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function P3(e,t,i){if(i===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 om(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function aS(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function oS(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function hm(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=oS(t),e.suspenseyImages.push(t)),e=q3.bind(e),t.decode().then(e,e))}function I3(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=Zn(s.href),n=t.querySelector(wa(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ha.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,tt(n);return}n=t.ownerDocument||t,s=lS(s),(r=Si.get(r))&&Ff(s,r),n=n.createElement("link"),tt(n);var l=n;l._p=new Promise(function(a,o){l.onload=a,l.onerror=o}),mt(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ha.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Ko=0;function F3(e,t){return e.stylesheets&&e.count===0&&jo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Ko===0&&(Ko=62500*n3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Ko?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function hS(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)jo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ha(){this.count--,hS(this)}function q3(){this.imgCount--,hS(this)}var Ch=null;function jo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ch=new Map,t.forEach(W3,e),Ch=null,ha.call(e))}function W3(e,t){if(!(t.state.loading&4)){var i=Ch.get(e);if(i)var s=i.get(null);else{i=new Map,Ch.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var l=r[n];(l.nodeName==="LINK"||l.getAttribute("media")!=="not all")&&(i.set(l.dataset.precedence,l),s=l)}s&&i.set(null,s)}r=t.instance,l=r.getAttribute("data-precedence"),n=i.get(l)||s,n===s&&i.set(null,r),i.set(l,r),this.count++,s=ha.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Qn={$$typeof:Wi,Provider:null,Consumer:null,_currentValue:Nr,_currentValue2:Nr,_threadCount:0};function V3(e,t,i,s,r,n,l,a,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=ou(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ou(0),this.hiddenUpdates=ou(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.transitionTypes=null,this.incompleteTransitions=new Map}function cS(e,t,i,s,r,n,l,a,o,h,c,u){return e=new V3(e,t,i,l,o,h,c,u,a),t=1,n===!0&&(t|=24),n=It(3,null,null,t),e.current=n,n.stateNode=e,t=of(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},uf(n),e}function uS(e){return e?(e=Ln,e):Ln}function dS(e,t,i,s,r,n){r=uS(r),s.context===null?s.context=r:s.pendingContext=r,s=tr(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=ir(e,s,t),i!==null&&(Ft(i,e,t),Fl(i,e,t))}function cm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Wf(e,t){cm(e,t),(e=e.alternate)&&cm(e,t)}function fS(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&Ft(t,e,67108864),Wf(e,67108864)}}function um(e){if(e.tag===13||e.tag===31){var t=ti();t=$d(t);var i=Zr(e,t);i!==null&&Ft(i,e,t),Wf(e,t)}}var Jn=!0;function Y3(e,t,i,s){var r=q.T;q.T=null;var n=ne.p;try{ne.p=2,Vf(e,t,i,s)}finally{ne.p=n,q.T=r}}function G3(e,t,i,s){var r=q.T;q.T=null;var n=ne.p;try{ne.p=8,Vf(e,t,i,s)}finally{ne.p=n,q.T=r}}function Vf(e,t,i,s){if(Jn){var r=Vd(s);if(r===null)Ru(e,t,s,xh,i),dm(e,s);else if(j3(r,e,t,i,s))s.stopPropagation();else if(dm(e,s),t&4&&-1<K3.indexOf(e)){for(;r!==null;){var n=il(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var l=Dr(n.pendingLanes);if(l!==0){var a=n;for(a.pendingLanes|=2,a.entangledLanes|=2;l;){var o=1<<31-ei(l);a.entanglements[1]|=o,l&=~o}Zi(n),(re&6)===0&&(ph=Qt()+500,ba(0,!1))}}break;case 31:case 13:a=Zr(n,2),a!==null&&Ft(a,n,2),Ih(),Wf(n,2)}if(n=Vd(s),n===null&&Ru(e,t,s,xh,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else Ru(e,t,s,null,i)}}function Vd(e){return e=Qd(e),Yf(e)}var xh=null;function Yf(e){if(xh=null,e=kr(e),e!==null){var t=da(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=pm(t),e!==null)return e;e=null}else if(i===31){if(e=Sm(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function _S(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(aw()){case Em:return 2;case Tm:return 8;case Jo:case ow:return 32;case Mm:return 268435456;default:return 32}default:return 32}}var Yd=!1,lr=null,ar=null,or=null,ca=new Map,ua=new Map,Gs=[],K3="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 dm(e,t){switch(e){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":ar=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ua.delete(t.pointerId)}}function Dl(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=il(t),t!==null&&fS(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function j3(e,t,i,s,r){switch(t){case"focusin":return lr=Dl(lr,e,t,i,s,r),!0;case"dragenter":return ar=Dl(ar,e,t,i,s,r),!0;case"mouseover":return or=Dl(or,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return ca.set(n,Dl(ca.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,ua.set(n,Dl(ua.get(n)||null,e,t,i,s,r)),!0}return!1}function gS(e){var t=kr(e.target);if(t!==null){var i=da(t);if(i!==null){if(t=i.tag,t===13){if(t=pm(i),t!==null){e.blockedOn=t,Ug(e.priority,function(){um(i)});return}}else if(t===31){if(t=Sm(i),t!==null){e.blockedOn=t,Ug(e.priority,function(){um(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $o(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Vd(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);ju=s,i.target.dispatchEvent(s),ju=null}else return t=il(i),t!==null&&fS(t),e.blockedOn=i,!1;t.shift()}return!0}function fm(e,t,i){$o(e)&&i.delete(t)}function $3(){Yd=!1,lr!==null&&$o(lr)&&(lr=null),ar!==null&&$o(ar)&&(ar=null),or!==null&&$o(or)&&(or=null),ca.forEach(fm),ua.forEach(fm)}function Ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Yd||(Yd=!0,je.unstable_scheduleCallback(je.unstable_NormalPriority,$3)))}var Do=null;function _m(e){Do!==e&&(Do=e,je.unstable_scheduleCallback(je.unstable_NormalPriority,function(){Do===e&&(Do=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Yf(s||i)===null)continue;break}var n=il(i);n!==null&&(e.splice(t,3),t-=3,cd(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function el(e){function t(o){return Ao(o,e)}lr!==null&&Ao(lr,e),ar!==null&&Ao(ar,e),or!==null&&Ao(or,e),ca.forEach(t),ua.forEach(t);for(var i=0;i<Gs.length;i++){var s=Gs[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Gs.length&&(i=Gs[0],i.blockedOn===null);)gS(i),i.blockedOn===null&&Gs.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],l=r[Wt]||null;if(typeof n=="function")l||_m(i);else if(l){var a=null;if(n&&n.hasAttribute("formAction")){if(r=n,l=n[Wt]||null)a=l.formAction;else if(Yf(r)!==null)continue}else a=l.action;typeof a=="function"?i[s+1]=a:(i.splice(s,3),s-=3),_m(i)}}}function vS(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(l){return r=l})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Gf(e){this._internalRoot=e}Wh.prototype.render=Gf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));var i=t.current,s=ti();dS(i,s,e,t,null,null)};Wh.prototype.unmount=Gf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dS(e.current,2,null,e,null,null),Ih(),t[tl]=null}};function Wh(e){this._internalRoot=e}Wh.prototype.unstable_scheduleHydration=function(e){if(e){var t=km();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Gs.length&&t!==0&&t<Gs[i].priority;i++);Gs.splice(i,0,e),i===0&&gS(e)}};var gm=vm.version;if(gm!=="19.3.0")throw Error(D(527,gm,"19.3.0"));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(D(188)):(e=Object.keys(e).join(","),Error(D(268,e)));return e=X5(t),e=e!==null?ym(e):null,e=e===null?null:e.stateNode,e};var X3={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Rl.isDisabled&&Rl.supportsFiber))try{fa=Rl.inject(X3),Jt=Rl}catch{}var Rl;Vh.createRoot=function(e,t){if(!mm(e))throw Error(D(299));var i=!1,s="",r=X1,n=Z1,l=Q1;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=cS(e,1,!1,null,null,i,s,null,r,n,l,vS),e[tl]=t.current,Hf(e),new Gf(t)};Vh.hydrateRoot=function(e,t,i){if(!mm(e))throw Error(D(299));var s=!1,r="",n=X1,l=Z1,a=Q1,o=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(l=i.onCaughtError),i.onRecoverableError!==void 0&&(a=i.onRecoverableError),i.formState!==void 0&&(o=i.formState)),t=cS(e,1,!0,t,i??null,s,r,o,n,l,a,vS),t.context=uS(null),i=t.current,s=ti(),s=$d(s),r=tr(s),r.callback=null,ir(i,r,s),i=s,t.current.lanes=i,ga(t,i),Zi(t),e[tl]=t.current,Hf(e),new Wh(t)};Vh.version="19.3.0"});var yS=zi((YM,SS)=>{"use strict";function pS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pS)}catch(e){console.error(e)}}pS(),SS.exports=mS()});var d5=zi(Fc=>{"use strict";var MM=Symbol.for("react.transitional.element"),LM=Symbol.for("react.fragment");function u5(e,t,i){var s=null;if(i!==void 0&&(s=""+i),t.key!==void 0&&(s=""+t.key),"key"in t){i={};for(var r in t)r!=="key"&&(i[r]=t[r])}else i=t;return t=i.ref,{$$typeof:MM,type:e,key:s,ref:t!==void 0?t:null,props:i}}Fc.Fragment=LM;Fc.jsx=u5;Fc.jsxs=u5});var j0=zi((aR,f5)=>{"use strict";f5.exports=d5()});var Ae=io(ro(),1),g5=io(yS(),1);var xy=Object.defineProperty,Z3=Object.getOwnPropertyDescriptor,Q3=(e,t)=>{for(var i in t)xy(e,i,{get:t[i],enumerable:!0})},Oe=(e,t,i,s)=>{for(var r=s>1?void 0:s?Z3(t,i):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(r=(s?l(t,i,r):l(r))||r);return s&&r&&xy(t,i,r),r},H=(e,t)=>(i,s)=>t(i,s,e),bS="Terminal input",h_={get:()=>bS,set:e=>bS=e},wS="Too much output to announce, navigate to rows manually to read",c_={get:()=>wS,set:e=>wS=e};function J3(e){return e.replace(/\r?\n/g,"\r")}function ex(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function tx(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function ix(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");Ey(r,t,i,s)}}function Ey(e,t,i,s){e=J3(e),e=ex(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Ty(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function CS(e,t,i,s,r){Ty(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function yr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function gc(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var sx=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let l=e.charCodeAt(n);if(55296<=l&&l<=56319){if(++n>=i)return this._interim=l,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(l-55296)*1024+a-56320+65536:(t[s++]=l,t[s++]=a);continue}l!==65279&&(t[s++]=l)}return s}},rx=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,l,a,o=0,h=0;if(this.interim[0]){let d=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let _=0,y;for(;(y=this.interim[++_]&63)&&_<4;)f<<=6,f|=y;let M=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,m=M-_;for(;h<m;){if(h>=i)return 0;if(y=e[h++],(y&192)!==128){h--,d=!0;break}else this.interim[_++]=y,f<<=6,f|=y&63}d||(M===2?f<128?h--:t[s++]=f:M===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let c=i-4,u=h;for(;u<i;){for(;u<c&&!((r=e[u])&128)&&!((n=e[u+1])&128)&&!((l=e[u+2])&128)&&!((a=e[u+3])&128);)t[s++]=r,t[s++]=n,t[s++]=l,t[s++]=a,u+=4;if(r=e[u++],r<128)t[s++]=r;else if((r&224)===192){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(o=(r&31)<<6|n&63,o<128){u--;continue}t[s++]=o}else if((r&240)===224){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(l=e[u++],(l&192)!==128){u--;continue}if(o=(r&15)<<12|(n&63)<<6|l&63,o<2048||o>=55296&&o<=57343||o===65279)continue;t[s++]=o}else if((r&248)===240){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(l=e[u++],(l&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=l,s;if(a=e[u++],(a&192)!==128){u--;continue}if(o=(r&7)<<18|(n&63)<<12|(l&63)<<6|a&63,o<65536||o>1114111)continue;t[s++]=o}}return s}},My="",br=" ",Wa=class Ly{constructor(){this.fg=0,this.bg=0,this.extended=new lc}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Ly;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},lc=class Ay{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Ay(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ci=class Dy extends Wa{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new lc,this.combinedData=""}static fromCharData(t){let i=new Dy;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?yr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},xS="di$target",u_="di$dependencies",Kf=new Map;function nx(e){return e[u_]||[]}function at(e){if(Kf.has(e))return Kf.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");lx(t,i,r)};return t._id=e,Kf.set(e,t),t}function lx(e,t,i){t[xS]===t?t[u_].push({id:e,index:i}):(t[u_]=[{id:e,index:i}],t[xS]=t)}var kt=at("BufferService"),Ry=at("CoreMouseService"),an=at("CoreService"),ax=at("CharsetService"),K_=at("InstantiationService"),By=at("LogService"),Ot=at("OptionsService"),ky=at("OscLinkService"),ox=at("UnicodeService"),Va=at("DecorationService"),d_=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Ci,l=i.getTrimmedLength(),a=-1,o=-1,h=!1;for(let c=0;c<l;c++)if(!(o===-1&&!i.hasContent(c))){if(i.loadCell(c,n),n.hasExtendedAttrs()&&n.extended.urlId)if(o===-1){o=c,a=n.extended.urlId;continue}else h=n.extended.urlId!==a;else o!==-1&&(h=!0);if(h||o!==-1&&c===l-1){let u=this._oscLinkService.getLinkData(a)?.uri;if(u){let d={start:{x:o+1,y:e},end:{x:c+(!h&&c===l-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let _=new URL(u);["http:","https:"].includes(_.protocol)||(f=!0)}catch{f=!0}f||s.push({text:u,range:d,activate:(_,y)=>r?r.activate(_,y,d):hx(_,y),hover:(_,y)=>r?.hover?.(_,y,d),leave:(_,y)=>r?.leave?.(_,y,d)})}h=!1,n.hasExtendedAttrs()&&n.extended.urlId?(o=c,a=n.extended.urlId):(o=-1,a=-1)}}t(s)}};d_=Oe([H(0,kt),H(1,Ot),H(2,ky)],d_);function hx(e,t){if(confirm(`Do you want to navigate to ${t}?
11
11
 
12
- WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var uh=Xe("CharSizeService"),Wi=Xe("CoreBrowserService"),Cf=Xe("MouseService"),Zi=Xe("RenderService"),sC=Xe("SelectionService"),v1=Xe("CharacterJoinerService"),yn=Xe("ThemeService"),g1=Xe("LinkProviderService"),rC=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ap.isErrorNoTelemetry(e)?new ap(e.message+`
12
+ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var vc=at("CharSizeService"),Ts=at("CoreBrowserService"),j_=at("MouseService"),Ms=at("RenderService"),cx=at("SelectionService"),Oy=at("CharacterJoinerService"),ul=at("ThemeService"),Ny=at("LinkProviderService"),ux=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ES.isErrorNoTelemetry(e)?new ES(e.message+`
13
13
 
14
14
  `+e.stack):new Error(e.message+`
15
15
 
16
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},nC=new rC;function Io(e){lC(e)||nC.onUnexpectedError(e)}var Kd="Canceled";function lC(e){return e instanceof aC?!0:e instanceof Error&&e.name===Kd&&e.message===Kd}var aC=class extends Error{constructor(){super(Kd),this.name=this.message}};function oC(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}var ap=class Vd extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Vd)return t;let i=new Vd;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Pd=class p1 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,p1.prototype)}};function hC(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let l=Math.floor((r+n)/2);t(e[l])?r=l+1:n=l}return r-1}var cC=class S1{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(S1.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=hC(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};cC.assertInvariants=!1;function zt(e,t=0){return e[e.length-(1+t)]}var y1;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(y1||={});function uC(e,t){return(i,s)=>t(e(i),e(s))}var dC=(e,t)=>e-t,op=class Gd{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new Gd(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new Gd(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||y1.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};op.empty=new op(e=>{});function fC(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var hp,cp,Xx=class{constructor(e,t){this.toKey=t,this._map=new Map,this[hp]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(cp=Symbol.iterator,hp=Symbol.toStringTag,cp)](){return this.values()}},_C=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};function mC(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}var b1;(e=>{function t(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(S){yield S}e.single=r;function n(S){return t(S)?S:r(S)}e.wrap=n;function l(S){return S||i}e.from=l;function*a(S){for(let C=S.length-1;C>=0;C--)yield S[C]}e.reverse=a;function o(S){return!S||S[Symbol.iterator]().next().done===!0}e.isEmpty=o;function h(S){return S[Symbol.iterator]().next().value}e.first=h;function u(S,C){let A=0;for(let T of S)if(C(T,A++))return!0;return!1}e.some=u;function d(S,C){for(let A of S)if(C(A))return A}e.find=d;function*c(S,C){for(let A of S)C(A)&&(yield A)}e.filter=c;function*f(S,C){let A=0;for(let T of S)yield C(T,A++)}e.map=f;function*_(S,C){let A=0;for(let T of S)yield*C(T,A++)}e.flatMap=_;function*p(...S){for(let C of S)yield*C}e.concat=p;function y(S,C,A){let T=A;for(let k of S)T=C(T,k);return T}e.reduce=y;function*m(S,C,A=S.length){for(C<0&&(C+=S.length),A<0?A+=S.length:A>S.length&&(A=S.length);C<A;C++)yield S[C]}e.slice=m;function v(S,C=Number.POSITIVE_INFINITY){let A=[];if(C===0)return[A,S];let T=S[Symbol.iterator]();for(let k=0;k<C;k++){let Z=T.next();if(Z.done)return[A,e.empty()];A.push(Z.value)}return[A,{[Symbol.iterator](){return T}}]}e.consume=v;async function g(S){let C=[];for await(let A of S)C.push(A);return Promise.resolve(C)}e.asyncToArray=g})(b1||={});var vC=!1,_r=null,gC=class w1{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:w1.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let o=new Map,h=[...this.livingDisposables.values()].filter(d=>d.source!==null&&!this.getRootParent(d,o).isSingleton);if(h.length===0)return;let u=new Set(h.map(d=>d.value));if(s=h.filter(d=>!(d.parent&&u.has(d.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(o){function h(d,c){for(;d.length>0&&c.some(f=>typeof f=="string"?f===d[0]:d[0].match(f));)d.shift()}let u=o.source.split(`
17
- `).map(d=>d.trim().replace("at ","")).filter(d=>d!=="");return h(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}let n=new _C;for(let o of s){let h=r(o);for(let u=0;u<=h.length;u++)n.add(h.slice(0,u).join(`
18
- `),o)}s.sort(uC(o=>o.idx,dC));let l="",a=0;for(let o of s.slice(0,t)){a++;let h=r(o),u=[];for(let d=0;d<h.length;d++){let c=h[d];c=`(shared with ${n.get(h.slice(0,d+1).join(`
19
- `)).size}/${s.length} leaks) at ${c}`;let f=n.get(h.slice(0,d).join(`
20
- `)),_=fC([...f].map(p=>r(p)[d]),p=>p);delete _[h[d]];for(let[p,y]of Object.entries(_))u.unshift(` - stacktraces of ${y.length} other leaks continue with ${p}`);u.unshift(c)}l+=`
16
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},dx=new ux;function Xh(e){fx(e)||dx.onUnexpectedError(e)}var f_="Canceled";function fx(e){return e instanceof _x?!0:e instanceof Error&&e.name===f_&&e.message===f_}var _x=class extends Error{constructor(){super(f_),this.name=this.message}};function gx(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}var ES=class __ extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof __)return t;let i=new __;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},g_=class zy extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,zy.prototype)}};function vx(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let l=Math.floor((r+n)/2);t(e[l])?r=l+1:n=l}return r-1}var mx=class Hy{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(Hy.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=vx(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};mx.assertInvariants=!1;function ri(e,t=0){return e[e.length-(1+t)]}var Uy;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Uy||={});function px(e,t){return(i,s)=>t(e(i),e(s))}var Sx=(e,t)=>e-t,TS=class v_{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new v_(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new v_(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||Uy.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};TS.empty=new TS(e=>{});function yx(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var MS,LS,GM=class{constructor(e,t){this.toKey=t,this._map=new Map,this[MS]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(LS=Symbol.iterator,MS=Symbol.toStringTag,LS)](){return this.values()}},bx=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};function wx(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}var Py;(e=>{function t(g){return g&&typeof g=="object"&&typeof g[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(g){yield g}e.single=r;function n(g){return t(g)?g:r(g)}e.wrap=n;function l(g){return g||i}e.from=l;function*a(g){for(let T=g.length-1;T>=0;T--)yield g[T]}e.reverse=a;function o(g){return!g||g[Symbol.iterator]().next().done===!0}e.isEmpty=o;function h(g){return g[Symbol.iterator]().next().value}e.first=h;function c(g,T){let L=0;for(let B of g)if(T(B,L++))return!0;return!1}e.some=c;function u(g,T){for(let L of g)if(T(L))return L}e.find=u;function*d(g,T){for(let L of g)T(L)&&(yield L)}e.filter=d;function*f(g,T){let L=0;for(let B of g)yield T(B,L++)}e.map=f;function*_(g,T){let L=0;for(let B of g)yield*T(B,L++)}e.flatMap=_;function*y(...g){for(let T of g)yield*T}e.concat=y;function M(g,T,L){let B=L;for(let O of g)B=T(B,O);return B}e.reduce=M;function*m(g,T,L=g.length){for(T<0&&(T+=g.length),L<0?L+=g.length:L>g.length&&(L=g.length);T<L;T++)yield g[T]}e.slice=m;function v(g,T=Number.POSITIVE_INFINITY){let L=[];if(T===0)return[L,g];let B=g[Symbol.iterator]();for(let O=0;O<T;O++){let I=B.next();if(I.done)return[L,e.empty()];L.push(I.value)}return[L,{[Symbol.iterator](){return B}}]}e.consume=v;async function S(g){let T=[];for await(let L of g)T.push(L);return Promise.resolve(T)}e.asyncToArray=S})(Py||={});var Cx=!1,rn=null,xx=class Iy{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:Iy.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let o=new Map,h=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,o).isSingleton);if(h.length===0)return;let c=new Set(h.map(u=>u.value));if(s=h.filter(u=>!(u.parent&&c.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(o){function h(u,d){for(;u.length>0&&d.some(f=>typeof f=="string"?f===u[0]:u[0].match(f));)u.shift()}let c=o.source.split(`
17
+ `).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return h(c,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),c.reverse()}let n=new bx;for(let o of s){let h=r(o);for(let c=0;c<=h.length;c++)n.add(h.slice(0,c).join(`
18
+ `),o)}s.sort(px(o=>o.idx,Sx));let l="",a=0;for(let o of s.slice(0,t)){a++;let h=r(o),c=[];for(let u=0;u<h.length;u++){let d=h[u];d=`(shared with ${n.get(h.slice(0,u+1).join(`
19
+ `)).size}/${s.length} leaks) at ${d}`;let f=n.get(h.slice(0,u).join(`
20
+ `)),_=yx([...f].map(y=>r(y)[u]),y=>y);delete _[h[u]];for(let[y,M]of Object.entries(_))c.unshift(` - stacktraces of ${M.length} other leaks continue with ${y}`);c.unshift(d)}l+=`
21
21
 
22
22
 
23
23
  ==================== Leaking disposable ${a}/${s.length}: ${o.value.constructor.name} ====================
24
- ${u.join(`
24
+ ${c.join(`
25
25
  `)}
26
26
  ============================================================
27
27
 
@@ -30,19 +30,128 @@ ${u.join(`
30
30
 
31
31
  ... and ${s.length-t} more leaking disposables
32
32
 
33
- `),{leaks:s,details:l}}};gC.idx=0;function pC(e){_r=e}if(vC){let e="__is_disposable_tracked__";pC(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Y.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Y.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function dh(e){return _r?.trackDisposable(e),e}function fh(e){_r?.markAsDisposed(e)}function Vl(e,t){_r?.setParent(e,t)}function SC(e,t){if(_r)for(let i of e)_r.setParent(i,t)}function up(e){return _r?.markAsSingleton(e),e}function mr(e){if(b1.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function yC(...e){let t=fe(()=>mr(e));return SC(e,t),t}function fe(e){let t=dh({dispose:mC(()=>{fh(t),e()})});return t}var C1=class E1{constructor(){this._toDispose=new Set,this._isDisposed=!1,dh(this)}dispose(){this._isDisposed||(fh(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{mr(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Vl(t,this),this._isDisposed?E1.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),Vl(t,null))}};C1.DISABLE_DISPOSED_WARNING=!1;var Hs=C1,Y=class{constructor(){this._store=new Hs,dh(this),Vl(this._store,this)}dispose(){fh(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Y.None=Object.freeze({dispose(){}});var Sn=class{constructor(){this._isDisposed=!1,dh(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Vl(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,fh(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Vl(e,null),e}},Ut=typeof window=="object"?window:globalThis,Id=class jd{constructor(t){this.element=t,this.next=jd.Undefined,this.prev=jd.Undefined}};Id.Undefined=new Id(void 0);var pe=Id,dp=class{constructor(){this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===pe.Undefined}clear(){let e=this._first;for(;e!==pe.Undefined;){let t=e.next;e.prev=pe.Undefined,e.next=pe.Undefined,e=t}this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new pe(e);if(this._first===pe.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==pe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==pe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==pe.Undefined&&e.next!==pe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===pe.Undefined&&e.next===pe.Undefined?(this._first=pe.Undefined,this._last=pe.Undefined):e.next===pe.Undefined?(this._last=this._last.prev,this._last.next=pe.Undefined):e.prev===pe.Undefined&&(this._first=this._first.next,this._first.prev=pe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==pe.Undefined;)yield e.element,e=e.next}},bC=globalThis.performance&&typeof globalThis.performance.now=="function",wC=class x1{static create(t){return new x1(t)}constructor(t){this._now=bC&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},CC=!1,fp=!1,EC=!1,it;(e=>{e.None=()=>Y.None;function t(M){if(EC){let{onDidAddListener:x}=M,N=Wd.create(),O=0;M.onDidAddListener=()=>{++O===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),N.print()),x?.()}}}function i(M,x){return c(M,()=>{},0,void 0,!0,void 0,x)}e.defer=i;function s(M){return(x,N=null,O)=>{let z=!1,D;return D=M(j=>{if(!z)return D?D.dispose():z=!0,x.call(N,j)},null,O),z&&D.dispose(),D}}e.once=s;function r(M,x,N){return u((O,z=null,D)=>M(j=>O.call(z,x(j)),null,D),N)}e.map=r;function n(M,x,N){return u((O,z=null,D)=>M(j=>{x(j),O.call(z,j)},null,D),N)}e.forEach=n;function l(M,x,N){return u((O,z=null,D)=>M(j=>x(j)&&O.call(z,j),null,D),N)}e.filter=l;function a(M){return M}e.signal=a;function o(...M){return(x,N=null,O)=>{let z=yC(...M.map(D=>D(j=>x.call(N,j))));return d(z,O)}}e.any=o;function h(M,x,N,O){let z=N;return r(M,D=>(z=x(z,D),z),O)}e.reduce=h;function u(M,x){let N,O={onWillAddFirstListener(){N=M(z.fire,z)},onDidRemoveLastListener(){N?.dispose()}};x||t(O);let z=new E(O);return x?.add(z),z.event}function d(M,x){return x instanceof Array?x.push(M):x&&x.add(M),M}function c(M,x,N=100,O=!1,z=!1,D,j){let ve,Fe,li,Mi=0,Ue,Qi={leakWarningThreshold:D,onWillAddFirstListener(){ve=M(Us=>{Mi++,Fe=x(Fe,Us),O&&!li&&(at.fire(Fe),Fe=void 0),Ue=()=>{let Cn=Fe;Fe=void 0,li=void 0,(!O||Mi>1)&&at.fire(Cn),Mi=0},typeof N=="number"?(clearTimeout(li),li=setTimeout(Ue,N)):li===void 0&&(li=0,queueMicrotask(Ue))})},onWillRemoveListener(){z&&Mi>0&&Ue?.()},onDidRemoveLastListener(){Ue=void 0,ve.dispose()}};j||t(Qi);let at=new E(Qi);return j?.add(at),at.event}e.debounce=c;function f(M,x=0,N){return e.debounce(M,(O,z)=>O?(O.push(z),O):[z],x,void 0,!0,void 0,N)}e.accumulate=f;function _(M,x=(O,z)=>O===z,N){let O=!0,z;return l(M,D=>{let j=O||!x(D,z);return O=!1,z=D,j},N)}e.latch=_;function p(M,x,N){return[e.filter(M,x,N),e.filter(M,O=>!x(O),N)]}e.split=p;function y(M,x=!1,N=[],O){let z=N.slice(),D=M(Fe=>{z?z.push(Fe):ve.fire(Fe)});O&&O.add(D);let j=()=>{z?.forEach(Fe=>ve.fire(Fe)),z=null},ve=new E({onWillAddFirstListener(){D||(D=M(Fe=>ve.fire(Fe)),O&&O.add(D))},onDidAddFirstListener(){z&&(x?setTimeout(j):j())},onDidRemoveLastListener(){D&&D.dispose(),D=null}});return O&&O.add(ve),ve.event}e.buffer=y;function m(M,x){return(N,O,z)=>{let D=x(new g);return M(function(j){let ve=D.evaluate(j);ve!==v&&N.call(O,ve)},void 0,z)}}e.chain=m;let v=Symbol("HaltChainable");class g{constructor(){this.steps=[]}map(x){return this.steps.push(x),this}forEach(x){return this.steps.push(N=>(x(N),N)),this}filter(x){return this.steps.push(N=>x(N)?N:v),this}reduce(x,N){let O=N;return this.steps.push(z=>(O=x(O,z),O)),this}latch(x=(N,O)=>N===O){let N=!0,O;return this.steps.push(z=>{let D=N||!x(z,O);return N=!1,O=z,D?z:v}),this}evaluate(x){for(let N of this.steps)if(x=N(x),x===v)break;return x}}function S(M,x,N=O=>O){let O=(...ve)=>j.fire(N(...ve)),z=()=>M.on(x,O),D=()=>M.removeListener(x,O),j=new E({onWillAddFirstListener:z,onDidRemoveLastListener:D});return j.event}e.fromNodeEventEmitter=S;function C(M,x,N=O=>O){let O=(...ve)=>j.fire(N(...ve)),z=()=>M.addEventListener(x,O),D=()=>M.removeEventListener(x,O),j=new E({onWillAddFirstListener:z,onDidRemoveLastListener:D});return j.event}e.fromDOMEventEmitter=C;function A(M){return new Promise(x=>s(M)(x))}e.toPromise=A;function T(M){let x=new E;return M.then(N=>{x.fire(N)},()=>{x.fire(void 0)}).finally(()=>{x.dispose()}),x.event}e.fromPromise=T;function k(M,x){return M(N=>x.fire(N))}e.forward=k;function Z(M,x,N){return x(N),M(O=>x(O))}e.runAndSubscribe=Z;class K{constructor(x,N){this._observable=x,this._counter=0,this._hasChanged=!1;let O={onWillAddFirstListener:()=>{x.addObserver(this)},onDidRemoveLastListener:()=>{x.removeObserver(this)}};N||t(O),this.emitter=new E(O),N&&N.add(this.emitter)}beginUpdate(x){this._counter++}handlePossibleChange(x){}handleChange(x,N){this._hasChanged=!0}endUpdate(x){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function F(M,x){return new K(M,x).emitter.event}e.fromObservable=F;function wn(M){return(x,N,O)=>{let z=0,D=!1,j={beginUpdate(){z++},endUpdate(){z--,z===0&&(M.reportChanges(),D&&(D=!1,x.call(N)))},handlePossibleChange(){},handleChange(){D=!0}};M.addObserver(j),M.reportChanges();let ve={dispose(){M.removeObserver(j)}};return O instanceof Hs?O.add(ve):Array.isArray(O)&&O.push(ve),ve}}e.fromObservableLight=wn})(it||={});var Xd=class Fd{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Fd._idPool++}`,Fd.all.add(this)}start(t){this._stopWatch=new wC,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Xd.all=new Set,Xd._idPool=0;var xC=Xd,_p=-1,T1=class D1{constructor(t,i,s=(D1._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,l]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${l}):`;console.warn(a),console.warn(n);let o=new DC(a,n);this._errorHandler(o)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};T1._idPool=1;var TC=T1,Wd=class M1{constructor(t){this.value=t}static create(){let t=new Error;return new M1(t.stack??"")}print(){console.warn(this.value.split(`
33
+ `),{leaks:s,details:l}}};xx.idx=0;function Ex(e){rn=e}if(Cx){let e="__is_disposable_tracked__";Ex(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==G.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==G.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function mc(e){return rn?.trackDisposable(e),e}function pc(e){rn?.markAsDisposed(e)}function Pa(e,t){rn?.setParent(e,t)}function Tx(e,t){if(rn)for(let i of e)rn.setParent(i,t)}function AS(e){return rn?.markAsSingleton(e),e}function nn(e){if(Py.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Mx(...e){let t=be(()=>nn(e));return Tx(e,t),t}function be(e){let t=mc({dispose:wx(()=>{pc(t),e()})});return t}var Fy=class qy{constructor(){this._toDispose=new Set,this._isDisposed=!1,mc(this)}dispose(){this._isDisposed||(pc(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{nn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Pa(t,this),this._isDisposed?qy.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),Pa(t,null))}};Fy.DISABLE_DISPOSED_WARNING=!1;var wr=Fy,G=class{constructor(){this._store=new wr,mc(this),Pa(this._store,this)}dispose(){pc(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};G.None=Object.freeze({dispose(){}});var cl=class{constructor(){this._isDisposed=!1,mc(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Pa(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,pc(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Pa(e,null),e}},ai=typeof window=="object"?window:globalThis,m_=class p_{constructor(t){this.element=t,this.next=p_.Undefined,this.prev=p_.Undefined}};m_.Undefined=new m_(void 0);var Me=m_,DS=class{constructor(){this._first=Me.Undefined,this._last=Me.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Me.Undefined}clear(){let e=this._first;for(;e!==Me.Undefined;){let t=e.next;e.prev=Me.Undefined,e.next=Me.Undefined,e=t}this._first=Me.Undefined,this._last=Me.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new Me(e);if(this._first===Me.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Me.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Me.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Me.Undefined&&e.next!==Me.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Me.Undefined&&e.next===Me.Undefined?(this._first=Me.Undefined,this._last=Me.Undefined):e.next===Me.Undefined?(this._last=this._last.prev,this._last.next=Me.Undefined):e.prev===Me.Undefined&&(this._first=this._first.next,this._first.prev=Me.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Me.Undefined;)yield e.element,e=e.next}},Lx=globalThis.performance&&typeof globalThis.performance.now=="function",Ax=class Wy{static create(t){return new Wy(t)}constructor(t){this._now=Lx&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Dx=!1,RS=!1,Rx=!1,St;(e=>{e.None=()=>G.None;function t(w){if(Rx){let{onDidAddListener:p}=w,C=b_.create(),b=0;w.onDidAddListener=()=>{++b===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),C.print()),p?.()}}}function i(w,p){return d(w,()=>{},0,void 0,!0,void 0,p)}e.defer=i;function s(w){return(p,C=null,b)=>{let E=!1,x;return x=w(A=>{if(!E)return x?x.dispose():E=!0,p.call(C,A)},null,b),E&&x.dispose(),x}}e.once=s;function r(w,p,C){return c((b,E=null,x)=>w(A=>b.call(E,p(A)),null,x),C)}e.map=r;function n(w,p,C){return c((b,E=null,x)=>w(A=>{p(A),b.call(E,A)},null,x),C)}e.forEach=n;function l(w,p,C){return c((b,E=null,x)=>w(A=>p(A)&&b.call(E,A),null,x),C)}e.filter=l;function a(w){return w}e.signal=a;function o(...w){return(p,C=null,b)=>{let E=Mx(...w.map(x=>x(A=>p.call(C,A))));return u(E,b)}}e.any=o;function h(w,p,C,b){let E=C;return r(w,x=>(E=p(E,x),E),b)}e.reduce=h;function c(w,p){let C,b={onWillAddFirstListener(){C=w(E.fire,E)},onDidRemoveLastListener(){C?.dispose()}};p||t(b);let E=new N(b);return p?.add(E),E.event}function u(w,p){return p instanceof Array?p.push(w):p&&p.add(w),w}function d(w,p,C=100,b=!1,E=!1,x,A){let k,U,Q,K=0,J,Pe={leakWarningThreshold:x,onWillAddFirstListener(){k=w(Ee=>{K++,U=p(U,Ee),b&&!Q&&(te.fire(U),U=void 0),J=()=>{let le=U;U=void 0,Q=void 0,(!b||K>1)&&te.fire(le),K=0},typeof C=="number"?(clearTimeout(Q),Q=setTimeout(J,C)):Q===void 0&&(Q=0,queueMicrotask(J))})},onWillRemoveListener(){E&&K>0&&J?.()},onDidRemoveLastListener(){J=void 0,k.dispose()}};A||t(Pe);let te=new N(Pe);return A?.add(te),te.event}e.debounce=d;function f(w,p=0,C){return e.debounce(w,(b,E)=>b?(b.push(E),b):[E],p,void 0,!0,void 0,C)}e.accumulate=f;function _(w,p=(b,E)=>b===E,C){let b=!0,E;return l(w,x=>{let A=b||!p(x,E);return b=!1,E=x,A},C)}e.latch=_;function y(w,p,C){return[e.filter(w,p,C),e.filter(w,b=>!p(b),C)]}e.split=y;function M(w,p=!1,C=[],b){let E=C.slice(),x=w(U=>{E?E.push(U):k.fire(U)});b&&b.add(x);let A=()=>{E?.forEach(U=>k.fire(U)),E=null},k=new N({onWillAddFirstListener(){x||(x=w(U=>k.fire(U)),b&&b.add(x))},onDidAddFirstListener(){E&&(p?setTimeout(A):A())},onDidRemoveLastListener(){x&&x.dispose(),x=null}});return b&&b.add(k),k.event}e.buffer=M;function m(w,p){return(C,b,E)=>{let x=p(new S);return w(function(A){let k=x.evaluate(A);k!==v&&C.call(b,k)},void 0,E)}}e.chain=m;let v=Symbol("HaltChainable");class S{constructor(){this.steps=[]}map(p){return this.steps.push(p),this}forEach(p){return this.steps.push(C=>(p(C),C)),this}filter(p){return this.steps.push(C=>p(C)?C:v),this}reduce(p,C){let b=C;return this.steps.push(E=>(b=p(b,E),b)),this}latch(p=(C,b)=>C===b){let C=!0,b;return this.steps.push(E=>{let x=C||!p(E,b);return C=!1,b=E,x?E:v}),this}evaluate(p){for(let C of this.steps)if(p=C(p),p===v)break;return p}}function g(w,p,C=b=>b){let b=(...k)=>A.fire(C(...k)),E=()=>w.on(p,b),x=()=>w.removeListener(p,b),A=new N({onWillAddFirstListener:E,onDidRemoveLastListener:x});return A.event}e.fromNodeEventEmitter=g;function T(w,p,C=b=>b){let b=(...k)=>A.fire(C(...k)),E=()=>w.addEventListener(p,b),x=()=>w.removeEventListener(p,b),A=new N({onWillAddFirstListener:E,onDidRemoveLastListener:x});return A.event}e.fromDOMEventEmitter=T;function L(w){return new Promise(p=>s(w)(p))}e.toPromise=L;function B(w){let p=new N;return w.then(C=>{p.fire(C)},()=>{p.fire(void 0)}).finally(()=>{p.dispose()}),p.event}e.fromPromise=B;function O(w,p){return w(C=>p.fire(C))}e.forward=O;function I(w,p,C){return p(C),w(b=>p(b))}e.runAndSubscribe=I;class F{constructor(p,C){this._observable=p,this._counter=0,this._hasChanged=!1;let b={onWillAddFirstListener:()=>{p.addObserver(this)},onDidRemoveLastListener:()=>{p.removeObserver(this)}};C||t(b),this.emitter=new N(b),C&&C.add(this.emitter)}beginUpdate(p){this._counter++}handlePossibleChange(p){}handleChange(p,C){this._hasChanged=!0}endUpdate(p){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(w,p){return new F(w,p).emitter.event}e.fromObservable=P;function wt(w){return(p,C,b)=>{let E=0,x=!1,A={beginUpdate(){E++},endUpdate(){E--,E===0&&(w.reportChanges(),x&&(x=!1,p.call(C)))},handlePossibleChange(){},handleChange(){x=!0}};w.addObserver(A),w.reportChanges();let k={dispose(){w.removeObserver(A)}};return b instanceof wr?b.add(k):Array.isArray(b)&&b.push(k),k}}e.fromObservableLight=wt})(St||={});var S_=class y_{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${y_._idPool++}`,y_.all.add(this)}start(t){this._stopWatch=new Ax,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};S_.all=new Set,S_._idPool=0;var Bx=S_,BS=-1,Vy=class Yy{constructor(t,i,s=(Yy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,l]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${l}):`;console.warn(a),console.warn(n);let o=new Ox(a,n);this._errorHandler(o)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};Vy._idPool=1;var kx=Vy,b_=class Gy{constructor(t){this.value=t}static create(){let t=new Error;return new Gy(t.stack??"")}print(){console.warn(this.value.split(`
34
34
  `).slice(2).join(`
35
- `))}},DC=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},MC=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},AC=0,jo=class{constructor(e){this.value=e,this.id=AC++}},RC=2,OC=(e,t)=>{if(e instanceof jo)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},Xo;if(CC){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
36
- `)),e.length=0)},3e3),Xo=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var E=class{constructor(e){this._size=0,this._options=e,this._leakageMon=_p>0||this._options?.leakWarningThreshold?new TC(e?.onListenerError??Io,this._options?.leakWarningThreshold??_p):void 0,this._perfMon=this._options?._profName?new xC(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(fp){let e=this._listeners;queueMicrotask(()=>{OC(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new MC(`${a}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||Io)(h),Y.None}if(this._disposed)return Y.None;t&&(e=e.bind(t));let s=new jo(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Wd.create(),r=this._leakageMon.check(s.stack,this._size+1)),fp&&(s.stack=n??Wd.create()),this._listeners?this._listeners instanceof jo?(this._deliveryQueue??=new BC,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=fe(()=>{Xo?.unregister(l),r?.(),this._removeListener(s)});if(i instanceof Hs?i.add(l):Array.isArray(i)&&i.push(l),Xo){let a=new Error().stack.split(`
35
+ `))}},Ox=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Nx=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},zx=0,Zh=class{constructor(e){this.value=e,this.id=zx++}},Hx=2,Ux=(e,t)=>{if(e instanceof Zh)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},Qh;if(Dx){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
36
+ `)),e.length=0)},3e3),Qh=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=BS>0||this._options?.leakWarningThreshold?new kx(e?.onListenerError??Xh,this._options?.leakWarningThreshold??BS):void 0,this._perfMon=this._options?._profName?new Bx(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(RS){let e=this._listeners;queueMicrotask(()=>{Ux(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new Nx(`${a}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||Xh)(h),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));let s=new Zh(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=b_.create(),r=this._leakageMon.check(s.stack,this._size+1)),RS&&(s.stack=n??b_.create()),this._listeners?this._listeners instanceof Zh?(this._deliveryQueue??=new Px,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=be(()=>{Qh?.unregister(l),r?.(),this._removeListener(s)});if(i instanceof wr?i.add(l):Array.isArray(i)&&i.push(l),Qh){let a=new Error().stack.split(`
37
37
  `).slice(2,3).join(`
38
- `).trim(),o=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);Xo.register(l,o?.[2]??a,l)}return l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*RC<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Io;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof jo)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},BC=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Zd=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new E,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new E,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Zd.INSTANCE=new Zd;var Ef=Zd;function NC(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var Wx=Ef.INSTANCE.onDidChangeZoomLevel;function kC(e){return Ef.INSTANCE.getZoomFactor(e)}var Zx=Ef.INSTANCE.onDidChangeFullscreen,bn=typeof navigator=="object"?navigator.userAgent:"",Qd=bn.indexOf("Firefox")>=0,Fo=bn.indexOf("AppleWebKit")>=0,xf=bn.indexOf("Chrome")>=0,A1=!xf&&bn.indexOf("Safari")>=0,Qx=bn.indexOf("Electron/")>=0,Jx=bn.indexOf("Android")>=0,Wo=!1;if(typeof Ut.matchMedia=="function"){let e=Ut.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Ut.matchMedia("(display-mode: fullscreen)");Wo=e.matches,NC(Ut,e,({matches:i})=>{Wo&&t.matches||(Wo=i)})}function zC(){return Wo}var pn="en",ih=!1,sh=!1,Yl=!1,LC=!1,R1=!1,O1=!1,HC=!1,UC=!1,qC=!1,YC=!1,Yo,Zo=pn,mp=pn,KC,ji,Fi=globalThis,Ht;typeof Fi.vscode<"u"&&typeof Fi.vscode.process<"u"?Ht=Fi.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ht=process);var B1=typeof Ht?.versions?.electron=="string",VC=B1&&Ht?.type==="renderer";if(typeof Ht=="object"){ih=Ht.platform==="win32",sh=Ht.platform==="darwin",Yl=Ht.platform==="linux",LC=Yl&&!!Ht.env.SNAP&&!!Ht.env.SNAP_REVISION,HC=B1,qC=!!Ht.env.CI||!!Ht.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Yo=pn,Zo=pn;let e=Ht.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Yo=t.userLocale,mp=t.osLocale,Zo=t.resolvedLanguage||pn,KC=t.languagePack?.translationsConfigFile}catch{}R1=!0}else typeof navigator=="object"&&!VC?(ji=navigator.userAgent,ih=ji.indexOf("Windows")>=0,sh=ji.indexOf("Macintosh")>=0,UC=(ji.indexOf("Macintosh")>=0||ji.indexOf("iPad")>=0||ji.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Yl=ji.indexOf("Linux")>=0,YC=ji?.indexOf("Mobi")>=0,O1=!0,Zo=globalThis._VSCODE_NLS_LANGUAGE||pn,Yo=navigator.language.toLowerCase(),mp=Yo):console.error("Unable to resolve platform.");var wd=0;sh?wd=1:ih?wd=3:Yl&&(wd=2);var N1=ih,Ti=sh,PC=Yl,Cd=R1,GC=O1&&typeof Fi.importScripts=="function",$x=GC?Fi.origin:void 0,Di=ji,Os=Zo,IC;(e=>{function t(){return Os}e.value=t;function i(){return Os.length===2?Os==="en":Os.length>=3?Os[0]==="e"&&Os[1]==="n"&&Os[2]==="-":!1}e.isDefaultVariant=i;function s(){return Os==="en"}e.isDefault=s})(IC||={});var jC=typeof Fi.postMessage=="function"&&!Fi.importScripts,XC=(()=>{if(jC){let e=[];Fi.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Fi.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),FC=!!(Di&&Di.indexOf("Chrome")>=0),e3=!!(Di&&Di.indexOf("Firefox")>=0),t3=!!(!FC&&Di&&Di.indexOf("Safari")>=0),i3=!!(Di&&Di.indexOf("Edg/")>=0),s3=!!(Di&&Di.indexOf("Android")>=0),Bs=typeof navigator=="object"?navigator:{},r3={clipboard:{writeText:Cd||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Bs&&Bs.clipboard&&Bs.clipboard.writeText),readText:Cd||!!(Bs&&Bs.clipboard&&Bs.clipboard.readText)},keyboard:Cd||zC()?0:Bs.keyboard||A1?1:2,touch:"ontouchstart"in Ut||Bs.maxTouchPoints>0,pointerEvents:Ut.PointerEvent&&("ontouchstart"in Ut||navigator.maxTouchPoints>0)},Tf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Ed=new Tf,vp=new Tf,gp=new Tf,WC=new Array(230),k1;(e=>{function t(a){return Ed.keyCodeToStr(a)}e.toString=t;function i(a){return Ed.strToKeyCode(a)}e.fromString=i;function s(a){return vp.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return gp.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return vp.strToKeyCode(a)||gp.strToKeyCode(a)}e.fromUserSettings=n;function l(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ed.keyCodeToStr(a)}e.toElectronAccelerator=l})(k1||={});var ZC=class z1{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof z1&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new QC([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},QC=class{constructor(e){if(e.length===0)throw oC("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function JC(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return k1.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(Qd)switch(t){case 59:return 85;case 60:if(PC)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ti)return 57;break}else if(Fo&&(Ti&&t===93||!Ti&&t===92))return 57;return WC[t]||0}var $C=Ti?256:2048,e2=512,t2=1024,i2=Ti?2048:256,Jd=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=JC(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=$C),this.altKey&&(t|=e2),this.shiftKey&&(t|=t2),this.metaKey&&(t|=i2),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new ZC(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},pp=new WeakMap;function s2(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var r2=class{static getSameOriginWindowChain(e){let t=pp.get(e);if(!t){t=[],pp.set(e,t);let i=e,s;do s=s2(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain(e);for(let n of r){let l=n.window.deref();if(i+=l?.scrollY??0,s+=l?.scrollX??0,l===t||!n.iframeElement)break;let a=n.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}},kl=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=r2.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Sp=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(xf){let r=navigator.userAgent.match(/Chrome\/(\d+)/);s=(r?parseInt(r[1]):123)<=122}if(e){let r=e,n=e,l=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")s?this.deltaY=r.wheelDeltaY/(120*l):this.deltaY=r.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<"u"&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?Qd&&!Ti?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")A1&&N1?this.deltaX=-(r.wheelDeltaX/120):s?this.deltaX=r.wheelDeltaX/(120*l):this.deltaX=r.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<"u"&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?Qd&&!Ti?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},L1=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),n2;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof l2?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:it.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:L1})})(n2||={});var l2=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?L1:(this._emitter||(this._emitter=new E),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var Df=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Pd("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Pd("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},a2=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Pd("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=fe(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},o2,xd;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?xd=(e,t)=>{XC(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:xd=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},o2=e=>xd(globalThis,e)})();var h2;(e=>{async function t(s){let r,n=await Promise.all(s.map(l=>l.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(l){n(l)}})}e.withAsyncBody=i})(h2||={});var yp=class Zt{static fromArray(t){return new Zt(i=>{i.emitMany(t)})}static fromPromise(t){return new Zt(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Zt(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Zt(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new E,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await it.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Zt(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Zt.map(this,t)}static filter(t,i){return new Zt(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Zt.filter(this,t)}static coalesce(t){return Zt.filter(t,i=>!!i)}coalesce(){return Zt.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Zt.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};yp.EMPTY=yp.fromArray([]);function c2(e){return 55296<=e&&e<=56319}function bp(e){return 56320<=e&&e<=57343}function u2(e,t){return(e-55296<<10)+(t-56320)+65536}function d2(e){return Mf(e,0)}function Mf(e,t){switch(typeof e){case"object":return e===null?Xi(349,t):Array.isArray(e)?_2(e,t):m2(e,t);case"string":return H1(e,t);case"boolean":return f2(e,t);case"number":return Xi(e,t);case"undefined":return Xi(937,t);default:return Xi(617,t)}}function Xi(e,t){return(t<<5)-t+e|0}function f2(e,t){return Xi(e?433:863,t)}function H1(e,t){t=Xi(149417,t);for(let i=0,s=e.length;i<s;i++)t=Xi(e.charCodeAt(i),t);return t}function _2(e,t){return t=Xi(104579,t),e.reduce((i,s)=>Mf(s,i),t)}function m2(e,t){return t=Xi(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=H1(s,i),Mf(e[s],i)),t)}function Td(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function wp(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function v2(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Dl(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):v2((e>>>0).toString(16),t/4)}var g2=class U1{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,l,a;for(n!==0?(l=n,a=-1,n=0):(l=t.charCodeAt(0),a=0);;){let o=l;if(c2(l))if(a+1<i){let h=t.charCodeAt(a+1);bp(h)?(a++,o=u2(l,h)):o=65533}else{n=l;break}else bp(l)&&(o=65533);if(r=this._push(s,r,o),a++,a<i)l=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Dl(this._h0)+Dl(this._h1)+Dl(this._h2)+Dl(this._h3)+Dl(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,wp(this._buff,this._buffLen),this._buffLen>56&&(this._step(),wp(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=U1._bigBlock32,i=this._buffDV;for(let d=0;d<64;d+=4)t.setUint32(d,i.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)t.setUint32(d,Td(t.getUint32(d-12,!1)^t.getUint32(d-32,!1)^t.getUint32(d-56,!1)^t.getUint32(d-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,l=this._h3,a=this._h4,o,h,u;for(let d=0;d<80;d++)d<20?(o=r&n|~r&l,h=1518500249):d<40?(o=r^n^l,h=1859775393):d<60?(o=r&n|r&l|n&l,h=2400959708):(o=r^n^l,h=3395469782),u=Td(s,5)+o+a+h+t.getUint32(d*4,!1)&4294967295,a=l,l=n,n=Td(r,30),r=s,s=u;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+a&4294967295}};g2._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:n3,getWindow:ni,getDocument:l3,getWindows:a3,getWindowsCount:o3,getWindowId:Cp,getWindowById:h3,hasWindow:c3,onDidRegisterWindow:p2,onWillUnregisterWindow:u3,onDidUnregisterWindow:d3}=(function(){let e=new Map,t={window:Ut,disposables:new Hs};e.set(Ut.vscodeWindowId,t);let i=new E,s=new E,r=new E;function n(l,a){return(typeof l=="number"?e.get(l):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Y.None;let a=new Hs,o={window:l,disposables:a.add(new Hs)};return e.set(l.vscodeWindowId,o),a.add(fe(()=>{e.delete(l.vscodeWindowId),s.fire(l)})),a.add(H(l,Pe.BEFORE_UNLOAD,()=>{r.fire(l)})),i.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:n,getWindow(l){let a=l;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let o=l;return o?.view?o.view.window:Ut},getDocument(l){return ni(l).document}}})(),S2=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function H(e,t,i,s){return new S2(e,t,i,s)}function y2(e,t){return function(i){return t(new kl(e,i))}}function b2(e){return function(t){return e(new Jd(t))}}var Ep=function(e,t,i,s){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=y2(ni(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=b2(i)),H(e,t,r,s)},w2,rh,C2=class extends a2{constructor(e){super(),this.defaultTarget=e&&ni(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Dd=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Io(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let l=e.get(n)??[];for(t.set(n,l),e.set(n,[]),s.set(n,!0);l.length>0;)l.sort(Dd.sort),l.shift().execute();s.set(n,!1)};rh=(n,l,a=0)=>{let o=Cp(n),h=new Dd(l,a),u=e.get(o);return u||(u=[],e.set(o,u)),u.push(h),i.get(o)||(i.set(o,!0),n.requestAnimationFrame(()=>r(o))),h},w2=(n,l,a)=>{let o=Cp(n);if(s.get(o)){let h=new Dd(l,a),u=t.get(o);return u||(u=[],t.set(o,u)),u.push(h),h}else return rh(n,l,a)}})();var xp=class Qo{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new Qo(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof Qo?t:new Qo(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};xp.None=new xp(0,0);function E2(e){let t=e.getBoundingClientRect(),i=ni(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var f3=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=d2(i),n=s.get(r);if(n)n.users+=1;else{let l=new E,a=new MutationObserver(h=>l.fire(h));a.observe(e,i);let o=n={users:1,observer:a,onDidMutate:l.event};t.add(fe(()=>{o.users-=1,o.users===0&&(l.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},Pe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Fo?"webkitAnimationStart":"animationstart",ANIMATION_END:Fo?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Fo?"webkitAnimationIteration":"animationiteration"},x2=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function q1(e,t,i,...s){let r=x2.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",l;return e!=="http://www.w3.org/1999/xhtml"?l=document.createElementNS(e,n):l=document.createElement(n),r[3]&&(l.id=r[3]),r[4]&&(l.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,o])=>{typeof o>"u"||(/^on\w+$/.test(a)?l[a]=o:a==="selected"?o&&l.setAttribute(a,"true"):l.setAttribute(a,o))}),l.append(...s),l}function T2(e,t,...i){return q1("http://www.w3.org/1999/xhtml",e,t,...i)}T2.SVG=function(e,t,...i){return q1("http://www.w3.org/2000/svg",e,t,...i)};var D2=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Ct(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ct(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ct(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ct(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ct(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ct(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ct(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ct(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ct(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ct(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ct(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ct(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ct(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ct(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ct(e){return typeof e=="number"?`${e}px`:e}function Kl(e){return new D2(e)}var Y1=class{constructor(){this._hooks=new Hs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(fe(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=ni(e)}this._hooks.add(H(n,Pe.POINTER_MOVE,l=>{if(l.buttons!==i){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(H(n,Pe.POINTER_UP,l=>this.stopMonitoring(!0)))}};function M2(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...l){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,l)}),this[n]}}var xi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(xi||={});var zl=class lt extends Y{constructor(){super(),this.dispatched=!1,this.targets=new dp,this.ignoreTargets=new dp,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(it.runAndSubscribe(p2,({window:t,disposables:i})=>{i.add(H(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(H(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(H(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Ut,disposables:this._store}))}static addTarget(t){if(!lt.isTouchDevice())return Y.None;lt.INSTANCE||(lt.INSTANCE=up(new lt));let i=lt.INSTANCE.targets.push(t);return fe(i)}static ignoreTarget(t){if(!lt.isTouchDevice())return Y.None;lt.INSTANCE||(lt.INSTANCE=up(new lt));let i=lt.INSTANCE.ignoreTargets.push(t);return fe(i)}static isTouchDevice(){return"ontouchstart"in Ut||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s<r;s++){let n=t.targetTouches.item(s);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let l=this.newGestureEvent(xi.Start,n.target);l.pageX=n.pageX,l.pageY=n.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),r=Object.keys(this.activeTouches).length;for(let n=0,l=i.changedTouches.length;n<l;n++){let a=i.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let o=this.activeTouches[a.identifier],h=Date.now()-o.initialTimeStamp;if(h<lt.HOLD_DELAY&&Math.abs(o.initialPageX-zt(o.rollingPageX))<30&&Math.abs(o.initialPageY-zt(o.rollingPageY))<30){let u=this.newGestureEvent(xi.Tap,o.initialTarget);u.pageX=zt(o.rollingPageX),u.pageY=zt(o.rollingPageY),this.dispatchEvent(u)}else if(h>=lt.HOLD_DELAY&&Math.abs(o.initialPageX-zt(o.rollingPageX))<30&&Math.abs(o.initialPageY-zt(o.rollingPageY))<30){let u=this.newGestureEvent(xi.Contextmenu,o.initialTarget);u.pageX=zt(o.rollingPageX),u.pageY=zt(o.rollingPageY),this.dispatchEvent(u)}else if(r===1){let u=zt(o.rollingPageX),d=zt(o.rollingPageY),c=zt(o.rollingTimestamps)-o.rollingTimestamps[0],f=u-o.rollingPageX[0],_=d-o.rollingPageY[0],p=[...this.targets].filter(y=>o.initialTarget instanceof Node&&y.contains(o.initialTarget));this.inertia(t,p,s,Math.abs(f)/c,f>0?1:-1,u,Math.abs(_)/c,_>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(xi.End,o.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===xi.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>lt.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===xi.Change||t.type===xi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,l,a,o,h){this.handle=rh(t,()=>{let u=Date.now(),d=u-s,c=0,f=0,_=!0;r+=lt.SCROLL_FRICTION*d,a+=lt.SCROLL_FRICTION*d,r>0&&(_=!1,c=n*r*d),a>0&&(_=!1,f=o*a*d);let p=this.newGestureEvent(xi.Change);p.translationX=c,p.translationY=f,i.forEach(y=>y.dispatchEvent(p)),_||this.inertia(t,i,u,r,n,l+c,a,o,h+f)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s<r;s++){let n=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let l=this.activeTouches[n.identifier],a=this.newGestureEvent(xi.Change,l.initialTarget);a.translationX=n.pageX-zt(l.rollingPageX),a.translationY=n.pageY-zt(l.rollingPageY),a.pageX=n.pageX,a.pageY=n.pageY,this.dispatchEvent(a),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(n.pageX),l.rollingPageY.push(n.pageY),l.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};zl.SCROLL_FRICTION=-.005,zl.HOLD_DELAY=700,zl.CLEAR_TAP_COUNT_TIME=400,Ee([M2],zl,"isTouchDevice",1);var A2=zl,Af=class extends Y{onclick(e,t){this._register(H(e,Pe.CLICK,i=>t(new kl(ni(e),i))))}onmousedown(e,t){this._register(H(e,Pe.MOUSE_DOWN,i=>t(new kl(ni(e),i))))}onmouseover(e,t){this._register(H(e,Pe.MOUSE_OVER,i=>t(new kl(ni(e),i))))}onmouseleave(e,t){this._register(H(e,Pe.MOUSE_LEAVE,i=>t(new kl(ni(e),i))))}onkeydown(e,t){this._register(H(e,Pe.KEY_DOWN,i=>t(new Jd(i))))}onkeyup(e,t){this._register(H(e,Pe.KEY_UP,i=>t(new Jd(i))))}oninput(e,t){this._register(H(e,Pe.INPUT,t))}onblur(e,t){this._register(H(e,Pe.BLUR,t))}onfocus(e,t){this._register(H(e,Pe.FOCUS,t))}onchange(e,t){this._register(H(e,Pe.CHANGE,t))}ignoreGesture(e){return A2.ignoreTarget(e)}},Tp=11,R2=class extends Af{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Tp+"px",this.domNode.style.height=Tp+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Y1),this._register(Ep(this.bgDomNode,Pe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ep(this.domNode,Pe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new C2),this._pointerdownScheduleRepeatTimer=this._register(new Df)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ni(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},O2=class $d{constructor(t,i,s,r,n,l,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,l=l|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),a+n>l&&(a=l-n),a<0&&(a=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=l,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new $d(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new $d(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,o=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:l,scrollHeightChanged:a,scrollTopChanged:o}}},B2=class extends Y{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new E),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new O2(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Mp(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=Mp.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Dp=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Md(e,t){let i=t-e;return function(s){return e+i*z2(s)}}function N2(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var Mp=class ef{constructor(t,i,s,r){this.from=t,this.to=i,this.duration=r,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,s){if(Math.abs(t-i)>2.5*s){let r,n;return t<i?(r=t+.75*s,n=i-.75*s):(r=t-.75*s,n=i+.75*s),N2(Md(t,r),Md(n,i),.33)}return Md(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),r=this.scrollTop(i);return new Dp(s,r,!1)}return new Dp(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return ef.start(t,i,s)}static start(t,i,s){s=s+10;let r=Date.now()-10;return new ef(t,i,r,s)}};function k2(e){return Math.pow(e,3)}function z2(e){return 1-k2(1-e)}var L2=class extends Y{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Df)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},H2=140,K1=class extends Af{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new L2(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Y1),this._shouldRender=!0,this.domNode=Kl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(H(this.domNode.domNode,Pe.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new R2(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=Kl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(H(this.slider.domNode,Pe.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=E2(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),l=Math.abs(n-i);if(N1&&l>H2){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let a=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},V1=class tf{constructor(t,i,s,r,n,l){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new tf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let l=Math.max(0,s-t),a=Math.max(0,l-2*i),o=r>0&&r>s;if(!o)return{computedAvailableSize:Math.round(l),computedIsNeeded:o,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(s*a/r))),u=(a-h)/(r-s),d=n*u;return{computedAvailableSize:Math.round(l),computedIsNeeded:o,computedSliderSize:Math.round(h),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){let t=tf._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},U2=class extends K1{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new V1(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},q2=class extends K1{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new V1(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},Y2=500,Ap=50,Rp=!0,K2=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},sf=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,s=1,r=this._rear;do{let n=r===this._front?t:Math.pow(2,-s);if(t-=n,i+=this._memory[r].score*n,r===this._front)break;r=(this._capacity+r-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(xf){let i=ni(t.browserEvent),s=kC(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let r=null,n=new K2(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n),n.score=this._computeScore(n,r)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),l=Math.abs(i.deltaX),a=Math.abs(i.deltaY),o=Math.max(Math.min(r,l),1),h=Math.max(Math.min(n,a),1),u=Math.max(r,l),d=Math.max(n,a);u%o===0&&d%h===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};sf.INSTANCE=new sf;var V2=sf,P2=class extends Af{constructor(e,t,i){super(),this._onScroll=this._register(new E),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new E),this.onWillScroll=this._onWillScroll.event,this._options=I2(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new q2(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new U2(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Kl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Kl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Kl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Df),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=mr(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ti&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Sp(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=mr(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new Sp(i))};this._mouseWheelToDispose.push(H(this._listenOnDomNode,Pe.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=V2.INSTANCE;Rp&&t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let l=!Ti&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!n&&(n=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),o={};if(r){let h=Ap*r,u=a.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(o,u)}if(n){let h=Ap*n,u=a.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(o,u)}o=this._scrollable.validateScrollPosition(o),(a.scrollLeft!==o.scrollLeft||a.scrollTop!==o.scrollTop)&&(Rp&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(o):this._scrollable.setScrollPositionNow(o),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Y2)}},G2=class extends P2{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function I2(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Ti&&(t.className+=" mac"),t}var rf=class extends Y{constructor(e,t,i,s,r,n,l,a){super(),this._bufferService=i,this._optionsService=l,this._renderService=a,this._onRequestScrollLines=this._register(new E),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let o=this._register(new B2({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>rh(s.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{o.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new G2(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},o)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(it.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(fe(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(fe(()=>this._styleElement.remove())),this._register(it.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
39
- `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};rf=Ee([B(2,_t),B(3,Wi),B(4,f1),B(5,yn),B(6,mt),B(7,Zi)],rf);var nf=class extends Y{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this._register(fe(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};nf=Ee([B(1,_t),B(2,Wi),B(3,Xl),B(4,Zi)],nf);var j2=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Ci={full:0,left:0,center:0,right:0},Ns={full:0,left:0,center:0,right:0},Ml={full:0,left:0,center:0,right:0},nh=class extends Y{constructor(e,t,i,s,r,n,l,a){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=n,this._themeService=l,this._coreBrowserService=a,this._colorZoneStore=new j2,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(fe(()=>this._canvas?.remove()));let o=this._canvas.getContext("2d");if(o)this._ctx=o;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Ns.full=this._canvas.width,Ns.left=e,Ns.center=t,Ns.right=e,this._refreshDrawHeightConstants(),Ml.full=1,Ml.left=1,Ml.center=1+Ns.left,Ml.right=1+Ns.left+Ns.center}_refreshDrawHeightConstants(){Ci.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ci.left=t,Ci.center=t,Ci.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ci.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ml[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ci[e.position||"full"]/2),Ns[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ci[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};nh=Ee([B(2,_t),B(3,Xl),B(4,Zi),B(5,mt),B(6,yn),B(7,Wi)],nh);var w;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
40
- `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(w||={});var Jo;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(Jo||={});var P1;(e=>e.ST=`${w.ESC}\\`)(P1||={});var lf=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${w.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let n=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};lf=Ee([B(2,_t),B(3,mt),B(4,gr),B(5,Zi)],lf);var Ge=0,Ie=0,je=0,Ce=0,Op={css:"#00000000",rgba:0},Oe;(e=>{function t(r,n,l,a){return a!==void 0?`#${cr(r)}${cr(n)}${cr(l)}${cr(a)}`:`#${cr(r)}${cr(n)}${cr(l)}`}e.toCss=t;function i(r,n,l,a=255){return(r<<24|n<<16|l<<8|a)>>>0}e.toRgba=i;function s(r,n,l,a){return{css:e.toCss(r,n,l,a),rgba:e.toRgba(r,n,l,a)}}e.toColor=s})(Oe||={});var de;(e=>{function t(o,h){if(Ce=(h.rgba&255)/255,Ce===1)return{css:h.css,rgba:h.rgba};let u=h.rgba>>24&255,d=h.rgba>>16&255,c=h.rgba>>8&255,f=o.rgba>>24&255,_=o.rgba>>16&255,p=o.rgba>>8&255;Ge=f+Math.round((u-f)*Ce),Ie=_+Math.round((d-_)*Ce),je=p+Math.round((c-p)*Ce);let y=Oe.toCss(Ge,Ie,je),m=Oe.toRgba(Ge,Ie,je);return{css:y,rgba:m}}e.blend=t;function i(o){return(o.rgba&255)===255}e.isOpaque=i;function s(o,h,u){let d=$o.ensureContrastRatio(o.rgba,h.rgba,u);if(d)return Oe.toColor(d>>24&255,d>>16&255,d>>8&255)}e.ensureContrastRatio=s;function r(o){let h=(o.rgba|255)>>>0;return[Ge,Ie,je]=$o.toChannels(h),{css:Oe.toCss(Ge,Ie,je),rgba:h}}e.opaque=r;function n(o,h){return Ce=Math.round(h*255),[Ge,Ie,je]=$o.toChannels(o.rgba),{css:Oe.toCss(Ge,Ie,je,Ce),rgba:Oe.toRgba(Ge,Ie,je,Ce)}}e.opacity=n;function l(o,h){return Ce=o.rgba&255,n(o,Ce*h/255)}e.multiplyOpacity=l;function a(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}e.toColorRGB=a})(de||={});var Se;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Ge=parseInt(r.slice(1,2).repeat(2),16),Ie=parseInt(r.slice(2,3).repeat(2),16),je=parseInt(r.slice(3,4).repeat(2),16),Oe.toColor(Ge,Ie,je);case 5:return Ge=parseInt(r.slice(1,2).repeat(2),16),Ie=parseInt(r.slice(2,3).repeat(2),16),je=parseInt(r.slice(3,4).repeat(2),16),Ce=parseInt(r.slice(4,5).repeat(2),16),Oe.toColor(Ge,Ie,je,Ce);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return Ge=parseInt(n[1]),Ie=parseInt(n[2]),je=parseInt(n[3]),Ce=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Oe.toColor(Ge,Ie,je,Ce);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Ge,Ie,je,Ce]=t.getImageData(0,0,1,1).data,Ce!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Oe.toRgba(Ge,Ie,je,Ce),css:r}}e.toColor=s})(Se||={});var ft;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let l=s/255,a=r/255,o=n/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),u=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),d=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4);return h*.2126+u*.7152+d*.0722}e.relativeLuminance2=i})(ft||={});var $o;(e=>{function t(l,a){if(Ce=(a&255)/255,Ce===1)return a;let o=a>>24&255,h=a>>16&255,u=a>>8&255,d=l>>24&255,c=l>>16&255,f=l>>8&255;return Ge=d+Math.round((o-d)*Ce),Ie=c+Math.round((h-c)*Ce),je=f+Math.round((u-f)*Ce),Oe.toRgba(Ge,Ie,je)}e.blend=t;function i(l,a,o){let h=ft.relativeLuminance(l>>8),u=ft.relativeLuminance(a>>8);if(Ii(h,u)<o){if(u<h){let f=s(l,a,o),_=Ii(h,ft.relativeLuminance(f>>8));if(_<o){let p=r(l,a,o),y=Ii(h,ft.relativeLuminance(p>>8));return _>y?f:p}return f}let d=r(l,a,o),c=Ii(h,ft.relativeLuminance(d>>8));if(c<o){let f=s(l,a,o),_=Ii(h,ft.relativeLuminance(f>>8));return c>_?d:f}return d}}e.ensureContrastRatio=i;function s(l,a,o){let h=l>>24&255,u=l>>16&255,d=l>>8&255,c=a>>24&255,f=a>>16&255,_=a>>8&255,p=Ii(ft.relativeLuminance2(c,f,_),ft.relativeLuminance2(h,u,d));for(;p<o&&(c>0||f>0||_>0);)c-=Math.max(0,Math.ceil(c*.1)),f-=Math.max(0,Math.ceil(f*.1)),_-=Math.max(0,Math.ceil(_*.1)),p=Ii(ft.relativeLuminance2(c,f,_),ft.relativeLuminance2(h,u,d));return(c<<24|f<<16|_<<8|255)>>>0}e.reduceLuminance=s;function r(l,a,o){let h=l>>24&255,u=l>>16&255,d=l>>8&255,c=a>>24&255,f=a>>16&255,_=a>>8&255,p=Ii(ft.relativeLuminance2(c,f,_),ft.relativeLuminance2(h,u,d));for(;p<o&&(c<255||f<255||_<255);)c=Math.min(255,c+Math.ceil((255-c)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),p=Ii(ft.relativeLuminance2(c,f,_),ft.relativeLuminance2(h,u,d));return(c<<24|f<<16|_<<8|255)>>>0}e.increaseLuminance=r;function n(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=n})($o||={});function cr(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Ii(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var X2=class extends jl{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},lh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Jt}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],s=t.translateToString(!0),r=0,n=0,l=0,a=t.getFg(0),o=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==o){if(h-r>1){let u=this._getJoinedRanges(s,l,n,t,r);for(let d=0;d<u.length;d++)i.push(u[d])}r=h,l=n,a=this._workCell.fg,o=this._workCell.bg}n+=this._workCell.getChars().length||Ls.length}if(this._bufferService.cols-r>1){let h=this._getJoinedRanges(s,l,n,t,r);for(let u=0;u<h.length;u++)i.push(h[u])}return i}_getJoinedRanges(e,t,i,s,r){let n=e.substring(t,i),l=[];try{l=this._characterJoiners[0].handler(n)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let o=this._characterJoiners[a].handler(n);for(let h=0;h<o.length;h++)lh._mergeRanges(l,o[h])}catch(o){console.error(o)}return this._stringRangesToCellRanges(l,s,r),l}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,l=e[s];if(l){for(let a=i;a<this._bufferService.cols;a++){let o=t.getWidth(a),h=t.getString(a).length||Ls.length;if(o!==0){if(!r&&l[0]<=n&&(l[0]=a,r=!0),l[1]<=n){if(l[1]=a,l=e[++s],!l)break;l[0]<=n?(l[0]=a,r=!0):r=!1}n+=h}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};lh=Ee([B(0,_t)],lh);function F2(e){return 57508<=e&&e<=57558}function W2(e){return 9472<=e&&e<=9631}function Z2(e){return F2(e)||W2(e)}function Q2(){return{css:{canvas:Ko(),cell:Ko()},device:{canvas:Ko(),cell:Ko(),char:{width:0,height:0,left:0,top:0}}}}function Ko(){return{width:0,height:0}}var af=class{constructor(e,t,i,s,r,n,l){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=l,this._workCell=new Jt,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,n,l,a,o,h,u){let d=[],c=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,_=e.getNoBgTrimmedLength();i&&_<n+1&&(_=n+1);let p,y=0,m="",v=0,g=0,S=0,C=0,A=!1,T=0,k=!1,Z=0,K=0,F=[],wn=h!==-1&&u!==-1;for(let M=0;M<_;M++){e.loadCell(M,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let N=!1,O=M>=K,z=M,D=this._workCell;if(c.length>0&&M===c[0][0]&&O){let ee=c.shift(),gh=this._isCellInSelection(ee[0],t);for(v=ee[0]+1;v<ee[1];v++)O&&=gh===this._isCellInSelection(v,t);O&&=!i||n<ee[0]||n>=ee[1],O?(N=!0,D=new X2(this._workCell,e.translateToString(!0,ee[0],ee[1]),ee[1]-ee[0]),z=ee[1]-1,x=D.getWidth()):K=ee[1]}let j=this._isCellInSelection(M,t),ve=i&&M===n,Fe=wn&&M>=h&&M<=u,li=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,ee=>{li=!0});let Mi=D.getChars()||Ls;if(Mi===" "&&(D.isUnderline()||D.isOverline())&&(Mi=" "),Z=x*a-o.get(Mi,D.isBold(),D.isItalic()),!p)p=this._document.createElement("span");else if(y&&(j&&k||!j&&!k&&D.bg===g)&&(j&&k&&f.selectionForeground||D.fg===S)&&D.extended.ext===C&&Fe===A&&Z===T&&!ve&&!N&&!li&&O){D.isInvisible()?m+=Ls:m+=Mi,y++;continue}else y&&(p.textContent=m),p=this._document.createElement("span"),y=0,m="";if(g=D.bg,S=D.fg,C=D.extended.ext,A=Fe,T=Z,k=j,N&&n>=M&&n<=z&&(n=M),!this._coreService.isCursorHidden&&ve&&this._coreService.isCursorInitialized){if(F.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&F.push("xterm-cursor-blink"),F.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":F.push("xterm-cursor-outline");break;case"block":F.push("xterm-cursor-block");break;case"bar":F.push("xterm-cursor-bar");break;case"underline":F.push("xterm-cursor-underline");break;default:break}}if(D.isBold()&&F.push("xterm-bold"),D.isItalic()&&F.push("xterm-italic"),D.isDim()&&F.push("xterm-dim"),D.isInvisible()?m=Ls:m=D.getChars()||Ls,D.isUnderline()&&(F.push(`xterm-underline-${D.extended.underlineStyle}`),m===" "&&(m=" "),!D.isUnderlineColorDefault()))if(D.isUnderlineColorRGB())p.style.textDecorationColor=`rgb(${jl.toColorRGB(D.getUnderlineColor()).join(",")})`;else{let ee=D.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&D.isBold()&&ee<8&&(ee+=8),p.style.textDecorationColor=f.ansi[ee].css}D.isOverline()&&(F.push("xterm-overline"),m===" "&&(m=" ")),D.isStrikethrough()&&F.push("xterm-strikethrough"),Fe&&(p.style.textDecoration="underline");let Ue=D.getFgColor(),Qi=D.getFgColorMode(),at=D.getBgColor(),Us=D.getBgColorMode(),Cn=!!D.isInverse();if(Cn){let ee=Ue;Ue=at,at=ee;let gh=Qi;Qi=Us,Us=gh}let Ji,Zl,En=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,ee=>{ee.options.layer!=="top"&&En||(ee.backgroundColorRGB&&(Us=50331648,at=ee.backgroundColorRGB.rgba>>8&16777215,Ji=ee.backgroundColorRGB),ee.foregroundColorRGB&&(Qi=50331648,Ue=ee.foregroundColorRGB.rgba>>8&16777215,Zl=ee.foregroundColorRGB),En=ee.options.layer==="top")}),!En&&j&&(Ji=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,at=Ji.rgba>>8&16777215,Us=50331648,En=!0,f.selectionForeground&&(Qi=50331648,Ue=f.selectionForeground.rgba>>8&16777215,Zl=f.selectionForeground)),En&&F.push("xterm-decoration-top");let $i;switch(Us){case 16777216:case 33554432:$i=f.ansi[at],F.push(`xterm-bg-${at}`);break;case 50331648:$i=Oe.toColor(at>>16,at>>8&255,at&255),this._addStyle(p,`background-color:#${Bp((at>>>0).toString(16),"0",6)}`);break;default:Cn?($i=f.foreground,F.push("xterm-bg-257")):$i=f.background}switch(Ji||D.isDim()&&(Ji=de.multiplyOpacity($i,.5)),Qi){case 16777216:case 33554432:D.isBold()&&Ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ue+=8),this._applyMinimumContrast(p,$i,f.ansi[Ue],D,Ji,void 0)||F.push(`xterm-fg-${Ue}`);break;case 50331648:let ee=Oe.toColor(Ue>>16&255,Ue>>8&255,Ue&255);this._applyMinimumContrast(p,$i,ee,D,Ji,Zl)||this._addStyle(p,`color:#${Bp(Ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(p,$i,f.foreground,D,Ji,Zl)||Cn&&F.push("xterm-fg-257")}F.length&&(p.className=F.join(" "),F.length=0),!ve&&!N&&!li&&O?y++:p.textContent=m,Z!==this.defaultSpacing&&(p.style.letterSpacing=`${Z}px`),d.push(p),M=z}return p&&y&&(p.textContent=m),d}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||Z2(s.getCode()))return!1;let l=this._getContrastCache(s),a;if(!r&&!n&&(a=l.getColor(t.rgba,i.rgba)),a===void 0){let o=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=de.ensureContrastRatio(r||t,n||i,o),l.setColor((r||t).rgba,(n||i).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};af=Ee([B(1,v1),B(2,mt),B(3,Wi),B(4,gr),B(5,Xl),B(6,yn)],af);function Bp(e,t,i){for(;e.length<i;)e=t+e;return e}var J2=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let l=this._measure(e,0);return l>0&&(this._flat[s]=l),l}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let l=0;t&&(l|=1),i&&(l|=2),n=this._measure(e,l),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},$2=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,l=i[1]-r,a=Math.max(n,0),o=Math.min(l,e.rows-1);if(a>=e.rows||o<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=l,this.viewportCappedStartRow=a,this.viewportCappedEndRow=o,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function eE(){return new $2}var Ad="xterm-dom-renderer-owner-",Wt="xterm-rows",Vo="xterm-fg-",Np="xterm-bg-",Al="xterm-focus",Po="xterm-selection",tE=1,of=class extends Y{constructor(e,t,i,s,r,n,l,a,o,h,u,d,c,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=l,this._charSizeService=o,this._optionsService=h,this._bufferService=u,this._coreService=d,this._coreBrowserService=c,this._themeService=f,this._terminalClass=tE++,this._rowElements=[],this._selectionRenderModel=eE(),this.onRequestRedraw=this._register(new E).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Wt),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Po),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Q2(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(_=>this._injectCss(_))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(af,document),this._element.classList.add(Ad+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(_=>this._handleLinkHover(_))),this._register(this._linkifier2.onHideLinkUnderline(_=>this._handleLinkLeave(_))),this._register(fe(()=>{this._element.classList.remove(Ad+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new J2(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Wt} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Wt} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Wt} .xterm-dim { color: ${de.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Wt}.${Al} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Wt}.${Al} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Wt}.${Al} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Wt} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Wt} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Wt} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Wt} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Wt} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Po} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Po} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Po} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Vo}${n} { color: ${l.css}; }${this._terminalSelector} .${Vo}${n}.xterm-dim { color: ${de.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${Np}${n} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Vo}257 { color: ${de.opaque(e.background).css}; }${this._terminalSelector} .${Vo}257.xterm-dim { color: ${de.multiplyOpacity(de.opaque(e.background),.5).css}; }${this._terminalSelector} .${Np}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Al),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Al),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){let o=e[0]>t[0];a.appendChild(this._createSelectionElement(n,o?t[0]:e[0],o?e[0]:t[0],l-n+1))}else{let o=s===n?e[0]:0,h=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,o,h));let u=l-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,u)),n!==l){let d=r===l?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(l,0,d))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(i-t);return n+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${l}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=e;o<=t;o++){let h=o+i.ydisp,u=this._rowElements[o],d=i.lines.get(h);if(!u||!d)break;u.replaceChildren(...this._rowFactory.createRow(d,h,h===s,l,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ad}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let l=this._bufferService.rows-1;i=Math.max(Math.min(i,l),0),s=Math.max(Math.min(s,l),0),r=Math.min(r,this._bufferService.cols);let a=this._bufferService.buffer,o=a.ybase+a.y,h=Math.min(a.x,r-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=s;++f){let _=f+a.ydisp,p=this._rowElements[f],y=a.lines.get(_);if(!p||!y)break;p.replaceChildren(...this._rowFactory.createRow(y,_,_===o,d,c,h,u,this.dimensions.css.cell.width,this._widthCache,n?f===i?e:0:-1,n?(f===s?t:r)-1:-1))}}};of=Ee([B(7,wf),B(8,uh),B(9,mt),B(10,_t),B(11,gr),B(12,Wi),B(13,yn)],of);var hf=class extends Y{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new E),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new sE(this._optionsService))}catch{this._measureStrategy=this._register(new iE(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};hf=Ee([B(2,mt)],hf);var G1=class extends Y{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},iE=class extends G1{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},sE=class extends G1{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},rE=class extends Y{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new nE(this._window)),this._onDprChange=this._register(new E),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new E),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(it.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(H(this._textarea,"focus",()=>this._isFocused=!0)),this._register(H(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},nE=class extends Y{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Sn),this._onDprChange=this._register(new E),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(fe(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=H(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},lE=class extends Y{constructor(){super(),this.linkProviders=[],this._register(fe(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Rf(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),l=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-l]}function aE(e,t,i,s,r,n,l,a,o){if(!n)return;let h=Rf(e,t,i);if(h)return h[0]=Math.ceil((h[0]+(o?l/2:0))/l),h[1]=Math.ceil(h[1]/a),h[0]=Math.min(Math.max(h[0],1),s+(o?1:0)),h[1]=Math.min(Math.max(h[1],1),r),h}var cf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return aE(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=Rf(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};cf=Ee([B(0,Zi),B(1,uh)],cf);var oE=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},I1={};Iw(I1,{getSafariVersion:()=>cE,isChromeOS:()=>W1,isFirefox:()=>j1,isIpad:()=>uE,isIphone:()=>dE,isLegacyEdge:()=>hE,isLinux:()=>Of,isMac:()=>ah,isNode:()=>_h,isSafari:()=>X1,isWindows:()=>F1});var _h=typeof process<"u"&&"title"in process,Fl=_h?"node":navigator.userAgent,Wl=_h?"node":navigator.platform,j1=Fl.includes("Firefox"),hE=Fl.includes("Edge"),X1=/^((?!chrome|android).)*safari/i.test(Fl);function cE(){if(!X1)return 0;let e=Fl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ah=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Wl),uE=Wl==="iPad",dE=Wl==="iPhone",F1=["Windows","Win16","Win32","WinCE"].includes(Wl),Of=Wl.indexOf("Linux")>=0,W1=/\bCrOS\b/.test(Fl),Z1=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},fE=class extends Z1{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},_E=class extends Z1{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},oh=!_h&&"requestIdleCallback"in window?_E:fE,mE=class{constructor(){this._queue=new oh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},uf=class extends Y{constructor(e,t,i,s,r,n,l,a,o){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=a,this._renderer=this._register(new Sn),this._pausedResizeTask=new mE,this._observerDisposable=this._register(new Sn),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new E),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new E),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new E),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new E),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new oE((h,u)=>this._renderRows(h,u),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new vE(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(fe(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(o.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=fe(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};uf=Ee([B(2,mt),B(3,uh),B(4,gr),B(5,Xl),B(6,_t),B(7,Wi),B(8,yn)],uf);var vE=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function gE(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return yE(r,n,e,t,i,s)+mh(n,t,i,s)+bE(r,n,e,t,i,s);let l;if(n===t)return l=r>e?"D":"C",Gl(Math.abs(r-e),Pl(l,s));l=n>t?"D":"C";let a=Math.abs(n-t),o=SE(n>t?e:r,i)+(a-1)*i.cols+1+pE(n>t?r:e,i);return Gl(o,Pl(l,s))}function pE(e,t){return e-1}function SE(e,t){return t.cols-e}function yE(e,t,i,s,r,n){return mh(t,s,r,n).length===0?"":Gl(J1(e,t,e,t-vr(t,r),!1,r).length,Pl("D",n))}function mh(e,t,i,s){let r=e-vr(e,i),n=t-vr(t,i),l=Math.abs(r-n)-wE(e,t,i);return Gl(l,Pl(Q1(e,t),s))}function bE(e,t,i,s,r,n){let l;mh(t,s,r,n).length>0?l=s-vr(s,r):l=t;let a=s,o=CE(e,t,i,s,r,n);return Gl(J1(e,l,i,a,o==="C",r).length,Pl(o,n))}function wE(e,t,i){let s=0,r=e-vr(e,i),n=t-vr(t,i);for(let l=0;l<Math.abs(r-n);l++){let a=Q1(e,t)==="A"?-1:1;i.buffer.lines.get(r+a*l)?.isWrapped&&s++}return s}function vr(e,t){let i=0,s=t.buffer.lines.get(e),r=s?.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),r=s?.isWrapped;return i}function CE(e,t,i,s,r,n){let l;return mh(i,s,r,n).length>0?l=s-vr(s,r):l=t,e<i&&l<=s||e>=i&&l<s?"C":"D"}function Q1(e,t){return e>t?"A":"B"}function J1(e,t,i,s,r,n){let l=e,a=t,o="";for(;(l!==i||a!==s)&&a>=0&&a<n.buffer.lines.length;)l+=r?1:-1,r&&l>n.cols-1?(o+=n.buffer.translateBufferLineToString(a,!1,e,l),l=0,e=0,a++):!r&&l<0&&(o+=n.buffer.translateBufferLineToString(a,!1,0,e+1),l=n.cols-1,e=l,a--);return o+n.buffer.translateBufferLineToString(a,!1,e,l)}function Pl(e,t){let i=t?"O":"[";return w.ESC+i+e}function Gl(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var EE=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function kp(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Rd=50,xE=15,TE=50,DE=500,ME=" ",AE=new RegExp(ME,"g"),df=class extends Y{constructor(e,t,i,s,r,n,l,a,o){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=l,this._renderService=a,this._coreBrowserService=o,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Jt,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new E),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new E),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new E),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new E),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new EE(this._bufferService),this._activeSelectionMode=0,this._register(fe(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let a=i.translateBufferLineToString(l,!0,r,n);s.push(a)}}else{let r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let n=e[1]+1;n<=t[1]-1;n++){let l=i.lines.get(n),a=i.translateBufferLineToString(n,!0);l?.isWrapped?s[s.length-1]+=a:s.push(a)}if(e[1]!==t[1]){let n=i.lines.get(t[1]),l=i.translateBufferLineToString(t[1],!0,0,t[0]);n&&n.isWrapped?s[s.length-1]+=l:s.push(l)}}return s.map(r=>r.replace(AE," ")).join(F1?`\r
38
+ `).trim(),o=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);Qh.register(l,o?.[2]??a,l)}return l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*Hx<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Xh;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Zh)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Px=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},w_=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};w_.INSTANCE=new w_;var $_=w_;function Ix(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var jM=$_.INSTANCE.onDidChangeZoomLevel;function Fx(e){return $_.INSTANCE.getZoomFactor(e)}var $M=$_.INSTANCE.onDidChangeFullscreen,dl=typeof navigator=="object"?navigator.userAgent:"",C_=dl.indexOf("Firefox")>=0,Jh=dl.indexOf("AppleWebKit")>=0,X_=dl.indexOf("Chrome")>=0,Ky=!X_&&dl.indexOf("Safari")>=0,XM=dl.indexOf("Electron/")>=0,ZM=dl.indexOf("Android")>=0,ec=!1;if(typeof ai.matchMedia=="function"){let e=ai.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ai.matchMedia("(display-mode: fullscreen)");ec=e.matches,Ix(ai,e,({matches:i})=>{ec&&t.matches||(ec=i)})}function qx(){return ec}var hl="en",ac=!1,oc=!1,Ha=!1,Wx=!1,jy=!1,$y=!1,Vx=!1,Yx=!1,Gx=!1,Kx=!1,Yh,tc=hl,kS=hl,jx,Cs,Es=globalThis,li;typeof Es.vscode<"u"&&typeof Es.vscode.process<"u"?li=Es.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(li=process);var Xy=typeof li?.versions?.electron=="string",$x=Xy&&li?.type==="renderer";if(typeof li=="object"){ac=li.platform==="win32",oc=li.platform==="darwin",Ha=li.platform==="linux",Wx=Ha&&!!li.env.SNAP&&!!li.env.SNAP_REVISION,Vx=Xy,Gx=!!li.env.CI||!!li.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Yh=hl,tc=hl;let e=li.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Yh=t.userLocale,kS=t.osLocale,tc=t.resolvedLanguage||hl,jx=t.languagePack?.translationsConfigFile}catch{}jy=!0}else typeof navigator=="object"&&!$x?(Cs=navigator.userAgent,ac=Cs.indexOf("Windows")>=0,oc=Cs.indexOf("Macintosh")>=0,Yx=(Cs.indexOf("Macintosh")>=0||Cs.indexOf("iPad")>=0||Cs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ha=Cs.indexOf("Linux")>=0,Kx=Cs?.indexOf("Mobi")>=0,$y=!0,tc=globalThis._VSCODE_NLS_LANGUAGE||hl,Yh=navigator.language.toLowerCase(),kS=Yh):console.error("Unable to resolve platform.");var jf=0;oc?jf=1:ac?jf=3:Ha&&(jf=2);var Zy=ac,ts=oc,Xx=Ha,$f=jy,Zx=$y&&typeof Es.importScripts=="function",QM=Zx?Es.origin:void 0,is=Cs,vr=tc,Qx;(e=>{function t(){return vr}e.value=t;function i(){return vr.length===2?vr==="en":vr.length>=3?vr[0]==="e"&&vr[1]==="n"&&vr[2]==="-":!1}e.isDefaultVariant=i;function s(){return vr==="en"}e.isDefault=s})(Qx||={});var Jx=typeof Es.postMessage=="function"&&!Es.importScripts,e6=(()=>{if(Jx){let e=[];Es.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Es.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),t6=!!(is&&is.indexOf("Chrome")>=0),JM=!!(is&&is.indexOf("Firefox")>=0),e8=!!(!t6&&is&&is.indexOf("Safari")>=0),t8=!!(is&&is.indexOf("Edg/")>=0),i8=!!(is&&is.indexOf("Android")>=0),mr=typeof navigator=="object"?navigator:{},s8={clipboard:{writeText:$f||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(mr&&mr.clipboard&&mr.clipboard.writeText),readText:$f||!!(mr&&mr.clipboard&&mr.clipboard.readText)},keyboard:$f||qx()?0:mr.keyboard||Ky?1:2,touch:"ontouchstart"in ai||mr.maxTouchPoints>0,pointerEvents:ai.PointerEvent&&("ontouchstart"in ai||navigator.maxTouchPoints>0)},Z_=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Xf=new Z_,OS=new Z_,NS=new Z_,i6=new Array(230),Qy;(e=>{function t(a){return Xf.keyCodeToStr(a)}e.toString=t;function i(a){return Xf.strToKeyCode(a)}e.fromString=i;function s(a){return OS.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return NS.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return OS.strToKeyCode(a)||NS.strToKeyCode(a)}e.fromUserSettings=n;function l(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Xf.keyCodeToStr(a)}e.toElectronAccelerator=l})(Qy||={});var s6=class Jy{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof Jy&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new r6([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},r6=class{constructor(e){if(e.length===0)throw gx("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function n6(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Qy.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(C_)switch(t){case 59:return 85;case 60:if(Xx)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ts)return 57;break}else if(Jh&&(ts&&t===93||!ts&&t===92))return 57;return i6[t]||0}var l6=ts?256:2048,a6=512,o6=1024,h6=ts?2048:256,x_=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=n6(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=l6),this.altKey&&(t|=a6),this.shiftKey&&(t|=o6),this.metaKey&&(t|=h6),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new s6(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},zS=new WeakMap;function c6(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var u6=class{static getSameOriginWindowChain(e){let t=zS.get(e);if(!t){t=[],zS.set(e,t);let i=e,s;do s=c6(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain(e);for(let n of r){let l=n.window.deref();if(i+=l?.scrollY??0,s+=l?.scrollX??0,l===t||!n.iframeElement)break;let a=n.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}},Ra=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=u6.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},HS=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(X_){let r=navigator.userAgent.match(/Chrome\/(\d+)/);s=(r?parseInt(r[1]):123)<=122}if(e){let r=e,n=e,l=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")s?this.deltaY=r.wheelDeltaY/(120*l):this.deltaY=r.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<"u"&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?C_&&!ts?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")Ky&&Zy?this.deltaX=-(r.wheelDeltaX/120):s?this.deltaX=r.wheelDeltaX/(120*l):this.deltaX=r.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<"u"&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?C_&&!ts?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},eb=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),d6;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof f6?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:St.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:eb})})(d6||={});var f6=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?eb:(this._emitter||(this._emitter=new N),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var Q_=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new g_("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new g_("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},_6=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new g_("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=be(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},g6,Zf;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Zf=(e,t)=>{e6(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:Zf=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},g6=e=>Zf(globalThis,e)})();var v6;(e=>{async function t(s){let r,n=await Promise.all(s.map(l=>l.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(l){n(l)}})}e.withAsyncBody=i})(v6||={});var US=class bi{static fromArray(t){return new bi(i=>{i.emitMany(t)})}static fromPromise(t){return new bi(async i=>{i.emitMany(await t)})}static fromPromises(t){return new bi(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new bi(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new N,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await St.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new bi(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return bi.map(this,t)}static filter(t,i){return new bi(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return bi.filter(this,t)}static coalesce(t){return bi.filter(t,i=>!!i)}coalesce(){return bi.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return bi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};US.EMPTY=US.fromArray([]);function m6(e){return 55296<=e&&e<=56319}function PS(e){return 56320<=e&&e<=57343}function p6(e,t){return(e-55296<<10)+(t-56320)+65536}function S6(e){return J_(e,0)}function J_(e,t){switch(typeof e){case"object":return e===null?xs(349,t):Array.isArray(e)?b6(e,t):w6(e,t);case"string":return tb(e,t);case"boolean":return y6(e,t);case"number":return xs(e,t);case"undefined":return xs(937,t);default:return xs(617,t)}}function xs(e,t){return(t<<5)-t+e|0}function y6(e,t){return xs(e?433:863,t)}function tb(e,t){t=xs(149417,t);for(let i=0,s=e.length;i<s;i++)t=xs(e.charCodeAt(i),t);return t}function b6(e,t){return t=xs(104579,t),e.reduce((i,s)=>J_(s,i),t)}function w6(e,t){return t=xs(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=tb(s,i),J_(e[s],i)),t)}function Qf(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function IS(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function C6(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function xa(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):C6((e>>>0).toString(16),t/4)}var x6=class ib{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,l,a;for(n!==0?(l=n,a=-1,n=0):(l=t.charCodeAt(0),a=0);;){let o=l;if(m6(l))if(a+1<i){let h=t.charCodeAt(a+1);PS(h)?(a++,o=p6(l,h)):o=65533}else{n=l;break}else PS(l)&&(o=65533);if(r=this._push(s,r,o),a++,a<i)l=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),xa(this._h0)+xa(this._h1)+xa(this._h2)+xa(this._h3)+xa(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,IS(this._buff,this._buffLen),this._buffLen>56&&(this._step(),IS(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=ib._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,Qf(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,l=this._h3,a=this._h4,o,h,c;for(let u=0;u<80;u++)u<20?(o=r&n|~r&l,h=1518500249):u<40?(o=r^n^l,h=1859775393):u<60?(o=r&n|r&l|n&l,h=2400959708):(o=r^n^l,h=3395469782),c=Qf(s,5)+o+a+h+t.getUint32(u*4,!1)&4294967295,a=l,l=n,n=Qf(r,30),r=s,s=c;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+a&4294967295}};x6._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:r8,getWindow:ki,getDocument:n8,getWindows:l8,getWindowsCount:a8,getWindowId:FS,getWindowById:o8,hasWindow:h8,onDidRegisterWindow:E6,onWillUnregisterWindow:c8,onDidUnregisterWindow:u8}=(function(){let e=new Map,t={window:ai,disposables:new wr};e.set(ai.vscodeWindowId,t);let i=new N,s=new N,r=new N;function n(l,a){return(typeof l=="number"?e.get(l):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(l){if(e.has(l.vscodeWindowId))return G.None;let a=new wr,o={window:l,disposables:a.add(new wr)};return e.set(l.vscodeWindowId,o),a.add(be(()=>{e.delete(l.vscodeWindowId),s.fire(l)})),a.add(W(l,st.BEFORE_UNLOAD,()=>{r.fire(l)})),i.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:n,getWindow(l){let a=l;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let o=l;return o?.view?o.view.window:ai},getDocument(l){return ki(l).document}}})(),T6=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function W(e,t,i,s){return new T6(e,t,i,s)}function M6(e,t){return function(i){return t(new Ra(e,i))}}function L6(e){return function(t){return e(new x_(t))}}var qS=function(e,t,i,s){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=M6(ki(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=L6(i)),W(e,t,r,s)},A6,hc,D6=class extends _6{constructor(e){super(),this.defaultTarget=e&&ki(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Jf=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Xh(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let l=e.get(n)??[];for(t.set(n,l),e.set(n,[]),s.set(n,!0);l.length>0;)l.sort(Jf.sort),l.shift().execute();s.set(n,!1)};hc=(n,l,a=0)=>{let o=FS(n),h=new Jf(l,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(h),i.get(o)||(i.set(o,!0),n.requestAnimationFrame(()=>r(o))),h},A6=(n,l,a)=>{let o=FS(n);if(s.get(o)){let h=new Jf(l,a),c=t.get(o);return c||(c=[],t.set(o,c)),c.push(h),h}else return hc(n,l,a)}})();var WS=class ic{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new ic(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof ic?t:new ic(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};WS.None=new WS(0,0);function R6(e){let t=e.getBoundingClientRect(),i=ki(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var d8=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=S6(i),n=s.get(r);if(n)n.users+=1;else{let l=new N,a=new MutationObserver(h=>l.fire(h));a.observe(e,i);let o=n={users:1,observer:a,onDidMutate:l.event};t.add(be(()=>{o.users-=1,o.users===0&&(l.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},st={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Jh?"webkitAnimationStart":"animationstart",ANIMATION_END:Jh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Jh?"webkitAnimationIteration":"animationiteration"},B6=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function sb(e,t,i,...s){let r=B6.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",l;return e!=="http://www.w3.org/1999/xhtml"?l=document.createElementNS(e,n):l=document.createElement(n),r[3]&&(l.id=r[3]),r[4]&&(l.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,o])=>{typeof o>"u"||(/^on\w+$/.test(a)?l[a]=o:a==="selected"?o&&l.setAttribute(a,"true"):l.setAttribute(a,o))}),l.append(...s),l}function k6(e,t,...i){return sb("http://www.w3.org/1999/xhtml",e,t,...i)}k6.SVG=function(e,t,...i){return sb("http://www.w3.org/2000/svg",e,t,...i)};var O6=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Vt(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Vt(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Vt(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Vt(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Vt(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Vt(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Vt(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Vt(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Vt(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Vt(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Vt(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Vt(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Vt(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Vt(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Vt(e){return typeof e=="number"?`${e}px`:e}function Ua(e){return new O6(e)}var rb=class{constructor(){this._hooks=new wr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(be(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=ki(e)}this._hooks.add(W(n,st.POINTER_MOVE,l=>{if(l.buttons!==i){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(W(n,st.POINTER_UP,l=>this.stopMonitoring(!0)))}};function N6(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...l){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,l)}),this[n]}}var es;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(es||={});var Ba=class Tt extends G{constructor(){super(),this.dispatched=!1,this.targets=new DS,this.ignoreTargets=new DS,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(St.runAndSubscribe(E6,({window:t,disposables:i})=>{i.add(W(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(W(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(W(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:ai,disposables:this._store}))}static addTarget(t){if(!Tt.isTouchDevice())return G.None;Tt.INSTANCE||(Tt.INSTANCE=AS(new Tt));let i=Tt.INSTANCE.targets.push(t);return be(i)}static ignoreTarget(t){if(!Tt.isTouchDevice())return G.None;Tt.INSTANCE||(Tt.INSTANCE=AS(new Tt));let i=Tt.INSTANCE.ignoreTargets.push(t);return be(i)}static isTouchDevice(){return"ontouchstart"in ai||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s<r;s++){let n=t.targetTouches.item(s);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let l=this.newGestureEvent(es.Start,n.target);l.pageX=n.pageX,l.pageY=n.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),r=Object.keys(this.activeTouches).length;for(let n=0,l=i.changedTouches.length;n<l;n++){let a=i.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let o=this.activeTouches[a.identifier],h=Date.now()-o.initialTimeStamp;if(h<Tt.HOLD_DELAY&&Math.abs(o.initialPageX-ri(o.rollingPageX))<30&&Math.abs(o.initialPageY-ri(o.rollingPageY))<30){let c=this.newGestureEvent(es.Tap,o.initialTarget);c.pageX=ri(o.rollingPageX),c.pageY=ri(o.rollingPageY),this.dispatchEvent(c)}else if(h>=Tt.HOLD_DELAY&&Math.abs(o.initialPageX-ri(o.rollingPageX))<30&&Math.abs(o.initialPageY-ri(o.rollingPageY))<30){let c=this.newGestureEvent(es.Contextmenu,o.initialTarget);c.pageX=ri(o.rollingPageX),c.pageY=ri(o.rollingPageY),this.dispatchEvent(c)}else if(r===1){let c=ri(o.rollingPageX),u=ri(o.rollingPageY),d=ri(o.rollingTimestamps)-o.rollingTimestamps[0],f=c-o.rollingPageX[0],_=u-o.rollingPageY[0],y=[...this.targets].filter(M=>o.initialTarget instanceof Node&&M.contains(o.initialTarget));this.inertia(t,y,s,Math.abs(f)/d,f>0?1:-1,c,Math.abs(_)/d,_>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(es.End,o.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===es.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Tt.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===es.Change||t.type===es.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,l,a,o,h){this.handle=hc(t,()=>{let c=Date.now(),u=c-s,d=0,f=0,_=!0;r+=Tt.SCROLL_FRICTION*u,a+=Tt.SCROLL_FRICTION*u,r>0&&(_=!1,d=n*r*u),a>0&&(_=!1,f=o*a*u);let y=this.newGestureEvent(es.Change);y.translationX=d,y.translationY=f,i.forEach(M=>M.dispatchEvent(y)),_||this.inertia(t,i,c,r,n,l+d,a,o,h+f)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s<r;s++){let n=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let l=this.activeTouches[n.identifier],a=this.newGestureEvent(es.Change,l.initialTarget);a.translationX=n.pageX-ri(l.rollingPageX),a.translationY=n.pageY-ri(l.rollingPageY),a.pageX=n.pageX,a.pageY=n.pageY,this.dispatchEvent(a),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(n.pageX),l.rollingPageY.push(n.pageY),l.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Ba.SCROLL_FRICTION=-.005,Ba.HOLD_DELAY=700,Ba.CLEAR_TAP_COUNT_TIME=400,Oe([N6],Ba,"isTouchDevice",1);var z6=Ba,e0=class extends G{onclick(e,t){this._register(W(e,st.CLICK,i=>t(new Ra(ki(e),i))))}onmousedown(e,t){this._register(W(e,st.MOUSE_DOWN,i=>t(new Ra(ki(e),i))))}onmouseover(e,t){this._register(W(e,st.MOUSE_OVER,i=>t(new Ra(ki(e),i))))}onmouseleave(e,t){this._register(W(e,st.MOUSE_LEAVE,i=>t(new Ra(ki(e),i))))}onkeydown(e,t){this._register(W(e,st.KEY_DOWN,i=>t(new x_(i))))}onkeyup(e,t){this._register(W(e,st.KEY_UP,i=>t(new x_(i))))}oninput(e,t){this._register(W(e,st.INPUT,t))}onblur(e,t){this._register(W(e,st.BLUR,t))}onfocus(e,t){this._register(W(e,st.FOCUS,t))}onchange(e,t){this._register(W(e,st.CHANGE,t))}ignoreGesture(e){return z6.ignoreTarget(e)}},VS=11,H6=class extends e0{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=VS+"px",this.domNode.style.height=VS+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new rb),this._register(qS(this.bgDomNode,st.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(qS(this.domNode,st.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new D6),this._pointerdownScheduleRepeatTimer=this._register(new Q_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ki(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},U6=class E_{constructor(t,i,s,r,n,l,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,l=l|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),a+n>l&&(a=l-n),a<0&&(a=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=l,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new E_(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new E_(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,o=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:l,scrollHeightChanged:a,scrollTopChanged:o}}},P6=class extends G{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new U6(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new GS(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=GS.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},YS=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function e_(e,t){let i=t-e;return function(s){return e+i*q6(s)}}function I6(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var GS=class T_{constructor(t,i,s,r){this.from=t,this.to=i,this.duration=r,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,s){if(Math.abs(t-i)>2.5*s){let r,n;return t<i?(r=t+.75*s,n=i-.75*s):(r=t-.75*s,n=i+.75*s),I6(e_(t,r),e_(n,i),.33)}return e_(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),r=this.scrollTop(i);return new YS(s,r,!1)}return new YS(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return T_.start(t,i,s)}static start(t,i,s){s=s+10;let r=Date.now()-10;return new T_(t,i,r,s)}};function F6(e){return Math.pow(e,3)}function q6(e){return 1-F6(1-e)}var W6=class extends G{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Q_)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},V6=140,nb=class extends e0{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new W6(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new rb),this._shouldRender=!0,this.domNode=Ua(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(W(this.domNode.domNode,st.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new H6(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=Ua(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(W(this.slider.domNode,st.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=R6(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),l=Math.abs(n-i);if(Zy&&l>V6){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let a=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},lb=class M_{constructor(t,i,s,r,n,l){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new M_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let l=Math.max(0,s-t),a=Math.max(0,l-2*i),o=r>0&&r>s;if(!o)return{computedAvailableSize:Math.round(l),computedIsNeeded:o,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(s*a/r))),c=(a-h)/(r-s),u=n*c;return{computedAvailableSize:Math.round(l),computedIsNeeded:o,computedSliderSize:Math.round(h),computedSliderRatio:c,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=M_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},Y6=class extends nb{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new lb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},G6=class extends nb{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new lb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},K6=500,KS=50,jS=!0,j6=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},L_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,s=1,r=this._rear;do{let n=r===this._front?t:Math.pow(2,-s);if(t-=n,i+=this._memory[r].score*n,r===this._front)break;r=(this._capacity+r-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(X_){let i=ki(t.browserEvent),s=Fx(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let r=null,n=new j6(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n),n.score=this._computeScore(n,r)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),l=Math.abs(i.deltaX),a=Math.abs(i.deltaY),o=Math.max(Math.min(r,l),1),h=Math.max(Math.min(n,a),1),c=Math.max(r,l),u=Math.max(n,a);c%o===0&&u%h===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};L_.INSTANCE=new L_;var $6=L_,X6=class extends e0{constructor(e,t,i){super(),this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new N),this.onWillScroll=this._onWillScroll.event,this._options=Q6(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new G6(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Y6(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Ua(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ua(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ua(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Q_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=nn(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ts&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new HS(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=nn(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new HS(i))};this._mouseWheelToDispose.push(W(this._listenOnDomNode,st.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=$6.INSTANCE;jS&&t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let l=!ts&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!n&&(n=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),o={};if(r){let h=KS*r,c=a.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(o,c)}if(n){let h=KS*n,c=a.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(o,c)}o=this._scrollable.validateScrollPosition(o),(a.scrollLeft!==o.scrollLeft||a.scrollTop!==o.scrollTop)&&(jS&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(o):this._scrollable.setScrollPositionNow(o),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),K6)}},Z6=class extends X6{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Q6(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ts&&(t.className+=" mac"),t}var A_=class extends G{constructor(e,t,i,s,r,n,l,a){super(),this._bufferService=i,this._optionsService=l,this._renderService=a,this._onRequestScrollLines=this._register(new N),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let o=this._register(new P6({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>hc(s.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{o.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Z6(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},o)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(St.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(be(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(be(()=>this._styleElement.remove())),this._register(St.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
39
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};A_=Oe([H(2,kt),H(3,Ts),H(4,Ry),H(5,ul),H(6,Ot),H(7,Ms)],A_);var D_=class extends G{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this._register(be(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};D_=Oe([H(1,kt),H(2,Ts),H(3,Va),H(4,Ms)],D_);var J6=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Qi={full:0,left:0,center:0,right:0},pr={full:0,left:0,center:0,right:0},Ea={full:0,left:0,center:0,right:0},cc=class extends G{constructor(e,t,i,s,r,n,l,a){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=n,this._themeService=l,this._coreBrowserService=a,this._colorZoneStore=new J6,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(be(()=>this._canvas?.remove()));let o=this._canvas.getContext("2d");if(o)this._ctx=o;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);pr.full=this._canvas.width,pr.left=e,pr.center=t,pr.right=e,this._refreshDrawHeightConstants(),Ea.full=1,Ea.left=1,Ea.center=1+pr.left,Ea.right=1+pr.left+pr.center}_refreshDrawHeightConstants(){Qi.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Qi.left=t,Qi.center=t,Qi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qi.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ea[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Qi[e.position||"full"]/2),pr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Qi[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};cc=Oe([H(2,kt),H(3,Va),H(4,Ms),H(5,Ot),H(6,ul),H(7,Ts)],cc);var R;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
40
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(R||={});var sc;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(sc||={});var ab;(e=>e.ST=`${R.ESC}\\`)(ab||={});var R_=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${R.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let n=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};R_=Oe([H(2,kt),H(3,Ot),H(4,an),H(5,Ms)],R_);var rt=0,nt=0,lt=0,ke=0,$S={css:"#00000000",rgba:0},Ve;(e=>{function t(r,n,l,a){return a!==void 0?`#${Jr(r)}${Jr(n)}${Jr(l)}${Jr(a)}`:`#${Jr(r)}${Jr(n)}${Jr(l)}`}e.toCss=t;function i(r,n,l,a=255){return(r<<24|n<<16|l<<8|a)>>>0}e.toRgba=i;function s(r,n,l,a){return{css:e.toCss(r,n,l,a),rgba:e.toRgba(r,n,l,a)}}e.toColor=s})(Ve||={});var ye;(e=>{function t(o,h){if(ke=(h.rgba&255)/255,ke===1)return{css:h.css,rgba:h.rgba};let c=h.rgba>>24&255,u=h.rgba>>16&255,d=h.rgba>>8&255,f=o.rgba>>24&255,_=o.rgba>>16&255,y=o.rgba>>8&255;rt=f+Math.round((c-f)*ke),nt=_+Math.round((u-_)*ke),lt=y+Math.round((d-y)*ke);let M=Ve.toCss(rt,nt,lt),m=Ve.toRgba(rt,nt,lt);return{css:M,rgba:m}}e.blend=t;function i(o){return(o.rgba&255)===255}e.isOpaque=i;function s(o,h,c){let u=rc.ensureContrastRatio(o.rgba,h.rgba,c);if(u)return Ve.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(o){let h=(o.rgba|255)>>>0;return[rt,nt,lt]=rc.toChannels(h),{css:Ve.toCss(rt,nt,lt),rgba:h}}e.opaque=r;function n(o,h){return ke=Math.round(h*255),[rt,nt,lt]=rc.toChannels(o.rgba),{css:Ve.toCss(rt,nt,lt,ke),rgba:Ve.toRgba(rt,nt,lt,ke)}}e.opacity=n;function l(o,h){return ke=o.rgba&255,n(o,ke*h/255)}e.multiplyOpacity=l;function a(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}e.toColorRGB=a})(ye||={});var Le;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return rt=parseInt(r.slice(1,2).repeat(2),16),nt=parseInt(r.slice(2,3).repeat(2),16),lt=parseInt(r.slice(3,4).repeat(2),16),Ve.toColor(rt,nt,lt);case 5:return rt=parseInt(r.slice(1,2).repeat(2),16),nt=parseInt(r.slice(2,3).repeat(2),16),lt=parseInt(r.slice(3,4).repeat(2),16),ke=parseInt(r.slice(4,5).repeat(2),16),Ve.toColor(rt,nt,lt,ke);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return rt=parseInt(n[1]),nt=parseInt(n[2]),lt=parseInt(n[3]),ke=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ve.toColor(rt,nt,lt,ke);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[rt,nt,lt,ke]=t.getImageData(0,0,1,1).data,ke!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ve.toRgba(rt,nt,lt,ke),css:r}}e.toColor=s})(Le||={});var Bt;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let l=s/255,a=r/255,o=n/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4);return h*.2126+c*.7152+u*.0722}e.relativeLuminance2=i})(Bt||={});var rc;(e=>{function t(l,a){if(ke=(a&255)/255,ke===1)return a;let o=a>>24&255,h=a>>16&255,c=a>>8&255,u=l>>24&255,d=l>>16&255,f=l>>8&255;return rt=u+Math.round((o-u)*ke),nt=d+Math.round((h-d)*ke),lt=f+Math.round((c-f)*ke),Ve.toRgba(rt,nt,lt)}e.blend=t;function i(l,a,o){let h=Bt.relativeLuminance(l>>8),c=Bt.relativeLuminance(a>>8);if(ws(h,c)<o){if(c<h){let f=s(l,a,o),_=ws(h,Bt.relativeLuminance(f>>8));if(_<o){let y=r(l,a,o),M=ws(h,Bt.relativeLuminance(y>>8));return _>M?f:y}return f}let u=r(l,a,o),d=ws(h,Bt.relativeLuminance(u>>8));if(d<o){let f=s(l,a,o),_=ws(h,Bt.relativeLuminance(f>>8));return d>_?u:f}return u}}e.ensureContrastRatio=i;function s(l,a,o){let h=l>>24&255,c=l>>16&255,u=l>>8&255,d=a>>24&255,f=a>>16&255,_=a>>8&255,y=ws(Bt.relativeLuminance2(d,f,_),Bt.relativeLuminance2(h,c,u));for(;y<o&&(d>0||f>0||_>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),_-=Math.max(0,Math.ceil(_*.1)),y=ws(Bt.relativeLuminance2(d,f,_),Bt.relativeLuminance2(h,c,u));return(d<<24|f<<16|_<<8|255)>>>0}e.reduceLuminance=s;function r(l,a,o){let h=l>>24&255,c=l>>16&255,u=l>>8&255,d=a>>24&255,f=a>>16&255,_=a>>8&255,y=ws(Bt.relativeLuminance2(d,f,_),Bt.relativeLuminance2(h,c,u));for(;y<o&&(d<255||f<255||_<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),y=ws(Bt.relativeLuminance2(d,f,_),Bt.relativeLuminance2(h,c,u));return(d<<24|f<<16|_<<8|255)>>>0}e.increaseLuminance=r;function n(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=n})(rc||={});function Jr(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ws(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var e4=class extends Wa{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},uc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ci}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],s=t.translateToString(!0),r=0,n=0,l=0,a=t.getFg(0),o=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==o){if(h-r>1){let c=this._getJoinedRanges(s,l,n,t,r);for(let u=0;u<c.length;u++)i.push(c[u])}r=h,l=n,a=this._workCell.fg,o=this._workCell.bg}n+=this._workCell.getChars().length||br.length}if(this._bufferService.cols-r>1){let h=this._getJoinedRanges(s,l,n,t,r);for(let c=0;c<h.length;c++)i.push(h[c])}return i}_getJoinedRanges(e,t,i,s,r){let n=e.substring(t,i),l=[];try{l=this._characterJoiners[0].handler(n)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let o=this._characterJoiners[a].handler(n);for(let h=0;h<o.length;h++)uc._mergeRanges(l,o[h])}catch(o){console.error(o)}return this._stringRangesToCellRanges(l,s,r),l}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,l=e[s];if(l){for(let a=i;a<this._bufferService.cols;a++){let o=t.getWidth(a),h=t.getString(a).length||br.length;if(o!==0){if(!r&&l[0]<=n&&(l[0]=a,r=!0),l[1]<=n){if(l[1]=a,l=e[++s],!l)break;l[0]<=n?(l[0]=a,r=!0):r=!1}n+=h}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};uc=Oe([H(0,kt)],uc);function t4(e){return 57508<=e&&e<=57558}function i4(e){return 9472<=e&&e<=9631}function s4(e){return t4(e)||i4(e)}function r4(){return{css:{canvas:Gh(),cell:Gh()},device:{canvas:Gh(),cell:Gh(),char:{width:0,height:0,left:0,top:0}}}}function Gh(){return{width:0,height:0}}var B_=class{constructor(e,t,i,s,r,n,l){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=l,this._workCell=new Ci,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,n,l,a,o,h,c){let u=[],d=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,_=e.getNoBgTrimmedLength();i&&_<n+1&&(_=n+1);let y,M=0,m="",v=0,S=0,g=0,T=0,L=!1,B=0,O=!1,I=0,F=0,P=[],wt=h!==-1&&c!==-1;for(let w=0;w<_;w++){e.loadCell(w,this._workCell);let p=this._workCell.getWidth();if(p===0)continue;let C=!1,b=w>=F,E=w,x=this._workCell;if(d.length>0&&w===d[0][0]&&b){let ie=d.shift(),Us=this._isCellInSelection(ie[0],t);for(v=ie[0]+1;v<ie[1];v++)b&&=Us===this._isCellInSelection(v,t);b&&=!i||n<ie[0]||n>=ie[1],b?(C=!0,x=new e4(this._workCell,e.translateToString(!0,ie[0],ie[1]),ie[1]-ie[0]),E=ie[1]-1,p=x.getWidth()):F=ie[1]}let A=this._isCellInSelection(w,t),k=i&&w===n,U=wt&&w>=h&&w<=c,Q=!1;this._decorationService.forEachDecorationAtCell(w,t,void 0,ie=>{Q=!0});let K=x.getChars()||br;if(K===" "&&(x.isUnderline()||x.isOverline())&&(K=" "),I=p*a-o.get(K,x.isBold(),x.isItalic()),!y)y=this._document.createElement("span");else if(M&&(A&&O||!A&&!O&&x.bg===S)&&(A&&O&&f.selectionForeground||x.fg===g)&&x.extended.ext===T&&U===L&&I===B&&!k&&!C&&!Q&&b){x.isInvisible()?m+=br:m+=K,M++;continue}else M&&(y.textContent=m),y=this._document.createElement("span"),M=0,m="";if(S=x.bg,g=x.fg,T=x.extended.ext,L=U,B=I,O=A,C&&n>=w&&n<=E&&(n=w),!this._coreService.isCursorHidden&&k&&this._coreService.isCursorInitialized){if(P.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&P.push("xterm-cursor-blink"),P.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":P.push("xterm-cursor-outline");break;case"block":P.push("xterm-cursor-block");break;case"bar":P.push("xterm-cursor-bar");break;case"underline":P.push("xterm-cursor-underline");break;default:break}}if(x.isBold()&&P.push("xterm-bold"),x.isItalic()&&P.push("xterm-italic"),x.isDim()&&P.push("xterm-dim"),x.isInvisible()?m=br:m=x.getChars()||br,x.isUnderline()&&(P.push(`xterm-underline-${x.extended.underlineStyle}`),m===" "&&(m=" "),!x.isUnderlineColorDefault()))if(x.isUnderlineColorRGB())y.style.textDecorationColor=`rgb(${Wa.toColorRGB(x.getUnderlineColor()).join(",")})`;else{let ie=x.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&x.isBold()&&ie<8&&(ie+=8),y.style.textDecorationColor=f.ansi[ie].css}x.isOverline()&&(P.push("xterm-overline"),m===" "&&(m=" ")),x.isStrikethrough()&&P.push("xterm-strikethrough"),U&&(y.style.textDecoration="underline");let J=x.getFgColor(),Pe=x.getFgColorMode(),te=x.getBgColor(),Ee=x.getBgColorMode(),le=!!x.isInverse();if(le){let ie=J;J=te,te=ie;let Us=Pe;Pe=Ee,Ee=Us}let De,Hs,Ni=!1;this._decorationService.forEachDecorationAtCell(w,t,void 0,ie=>{ie.options.layer!=="top"&&Ni||(ie.backgroundColorRGB&&(Ee=50331648,te=ie.backgroundColorRGB.rgba>>8&16777215,De=ie.backgroundColorRGB),ie.foregroundColorRGB&&(Pe=50331648,J=ie.foregroundColorRGB.rgba>>8&16777215,Hs=ie.foregroundColorRGB),Ni=ie.options.layer==="top")}),!Ni&&A&&(De=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,te=De.rgba>>8&16777215,Ee=50331648,Ni=!0,f.selectionForeground&&(Pe=50331648,J=f.selectionForeground.rgba>>8&16777215,Hs=f.selectionForeground)),Ni&&P.push("xterm-decoration-top");let Gt;switch(Ee){case 16777216:case 33554432:Gt=f.ansi[te],P.push(`xterm-bg-${te}`);break;case 50331648:Gt=Ve.toColor(te>>16,te>>8&255,te&255),this._addStyle(y,`background-color:#${XS((te>>>0).toString(16),"0",6)}`);break;default:le?(Gt=f.foreground,P.push("xterm-bg-257")):Gt=f.background}switch(De||x.isDim()&&(De=ye.multiplyOpacity(Gt,.5)),Pe){case 16777216:case 33554432:x.isBold()&&J<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(J+=8),this._applyMinimumContrast(y,Gt,f.ansi[J],x,De,void 0)||P.push(`xterm-fg-${J}`);break;case 50331648:let ie=Ve.toColor(J>>16&255,J>>8&255,J&255);this._applyMinimumContrast(y,Gt,ie,x,De,Hs)||this._addStyle(y,`color:#${XS(J.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(y,Gt,f.foreground,x,De,Hs)||le&&P.push("xterm-fg-257")}P.length&&(y.className=P.join(" "),P.length=0),!k&&!C&&!Q&&b?M++:y.textContent=m,I!==this.defaultSpacing&&(y.style.letterSpacing=`${I}px`),u.push(y),w=E}return y&&M&&(y.textContent=m),u}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||s4(s.getCode()))return!1;let l=this._getContrastCache(s),a;if(!r&&!n&&(a=l.getColor(t.rgba,i.rgba)),a===void 0){let o=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=ye.ensureContrastRatio(r||t,n||i,o),l.setColor((r||t).rgba,(n||i).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};B_=Oe([H(1,Oy),H(2,Ot),H(3,Ts),H(4,an),H(5,Va),H(6,ul)],B_);function XS(e,t,i){for(;e.length<i;)e=t+e;return e}var n4=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let l=this._measure(e,0);return l>0&&(this._flat[s]=l),l}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let l=0;t&&(l|=1),i&&(l|=2),n=this._measure(e,l),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},l4=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,l=i[1]-r,a=Math.max(n,0),o=Math.min(l,e.rows-1);if(a>=e.rows||o<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=l,this.viewportCappedStartRow=a,this.viewportCappedEndRow=o,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function a4(){return new l4}var t_="xterm-dom-renderer-owner-",yi="xterm-rows",Kh="xterm-fg-",ZS="xterm-bg-",Ta="xterm-focus",jh="xterm-selection",o4=1,k_=class extends G{constructor(e,t,i,s,r,n,l,a,o,h,c,u,d,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=l,this._charSizeService=o,this._optionsService=h,this._bufferService=c,this._coreService=u,this._coreBrowserService=d,this._themeService=f,this._terminalClass=o4++,this._rowElements=[],this._selectionRenderModel=a4(),this.onRequestRedraw=this._register(new N).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(yi),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(jh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=r4(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(_=>this._injectCss(_))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(B_,document),this._element.classList.add(t_+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(_=>this._handleLinkHover(_))),this._register(this._linkifier2.onHideLinkUnderline(_=>this._handleLinkLeave(_))),this._register(be(()=>{this._element.classList.remove(t_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new n4(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${yi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${yi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${yi} .xterm-dim { color: ${ye.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${yi}.${Ta} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${yi}.${Ta} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${yi}.${Ta} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${jh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${jh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${jh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Kh}${n} { color: ${l.css}; }${this._terminalSelector} .${Kh}${n}.xterm-dim { color: ${ye.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${ZS}${n} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Kh}257 { color: ${ye.opaque(e.background).css}; }${this._terminalSelector} .${Kh}257.xterm-dim { color: ${ye.multiplyOpacity(ye.opaque(e.background),.5).css}; }${this._terminalSelector} .${ZS}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Ta),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ta),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){let o=e[0]>t[0];a.appendChild(this._createSelectionElement(n,o?t[0]:e[0],o?e[0]:t[0],l-n+1))}else{let o=s===n?e[0]:0,h=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,o,h));let c=l-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,c)),n!==l){let u=r===l?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(l,0,u))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(i-t);return n+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${l}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=e;o<=t;o++){let h=o+i.ydisp,c=this._rowElements[o],u=i.lines.get(h);if(!c||!u)break;c.replaceChildren(...this._rowFactory.createRow(u,h,h===s,l,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${t_}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let l=this._bufferService.rows-1;i=Math.max(Math.min(i,l),0),s=Math.max(Math.min(s,l),0),r=Math.min(r,this._bufferService.cols);let a=this._bufferService.buffer,o=a.ybase+a.y,h=Math.min(a.x,r-1),c=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=s;++f){let _=f+a.ydisp,y=this._rowElements[f],M=a.lines.get(_);if(!y||!M)break;y.replaceChildren(...this._rowFactory.createRow(M,_,_===o,u,d,h,c,this.dimensions.css.cell.width,this._widthCache,n?f===i?e:0:-1,n?(f===s?t:r)-1:-1))}}};k_=Oe([H(7,K_),H(8,vc),H(9,Ot),H(10,kt),H(11,an),H(12,Ts),H(13,ul)],k_);var O_=class extends G{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new N),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new c4(this._optionsService))}catch{this._measureStrategy=this._register(new h4(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};O_=Oe([H(2,Ot)],O_);var ob=class extends G{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},h4=class extends ob{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},c4=class extends ob{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},u4=class extends G{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new d4(this._window)),this._onDprChange=this._register(new N),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new N),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(St.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(W(this._textarea,"focus",()=>this._isFocused=!0)),this._register(W(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},d4=class extends G{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new cl),this._onDprChange=this._register(new N),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(be(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=W(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},f4=class extends G{constructor(){super(),this.linkProviders=[],this._register(be(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function t0(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),l=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-l]}function _4(e,t,i,s,r,n,l,a,o){if(!n)return;let h=t0(e,t,i);if(h)return h[0]=Math.ceil((h[0]+(o?l/2:0))/l),h[1]=Math.ceil(h[1]/a),h[0]=Math.min(Math.max(h[0],1),s+(o?1:0)),h[1]=Math.min(Math.max(h[1],1),r),h}var N_=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return _4(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=t0(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};N_=Oe([H(0,Ms),H(1,vc)],N_);var g4=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},hb={};Q3(hb,{getSafariVersion:()=>m4,isChromeOS:()=>fb,isFirefox:()=>cb,isIpad:()=>p4,isIphone:()=>S4,isLegacyEdge:()=>v4,isLinux:()=>i0,isMac:()=>dc,isNode:()=>Sc,isSafari:()=>ub,isWindows:()=>db});var Sc=typeof process<"u"&&"title"in process,Ya=Sc?"node":navigator.userAgent,Ga=Sc?"node":navigator.platform,cb=Ya.includes("Firefox"),v4=Ya.includes("Edge"),ub=/^((?!chrome|android).)*safari/i.test(Ya);function m4(){if(!ub)return 0;let e=Ya.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var dc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ga),p4=Ga==="iPad",S4=Ga==="iPhone",db=["Windows","Win16","Win32","WinCE"].includes(Ga),i0=Ga.indexOf("Linux")>=0,fb=/\bCrOS\b/.test(Ya),_b=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},y4=class extends _b{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},b4=class extends _b{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},fc=!Sc&&"requestIdleCallback"in window?b4:y4,w4=class{constructor(){this._queue=new fc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},z_=class extends G{constructor(e,t,i,s,r,n,l,a,o){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=a,this._renderer=this._register(new cl),this._pausedResizeTask=new w4,this._observerDisposable=this._register(new cl),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new N),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new N),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new N),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new N),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g4((h,c)=>this._renderRows(h,c),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new C4(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(be(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(o.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=be(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};z_=Oe([H(2,Ot),H(3,vc),H(4,an),H(5,Va),H(6,kt),H(7,Ts),H(8,ul)],z_);var C4=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function x4(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return M4(r,n,e,t,i,s)+yc(n,t,i,s)+L4(r,n,e,t,i,s);let l;if(n===t)return l=r>e?"D":"C",Fa(Math.abs(r-e),Ia(l,s));l=n>t?"D":"C";let a=Math.abs(n-t),o=T4(n>t?e:r,i)+(a-1)*i.cols+1+E4(n>t?r:e,i);return Fa(o,Ia(l,s))}function E4(e,t){return e-1}function T4(e,t){return t.cols-e}function M4(e,t,i,s,r,n){return yc(t,s,r,n).length===0?"":Fa(vb(e,t,e,t-ln(t,r),!1,r).length,Ia("D",n))}function yc(e,t,i,s){let r=e-ln(e,i),n=t-ln(t,i),l=Math.abs(r-n)-A4(e,t,i);return Fa(l,Ia(gb(e,t),s))}function L4(e,t,i,s,r,n){let l;yc(t,s,r,n).length>0?l=s-ln(s,r):l=t;let a=s,o=D4(e,t,i,s,r,n);return Fa(vb(e,l,i,a,o==="C",r).length,Ia(o,n))}function A4(e,t,i){let s=0,r=e-ln(e,i),n=t-ln(t,i);for(let l=0;l<Math.abs(r-n);l++){let a=gb(e,t)==="A"?-1:1;i.buffer.lines.get(r+a*l)?.isWrapped&&s++}return s}function ln(e,t){let i=0,s=t.buffer.lines.get(e),r=s?.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),r=s?.isWrapped;return i}function D4(e,t,i,s,r,n){let l;return yc(i,s,r,n).length>0?l=s-ln(s,r):l=t,e<i&&l<=s||e>=i&&l<s?"C":"D"}function gb(e,t){return e>t?"A":"B"}function vb(e,t,i,s,r,n){let l=e,a=t,o="";for(;(l!==i||a!==s)&&a>=0&&a<n.buffer.lines.length;)l+=r?1:-1,r&&l>n.cols-1?(o+=n.buffer.translateBufferLineToString(a,!1,e,l),l=0,e=0,a++):!r&&l<0&&(o+=n.buffer.translateBufferLineToString(a,!1,0,e+1),l=n.cols-1,e=l,a--);return o+n.buffer.translateBufferLineToString(a,!1,e,l)}function Ia(e,t){let i=t?"O":"[";return R.ESC+i+e}function Fa(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var R4=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function QS(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var i_=50,B4=15,k4=50,O4=500,N4=" ",z4=new RegExp(N4,"g"),H_=class extends G{constructor(e,t,i,s,r,n,l,a,o){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=l,this._renderService=a,this._coreBrowserService=o,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ci,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new N),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new N),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new N),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new N),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new R4(this._bufferService),this._activeSelectionMode=0,this._register(be(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let a=i.translateBufferLineToString(l,!0,r,n);s.push(a)}}else{let r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let n=e[1]+1;n<=t[1]-1;n++){let l=i.lines.get(n),a=i.translateBufferLineToString(n,!0);l?.isWrapped?s[s.length-1]+=a:s.push(a)}if(e[1]!==t[1]){let n=i.lines.get(t[1]),l=i.translateBufferLineToString(t[1],!0,0,t[0]);n&&n.isWrapped?s[s.length-1]+=l:s.push(l)}}return s.map(r=>r.replace(z4," ")).join(db?`\r
41
41
  `:`
42
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Of&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=kp(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Rf(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Rd),Rd),t/=Rd,t/Math.abs(t)+Math.round(t*(xE-1)))}shouldForceSelection(e){return ah?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),TE)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(ah&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<DE&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=gE(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let l=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),o=a,h=e[0]-a,u=0,d=0,c=0,f=0;if(l.charAt(a)===" "){for(;a>0&&l.charAt(a-1)===" ";)a--;for(;o<l.length&&l.charAt(o+1)===" ";)o++}else{let y=e[0],m=e[0];n.getWidth(y)===0&&(u++,y--),n.getWidth(m)===2&&(d++,m++);let v=n.getString(m).length;for(v>1&&(f+=v-1,o+=v-1);y>0&&a>0&&!this._isCharWordSeparator(n.loadCell(y-1,this._workCell));){n.loadCell(y-1,this._workCell);let g=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,y--):g>1&&(c+=g-1,a-=g-1),a--,y--}for(;m<n.length&&o+1<l.length&&!this._isCharWordSeparator(n.loadCell(m+1,this._workCell));){n.loadCell(m+1,this._workCell);let g=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,m++):g>1&&(f+=g-1,o+=g-1),o++,m++}}o++;let _=a+h-u+c,p=Math.min(this._bufferService.cols,o-a+u+d-c-f);if(!(!t&&l.slice(a,o).trim()==="")){if(i&&_===0&&n.getCodePoint(0)!==32){let y=r.lines.get(e[1]-1);if(y&&n.isWrapped&&y.getCodePoint(this._bufferService.cols-1)!==32){let m=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(m){let v=this._bufferService.cols-m.start;_-=v,p+=v}}}if(s&&_+p===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let y=r.lines.get(e[1]+1);if(y?.isWrapped&&y.getCodePoint(0)!==32){let m=this._getWordAt([0,e[1]+1],!1,!1,!0);m&&(p+=m.length)}}return{start:_,length:p}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=kp(i,this._bufferService.cols)}};df=Ee([B(3,_t),B(4,gr),B(5,Cf),B(6,mt),B(7,Zi),B(8,Wi)],df);var zp=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Lp=class{constructor(){this._color=new zp,this._css=new zp}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ze=Object.freeze((()=>{let e=[Se.toColor("#2e3436"),Se.toColor("#cc0000"),Se.toColor("#4e9a06"),Se.toColor("#c4a000"),Se.toColor("#3465a4"),Se.toColor("#75507b"),Se.toColor("#06989a"),Se.toColor("#d3d7cf"),Se.toColor("#555753"),Se.toColor("#ef2929"),Se.toColor("#8ae234"),Se.toColor("#fce94f"),Se.toColor("#729fcf"),Se.toColor("#ad7fa8"),Se.toColor("#34e2e2"),Se.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:Oe.toCss(s,r,n),rgba:Oe.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:Oe.toCss(s,s,s),rgba:Oe.toRgba(s,s,s)})}return e})()),ur=Se.toColor("#ffffff"),Ll=Se.toColor("#000000"),Hp=Se.toColor("#ffffff"),Up=Ll,Rl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},RE=ur,ff=class extends Y{constructor(e){super(),this._optionsService=e,this._contrastCache=new Lp,this._halfContrastCache=new Lp,this._onChangeColors=this._register(new E),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ur,background:Ll,cursor:Hp,cursorAccent:Up,selectionForeground:void 0,selectionBackgroundTransparent:Rl,selectionBackgroundOpaque:de.blend(Ll,Rl),selectionInactiveBackgroundTransparent:Rl,selectionInactiveBackgroundOpaque:de.blend(Ll,Rl),scrollbarSliderBackground:de.opacity(ur,.2),scrollbarSliderHoverBackground:de.opacity(ur,.4),scrollbarSliderActiveBackground:de.opacity(ur,.5),overviewRulerBorder:ur,ansi:ze.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=ne(e.foreground,ur),t.background=ne(e.background,Ll),t.cursor=de.blend(t.background,ne(e.cursor,Hp)),t.cursorAccent=de.blend(t.background,ne(e.cursorAccent,Up)),t.selectionBackgroundTransparent=ne(e.selectionBackground,Rl),t.selectionBackgroundOpaque=de.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=ne(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=de.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?ne(e.selectionForeground,Op):void 0,t.selectionForeground===Op&&(t.selectionForeground=void 0),de.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=de.opacity(t.selectionBackgroundTransparent,.3)),de.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=de.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=ne(e.scrollbarSliderBackground,de.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=ne(e.scrollbarSliderHoverBackground,de.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=ne(e.scrollbarSliderActiveBackground,de.opacity(t.foreground,.5)),t.overviewRulerBorder=ne(e.overviewRulerBorder,RE),t.ansi=ze.slice(),t.ansi[0]=ne(e.black,ze[0]),t.ansi[1]=ne(e.red,ze[1]),t.ansi[2]=ne(e.green,ze[2]),t.ansi[3]=ne(e.yellow,ze[3]),t.ansi[4]=ne(e.blue,ze[4]),t.ansi[5]=ne(e.magenta,ze[5]),t.ansi[6]=ne(e.cyan,ze[6]),t.ansi[7]=ne(e.white,ze[7]),t.ansi[8]=ne(e.brightBlack,ze[8]),t.ansi[9]=ne(e.brightRed,ze[9]),t.ansi[10]=ne(e.brightGreen,ze[10]),t.ansi[11]=ne(e.brightYellow,ze[11]),t.ansi[12]=ne(e.brightBlue,ze[12]),t.ansi[13]=ne(e.brightMagenta,ze[13]),t.ansi[14]=ne(e.brightCyan,ze[14]),t.ansi[15]=ne(e.brightWhite,ze[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=ne(e.extendedAnsi[s],ze[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};ff=Ee([B(0,mt)],ff);function ne(e,t){if(e!==void 0)try{return Se.toColor(e)}catch{}return t}var OE=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},BE=class{constructor(){this._services=new OE,this._services.set(wf,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=Jw(e).sort((n,l)=>n.index-l.index),s=[];for(let n of i){let l=this._services.get(n.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(l)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},NE={trace:0,debug:1,info:2,warn:3,error:4,off:5},kE="xterm.js: ",_f=class extends Y{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),zE=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=NE[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":kE)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};_f=Ee([B(0,mt)],_f);var zE,qp=class extends Y{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new E),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new E),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new E),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},P=3,Re=Object.freeze(new jl),Go=0,Od=2,Hl=class $1{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*P);let r=i||Jt.fromCharData([0,h1,1,0]);for(let n=0;n<t;++n)this.setCell(n,r);this.length=t}get(t){let i=this._data[t*P+0],s=i&2097151;return[this._data[t*P+1],i&2097152?this._combined[t]:s?zs(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*P+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*P+0]=t|2097152|i[2]<<22):this._data[t*P+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*P+0]>>22}hasWidth(t){return this._data[t*P+0]&12582912}getFg(t){return this._data[t*P+1]}getBg(t){return this._data[t*P+2]}hasContent(t){return this._data[t*P+0]&4194303}getCodePoint(t){let i=this._data[t*P+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*P+0]&2097152}getString(t){let i=this._data[t*P+0];return i&2097152?this._combined[t]:i&2097151?zs(i&2097151):""}isProtected(t){return this._data[t*P+2]&536870912}loadCell(t,i){return Go=t*P,i.content=this._data[Go+0],i.fg=this._data[Go+1],i.bg=this._data[Go+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*P+0]=i.content,this._data[t*P+1]=i.fg,this._data[t*P+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*P+0]=i|s<<22,this._data[t*P+1]=r.fg,this._data[t*P+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*P+0];r&2097152?this._combined[t]+=zs(i):r&2097151?(this._combined[t]=zs(r&2097151)+zs(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*P+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let r=new Jt;for(let n=this.length-t-i-1;n>=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;n<i;++n)this.setCell(t+n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let r=new Jt;for(let n=0;n<this.length-t-i;++n)this.setCell(t+n,this.loadCell(t+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*Od<this._data.buffer.byteLength;let s=t*P;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);let r=Object.keys(this._combined);for(let l=0;l<r.length;l++){let a=parseInt(r[l],10);a>=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let l=0;l<n.length;l++){let a=parseInt(n[l],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*Od<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Od<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new $1(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*P+0]&4194303)return t+(this._data[t*P+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*P+0]&4194303||this._data[t*P+2]&50331648)return t+(this._data[t*P+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let l=t._data;if(n)for(let o=r-1;o>=0;o--){for(let h=0;h<P;h++)this._data[(s+o)*P+h]=l[(i+o)*P+h];l[(i+o)*P+2]&268435456&&(this._extendedAttrs[s+o]=t._extendedAttrs[i+o])}else for(let o=0;o<r;o++){for(let h=0;h<P;h++)this._data[(s+o)*P+h]=l[(i+o)*P+h];l[(i+o)*P+2]&268435456&&(this._extendedAttrs[s+o]=t._extendedAttrs[i+o])}let a=Object.keys(t._combined);for(let o=0;o<a.length;o++){let h=parseInt(a[o],10);h>=i&&(this._combined[h-i+s]=t._combined[h])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let l=this._data[i*P+0],a=l&2097151,o=l&2097152?this._combined[i]:a?zs(a):Ls;if(n+=o,r)for(let h=0;h<o.length;++h)r.push(i);i+=l>>22||1}return r&&r.push(i),n}};function LE(e,t,i,s,r,n){let l=[];for(let a=0;a<e.length-1;a++){let o=a,h=e.get(++o);if(!h.isWrapped)continue;let u=[e.get(a)];for(;o<e.length&&h.isWrapped;)u.push(h),h=e.get(++o);if(!n&&s>=a&&s<o){a+=u.length-1;continue}let d=0,c=Il(u,d,t),f=1,_=0;for(;f<u.length;){let y=Il(u,f,t),m=y-_,v=i-c,g=Math.min(m,v);u[d].copyCellsFrom(u[f],_,c,g,!1),c+=g,c===i&&(d++,c=0),_+=g,_===y&&(f++,_=0),c===0&&d!==0&&u[d-1].getWidth(i-1)===2&&(u[d].copyCellsFrom(u[d-1],i-1,c++,1,!1),u[d-1].setCell(i-1,r))}u[d].replaceCells(c,i,r);let p=0;for(let y=u.length-1;y>0&&(y>d||u[y].getTrimmedLength()===0);y--)p++;p>0&&(l.push(a+u.length-p),l.push(p)),a+=u.length-1}return l}function HE(e,t){let i=[],s=0,r=t[s],n=0;for(let l=0;l<e.length;l++)if(r===l){let a=t[++s];e.onDeleteEmitter.fire({index:l-n,amount:a}),l+=a-1,n+=a,r=t[++s]}else i.push(l);return{layout:i,countRemoved:n}}function UE(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function qE(e,t,i){let s=[],r=e.map((o,h)=>Il(e,h,t)).reduce((o,h)=>o+h),n=0,l=0,a=0;for(;a<r;){if(r-a<i){s.push(r-a);break}n+=i;let o=Il(e,l,t);n>o&&(n-=o,l++);let h=e[l].getWidth(n-1)===2;h&&n--;let u=h?i-1:i;s.push(u),a+=u}return s}function Il(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var eS=class tS{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=tS._nextId++,this._onDispose=this.register(new E),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),mr(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};eS._nextId=1;var YE=eS,He={},dr=He.B;He[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};He.A={"#":"£"};He.B=void 0;He[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};He.C=He[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};He.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};He.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};He.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};He.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};He.E=He[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};He.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};He.H=He[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};He["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Yp=4294967295,Kp=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Re.clone(),this.savedCharset=dr,this.markers=[],this._nullCell=Jt.fromCharData([0,h1,1,0]),this._whitespaceCell=Jt.fromCharData([0,Ls,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new oh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new qp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new th),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new th),this._whitespaceCell}getBlankLine(e,t){return new Hl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Yp?Yp:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Re);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new qp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(Re),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)s+=+this.lines.get(l).resize(e,i);let n=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Hl(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new Hl(e,i)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let l=this.lines.length-r;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=LE(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Re),i);if(s.length>0){let r=HE(this.lines,s);UE(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(Re),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Hl(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(Re),r=[],n=0;for(let l=this.lines.length-1;l>=0;l--){let a=this.lines.get(l);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let o=[a];for(;a.isWrapped&&l>0;)a=this.lines.get(--l),o.unshift(a);if(!i){let g=this.ybase+this.y;if(g>=l&&g<l+o.length)continue}let h=o[o.length-1].getTrimmedLength(),u=qE(o,this._cols,e),d=u.length-o.length,c;this.ybase===0&&this.y!==this.lines.length-1?c=Math.max(0,this.y-this.lines.maxLength+d):c=Math.max(0,this.lines.length-this.lines.maxLength+d);let f=[];for(let g=0;g<d;g++){let S=this.getBlankLine(Re,!0);f.push(S)}f.length>0&&(r.push({start:l+o.length+n,newLines:f}),n+=f.length),o.push(...f);let _=u.length-1,p=u[_];p===0&&(_--,p=u[_]);let y=o.length-d-1,m=h;for(;y>=0;){let g=Math.min(m,p);if(o[_]===void 0)break;if(o[_].copyCellsFrom(o[y],m-g,p-g,g,!0),p-=g,p===0&&(_--,p=u[_]),m-=g,m===0){y--;let S=Math.max(y,0);m=Il(o,S,this._cols)}}for(let g=0;g<o.length;g++)u[g]<e&&o[g].setCell(u[g],s);let v=d-c;for(;v-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(r.length>0){let l=[],a=[];for(let p=0;p<this.lines.length;p++)a.push(this.lines.get(p));let o=this.lines.length,h=o-1,u=0,d=r[u];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let c=0;for(let p=Math.min(this.lines.maxLength-1,o+n-1);p>=0;p--)if(d&&d.start>h+c){for(let y=d.newLines.length-1;y>=0;y--)this.lines.set(p--,d.newLines[y]);p++,l.push({index:h+1,amount:d.newLines.length}),c+=d.newLines.length,d=r[++u]}else this.lines.set(p,a[h--]);let f=0;for(let p=l.length-1;p>=0;p--)l[p].index+=f,this.lines.onInsertEmitter.fire(l[p]),f+=l[p].amount;let _=Math.max(0,o+n-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new YE(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},KE=class extends Y{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new E),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new Kp(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Kp(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},iS=2,sS=1,mf=class extends Y{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new E),this.onResize=this._onResize.event,this._onScroll=this._register(new E),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,iS),this.rows=Math.max(e.rawOptions.rows||0,sS),this.buffers=this._register(new KE(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let l=i.lines.isFull;n===i.lines.length-1?l?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),l?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let l=n-r+1;i.lines.shiftElements(r+1,l-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};mf=Ee([B(0,mt)],mf);var gn={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:ah,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},VE=["normal","bold","100","200","300","400","500","600","700","800","900"],PE=class extends Y{constructor(e){super(),this._onOptionChange=this._register(new E),this.onOptionChange=this._onOptionChange.event;let t={...gn};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(fe(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in gn))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in gn))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=gn[e]),!GE(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=gn[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=VE.includes(t)?t:gn[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function GE(e){return e==="block"||e==="underline"||e==="bar"}function Ul(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&Ul(e[s],t-1);return i}var Vp=Object.freeze({insertMode:!1}),Pp=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),vf=class extends Y{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new E),this.onData=this._onData.event,this._onUserInput=this._register(new E),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new E),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new E),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Ul(Vp),this.decPrivateModes=Ul(Pp)}reset(){this.modes=Ul(Vp),this.decPrivateModes=Ul(Pp)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};vf=Ee([B(0,_t),B(1,_1),B(2,mt)],vf);var Gp={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Bd(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Nd=String.fromCharCode,Ip={DEFAULT:e=>{let t=[Bd(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Nd(t[0])}${Nd(t[1])}${Nd(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Bd(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Bd(e,!0)};${e.x};${e.y}${t}`}},gf=class extends Y{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new E),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(Gp))this.addProtocol(s,Gp[s]);for(let s of Object.keys(Ip))this.addEncoding(s,Ip[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};gf=Ee([B(0,_t),B(1,gr),B(2,mt)],gf);var kd=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],IE=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Le;function jE(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var XE=class{constructor(){if(this.version="6",!Le){Le=new Uint8Array(65536),Le.fill(1),Le[0]=0,Le.fill(0,1,32),Le.fill(0,127,160),Le.fill(2,4352,4448),Le[9001]=2,Le[9002]=2,Le.fill(2,11904,42192),Le[12351]=1,Le.fill(2,44032,55204),Le.fill(2,63744,64256),Le.fill(2,65040,65050),Le.fill(2,65072,65136),Le.fill(2,65280,65377),Le.fill(2,65504,65511);for(let e=0;e<kd.length;++e)Le.fill(0,kd[e][0],kd[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Le[e]:jE(e,IE)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=fr.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return fr.createPropertyValue(0,i,s)}},fr=class eh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new E,this.onChange=this._onChange.event;let t=new XE;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let l=t.charCodeAt(n);if(55296<=l&&l<=56319){if(++n>=r)return i+this.wcwidth(l);let h=t.charCodeAt(n);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:i+=this.wcwidth(h)}let a=this.charProperties(l,s),o=eh.extractWidth(a);eh.extractShouldJoin(a)&&(o-=eh.extractWidth(s)),i+=o,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},FE=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function jp(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var Ol=2147483647,WE=256,rS=class pf{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>WE)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new pf;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let r=t[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let t=new pf(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Ol?Ol:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Ol?Ol:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,Ol):t}},Bl=[],ZE=class{constructor(){this._state=0,this._active=Bl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Bl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Bl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Bl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",ch(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Bl,this._id=-1,this._state=0}}},Lt=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=ch(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},Nl=[],QE=class{constructor(){this._handlers=Object.create(null),this._active=Nl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Nl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Nl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Nl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",ch(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Nl,this._ident=0}},ql=new rS;ql.addParam(0);var Xp=class{constructor(e){this._handler=e,this._data="",this._params=ql,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ql,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=ch(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ql,this._data="",this._hitLimit=!1,i));return this._params=ql,this._data="",this._hitLimit=!1,t}},JE=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}},Qt=160,$E=(function(){let e=new JE(4095),t=Array.apply(null,Array(256)).map((a,o)=>o),i=(a,o)=>t.slice(a,o),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),l;e.setDefault(1,0),e.addMany(s,0,2,0);for(l in n)e.addMany([24,26,153,154],l,3,0),e.addMany(i(128,144),l,3,0),e.addMany(i(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Qt,0,2,0),e.add(Qt,8,5,8),e.add(Qt,6,0,6),e.add(Qt,11,0,11),e.add(Qt,13,13,13),e})(),ex=class extends Y{constructor(e=$E){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new rS,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(fe(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new ZE),this._dcsParser=this._register(new QE),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,o=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&o>-1){for(;o>=0&&(l=a[o](this._params),l!==!0);o--)if(l instanceof Promise)return this._parseStack.handlerPos=o,l}this._parseStack.handlers=[];break;case 4:if(i===!1&&o>-1){for(;o>=0&&(l=a[o](),l!==!0);o--)if(l instanceof Promise)return this._parseStack.handlerPos=o,l}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(s!==24&&s!==26,i),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],l=this._oscParser.end(s!==24&&s!==26,i),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a<t;++a){switch(s=e[a],r=this._transitions.table[this.currentState<<8|(s<160?s:Qt)],r>>4){case 2:for(let c=a+1;;++c){if(c>=t||(s=e[c])<32||s>126&&s<Qt){this._printHandler(e,a,c),a=c-1;break}if(++c>=t||(s=e[c])<32||s>126&&s<Qt){this._printHandler(e,a,c),a=c-1;break}if(++c>=t||(s=e[c])<32||s>126&&s<Qt){this._printHandler(e,a,c),a=c-1;break}if(++c>=t||(s=e[c])<32||s>126&&s<Qt){this._printHandler(e,a,c),a=c-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|s],h=o?o.length-1:-1;for(;h>=0&&(l=o[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._preserveStack(3,o,h,r,a),l;h<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a<t&&(s=e[a])>47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let u=this._escHandlers[this._collect<<8|s],d=u?u.length-1:-1;for(;d>=0&&(l=u[d](),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(4,u,d,r,a),l;d<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let c=a+1;;++c)if(c>=t||(s=e[c])===24||s===26||s===27||s>127&&s<Qt){this._dcsParser.put(e,a,c),a=c-1;break}break;case 14:if(l=this._dcsParser.unhook(s!==24&&s!==26),l)return this._preserveStack(6,[],0,r,a),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let c=a+1;;c++)if(c>=t||(s=e[c])<32||s>127&&s<Qt){this._oscParser.put(e,a,c),a=c-1;break}break;case 6:if(l=this._oscParser.end(s!==24&&s!==26),l)return this._preserveStack(5,[],0,r,a),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},tx=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,ix=/^[\da-f]+$/;function Fp(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=tx.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),ix.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(t.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function zd(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function sx(e,t=16){let[i,s,r]=e;return`rgb:${zd(i,t)}/${zd(s,t)}/${zd(r,t)}`}var rx={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ks=131072,Wp=10;function Zp(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Qp=5e3,Jp=0,nx=class extends Y{constructor(e,t,i,s,r,n,l,a,o=new ex){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=l,this._unicodeService=a,this._parser=o,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Zw,this._utf8Decoder=new Qw,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Re.clone(),this._eraseAttrDataInternal=Re.clone(),this._onRequestBell=this._register(new E),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new E),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new E),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new E),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new E),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new E),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new E),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new E),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new E),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new E),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new E),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new E),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new E),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Sf(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,u)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:u.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,u,d)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:u,data:d})}),this._parser.setDcsHandlerFallback((h,u,d)=>{u==="HOOK"&&(d=d.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:u,payload:d})}),this._parser.setPrintHandler((h,u,d)=>this.print(h,u,d)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(w.BEL,()=>this.bell()),this._parser.setExecuteHandler(w.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(w.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(w.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(w.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(w.BS,()=>this.backspace()),this._parser.setExecuteHandler(w.HT,()=>this.tab()),this._parser.setExecuteHandler(w.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(w.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Jo.IND,()=>this.index()),this._parser.setExecuteHandler(Jo.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Jo.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Lt(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new Lt(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new Lt(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new Lt(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new Lt(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new Lt(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new Lt(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new Lt(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new Lt(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new Lt(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new Lt(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new Lt(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in He)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Xp((h,u)=>this.requestStatusString(h,u)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),Qp))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Qp} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,l=this._parseStack.paused;if(l){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ks&&(n=this._parseStack.position+ks)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<ks&&(this._parseBuffer=new Uint32Array(Math.min(e.length,ks))),l||this._dirtyRowTracker.clearRange(),e.length>ks)for(let h=n;h<e.length;h+=ks){let u=h+ks<e.length?h+ks:e.length,d=typeof e=="string"?this._stringDecoder.decode(e.substring(h,u),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,u),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,d))return this._preserveStack(s,r,d,h),this._logSlowResolvingAsync(i),i}else if(!l){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,h))return this._preserveStack(s,r,h,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),o=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);o<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(o,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,i){let s,r,n=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,o=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let c=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(s=e[f],s<127&&n){let m=n[String.fromCharCode(s)];m&&(s=m.charCodeAt(0))}let _=this._unicodeService.charProperties(s,c);r=fr.extractWidth(_);let p=fr.extractShouldJoin(_),y=p?fr.extractWidth(c):0;if(c=_,l&&this._onA11yChar.fire(zs(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-y>a){if(o){let m=d,v=this._activeBuffer.x-y;for(this._activeBuffer.x=y,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),y>0&&d instanceof Hl&&d.copyCellsFrom(m,v,0,y,!1);v<a;)m.setCellFromCodepoint(v++,0,1,u)}else if(this._activeBuffer.x=a-1,r===2)continue}if(p&&this._activeBuffer.x){let m=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-m,s,r);for(let v=r-y;--v>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(h&&(d.insertCells(this._activeBuffer.x,r-y,this._activeBuffer.getNullCell(u)),d.getWidth(a-1)===2&&d.setCellFromCodepoint(a-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,s,r,u),r>0)for(;--r;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=c,this._activeBuffer.x<a&&i-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>Zp(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Xp(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Lt(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Re));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,s=fr.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),l=new Uint32Array(n.length*i),a=0;for(let h=0;h<n.length;){let u=n.codePointAt(h)||0;l[a++]=u,h+=u>65535?2:1}let o=a;for(let h=1;h<i;++h)l.copyWithin(o,0,a),o+=a;return this.print(l,0,o),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(w.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(w.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(w.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(w.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(w.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,dr),this._charsetService.setgCharset(1,dr),this._charsetService.setgCharset(2,dr),this._charsetService.setgCharset(3,dr);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let i;(p=>(p[p.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",p[p.SET=1]="SET",p[p.RESET=2]="RESET",p[p.PERMANENTLY_SET=3]="PERMANENTLY_SET",p[p.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,l=this._coreService,{buffers:a,cols:o}=this._bufferService,{active:h,alt:u}=a,d=this._optionsService.rawOptions,c=(p,y)=>(l.triggerDataEvent(`${w.ESC}[${t?"":"?"}${p};${y}$y`),!0),f=p=>p?1:2,_=e.params[0];return t?_===2?c(_,4):_===4?c(_,f(l.modes.insertMode)):_===12?c(_,3):_===20?c(_,f(d.convertEol)):c(_,0):_===1?c(_,f(s.applicationCursorKeys)):_===3?c(_,d.windowOptions.setWinLines?o===80?2:o===132?1:0:0):_===6?c(_,f(s.origin)):_===7?c(_,f(s.wraparound)):_===8?c(_,3):_===9?c(_,f(r==="X10")):_===12?c(_,f(d.cursorBlink)):_===25?c(_,f(!l.isCursorHidden)):_===45?c(_,f(s.reverseWraparound)):_===66?c(_,f(s.applicationKeypad)):_===67?c(_,4):_===1e3?c(_,f(r==="VT200")):_===1002?c(_,f(r==="DRAG")):_===1003?c(_,f(r==="ANY")):_===1004?c(_,f(s.sendFocus)):_===1005?c(_,4):_===1006?c(_,f(n==="SGR")):_===1015?c(_,4):_===1016?c(_,f(n==="SGR_PIXELS")):_===1048?c(_,1):_===47||_===1047||_===1049?c(_,f(h===u)):_===2004?c(_,f(s.bracketedPasteMode)):_===2026?c(_,f(s.synchronizedOutput)):c(_,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=jl.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let l=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=l[a];while(++a<l.length&&a+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let l=2;l<s.length;++l)s[l]===-1&&(s[l]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Re.fg,e.bg=Re.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=Re.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=Re.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=Re.fg&16777215,s.bg&=-67108864,s.bg|=Re.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${w.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${w.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${w.ESC}[?${t};${i}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Re.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Zp(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${w.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Wp&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Wp&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if($p(n))if(r==="?")t.push({type:0,index:n});else{let l=Fp(r);l&&t.push({type:1,index:n,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=Fp(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);$p(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,dr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(rx[e[0]],He[e[1]]||dr),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Re.clone(),this._eraseAttrDataInternal=Re.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Jt;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=l=>(this._coreService.triggerDataEvent(`${w.ESC}${l}${w.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Sf=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Jp=e,e=t,t=Jp),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Sf=Ee([B(0,_t)],Sf);function $p(e){return 0<=e&&e<256}var lx=5e7,e1=12,ax=50,ox=class extends Y{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new E),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>lx)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let l=a=>performance.now()-i>=e1?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(l);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=e1)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>ax&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},yf=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),o={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._dataByLinkId.set(o.id,o),o.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(l,n)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};yf=Ee([B(0,_t)],yf);var t1=!1,hx=class extends Y{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Sn),this._onBinary=this._register(new E),this.onBinary=this._onBinary.event,this._onData=this._register(new E),this.onData=this._onData.event,this._onLineFeed=this._register(new E),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new E),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new E),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new E),this._instantiationService=new BE,this.optionsService=this._register(new PE(e)),this._instantiationService.setService(mt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(mf)),this._instantiationService.setService(_t,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(_f)),this._instantiationService.setService(_1,this._logService),this.coreService=this._register(this._instantiationService.createInstance(vf)),this._instantiationService.setService(gr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(gf)),this._instantiationService.setService(f1,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(fr)),this._instantiationService.setService(tC,this.unicodeService),this._charsetService=this._instantiationService.createInstance(FE),this._instantiationService.setService(eC,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(yf),this._instantiationService.setService(m1,this._oscLinkService),this._inputHandler=this._register(new nx(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(it.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(it.forward(this._bufferService.onResize,this._onResize)),this._register(it.forward(this.coreService.onData,this._onData)),this._register(it.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new ox((t,i)=>this._inputHandler.parse(t,i))),this._register(it.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new E),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!t1&&(this._logService.warn("writeSync is unreliable and will be removed soon."),t1=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,iS),t=Math.max(t,sS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(jp.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(jp(this._bufferService),!1))),this._windowsWrappingHeuristics.value=fe(()=>{for(let t of e)t.dispose()})}}},cx={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function ux(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=w.ESC+"OA":r.key=w.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=w.ESC+"OD":r.key=w.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=w.ESC+"OC":r.key=w.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=w.ESC+"OB":r.key=w.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":w.DEL,e.altKey&&(r.key=w.ESC+r.key);break;case 9:if(e.shiftKey){r.key=w.ESC+"[Z";break}r.key=w.HT,r.cancel=!0;break;case 13:r.key=e.altKey?w.ESC+w.CR:w.CR,r.cancel=!0;break;case 27:r.key=w.ESC,e.altKey&&(r.key=w.ESC+w.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=w.ESC+"[1;"+(n+1)+"D":t?r.key=w.ESC+"OD":r.key=w.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=w.ESC+"[1;"+(n+1)+"C":t?r.key=w.ESC+"OC":r.key=w.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=w.ESC+"[1;"+(n+1)+"A":t?r.key=w.ESC+"OA":r.key=w.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=w.ESC+"[1;"+(n+1)+"B":t?r.key=w.ESC+"OB":r.key=w.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=w.ESC+"[2~");break;case 46:n?r.key=w.ESC+"[3;"+(n+1)+"~":r.key=w.ESC+"[3~";break;case 36:n?r.key=w.ESC+"[1;"+(n+1)+"H":t?r.key=w.ESC+"OH":r.key=w.ESC+"[H";break;case 35:n?r.key=w.ESC+"[1;"+(n+1)+"F":t?r.key=w.ESC+"OF":r.key=w.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=w.ESC+"[5;"+(n+1)+"~":r.key=w.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=w.ESC+"[6;"+(n+1)+"~":r.key=w.ESC+"[6~";break;case 112:n?r.key=w.ESC+"[1;"+(n+1)+"P":r.key=w.ESC+"OP";break;case 113:n?r.key=w.ESC+"[1;"+(n+1)+"Q":r.key=w.ESC+"OQ";break;case 114:n?r.key=w.ESC+"[1;"+(n+1)+"R":r.key=w.ESC+"OR";break;case 115:n?r.key=w.ESC+"[1;"+(n+1)+"S":r.key=w.ESC+"OS";break;case 116:n?r.key=w.ESC+"[15;"+(n+1)+"~":r.key=w.ESC+"[15~";break;case 117:n?r.key=w.ESC+"[17;"+(n+1)+"~":r.key=w.ESC+"[17~";break;case 118:n?r.key=w.ESC+"[18;"+(n+1)+"~":r.key=w.ESC+"[18~";break;case 119:n?r.key=w.ESC+"[19;"+(n+1)+"~":r.key=w.ESC+"[19~";break;case 120:n?r.key=w.ESC+"[20;"+(n+1)+"~":r.key=w.ESC+"[20~";break;case 121:n?r.key=w.ESC+"[21;"+(n+1)+"~":r.key=w.ESC+"[21~";break;case 122:n?r.key=w.ESC+"[23;"+(n+1)+"~":r.key=w.ESC+"[23~";break;case 123:n?r.key=w.ESC+"[24;"+(n+1)+"~":r.key=w.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=w.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=w.DEL:e.keyCode===219?r.key=w.ESC:e.keyCode===220?r.key=w.FS:e.keyCode===221&&(r.key=w.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let l=cx[e.keyCode]?.[e.shiftKey?1:0];if(l)r.key=w.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,o=String.fromCharCode(a);e.shiftKey&&(o=o.toUpperCase()),r.key=w.ESC+o}else if(e.keyCode===32)r.key=w.ESC+(e.ctrlKey?w.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=w.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=w.US),e.key==="@"&&(r.key=w.NUL));break}return r}var Te=0,dx=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new oh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new oh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Te=this._search(t),Te===-1)||this._getKey(this._array[Te])!==t)return!1;do if(this._array[Te]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Te),!0;while(++Te<this._array.length&&this._getKey(this._array[Te])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,n)=>r-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Te=this._search(e),!(Te<0||Te>=this._array.length)&&this._getKey(this._array[Te])===e))do yield this._array[Te];while(++Te<this._array.length&&this._getKey(this._array[Te])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Te=this._search(e),!(Te<0||Te>=this._array.length)&&this._getKey(this._array[Te])===e))do t(this._array[Te]);while(++Te<this._array.length&&this._getKey(this._array[Te])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Ld=0,i1=0,fx=class extends Y{constructor(){super(),this._decorations=new dx(e=>e?.marker.line),this._onDecorationRegistered=this._register(new E),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new E),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(fe(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new _x(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,r=>{Ld=r.options.x??0,i1=Ld+(r.options.width??1),e>=Ld&&e<i1&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},_x=class extends Hs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new E),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new E),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Se.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Se.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},mx=1e3,vx=class{constructor(e,t=mx){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},s1=20,r1=!1,hh=class extends Y{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new vx(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");r1?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=r.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(r.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(r.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
43
- `))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(H(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(fe(()=>{r1?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<s1+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
44
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===s1+1&&(this._liveRegion.textContent+=Ud.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),l=[],a=n?.translateToString(!0,void 0,void 0,l)||"",o=(i.ydisp+r+1).toString(),h=this._rowElements[r];h&&(a.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=a,this._rowColumns.set(h,l)),h.setAttribute("aria-posinset",o),h.setAttribute("aria-setsize",s),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let l,a;if(t===0?(l=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(l=this._rowElements.shift(),a=i,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let o=this._createAccessibilityTreeNode();this._rowElements.unshift(o),this._rowContainer.insertAdjacentElement("afterbegin",o)}else{let o=this._createAccessibilityTreeNode();this._rowElements.push(o),this._rowContainer.appendChild(o)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:o})=>{let h=a instanceof Text?a.parentNode:a,u=parseInt(h?.getAttribute("aria-posinset"),10)-1;if(isNaN(u))return console.warn("row is invalid. Race condition?"),null;let d=this._rowColumns.get(h);if(!d)return console.warn("columns is null. Race condition?"),null;let c=o<d.length?d[o]:d.slice(-1)[0]+1;return c>=this._terminal.cols&&(++u,c=0),{row:u,column:c}},n=r(t),l=r(i);if(!(!n||!l)){if(n.row>l.row||n.row===l.row&&n.column>=l.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(l.row-n.row)*this._terminal.cols-n.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};hh=Ee([B(1,wf),B(2,Wi),B(3,Zi)],hh);var bf=class extends Y{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new E),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new E),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(fe(()=>{mr(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(H(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(H(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(H(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(H(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let l=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,l),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let l=r[n],a=l.link.range.start.y<e?0:l.link.range.start.x,o=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let h=a;h<=o;h++){if(i.has(h)){r.splice(n--,1);break}i.add(h)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;n<e;n++)(!this._activeProviderReplies.has(n)||this._activeProviderReplies.get(n))&&(r=!0);if(!r&&s){let n=s.find(l=>this._linkAtPosition(l.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;n<this._activeProviderReplies.size;n++){let l=this._activeProviderReplies.get(n)?.find(a=>this._linkAtPosition(a.link,t));if(l){i=!0,this._handleNewLink(l);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&gx(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,mr(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};bf=Ee([B(1,Cf),B(2,Zi),B(3,_t),B(4,g1)],bf);function gx(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var px=class extends hx{constructor(e={}){super(e),this._linkifier=this._register(new Sn),this.browser=I1,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Sn),this._onCursorMove=this._register(new E),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new E),this.onKey=this._onKey.event,this._onRender=this._register(new E),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new E),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new E),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new E),this.onBell=this._onBell.event,this._onFocus=this._register(new E),this._onBlur=this._register(new E),this._onA11yCharEmitter=this._register(new E),this._onA11yTabEmitter=this._register(new E),this._onWillOpen=this._register(new E),this._setup(),this._decorationService=this._instantiationService.createInstance(fx),this._instantiationService.setService(Xl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(lE),this._instantiationService.setService(g1,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Yd)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(it.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(it.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(it.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(it.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(fe(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=de.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${w.ESC}]${s};${sx(r)}${P1.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Oe.toColor(...t.color));else{let n=i;this._themeService.modifyColors(l=>l[n]=Oe.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(hh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(w.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(w.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,l=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=l+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(H(this.element,"copy",t=>{this.hasSelection()&&Fw(t,this._selectionService)}));let e=t=>Ww(t,this.textarea,this.coreService,this.optionsService);this._register(H(this.textarea,"paste",e)),this._register(H(this.element,"paste",e)),j1?this._register(H(this.element,"mousedown",t=>{t.button===2&&np(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(H(this.element,"contextmenu",t=>{np(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Of&&this._register(H(this.element,"auxclick",t=>{t.button===1&&o1(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(H(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(H(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(H(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(H(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(H(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(H(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(H(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(H(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Hd.get()),W1||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(rE,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Wi,this._coreBrowserService),this._register(H(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(H(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(hf,this._document,this._helperContainer),this._instantiationService.setService(uh,this._charSizeService),this._themeService=this._instantiationService.createInstance(ff),this._instantiationService.setService(yn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(lh),this._instantiationService.setService(v1,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(uf,this.rows,this.screenElement)),this._instantiationService.setService(Zi,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(lf,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(cf),this._instantiationService.setService(Cf,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(bf,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(rf,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(df,this.element,this.screenElement,s)),this._instantiationService.setService(sC,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(it.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(nf,this.screenElement)),this._register(H(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(hh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(nh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(nh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(of,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let l=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!l)return!1;let a,o;switch(n.overrideType||n.type){case"mousemove":o=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":o=0,a=n.button<3?n.button:3;break;case"mousedown":o=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let h=n.deltaY;if(h===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;o=h<0?0:1,a=4;break;default:return!1}return o===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:a,action:o,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(H(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(H(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let l=w.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(l,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){a1(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=ux(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===w.ETX||i.key===w.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Sx(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Re));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(w.ESC+"[I"):this.coreService.triggerDataEvent(w.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${w.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${w.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Sx(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var yx=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},bx=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Jt)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},n1=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new bx(t)}getNullCell(){return new Jt}},wx=class extends Y{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new E),this.onBufferChange=this._onBufferChange.event,this._normal=new n1(this._core.buffers.normal,"normal"),this._alternate=new n1(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},Cx=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},Ex=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},xx=["cols","rows"],Ei=0,nS=class extends Y{constructor(e){super(),this._core=this._register(new px(e)),this._addonManager=this._register(new yx),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(xx.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Cx(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Ex(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new wx(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
45
- `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Hd.get()},set promptLabel(e){Hd.set(e)},get tooMuchOutput(){return Ud.get()},set tooMuchOutput(e){Ud.set(e)}}}_verifyIntegers(...e){for(Ei of e)if(Ei===1/0||isNaN(Ei)||Ei%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Ei of e)if(Ei&&(Ei===1/0||isNaN(Ei)||Ei%1!==0||Ei<0))throw new Error("This API only accepts positive integers")}};var Tx=2,Dx=1,lS=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),l={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=l.top+l.bottom,o=l.right+l.left,h=s-a,u=r-o-t;return{cols:Math.max(Tx,Math.floor(u/e.css.cell.width)),rows:Math.max(Dx,Math.floor(h/e.css.cell.height))}}};var R=Ql(Bf(),1),dS={claude:"Claude Code",codex:"Codex",shell:"Shell"},Rx={connecting:"Connecting…",live:"Live",ended:"Ended",behind:"Catching up…","signed-out":"Signed out — sign in again to keep typing",gone:"This terminal is gone",offline:"Reconnecting…",busy:"Not reading input — what you type waits"},kf=document.getElementById("so-term-boot"),Ox=kf?.dataset.csrf??"",Bx=kf?.dataset.session??null,cS=kf?.dataset.passwordless==="1";async function Nx(){let e=await fetch("/term/state",{headers:{accept:"application/json"},credentials:"same-origin"});return e.status===401?(location.href=`/login?next=${encodeURIComponent(location.pathname)}`,null):e.ok?await e.json():null}async function fS(e,t){let i=await fetch(e,{method:"POST",headers:{accept:"application/json"},credentials:"same-origin",body:new URLSearchParams({csrf:Ox,...t})});try{return await i.json()}catch{return{ok:!1,error:"The console didn't answer. Try again."}}}function Nf({program:e}){return(0,R.jsx)("span",{className:`term-glyph term-glyph--${e}`,"aria-hidden":!0,children:e==="claude"?"C":e==="codex"?"X":"$"})}function kx({session:e,onLink:t,keys:i}){let s=(0,ye.useRef)(null);return(0,ye.useEffect)(()=>{let r=new nS({fontFamily:'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:window.matchMedia("(max-width: 720px)").matches?12:13,cursorBlink:!0,allowProposedApi:!1,scrollback:5e3,macOptionIsMeta:!0,theme:{background:"#0C0E12",foreground:"#E6E8EC",cursor:"#E6E8EC",selectionBackground:"#2A3140",black:"#14171D",brightBlack:"#5B6372",blue:"#5B9DFF",brightBlue:"#8AB8FF",green:"#3FB97F",brightGreen:"#6BD9A2",red:"#F06464",brightRed:"#FF8F8F",yellow:"#F5A524",brightYellow:"#FFC266",cyan:"#4FC4CF",brightCyan:"#7FDDE5",magenta:"#B78CF2",brightMagenta:"#D0B3FF",white:"#C9CED6",brightWhite:"#FFFFFF"}}),n=new lS;r.loadAddon(n),r.open(s.current);let l=null,a=!1,o=!1,h=0,u,d,c=g=>{l?.readyState===WebSocket.OPEN&&l.send(JSON.stringify(g))},f=g=>c({t:"in",d:g});i(f);let _=()=>{try{n.fit()}catch{return}c({t:"resize",cols:r.cols,rows:r.rows})},p=()=>{t(h===0?"connecting":"offline");let g=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/term/${e.id}/socket`,S=new WebSocket(g);l=S,S.binaryType="arraybuffer";let C=!0;S.onmessage=A=>{if(C&&(r.reset(),C=!1),typeof A.data!="string"){r.write(new Uint8Array(A.data));return}let T;try{T=JSON.parse(A.data)}catch{return}T.t==="hello"?(h=0,o=T.ended===!0,t(o?"ended":"live"),o||_()):T.t==="exit"?(o=!0,t("ended")):T.t==="input-full"&&(t("busy"),window.clearTimeout(d),d=window.setTimeout(()=>{o||t("live")},2500))},S.onclose=A=>{if(l===S&&(l=null),!a){if(A.code===4401)return t("signed-out");if(A.code===4404)return t("gone");if(o)return t("ended");t(A.code===4008?"behind":"offline"),h+=1,u=window.setTimeout(p,Math.min(8e3,250*2**Math.min(h,5)))}}},y=r.onData(f),m=new ResizeObserver(()=>_());m.observe(s.current);let v=window.visualViewport;return v?.addEventListener("resize",_),p(),r.focus(),()=>{a=!0,window.clearTimeout(u),window.clearTimeout(d),m.disconnect(),v?.removeEventListener("resize",_),y.dispose(),l?.close(1e3),r.dispose()}},[e.id]),(0,R.jsx)("div",{className:"term-screen",ref:s})}function zx({sendRef:e}){let[t,i]=(0,ye.useState)(!1),s=(n,l)=>(0,R.jsx)("button",{type:"button",className:"term-key",onPointerDown:a=>{a.preventDefault(),e.current?.(l)},children:n}),r=n=>{e.current?.(String.fromCharCode(n.toUpperCase().charCodeAt(0)-64)),i(!1)};return(0,R.jsxs)("div",{className:"term-keys",role:"toolbar","aria-label":"Terminal keys",children:[s("esc","\x1B"),s("tab"," "),(0,R.jsx)("button",{type:"button",className:`term-key${t?" term-key--on":""}`,"aria-pressed":t,onPointerDown:n=>{n.preventDefault(),i(l=>!l)},children:"ctrl"}),t?(0,R.jsx)(R.Fragment,{children:["c","d","r","l","z"].map(n=>(0,R.jsxs)("button",{type:"button",className:"term-key",onPointerDown:l=>{l.preventDefault(),r(n)},children:["^",n.toUpperCase()]},n))}):(0,R.jsxs)(R.Fragment,{children:[s("↑","\x1B[A"),s("↓","\x1B[B"),s("←","\x1B[D"),s("→","\x1B[C"),s("/","/"),s("⏎","\r")]})]})}function Lx({state:e,onStarted:t,onCancel:i}){let[s,r]=(0,ye.useState)(e.projects[0]?.path??""),[n,l]=(0,ye.useState)(e.programs[0]??"claude"),[a,o]=(0,ye.useState)(""),[h,u]=(0,ye.useState)(!1),[d,c]=(0,ye.useState)(null),f=async _=>{_.preventDefault(),u(!0),c(null);let p=await fS("/term/start",{repo:s,program:n,password:a});u(!1),o(""),p.ok&&p.id!==void 0?t(p.id):c(p.error??"The terminal didn't start.")};return e.projects.length===0?(0,R.jsxs)("div",{className:"term-new",children:[(0,R.jsx)("h2",{children:"No projects yet"}),(0,R.jsx)("p",{children:"Add a project in the console first, then start a terminal in it."}),(0,R.jsx)("a",{className:"term-button",href:"/projects",children:"Projects"})]}):(0,R.jsxs)("form",{className:"term-new",onSubmit:_=>{f(_)},children:[(0,R.jsx)("h2",{children:"New terminal"}),(0,R.jsx)("p",{className:"term-muted",children:"Runs in a fresh worktree on its own branch. Your default branch is never touched."}),(0,R.jsxs)("label",{className:"term-field",children:[(0,R.jsx)("span",{children:"Project"}),(0,R.jsx)("select",{value:s,onChange:_=>r(_.target.value),children:e.projects.map(_=>(0,R.jsx)("option",{value:_.path,children:_.name},_.path))})]}),(0,R.jsxs)("fieldset",{className:"term-programs",children:[(0,R.jsx)("legend",{children:"Program"}),e.programs.map(_=>(0,R.jsxs)("label",{className:`term-program${n===_?" term-program--on":""}`,children:[(0,R.jsx)("input",{type:"radio",name:"program",value:_,checked:n===_,onChange:()=>l(_)}),(0,R.jsx)(Nf,{program:_})," ",dS[_]]},_))]}),cS?(0,R.jsx)("p",{className:"term-muted",children:"A terminal can do anything you can on this computer."}):(0,R.jsxs)("div",{className:"term-ceremony",children:[(0,R.jsx)("p",{children:"A terminal can do anything you can on this computer. Confirm with your Toolroll password."}),(0,R.jsxs)("label",{className:"term-field",children:[(0,R.jsx)("span",{children:"Password"}),(0,R.jsx)("input",{type:"password",autoComplete:"current-password",value:a,onChange:_=>o(_.target.value),required:!0})]})]}),d!==null?(0,R.jsx)("p",{className:"term-error",role:"alert",children:d}):null,(0,R.jsxs)("div",{className:"term-actions",children:[i!==null?(0,R.jsx)("button",{type:"button",className:"term-button term-button--quiet",onClick:i,children:"Cancel"}):null,(0,R.jsx)("button",{type:"submit",className:"term-button",disabled:h||!cS&&a===""||s==="",children:h?"Starting…":"Start"})]})]})}function Hx(){let[e,t]=(0,ye.useState)(null),[i,s]=(0,ye.useState)(Bx),[r,n]=(0,ye.useState)(!1),[l,a]=(0,ye.useState)(!1),[o,h]=(0,ye.useState)("connecting"),u=(0,ye.useRef)(null),d=(0,ye.useCallback)(async()=>{let y=await Nx();y!==null&&t(y)},[]);if((0,ye.useEffect)(()=>{d();let y=window.setInterval(()=>{d()},5e3);return()=>window.clearInterval(y)},[d]),(0,ye.useEffect)(()=>{e!==null&&(i!==null&&!e.sessions.some(y=>y.id===i)&&s(e.sessions[0]?.id??null),i===null&&e.sessions.length>0&&!r&&s(e.sessions[0].id))},[e,i,r]),(0,ye.useEffect)(()=>{let y=i===null?"/term":`/term/${i}`;location.pathname!==y&&history.replaceState(null,"",y)},[i]),(0,ye.useEffect)(()=>{o==="ended"&&d()},[o,d]),e===null)return(0,R.jsx)("div",{className:"term-app term-app--loading",children:"Loading…"});let c=e.sessions.find(y=>y.id===i)??null,f=y=>{s(y),n(!1),a(!1)},_=async y=>{if(c===null)return;let m=await fS(`/term/${c.id}/${y}`,{});!m.ok&&m.error&&window.alert(m.error),await d()},p=(0,R.jsxs)("nav",{className:"term-list","aria-label":"Terminals",children:[(0,R.jsxs)("div",{className:"term-list-head",children:[(0,R.jsx)("a",{href:"/",className:"term-back","aria-label":"Back to the console",children:"←"}),(0,R.jsx)("h1",{children:"Live"}),(0,R.jsx)("button",{type:"button",className:"term-button term-button--small",onClick:()=>{n(!0),a(!1)},children:"+ New"})]}),e.sessions.length===0?(0,R.jsx)("p",{className:"term-muted term-list-empty",children:"No terminals yet."}):null,e.sessions.map(y=>(0,R.jsxs)("button",{type:"button",className:`term-item${y.id===i&&!r?" term-item--on":""}`,onClick:()=>f(y.id),children:[(0,R.jsx)(Nf,{program:y.program}),(0,R.jsxs)("span",{className:"term-item-text",children:[(0,R.jsx)("span",{className:"term-item-title",children:y.project}),(0,R.jsxs)("span",{className:"term-item-meta",children:[dS[y.program]," · ",y.branch]})]}),(0,R.jsx)("span",{className:`term-dot${y.endedAt===null?" term-dot--live":""}`,"aria-label":y.endedAt===null?"running":"ended"})]},y.id))]});return(0,R.jsxs)("div",{className:`term-app${l?" term-app--drawer":""}`,children:[(0,R.jsx)("aside",{className:"term-side",children:p}),(0,R.jsx)("button",{type:"button",className:"term-scrim","aria-label":"Close the list",onClick:()=>a(!1)}),(0,R.jsxs)("main",{className:"term-main",children:[(0,R.jsxs)("header",{className:"term-bar",children:[(0,R.jsx)("button",{type:"button",className:"term-menu","aria-label":"Terminals",onClick:()=>a(!0),children:"☰"}),c!==null&&!r?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("span",{className:"term-bar-title",children:[(0,R.jsx)(Nf,{program:c.program})," ",c.project,(0,R.jsx)("span",{className:"term-bar-branch",children:c.branch})]}),(0,R.jsx)("span",{className:`term-link term-link--${o}`,children:Rx[o]}),c.endedAt===null?(0,R.jsx)("button",{type:"button",className:"term-button term-button--quiet term-button--small",onClick:()=>{window.confirm("Close this terminal? Everything running in it stops.")&&_("close")},children:"Close"}):(0,R.jsx)("button",{type:"button",className:"term-button term-button--quiet term-button--small",onClick:()=>{window.confirm("Remove this terminal and its worktree? Its branch stays.")&&_("remove")},children:"Remove"})]}):(0,R.jsx)("span",{className:"term-bar-title",children:e.available?"New terminal":"Live"})]}),e.available?r||c===null?(0,R.jsx)(Lx,{state:e,onCancel:c===null?null:()=>n(!1),onStarted:y=>{n(!1),s(y),d()}}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(kx,{session:c,onLink:h,keys:y=>{u.current=y}},c.id),(0,R.jsx)(zx,{sendRef:u})]}):(0,R.jsxs)("div",{className:"term-new",children:[(0,R.jsx)("h2",{children:"Terminals aren't available"}),(0,R.jsx)("p",{children:e.problem??"This install can't run terminals."})]})]})]})}(0,uS.createRoot)(document.getElementById("so-term")).render((0,R.jsx)(Hx,{}));
42
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),i0&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=QS(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=t0(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-i_),i_),t/=i_,t/Math.abs(t)+Math.round(t*(B4-1)))}shouldForceSelection(e){return dc?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),k4)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(dc&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<O4&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=x4(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let l=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),o=a,h=e[0]-a,c=0,u=0,d=0,f=0;if(l.charAt(a)===" "){for(;a>0&&l.charAt(a-1)===" ";)a--;for(;o<l.length&&l.charAt(o+1)===" ";)o++}else{let M=e[0],m=e[0];n.getWidth(M)===0&&(c++,M--),n.getWidth(m)===2&&(u++,m++);let v=n.getString(m).length;for(v>1&&(f+=v-1,o+=v-1);M>0&&a>0&&!this._isCharWordSeparator(n.loadCell(M-1,this._workCell));){n.loadCell(M-1,this._workCell);let S=this._workCell.getChars().length;this._workCell.getWidth()===0?(c++,M--):S>1&&(d+=S-1,a-=S-1),a--,M--}for(;m<n.length&&o+1<l.length&&!this._isCharWordSeparator(n.loadCell(m+1,this._workCell));){n.loadCell(m+1,this._workCell);let S=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,m++):S>1&&(f+=S-1,o+=S-1),o++,m++}}o++;let _=a+h-c+d,y=Math.min(this._bufferService.cols,o-a+c+u-d-f);if(!(!t&&l.slice(a,o).trim()==="")){if(i&&_===0&&n.getCodePoint(0)!==32){let M=r.lines.get(e[1]-1);if(M&&n.isWrapped&&M.getCodePoint(this._bufferService.cols-1)!==32){let m=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(m){let v=this._bufferService.cols-m.start;_-=v,y+=v}}}if(s&&_+y===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let M=r.lines.get(e[1]+1);if(M?.isWrapped&&M.getCodePoint(0)!==32){let m=this._getWordAt([0,e[1]+1],!1,!1,!0);m&&(y+=m.length)}}return{start:_,length:y}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=QS(i,this._bufferService.cols)}};H_=Oe([H(3,kt),H(4,an),H(5,j_),H(6,Ot),H(7,Ms),H(8,Ts)],H_);var JS=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},ey=class{constructor(){this._color=new JS,this._css=new JS}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},$e=Object.freeze((()=>{let e=[Le.toColor("#2e3436"),Le.toColor("#cc0000"),Le.toColor("#4e9a06"),Le.toColor("#c4a000"),Le.toColor("#3465a4"),Le.toColor("#75507b"),Le.toColor("#06989a"),Le.toColor("#d3d7cf"),Le.toColor("#555753"),Le.toColor("#ef2929"),Le.toColor("#8ae234"),Le.toColor("#fce94f"),Le.toColor("#729fcf"),Le.toColor("#ad7fa8"),Le.toColor("#34e2e2"),Le.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:Ve.toCss(s,r,n),rgba:Ve.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:Ve.toCss(s,s,s),rgba:Ve.toRgba(s,s,s)})}return e})()),en=Le.toColor("#ffffff"),ka=Le.toColor("#000000"),ty=Le.toColor("#ffffff"),iy=ka,Ma={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},H4=en,U_=class extends G{constructor(e){super(),this._optionsService=e,this._contrastCache=new ey,this._halfContrastCache=new ey,this._onChangeColors=this._register(new N),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:en,background:ka,cursor:ty,cursorAccent:iy,selectionForeground:void 0,selectionBackgroundTransparent:Ma,selectionBackgroundOpaque:ye.blend(ka,Ma),selectionInactiveBackgroundTransparent:Ma,selectionInactiveBackgroundOpaque:ye.blend(ka,Ma),scrollbarSliderBackground:ye.opacity(en,.2),scrollbarSliderHoverBackground:ye.opacity(en,.4),scrollbarSliderActiveBackground:ye.opacity(en,.5),overviewRulerBorder:en,ansi:$e.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=de(e.foreground,en),t.background=de(e.background,ka),t.cursor=ye.blend(t.background,de(e.cursor,ty)),t.cursorAccent=ye.blend(t.background,de(e.cursorAccent,iy)),t.selectionBackgroundTransparent=de(e.selectionBackground,Ma),t.selectionBackgroundOpaque=ye.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=de(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ye.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?de(e.selectionForeground,$S):void 0,t.selectionForeground===$S&&(t.selectionForeground=void 0),ye.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ye.opacity(t.selectionBackgroundTransparent,.3)),ye.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ye.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=de(e.scrollbarSliderBackground,ye.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=de(e.scrollbarSliderHoverBackground,ye.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=de(e.scrollbarSliderActiveBackground,ye.opacity(t.foreground,.5)),t.overviewRulerBorder=de(e.overviewRulerBorder,H4),t.ansi=$e.slice(),t.ansi[0]=de(e.black,$e[0]),t.ansi[1]=de(e.red,$e[1]),t.ansi[2]=de(e.green,$e[2]),t.ansi[3]=de(e.yellow,$e[3]),t.ansi[4]=de(e.blue,$e[4]),t.ansi[5]=de(e.magenta,$e[5]),t.ansi[6]=de(e.cyan,$e[6]),t.ansi[7]=de(e.white,$e[7]),t.ansi[8]=de(e.brightBlack,$e[8]),t.ansi[9]=de(e.brightRed,$e[9]),t.ansi[10]=de(e.brightGreen,$e[10]),t.ansi[11]=de(e.brightYellow,$e[11]),t.ansi[12]=de(e.brightBlue,$e[12]),t.ansi[13]=de(e.brightMagenta,$e[13]),t.ansi[14]=de(e.brightCyan,$e[14]),t.ansi[15]=de(e.brightWhite,$e[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=de(e.extendedAnsi[s],$e[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};U_=Oe([H(0,Ot)],U_);function de(e,t){if(e!==void 0)try{return Le.toColor(e)}catch{}return t}var U4=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},P4=class{constructor(){this._services=new U4,this._services.set(K_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=nx(e).sort((n,l)=>n.index-l.index),s=[];for(let n of i){let l=this._services.get(n.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(l)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},I4={trace:0,debug:1,info:2,warn:3,error:4,off:5},F4="xterm.js: ",P_=class extends G{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),q4=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=I4[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":F4)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};P_=Oe([H(0,Ot)],P_);var q4,sy=class extends G{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new N),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new N),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new N),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},$=3,We=Object.freeze(new Wa),$h=0,s_=2,Oa=class mb{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*$);let r=i||Ci.fromCharData([0,My,1,0]);for(let n=0;n<t;++n)this.setCell(n,r);this.length=t}get(t){let i=this._data[t*$+0],s=i&2097151;return[this._data[t*$+1],i&2097152?this._combined[t]:s?yr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*$+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*$+0]=t|2097152|i[2]<<22):this._data[t*$+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*$+0]>>22}hasWidth(t){return this._data[t*$+0]&12582912}getFg(t){return this._data[t*$+1]}getBg(t){return this._data[t*$+2]}hasContent(t){return this._data[t*$+0]&4194303}getCodePoint(t){let i=this._data[t*$+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*$+0]&2097152}getString(t){let i=this._data[t*$+0];return i&2097152?this._combined[t]:i&2097151?yr(i&2097151):""}isProtected(t){return this._data[t*$+2]&536870912}loadCell(t,i){return $h=t*$,i.content=this._data[$h+0],i.fg=this._data[$h+1],i.bg=this._data[$h+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*$+0]=i.content,this._data[t*$+1]=i.fg,this._data[t*$+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*$+0]=i|s<<22,this._data[t*$+1]=r.fg,this._data[t*$+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*$+0];r&2097152?this._combined[t]+=yr(i):r&2097151?(this._combined[t]=yr(r&2097151)+yr(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*$+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let r=new Ci;for(let n=this.length-t-i-1;n>=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;n<i;++n)this.setCell(t+n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let r=new Ci;for(let n=0;n<this.length-t-i;++n)this.setCell(t+n,this.loadCell(t+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*s_<this._data.buffer.byteLength;let s=t*$;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);let r=Object.keys(this._combined);for(let l=0;l<r.length;l++){let a=parseInt(r[l],10);a>=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let l=0;l<n.length;l++){let a=parseInt(n[l],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*s_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*s_<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new mb(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$+0]&4194303)return t+(this._data[t*$+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$+0]&4194303||this._data[t*$+2]&50331648)return t+(this._data[t*$+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let l=t._data;if(n)for(let o=r-1;o>=0;o--){for(let h=0;h<$;h++)this._data[(s+o)*$+h]=l[(i+o)*$+h];l[(i+o)*$+2]&268435456&&(this._extendedAttrs[s+o]=t._extendedAttrs[i+o])}else for(let o=0;o<r;o++){for(let h=0;h<$;h++)this._data[(s+o)*$+h]=l[(i+o)*$+h];l[(i+o)*$+2]&268435456&&(this._extendedAttrs[s+o]=t._extendedAttrs[i+o])}let a=Object.keys(t._combined);for(let o=0;o<a.length;o++){let h=parseInt(a[o],10);h>=i&&(this._combined[h-i+s]=t._combined[h])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let l=this._data[i*$+0],a=l&2097151,o=l&2097152?this._combined[i]:a?yr(a):br;if(n+=o,r)for(let h=0;h<o.length;++h)r.push(i);i+=l>>22||1}return r&&r.push(i),n}};function W4(e,t,i,s,r,n){let l=[];for(let a=0;a<e.length-1;a++){let o=a,h=e.get(++o);if(!h.isWrapped)continue;let c=[e.get(a)];for(;o<e.length&&h.isWrapped;)c.push(h),h=e.get(++o);if(!n&&s>=a&&s<o){a+=c.length-1;continue}let u=0,d=qa(c,u,t),f=1,_=0;for(;f<c.length;){let M=qa(c,f,t),m=M-_,v=i-d,S=Math.min(m,v);c[u].copyCellsFrom(c[f],_,d,S,!1),d+=S,d===i&&(u++,d=0),_+=S,_===M&&(f++,_=0),d===0&&u!==0&&c[u-1].getWidth(i-1)===2&&(c[u].copyCellsFrom(c[u-1],i-1,d++,1,!1),c[u-1].setCell(i-1,r))}c[u].replaceCells(d,i,r);let y=0;for(let M=c.length-1;M>0&&(M>u||c[M].getTrimmedLength()===0);M--)y++;y>0&&(l.push(a+c.length-y),l.push(y)),a+=c.length-1}return l}function V4(e,t){let i=[],s=0,r=t[s],n=0;for(let l=0;l<e.length;l++)if(r===l){let a=t[++s];e.onDeleteEmitter.fire({index:l-n,amount:a}),l+=a-1,n+=a,r=t[++s]}else i.push(l);return{layout:i,countRemoved:n}}function Y4(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function G4(e,t,i){let s=[],r=e.map((o,h)=>qa(e,h,t)).reduce((o,h)=>o+h),n=0,l=0,a=0;for(;a<r;){if(r-a<i){s.push(r-a);break}n+=i;let o=qa(e,l,t);n>o&&(n-=o,l++);let h=e[l].getWidth(n-1)===2;h&&n--;let c=h?i-1:i;s.push(c),a+=c}return s}function qa(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var pb=class Sb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Sb._nextId++,this._onDispose=this.register(new N),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),nn(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};pb._nextId=1;var K4=pb,Ze={},tn=Ze.B;Ze[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Ze.A={"#":"£"};Ze.B=void 0;Ze[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Ze.C=Ze[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Ze.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Ze.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Ze.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Ze.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Ze.E=Ze[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Ze.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Ze.H=Ze[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Ze["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var ry=4294967295,ny=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=We.clone(),this.savedCharset=tn,this.markers=[],this._nullCell=Ci.fromCharData([0,My,1,0]),this._whitespaceCell=Ci.fromCharData([0,br,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new fc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new sy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new lc),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new lc),this._whitespaceCell}getBlankLine(e,t){return new Oa(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>ry?ry:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=We);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new sy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(We),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)s+=+this.lines.get(l).resize(e,i);let n=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Oa(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new Oa(e,i)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let l=this.lines.length-r;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=W4(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(We),i);if(s.length>0){let r=V4(this.lines,s);Y4(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(We),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Oa(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(We),r=[],n=0;for(let l=this.lines.length-1;l>=0;l--){let a=this.lines.get(l);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let o=[a];for(;a.isWrapped&&l>0;)a=this.lines.get(--l),o.unshift(a);if(!i){let S=this.ybase+this.y;if(S>=l&&S<l+o.length)continue}let h=o[o.length-1].getTrimmedLength(),c=G4(o,this._cols,e),u=c.length-o.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+u):d=Math.max(0,this.lines.length-this.lines.maxLength+u);let f=[];for(let S=0;S<u;S++){let g=this.getBlankLine(We,!0);f.push(g)}f.length>0&&(r.push({start:l+o.length+n,newLines:f}),n+=f.length),o.push(...f);let _=c.length-1,y=c[_];y===0&&(_--,y=c[_]);let M=o.length-u-1,m=h;for(;M>=0;){let S=Math.min(m,y);if(o[_]===void 0)break;if(o[_].copyCellsFrom(o[M],m-S,y-S,S,!0),y-=S,y===0&&(_--,y=c[_]),m-=S,m===0){M--;let g=Math.max(M,0);m=qa(o,g,this._cols)}}for(let S=0;S<o.length;S++)c[S]<e&&o[S].setCell(c[S],s);let v=u-d;for(;v-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(r.length>0){let l=[],a=[];for(let y=0;y<this.lines.length;y++)a.push(this.lines.get(y));let o=this.lines.length,h=o-1,c=0,u=r[c];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let d=0;for(let y=Math.min(this.lines.maxLength-1,o+n-1);y>=0;y--)if(u&&u.start>h+d){for(let M=u.newLines.length-1;M>=0;M--)this.lines.set(y--,u.newLines[M]);y++,l.push({index:h+1,amount:u.newLines.length}),d+=u.newLines.length,u=r[++c]}else this.lines.set(y,a[h--]);let f=0;for(let y=l.length-1;y>=0;y--)l[y].index+=f,this.lines.onInsertEmitter.fire(l[y]),f+=l[y].amount;let _=Math.max(0,o+n-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new K4(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},j4=class extends G{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new N),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new ny(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new ny(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},yb=2,bb=1,I_=class extends G{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new N),this.onResize=this._onResize.event,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,yb),this.rows=Math.max(e.rawOptions.rows||0,bb),this.buffers=this._register(new j4(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let l=i.lines.isFull;n===i.lines.length-1?l?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),l?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let l=n-r+1;i.lines.shiftElements(r+1,l-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};I_=Oe([H(0,Ot)],I_);var ol={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:dc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},$4=["normal","bold","100","200","300","400","500","600","700","800","900"],X4=class extends G{constructor(e){super(),this._onOptionChange=this._register(new N),this.onOptionChange=this._onOptionChange.event;let t={...ol};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(be(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in ol))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in ol))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ol[e]),!Z4(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ol[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=$4.includes(t)?t:ol[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function Z4(e){return e==="block"||e==="underline"||e==="bar"}function Na(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&Na(e[s],t-1);return i}var ly=Object.freeze({insertMode:!1}),ay=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),F_=class extends G{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new N),this.onData=this._onData.event,this._onUserInput=this._register(new N),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new N),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new N),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Na(ly),this.decPrivateModes=Na(ay)}reset(){this.modes=Na(ly),this.decPrivateModes=Na(ay)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};F_=Oe([H(0,kt),H(1,By),H(2,Ot)],F_);var oy={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function r_(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var n_=String.fromCharCode,hy={DEFAULT:e=>{let t=[r_(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${n_(t[0])}${n_(t[1])}${n_(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${r_(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${r_(e,!0)};${e.x};${e.y}${t}`}},q_=class extends G{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new N),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(oy))this.addProtocol(s,oy[s]);for(let s of Object.keys(hy))this.addEncoding(s,hy[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};q_=Oe([H(0,kt),H(1,an),H(2,Ot)],q_);var l_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Q4=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Xe;function J4(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var eE=class{constructor(){if(this.version="6",!Xe){Xe=new Uint8Array(65536),Xe.fill(1),Xe[0]=0,Xe.fill(0,1,32),Xe.fill(0,127,160),Xe.fill(2,4352,4448),Xe[9001]=2,Xe[9002]=2,Xe.fill(2,11904,42192),Xe[12351]=1,Xe.fill(2,44032,55204),Xe.fill(2,63744,64256),Xe.fill(2,65040,65050),Xe.fill(2,65072,65136),Xe.fill(2,65280,65377),Xe.fill(2,65504,65511);for(let e=0;e<l_.length;++e)Xe.fill(0,l_[e][0],l_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Xe[e]:J4(e,Q4)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=sn.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return sn.createPropertyValue(0,i,s)}},sn=class nc{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new N,this.onChange=this._onChange.event;let t=new eE;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let l=t.charCodeAt(n);if(55296<=l&&l<=56319){if(++n>=r)return i+this.wcwidth(l);let h=t.charCodeAt(n);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:i+=this.wcwidth(h)}let a=this.charProperties(l,s),o=nc.extractWidth(a);nc.extractShouldJoin(a)&&(o-=nc.extractWidth(s)),i+=o,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},tE=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function cy(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var La=2147483647,iE=256,wb=class W_{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>iE)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new W_;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let r=t[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let t=new W_(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>La?La:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>La?La:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,La):t}},Aa=[],sE=class{constructor(){this._state=0,this._active=Aa,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Aa}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Aa,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Aa,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",gc(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Aa,this._id=-1,this._state=0}}},ni=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=gc(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},Da=[],rE=class{constructor(){this._handlers=Object.create(null),this._active=Da,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Da}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Da,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Da,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",gc(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Da,this._ident=0}},za=new wb;za.addParam(0);var uy=class{constructor(e){this._handler=e,this._data="",this._params=za,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():za,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=gc(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=za,this._data="",this._hitLimit=!1,i));return this._params=za,this._data="",this._hitLimit=!1,t}},nE=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}},wi=160,lE=(function(){let e=new nE(4095),t=Array.apply(null,Array(256)).map((a,o)=>o),i=(a,o)=>t.slice(a,o),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),l;e.setDefault(1,0),e.addMany(s,0,2,0);for(l in n)e.addMany([24,26,153,154],l,3,0),e.addMany(i(128,144),l,3,0),e.addMany(i(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(wi,0,2,0),e.add(wi,8,5,8),e.add(wi,6,0,6),e.add(wi,11,0,11),e.add(wi,13,13,13),e})(),aE=class extends G{constructor(e=lE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new wb,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(be(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new sE),this._dcsParser=this._register(new rE),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,o=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&o>-1){for(;o>=0&&(l=a[o](this._params),l!==!0);o--)if(l instanceof Promise)return this._parseStack.handlerPos=o,l}this._parseStack.handlers=[];break;case 4:if(i===!1&&o>-1){for(;o>=0&&(l=a[o](),l!==!0);o--)if(l instanceof Promise)return this._parseStack.handlerPos=o,l}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(s!==24&&s!==26,i),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],l=this._oscParser.end(s!==24&&s!==26,i),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a<t;++a){switch(s=e[a],r=this._transitions.table[this.currentState<<8|(s<160?s:wi)],r>>4){case 2:for(let d=a+1;;++d){if(d>=t||(s=e[d])<32||s>126&&s<wi){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<wi){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<wi){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<wi){this._printHandler(e,a,d),a=d-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|s],h=o?o.length-1:-1;for(;h>=0&&(l=o[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._preserveStack(3,o,h,r,a),l;h<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a<t&&(s=e[a])>47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let c=this._escHandlers[this._collect<<8|s],u=c?c.length-1:-1;for(;u>=0&&(l=c[u](),l!==!0);u--)if(l instanceof Promise)return this._preserveStack(4,c,u,r,a),l;u<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let d=a+1;;++d)if(d>=t||(s=e[d])===24||s===26||s===27||s>127&&s<wi){this._dcsParser.put(e,a,d),a=d-1;break}break;case 14:if(l=this._dcsParser.unhook(s!==24&&s!==26),l)return this._preserveStack(6,[],0,r,a),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let d=a+1;;d++)if(d>=t||(s=e[d])<32||s>127&&s<wi){this._oscParser.put(e,a,d),a=d-1;break}break;case 6:if(l=this._oscParser.end(s!==24&&s!==26),l)return this._preserveStack(5,[],0,r,a),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},oE=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,hE=/^[\da-f]+$/;function dy(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=oE.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),hE.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(t.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function a_(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function cE(e,t=16){let[i,s,r]=e;return`rgb:${a_(i,t)}/${a_(s,t)}/${a_(r,t)}`}var uE={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Sr=131072,fy=10;function _y(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var gy=5e3,vy=0,dE=class extends G{constructor(e,t,i,s,r,n,l,a,o=new aE){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=l,this._unicodeService=a,this._parser=o,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new sx,this._utf8Decoder=new rx,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=We.clone(),this._eraseAttrDataInternal=We.clone(),this._onRequestBell=this._register(new N),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new N),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new N),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new N),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new N),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new N),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new N),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new N),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new N),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new N),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new N),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new N),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new V_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,c)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:c.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,c,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:c,data:u})}),this._parser.setDcsHandlerFallback((h,c,u)=>{c==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:c,payload:u})}),this._parser.setPrintHandler((h,c,u)=>this.print(h,c,u)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(R.BEL,()=>this.bell()),this._parser.setExecuteHandler(R.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(R.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(R.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(R.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(R.BS,()=>this.backspace()),this._parser.setExecuteHandler(R.HT,()=>this.tab()),this._parser.setExecuteHandler(R.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(R.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(sc.IND,()=>this.index()),this._parser.setExecuteHandler(sc.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(sc.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new ni(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new ni(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new ni(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new ni(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new ni(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new ni(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new ni(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new ni(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new ni(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new ni(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new ni(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new ni(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in Ze)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new uy((h,c)=>this.requestStatusString(h,c)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),gy))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${gy} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,l=this._parseStack.paused;if(l){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Sr&&(n=this._parseStack.position+Sr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Sr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Sr))),l||this._dirtyRowTracker.clearRange(),e.length>Sr)for(let h=n;h<e.length;h+=Sr){let c=h+Sr<e.length?h+Sr:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(h,c),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,c),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(s,r,u,h),this._logSlowResolvingAsync(i),i}else if(!l){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,h))return this._preserveStack(s,r,h,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),o=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);o<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(o,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,i){let s,r,n=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,o=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,c=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,c);let d=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(s=e[f],s<127&&n){let m=n[String.fromCharCode(s)];m&&(s=m.charCodeAt(0))}let _=this._unicodeService.charProperties(s,d);r=sn.extractWidth(_);let y=sn.extractShouldJoin(_),M=y?sn.extractWidth(d):0;if(d=_,l&&this._onA11yChar.fire(yr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-M>a){if(o){let m=u,v=this._activeBuffer.x-M;for(this._activeBuffer.x=M,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),M>0&&u instanceof Oa&&u.copyCellsFrom(m,v,0,M,!1);v<a;)m.setCellFromCodepoint(v++,0,1,c)}else if(this._activeBuffer.x=a-1,r===2)continue}if(y&&this._activeBuffer.x){let m=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-m,s,r);for(let v=r-M;--v>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,c);continue}if(h&&(u.insertCells(this._activeBuffer.x,r-M,this._activeBuffer.getNullCell(c)),u.getWidth(a-1)===2&&u.setCellFromCodepoint(a-1,0,1,c)),u.setCellFromCodepoint(this._activeBuffer.x++,s,r,c),r>0)for(;--r;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,c)}this._parser.precedingJoinState=d,this._activeBuffer.x<a&&i-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,c),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>_y(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new uy(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new ni(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(We));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,s=sn.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),l=new Uint32Array(n.length*i),a=0;for(let h=0;h<n.length;){let c=n.codePointAt(h)||0;l[a++]=c,h+=c>65535?2:1}let o=a;for(let h=1;h<i;++h)l.copyWithin(o,0,a),o+=a;return this.print(l,0,o),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(R.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(R.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(R.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(R.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(R.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,tn),this._charsetService.setgCharset(1,tn),this._charsetService.setgCharset(2,tn),this._charsetService.setgCharset(3,tn);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let i;(y=>(y[y.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",y[y.SET=1]="SET",y[y.RESET=2]="RESET",y[y.PERMANENTLY_SET=3]="PERMANENTLY_SET",y[y.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,l=this._coreService,{buffers:a,cols:o}=this._bufferService,{active:h,alt:c}=a,u=this._optionsService.rawOptions,d=(y,M)=>(l.triggerDataEvent(`${R.ESC}[${t?"":"?"}${y};${M}$y`),!0),f=y=>y?1:2,_=e.params[0];return t?_===2?d(_,4):_===4?d(_,f(l.modes.insertMode)):_===12?d(_,3):_===20?d(_,f(u.convertEol)):d(_,0):_===1?d(_,f(s.applicationCursorKeys)):_===3?d(_,u.windowOptions.setWinLines?o===80?2:o===132?1:0:0):_===6?d(_,f(s.origin)):_===7?d(_,f(s.wraparound)):_===8?d(_,3):_===9?d(_,f(r==="X10")):_===12?d(_,f(u.cursorBlink)):_===25?d(_,f(!l.isCursorHidden)):_===45?d(_,f(s.reverseWraparound)):_===66?d(_,f(s.applicationKeypad)):_===67?d(_,4):_===1e3?d(_,f(r==="VT200")):_===1002?d(_,f(r==="DRAG")):_===1003?d(_,f(r==="ANY")):_===1004?d(_,f(s.sendFocus)):_===1005?d(_,4):_===1006?d(_,f(n==="SGR")):_===1015?d(_,4):_===1016?d(_,f(n==="SGR_PIXELS")):_===1048?d(_,1):_===47||_===1047||_===1049?d(_,f(h===c)):_===2004?d(_,f(s.bracketedPasteMode)):_===2026?d(_,f(s.synchronizedOutput)):d(_,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=Wa.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let l=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=l[a];while(++a<l.length&&a+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let l=2;l<s.length;++l)s[l]===-1&&(s[l]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=We.fg,e.bg=We.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=We.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=We.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=We.fg&16777215,s.bg&=-67108864,s.bg|=We.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${R.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${R.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${R.ESC}[?${t};${i}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=We.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!_y(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${R.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>fy&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>fy&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(my(n))if(r==="?")t.push({type:0,index:n});else{let l=dy(r);l&&t.push({type:1,index:n,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=dy(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);my(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,tn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(uE[e[0]],Ze[e[1]]||tn),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=We.clone(),this._eraseAttrDataInternal=We.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Ci;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=l=>(this._coreService.triggerDataEvent(`${R.ESC}${l}${R.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},V_=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(vy=e,e=t,t=vy),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};V_=Oe([H(0,kt)],V_);function my(e){return 0<=e&&e<256}var fE=5e7,py=12,_E=50,gE=class extends G{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new N),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>fE)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let l=a=>performance.now()-i>=py?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(l);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=py)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>_E&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Y_=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),o={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._dataByLinkId.set(o.id,o),o.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(l,n)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Y_=Oe([H(0,kt)],Y_);var Sy=!1,vE=class extends G{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new cl),this._onBinary=this._register(new N),this.onBinary=this._onBinary.event,this._onData=this._register(new N),this.onData=this._onData.event,this._onLineFeed=this._register(new N),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new N),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new N),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new N),this._instantiationService=new P4,this.optionsService=this._register(new X4(e)),this._instantiationService.setService(Ot,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(I_)),this._instantiationService.setService(kt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(P_)),this._instantiationService.setService(By,this._logService),this.coreService=this._register(this._instantiationService.createInstance(F_)),this._instantiationService.setService(an,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(q_)),this._instantiationService.setService(Ry,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(sn)),this._instantiationService.setService(ox,this.unicodeService),this._charsetService=this._instantiationService.createInstance(tE),this._instantiationService.setService(ax,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Y_),this._instantiationService.setService(ky,this._oscLinkService),this._inputHandler=this._register(new dE(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(St.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(St.forward(this._bufferService.onResize,this._onResize)),this._register(St.forward(this.coreService.onData,this._onData)),this._register(St.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new gE((t,i)=>this._inputHandler.parse(t,i))),this._register(St.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new N),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Sy&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Sy=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,yb),t=Math.max(t,bb),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(cy.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(cy(this._bufferService),!1))),this._windowsWrappingHeuristics.value=be(()=>{for(let t of e)t.dispose()})}}},mE={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function pE(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=R.ESC+"OA":r.key=R.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=R.ESC+"OD":r.key=R.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=R.ESC+"OC":r.key=R.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=R.ESC+"OB":r.key=R.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":R.DEL,e.altKey&&(r.key=R.ESC+r.key);break;case 9:if(e.shiftKey){r.key=R.ESC+"[Z";break}r.key=R.HT,r.cancel=!0;break;case 13:r.key=e.altKey?R.ESC+R.CR:R.CR,r.cancel=!0;break;case 27:r.key=R.ESC,e.altKey&&(r.key=R.ESC+R.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=R.ESC+"[1;"+(n+1)+"D":t?r.key=R.ESC+"OD":r.key=R.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=R.ESC+"[1;"+(n+1)+"C":t?r.key=R.ESC+"OC":r.key=R.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=R.ESC+"[1;"+(n+1)+"A":t?r.key=R.ESC+"OA":r.key=R.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=R.ESC+"[1;"+(n+1)+"B":t?r.key=R.ESC+"OB":r.key=R.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=R.ESC+"[2~");break;case 46:n?r.key=R.ESC+"[3;"+(n+1)+"~":r.key=R.ESC+"[3~";break;case 36:n?r.key=R.ESC+"[1;"+(n+1)+"H":t?r.key=R.ESC+"OH":r.key=R.ESC+"[H";break;case 35:n?r.key=R.ESC+"[1;"+(n+1)+"F":t?r.key=R.ESC+"OF":r.key=R.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=R.ESC+"[5;"+(n+1)+"~":r.key=R.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=R.ESC+"[6;"+(n+1)+"~":r.key=R.ESC+"[6~";break;case 112:n?r.key=R.ESC+"[1;"+(n+1)+"P":r.key=R.ESC+"OP";break;case 113:n?r.key=R.ESC+"[1;"+(n+1)+"Q":r.key=R.ESC+"OQ";break;case 114:n?r.key=R.ESC+"[1;"+(n+1)+"R":r.key=R.ESC+"OR";break;case 115:n?r.key=R.ESC+"[1;"+(n+1)+"S":r.key=R.ESC+"OS";break;case 116:n?r.key=R.ESC+"[15;"+(n+1)+"~":r.key=R.ESC+"[15~";break;case 117:n?r.key=R.ESC+"[17;"+(n+1)+"~":r.key=R.ESC+"[17~";break;case 118:n?r.key=R.ESC+"[18;"+(n+1)+"~":r.key=R.ESC+"[18~";break;case 119:n?r.key=R.ESC+"[19;"+(n+1)+"~":r.key=R.ESC+"[19~";break;case 120:n?r.key=R.ESC+"[20;"+(n+1)+"~":r.key=R.ESC+"[20~";break;case 121:n?r.key=R.ESC+"[21;"+(n+1)+"~":r.key=R.ESC+"[21~";break;case 122:n?r.key=R.ESC+"[23;"+(n+1)+"~":r.key=R.ESC+"[23~";break;case 123:n?r.key=R.ESC+"[24;"+(n+1)+"~":r.key=R.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=R.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=R.DEL:e.keyCode===219?r.key=R.ESC:e.keyCode===220?r.key=R.FS:e.keyCode===221&&(r.key=R.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let l=mE[e.keyCode]?.[e.shiftKey?1:0];if(l)r.key=R.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,o=String.fromCharCode(a);e.shiftKey&&(o=o.toUpperCase()),r.key=R.ESC+o}else if(e.keyCode===32)r.key=R.ESC+(e.ctrlKey?R.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=R.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=R.US),e.key==="@"&&(r.key=R.NUL));break}return r}var Ue=0,SE=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new fc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new fc,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Ue=this._search(t),Ue===-1)||this._getKey(this._array[Ue])!==t)return!1;do if(this._array[Ue]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ue),!0;while(++Ue<this._array.length&&this._getKey(this._array[Ue])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,n)=>r-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ue=this._search(e),!(Ue<0||Ue>=this._array.length)&&this._getKey(this._array[Ue])===e))do yield this._array[Ue];while(++Ue<this._array.length&&this._getKey(this._array[Ue])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ue=this._search(e),!(Ue<0||Ue>=this._array.length)&&this._getKey(this._array[Ue])===e))do t(this._array[Ue]);while(++Ue<this._array.length&&this._getKey(this._array[Ue])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},o_=0,yy=0,yE=class extends G{constructor(){super(),this._decorations=new SE(e=>e?.marker.line),this._onDecorationRegistered=this._register(new N),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new N),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(be(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new bE(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,r=>{o_=r.options.x??0,yy=o_+(r.options.width??1),e>=o_&&e<yy&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},bE=class extends wr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new N),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new N),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Le.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Le.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},wE=1e3,CE=class{constructor(e,t=wE){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},by=20,wy=!1,_c=class extends G{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new CE(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");wy?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=r.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(r.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(r.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
43
+ `))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(W(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(be(()=>{wy?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<by+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
44
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===by+1&&(this._liveRegion.textContent+=c_.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),l=[],a=n?.translateToString(!0,void 0,void 0,l)||"",o=(i.ydisp+r+1).toString(),h=this._rowElements[r];h&&(a.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=a,this._rowColumns.set(h,l)),h.setAttribute("aria-posinset",o),h.setAttribute("aria-setsize",s),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let l,a;if(t===0?(l=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(l=this._rowElements.shift(),a=i,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let o=this._createAccessibilityTreeNode();this._rowElements.unshift(o),this._rowContainer.insertAdjacentElement("afterbegin",o)}else{let o=this._createAccessibilityTreeNode();this._rowElements.push(o),this._rowContainer.appendChild(o)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:o})=>{let h=a instanceof Text?a.parentNode:a,c=parseInt(h?.getAttribute("aria-posinset"),10)-1;if(isNaN(c))return console.warn("row is invalid. Race condition?"),null;let u=this._rowColumns.get(h);if(!u)return console.warn("columns is null. Race condition?"),null;let d=o<u.length?u[o]:u.slice(-1)[0]+1;return d>=this._terminal.cols&&(++c,d=0),{row:c,column:d}},n=r(t),l=r(i);if(!(!n||!l)){if(n.row>l.row||n.row===l.row&&n.column>=l.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(l.row-n.row)*this._terminal.cols-n.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};_c=Oe([H(1,K_),H(2,Ts),H(3,Ms)],_c);var G_=class extends G{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new N),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new N),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(be(()=>{nn(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(W(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(W(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(W(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(W(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let l=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,l),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let l=r[n],a=l.link.range.start.y<e?0:l.link.range.start.x,o=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let h=a;h<=o;h++){if(i.has(h)){r.splice(n--,1);break}i.add(h)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;n<e;n++)(!this._activeProviderReplies.has(n)||this._activeProviderReplies.get(n))&&(r=!0);if(!r&&s){let n=s.find(l=>this._linkAtPosition(l.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;n<this._activeProviderReplies.size;n++){let l=this._activeProviderReplies.get(n)?.find(a=>this._linkAtPosition(a.link,t));if(l){i=!0,this._handleNewLink(l);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&xE(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,nn(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};G_=Oe([H(1,j_),H(2,Ms),H(3,kt),H(4,Ny)],G_);function xE(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var EE=class extends vE{constructor(e={}){super(e),this._linkifier=this._register(new cl),this.browser=hb,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new cl),this._onCursorMove=this._register(new N),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new N),this.onKey=this._onKey.event,this._onRender=this._register(new N),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new N),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new N),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new N),this.onBell=this._onBell.event,this._onFocus=this._register(new N),this._onBlur=this._register(new N),this._onA11yCharEmitter=this._register(new N),this._onA11yTabEmitter=this._register(new N),this._onWillOpen=this._register(new N),this._setup(),this._decorationService=this._instantiationService.createInstance(yE),this._instantiationService.setService(Va,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(f4),this._instantiationService.setService(Ny,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(d_)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(St.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(St.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(St.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(St.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(be(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=ye.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${R.ESC}]${s};${cE(r)}${ab.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Ve.toColor(...t.color));else{let n=i;this._themeService.modifyColors(l=>l[n]=Ve.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(_c,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(R.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(R.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,l=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=l+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(W(this.element,"copy",t=>{this.hasSelection()&&tx(t,this._selectionService)}));let e=t=>ix(t,this.textarea,this.coreService,this.optionsService);this._register(W(this.textarea,"paste",e)),this._register(W(this.element,"paste",e)),cb?this._register(W(this.element,"mousedown",t=>{t.button===2&&CS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(W(this.element,"contextmenu",t=>{CS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),i0&&this._register(W(this.element,"auxclick",t=>{t.button===1&&Ty(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(W(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(W(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(W(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(W(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(W(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(W(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(W(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(W(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",h_.get()),fb||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(u4,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Ts,this._coreBrowserService),this._register(W(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(W(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(O_,this._document,this._helperContainer),this._instantiationService.setService(vc,this._charSizeService),this._themeService=this._instantiationService.createInstance(U_),this._instantiationService.setService(ul,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(uc),this._instantiationService.setService(Oy,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(z_,this.rows,this.screenElement)),this._instantiationService.setService(Ms,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(R_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N_),this._instantiationService.setService(j_,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(G_,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(A_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(H_,this.element,this.screenElement,s)),this._instantiationService.setService(cx,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(St.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(D_,this.screenElement)),this._register(W(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(_c,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(cc,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(cc,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(k_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let l=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!l)return!1;let a,o;switch(n.overrideType||n.type){case"mousemove":o=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":o=0,a=n.button<3?n.button:3;break;case"mousedown":o=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let h=n.deltaY;if(h===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;o=h<0?0:1,a=4;break;default:return!1}return o===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:a,action:o,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(W(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(W(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let l=R.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(l,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Ey(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=pE(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===R.ETX||i.key===R.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(TE(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(We));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(R.ESC+"[I"):this.coreService.triggerDataEvent(R.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${R.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${R.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function TE(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var ME=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},LE=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ci)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Cy=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new LE(t)}getNullCell(){return new Ci}},AE=class extends G{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new N),this.onBufferChange=this._onBufferChange.event,this._normal=new Cy(this._core.buffers.normal,"normal"),this._alternate=new Cy(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},DE=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},RE=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},BE=["cols","rows"],Ji=0,Cb=class extends G{constructor(e){super(),this._core=this._register(new EE(e)),this._addonManager=this._register(new ME),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(BE.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new DE(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new RE(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new AE(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
45
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return h_.get()},set promptLabel(e){h_.set(e)},get tooMuchOutput(){return c_.get()},set tooMuchOutput(e){c_.set(e)}}}_verifyIntegers(...e){for(Ji of e)if(Ji===1/0||isNaN(Ji)||Ji%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Ji of e)if(Ji&&(Ji===1/0||isNaN(Ji)||Ji%1!==0||Ji<0))throw new Error("This API only accepts positive integers")}};var kE=2,OE=1,xb=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),l={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=l.top+l.bottom,o=l.right+l.left,h=s-a,c=r-o-t;return{cols:Math.max(kE,Math.floor(c/e.css.cell.width)),rows:Math.max(OE,Math.floor(h/e.css.cell.height))}}};var s0=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],NE=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Qe;function zE(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var HE=class{constructor(){if(this.version="6",!Qe){Qe=new Uint8Array(65536),Qe.fill(1),Qe[0]=0,Qe.fill(0,1,32),Qe.fill(0,127,160),Qe.fill(2,4352,4448),Qe[9001]=2,Qe[9002]=2,Qe.fill(2,11904,42192),Qe[12351]=1,Qe.fill(2,44032,55204),Qe.fill(2,63744,64256),Qe.fill(2,65040,65050),Qe.fill(2,65072,65136),Qe.fill(2,65280,65377),Qe.fill(2,65504,65511);for(let e=0;e<s0.length;++e)Qe.fill(0,s0[e][0],s0[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Qe[e]:zE(e,NE)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=xc.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return xc.createPropertyValue(0,i,s)}},UE=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Eb.isErrorNoTelemetry(e)?new Eb(e.message+`
46
+
47
+ `+e.stack):new Error(e.message+`
48
+
49
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},PE=new UE;function r0(e){IE(e)||PE.onUnexpectedError(e)}var a0="Canceled";function IE(e){return e instanceof FE?!0:e instanceof Error&&e.name===a0&&e.message===a0}var FE=class extends Error{constructor(){super(a0),this.name=this.message}},Eb=class o0 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof o0)return t;let i=new o0;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function qE(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}function WE(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let l=Math.floor((r+n)/2);t(e[l])?r=l+1:n=l}return r-1}var VE=class kb{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(kb.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=WE(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};VE.assertInvariants=!1;var Ob;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Ob||={});function YE(e,t){return(i,s)=>t(e(i),e(s))}var GE=(e,t)=>e-t,Tb=class h0{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new h0(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new h0(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||Ob.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};Tb.empty=new Tb(e=>{});function KE(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var Mb,Lb,SA=class{constructor(e,t){this.toKey=t,this._map=new Map,this[Mb]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(Lb=Symbol.iterator,Mb=Symbol.toStringTag,Lb)](){return this.values()}},jE=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}},Nb;(e=>{function t(g){return g&&typeof g=="object"&&typeof g[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(g){yield g}e.single=r;function n(g){return t(g)?g:r(g)}e.wrap=n;function l(g){return g||i}e.from=l;function*a(g){for(let T=g.length-1;T>=0;T--)yield g[T]}e.reverse=a;function o(g){return!g||g[Symbol.iterator]().next().done===!0}e.isEmpty=o;function h(g){return g[Symbol.iterator]().next().value}e.first=h;function c(g,T){let L=0;for(let B of g)if(T(B,L++))return!0;return!1}e.some=c;function u(g,T){for(let L of g)if(T(L))return L}e.find=u;function*d(g,T){for(let L of g)T(L)&&(yield L)}e.filter=d;function*f(g,T){let L=0;for(let B of g)yield T(B,L++)}e.map=f;function*_(g,T){let L=0;for(let B of g)yield*T(B,L++)}e.flatMap=_;function*y(...g){for(let T of g)yield*T}e.concat=y;function M(g,T,L){let B=L;for(let O of g)B=T(B,O);return B}e.reduce=M;function*m(g,T,L=g.length){for(T<0&&(T+=g.length),L<0?L+=g.length:L>g.length&&(L=g.length);T<L;T++)yield g[T]}e.slice=m;function v(g,T=Number.POSITIVE_INFINITY){let L=[];if(T===0)return[L,g];let B=g[Symbol.iterator]();for(let O=0;O<T;O++){let I=B.next();if(I.done)return[L,e.empty()];L.push(I.value)}return[L,{[Symbol.iterator](){return B}}]}e.consume=v;async function S(g){let T=[];for await(let L of g)T.push(L);return Promise.resolve(T)}e.asyncToArray=S})(Nb||={});var $E=!1,fl=null,XE=class zb{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:zb.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let o=new Map,h=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,o).isSingleton);if(h.length===0)return;let c=new Set(h.map(u=>u.value));if(s=h.filter(u=>!(u.parent&&c.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(o){function h(u,d){for(;u.length>0&&d.some(f=>typeof f=="string"?f===u[0]:u[0].match(f));)u.shift()}let c=o.source.split(`
50
+ `).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return h(c,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),c.reverse()}let n=new jE;for(let o of s){let h=r(o);for(let c=0;c<=h.length;c++)n.add(h.slice(0,c).join(`
51
+ `),o)}s.sort(YE(o=>o.idx,GE));let l="",a=0;for(let o of s.slice(0,t)){a++;let h=r(o),c=[];for(let u=0;u<h.length;u++){let d=h[u];d=`(shared with ${n.get(h.slice(0,u+1).join(`
52
+ `)).size}/${s.length} leaks) at ${d}`;let f=n.get(h.slice(0,u).join(`
53
+ `)),_=KE([...f].map(y=>r(y)[u]),y=>y);delete _[h[u]];for(let[y,M]of Object.entries(_))c.unshift(` - stacktraces of ${M.length} other leaks continue with ${y}`);c.unshift(d)}l+=`
54
+
55
+
56
+ ==================== Leaking disposable ${a}/${s.length}: ${o.value.constructor.name} ====================
57
+ ${c.join(`
58
+ `)}
59
+ ============================================================
60
+
61
+ `}return s.length>t&&(l+=`
62
+
63
+
64
+ ... and ${s.length-t} more leaking disposables
65
+
66
+ `),{leaks:s,details:l}}};XE.idx=0;function ZE(e){fl=e}if($E){let e="__is_disposable_tracked__";ZE(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==_l.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==_l.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function g0(e){return fl?.trackDisposable(e),e}function v0(e){fl?.markAsDisposed(e)}function c0(e,t){fl?.setParent(e,t)}function QE(e,t){if(fl)for(let i of e)fl.setParent(i,t)}function Hb(e){if(Nb.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function JE(...e){let t=Ub(()=>Hb(e));return QE(e,t),t}function Ub(e){let t=g0({dispose:qE(()=>{v0(t),e()})});return t}var Pb=class Ib{constructor(){this._toDispose=new Set,this._isDisposed=!1,g0(this)}dispose(){this._isDisposed||(v0(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hb(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return c0(t,this),this._isDisposed?Ib.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),c0(t,null))}};Pb.DISABLE_DISPOSED_WARNING=!1;var m0=Pb,_l=class{constructor(){this._store=new m0,g0(this),c0(this._store,this)}dispose(){v0(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_l.None=Object.freeze({dispose(){}});var Ab=class u0{constructor(t){this.element=t,this.next=u0.Undefined,this.prev=u0.Undefined}};Ab.Undefined=new Ab(void 0);var eT=globalThis.performance&&typeof globalThis.performance.now=="function",tT=class Fb{static create(t){return new Fb(t)}constructor(t){this._now=eT&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},iT=!1,Db=!1,sT=!1,rT;(e=>{e.None=()=>_l.None;function t(w){if(sT){let{onDidAddListener:p}=w,C=_0.create(),b=0;w.onDidAddListener=()=>{++b===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),C.print()),p?.()}}}function i(w,p){return d(w,()=>{},0,void 0,!0,void 0,p)}e.defer=i;function s(w){return(p,C=null,b)=>{let E=!1,x;return x=w(A=>{if(!E)return x?x.dispose():E=!0,p.call(C,A)},null,b),E&&x.dispose(),x}}e.once=s;function r(w,p,C){return c((b,E=null,x)=>w(A=>b.call(E,p(A)),null,x),C)}e.map=r;function n(w,p,C){return c((b,E=null,x)=>w(A=>{p(A),b.call(E,A)},null,x),C)}e.forEach=n;function l(w,p,C){return c((b,E=null,x)=>w(A=>p(A)&&b.call(E,A),null,x),C)}e.filter=l;function a(w){return w}e.signal=a;function o(...w){return(p,C=null,b)=>{let E=JE(...w.map(x=>x(A=>p.call(C,A))));return u(E,b)}}e.any=o;function h(w,p,C,b){let E=C;return r(w,x=>(E=p(E,x),E),b)}e.reduce=h;function c(w,p){let C,b={onWillAddFirstListener(){C=w(E.fire,E)},onDidRemoveLastListener(){C?.dispose()}};p||t(b);let E=new Cr(b);return p?.add(E),E.event}function u(w,p){return p instanceof Array?p.push(w):p&&p.add(w),w}function d(w,p,C=100,b=!1,E=!1,x,A){let k,U,Q,K=0,J,Pe={leakWarningThreshold:x,onWillAddFirstListener(){k=w(Ee=>{K++,U=p(U,Ee),b&&!Q&&(te.fire(U),U=void 0),J=()=>{let le=U;U=void 0,Q=void 0,(!b||K>1)&&te.fire(le),K=0},typeof C=="number"?(clearTimeout(Q),Q=setTimeout(J,C)):Q===void 0&&(Q=0,queueMicrotask(J))})},onWillRemoveListener(){E&&K>0&&J?.()},onDidRemoveLastListener(){J=void 0,k.dispose()}};A||t(Pe);let te=new Cr(Pe);return A?.add(te),te.event}e.debounce=d;function f(w,p=0,C){return e.debounce(w,(b,E)=>b?(b.push(E),b):[E],p,void 0,!0,void 0,C)}e.accumulate=f;function _(w,p=(b,E)=>b===E,C){let b=!0,E;return l(w,x=>{let A=b||!p(x,E);return b=!1,E=x,A},C)}e.latch=_;function y(w,p,C){return[e.filter(w,p,C),e.filter(w,b=>!p(b),C)]}e.split=y;function M(w,p=!1,C=[],b){let E=C.slice(),x=w(U=>{E?E.push(U):k.fire(U)});b&&b.add(x);let A=()=>{E?.forEach(U=>k.fire(U)),E=null},k=new Cr({onWillAddFirstListener(){x||(x=w(U=>k.fire(U)),b&&b.add(x))},onDidAddFirstListener(){E&&(p?setTimeout(A):A())},onDidRemoveLastListener(){x&&x.dispose(),x=null}});return b&&b.add(k),k.event}e.buffer=M;function m(w,p){return(C,b,E)=>{let x=p(new S);return w(function(A){let k=x.evaluate(A);k!==v&&C.call(b,k)},void 0,E)}}e.chain=m;let v=Symbol("HaltChainable");class S{constructor(){this.steps=[]}map(p){return this.steps.push(p),this}forEach(p){return this.steps.push(C=>(p(C),C)),this}filter(p){return this.steps.push(C=>p(C)?C:v),this}reduce(p,C){let b=C;return this.steps.push(E=>(b=p(b,E),b)),this}latch(p=(C,b)=>C===b){let C=!0,b;return this.steps.push(E=>{let x=C||!p(E,b);return C=!1,b=E,x?E:v}),this}evaluate(p){for(let C of this.steps)if(p=C(p),p===v)break;return p}}function g(w,p,C=b=>b){let b=(...k)=>A.fire(C(...k)),E=()=>w.on(p,b),x=()=>w.removeListener(p,b),A=new Cr({onWillAddFirstListener:E,onDidRemoveLastListener:x});return A.event}e.fromNodeEventEmitter=g;function T(w,p,C=b=>b){let b=(...k)=>A.fire(C(...k)),E=()=>w.addEventListener(p,b),x=()=>w.removeEventListener(p,b),A=new Cr({onWillAddFirstListener:E,onDidRemoveLastListener:x});return A.event}e.fromDOMEventEmitter=T;function L(w){return new Promise(p=>s(w)(p))}e.toPromise=L;function B(w){let p=new Cr;return w.then(C=>{p.fire(C)},()=>{p.fire(void 0)}).finally(()=>{p.dispose()}),p.event}e.fromPromise=B;function O(w,p){return w(C=>p.fire(C))}e.forward=O;function I(w,p,C){return p(C),w(b=>p(b))}e.runAndSubscribe=I;class F{constructor(p,C){this._observable=p,this._counter=0,this._hasChanged=!1;let b={onWillAddFirstListener:()=>{p.addObserver(this)},onDidRemoveLastListener:()=>{p.removeObserver(this)}};C||t(b),this.emitter=new Cr(b),C&&C.add(this.emitter)}beginUpdate(p){this._counter++}handlePossibleChange(p){}handleChange(p,C){this._hasChanged=!0}endUpdate(p){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(w,p){return new F(w,p).emitter.event}e.fromObservable=P;function wt(w){return(p,C,b)=>{let E=0,x=!1,A={beginUpdate(){E++},endUpdate(){E--,E===0&&(w.reportChanges(),x&&(x=!1,p.call(C)))},handlePossibleChange(){},handleChange(){x=!0}};w.addObserver(A),w.reportChanges();let k={dispose(){w.removeObserver(A)}};return b instanceof m0?b.add(k):Array.isArray(b)&&b.push(k),k}}e.fromObservableLight=wt})(rT||={});var d0=class f0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${f0._idPool++}`,f0.all.add(this)}start(t){this._stopWatch=new tT,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};d0.all=new Set,d0._idPool=0;var nT=d0,Rb=-1,qb=class Wb{constructor(t,i,s=(Wb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,l]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${l}):`;console.warn(a),console.warn(n);let o=new aT(a,n);this._errorHandler(o)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};qb._idPool=1;var lT=qb,_0=class Vb{constructor(t){this.value=t}static create(){let t=new Error;return new Vb(t.stack??"")}print(){console.warn(this.value.split(`
67
+ `).slice(2).join(`
68
+ `))}},aT=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},oT=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},hT=0,bc=class{constructor(e){this.value=e,this.id=hT++}},cT=2,uT=(e,t)=>{if(e instanceof bc)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},wc;if(iT){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
69
+ `)),e.length=0)},3e3),wc=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var Cr=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Rb>0||this._options?.leakWarningThreshold?new lT(e?.onListenerError??r0,this._options?.leakWarningThreshold??Rb):void 0,this._perfMon=this._options?._profName?new nT(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Db){let e=this._listeners;queueMicrotask(()=>{uT(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new oT(`${a}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||r0)(h),_l.None}if(this._disposed)return _l.None;t&&(e=e.bind(t));let s=new bc(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=_0.create(),r=this._leakageMon.check(s.stack,this._size+1)),Db&&(s.stack=n??_0.create()),this._listeners?this._listeners instanceof bc?(this._deliveryQueue??=new dT,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=Ub(()=>{wc?.unregister(l),r?.(),this._removeListener(s)});if(i instanceof m0?i.add(l):Array.isArray(i)&&i.push(l),wc){let a=new Error().stack.split(`
70
+ `).slice(2,3).join(`
71
+ `).trim(),o=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);wc.register(l,o?.[2]??a,l)}return l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*cT<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||r0;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof bc)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},dT=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},xc=class Cc{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Cr,this.onChange=this._onChange.event;let t=new HE;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let l=t.charCodeAt(n);if(55296<=l&&l<=56319){if(++n>=r)return i+this.wcwidth(l);let h=t.charCodeAt(n);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:i+=this.wcwidth(h)}let a=this.charProperties(l,s),o=Cc.extractWidth(a);Cc.extractShouldJoin(a)&&(o-=Cc.extractWidth(s)),i+=o,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},n0=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],fT=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],l0=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_T=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],Ls;function Bb(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var gT=class{constructor(){if(this.version="11",!Ls){Ls=new Uint8Array(65536),Ls.fill(1),Ls[0]=0,Ls.fill(0,1,32),Ls.fill(0,127,160);for(let e=0;e<n0.length;++e)Ls.fill(0,n0[e][0],n0[e][1]+1);for(let e=0;e<l0.length;++e)Ls.fill(2,l0[e][0],l0[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ls[e]:Bb(e,fT)?0:Bb(e,_T)?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=xc.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return xc.createPropertyValue(0,i,s)}},Yb=class{activate(e){e.unicode.register(new gT)}dispose(){}};var vT=Object.defineProperty,mT=Object.getOwnPropertyDescriptor,pT=(e,t,i,s)=>{for(var r=s>1?void 0:s?mT(t,i):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(r=(s?l(t,i,r):l(r))||r);return s&&r&&vT(t,i,r),r},ST=(e,t)=>(i,s)=>t(i,s,e),yT=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Gb.isErrorNoTelemetry(e)?new Gb(e.message+`
72
+
73
+ `+e.stack):new Error(e.message+`
74
+
75
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},bT=new yT;function Ac(e){wT(e)||bT.onUnexpectedError(e)}var B0="Canceled";function wT(e){return e instanceof CT?!0:e instanceof Error&&e.name===B0&&e.message===B0}var CT=class extends Error{constructor(){super(B0),this.name=this.message}},Gb=class k0 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof k0)return t;let i=new k0;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function xT(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let l=Math.floor((r+n)/2);t(e[l])?r=l+1:n=l}return r-1}var ET=class A2{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(A2.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=xT(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};ET.assertInvariants=!1;var D2;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(D2||={});function TT(e,t){return(i,s)=>t(e(i),e(s))}var MT=(e,t)=>e-t,Kb=class O0{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new O0(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new O0(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||D2.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};Kb.empty=new Kb(e=>{});function LT(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var jb,$b,NA=class{constructor(e,t){this.toKey=t,this._map=new Map,this[jb]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[($b=Symbol.iterator,jb=Symbol.toStringTag,$b)](){return this.values()}},AT=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};function DT(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}var R2;(e=>{function t(g){return g&&typeof g=="object"&&typeof g[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(g){yield g}e.single=r;function n(g){return t(g)?g:r(g)}e.wrap=n;function l(g){return g||i}e.from=l;function*a(g){for(let T=g.length-1;T>=0;T--)yield g[T]}e.reverse=a;function o(g){return!g||g[Symbol.iterator]().next().done===!0}e.isEmpty=o;function h(g){return g[Symbol.iterator]().next().value}e.first=h;function c(g,T){let L=0;for(let B of g)if(T(B,L++))return!0;return!1}e.some=c;function u(g,T){for(let L of g)if(T(L))return L}e.find=u;function*d(g,T){for(let L of g)T(L)&&(yield L)}e.filter=d;function*f(g,T){let L=0;for(let B of g)yield T(B,L++)}e.map=f;function*_(g,T){let L=0;for(let B of g)yield*T(B,L++)}e.flatMap=_;function*y(...g){for(let T of g)yield*T}e.concat=y;function M(g,T,L){let B=L;for(let O of g)B=T(B,O);return B}e.reduce=M;function*m(g,T,L=g.length){for(T<0&&(T+=g.length),L<0?L+=g.length:L>g.length&&(L=g.length);T<L;T++)yield g[T]}e.slice=m;function v(g,T=Number.POSITIVE_INFINITY){let L=[];if(T===0)return[L,g];let B=g[Symbol.iterator]();for(let O=0;O<T;O++){let I=B.next();if(I.done)return[L,e.empty()];L.push(I.value)}return[L,{[Symbol.iterator](){return B}}]}e.consume=v;async function S(g){let T=[];for await(let L of g)T.push(L);return Promise.resolve(T)}e.asyncToArray=S})(R2||={});var RT=!1,yl=null,BT=class B2{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:B2.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let o=new Map,h=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,o).isSingleton);if(h.length===0)return;let c=new Set(h.map(u=>u.value));if(s=h.filter(u=>!(u.parent&&c.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(o){function h(u,d){for(;u.length>0&&d.some(f=>typeof f=="string"?f===u[0]:u[0].match(f));)u.shift()}let c=o.source.split(`
76
+ `).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return h(c,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),c.reverse()}let n=new AT;for(let o of s){let h=r(o);for(let c=0;c<=h.length;c++)n.add(h.slice(0,c).join(`
77
+ `),o)}s.sort(TT(o=>o.idx,MT));let l="",a=0;for(let o of s.slice(0,t)){a++;let h=r(o),c=[];for(let u=0;u<h.length;u++){let d=h[u];d=`(shared with ${n.get(h.slice(0,u+1).join(`
78
+ `)).size}/${s.length} leaks) at ${d}`;let f=n.get(h.slice(0,u).join(`
79
+ `)),_=LT([...f].map(y=>r(y)[u]),y=>y);delete _[h[u]];for(let[y,M]of Object.entries(_))c.unshift(` - stacktraces of ${M.length} other leaks continue with ${y}`);c.unshift(d)}l+=`
80
+
81
+
82
+ ==================== Leaking disposable ${a}/${s.length}: ${o.value.constructor.name} ====================
83
+ ${c.join(`
84
+ `)}
85
+ ============================================================
86
+
87
+ `}return s.length>t&&(l+=`
88
+
89
+
90
+ ... and ${s.length-t} more leaking disposables
91
+
92
+ `),{leaks:s,details:l}}};BT.idx=0;function kT(e){yl=e}if(RT){let e="__is_disposable_tracked__";kT(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==hi.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==hi.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function Pc(e){return yl?.trackDisposable(e),e}function Ic(e){yl?.markAsDisposed(e)}function Ja(e,t){yl?.setParent(e,t)}function OT(e,t){if(yl)for(let i of e)yl.setParent(i,t)}function k2(e){if(R2.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function O2(...e){let t=bt(()=>k2(e));return OT(e,t),t}function bt(e){let t=Pc({dispose:DT(()=>{Ic(t),e()})});return t}var N2=class z2{constructor(){this._toDispose=new Set,this._isDisposed=!1,Pc(this)}dispose(){this._isDisposed||(Ic(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{k2(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Ja(t,this),this._isDisposed?z2.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),Ja(t,null))}};N2.DISABLE_DISPOSED_WARNING=!1;var Sl=N2,hi=class{constructor(){this._store=new Sl,Pc(this),Ja(this._store,this)}dispose(){Ic(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};hi.None=Object.freeze({dispose(){}});var Ka=class{constructor(){this._isDisposed=!1,Pc(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Ja(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Ic(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Ja(e,null),e}},W0=typeof process<"u"&&"title"in process,to=W0?"node":navigator.userAgent,V0=W0?"node":navigator.platform,NT=to.includes("Firefox"),zT=to.includes("Edge"),H2=/^((?!chrome|android).)*safari/i.test(to);function HT(){if(!H2)return 0;let e=to.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var zA=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(V0),HA=["Windows","Win16","Win32","WinCE"].includes(V0),UA=V0.indexOf("Linux")>=0,PA=/\bCrOS\b/.test(to),UT="",ht=0,ct=0,ut=0,ze=0,xi={css:"#00000000",rgba:0},zt;(e=>{function t(r,n,l,a){return a!==void 0?`#${on(r)}${on(n)}${on(l)}${on(a)}`:`#${on(r)}${on(n)}${on(l)}`}e.toCss=t;function i(r,n,l,a=255){return(r<<24|n<<16|l<<8|a)>>>0}e.toRgba=i;function s(r,n,l,a){return{css:e.toCss(r,n,l,a),rgba:e.toRgba(r,n,l,a)}}e.toColor=s})(zt||={});var Qa;(e=>{function t(o,h){if(ze=(h.rgba&255)/255,ze===1)return{css:h.css,rgba:h.rgba};let c=h.rgba>>24&255,u=h.rgba>>16&255,d=h.rgba>>8&255,f=o.rgba>>24&255,_=o.rgba>>16&255,y=o.rgba>>8&255;ht=f+Math.round((c-f)*ze),ct=_+Math.round((u-_)*ze),ut=y+Math.round((d-y)*ze);let M=zt.toCss(ht,ct,ut),m=zt.toRgba(ht,ct,ut);return{css:M,rgba:m}}e.blend=t;function i(o){return(o.rgba&255)===255}e.isOpaque=i;function s(o,h,c){let u=hn.ensureContrastRatio(o.rgba,h.rgba,c);if(u)return zt.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(o){let h=(o.rgba|255)>>>0;return[ht,ct,ut]=hn.toChannels(h),{css:zt.toCss(ht,ct,ut),rgba:h}}e.opaque=r;function n(o,h){return ze=Math.round(h*255),[ht,ct,ut]=hn.toChannels(o.rgba),{css:zt.toCss(ht,ct,ut,ze),rgba:zt.toRgba(ht,ct,ut,ze)}}e.opacity=n;function l(o,h){return ze=o.rgba&255,n(o,ze*h/255)}e.multiplyOpacity=l;function a(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}e.toColorRGB=a})(Qa||={});var PT;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return ht=parseInt(r.slice(1,2).repeat(2),16),ct=parseInt(r.slice(2,3).repeat(2),16),ut=parseInt(r.slice(3,4).repeat(2),16),zt.toColor(ht,ct,ut);case 5:return ht=parseInt(r.slice(1,2).repeat(2),16),ct=parseInt(r.slice(2,3).repeat(2),16),ut=parseInt(r.slice(3,4).repeat(2),16),ze=parseInt(r.slice(4,5).repeat(2),16),zt.toColor(ht,ct,ut,ze);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return ht=parseInt(n[1]),ct=parseInt(n[2]),ut=parseInt(n[3]),ze=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),zt.toColor(ht,ct,ut,ze);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[ht,ct,ut,ze]=t.getImageData(0,0,1,1).data,ze!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:zt.toRgba(ht,ct,ut,ze),css:r}}e.toColor=s})(PT||={});var Nt;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let l=s/255,a=r/255,o=n/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4);return h*.2126+c*.7152+u*.0722}e.relativeLuminance2=i})(Nt||={});var hn;(e=>{function t(l,a){if(ze=(a&255)/255,ze===1)return a;let o=a>>24&255,h=a>>16&255,c=a>>8&255,u=l>>24&255,d=l>>16&255,f=l>>8&255;return ht=u+Math.round((o-u)*ze),ct=d+Math.round((h-d)*ze),ut=f+Math.round((c-f)*ze),zt.toRgba(ht,ct,ut)}e.blend=t;function i(l,a,o){let h=Nt.relativeLuminance(l>>8),c=Nt.relativeLuminance(a>>8);if(As(h,c)<o){if(c<h){let f=s(l,a,o),_=As(h,Nt.relativeLuminance(f>>8));if(_<o){let y=r(l,a,o),M=As(h,Nt.relativeLuminance(y>>8));return _>M?f:y}return f}let u=r(l,a,o),d=As(h,Nt.relativeLuminance(u>>8));if(d<o){let f=s(l,a,o),_=As(h,Nt.relativeLuminance(f>>8));return d>_?u:f}return u}}e.ensureContrastRatio=i;function s(l,a,o){let h=l>>24&255,c=l>>16&255,u=l>>8&255,d=a>>24&255,f=a>>16&255,_=a>>8&255,y=As(Nt.relativeLuminance2(d,f,_),Nt.relativeLuminance2(h,c,u));for(;y<o&&(d>0||f>0||_>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),_-=Math.max(0,Math.ceil(_*.1)),y=As(Nt.relativeLuminance2(d,f,_),Nt.relativeLuminance2(h,c,u));return(d<<24|f<<16|_<<8|255)>>>0}e.reduceLuminance=s;function r(l,a,o){let h=l>>24&255,c=l>>16&255,u=l>>8&255,d=a>>24&255,f=a>>16&255,_=a>>8&255,y=As(Nt.relativeLuminance2(d,f,_),Nt.relativeLuminance2(h,c,u));for(;y<o&&(d<255||f<255||_<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),y=As(Nt.relativeLuminance2(d,f,_),Nt.relativeLuminance2(h,c,u));return(d<<24|f<<16|_<<8|255)>>>0}e.increaseLuminance=r;function n(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=n})(hn||={});function on(e){let t=e.toString(16);return t.length<2?"0"+t:t}function As(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function Ye(e){if(!e)throw new Error("value must not be falsy");return e}function Y0(e){return 57508<=e&&e<=57558}function IT(e){return 57520<=e&&e<=57527}function FT(e){return 57344<=e&&e<=63743}function qT(e){return 9472<=e&&e<=9631}function WT(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function VT(e,t,i,s){return t===1&&i>Math.ceil(s*1.5)&&e!==void 0&&e>255&&!WT(e)&&!Y0(e)&&!FT(e)}function U2(e){return Y0(e)||qT(e)}function YT(){return{css:{canvas:Ec(),cell:Ec()},device:{canvas:Ec(),cell:Ec(),char:{width:0,height:0,left:0,top:0}}}}function Ec(){return{width:0,height:0}}function GT(e,t,i=0){return(e-(Math.round(t)*2-i))%(Math.round(t)*2)}var yt=0,ot=0,ss=!1,Ds=!1,Tc=!1,Yt,p0=0,KT=class{constructor(e,t,i,s,r,n){this._terminal=e,this._optionService=t,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=r,this._themeService=n,this.result={fg:0,bg:0,ext:0}}resolve(e,t,i,s){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,ot=0,yt=0,Ds=!1,ss=!1,Tc=!1,Yt=this._themeService.colors,p0=0,e.getCode()!==0&&e.extended.underlineStyle===4){let r=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));p0=t*s%(Math.round(r)*2)}if(this._decorationService.forEachDecorationAtCell(t,i,"bottom",r=>{r.backgroundColorRGB&&(ot=r.backgroundColorRGB.rgba>>8&16777215,Ds=!0),r.foregroundColorRGB&&(yt=r.foregroundColorRGB.rgba>>8&16777215,ss=!0)}),Tc=this._selectionRenderModel.isCellSelected(this._terminal,t,i),Tc){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:ot=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:ot=(this.result.fg&16777215)<<8|255;break;default:ot=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:ot=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:ot=(this.result.bg&16777215)<<8|255;break}ot=hn.blend(ot,(this._coreBrowserService.isFocused?Yt.selectionBackgroundOpaque:Yt.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else ot=(this._coreBrowserService.isFocused?Yt.selectionBackgroundOpaque:Yt.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Ds=!0,Yt.selectionForeground&&(yt=Yt.selectionForeground.rgba>>8&16777215,ss=!0),U2(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)yt=(this._coreBrowserService.isFocused?Yt.selectionBackgroundOpaque:Yt.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:yt=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:yt=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:yt=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:yt=(this.result.fg&16777215)<<8|255;break;default:yt=this._themeService.colors.foreground.rgba}yt=hn.blend(yt,(this._coreBrowserService.isFocused?Yt.selectionBackgroundOpaque:Yt.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}ss=!0}}this._decorationService.forEachDecorationAtCell(t,i,"top",r=>{r.backgroundColorRGB&&(ot=r.backgroundColorRGB.rgba>>8&16777215,Ds=!0),r.foregroundColorRGB&&(yt=r.foregroundColorRGB.rgba>>8&16777215,ss=!0)}),Ds&&(Tc?ot=e.bg&-16777216&-134217729|ot|50331648:ot=e.bg&-16777216|ot|50331648),ss&&(yt=e.fg&-16777216&-67108865|yt|50331648),this.result.fg&67108864&&(Ds&&!ss&&((this.result.bg&50331648)===0?yt=this.result.fg&-134217728|Yt.background.rgba>>8&16777215&16777215|50331648:yt=this.result.fg&-134217728|this.result.bg&67108863,ss=!0),!Ds&&ss&&((this.result.fg&50331648)===0?ot=this.result.bg&-67108864|Yt.foreground.rgba>>8&16777215&16777215|50331648:ot=this.result.bg&-67108864|this.result.fg&67108863,Ds=!0)),Yt=void 0,this.result.bg=Ds?ot:this.result.bg,this.result.fg=ss?yt:this.result.fg,this.result.ext&=536870911,this.result.ext|=p0<<29&3758096384}},jT=.5,P2=NT||zT?"bottom":"ideographic",$T={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},XT={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},ZT={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},eo={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};eo[""]=eo[""];eo[""]=eo[""];function QT(e,t,i,s,r,n,l,a){let o=$T[t];if(o)return JT(e,o,i,s,r,n),!0;let h=XT[t];if(h)return e7(e,h,i,s,r,n),!0;let c=ZT[t];if(c)return t7(e,c,i,s,r,n,a),!0;let u=eo[t];return u?(i7(e,u,i,s,r,n,l,a),!0):!1}function JT(e,t,i,s,r,n){for(let l=0;l<t.length;l++){let a=t[l],o=r/8,h=n/8;e.fillRect(i+a.x*o,s+a.y*h,a.w*o,a.h*h)}}var Xb=new Map;function e7(e,t,i,s,r,n){let l=Xb.get(t);l||(l=new Map,Xb.set(t,l));let a=e.fillStyle;if(typeof a!="string")throw new Error(`Unexpected fillStyle type "${a}"`);let o=l.get(a);if(!o){let h=t[0].length,c=t.length,u=e.canvas.ownerDocument.createElement("canvas");u.width=h,u.height=c;let d=Ye(u.getContext("2d")),f=new ImageData(h,c),_,y,M,m;if(a.startsWith("#"))_=parseInt(a.slice(1,3),16),y=parseInt(a.slice(3,5),16),M=parseInt(a.slice(5,7),16),m=a.length>7&&parseInt(a.slice(7,9),16)||1;else if(a.startsWith("rgba"))[_,y,M,m]=a.substring(5,a.length-1).split(",").map(v=>parseFloat(v));else throw new Error(`Unexpected fillStyle color format "${a}" when drawing pattern glyph`);for(let v=0;v<c;v++)for(let S=0;S<h;S++)f.data[(v*h+S)*4]=_,f.data[(v*h+S)*4+1]=y,f.data[(v*h+S)*4+2]=M,f.data[(v*h+S)*4+3]=t[v][S]*(m*255);d.putImageData(f,0,0),o=Ye(e.createPattern(u,null)),l.set(a,o)}e.fillStyle=o,e.fillRect(i,s,r,n)}function t7(e,t,i,s,r,n,l){e.strokeStyle=e.fillStyle;for(let[a,o]of Object.entries(t)){e.beginPath(),e.lineWidth=l*Number.parseInt(a);let h;if(typeof o=="function"){let c=.15/n*r;h=o(.15,c)}else h=o;for(let c of h.split(" ")){let u=c[0],d=I2[u];if(!d){console.error(`Could not find drawing instructions for "${u}"`);continue}let f=c.substring(1).split(",");!f[0]||!f[1]||d(e,F2(f,r,n,i,s,!0,l))}e.stroke(),e.closePath()}}function i7(e,t,i,s,r,n,l,a){let o=new Path2D;o.rect(i,s,r,n),e.clip(o),e.beginPath();let h=l/12;e.lineWidth=a*h;for(let c of t.d.split(" ")){let u=c[0],d=I2[u];if(!d){console.error(`Could not find drawing instructions for "${u}"`);continue}let f=c.substring(1).split(",");!f[0]||!f[1]||d(e,F2(f,r,n,i,s,!1,a,(t.leftPadding??0)*(h/2),(t.rightPadding??0)*(h/2)))}t.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function Zb(e,t,i=0){return Math.max(Math.min(e,t),i)}var I2={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function F2(e,t,i,s,r,n,l,a=0,o=0){let h=e.map(c=>parseFloat(c)||parseInt(c));if(h.length<2)throw new Error("Too few arguments for instruction");for(let c=0;c<h.length;c+=2)h[c]*=t-a*l-o*l,n&&h[c]!==0&&(h[c]=Zb(Math.round(h[c]+.5)-.5,t,0)),h[c]+=s+a*l;for(let c=1;c<h.length;c+=2)h[c]*=i,n&&h[c]!==0&&(h[c]=Zb(Math.round(h[c]+.5)-.5,i,0)),h[c]+=r;return h}var Qb=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Jb=class{constructor(){this._data=new Qb}set(e,t,i,s,r){this._data.get(e,t)||this._data.set(e,t,new Qb),this._data.get(e,t).set(i,s,r)}get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}clear(){this._data.clear()}},q2=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},s7=class extends q2{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},r7=class extends q2{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},n7=!W0&&"requestIdleCallback"in window?r7:s7,ml=class W2{constructor(){this.fg=0,this.bg=0,this.extended=new V2}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new W2;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},V2=class Y2{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Y2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},e2=class N0{constructor(t){this.element=t,this.next=N0.Undefined,this.prev=N0.Undefined}};e2.Undefined=new e2(void 0);var l7=globalThis.performance&&typeof globalThis.performance.now=="function",a7=class G2{static create(t){return new G2(t)}constructor(t){this._now=l7&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},o7=!1,t2=!1,h7=!1,Os;(e=>{e.None=()=>hi.None;function t(w){if(h7){let{onDidAddListener:p}=w,C=U0.create(),b=0;w.onDidAddListener=()=>{++b===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),C.print()),p?.()}}}function i(w,p){return d(w,()=>{},0,void 0,!0,void 0,p)}e.defer=i;function s(w){return(p,C=null,b)=>{let E=!1,x;return x=w(A=>{if(!E)return x?x.dispose():E=!0,p.call(C,A)},null,b),E&&x.dispose(),x}}e.once=s;function r(w,p,C){return c((b,E=null,x)=>w(A=>b.call(E,p(A)),null,x),C)}e.map=r;function n(w,p,C){return c((b,E=null,x)=>w(A=>{p(A),b.call(E,A)},null,x),C)}e.forEach=n;function l(w,p,C){return c((b,E=null,x)=>w(A=>p(A)&&b.call(E,A),null,x),C)}e.filter=l;function a(w){return w}e.signal=a;function o(...w){return(p,C=null,b)=>{let E=O2(...w.map(x=>x(A=>p.call(C,A))));return u(E,b)}}e.any=o;function h(w,p,C,b){let E=C;return r(w,x=>(E=p(E,x),E),b)}e.reduce=h;function c(w,p){let C,b={onWillAddFirstListener(){C=w(E.fire,E)},onDidRemoveLastListener(){C?.dispose()}};p||t(b);let E=new Se(b);return p?.add(E),E.event}function u(w,p){return p instanceof Array?p.push(w):p&&p.add(w),w}function d(w,p,C=100,b=!1,E=!1,x,A){let k,U,Q,K=0,J,Pe={leakWarningThreshold:x,onWillAddFirstListener(){k=w(Ee=>{K++,U=p(U,Ee),b&&!Q&&(te.fire(U),U=void 0),J=()=>{let le=U;U=void 0,Q=void 0,(!b||K>1)&&te.fire(le),K=0},typeof C=="number"?(clearTimeout(Q),Q=setTimeout(J,C)):Q===void 0&&(Q=0,queueMicrotask(J))})},onWillRemoveListener(){E&&K>0&&J?.()},onDidRemoveLastListener(){J=void 0,k.dispose()}};A||t(Pe);let te=new Se(Pe);return A?.add(te),te.event}e.debounce=d;function f(w,p=0,C){return e.debounce(w,(b,E)=>b?(b.push(E),b):[E],p,void 0,!0,void 0,C)}e.accumulate=f;function _(w,p=(b,E)=>b===E,C){let b=!0,E;return l(w,x=>{let A=b||!p(x,E);return b=!1,E=x,A},C)}e.latch=_;function y(w,p,C){return[e.filter(w,p,C),e.filter(w,b=>!p(b),C)]}e.split=y;function M(w,p=!1,C=[],b){let E=C.slice(),x=w(U=>{E?E.push(U):k.fire(U)});b&&b.add(x);let A=()=>{E?.forEach(U=>k.fire(U)),E=null},k=new Se({onWillAddFirstListener(){x||(x=w(U=>k.fire(U)),b&&b.add(x))},onDidAddFirstListener(){E&&(p?setTimeout(A):A())},onDidRemoveLastListener(){x&&x.dispose(),x=null}});return b&&b.add(k),k.event}e.buffer=M;function m(w,p){return(C,b,E)=>{let x=p(new S);return w(function(A){let k=x.evaluate(A);k!==v&&C.call(b,k)},void 0,E)}}e.chain=m;let v=Symbol("HaltChainable");class S{constructor(){this.steps=[]}map(p){return this.steps.push(p),this}forEach(p){return this.steps.push(C=>(p(C),C)),this}filter(p){return this.steps.push(C=>p(C)?C:v),this}reduce(p,C){let b=C;return this.steps.push(E=>(b=p(b,E),b)),this}latch(p=(C,b)=>C===b){let C=!0,b;return this.steps.push(E=>{let x=C||!p(E,b);return C=!1,b=E,x?E:v}),this}evaluate(p){for(let C of this.steps)if(p=C(p),p===v)break;return p}}function g(w,p,C=b=>b){let b=(...k)=>A.fire(C(...k)),E=()=>w.on(p,b),x=()=>w.removeListener(p,b),A=new Se({onWillAddFirstListener:E,onDidRemoveLastListener:x});return A.event}e.fromNodeEventEmitter=g;function T(w,p,C=b=>b){let b=(...k)=>A.fire(C(...k)),E=()=>w.addEventListener(p,b),x=()=>w.removeEventListener(p,b),A=new Se({onWillAddFirstListener:E,onDidRemoveLastListener:x});return A.event}e.fromDOMEventEmitter=T;function L(w){return new Promise(p=>s(w)(p))}e.toPromise=L;function B(w){let p=new Se;return w.then(C=>{p.fire(C)},()=>{p.fire(void 0)}).finally(()=>{p.dispose()}),p.event}e.fromPromise=B;function O(w,p){return w(C=>p.fire(C))}e.forward=O;function I(w,p,C){return p(C),w(b=>p(b))}e.runAndSubscribe=I;class F{constructor(p,C){this._observable=p,this._counter=0,this._hasChanged=!1;let b={onWillAddFirstListener:()=>{p.addObserver(this)},onDidRemoveLastListener:()=>{p.removeObserver(this)}};C||t(b),this.emitter=new Se(b),C&&C.add(this.emitter)}beginUpdate(p){this._counter++}handlePossibleChange(p){}handleChange(p,C){this._hasChanged=!0}endUpdate(p){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(w,p){return new F(w,p).emitter.event}e.fromObservable=P;function wt(w){return(p,C,b)=>{let E=0,x=!1,A={beginUpdate(){E++},endUpdate(){E--,E===0&&(w.reportChanges(),x&&(x=!1,p.call(C)))},handlePossibleChange(){},handleChange(){x=!0}};w.addObserver(A),w.reportChanges();let k={dispose(){w.removeObserver(A)}};return b instanceof Sl?b.add(k):Array.isArray(b)&&b.push(k),k}}e.fromObservableLight=wt})(Os||={});var z0=class H0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${H0._idPool++}`,H0.all.add(this)}start(t){this._stopWatch=new a7,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};z0.all=new Set,z0._idPool=0;var c7=z0,i2=-1,K2=class j2{constructor(t,i,s=(j2._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,l]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${l}):`;console.warn(a),console.warn(n);let o=new d7(a,n);this._errorHandler(o)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};K2._idPool=1;var u7=K2,U0=class $2{constructor(t){this.value=t}static create(){let t=new Error;return new $2(t.stack??"")}print(){console.warn(this.value.split(`
93
+ `).slice(2).join(`
94
+ `))}},d7=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},f7=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},_7=0,Dc=class{constructor(e){this.value=e,this.id=_7++}},g7=2,v7=(e,t)=>{if(e instanceof Dc)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},Rc;if(o7){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
95
+ `)),e.length=0)},3e3),Rc=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var Se=class{constructor(e){this._size=0,this._options=e,this._leakageMon=i2>0||this._options?.leakWarningThreshold?new u7(e?.onListenerError??Ac,this._options?.leakWarningThreshold??i2):void 0,this._perfMon=this._options?._profName?new c7(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(t2){let e=this._listeners;queueMicrotask(()=>{v7(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new f7(`${a}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||Ac)(h),hi.None}if(this._disposed)return hi.None;t&&(e=e.bind(t));let s=new Dc(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=U0.create(),r=this._leakageMon.check(s.stack,this._size+1)),t2&&(s.stack=n??U0.create()),this._listeners?this._listeners instanceof Dc?(this._deliveryQueue??=new m7,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=bt(()=>{Rc?.unregister(l),r?.(),this._removeListener(s)});if(i instanceof Sl?i.add(l):Array.isArray(i)&&i.push(l),Rc){let a=new Error().stack.split(`
96
+ `).slice(2,3).join(`
97
+ `).trim(),o=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);Rc.register(l,o?.[2]??a,l)}return l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*g7<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Ac;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Dc)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},m7=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},s2={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},ja=2,$a,Tr=class vl{constructor(t,i,s){this._document=t,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new Jb,this._cacheMapCombined=new Jb,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new ml,this._textureSize=512,this._onAddTextureAtlasCanvas=new Se,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Se,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=X2(t,this._config.deviceCellWidth*4+ja*2,this._config.deviceCellHeight+ja*2),this._tmpCtx=Ye(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let t of this.pages)t.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let t=new n7;for(let i=33;i<126;i++)t.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let t of this._pages)t.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(vl.maxAtlasPages&&this._pages.length>=Math.max(4,vl.maxAtlasPages)){let i=this._pages.filter(h=>h.canvas.width*2<=(vl.maxTextureSize||4096)).sort((h,c)=>c.canvas.width!==h.canvas.width?c.canvas.width-h.canvas.width:c.percentageUsed-h.percentageUsed),s=-1,r=0;for(let h=0;h<i.length;h++)if(i[h].canvas.width!==r)s=h,r=i[h].canvas.width;else if(h-s===3)break;let n=i.slice(s,s+4),l=n.map(h=>h.glyphs[0].texturePage).sort((h,c)=>h>c?1:-1),a=this.pages.length-n.length,o=this._mergePages(n,a);o.version++;for(let h=l.length-1;h>=0;h--)this._deletePage(l[h]);this.pages.push(o),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(o.canvas)}let t=new S0(this._document,this._textureSize);return this._pages.push(t),this._activePages.push(t),this._onAddTextureAtlasCanvas.fire(t.canvas),t}_mergePages(t,i){let s=t[0].canvas.width*2,r=new S0(this._document,s,t);for(let[n,l]of t.entries()){let a=n*l.canvas.width%s,o=Math.floor(n/2)*l.canvas.height;r.ctx.drawImage(l.canvas,a,o);for(let c of l.glyphs)c.texturePage=i,c.sizeClipSpace.x=c.size.x/s,c.sizeClipSpace.y=c.size.y/s,c.texturePosition.x+=a,c.texturePosition.y+=o,c.texturePositionClipSpace.x=c.texturePosition.x/s,c.texturePositionClipSpace.y=c.texturePosition.y/s;this._onRemoveTextureAtlasCanvas.fire(l.canvas);let h=this._activePages.indexOf(l);h!==-1&&this._activePages.splice(h,1)}return r}_deletePage(t){this._pages.splice(t,1);for(let i=t;i<this._pages.length;i++){let s=this._pages[i];for(let r of s.glyphs)r.texturePage--;s.version++}}getRasterizedGlyphCombinedChar(t,i,s,r,n,l){return this._getFromCacheMap(this._cacheMapCombined,t,i,s,r,n,l)}getRasterizedGlyph(t,i,s,r,n,l){return this._getFromCacheMap(this._cacheMap,t,i,s,r,n,l)}_getFromCacheMap(t,i,s,r,n,l,a){return $a=t.get(i,s,r,n),$a||($a=this._drawToCache(i,s,r,n,l,a),t.set(i,s,r,n,$a)),$a}_getColorFromAnsiIndex(t){if(t>=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,i,s,r){if(this._config.allowTransparency)return xi;let n;switch(t){case 16777216:case 33554432:n=this._getColorFromAnsiIndex(i);break;case 50331648:let l=ml.toColorRGB(i);n=zt.toColor(l[0],l[1],l[2]);break;default:s?n=Qa.opaque(this._config.colors.foreground):n=this._config.colors.background;break}return this._config.allowTransparency||(n=Qa.opaque(n)),n}_getForegroundColor(t,i,s,r,n,l,a,o,h,c){let u=this._getMinimumContrastColor(t,i,s,r,n,l,a,h,o,c);if(u)return u;let d;switch(n){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&l<8&&(l+=8),d=this._getColorFromAnsiIndex(l);break;case 50331648:let f=ml.toColorRGB(l);d=zt.toColor(f[0],f[1],f[2]);break;default:a?d=this._config.colors.background:d=this._config.colors.foreground}return this._config.allowTransparency&&(d=Qa.opaque(d)),o&&(d=Qa.multiplyOpacity(d,jT)),d}_resolveBackgroundRgba(t,i,s){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,i,s,r){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,i,s,r,n,l,a,o,h,c){if(this._config.minimumContrastRatio===1||c)return;let u=this._getContrastCache(h),d=u.getColor(t,r);if(d!==void 0)return d||void 0;let f=this._resolveBackgroundRgba(i,s,a),_=this._resolveForegroundRgba(n,l,a,o),y=hn.ensureContrastRatio(f,_,this._config.minimumContrastRatio/(h?2:1));if(!y){u.setColor(t,r,null);return}let M=zt.toColor(y>>24&255,y>>16&255,y>>8&255);return u.setColor(t,r,M),M}_getContrastCache(t){return t?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(t,i,s,r,n,l){let a=typeof t=="number"?String.fromCharCode(t):t;l&&this._tmpCanvas.parentElement!==l&&(this._tmpCanvas.style.display="none",l.append(this._tmpCanvas));let o=Math.min(this._config.deviceCellWidth*Math.max(a.length,2)+ja*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<o&&(this._tmpCanvas.width=o);let h=Math.min(this._config.deviceCellHeight+ja*4,this._textureSize);if(this._tmpCanvas.height<h&&(this._tmpCanvas.height=h),this._tmpCtx.save(),this._workAttributeData.fg=s,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=r,!!this._workAttributeData.isInvisible())return s2;let c=!!this._workAttributeData.isBold(),u=!!this._workAttributeData.isInverse(),d=!!this._workAttributeData.isDim(),f=!!this._workAttributeData.isItalic(),_=!!this._workAttributeData.isUnderline(),y=!!this._workAttributeData.isStrikethrough(),M=!!this._workAttributeData.isOverline(),m=this._workAttributeData.getFgColor(),v=this._workAttributeData.getFgColorMode(),S=this._workAttributeData.getBgColor(),g=this._workAttributeData.getBgColorMode();if(u){let k=m;m=S,S=k;let U=v;v=g,g=U}let T=this._getBackgroundColor(g,S,u,d);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=T.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=c?this._config.fontWeightBold:this._config.fontWeight,B=f?"italic":"";this._tmpCtx.font=`${B} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=P2;let O=a.length===1&&Y0(a.charCodeAt(0)),I=a.length===1&&IT(a.charCodeAt(0)),F=this._getForegroundColor(i,g,S,s,v,m,u,d,c,U2(a.charCodeAt(0)));this._tmpCtx.fillStyle=F.css;let P=I?0:ja*2,wt=!1;this._config.customGlyphs!==!1&&(wt=QT(this._tmpCtx,a,P,P,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let w=!O,p;if(typeof t=="number"?p=this._unicodeService.wcwidth(t):p=this._unicodeService.getStringCellWidth(t),_){this._tmpCtx.save();let k=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),U=k%2===1?.5:0;if(this._tmpCtx.lineWidth=k,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())w=!1,this._tmpCtx.strokeStyle=`rgb(${ml.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{w=!1;let Ee=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ee<8&&(Ee+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ee).css}this._tmpCtx.beginPath();let Q=P,K=Math.ceil(P+this._config.deviceCharHeight)-U-(n?k*2:0),J=K+k,Pe=K+k*2,te=this._workAttributeData.getUnderlineVariantOffset();for(let Ee=0;Ee<p;Ee++){this._tmpCtx.save();let le=Q+Ee*this._config.deviceCellWidth,De=Q+(Ee+1)*this._config.deviceCellWidth,Hs=le+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(le,K),this._tmpCtx.lineTo(De,K),this._tmpCtx.moveTo(le,Pe),this._tmpCtx.lineTo(De,Pe);break;case 3:let Ni=k<=1?Pe:Math.ceil(P+this._config.deviceCharHeight-k/2)-U,Gt=k<=1?K:Math.ceil(P+this._config.deviceCharHeight+k/2)-U,ie=new Path2D;ie.rect(le,K,this._config.deviceCellWidth,Pe-K),this._tmpCtx.clip(ie),this._tmpCtx.moveTo(le-this._config.deviceCellWidth/2,J),this._tmpCtx.bezierCurveTo(le-this._config.deviceCellWidth/2,Gt,le,Gt,le,J),this._tmpCtx.bezierCurveTo(le,Ni,Hs,Ni,Hs,J),this._tmpCtx.bezierCurveTo(Hs,Gt,De,Gt,De,J),this._tmpCtx.bezierCurveTo(De,Ni,De+this._config.deviceCellWidth/2,Ni,De+this._config.deviceCellWidth/2,J);break;case 4:let Us=te===0?0:te>=k?k*2-te:k-te;te>=k||Us===0?(this._tmpCtx.setLineDash([Math.round(k),Math.round(k)]),this._tmpCtx.moveTo(le+Us,K),this._tmpCtx.lineTo(De,K)):(this._tmpCtx.setLineDash([Math.round(k),Math.round(k)]),this._tmpCtx.moveTo(le,K),this._tmpCtx.lineTo(le+Us,K),this._tmpCtx.moveTo(le+Us+k,K),this._tmpCtx.lineTo(De,K)),te=GT(De-le,k,te);break;case 5:let p5=.6,S5=.3,qc=De-le,Z0=Math.floor(p5*qc),Q0=Math.floor(S5*qc),y5=qc-Z0-Q0;this._tmpCtx.setLineDash([Z0,Q0,y5]),this._tmpCtx.moveTo(le,K),this._tmpCtx.lineTo(De,K);break;default:this._tmpCtx.moveTo(le,K),this._tmpCtx.lineTo(De,K);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!wt&&this._config.fontSize>=12&&!this._config.allowTransparency&&a!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Ee=this._tmpCtx.measureText(a);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ee&&Ee.actualBoundingBoxDescent>0){this._tmpCtx.save();let le=new Path2D;le.rect(Q,K-Math.ceil(k/2),this._config.deviceCellWidth*p,Pe-K+Math.ceil(k/2)),this._tmpCtx.clip(le),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=T.css,this._tmpCtx.strokeText(a,P,P+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(M){let k=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),U=k%2===1?.5:0;this._tmpCtx.lineWidth=k,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+U),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*p,P+U),this._tmpCtx.stroke()}if(wt||this._tmpCtx.fillText(a,P,P+this._config.deviceCharHeight),a==="_"&&!this._config.allowTransparency){let k=y0(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),T,F,w);if(k)for(let U=1;U<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=T.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(a,P,P+this._config.deviceCharHeight-U),k=y0(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),T,F,w),!!k);U++);}if(y){let k=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),U=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=k,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+Math.floor(this._config.deviceCharHeight/2)-U),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*p,P+Math.floor(this._config.deviceCharHeight/2)-U),this._tmpCtx.stroke()}this._tmpCtx.restore();let C=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),b;if(this._config.allowTransparency?b=p7(C):b=y0(C,T,F,w),b)return s2;let E=this._findGlyphBoundingBox(C,this._workBoundingBox,o,I,wt,P),x,A;for(;;){if(this._activePages.length===0){let k=this._createNewPage();x=k,A=k.currentRow,A.height=E.size.y;break}x=this._activePages[this._activePages.length-1],A=x.currentRow;for(let k of this._activePages)E.size.y<=k.currentRow.height&&(x=k,A=k.currentRow);for(let k=this._activePages.length-1;k>=0;k--)for(let U of this._activePages[k].fixedRows)U.height<=A.height&&E.size.y<=U.height&&(x=this._activePages[k],A=U);if(E.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new S0(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),x=this._overflowSizePage,A=this._overflowSizePage.currentRow,A.x+E.size.x>=x.canvas.width&&(A.x=0,A.y+=A.height,A.height=0);break}if(A.y+E.size.y>=x.canvas.height||A.height>E.size.y+2){let k=!1;if(x.currentRow.y+x.currentRow.height+E.size.y>=x.canvas.height){let U;for(let Q of this._activePages)if(Q.currentRow.y+Q.currentRow.height+E.size.y<Q.canvas.height){U=Q;break}if(U)x=U;else if(vl.maxAtlasPages&&this._pages.length>=vl.maxAtlasPages&&A.y+E.size.y<=x.canvas.height&&A.height>=E.size.y&&A.x+E.size.x<=x.canvas.width)k=!0;else{let Q=this._createNewPage();x=Q,A=Q.currentRow,A.height=E.size.y,k=!0}}k||(x.currentRow.height>0&&x.fixedRows.push(x.currentRow),A={x:0,y:x.currentRow.y+x.currentRow.height,height:E.size.y},x.fixedRows.push(A),x.currentRow={x:0,y:A.y+A.height,height:0})}if(A.x+E.size.x<=x.canvas.width)break;A===x.currentRow?(A.x=0,A.y+=A.height,A.height=0):x.fixedRows.splice(x.fixedRows.indexOf(A),1)}return E.texturePage=this._pages.indexOf(x),E.texturePosition.x=A.x,E.texturePosition.y=A.y,E.texturePositionClipSpace.x=A.x/x.canvas.width,E.texturePositionClipSpace.y=A.y/x.canvas.height,E.sizeClipSpace.x/=x.canvas.width,E.sizeClipSpace.y/=x.canvas.height,A.height=Math.max(A.height,E.size.y),A.x+=E.size.x,x.ctx.putImageData(C,E.texturePosition.x-this._workBoundingBox.left,E.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,E.size.x,E.size.y),x.addGlyph(E),x.version++,E}_findGlyphBoundingBox(t,i,s,r,n,l){i.top=0;let a=r?this._config.deviceCellHeight:this._tmpCanvas.height,o=r?this._config.deviceCellWidth:s,h=!1;for(let c=0;c<a;c++){for(let u=0;u<o;u++){let d=c*this._tmpCanvas.width*4+u*4+3;if(t.data[d]!==0){i.top=c,h=!0;break}}if(h)break}i.left=0,h=!1;for(let c=0;c<l+o;c++){for(let u=0;u<a;u++){let d=u*this._tmpCanvas.width*4+c*4+3;if(t.data[d]!==0){i.left=c,h=!0;break}}if(h)break}i.right=o,h=!1;for(let c=l+o-1;c>=l;c--){for(let u=0;u<a;u++){let d=u*this._tmpCanvas.width*4+c*4+3;if(t.data[d]!==0){i.right=c,h=!0;break}}if(h)break}i.bottom=a,h=!1;for(let c=a-1;c>=0;c--){for(let u=0;u<o;u++){let d=c*this._tmpCanvas.width*4+u*4+3;if(t.data[d]!==0){i.bottom=c,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+l+(r||n?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+l+(r||n?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},S0=class{constructor(e,t,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let s of i)this._glyphs.push(...s.glyphs),this._usedPixels+=s._usedPixels;this.canvas=X2(e,t,t),this.ctx=Ye(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function y0(e,t,i,s){let r=t.rgba>>>24,n=t.rgba>>>16&255,l=t.rgba>>>8&255,a=i.rgba>>>24,o=i.rgba>>>16&255,h=i.rgba>>>8&255,c=Math.floor((Math.abs(r-a)+Math.abs(n-o)+Math.abs(l-h))/12),u=!0;for(let d=0;d<e.data.length;d+=4)e.data[d]===r&&e.data[d+1]===n&&e.data[d+2]===l||s&&Math.abs(e.data[d]-r)+Math.abs(e.data[d+1]-n)+Math.abs(e.data[d+2]-l)<c?e.data[d+3]=0:u=!1;return u}function p7(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}function X2(e,t,i){let s=e.createElement("canvas");return s.width=t,s.height=i,s}function S7(e,t,i,s,r,n,l,a){let o={foreground:n.foreground,background:n.background,cursor:xi,cursorAccent:xi,selectionForeground:xi,selectionBackgroundTransparent:xi,selectionBackgroundOpaque:xi,selectionInactiveBackgroundTransparent:xi,selectionInactiveBackgroundOpaque:xi,overviewRulerBorder:xi,scrollbarSliderBackground:xi,scrollbarSliderHoverBackground:xi,scrollbarSliderActiveBackground:xi,ansi:n.ansi.slice(),contrastCache:n.contrastCache,halfContrastCache:n.halfContrastCache};return{customGlyphs:r.customGlyphs,devicePixelRatio:l,deviceMaxTextureSize:a,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:s,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,drawBoldTextInBrightColors:r.drawBoldTextInBrightColors,minimumContrastRatio:r.minimumContrastRatio,colors:o}}function r2(e,t){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba}function y7(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Ti=[];function Z2(e,t,i,s,r,n,l,a,o){let h=S7(s,r,n,l,t,i,a,o);for(let d=0;d<Ti.length;d++){let f=Ti[d],_=f.ownedBy.indexOf(e);if(_>=0){if(r2(f.config,h))return f.atlas;f.ownedBy.length===1?(f.atlas.dispose(),Ti.splice(d,1)):f.ownedBy.splice(_,1);break}}for(let d=0;d<Ti.length;d++){let f=Ti[d];if(r2(f.config,h))return f.ownedBy.push(e),f.atlas}let c=e._core,u={atlas:new Tr(document,h,c.unicodeService),config:h,ownedBy:[e]};return Ti.push(u),u.atlas}function n2(e){for(let t=0;t<Ti.length;t++){let i=Ti[t].ownedBy.indexOf(e);if(i!==-1){Ti[t].ownedBy.length===1?(Ti[t].atlas.dispose(),Ti.splice(t,1)):Ti[t].ownedBy.splice(i,1);break}}}var Mc=600,b7=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=Mc){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let t=Mc-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0){this._restartInterval(t);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let t=Mc-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(t);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Mc)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function l2(e,t,i){let s=new t.ResizeObserver(r=>{let n=r.find(o=>o.target===e);if(!n)return;if(!("devicePixelContentBoxSize"in n)){s?.disconnect(),s=void 0;return}let l=n.devicePixelContentBoxSize[0].inlineSize,a=n.devicePixelContentBoxSize[0].blockSize;l>0&&a>0&&i(l,a)});try{s.observe(e,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return bt(()=>s?.disconnect())}function w7(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var a2=class Q2 extends ml{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new V2,this.combinedData=""}static fromCharData(t){let i=new Q2;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?w7(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},J2=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function e5(e,t,i){let s=Ye(e.createProgram());if(e.attachShader(s,Ye(o2(e,e.VERTEX_SHADER,t))),e.attachShader(s,Ye(o2(e,e.FRAGMENT_SHADER,i))),e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS))return s;console.error(e.getProgramInfoLog(s)),e.deleteProgram(s)}function o2(e,t,i){let s=Ye(e.createShader(t));if(e.shaderSource(s,i),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))return s;console.error(e.getShaderInfoLog(s)),e.deleteShader(s)}function C7(e,t){let i=Math.min(e.length*2,t),s=new Float32Array(i);for(let r=0;r<e.length;r++)s[r]=e[r];return s}var x7=class{constructor(e){this.texture=e,this.version=-1}},E7=`#version 300 es
98
+ layout (location = 0) in vec2 a_unitquad;
99
+ layout (location = 1) in vec2 a_cellpos;
100
+ layout (location = 2) in vec2 a_offset;
101
+ layout (location = 3) in vec2 a_size;
102
+ layout (location = 4) in float a_texpage;
103
+ layout (location = 5) in vec2 a_texcoord;
104
+ layout (location = 6) in vec2 a_texsize;
105
+
106
+ uniform mat4 u_projection;
107
+ uniform vec2 u_resolution;
108
+
109
+ out vec2 v_texcoord;
110
+ flat out int v_texpage;
111
+
112
+ void main() {
113
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
114
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
115
+ v_texpage = int(a_texpage);
116
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
117
+ }`;function T7(e){let t="";for(let i=1;i<e;i++)t+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
118
+ precision lowp float;
119
+
120
+ in vec2 v_texcoord;
121
+ flat in int v_texpage;
122
+
123
+ uniform sampler2D u_texture[${e}];
124
+
125
+ out vec4 outColor;
126
+
127
+ void main() {
128
+ if (v_texpage == 0) {
129
+ outColor = texture(u_texture[0], v_texcoord);
130
+ } ${t}
131
+ }`}var Mr=11,gl=Mr*Float32Array.BYTES_PER_ELEMENT,M7=2,Ne=0,we,b0=0,Xa=0,L7=class extends hi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r=this._gl;Tr.maxAtlasPages===void 0&&(Tr.maxAtlasPages=Math.min(32,Ye(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))),Tr.maxTextureSize=Ye(r.getParameter(r.MAX_TEXTURE_SIZE))),this._program=Ye(e5(r,E7,T7(Tr.maxAtlasPages))),this._register(bt(()=>r.deleteProgram(this._program))),this._projectionLocation=Ye(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=Ye(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=Ye(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),l=r.createBuffer();this._register(bt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),o=r.createBuffer();this._register(bt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Ye(r.createBuffer()),this._register(bt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,gl,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,gl,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,gl,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,gl,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,gl,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,gl,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let h=new Int32Array(Tr.maxAtlasPages);for(let c=0;c<Tr.maxAtlasPages;c++)h[c]=c;r.uniform1iv(this._textureLocation,h),r.uniformMatrix4fv(this._projectionLocation,!1,J2),this._atlasTextures=[];for(let c=0;c<Tr.maxAtlasPages;c++){let u=new x7(Ye(r.createTexture()));this._register(bt(()=>r.deleteTexture(u.texture))),r.activeTexture(r.TEXTURE0+c),r.bindTexture(r.TEXTURE_2D,u.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[c]=u}r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,i,s,r,n,l,a,o){this._updateCell(this._vertices.attributes,e,t,i,s,r,n,l,a,o)}_updateCell(e,t,i,s,r,n,l,a,o,h){if(Ne=(i*this._terminal.cols+t)*Mr,s===0||s===void 0){e.fill(0,Ne,Ne+Mr-1-M7);return}this._atlas&&(a&&a.length>1?we=this._atlas.getRasterizedGlyphCombinedChar(a,r,n,l,!1,this._terminal.element):we=this._atlas.getRasterizedGlyph(s,r,n,l,!1,this._terminal.element),b0=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==h&&we.offset.x>b0?(Xa=we.offset.x-b0,e[Ne]=-(we.offset.x-Xa)+this._dimensions.device.char.left,e[Ne+1]=-we.offset.y+this._dimensions.device.char.top,e[Ne+2]=(we.size.x-Xa)/this._dimensions.device.canvas.width,e[Ne+3]=we.size.y/this._dimensions.device.canvas.height,e[Ne+4]=we.texturePage,e[Ne+5]=we.texturePositionClipSpace.x+Xa/this._atlas.pages[we.texturePage].canvas.width,e[Ne+6]=we.texturePositionClipSpace.y,e[Ne+7]=we.sizeClipSpace.x-Xa/this._atlas.pages[we.texturePage].canvas.width,e[Ne+8]=we.sizeClipSpace.y):(e[Ne]=-we.offset.x+this._dimensions.device.char.left,e[Ne+1]=-we.offset.y+this._dimensions.device.char.top,e[Ne+2]=we.size.x/this._dimensions.device.canvas.width,e[Ne+3]=we.size.y/this._dimensions.device.canvas.height,e[Ne+4]=we.texturePage,e[Ne+5]=we.texturePositionClipSpace.x,e[Ne+6]=we.texturePositionClipSpace.y,e[Ne+7]=we.sizeClipSpace.x,e[Ne+8]=we.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&VT(s,o,we.size.x,this._dimensions.device.cell.width)&&(e[Ne+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*Mr;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==t?this._vertices.attributesBuffers[i]=new Float32Array(t):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=t,i=0;for(let s=0;s<e.rows;s++)for(let r=0;r<e.cols;r++)this._vertices.attributes[i+9]=r/e.cols,this._vertices.attributes[i+10]=s/e.rows,i+=Mr}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],s=0;for(let r=0;r<e.lineLengths.length;r++){let n=r*this._terminal.cols*Mr,l=this._vertices.attributes.subarray(n,n+e.lineLengths[r]*Mr);i.set(l,s),s+=l.length}t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,i.subarray(0,s),t.STREAM_DRAW);for(let r=0;r<this._atlas.pages.length;r++)this._atlas.pages[r].version!==this._atlasTextures[r].version&&this._bindAtlasPageTexture(t,this._atlas,r);t.drawElementsInstanced(t.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,s/Mr)}setAtlas(e){this._atlas=e;for(let t of this._atlasTextures)t.version=-1}_bindAtlasPageTexture(e,t,i){e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[i].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.pages[i].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[i].version=t.pages[i].version}setDimensions(e){this._dimensions=e}},A7=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,l=i[1]-r,a=Math.max(n,0),o=Math.min(l,e.rows-1);if(a>=e.rows||o<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=l,this.viewportCappedStartRow=a,this.viewportCappedEndRow=o,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function D7(){return new A7}var Uc=4,Bc=1,kc=2,w0=3,R7=2147483648,B7=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=D7()}resize(e,t){let i=e*t*Uc;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(t))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},k7=`#version 300 es
132
+ layout (location = 0) in vec2 a_position;
133
+ layout (location = 1) in vec2 a_size;
134
+ layout (location = 2) in vec4 a_color;
135
+ layout (location = 3) in vec2 a_unitquad;
136
+
137
+ uniform mat4 u_projection;
138
+
139
+ out vec4 v_color;
140
+
141
+ void main() {
142
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
143
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
144
+ v_color = a_color;
145
+ }`,O7=`#version 300 es
146
+ precision lowp float;
147
+
148
+ in vec4 v_color;
149
+
150
+ out vec4 outColor;
151
+
152
+ void main() {
153
+ outColor = v_color;
154
+ }`,ks=8,C0=ks*Float32Array.BYTES_PER_ELEMENT,N7=20*ks,h2=class{constructor(){this.attributes=new Float32Array(N7),this.count=0}},Rs=0,c2=0,u2=0,d2=0,f2=0,_2=0,g2=0,z7=class extends hi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new h2,this._verticesCursor=new h2;let r=this._gl;this._program=Ye(e5(r,k7,O7)),this._register(bt(()=>r.deleteProgram(this._program))),this._projectionLocation=Ye(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),l=r.createBuffer();this._register(bt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),o=r.createBuffer();this._register(bt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Ye(r.createBuffer()),this._register(bt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,C0,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,C0,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,C0,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(h=>{this._updateCachedColors(h),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,J2),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,l,a,o,h,c,u,d,f,_;for(r=0;r<t.rows;r++){for(l=-1,a=0,o=0,h=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*Uc,u=e.cells[c+Bc],d=e.cells[c+kc],f=!!(d&67108864),(u!==a||d!==o&&(h||f))&&((a!==0||h&&o!==0)&&(_=s++*ks,this._updateRectangle(i,_,o,a,l,n,r)),l=n,a=u,o=d,h=f);(a!==0||h&&o!==0)&&(_=s++*ks,this._updateRectangle(i,_,o,a,l,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){t.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*ks,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=r++*ks,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=r++*ks,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=r++*ks,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,l){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Rs=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Rs=(i&16777215)<<8;break;default:Rs=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Rs=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Rs=(s&16777215)<<8;break;default:Rs=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=C7(e.attributes,this._terminal.rows*this._terminal.cols*ks)),c2=r*this._dimensions.device.cell.width,u2=l*this._dimensions.device.cell.height,d2=(Rs>>24&255)/255,f2=(Rs>>16&255)/255,_2=(Rs>>8&255)/255,g2=1,this._addRectangle(e.attributes,t,c2,u2,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,d2,f2,_2,g2)}_addRectangle(e,t,i,s,r,n,l,a,o,h){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=l,e[t+5]=a,e[t+6]=o,e[t+7]=h}_addRectangleFloat(e,t,i,s,r,n,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=l[0],e[t+5]=l[1],e[t+6]=l[2],e[t+7]=l[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},H7=class extends hi{constructor(e,t,i,s,r,n,l,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=l,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(o=>{this._refreshCharAtlas(e,o),this.reset(e)})),this._register(bt(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Ye(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Z2(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=P2,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},U7=class extends H7{constructor(e,t,i,s,r,n,l){super(i,e,"link",t,!0,r,n,l),this._register(s.onShowLinkUnderline(a=>this._handleShowLinkUnderline(a))),this._register(s.onHideLinkUnderline(a=>this._handleHideLinkUnderline(a)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&y7(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Oi=typeof window=="object"?window:globalThis,P0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Se,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Se,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};P0.INSTANCE=new P0;var t5=P0;function P7(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var FA=t5.INSTANCE.onDidChangeZoomLevel,qA=t5.INSTANCE.onDidChangeFullscreen,bl=typeof navigator=="object"?navigator.userAgent:"",WA=bl.indexOf("Firefox")>=0,x0=bl.indexOf("AppleWebKit")>=0,I7=bl.indexOf("Chrome")>=0,F7=!I7&&bl.indexOf("Safari")>=0,VA=bl.indexOf("Electron/")>=0,YA=bl.indexOf("Android")>=0,Oc=!1;if(typeof Oi.matchMedia=="function"){let e=Oi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Oi.matchMedia("(display-mode: fullscreen)");Oc=e.matches,P7(Oi,e,({matches:i})=>{Oc&&t.matches||(Oc=i)})}function q7(){return Oc}var pl="en",I0=!1,F0=!1,Nc=!1,W7=!1,i5=!1,s5=!1,V7=!1,Y7=!1,G7=!1,K7=!1,Lc,zc=pl,v2=pl,j7,Bs,zs=globalThis,oi;typeof zs.vscode<"u"&&typeof zs.vscode.process<"u"?oi=zs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(oi=process);var r5=typeof oi?.versions?.electron=="string",$7=r5&&oi?.type==="renderer";if(typeof oi=="object"){I0=oi.platform==="win32",F0=oi.platform==="darwin",Nc=oi.platform==="linux",W7=Nc&&!!oi.env.SNAP&&!!oi.env.SNAP_REVISION,V7=r5,G7=!!oi.env.CI||!!oi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Lc=pl,zc=pl;let e=oi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Lc=t.userLocale,v2=t.osLocale,zc=t.resolvedLanguage||pl,j7=t.languagePack?.translationsConfigFile}catch{}i5=!0}else typeof navigator=="object"&&!$7?(Bs=navigator.userAgent,I0=Bs.indexOf("Windows")>=0,F0=Bs.indexOf("Macintosh")>=0,Y7=(Bs.indexOf("Macintosh")>=0||Bs.indexOf("iPad")>=0||Bs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Nc=Bs.indexOf("Linux")>=0,K7=Bs?.indexOf("Mobi")>=0,s5=!0,zc=globalThis._VSCODE_NLS_LANGUAGE||pl,Lc=navigator.language.toLowerCase(),v2=Lc):console.error("Unable to resolve platform.");var E0=0;F0?E0=1:I0?E0=3:Nc&&(E0=2);var T0=i5,X7=s5&&typeof zs.importScripts=="function",GA=X7?zs.origin:void 0,rs=Bs,xr=zc,Z7;(e=>{function t(){return xr}e.value=t;function i(){return xr.length===2?xr==="en":xr.length>=3?xr[0]==="e"&&xr[1]==="n"&&xr[2]==="-":!1}e.isDefaultVariant=i;function s(){return xr==="en"}e.isDefault=s})(Z7||={});var Q7=typeof zs.postMessage=="function"&&!zs.importScripts,J7=(()=>{if(Q7){let e=[];zs.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),zs.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),eM=!!(rs&&rs.indexOf("Chrome")>=0),KA=!!(rs&&rs.indexOf("Firefox")>=0),jA=!!(!eM&&rs&&rs.indexOf("Safari")>=0),$A=!!(rs&&rs.indexOf("Edg/")>=0),XA=!!(rs&&rs.indexOf("Android")>=0),Er=typeof navigator=="object"?navigator:{},ZA={clipboard:{writeText:T0||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Er&&Er.clipboard&&Er.clipboard.writeText),readText:T0||!!(Er&&Er.clipboard&&Er.clipboard.readText)},keyboard:T0||q7()?0:Er.keyboard||F7?1:2,touch:"ontouchstart"in Oi||Er.maxTouchPoints>0,pointerEvents:Oi.PointerEvent&&("ontouchstart"in Oi||navigator.maxTouchPoints>0)},G0=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},M0=new G0,m2=new G0,p2=new G0,QA=new Array(230),tM;(e=>{function t(a){return M0.keyCodeToStr(a)}e.toString=t;function i(a){return M0.strToKeyCode(a)}e.fromString=i;function s(a){return m2.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return p2.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return m2.strToKeyCode(a)||p2.strToKeyCode(a)}e.fromUserSettings=n;function l(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return M0.keyCodeToStr(a)}e.toElectronAccelerator=l})(tM||={});var n5=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),iM;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof sM?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Os.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n5})})(iM||={});var sM=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?n5:(this._emitter||(this._emitter=new Se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var rM,L0;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?L0=(e,t)=>{J7(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:L0=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},rM=e=>L0(globalThis,e)})();var nM;(e=>{async function t(s){let r,n=await Promise.all(s.map(l=>l.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(l){n(l)}})}e.withAsyncBody=i})(nM||={});var S2=class Ei{static fromArray(t){return new Ei(i=>{i.emitMany(t)})}static fromPromise(t){return new Ei(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Ei(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Ei(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Se,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Os.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Ei(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Ei.map(this,t)}static filter(t,i){return new Ei(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Ei.filter(this,t)}static coalesce(t){return Ei.filter(t,i=>!!i)}coalesce(){return Ei.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Ei.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};S2.EMPTY=S2.fromArray([]);function lM(e){return 55296<=e&&e<=56319}function y2(e){return 56320<=e&&e<=57343}function aM(e,t){return(e-55296<<10)+(t-56320)+65536}function oM(e){return K0(e,0)}function K0(e,t){switch(typeof e){case"object":return e===null?Ns(349,t):Array.isArray(e)?cM(e,t):uM(e,t);case"string":return l5(e,t);case"boolean":return hM(e,t);case"number":return Ns(e,t);case"undefined":return Ns(937,t);default:return Ns(617,t)}}function Ns(e,t){return(t<<5)-t+e|0}function hM(e,t){return Ns(e?433:863,t)}function l5(e,t){t=Ns(149417,t);for(let i=0,s=e.length;i<s;i++)t=Ns(e.charCodeAt(i),t);return t}function cM(e,t){return t=Ns(104579,t),e.reduce((i,s)=>K0(s,i),t)}function uM(e,t){return t=Ns(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=l5(s,i),K0(e[s],i)),t)}function A0(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function b2(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function dM(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Za(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):dM((e>>>0).toString(16),t/4)}var fM=class a5{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,l,a;for(n!==0?(l=n,a=-1,n=0):(l=t.charCodeAt(0),a=0);;){let o=l;if(lM(l))if(a+1<i){let h=t.charCodeAt(a+1);y2(h)?(a++,o=aM(l,h)):o=65533}else{n=l;break}else y2(l)&&(o=65533);if(r=this._push(s,r,o),a++,a<i)l=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Za(this._h0)+Za(this._h1)+Za(this._h2)+Za(this._h3)+Za(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,b2(this._buff,this._buffLen),this._buffLen>56&&(this._step(),b2(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=a5._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,A0(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,l=this._h3,a=this._h4,o,h,c;for(let u=0;u<80;u++)u<20?(o=r&n|~r&l,h=1518500249):u<40?(o=r^n^l,h=1859775393):u<60?(o=r&n|r&l|n&l,h=2400959708):(o=r^n^l,h=3395469782),c=A0(s,5)+o+a+h+t.getUint32(u*4,!1)&4294967295,a=l,l=n,n=A0(r,30),r=s,s=c;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+a&4294967295}};fM._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:JA,getWindow:_M,getDocument:eD,getWindows:tD,getWindowsCount:iD,getWindowId:w2,getWindowById:sD,hasWindow:rD,onDidRegisterWindow:nD,onWillUnregisterWindow:lD,onDidUnregisterWindow:aD}=(function(){let e=new Map,t={window:Oi,disposables:new Sl};e.set(Oi.vscodeWindowId,t);let i=new Se,s=new Se,r=new Se;function n(l,a){return(typeof l=="number"?e.get(l):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(l){if(e.has(l.vscodeWindowId))return hi.None;let a=new Sl,o={window:l,disposables:a.add(new Sl)};return e.set(l.vscodeWindowId,o),a.add(bt(()=>{e.delete(l.vscodeWindowId),s.fire(l)})),a.add(q0(l,mM.BEFORE_UNLOAD,()=>{r.fire(l)})),i.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:n,getWindow(l){let a=l;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let o=l;return o?.view?o.view.window:Oi},getDocument(l){return _M(l).document}}})(),gM=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function q0(e,t,i,s){return new gM(e,t,i,s)}var vM,C2,D0=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ac(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let l=e.get(n)??[];for(t.set(n,l),e.set(n,[]),s.set(n,!0);l.length>0;)l.sort(D0.sort),l.shift().execute();s.set(n,!1)};C2=(n,l,a=0)=>{let o=w2(n),h=new D0(l,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(h),i.get(o)||(i.set(o,!0),n.requestAnimationFrame(()=>r(o))),h},vM=(n,l,a)=>{let o=w2(n);if(s.get(o)){let h=new D0(l,a),c=t.get(o);return c||(c=[],t.set(o,c)),c.push(h),h}else return C2(n,l,a)}})();var x2=class Hc{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new Hc(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof Hc?t:new Hc(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};x2.None=new x2(0,0);var oD=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=oM(i),n=s.get(r);if(n)n.users+=1;else{let l=new Se,a=new MutationObserver(h=>l.fire(h));a.observe(e,i);let o=n={users:1,observer:a,onDidMutate:l.event};t.add(bt(()=>{o.users-=1,o.users===0&&(l.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},mM={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:x0?"webkitAnimationStart":"animationstart",ANIMATION_END:x0?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:x0?"webkitAnimationIteration":"animationiteration"},pM=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function o5(e,t,i,...s){let r=pM.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",l;return e!=="http://www.w3.org/1999/xhtml"?l=document.createElementNS(e,n):l=document.createElement(n),r[3]&&(l.id=r[3]),r[4]&&(l.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,o])=>{typeof o>"u"||(/^on\w+$/.test(a)?l[a]=o:a==="selected"?o&&l.setAttribute(a,"true"):l.setAttribute(a,o))}),l.append(...s),l}function SM(e,t,...i){return o5("http://www.w3.org/1999/xhtml",e,t,...i)}SM.SVG=function(e,t,...i){return o5("http://www.w3.org/2000/svg",e,t,...i)};var yM=class extends hi{constructor(e,t,i,s,r,n,l,a,o){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=l,this._themeService=a,this._cursorBlinkStateManager=new Ka,this._charAtlasDisposable=this._register(new Ka),this._observerDisposable=this._register(new Ka),this._model=new B7,this._workCell=new a2,this._workCell2=new a2,this._rectangleRenderer=this._register(new Ka),this._glyphRenderer=this._register(new Ka),this._onChangeTextureAtlas=this._register(new Se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Se),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Se),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let h={antialias:!1,depth:!1,preserveDrawingBuffer:o};if(this._gl=this._canvas.getContext("webgl2",h),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new KT(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new U7(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,l,this._themeService)],this.dimensions=YT(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(l.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(q0(this._canvas,"webglcontextlost",c=>{console.log("webglcontextlost event received"),c.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(c)},3e3)})),this._register(q0(this._canvas,"webglcontextrestored",c=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,n2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=l2(this._canvas,this._coreBrowserService.window,(c,u)=>this._setCanvasDevicePixelDimensions(c,u)),this._register(this._coreBrowserService.onWindowChange(c=>{this._observerDisposable.value=l2(this._canvas,c,(u,d)=>this._setCanvasDevicePixelDimensions(u,d))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(bt(()=>{for(let c of this._renderLayers)c.dispose();this._canvas.parentElement?.removeChild(this._canvas),n2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new z7(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new L7(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=Z2(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=O2(Os.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Os.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new b7(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,l,a,o,h,c=0,u=!0,d,f,_,y,M,m,v,S,g;e=E2(e,i.rows-1,0),t=E2(t,i.rows-1,0);let T=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,B=L-i.buffer.ydisp,O=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),I=-1,F=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(n=e;n<=t;n++)for(l=n+i.buffer.ydisp,a=i.buffer.lines.get(l),this._model.lineLengths[n]=0,_=L===l,c=0,o=this._characterJoinerService.getJoinedCharacters(l),S=0;S<i.cols;S++){if(r=this._cellColorResolver.result.bg,a.loadCell(S,s),S===0&&(r=this._cellColorResolver.result.bg),h=!1,u=S>=c,d=S,o.length>0&&S===o[0][0]&&u){f=o.shift();let wt=this._model.selection.isCellSelected(this._terminal,f[0],l);for(v=f[0]+1;v<f[1];v++)u&&=wt===this._model.selection.isCellSelected(this._terminal,v,l);u&&=!_||O<f[0]||O>=f[1],u?(h=!0,s=new bM(s,a.translateToString(!0,f[0],f[1]),f[1]-f[0]),d=f[1]-1):c=f[1]}if(y=s.getChars(),M=s.getCode(),v=(n*i.cols+S)*Uc,this._cellColorResolver.resolve(s,S,l,this.dimensions.device.cell.width),F&&l===L&&(S===O&&(this._model.cursor={x:O,y:B,width:s.getWidth(),style:this._coreBrowserService.isFocused?T:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},I=O+s.getWidth()-1),S>=O&&S<=I&&(this._coreBrowserService.isFocused&&T==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),M!==0&&(this._model.lineLengths[n]=S+1),!(this._model.cells[v]===M&&this._model.cells[v+Bc]===this._cellColorResolver.result.bg&&this._model.cells[v+kc]===this._cellColorResolver.result.fg&&this._model.cells[v+w0]===this._cellColorResolver.result.ext)&&(P=!0,y.length>1&&(M|=R7),this._model.cells[v]=M,this._model.cells[v+Bc]=this._cellColorResolver.result.bg,this._model.cells[v+kc]=this._cellColorResolver.result.fg,this._model.cells[v+w0]=this._cellColorResolver.result.ext,m=s.getWidth(),this._glyphRenderer.value.updateCell(S,n,M,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,y,m,r),h)){for(s=this._workCell,S++;S<=d;S++)g=(n*i.cols+S)*Uc,this._glyphRenderer.value.updateCell(S,n,0,0,0,0,UT,0,0),this._model.cells[g]=0,this._model.cells[g+Bc]=this._cellColorResolver.result.bg,this._model.cells[g+kc]=this._cellColorResolver.result.fg,this._model.cells[g+w0]=this._cellColorResolver.result.ext;S--}}P&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},bM=class extends ml{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function E2(e,t,i=0){return Math.max(Math.min(e,t),i)}var T2="di$target",M2="di$dependencies",R0=new Map;function ns(e){if(R0.has(e))return R0.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");wM(t,i,r)};return t._id=e,R0.set(e,t),t}function wM(e,t,i){t[T2]===t?t[M2].push({id:e,index:i}):(t[M2]=[{id:e,index:i}],t[T2]=t)}var hD=ns("BufferService"),cD=ns("CoreMouseService"),uD=ns("CoreService"),dD=ns("CharsetService"),fD=ns("InstantiationService"),_D=ns("LogService"),CM=ns("OptionsService"),gD=ns("OscLinkService"),vD=ns("UnicodeService"),mD=ns("DecorationService"),xM={trace:0,debug:1,info:2,warn:3,error:4,off:5},EM="xterm.js: ",L2=class extends hi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),h5=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=xM[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":EM)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};L2=pT([ST(0,CM)],L2);var h5;function TM(e){h5=e}var c5=class extends hi{constructor(e){if(H2&&HT()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Se),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let i=t.coreService,s=t.optionsService,r=t,n=r._renderService,l=r._characterJoinerService,a=r._charSizeService,o=r._coreBrowserService,h=r._decorationService,c=r._logService,u=r._themeService;TM(c),this._renderer=this._register(new yM(e,l,a,o,i,h,s,u,this._preserveDrawingBuffer)),this._register(Os.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Os.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Os.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Os.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(bt(()=>{if(this._terminal._core._store._isDisposed)return;let d=this._terminal._core._renderService;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};var z=io(j0(),1),v5={claude:"Claude Code",codex:"Codex",shell:"Shell"},AM={connecting:"Connecting…",live:"Live",ended:"Ended",behind:"Catching up…","signed-out":"Signed out — sign in again to keep typing",gone:"This terminal is gone",offline:"Reconnecting…",busy:"Not reading input — what you type waits"},X0=document.getElementById("so-term-boot"),DM=X0?.dataset.csrf??"",RM=X0?.dataset.session??null,_5=X0?.dataset.passwordless==="1";async function BM(){let e=await fetch("/term/state",{headers:{accept:"application/json"},credentials:"same-origin"});return e.status===401?(location.href=`/login?next=${encodeURIComponent(location.pathname)}`,null):e.ok?await e.json():null}async function m5(e,t){let i=await fetch(e,{method:"POST",headers:{accept:"application/json"},credentials:"same-origin",body:new URLSearchParams({csrf:DM,...t})});try{return await i.json()}catch{return{ok:!1,error:"The console didn't answer. Try again."}}}function $0({program:e}){return(0,z.jsx)("span",{className:`term-glyph term-glyph--${e}`,"aria-hidden":!0,children:e==="claude"?"C":e==="codex"?"X":"$"})}function kM({session:e,onLink:t,keys:i}){let s=(0,Ae.useRef)(null);return(0,Ae.useEffect)(()=>{let r=new Cb({fontFamily:'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:window.matchMedia("(max-width: 720px)").matches?12:13,cursorBlink:!0,allowProposedApi:!0,scrollback:5e3,macOptionIsMeta:!0,theme:{background:"#0C0E12",foreground:"#E6E8EC",cursor:"#E6E8EC",selectionBackground:"#2A3140",black:"#14171D",brightBlack:"#5B6372",blue:"#5B9DFF",brightBlue:"#8AB8FF",green:"#3FB97F",brightGreen:"#6BD9A2",red:"#F06464",brightRed:"#FF8F8F",yellow:"#F5A524",brightYellow:"#FFC266",cyan:"#4FC4CF",brightCyan:"#7FDDE5",magenta:"#B78CF2",brightMagenta:"#D0B3FF",white:"#C9CED6",brightWhite:"#FFFFFF"}}),n=new xb;r.loadAddon(n);let l=new Yb;r.loadAddon(l),r.unicode.activeVersion="11",r.open(s.current);let a=null;try{a=new c5,a.onContextLoss(()=>{a?.dispose(),a=null}),r.loadAddon(a)}catch{a=null}let o=null,h=!1,c=!1,u=0,d,f,_=T=>{o?.readyState===WebSocket.OPEN&&o.send(JSON.stringify(T))},y=T=>_({t:"in",d:T});i(y);let M=()=>{try{n.fit()}catch{return}_({t:"resize",cols:r.cols,rows:r.rows})},m=()=>{t(u===0?"connecting":"offline");let T=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/term/${e.id}/socket`,L=new WebSocket(T);o=L,L.binaryType="arraybuffer";let B=!0;L.onmessage=O=>{if(B&&(r.reset(),B=!1),typeof O.data!="string"){r.write(new Uint8Array(O.data));return}let I;try{I=JSON.parse(O.data)}catch{return}I.t==="hello"?(u=0,c=I.ended===!0,t(c?"ended":"live"),c||M()):I.t==="exit"?(c=!0,t("ended")):I.t==="input-full"&&(t("busy"),window.clearTimeout(f),f=window.setTimeout(()=>{c||t("live")},2500))},L.onclose=O=>{if(o===L&&(o=null),!h){if(O.code===4401)return t("signed-out");if(O.code===4404)return t("gone");if(c)return t("ended");t(O.code===4008?"behind":"offline"),u+=1,d=window.setTimeout(m,Math.min(8e3,250*2**Math.min(u,5)))}}},v=r.onData(y),S=new ResizeObserver(()=>M());S.observe(s.current);let g=window.visualViewport;return g?.addEventListener("resize",M),m(),r.focus(),()=>{h=!0,window.clearTimeout(d),window.clearTimeout(f),S.disconnect(),g?.removeEventListener("resize",M),v.dispose(),o?.close(1e3),r.dispose()}},[e.id]),(0,z.jsx)("div",{className:"term-screen",ref:s})}function OM({sendRef:e}){let[t,i]=(0,Ae.useState)(!1),s=(n,l)=>(0,z.jsx)("button",{type:"button",className:"term-key",onPointerDown:a=>{a.preventDefault(),e.current?.(l)},children:n}),r=n=>{e.current?.(String.fromCharCode(n.toUpperCase().charCodeAt(0)-64)),i(!1)};return(0,z.jsxs)("div",{className:"term-keys",role:"toolbar","aria-label":"Terminal keys",children:[s("esc","\x1B"),s("tab"," "),(0,z.jsx)("button",{type:"button",className:`term-key${t?" term-key--on":""}`,"aria-pressed":t,onPointerDown:n=>{n.preventDefault(),i(l=>!l)},children:"ctrl"}),t?(0,z.jsx)(z.Fragment,{children:["c","d","r","l","z"].map(n=>(0,z.jsxs)("button",{type:"button",className:"term-key",onPointerDown:l=>{l.preventDefault(),r(n)},children:["^",n.toUpperCase()]},n))}):(0,z.jsxs)(z.Fragment,{children:[s("↑","\x1B[A"),s("↓","\x1B[B"),s("←","\x1B[D"),s("→","\x1B[C"),s("/","/"),s("⏎","\r")]})]})}function NM({state:e,onStarted:t,onCancel:i}){let[s,r]=(0,Ae.useState)(e.projects[0]?.path??""),[n,l]=(0,Ae.useState)(e.programs[0]??"claude"),[a,o]=(0,Ae.useState)(""),[h,c]=(0,Ae.useState)(!1),[u,d]=(0,Ae.useState)(null),f=async _=>{_.preventDefault(),c(!0),d(null);let y=await m5("/term/start",{repo:s,program:n,password:a});c(!1),o(""),y.ok&&y.id!==void 0?t(y.id):d(y.error??"The terminal didn't start.")};return e.projects.length===0?(0,z.jsxs)("div",{className:"term-new",children:[(0,z.jsx)("h2",{children:"No projects yet"}),(0,z.jsx)("p",{children:"Add a project in the console first, then start a terminal in it."}),(0,z.jsx)("a",{className:"term-button",href:"/projects",children:"Projects"})]}):(0,z.jsxs)("form",{className:"term-new",onSubmit:_=>{f(_)},children:[(0,z.jsx)("h2",{children:"New terminal"}),(0,z.jsx)("p",{className:"term-muted",children:"Runs in a fresh worktree on its own branch. Your default branch is never touched."}),(0,z.jsxs)("label",{className:"term-field",children:[(0,z.jsx)("span",{children:"Project"}),(0,z.jsx)("select",{value:s,onChange:_=>r(_.target.value),children:e.projects.map(_=>(0,z.jsx)("option",{value:_.path,children:_.name},_.path))})]}),(0,z.jsxs)("fieldset",{className:"term-programs",children:[(0,z.jsx)("legend",{children:"Program"}),e.programs.map(_=>(0,z.jsxs)("label",{className:`term-program${n===_?" term-program--on":""}`,children:[(0,z.jsx)("input",{type:"radio",name:"program",value:_,checked:n===_,onChange:()=>l(_)}),(0,z.jsx)($0,{program:_})," ",v5[_]]},_))]}),_5?(0,z.jsx)("p",{className:"term-muted",children:"A terminal can do anything you can on this computer."}):(0,z.jsxs)("div",{className:"term-ceremony",children:[(0,z.jsx)("p",{children:"A terminal can do anything you can on this computer. Confirm with your Toolroll password."}),(0,z.jsxs)("label",{className:"term-field",children:[(0,z.jsx)("span",{children:"Password"}),(0,z.jsx)("input",{type:"password",autoComplete:"current-password",value:a,onChange:_=>o(_.target.value),required:!0})]})]}),u!==null?(0,z.jsx)("p",{className:"term-error",role:"alert",children:u}):null,(0,z.jsxs)("div",{className:"term-actions",children:[i!==null?(0,z.jsx)("button",{type:"button",className:"term-button term-button--quiet",onClick:i,children:"Cancel"}):null,(0,z.jsx)("button",{type:"submit",className:"term-button",disabled:h||!_5&&a===""||s==="",children:h?"Starting…":"Start"})]})]})}function zM(){let[e,t]=(0,Ae.useState)(null),[i,s]=(0,Ae.useState)(RM),[r,n]=(0,Ae.useState)(!1),[l,a]=(0,Ae.useState)(!1),[o,h]=(0,Ae.useState)("connecting"),c=(0,Ae.useRef)(null),u=(0,Ae.useCallback)(async()=>{let M=await BM();M!==null&&t(M)},[]);if((0,Ae.useEffect)(()=>{u();let M=window.setInterval(()=>{u()},5e3);return()=>window.clearInterval(M)},[u]),(0,Ae.useEffect)(()=>{e!==null&&(i!==null&&!e.sessions.some(M=>M.id===i)&&s(e.sessions[0]?.id??null),i===null&&e.sessions.length>0&&!r&&s(e.sessions[0].id))},[e,i,r]),(0,Ae.useEffect)(()=>{let M=i===null?"/term":`/term/${i}`;location.pathname!==M&&history.replaceState(null,"",M)},[i]),(0,Ae.useEffect)(()=>{o==="ended"&&u()},[o,u]),e===null)return(0,z.jsx)("div",{className:"term-app term-app--loading",children:"Loading…"});let d=e.sessions.find(M=>M.id===i)??null,f=M=>{s(M),n(!1),a(!1)},_=async M=>{if(d===null)return;let m=await m5(`/term/${d.id}/${M}`,{});!m.ok&&m.error&&window.alert(m.error),await u()},y=(0,z.jsxs)("nav",{className:"term-list","aria-label":"Terminals",children:[(0,z.jsxs)("div",{className:"term-list-head",children:[(0,z.jsx)("a",{href:"/",className:"term-back","aria-label":"Back to the console",children:"←"}),(0,z.jsx)("h1",{children:"Live"}),(0,z.jsx)("button",{type:"button",className:"term-button term-button--small",onClick:()=>{n(!0),a(!1)},children:"+ New"})]}),e.sessions.length===0?(0,z.jsx)("p",{className:"term-muted term-list-empty",children:"No terminals yet."}):null,e.sessions.map(M=>(0,z.jsxs)("button",{type:"button",className:`term-item${M.id===i&&!r?" term-item--on":""}`,onClick:()=>f(M.id),children:[(0,z.jsx)($0,{program:M.program}),(0,z.jsxs)("span",{className:"term-item-text",children:[(0,z.jsx)("span",{className:"term-item-title",children:M.project}),(0,z.jsxs)("span",{className:"term-item-meta",children:[v5[M.program]," · ",M.branch]})]}),(0,z.jsx)("span",{className:`term-dot${M.endedAt===null?" term-dot--live":""}`,"aria-label":M.endedAt===null?"running":"ended"})]},M.id))]});return(0,z.jsxs)("div",{className:`term-app${l?" term-app--drawer":""}`,children:[(0,z.jsx)("aside",{className:"term-side",children:y}),(0,z.jsx)("button",{type:"button",className:"term-scrim","aria-label":"Close the list",onClick:()=>a(!1)}),(0,z.jsxs)("main",{className:"term-main",children:[(0,z.jsxs)("header",{className:"term-bar",children:[(0,z.jsx)("button",{type:"button",className:"term-menu","aria-label":"Terminals",onClick:()=>a(!0),children:"☰"}),d!==null&&!r?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("span",{className:"term-bar-title",children:[(0,z.jsx)($0,{program:d.program})," ",d.project,(0,z.jsx)("span",{className:"term-bar-branch",children:d.branch})]}),(0,z.jsx)("span",{className:`term-link term-link--${o}`,children:AM[o]}),d.endedAt===null?(0,z.jsx)("button",{type:"button",className:"term-button term-button--quiet term-button--small",onClick:()=>{window.confirm("Close this terminal? Everything running in it stops.")&&_("close")},children:"Close"}):(0,z.jsx)("button",{type:"button",className:"term-button term-button--quiet term-button--small",onClick:()=>{window.confirm("Remove this terminal and its worktree? Its branch stays.")&&_("remove")},children:"Remove"})]}):(0,z.jsx)("span",{className:"term-bar-title",children:e.available?"New terminal":"Live"})]}),e.available?r||d===null?(0,z.jsx)(NM,{state:e,onCancel:d===null?null:()=>n(!1),onStarted:M=>{n(!1),s(M),u()}}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(kM,{session:d,onLink:h,keys:M=>{c.current=M}},d.id),(0,z.jsx)(OM,{sendRef:c})]}):(0,z.jsxs)("div",{className:"term-new",children:[(0,z.jsx)("h2",{children:"Terminals aren't available"}),(0,z.jsx)("p",{children:e.problem??"This install can't run terminals."})]})]})]})}(0,g5.createRoot)(document.getElementById("so-term")).render((0,z.jsx)(zM,{}));
46
155
  /*! Bundled license information:
47
156
 
48
157
  react/cjs/react.production.js:
@@ -102,6 +211,8 @@ react/cjs/react-jsx-runtime.production.js:
102
211
 
103
212
  @xterm/xterm/lib/xterm.mjs:
104
213
  @xterm/addon-fit/lib/addon-fit.mjs:
214
+ @xterm/addon-unicode11/lib/addon-unicode11.mjs:
215
+ @xterm/addon-webgl/lib/addon-webgl.mjs:
105
216
  (**
106
217
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
107
218
  * @license MIT