tono 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +125 -20
  2. package/dist/cli/checks.js +504 -0
  3. package/dist/cli/checks.js.map +1 -0
  4. package/dist/cli/commands/config.js +20 -3
  5. package/dist/cli/commands/config.js.map +1 -1
  6. package/dist/cli/commands/configure.js +1 -1
  7. package/dist/cli/commands/configure.js.map +1 -1
  8. package/dist/cli/commands/doctor.js +22 -0
  9. package/dist/cli/commands/doctor.js.map +1 -0
  10. package/dist/cli/commands/gateway.js +39 -14
  11. package/dist/cli/commands/gateway.js.map +1 -1
  12. package/dist/cli/commands/init.js +22 -3
  13. package/dist/cli/commands/init.js.map +1 -1
  14. package/dist/cli/commands/start.js +69 -19
  15. package/dist/cli/commands/start.js.map +1 -1
  16. package/dist/cli/commands/worker.js +500 -0
  17. package/dist/cli/commands/worker.js.map +1 -0
  18. package/dist/cli/index.js +28 -9
  19. package/dist/cli/index.js.map +1 -1
  20. package/dist/cli/launchd.js +5 -5
  21. package/dist/cli/launchd.js.map +1 -1
  22. package/dist/server/app.js +130 -35
  23. package/dist/server/app.js.map +1 -1
  24. package/dist/server/config/load.js +19 -1
  25. package/dist/server/config/load.js.map +1 -1
  26. package/dist/server/config/schema.json +19 -0
  27. package/dist/server/db/client.js +73 -2
  28. package/dist/server/db/client.js.map +1 -1
  29. package/dist/server/db/queries.js +126 -3
  30. package/dist/server/db/queries.js.map +1 -1
  31. package/dist/server/db/schema.sql +36 -21
  32. package/dist/server/events.js.map +1 -1
  33. package/dist/server/server.js +28 -11
  34. package/dist/server/server.js.map +1 -1
  35. package/dist/server/worker/agent.js +441 -0
  36. package/dist/server/worker/agent.js.map +1 -0
  37. package/dist/server/worker/pty-bridge.js +27 -0
  38. package/dist/server/worker/pty-bridge.js.map +1 -0
  39. package/dist/server/workers/github-poller.js +26 -8
  40. package/dist/server/workers/github-poller.js.map +1 -1
  41. package/dist/server/workers/reaper.js +44 -0
  42. package/dist/server/workers/reaper.js.map +1 -0
  43. package/dist/server/workers/registry.js +174 -0
  44. package/dist/server/workers/registry.js.map +1 -0
  45. package/dist/server/workers/scheduler.js +79 -130
  46. package/dist/server/workers/scheduler.js.map +1 -1
  47. package/dist/server/ws/pty.js +71 -54
  48. package/dist/server/ws/pty.js.map +1 -1
  49. package/dist/server/ws/workers.js +241 -0
  50. package/dist/server/ws/workers.js.map +1 -0
  51. package/dist/shared/types.js +4 -1
  52. package/dist/shared/types.js.map +1 -1
  53. package/dist/shared/worker-protocol.js +28 -0
  54. package/dist/shared/worker-protocol.js.map +1 -0
  55. package/dist/web/assets/index-BsiC8WMV.js +129 -0
  56. package/dist/web/assets/index-CjzMqxyT.css +1 -0
  57. package/dist/web/index.html +2 -2
  58. package/package.json +18 -26
  59. package/dist/web/assets/index-5VFn-lxF.js +0 -129
  60. package/dist/web/assets/index-CZHd5NaX.css +0 -1
@@ -0,0 +1,129 @@
1
+ (function(){const Y=document.createElement("link").relList;if(Y&&Y.supports&&Y.supports("modulepreload"))return;for(const J of document.querySelectorAll('link[rel="modulepreload"]'))j(J);new MutationObserver(J=>{for(const se of J)if(se.type==="childList")for(const P of se.addedNodes)P.tagName==="LINK"&&P.rel==="modulepreload"&&j(P)}).observe(document,{childList:!0,subtree:!0});function G(J){const se={};return J.integrity&&(se.integrity=J.integrity),J.referrerPolicy&&(se.referrerPolicy=J.referrerPolicy),J.crossOrigin==="use-credentials"?se.credentials="include":J.crossOrigin==="anonymous"?se.credentials="omit":se.credentials="same-origin",se}function j(J){if(J.ep)return;J.ep=!0;const se=G(J);fetch(J.href,se)}})();var Do={exports:{}},Zr={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Id;function Ev(){if(Id)return Zr;Id=1;var k=Symbol.for("react.transitional.element"),Y=Symbol.for("react.fragment");function G(j,J,se){var P=null;if(se!==void 0&&(P=""+se),J.key!==void 0&&(P=""+J.key),"key"in J){se={};for(var n in J)n!=="key"&&(se[n]=J[n])}else se=J;return J=se.ref,{$$typeof:k,type:j,key:P,ref:J!==void 0?J:null,props:se}}return Zr.Fragment=Y,Zr.jsx=G,Zr.jsxs=G,Zr}var Pd;function Lv(){return Pd||(Pd=1,Do.exports=Ev()),Do.exports}var T=Lv(),To={exports:{}},we={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Fd;function Av(){if(Fd)return we;Fd=1;var k=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),P=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),g=Symbol.iterator;function b(A){return A===null||typeof A!="object"?null:(A=g&&A[g]||A["@@iterator"],typeof A=="function"?A:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},u=Object.assign,r={};function c(A,z,V){this.props=A,this.context=z,this.refs=r,this.updater=V||y}c.prototype.isReactComponent={},c.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,z,"setState")},c.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function o(){}o.prototype=c.prototype;function h(A,z,V){this.props=A,this.context=z,this.refs=r,this.updater=V||y}var m=h.prototype=new o;m.constructor=h,u(m,c.prototype),m.isPureReactComponent=!0;var C=Array.isArray;function S(){}var w={H:null,A:null,T:null,S:null},p=Object.prototype.hasOwnProperty;function x(A,z,V){var Z=V.ref;return{$$typeof:k,type:A,key:z,ref:Z!==void 0?Z:null,props:V}}function L(A,z){return x(A.type,z,A.props)}function B(A){return typeof A=="object"&&A!==null&&A.$$typeof===k}function D(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(V){return z[V]})}var M=/\/+/g;function U(A,z){return typeof A=="object"&&A!==null&&A.key!=null?D(""+A.key):z.toString(36)}function K(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(S,S):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function I(A,z,V,Z,he){var ue=typeof A;(ue==="undefined"||ue==="boolean")&&(A=null);var q=!1;if(A===null)q=!0;else switch(ue){case"bigint":case"string":case"number":q=!0;break;case"object":switch(A.$$typeof){case k:case Y:q=!0;break;case v:return q=A._init,I(q(A._payload),z,V,Z,he)}}if(q)return he=he(A),q=Z===""?"."+U(A,0):Z,C(he)?(V="",q!=null&&(V=q.replace(M,"$&/")+"/"),I(he,z,V,"",function(re){return re})):he!=null&&(B(he)&&(he=L(he,V+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(M,"$&/")+"/")+q)),z.push(he)),1;q=0;var N=Z===""?".":Z+":";if(C(A))for(var ne=0;ne<A.length;ne++)Z=A[ne],ue=N+U(Z,ne),q+=I(Z,z,V,ue,he);else if(ne=b(A),typeof ne=="function")for(A=ne.call(A),ne=0;!(Z=A.next()).done;)Z=Z.value,ue=N+U(Z,ne++),q+=I(Z,z,V,ue,he);else if(ue==="object"){if(typeof A.then=="function")return I(K(A),z,V,Z,he);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return q}function F(A,z,V){if(A==null)return A;var Z=[],he=0;return I(A,Z,"","",function(ue){return z.call(V,ue,he++)}),Z}function $(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(V){(A._status===0||A._status===-1)&&(A._status=1,A._result=V)},function(V){(A._status===0||A._status===-1)&&(A._status=2,A._result=V)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var R=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},H={map:F,forEach:function(A,z,V){F(A,function(){z.apply(this,arguments)},V)},count:function(A){var z=0;return F(A,function(){z++}),z},toArray:function(A){return F(A,function(z){return z})||[]},only:function(A){if(!B(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return we.Activity=l,we.Children=H,we.Component=c,we.Fragment=G,we.Profiler=J,we.PureComponent=h,we.StrictMode=j,we.Suspense=f,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,we.__COMPILER_RUNTIME={__proto__:null,c:function(A){return w.H.useMemoCache(A)}},we.cache=function(A){return function(){return A.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(A,z,V){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var Z=u({},A.props),he=A.key;if(z!=null)for(ue in z.key!==void 0&&(he=""+z.key),z)!p.call(z,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&z.ref===void 0||(Z[ue]=z[ue]);var ue=arguments.length-2;if(ue===1)Z.children=V;else if(1<ue){for(var q=Array(ue),N=0;N<ue;N++)q[N]=arguments[N+2];Z.children=q}return x(A.type,he,Z)},we.createContext=function(A){return A={$$typeof:P,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:se,_context:A},A},we.createElement=function(A,z,V){var Z,he={},ue=null;if(z!=null)for(Z in z.key!==void 0&&(ue=""+z.key),z)p.call(z,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(he[Z]=z[Z]);var q=arguments.length-2;if(q===1)he.children=V;else if(1<q){for(var N=Array(q),ne=0;ne<q;ne++)N[ne]=arguments[ne+2];he.children=N}if(A&&A.defaultProps)for(Z in q=A.defaultProps,q)he[Z]===void 0&&(he[Z]=q[Z]);return x(A,ue,he)},we.createRef=function(){return{current:null}},we.forwardRef=function(A){return{$$typeof:n,render:A}},we.isValidElement=B,we.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:$}},we.memo=function(A,z){return{$$typeof:_,type:A,compare:z===void 0?null:z}},we.startTransition=function(A){var z=w.T,V={};w.T=V;try{var Z=A(),he=w.S;he!==null&&he(V,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(S,R)}catch(ue){R(ue)}finally{z!==null&&V.types!==null&&(z.types=V.types),w.T=z}},we.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},we.use=function(A){return w.H.use(A)},we.useActionState=function(A,z,V){return w.H.useActionState(A,z,V)},we.useCallback=function(A,z){return w.H.useCallback(A,z)},we.useContext=function(A){return w.H.useContext(A)},we.useDebugValue=function(){},we.useDeferredValue=function(A,z){return w.H.useDeferredValue(A,z)},we.useEffect=function(A,z){return w.H.useEffect(A,z)},we.useEffectEvent=function(A){return w.H.useEffectEvent(A)},we.useId=function(){return w.H.useId()},we.useImperativeHandle=function(A,z,V){return w.H.useImperativeHandle(A,z,V)},we.useInsertionEffect=function(A,z){return w.H.useInsertionEffect(A,z)},we.useLayoutEffect=function(A,z){return w.H.useLayoutEffect(A,z)},we.useMemo=function(A,z){return w.H.useMemo(A,z)},we.useOptimistic=function(A,z){return w.H.useOptimistic(A,z)},we.useReducer=function(A,z,V){return w.H.useReducer(A,z,V)},we.useRef=function(A){return w.H.useRef(A)},we.useState=function(A){return w.H.useState(A)},we.useSyncExternalStore=function(A,z,V){return w.H.useSyncExternalStore(A,z,V)},we.useTransition=function(){return w.H.useTransition()},we.version="19.2.6",we}var qd;function qo(){return qd||(qd=1,To.exports=Av()),To.exports}var de=qo(),Mo={exports:{}},Jr={},Bo={exports:{}},Oo={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Wd;function Rv(){return Wd||(Wd=1,(function(k){function Y(I,F){var $=I.length;I.push(F);e:for(;0<$;){var R=$-1>>>1,H=I[R];if(0<J(H,F))I[R]=F,I[$]=H,$=R;else break e}}function G(I){return I.length===0?null:I[0]}function j(I){if(I.length===0)return null;var F=I[0],$=I.pop();if($!==F){I[0]=$;e:for(var R=0,H=I.length,A=H>>>1;R<A;){var z=2*(R+1)-1,V=I[z],Z=z+1,he=I[Z];if(0>J(V,$))Z<H&&0>J(he,V)?(I[R]=he,I[Z]=$,R=Z):(I[R]=V,I[z]=$,R=z);else if(Z<H&&0>J(he,$))I[R]=he,I[Z]=$,R=Z;else break e}}return F}function J(I,F){var $=I.sortIndex-F.sortIndex;return $!==0?$:I.id-F.id}if(k.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var se=performance;k.unstable_now=function(){return se.now()}}else{var P=Date,n=P.now();k.unstable_now=function(){return P.now()-n}}var f=[],_=[],v=1,l=null,g=3,b=!1,y=!1,u=!1,r=!1,c=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function m(I){for(var F=G(_);F!==null;){if(F.callback===null)j(_);else if(F.startTime<=I)j(_),F.sortIndex=F.expirationTime,Y(f,F);else break;F=G(_)}}function C(I){if(u=!1,m(I),!y)if(G(f)!==null)y=!0,S||(S=!0,D());else{var F=G(_);F!==null&&K(C,F.startTime-I)}}var S=!1,w=-1,p=5,x=-1;function L(){return r?!0:!(k.unstable_now()-x<p)}function B(){if(r=!1,S){var I=k.unstable_now();x=I;var F=!0;try{e:{y=!1,u&&(u=!1,o(w),w=-1),b=!0;var $=g;try{t:{for(m(I),l=G(f);l!==null&&!(l.expirationTime>I&&L());){var R=l.callback;if(typeof R=="function"){l.callback=null,g=l.priorityLevel;var H=R(l.expirationTime<=I);if(I=k.unstable_now(),typeof H=="function"){l.callback=H,m(I),F=!0;break t}l===G(f)&&j(f),m(I)}else j(f);l=G(f)}if(l!==null)F=!0;else{var A=G(_);A!==null&&K(C,A.startTime-I),F=!1}}break e}finally{l=null,g=$,b=!1}F=void 0}}finally{F?D():S=!1}}}var D;if(typeof h=="function")D=function(){h(B)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,U=M.port2;M.port1.onmessage=B,D=function(){U.postMessage(null)}}else D=function(){c(B,0)};function K(I,F){w=c(function(){I(k.unstable_now())},F)}k.unstable_IdlePriority=5,k.unstable_ImmediatePriority=1,k.unstable_LowPriority=4,k.unstable_NormalPriority=3,k.unstable_Profiling=null,k.unstable_UserBlockingPriority=2,k.unstable_cancelCallback=function(I){I.callback=null},k.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):p=0<I?Math.floor(1e3/I):5},k.unstable_getCurrentPriorityLevel=function(){return g},k.unstable_next=function(I){switch(g){case 1:case 2:case 3:var F=3;break;default:F=g}var $=g;g=F;try{return I()}finally{g=$}},k.unstable_requestPaint=function(){r=!0},k.unstable_runWithPriority=function(I,F){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var $=g;g=I;try{return F()}finally{g=$}},k.unstable_scheduleCallback=function(I,F,$){var R=k.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?R+$:R):$=R,I){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=$+H,I={id:v++,callback:F,priorityLevel:I,startTime:$,expirationTime:H,sortIndex:-1},$>R?(I.sortIndex=$,Y(_,I),G(f)===null&&I===G(_)&&(u?(o(w),w=-1):u=!0,K(C,$-R))):(I.sortIndex=H,Y(f,I),y||b||(y=!0,S||(S=!0,D()))),I},k.unstable_shouldYield=L,k.unstable_wrapCallback=function(I){var F=g;return function(){var $=g;g=F;try{return I.apply(this,arguments)}finally{g=$}}}})(Oo)),Oo}var $d;function Dv(){return $d||($d=1,Bo.exports=Rv()),Bo.exports}var ko={exports:{}},yt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Gd;function Tv(){if(Gd)return yt;Gd=1;var k=qo();function Y(f){var _="https://react.dev/errors/"+f;if(1<arguments.length){_+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)_+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+f+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function G(){}var j={d:{f:G,r:function(){throw Error(Y(522))},D:G,C:G,L:G,m:G,X:G,S:G,M:G},p:0,findDOMNode:null},J=Symbol.for("react.portal");function se(f,_,v){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:l==null?null:""+l,children:f,containerInfo:_,implementation:v}}var P=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function n(f,_){if(f==="font")return"";if(typeof _=="string")return _==="use-credentials"?_:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,yt.createPortal=function(f,_){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(Y(299));return se(f,_,null,v)},yt.flushSync=function(f){var _=P.T,v=j.p;try{if(P.T=null,j.p=2,f)return f()}finally{P.T=_,j.p=v,j.d.f()}},yt.preconnect=function(f,_){typeof f=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,j.d.C(f,_))},yt.prefetchDNS=function(f){typeof f=="string"&&j.d.D(f)},yt.preinit=function(f,_){if(typeof f=="string"&&_&&typeof _.as=="string"){var v=_.as,l=n(v,_.crossOrigin),g=typeof _.integrity=="string"?_.integrity:void 0,b=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;v==="style"?j.d.S(f,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:l,integrity:g,fetchPriority:b}):v==="script"&&j.d.X(f,{crossOrigin:l,integrity:g,fetchPriority:b,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},yt.preinitModule=function(f,_){if(typeof f=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var v=n(_.as,_.crossOrigin);j.d.M(f,{crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&j.d.M(f)},yt.preload=function(f,_){if(typeof f=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var v=_.as,l=n(v,_.crossOrigin);j.d.L(f,v,{crossOrigin:l,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0,type:typeof _.type=="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority=="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy=="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet=="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes=="string"?_.imageSizes:void 0,media:typeof _.media=="string"?_.media:void 0})}},yt.preloadModule=function(f,_){if(typeof f=="string")if(_){var v=n(_.as,_.crossOrigin);j.d.m(f,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else j.d.m(f)},yt.requestFormReset=function(f){j.d.r(f)},yt.unstable_batchedUpdates=function(f,_){return f(_)},yt.useFormState=function(f,_,v){return P.H.useFormState(f,_,v)},yt.useFormStatus=function(){return P.H.useHostTransitionStatus()},yt.version="19.2.6",yt}var Yd;function Mv(){if(Yd)return ko.exports;Yd=1;function k(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k)}catch(Y){console.error(Y)}}return k(),ko.exports=Tv(),ko.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Xd;function Bv(){if(Xd)return Jr;Xd=1;var k=Dv(),Y=qo(),G=Mv();function j(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 J(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function se(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function P(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 n(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 f(e){if(se(e)!==e)throw Error(j(188))}function _(e){var t=e.alternate;if(!t){if(t=se(e),t===null)throw Error(j(188));return t!==e?null:e}for(var i=e,s=t;;){var a=i.return;if(a===null)break;var d=a.alternate;if(d===null){if(s=a.return,s!==null){i=s;continue}break}if(a.child===d.child){for(d=a.child;d;){if(d===i)return f(a),e;if(d===s)return f(a),t;d=d.sibling}throw Error(j(188))}if(i.return!==s.return)i=a,s=d;else{for(var E=!1,O=a.child;O;){if(O===i){E=!0,i=a,s=d;break}if(O===s){E=!0,s=a,i=d;break}O=O.sibling}if(!E){for(O=d.child;O;){if(O===i){E=!0,i=d,s=a;break}if(O===s){E=!0,s=d,i=a;break}O=O.sibling}if(!E)throw Error(j(189))}}if(i.alternate!==s)throw Error(j(190))}if(i.tag!==3)throw Error(j(188));return i.stateNode.current===i?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var l=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function D(e){return e===null||typeof e!="object"?null:(e=B&&e[B]||e["@@iterator"],typeof e=="function"?e:null)}var M=Symbol.for("react.client.reference");function U(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case c:return"Profiler";case r:return"StrictMode";case C:return"Suspense";case S:return"SuspenseList";case x:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case y:return"Portal";case h:return e.displayName||"Context";case o:return(e._context.displayName||"Context")+".Consumer";case m:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case w:return t=e.displayName||null,t!==null?t:U(e.type)||"Memo";case p:t=e._payload,e=e._init;try{return U(e(t))}catch{}}return null}var K=Array.isArray,I=Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=G.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},R=[],H=-1;function A(e){return{current:e}}function z(e){0>H||(e.current=R[H],R[H]=null,H--)}function V(e,t){H++,R[H]=e.current,e.current=t}var Z=A(null),he=A(null),ue=A(null),q=A(null);function N(e,t){switch(V(ue,t),V(he,e),V(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cd(t),e=hd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(Z),V(Z,e)}function ne(){z(Z),z(he),z(ue)}function re(e){e.memoizedState!==null&&V(q,e);var t=Z.current,i=hd(t,e.type);t!==i&&(V(he,e),V(Z,i))}function _e(e){he.current===e&&(z(Z),z(he)),q.current===e&&(z(q),Xr._currentValue=$)}var fe,xe;function pe(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",xe=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+fe+e+xe}var Ne=!1;function Qe(e,t){if(!e||Ne)return"";Ne=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ae){var ie=ae}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(ae){ie=ae}e.call(ce.prototype)}}else{try{throw Error()}catch(ae){ie=ae}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ae){if(ae&&ie&&typeof ae.stack=="string")return[ae.stack,ie.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),E=d[0],O=d[1];if(E&&O){var W=E.split(`
44
+ `),te=O.split(`
45
+ `);for(a=s=0;s<W.length&&!W[s].includes("DetermineComponentFrameRoot");)s++;for(;a<te.length&&!te[a].includes("DetermineComponentFrameRoot");)a++;if(s===W.length||a===te.length)for(s=W.length-1,a=te.length-1;1<=s&&0<=a&&W[s]!==te[a];)a--;for(;1<=s&&0<=a;s--,a--)if(W[s]!==te[a]){if(s!==1||a!==1)do if(s--,a--,0>a||W[s]!==te[a]){var le=`
46
+ `+W[s].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=s&&0<=a);break}}}finally{Ne=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?pe(i):""}function be(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe("Lazy");case 13:return e.child!==t&&t!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return Qe(e.type,!1);case 11:return Qe(e.type.render,!1);case 1:return Qe(e.type,!0);case 31:return pe("Activity");default:return""}}function Bt(e){try{var t="",i=null;do t+=be(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var si=Object.prototype.hasOwnProperty,Be=k.unstable_scheduleCallback,Ae=k.unstable_cancelCallback,De=k.unstable_shouldYield,ve=k.unstable_requestPaint,Ce=k.unstable_now,Ze=k.unstable_getCurrentPriorityLevel,Fe=k.unstable_ImmediatePriority,Ft=k.unstable_UserBlockingPriority,ht=k.unstable_NormalPriority,wt=k.unstable_LowPriority,et=k.unstable_IdlePriority,qe=k.log,Re=k.unstable_setDisableYieldValue,Jt=null,dt=null;function Ot(e){if(typeof qe=="function"&&Re(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Jt,e)}catch{}}var bt=Math.clz32?Math.clz32:va,ys=Math.log,_a=Math.LN2;function va(e){return e>>>=0,e===0?32:31-(ys(e)/_a|0)|0}var Ri=256,ts=262144,is=4194304;function ci(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function en(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var a=0,d=e.suspendedLanes,E=e.pingedLanes;e=e.warmLanes;var O=s&134217727;return O!==0?(s=O&~d,s!==0?a=ci(s):(E&=O,E!==0?a=ci(E):i||(i=O&~e,i!==0&&(a=ci(i))))):(O=s&~d,O!==0?a=ci(O):E!==0?a=ci(E):i||(i=s&~e,i!==0&&(a=ci(i)))),a===0?0:t!==0&&t!==a&&(t&d)===0&&(d=a&-a,i=t&-t,d>=i||d===32&&(i&4194048)!==0)?t:a}function lr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function df(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 Wo(){var e=is;return is<<=1,(is&62914560)===0&&(is=4194304),e}function ga(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function or(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ff(e,t,i,s,a,d){var E=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 O=e.entanglements,W=e.expirationTimes,te=e.hiddenUpdates;for(i=E&~i;0<i;){var le=31-bt(i),ce=1<<le;O[le]=0,W[le]=-1;var ie=te[le];if(ie!==null)for(te[le]=null,le=0;le<ie.length;le++){var ae=ie[le];ae!==null&&(ae.lane&=-536870913)}i&=~ce}s!==0&&$o(e,s,0),d!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=d&~(E&~t))}function $o(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-bt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Go(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-bt(i),a=1<<s;a&t|e[s]&t&&(e[s]|=t),i&=~a}}function Yo(e,t){var i=t&-t;return i=(i&42)!==0?1:ma(i),(i&(e.suspendedLanes|t))!==0?0:i}function ma(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 pa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xo(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Od(e.type))}function Vo(e,t){var i=F.p;try{return F.p=e,t()}finally{F.p=i}}var Di=Math.random().toString(36).slice(2),vt="__reactFiber$"+Di,Et="__reactProps$"+Di,Cs="__reactContainer$"+Di,Sa="__reactEvents$"+Di,_f="__reactListeners$"+Di,vf="__reactHandles$"+Di,Ko="__reactResources$"+Di,cr="__reactMarker$"+Di;function ba(e){delete e[vt],delete e[Et],delete e[Sa],delete e[_f],delete e[vf]}function xs(e){var t=e[vt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Cs]||i[vt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=md(e);e!==null;){if(i=e[vt])return i;e=md(e)}return t}e=i,i=e.parentNode}return null}function ws(e){if(e=e[vt]||e[Cs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function hr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(j(33))}function Es(e){var t=e[Ko];return t||(t=e[Ko]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[cr]=!0}var Qo=new Set,Zo={};function ss(e,t){Ls(e,t),Ls(e+"Capture",t)}function Ls(e,t){for(Zo[e]=t,e=0;e<t.length;e++)Qo.add(t[e])}var gf=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]*$"),Jo={},ec={};function mf(e){return si.call(ec,e)?!0:si.call(Jo,e)?!1:gf.test(e)?ec[e]=!0:(Jo[e]=!0,!1)}function tn(e,t,i){if(mf(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 sn(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 hi(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 qt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pf(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 a=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(E){i=""+E,d.call(this,E)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ya(e){if(!e._valueTracker){var t=tc(e)?"checked":"value";e._valueTracker=pf(e,t,""+e[t])}}function ic(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=tc(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function rn(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}}var Sf=/[\n"\\]/g;function Wt(e){return e.replace(Sf,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ca(e,t,i,s,a,d,E,O){e.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.type=E:e.removeAttribute("type"),t!=null?E==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qt(t)):e.value!==""+qt(t)&&(e.value=""+qt(t)):E!=="submit"&&E!=="reset"||e.removeAttribute("value"),t!=null?xa(e,E,qt(t)):i!=null?xa(e,E,qt(i)):s!=null&&e.removeAttribute("value"),a==null&&d!=null&&(e.defaultChecked=!!d),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.name=""+qt(O):e.removeAttribute("name")}function sc(e,t,i,s,a,d,E,O){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){ya(e);return}i=i!=null?""+qt(i):"",t=t!=null?""+qt(t):i,O||t===e.value||(e.value=t),e.defaultValue=t}s=s??a,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=O?e.checked:!!s,e.defaultChecked=!!s,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(e.name=E),ya(e)}function xa(e,t,i){t==="number"&&rn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function As(e,t,i,s){if(e=e.options,t){t={};for(var a=0;a<i.length;a++)t["$"+i[a]]=!0;for(i=0;i<e.length;i++)a=t.hasOwnProperty("$"+e[i].value),e[i].selected!==a&&(e[i].selected=a),a&&s&&(e[i].defaultSelected=!0)}else{for(i=""+qt(i),t=null,a=0;a<e.length;a++){if(e[a].value===i){e[a].selected=!0,s&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function rc(e,t,i){if(t!=null&&(t=""+qt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+qt(i):""}function nc(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(j(92));if(K(s)){if(1<s.length)throw Error(j(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=qt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),ya(e)}function Rs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var bf=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 ac(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||bf.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function lc(e,t,i){if(t!=null&&typeof t!="object")throw Error(j(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]="");for(var a in t)s=t[a],t.hasOwnProperty(a)&&i[a]!==s&&ac(e,a,s)}else for(var d in t)t.hasOwnProperty(d)&&ac(e,d,t[d])}function wa(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 yf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cf=/^[\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 nn(e){return Cf.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ui(){}var Ea=null;function La(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ds=null,Ts=null;function oc(e){var t=ws(e);if(t&&(e=t.stateNode)){var i=e[Et]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ca(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="'+Wt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var a=s[Et]||null;if(!a)throw Error(j(90));Ca(s,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&ic(s)}break e;case"textarea":rc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&As(e,!!i.multiple,t,!1)}}}var Aa=!1;function cc(e,t,i){if(Aa)return e(t,i);Aa=!0;try{var s=e(t);return s}finally{if(Aa=!1,(Ds!==null||Ts!==null)&&(Gn(),Ds&&(t=Ds,e=Ts,Ts=Ds=null,oc(t),e)))for(t=0;t<e.length;t++)oc(e[t])}}function ur(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Et]||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(j(231,t,typeof i));return i}var di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ra=!1;if(di)try{var dr={};Object.defineProperty(dr,"passive",{get:function(){Ra=!0}}),window.addEventListener("test",dr,dr),window.removeEventListener("test",dr,dr)}catch{Ra=!1}var Ti=null,Da=null,an=null;function hc(){if(an)return an;var e,t=Da,i=t.length,s,a="value"in Ti?Ti.value:Ti.textContent,d=a.length;for(e=0;e<i&&t[e]===a[e];e++);var E=i-e;for(s=1;s<=E&&t[i-s]===a[d-s];s++);return an=a.slice(e,1<s?1-s:void 0)}function ln(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 on(){return!0}function uc(){return!1}function Lt(e){function t(i,s,a,d,E){this._reactName=i,this._targetInst=a,this.type=s,this.nativeEvent=d,this.target=E,this.currentTarget=null;for(var O in e)e.hasOwnProperty(O)&&(i=e[O],this[O]=i?i(d):d[O]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?on:uc,this.isPropagationStopped=uc,this}return l(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=on)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=Lt(rs),fr=l({},rs,{view:0,detail:0}),xf=Lt(fr),Ta,Ma,_r,hn=l({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oa,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!==_r&&(_r&&e.type==="mousemove"?(Ta=e.screenX-_r.screenX,Ma=e.screenY-_r.screenY):Ma=Ta=0,_r=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:Ma}}),dc=Lt(hn),wf=l({},hn,{dataTransfer:0}),Ef=Lt(wf),Lf=l({},fr,{relatedTarget:0}),Ba=Lt(Lf),Af=l({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),Rf=Lt(Af),Df=l({},rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tf=Lt(Df),Mf=l({},rs,{data:0}),fc=Lt(Mf),Bf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Of={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"},kf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kf[e])?!!t[e]:!1}function Oa(){return zf}var Nf=l({},fr,{key:function(e){if(e.key){var t=Bf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ln(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Of[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oa,charCode:function(e){return e.type==="keypress"?ln(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ln(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hf=Lt(Nf),jf=l({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_c=Lt(jf),Uf=l({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oa}),If=Lt(Uf),Pf=l({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ff=Lt(Pf),qf=l({},hn,{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}),Wf=Lt(qf),$f=l({},rs,{newState:0,oldState:0}),Gf=Lt($f),Yf=[9,13,27,32],ka=di&&"CompositionEvent"in window,vr=null;di&&"documentMode"in document&&(vr=document.documentMode);var Xf=di&&"TextEvent"in window&&!vr,vc=di&&(!ka||vr&&8<vr&&11>=vr),gc=" ",mc=!1;function pc(e,t){switch(e){case"keyup":return Yf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ms=!1;function Vf(e,t){switch(e){case"compositionend":return Sc(t);case"keypress":return t.which!==32?null:(mc=!0,gc);case"textInput":return e=t.data,e===gc&&mc?null:e;default:return null}}function Kf(e,t){if(Ms)return e==="compositionend"||!ka&&pc(e,t)?(e=hc(),an=Da=Ti=null,Ms=!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 vc&&t.locale!=="ko"?null:t.data;default:return null}}var Qf={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 bc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qf[e.type]:t==="textarea"}function yc(e,t,i,s){Ds?Ts?Ts.push(s):Ts=[s]:Ds=s,t=Jn(t,"onChange"),0<t.length&&(i=new cn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var gr=null,mr=null;function Zf(e){sd(e,0)}function un(e){var t=hr(e);if(ic(t))return e}function Cc(e,t){if(e==="change")return t}var xc=!1;if(di){var za;if(di){var Na="oninput"in document;if(!Na){var wc=document.createElement("div");wc.setAttribute("oninput","return;"),Na=typeof wc.oninput=="function"}za=Na}else za=!1;xc=za&&(!document.documentMode||9<document.documentMode)}function Ec(){gr&&(gr.detachEvent("onpropertychange",Lc),mr=gr=null)}function Lc(e){if(e.propertyName==="value"&&un(mr)){var t=[];yc(t,mr,e,La(e)),cc(Zf,t)}}function Jf(e,t,i){e==="focusin"?(Ec(),gr=t,mr=i,gr.attachEvent("onpropertychange",Lc)):e==="focusout"&&Ec()}function e_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return un(mr)}function t_(e,t){if(e==="click")return un(t)}function i_(e,t){if(e==="input"||e==="change")return un(t)}function s_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:s_;function pr(e,t){if(kt(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 a=i[s];if(!si.call(t,a)||!kt(e[a],t[a]))return!1}return!0}function Ac(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rc(e,t){var i=Ac(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=Ac(i)}}function Dc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=rn(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=rn(e.document)}return t}function Ha(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 r_=di&&"documentMode"in document&&11>=document.documentMode,Bs=null,ja=null,Sr=null,Ua=!1;function Mc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ua||Bs==null||Bs!==rn(s)||(s=Bs,"selectionStart"in s&&Ha(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}),Sr&&pr(Sr,s)||(Sr=s,s=Jn(ja,"onSelect"),0<s.length&&(t=new cn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Bs)))}function ns(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Os={animationend:ns("Animation","AnimationEnd"),animationiteration:ns("Animation","AnimationIteration"),animationstart:ns("Animation","AnimationStart"),transitionrun:ns("Transition","TransitionRun"),transitionstart:ns("Transition","TransitionStart"),transitioncancel:ns("Transition","TransitionCancel"),transitionend:ns("Transition","TransitionEnd")},Ia={},Bc={};di&&(Bc=document.createElement("div").style,"AnimationEvent"in window||(delete Os.animationend.animation,delete Os.animationiteration.animation,delete Os.animationstart.animation),"TransitionEvent"in window||delete Os.transitionend.transition);function as(e){if(Ia[e])return Ia[e];if(!Os[e])return e;var t=Os[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Bc)return Ia[e]=t[i];return e}var Oc=as("animationend"),kc=as("animationiteration"),zc=as("animationstart"),n_=as("transitionrun"),a_=as("transitionstart"),l_=as("transitioncancel"),Nc=as("transitionend"),Hc=new Map,Pa="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Pa.push("scrollEnd");function ei(e,t){Hc.set(e,t),ss(t,[e])}var dn=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)},$t=[],ks=0,Fa=0;function fn(){for(var e=ks,t=Fa=ks=0;t<e;){var i=$t[t];$t[t++]=null;var s=$t[t];$t[t++]=null;var a=$t[t];$t[t++]=null;var d=$t[t];if($t[t++]=null,s!==null&&a!==null){var E=s.pending;E===null?a.next=a:(a.next=E.next,E.next=a),s.pending=a}d!==0&&jc(i,a,d)}}function _n(e,t,i,s){$t[ks++]=e,$t[ks++]=t,$t[ks++]=i,$t[ks++]=s,Fa|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qa(e,t,i,s){return _n(e,t,i,s),vn(e)}function ls(e,t){return _n(e,null,null,t),vn(e)}function jc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var a=!1,d=e.return;d!==null;)d.childLanes|=i,s=d.alternate,s!==null&&(s.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(a=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,a&&t!==null&&(a=31-bt(i),e=d.hiddenUpdates,s=e[a],s===null?e[a]=[t]:s.push(t),t.lane=i|536870912),d):null}function vn(e){if(50<Pr)throw Pr=0,Zl=null,Error(j(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zs={};function o_(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 zt(e,t,i,s){return new o_(e,t,i,s)}function Wa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fi(e,t){var i=e.alternate;return i===null?(i=zt(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&65011712,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 Uc(e,t){e.flags&=65011714;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 gn(e,t,i,s,a,d){var E=0;if(s=e,typeof e=="function")Wa(e)&&(E=1);else if(typeof e=="string")E=fv(e,i,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case x:return e=zt(31,i,t,a),e.elementType=x,e.lanes=d,e;case u:return os(i.children,a,d,t);case r:E=8,a|=24;break;case c:return e=zt(12,i,t,a|2),e.elementType=c,e.lanes=d,e;case C:return e=zt(13,i,t,a),e.elementType=C,e.lanes=d,e;case S:return e=zt(19,i,t,a),e.elementType=S,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h:E=10;break e;case o:E=9;break e;case m:E=11;break e;case w:E=14;break e;case p:E=16,s=null;break e}E=29,i=Error(j(130,e===null?"null":typeof e,"")),s=null}return t=zt(E,i,t,a),t.elementType=e,t.type=s,t.lanes=d,t}function os(e,t,i,s){return e=zt(7,e,s,t),e.lanes=i,e}function $a(e,t,i){return e=zt(6,e,null,t),e.lanes=i,e}function Ic(e){var t=zt(18,null,null,0);return t.stateNode=e,t}function Ga(e,t,i){return t=zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pc=new WeakMap;function Gt(e,t){if(typeof e=="object"&&e!==null){var i=Pc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Bt(t)},Pc.set(e,t),t)}return{value:e,source:t,stack:Bt(t)}}var Ns=[],Hs=0,mn=null,br=0,Yt=[],Xt=0,Mi=null,ri=1,ni="";function _i(e,t){Ns[Hs++]=br,Ns[Hs++]=mn,mn=e,br=t}function Fc(e,t,i){Yt[Xt++]=ri,Yt[Xt++]=ni,Yt[Xt++]=Mi,Mi=e;var s=ri;e=ni;var a=32-bt(s)-1;s&=~(1<<a),i+=1;var d=32-bt(t)+a;if(30<d){var E=a-a%5;d=(s&(1<<E)-1).toString(32),s>>=E,a-=E,ri=1<<32-bt(t)+a|i<<a|s,ni=d+e}else ri=1<<d|i<<a|s,ni=e}function Ya(e){e.return!==null&&(_i(e,1),Fc(e,1,0))}function Xa(e){for(;e===mn;)mn=Ns[--Hs],Ns[Hs]=null,br=Ns[--Hs],Ns[Hs]=null;for(;e===Mi;)Mi=Yt[--Xt],Yt[Xt]=null,ni=Yt[--Xt],Yt[Xt]=null,ri=Yt[--Xt],Yt[Xt]=null}function qc(e,t){Yt[Xt++]=ri,Yt[Xt++]=ni,Yt[Xt++]=Mi,ri=t.id,ni=t.overflow,Mi=e}var gt=null,Ve=null,ze=!1,Bi=null,Vt=!1,Va=Error(j(519));function Oi(e){var t=Error(j(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yr(Gt(t,e)),Va}function Wc(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[vt]=e,t[Et]=s,i){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(i=0;i<qr.length;i++)Me(qr[i],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),sc(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),nc(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||ld(t.textContent,i)?(s.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),s.onScroll!=null&&Me("scroll",t),s.onScrollEnd!=null&&Me("scrollend",t),s.onClick!=null&&(t.onclick=ui),t=!0):t=!1,t||Oi(e,!0)}function $c(e){for(gt=e.return;gt;)switch(gt.tag){case 5:case 31:case 13:Vt=!1;return;case 27:case 3:Vt=!0;return;default:gt=gt.return}}function js(e){if(e!==gt)return!1;if(!ze)return $c(e),ze=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||_o(e.type,e.memoizedProps)),i=!i),i&&Ve&&Oi(e),$c(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));Ve=gd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));Ve=gd(e)}else t===27?(t=Ve,Yi(e.type)?(e=So,So=null,Ve=e):Ve=t):Ve=gt?Qt(e.stateNode.nextSibling):null;return!0}function cs(){Ve=gt=null,ze=!1}function Ka(){var e=Bi;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Bi=null),e}function yr(e){Bi===null?Bi=[e]:Bi.push(e)}var Qa=A(null),hs=null,vi=null;function ki(e,t,i){V(Qa,t._currentValue),t._currentValue=i}function gi(e){e._currentValue=Qa.current,z(Qa)}function Za(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 Ja(e,t,i,s){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var d=a.dependencies;if(d!==null){var E=a.child;d=d.firstContext;e:for(;d!==null;){var O=d;d=a;for(var W=0;W<t.length;W++)if(O.context===t[W]){d.lanes|=i,O=d.alternate,O!==null&&(O.lanes|=i),Za(d.return,i,e),s||(E=null);break e}d=O.next}}else if(a.tag===18){if(E=a.return,E===null)throw Error(j(341));E.lanes|=i,d=E.alternate,d!==null&&(d.lanes|=i),Za(E,i,e),E=null}else E=a.child;if(E!==null)E.return=a;else for(E=a;E!==null;){if(E===e){E=null;break}if(a=E.sibling,a!==null){a.return=E.return,E=a;break}E=E.return}a=E}}function Us(e,t,i,s){e=null;for(var a=t,d=!1;a!==null;){if(!d){if((a.flags&524288)!==0)d=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var E=a.alternate;if(E===null)throw Error(j(387));if(E=E.memoizedProps,E!==null){var O=a.type;kt(a.pendingProps.value,E.value)||(e!==null?e.push(O):e=[O])}}else if(a===q.current){if(E=a.alternate,E===null)throw Error(j(387));E.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Xr):e=[Xr])}a=a.return}e!==null&&Ja(t,e,i,s),t.flags|=262144}function pn(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function us(e){hs=e,vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Gc(hs,e)}function Sn(e,t){return hs===null&&us(e),Gc(e,t)}function Gc(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},vi===null){if(e===null)throw Error(j(308));vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vi=vi.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()})}},h_=k.unstable_scheduleCallback,u_=k.unstable_NormalPriority,at={$$typeof:h,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function el(){return{controller:new c_,data:new Map,refCount:0}}function Cr(e){e.refCount--,e.refCount===0&&h_(u_,function(){e.controller.abort()})}var xr=null,tl=0,Is=0,Ps=null;function d_(e,t){if(xr===null){var i=xr=[];tl=0,Is=ro(),Ps={status:"pending",value:void 0,then:function(s){i.push(s)}}}return tl++,t.then(Yc,Yc),t}function Yc(){if(--tl===0&&xr!==null){Ps!==null&&(Ps.status="fulfilled");var e=xr;xr=null,Is=0,Ps=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function f_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(a){i.push(a)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var a=0;a<i.length;a++)(0,i[a])(t)},function(a){for(s.status="rejected",s.reason=a,a=0;a<i.length;a++)(0,i[a])(void 0)}),s}var Xc=I.S;I.S=function(e,t){Mu=Ce(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&d_(e,t),Xc!==null&&Xc(e,t)};var ds=A(null);function il(){var e=ds.current;return e!==null?e:Ye.pooledCache}function bn(e,t){t===null?V(ds,ds.current):V(ds,t.pool)}function Vc(){var e=il();return e===null?null:{parent:at._currentValue,pool:e}}var Fs=Error(j(460)),sl=Error(j(474)),yn=Error(j(542)),Cn={then:function(){}};function Kc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qc(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(ui,ui),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jc(e),e;default:if(typeof t.status=="string")t.then(ui,ui);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(j(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=s}},function(s){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jc(e),e}throw _s=t,Fs}}function fs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(_s=i,Fs):i}}var _s=null;function Zc(){if(_s===null)throw Error(j(459));var e=_s;return _s=null,e}function Jc(e){if(e===Fs||e===yn)throw Error(j(483))}var qs=null,wr=0;function xn(e){var t=wr;return wr+=1,qs===null&&(qs=[]),Qc(qs,e,t)}function Er(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wn(e,t){throw t.$$typeof===g?Error(j(525)):(e=Object.prototype.toString.call(t),Error(j(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function eh(e){function t(Q,X){if(e){var ee=Q.deletions;ee===null?(Q.deletions=[X],Q.flags|=16):ee.push(X)}}function i(Q,X){if(!e)return null;for(;X!==null;)t(Q,X),X=X.sibling;return null}function s(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function a(Q,X){return Q=fi(Q,X),Q.index=0,Q.sibling=null,Q}function d(Q,X,ee){return Q.index=ee,e?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<X?(Q.flags|=67108866,X):ee):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function E(Q){return e&&Q.alternate===null&&(Q.flags|=67108866),Q}function O(Q,X,ee,oe){return X===null||X.tag!==6?(X=$a(ee,Q.mode,oe),X.return=Q,X):(X=a(X,ee),X.return=Q,X)}function W(Q,X,ee,oe){var Se=ee.type;return Se===u?le(Q,X,ee.props.children,oe,ee.key):X!==null&&(X.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===p&&fs(Se)===X.type)?(X=a(X,ee.props),Er(X,ee),X.return=Q,X):(X=gn(ee.type,ee.key,ee.props,null,Q.mode,oe),Er(X,ee),X.return=Q,X)}function te(Q,X,ee,oe){return X===null||X.tag!==4||X.stateNode.containerInfo!==ee.containerInfo||X.stateNode.implementation!==ee.implementation?(X=Ga(ee,Q.mode,oe),X.return=Q,X):(X=a(X,ee.children||[]),X.return=Q,X)}function le(Q,X,ee,oe,Se){return X===null||X.tag!==7?(X=os(ee,Q.mode,oe,Se),X.return=Q,X):(X=a(X,ee),X.return=Q,X)}function ce(Q,X,ee){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=$a(""+X,Q.mode,ee),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return ee=gn(X.type,X.key,X.props,null,Q.mode,ee),Er(ee,X),ee.return=Q,ee;case y:return X=Ga(X,Q.mode,ee),X.return=Q,X;case p:return X=fs(X),ce(Q,X,ee)}if(K(X)||D(X))return X=os(X,Q.mode,ee,null),X.return=Q,X;if(typeof X.then=="function")return ce(Q,xn(X),ee);if(X.$$typeof===h)return ce(Q,Sn(Q,X),ee);wn(Q,X)}return null}function ie(Q,X,ee,oe){var Se=X!==null?X.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Se!==null?null:O(Q,X,""+ee,oe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Se?W(Q,X,ee,oe):null;case y:return ee.key===Se?te(Q,X,ee,oe):null;case p:return ee=fs(ee),ie(Q,X,ee,oe)}if(K(ee)||D(ee))return Se!==null?null:le(Q,X,ee,oe,null);if(typeof ee.then=="function")return ie(Q,X,xn(ee),oe);if(ee.$$typeof===h)return ie(Q,X,Sn(Q,ee),oe);wn(Q,ee)}return null}function ae(Q,X,ee,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Q=Q.get(ee)||null,O(X,Q,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Q=Q.get(oe.key===null?ee:oe.key)||null,W(X,Q,oe,Se);case y:return Q=Q.get(oe.key===null?ee:oe.key)||null,te(X,Q,oe,Se);case p:return oe=fs(oe),ae(Q,X,ee,oe,Se)}if(K(oe)||D(oe))return Q=Q.get(ee)||null,le(X,Q,oe,Se,null);if(typeof oe.then=="function")return ae(Q,X,ee,xn(oe),Se);if(oe.$$typeof===h)return ae(Q,X,ee,Sn(X,oe),Se);wn(X,oe)}return null}function ge(Q,X,ee,oe){for(var Se=null,He=null,me=X,Le=X=0,ke=null;me!==null&&Le<ee.length;Le++){me.index>Le?(ke=me,me=null):ke=me.sibling;var je=ie(Q,me,ee[Le],oe);if(je===null){me===null&&(me=ke);break}e&&me&&je.alternate===null&&t(Q,me),X=d(je,X,Le),He===null?Se=je:He.sibling=je,He=je,me=ke}if(Le===ee.length)return i(Q,me),ze&&_i(Q,Le),Se;if(me===null){for(;Le<ee.length;Le++)me=ce(Q,ee[Le],oe),me!==null&&(X=d(me,X,Le),He===null?Se=me:He.sibling=me,He=me);return ze&&_i(Q,Le),Se}for(me=s(me);Le<ee.length;Le++)ke=ae(me,Q,Le,ee[Le],oe),ke!==null&&(e&&ke.alternate!==null&&me.delete(ke.key===null?Le:ke.key),X=d(ke,X,Le),He===null?Se=ke:He.sibling=ke,He=ke);return e&&me.forEach(function(Zi){return t(Q,Zi)}),ze&&_i(Q,Le),Se}function ye(Q,X,ee,oe){if(ee==null)throw Error(j(151));for(var Se=null,He=null,me=X,Le=X=0,ke=null,je=ee.next();me!==null&&!je.done;Le++,je=ee.next()){me.index>Le?(ke=me,me=null):ke=me.sibling;var Zi=ie(Q,me,je.value,oe);if(Zi===null){me===null&&(me=ke);break}e&&me&&Zi.alternate===null&&t(Q,me),X=d(Zi,X,Le),He===null?Se=Zi:He.sibling=Zi,He=Zi,me=ke}if(je.done)return i(Q,me),ze&&_i(Q,Le),Se;if(me===null){for(;!je.done;Le++,je=ee.next())je=ce(Q,je.value,oe),je!==null&&(X=d(je,X,Le),He===null?Se=je:He.sibling=je,He=je);return ze&&_i(Q,Le),Se}for(me=s(me);!je.done;Le++,je=ee.next())je=ae(me,Q,Le,je.value,oe),je!==null&&(e&&je.alternate!==null&&me.delete(je.key===null?Le:je.key),X=d(je,X,Le),He===null?Se=je:He.sibling=je,He=je);return e&&me.forEach(function(wv){return t(Q,wv)}),ze&&_i(Q,Le),Se}function Ge(Q,X,ee,oe){if(typeof ee=="object"&&ee!==null&&ee.type===u&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Se=ee.key;X!==null;){if(X.key===Se){if(Se=ee.type,Se===u){if(X.tag===7){i(Q,X.sibling),oe=a(X,ee.props.children),oe.return=Q,Q=oe;break e}}else if(X.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===p&&fs(Se)===X.type){i(Q,X.sibling),oe=a(X,ee.props),Er(oe,ee),oe.return=Q,Q=oe;break e}i(Q,X);break}else t(Q,X);X=X.sibling}ee.type===u?(oe=os(ee.props.children,Q.mode,oe,ee.key),oe.return=Q,Q=oe):(oe=gn(ee.type,ee.key,ee.props,null,Q.mode,oe),Er(oe,ee),oe.return=Q,Q=oe)}return E(Q);case y:e:{for(Se=ee.key;X!==null;){if(X.key===Se)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){i(Q,X.sibling),oe=a(X,ee.children||[]),oe.return=Q,Q=oe;break e}else{i(Q,X);break}else t(Q,X);X=X.sibling}oe=Ga(ee,Q.mode,oe),oe.return=Q,Q=oe}return E(Q);case p:return ee=fs(ee),Ge(Q,X,ee,oe)}if(K(ee))return ge(Q,X,ee,oe);if(D(ee)){if(Se=D(ee),typeof Se!="function")throw Error(j(150));return ee=Se.call(ee),ye(Q,X,ee,oe)}if(typeof ee.then=="function")return Ge(Q,X,xn(ee),oe);if(ee.$$typeof===h)return Ge(Q,X,Sn(Q,ee),oe);wn(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(i(Q,X.sibling),oe=a(X,ee),oe.return=Q,Q=oe):(i(Q,X),oe=$a(ee,Q.mode,oe),oe.return=Q,Q=oe),E(Q)):i(Q,X)}return function(Q,X,ee,oe){try{wr=0;var Se=Ge(Q,X,ee,oe);return qs=null,Se}catch(me){if(me===Fs||me===yn)throw me;var He=zt(29,me,null,Q.mode);return He.lanes=oe,He.return=Q,He}finally{}}}var vs=eh(!0),th=eh(!1),zi=!1;function rl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nl(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 Ni(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Hi(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ue&2)!==0){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,t=vn(e),jc(e,null,i),t}return _n(e,s,t,i),vn(e)}function Lr(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,Go(e,i)}}function al(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var a=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var E={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?a=d=E:d=d.next=E,i=i.next}while(i!==null);d===null?a=d=t:d=d.next=t}else a=d=t;i={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:d,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 ll=!1;function Ar(){if(ll){var e=Ps;if(e!==null)throw e}}function Rr(e,t,i,s){ll=!1;var a=e.updateQueue;zi=!1;var d=a.firstBaseUpdate,E=a.lastBaseUpdate,O=a.shared.pending;if(O!==null){a.shared.pending=null;var W=O,te=W.next;W.next=null,E===null?d=te:E.next=te,E=W;var le=e.alternate;le!==null&&(le=le.updateQueue,O=le.lastBaseUpdate,O!==E&&(O===null?le.firstBaseUpdate=te:O.next=te,le.lastBaseUpdate=W))}if(d!==null){var ce=a.baseState;E=0,le=te=W=null,O=d;do{var ie=O.lane&-536870913,ae=ie!==O.lane;if(ae?(Oe&ie)===ie:(s&ie)===ie){ie!==0&&ie===Is&&(ll=!0),le!==null&&(le=le.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ge=e,ye=O;ie=t;var Ge=i;switch(ye.tag){case 1:if(ge=ye.payload,typeof ge=="function"){ce=ge.call(Ge,ce,ie);break e}ce=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=ye.payload,ie=typeof ge=="function"?ge.call(Ge,ce,ie):ge,ie==null)break e;ce=l({},ce,ie);break e;case 2:zi=!0}}ie=O.callback,ie!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=a.callbacks,ae===null?a.callbacks=[ie]:ae.push(ie))}else ae={lane:ie,tag:O.tag,payload:O.payload,callback:O.callback,next:null},le===null?(te=le=ae,W=ce):le=le.next=ae,E|=ie;if(O=O.next,O===null){if(O=a.shared.pending,O===null)break;ae=O,O=ae.next,ae.next=null,a.lastBaseUpdate=ae,a.shared.pending=null}}while(!0);le===null&&(W=ce),a.baseState=W,a.firstBaseUpdate=te,a.lastBaseUpdate=le,d===null&&(a.shared.lanes=0),Fi|=E,e.lanes=E,e.memoizedState=ce}}function ih(e,t){if(typeof e!="function")throw Error(j(191,e));e.call(t)}function sh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)ih(i[e],t)}var Ws=A(null),En=A(0);function rh(e,t){e=Ei,V(En,e),V(Ws,t),Ei=e|t.baseLanes}function ol(){V(En,Ei),V(Ws,Ws.current)}function cl(){Ei=En.current,z(Ws),z(En)}var Nt=A(null),Kt=null;function ji(e){var t=e.alternate;V(st,st.current&1),V(Nt,e),Kt===null&&(t===null||Ws.current!==null||t.memoizedState!==null)&&(Kt=e)}function hl(e){V(st,st.current),V(Nt,e),Kt===null&&(Kt=e)}function nh(e){e.tag===22?(V(st,st.current),V(Nt,e),Kt===null&&(Kt=e)):Ui()}function Ui(){V(st,st.current),V(Nt,Nt.current)}function Ht(e){z(Nt),Kt===e&&(Kt=null),z(st)}var st=A(0);function Ln(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||mo(i)||po(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mi=0,Ee=null,We=null,lt=null,An=!1,$s=!1,gs=!1,Rn=0,Dr=0,Gs=null,__=0;function tt(){throw Error(j(321))}function ul(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!kt(e[i],t[i]))return!1;return!0}function dl(e,t,i,s,a,d){return mi=d,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Fh:Al,gs=!1,d=i(s,a),gs=!1,$s&&(d=lh(t,i,s,a)),ah(e),d}function ah(e){I.H=Br;var t=We!==null&&We.next!==null;if(mi=0,lt=We=Ee=null,An=!1,Dr=0,Gs=null,t)throw Error(j(300));e===null||ot||(e=e.dependencies,e!==null&&pn(e)&&(ot=!0))}function lh(e,t,i,s){Ee=e;var a=0;do{if($s&&(Gs=null),Dr=0,$s=!1,25<=a)throw Error(j(301));if(a+=1,lt=We=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}I.H=qh,d=t(i,s)}while($s);return d}function v_(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?Tr(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Ee.flags|=1024),t}function fl(){var e=Rn!==0;return Rn=0,e}function _l(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function vl(e){if(An){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}An=!1}mi=0,lt=We=Ee=null,$s=!1,Dr=Rn=0,Gs=null}function xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Ee.memoizedState=lt=e:lt=lt.next=e,lt}function rt(){if(We===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=lt===null?Ee.memoizedState:lt.next;if(t!==null)lt=t,We=e;else{if(e===null)throw Ee.alternate===null?Error(j(467)):Error(j(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},lt===null?Ee.memoizedState=lt=e:lt=lt.next=e}return lt}function Dn(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tr(e){var t=Dr;return Dr+=1,Gs===null&&(Gs=[]),e=Qc(Gs,e,t),t=Ee,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Fh:Al),e}function Tn(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Tr(e);if(e.$$typeof===h)return mt(e)}throw Error(j(438,String(e)))}function gl(e){var t=null,i=Ee.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Ee.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Dn(),Ee.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]=L;return t.index++,i}function pi(e,t){return typeof t=="function"?t(e):t}function Mn(e){var t=rt();return ml(t,We,e)}function ml(e,t,i){var s=e.queue;if(s===null)throw Error(j(311));s.lastRenderedReducer=i;var a=e.baseQueue,d=s.pending;if(d!==null){if(a!==null){var E=a.next;a.next=d.next,d.next=E}t.baseQueue=a=d,s.pending=null}if(d=e.baseState,a===null)e.memoizedState=d;else{t=a.next;var O=E=null,W=null,te=t,le=!1;do{var ce=te.lane&-536870913;if(ce!==te.lane?(Oe&ce)===ce:(mi&ce)===ce){var ie=te.revertLane;if(ie===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ce===Is&&(le=!0);else if((mi&ie)===ie){te=te.next,ie===Is&&(le=!0);continue}else ce={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(O=W=ce,E=d):W=W.next=ce,Ee.lanes|=ie,Fi|=ie;ce=te.action,gs&&i(d,ce),d=te.hasEagerState?te.eagerState:i(d,ce)}else ie={lane:ce,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(O=W=ie,E=d):W=W.next=ie,Ee.lanes|=ce,Fi|=ce;te=te.next}while(te!==null&&te!==t);if(W===null?E=d:W.next=O,!kt(d,e.memoizedState)&&(ot=!0,le&&(i=Ps,i!==null)))throw i;e.memoizedState=d,e.baseState=E,e.baseQueue=W,s.lastRenderedState=d}return a===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function pl(e){var t=rt(),i=t.queue;if(i===null)throw Error(j(311));i.lastRenderedReducer=e;var s=i.dispatch,a=i.pending,d=t.memoizedState;if(a!==null){i.pending=null;var E=a=a.next;do d=e(d,E.action),E=E.next;while(E!==a);kt(d,t.memoizedState)||(ot=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,s]}function oh(e,t,i){var s=Ee,a=rt(),d=ze;if(d){if(i===void 0)throw Error(j(407));i=i()}else i=t();var E=!kt((We||a).memoizedState,i);if(E&&(a.memoizedState=i,ot=!0),a=a.queue,yl(uh.bind(null,s,a,e),[e]),a.getSnapshot!==t||E||lt!==null&&lt.memoizedState.tag&1){if(s.flags|=2048,Ys(9,{destroy:void 0},hh.bind(null,s,a,i,t),null),Ye===null)throw Error(j(349));d||(mi&127)!==0||ch(s,t,i)}return i}function ch(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ee.updateQueue,t===null?(t=Dn(),Ee.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function hh(e,t,i,s){t.value=i,t.getSnapshot=s,dh(t)&&fh(e)}function uh(e,t,i){return i(function(){dh(t)&&fh(e)})}function dh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!kt(e,i)}catch{return!0}}function fh(e){var t=ls(e,2);t!==null&&Mt(t,e,2)}function Sl(e){var t=xt();if(typeof e=="function"){var i=e;if(e=i(),gs){Ot(!0);try{i()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:e},t}function _h(e,t,i,s){return e.baseState=i,ml(e,We,typeof s=="function"?s:pi)}function g_(e,t,i,s,a){if(kn(e))throw Error(j(485));if(e=t.action,e!==null){var d={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){d.listeners.push(E)}};I.T!==null?i(!0):d.isTransition=!1,s(d),i=t.pending,i===null?(d.next=t.pending=d,vh(t,d)):(d.next=i.next,t.pending=i.next=d)}}function vh(e,t){var i=t.action,s=t.payload,a=e.state;if(t.isTransition){var d=I.T,E={};I.T=E;try{var O=i(a,s),W=I.S;W!==null&&W(E,O),gh(e,t,O)}catch(te){bl(e,t,te)}finally{d!==null&&E.types!==null&&(d.types=E.types),I.T=d}}else try{d=i(a,s),gh(e,t,d)}catch(te){bl(e,t,te)}}function gh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){mh(e,t,s)},function(s){return bl(e,t,s)}):mh(e,t,i)}function mh(e,t,i){t.status="fulfilled",t.value=i,ph(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,vh(e,i)))}function bl(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,ph(t),t=t.next;while(t!==s)}e.action=null}function ph(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sh(e,t){return t}function bh(e,t){if(ze){var i=Ye.formState;if(i!==null){e:{var s=Ee;if(ze){if(Ve){t:{for(var a=Ve,d=Vt;a.nodeType!==8;){if(!d){a=null;break t}if(a=Qt(a.nextSibling),a===null){a=null;break t}}d=a.data,a=d==="F!"||d==="F"?a:null}if(a){Ve=Qt(a.nextSibling),s=a.data==="F!";break e}}Oi(s)}s=!1}s&&(t=i[0])}}return i=xt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:t},i.queue=s,i=Uh.bind(null,Ee,s),s.dispatch=i,s=Sl(!1),d=Ll.bind(null,Ee,!1,s.queue),s=xt(),a={state:t,dispatch:null,action:e,pending:null},s.queue=a,i=g_.bind(null,Ee,a,d,i),a.dispatch=i,s.memoizedState=e,[t,i,!1]}function yh(e){var t=rt();return Ch(t,We,e)}function Ch(e,t,i){if(t=ml(e,t,Sh)[0],e=Mn(pi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Tr(t)}catch(E){throw E===Fs?yn:E}else s=t;t=rt();var a=t.queue,d=a.dispatch;return i!==t.memoizedState&&(Ee.flags|=2048,Ys(9,{destroy:void 0},m_.bind(null,a,i),null)),[s,d,e]}function m_(e,t){e.action=t}function xh(e){var t=rt(),i=We;if(i!==null)return Ch(t,i,e);rt(),t=t.memoizedState,i=rt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Ys(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=Dn(),Ee.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 wh(){return rt().memoizedState}function Bn(e,t,i,s){var a=xt();Ee.flags|=e,a.memoizedState=Ys(1|t,{destroy:void 0},i,s===void 0?null:s)}function On(e,t,i,s){var a=rt();s=s===void 0?null:s;var d=a.memoizedState.inst;We!==null&&s!==null&&ul(s,We.memoizedState.deps)?a.memoizedState=Ys(t,d,i,s):(Ee.flags|=e,a.memoizedState=Ys(1|t,d,i,s))}function Eh(e,t){Bn(8390656,8,e,t)}function yl(e,t){On(2048,8,e,t)}function p_(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=Dn(),Ee.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Lh(e){var t=rt().memoizedState;return p_({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(j(440));return t.impl.apply(void 0,arguments)}}function Ah(e,t){return On(4,2,e,t)}function Rh(e,t){return On(4,4,e,t)}function Dh(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 Th(e,t,i){i=i!=null?i.concat([e]):null,On(4,4,Dh.bind(null,t,e),i)}function Cl(){}function Mh(e,t){var i=rt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&ul(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Bh(e,t){var i=rt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&ul(t,s[1]))return s[0];if(s=e(),gs){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[s,t],s}function xl(e,t,i){return i===void 0||(mi&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ou(),Ee.lanes|=e,Fi|=e,i)}function Oh(e,t,i,s){return kt(i,t)?i:Ws.current!==null?(e=xl(e,i,s),kt(e,t)||(ot=!0),e):(mi&42)===0||(mi&1073741824)!==0&&(Oe&261930)===0?(ot=!0,e.memoizedState=i):(e=Ou(),Ee.lanes|=e,Fi|=e,t)}function kh(e,t,i,s,a){var d=F.p;F.p=d!==0&&8>d?d:8;var E=I.T,O={};I.T=O,Ll(e,!1,t,i);try{var W=a(),te=I.S;if(te!==null&&te(O,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var le=f_(W,s);Mr(e,t,le,It(e))}else Mr(e,t,s,It(e))}catch(ce){Mr(e,t,{then:function(){},status:"rejected",reason:ce},It())}finally{F.p=d,E!==null&&O.types!==null&&(E.types=O.types),I.T=E}}function S_(){}function wl(e,t,i,s){if(e.tag!==5)throw Error(j(476));var a=zh(e).queue;kh(e,a,t,$,i===null?S_:function(){return Nh(e),i(s)})}function zh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:$},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Nh(e){var t=zh(e);t.next===null&&(t=e.alternate.memoizedState),Mr(e,t.next.queue,{},It())}function El(){return mt(Xr)}function Hh(){return rt().memoizedState}function jh(){return rt().memoizedState}function b_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=It();e=Ni(i);var s=Hi(t,e,i);s!==null&&(Mt(s,t,i),Lr(s,t,i)),t={cache:el()},e.payload=t;return}t=t.return}}function y_(e,t,i){var s=It();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},kn(e)?Ih(t,i):(i=qa(e,t,i,s),i!==null&&(Mt(i,e,s),Ph(i,t,s)))}function Uh(e,t,i){var s=It();Mr(e,t,i,s)}function Mr(e,t,i,s){var a={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(kn(e))Ih(t,a);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var E=t.lastRenderedState,O=d(E,i);if(a.hasEagerState=!0,a.eagerState=O,kt(O,E))return _n(e,t,a,0),Ye===null&&fn(),!1}catch{}finally{}if(i=qa(e,t,a,s),i!==null)return Mt(i,e,s),Ph(i,t,s),!0}return!1}function Ll(e,t,i,s){if(s={lane:2,revertLane:ro(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},kn(e)){if(t)throw Error(j(479))}else t=qa(e,i,s,2),t!==null&&Mt(t,e,2)}function kn(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Ih(e,t){$s=An=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ph(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Go(e,i)}}var Br={readContext:mt,use:Tn,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};Br.useEffectEvent=tt;var Fh={readContext:mt,use:Tn,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Eh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Bn(4194308,4,Dh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Bn(4194308,4,e,t)},useInsertionEffect:function(e,t){Bn(4,2,e,t)},useMemo:function(e,t){var i=xt();t=t===void 0?null:t;var s=e();if(gs){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=xt();if(i!==void 0){var a=i(t);if(gs){Ot(!0);try{i(t)}finally{Ot(!1)}}}else a=t;return s.memoizedState=s.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},s.queue=e,e=e.dispatch=y_.bind(null,Ee,e),[s.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Sl(e);var t=e.queue,i=Uh.bind(null,Ee,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Cl,useDeferredValue:function(e,t){var i=xt();return xl(i,e,t)},useTransition:function(){var e=Sl(!1);return e=kh.bind(null,Ee,e.queue,!0,!1),xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Ee,a=xt();if(ze){if(i===void 0)throw Error(j(407));i=i()}else{if(i=t(),Ye===null)throw Error(j(349));(Oe&127)!==0||ch(s,t,i)}a.memoizedState=i;var d={value:i,getSnapshot:t};return a.queue=d,Eh(uh.bind(null,s,d,e),[e]),s.flags|=2048,Ys(9,{destroy:void 0},hh.bind(null,s,d,i,t),null),i},useId:function(){var e=xt(),t=Ye.identifierPrefix;if(ze){var i=ni,s=ri;i=(s&~(1<<32-bt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Rn++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=__++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:El,useFormState:bh,useActionState:bh,useOptimistic:function(e){var t=xt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ll.bind(null,Ee,!0,i),i.dispatch=t,[e,t]},useMemoCache:gl,useCacheRefresh:function(){return xt().memoizedState=b_.bind(null,Ee)},useEffectEvent:function(e){var t=xt(),i={impl:e};return t.memoizedState=i,function(){if((Ue&2)!==0)throw Error(j(440));return i.impl.apply(void 0,arguments)}}},Al={readContext:mt,use:Tn,useCallback:Mh,useContext:mt,useEffect:yl,useImperativeHandle:Th,useInsertionEffect:Ah,useLayoutEffect:Rh,useMemo:Bh,useReducer:Mn,useRef:wh,useState:function(){return Mn(pi)},useDebugValue:Cl,useDeferredValue:function(e,t){var i=rt();return Oh(i,We.memoizedState,e,t)},useTransition:function(){var e=Mn(pi)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:Tr(e),t]},useSyncExternalStore:oh,useId:Hh,useHostTransitionStatus:El,useFormState:yh,useActionState:yh,useOptimistic:function(e,t){var i=rt();return _h(i,We,e,t)},useMemoCache:gl,useCacheRefresh:jh};Al.useEffectEvent=Lh;var qh={readContext:mt,use:Tn,useCallback:Mh,useContext:mt,useEffect:yl,useImperativeHandle:Th,useInsertionEffect:Ah,useLayoutEffect:Rh,useMemo:Bh,useReducer:pl,useRef:wh,useState:function(){return pl(pi)},useDebugValue:Cl,useDeferredValue:function(e,t){var i=rt();return We===null?xl(i,e,t):Oh(i,We.memoizedState,e,t)},useTransition:function(){var e=pl(pi)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:Tr(e),t]},useSyncExternalStore:oh,useId:Hh,useHostTransitionStatus:El,useFormState:xh,useActionState:xh,useOptimistic:function(e,t){var i=rt();return We!==null?_h(i,We,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:gl,useCacheRefresh:jh};qh.useEffectEvent=Lh;function Rl(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:l({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Dl={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=It(),a=Ni(s);a.payload=t,i!=null&&(a.callback=i),t=Hi(e,a,s),t!==null&&(Mt(t,e,s),Lr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=It(),a=Ni(s);a.tag=1,a.payload=t,i!=null&&(a.callback=i),t=Hi(e,a,s),t!==null&&(Mt(t,e,s),Lr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=It(),s=Ni(i);s.tag=2,t!=null&&(s.callback=t),t=Hi(e,s,i),t!==null&&(Mt(t,e,i),Lr(t,e,i))}};function Wh(e,t,i,s,a,d,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,E):t.prototype&&t.prototype.isPureReactComponent?!pr(i,s)||!pr(a,d):!0}function $h(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&&Dl.enqueueReplaceState(t,t.state,null)}function ms(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=l({},i));for(var a in e)i[a]===void 0&&(i[a]=e[a])}return i}function Gh(e){dn(e)}function Yh(e){console.error(e)}function Xh(e){dn(e)}function zn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Vh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Tl(e,t,i){return i=Ni(i),i.tag=3,i.payload={element:null},i.callback=function(){zn(e,t)},i}function Kh(e){return e=Ni(e),e.tag=3,e}function Qh(e,t,i,s){var a=i.type.getDerivedStateFromError;if(typeof a=="function"){var d=s.value;e.payload=function(){return a(d)},e.callback=function(){Vh(t,i,s)}}var E=i.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(e.callback=function(){Vh(t,i,s),typeof a!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var O=s.stack;this.componentDidCatch(s.value,{componentStack:O!==null?O:""})})}function C_(e,t,i,s,a){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Us(t,i,a,!0),i=Nt.current,i!==null){switch(i.tag){case 31:case 13:return Kt===null?Yn():i.alternate===null&&it===0&&(it=3),i.flags&=-257,i.flags|=65536,i.lanes=a,s===Cn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),to(e,s,a)),!1;case 22:return i.flags|=65536,s===Cn?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)),to(e,s,a)),!1}throw Error(j(435,i.tag))}return to(e,s,a),Yn(),!1}if(ze)return t=Nt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,s!==Va&&(e=Error(j(422),{cause:s}),yr(Gt(e,i)))):(s!==Va&&(t=Error(j(423),{cause:s}),yr(Gt(t,i))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,s=Gt(s,i),a=Tl(e.stateNode,s,a),al(e,a),it!==4&&(it=2)),!1;var d=Error(j(520),{cause:s});if(d=Gt(d,i),Ir===null?Ir=[d]:Ir.push(d),it!==4&&(it=2),t===null)return!0;s=Gt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=a&-a,i.lanes|=e,e=Tl(i.stateNode,s,e),al(i,e),!1;case 1:if(t=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(qi===null||!qi.has(d))))return i.flags|=65536,a&=-a,i.lanes|=a,a=Kh(a),Qh(a,e,i,s),al(i,a),!1}i=i.return}while(i!==null);return!1}var Ml=Error(j(461)),ot=!1;function pt(e,t,i,s){t.child=e===null?th(t,null,i,s):vs(t,e.child,i,s)}function Zh(e,t,i,s,a){i=i.render;var d=t.ref;if("ref"in s){var E={};for(var O in s)O!=="ref"&&(E[O]=s[O])}else E=s;return us(t),s=dl(e,t,i,E,d,a),O=fl(),e!==null&&!ot?(_l(e,t,a),Si(e,t,a)):(ze&&O&&Ya(t),t.flags|=1,pt(e,t,s,a),t.child)}function Jh(e,t,i,s,a){if(e===null){var d=i.type;return typeof d=="function"&&!Wa(d)&&d.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=d,eu(e,t,d,s,a)):(e=gn(i.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Ul(e,a)){var E=d.memoizedProps;if(i=i.compare,i=i!==null?i:pr,i(E,s)&&e.ref===t.ref)return Si(e,t,a)}return t.flags|=1,e=fi(d,s),e.ref=t.ref,e.return=t,t.child=e}function eu(e,t,i,s,a){if(e!==null){var d=e.memoizedProps;if(pr(d,s)&&e.ref===t.ref)if(ot=!1,t.pendingProps=s=d,Ul(e,a))(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,Si(e,t,a)}return Bl(e,t,i,s,a)}function tu(e,t,i,s){var a=s.children,d=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(d=d!==null?d.baseLanes|i:i,e!==null){for(s=t.child=e.child,a=0;s!==null;)a=a|s.lanes|s.childLanes,s=s.sibling;s=a&~d}else s=0,t.child=null;return iu(e,t,d,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bn(t,d!==null?d.cachePool:null),d!==null?rh(t,d):ol(),nh(t);else return s=t.lanes=536870912,iu(e,t,d!==null?d.baseLanes|i:i,i,s)}else d!==null?(bn(t,d.cachePool),rh(t,d),Ui(),t.memoizedState=null):(e!==null&&bn(t,null),ol(),Ui());return pt(e,t,a,i),t.child}function Or(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function iu(e,t,i,s,a){var d=il();return d=d===null?null:{parent:at._currentValue,pool:d},t.memoizedState={baseLanes:i,cachePool:d},e!==null&&bn(t,null),ol(),nh(t),e!==null&&Us(e,t,s,!0),t.childLanes=a,null}function Nn(e,t){return t=jn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function su(e,t,i){return vs(t,e.child,null,i),e=Nn(t,t.pendingProps),e.flags|=2,Ht(t),t.memoizedState=null,e}function x_(e,t,i){var s=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(s.mode==="hidden")return e=Nn(t,s),t.lanes=536870912,Or(null,e);if(hl(t),(e=Ve)?(e=vd(e,Vt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi!==null?{id:ri,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,gt=t,Ve=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return Nn(t,s)}var d=e.memoizedState;if(d!==null){var E=d.dehydrated;if(hl(t),a)if(t.flags&256)t.flags&=-257,t=su(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(j(558));else if(ot||Us(e,t,i,!1),a=(i&e.childLanes)!==0,ot||a){if(s=Ye,s!==null&&(E=Yo(s,i),E!==0&&E!==d.retryLane))throw d.retryLane=E,ls(e,E),Mt(s,e,E),Ml;Yn(),t=su(e,t,i)}else e=d.treeContext,Ve=Qt(E.nextSibling),gt=t,ze=!0,Bi=null,Vt=!1,e!==null&&qc(t,e),t=Nn(t,s),t.flags|=4096;return t}return e=fi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hn(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(j(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Bl(e,t,i,s,a){return us(t),i=dl(e,t,i,s,void 0,a),s=fl(),e!==null&&!ot?(_l(e,t,a),Si(e,t,a)):(ze&&s&&Ya(t),t.flags|=1,pt(e,t,i,a),t.child)}function ru(e,t,i,s,a,d){return us(t),t.updateQueue=null,i=lh(t,s,i,a),ah(e),s=fl(),e!==null&&!ot?(_l(e,t,d),Si(e,t,d)):(ze&&s&&Ya(t),t.flags|=1,pt(e,t,i,d),t.child)}function nu(e,t,i,s,a){if(us(t),t.stateNode===null){var d=zs,E=i.contextType;typeof E=="object"&&E!==null&&(d=mt(E)),d=new i(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Dl,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},rl(t),E=i.contextType,d.context=typeof E=="object"&&E!==null?mt(E):zs,d.state=t.memoizedState,E=i.getDerivedStateFromProps,typeof E=="function"&&(Rl(t,i,E,s),d.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(E=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),E!==d.state&&Dl.enqueueReplaceState(d,d.state,null),Rr(t,s,d,a),Ar(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var O=t.memoizedProps,W=ms(i,O);d.props=W;var te=d.context,le=i.contextType;E=zs,typeof le=="object"&&le!==null&&(E=mt(le));var ce=i.getDerivedStateFromProps;le=typeof ce=="function"||typeof d.getSnapshotBeforeUpdate=="function",O=t.pendingProps!==O,le||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(O||te!==E)&&$h(t,d,s,E),zi=!1;var ie=t.memoizedState;d.state=ie,Rr(t,s,d,a),Ar(),te=t.memoizedState,O||ie!==te||zi?(typeof ce=="function"&&(Rl(t,i,ce,s),te=t.memoizedState),(W=zi||Wh(t,i,W,s,ie,te,E))?(le||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=te),d.props=s,d.state=te,d.context=E,s=W):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,nl(e,t),E=t.memoizedProps,le=ms(i,E),d.props=le,ce=t.pendingProps,ie=d.context,te=i.contextType,W=zs,typeof te=="object"&&te!==null&&(W=mt(te)),O=i.getDerivedStateFromProps,(te=typeof O=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(E!==ce||ie!==W)&&$h(t,d,s,W),zi=!1,ie=t.memoizedState,d.state=ie,Rr(t,s,d,a),Ar();var ae=t.memoizedState;E!==ce||ie!==ae||zi||e!==null&&e.dependencies!==null&&pn(e.dependencies)?(typeof O=="function"&&(Rl(t,i,O,s),ae=t.memoizedState),(le=zi||Wh(t,i,le,s,ie,ae,W)||e!==null&&e.dependencies!==null&&pn(e.dependencies))?(te||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,ae,W),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,ae,W)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||E===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||E===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ae),d.props=s,d.state=ae,d.context=W,s=le):(typeof d.componentDidUpdate!="function"||E===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||E===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Hn(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=vs(t,e.child,null,a),t.child=vs(t,null,i,a)):pt(e,t,i,a),t.memoizedState=d.state,e=t.child):e=Si(e,t,a),e}function au(e,t,i,s){return cs(),t.flags|=256,pt(e,t,i,s),t.child}var Ol={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kl(e){return{baseLanes:e,cachePool:Vc()}}function zl(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ut),e}function lu(e,t,i){var s=t.pendingProps,a=!1,d=(t.flags&128)!==0,E;if((E=d)||(E=e!==null&&e.memoizedState===null?!1:(st.current&2)!==0),E&&(a=!0,t.flags&=-129),E=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(a?ji(t):Ui(),(e=Ve)?(e=vd(e,Vt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi!==null?{id:ri,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,gt=t,Ve=null)):e=null,e===null)throw Oi(t);return po(e)?t.lanes=32:t.lanes=536870912,null}var O=s.children;return s=s.fallback,a?(Ui(),a=t.mode,O=jn({mode:"hidden",children:O},a),s=os(s,a,i,null),O.return=t,s.return=t,O.sibling=s,t.child=O,s=t.child,s.memoizedState=kl(i),s.childLanes=zl(e,E,i),t.memoizedState=Ol,Or(null,s)):(ji(t),Nl(t,O))}var W=e.memoizedState;if(W!==null&&(O=W.dehydrated,O!==null)){if(d)t.flags&256?(ji(t),t.flags&=-257,t=Hl(e,t,i)):t.memoizedState!==null?(Ui(),t.child=e.child,t.flags|=128,t=null):(Ui(),O=s.fallback,a=t.mode,s=jn({mode:"visible",children:s.children},a),O=os(O,a,i,null),O.flags|=2,s.return=t,O.return=t,s.sibling=O,t.child=s,vs(t,e.child,null,i),s=t.child,s.memoizedState=kl(i),s.childLanes=zl(e,E,i),t.memoizedState=Ol,t=Or(null,s));else if(ji(t),po(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var te=E.dgst;E=te,s=Error(j(419)),s.stack="",s.digest=E,yr({value:s,source:null,stack:null}),t=Hl(e,t,i)}else if(ot||Us(e,t,i,!1),E=(i&e.childLanes)!==0,ot||E){if(E=Ye,E!==null&&(s=Yo(E,i),s!==0&&s!==W.retryLane))throw W.retryLane=s,ls(e,s),Mt(E,e,s),Ml;mo(O)||Yn(),t=Hl(e,t,i)}else mo(O)?(t.flags|=192,t.child=e.child,t=null):(e=W.treeContext,Ve=Qt(O.nextSibling),gt=t,ze=!0,Bi=null,Vt=!1,e!==null&&qc(t,e),t=Nl(t,s.children),t.flags|=4096);return t}return a?(Ui(),O=s.fallback,a=t.mode,W=e.child,te=W.sibling,s=fi(W,{mode:"hidden",children:s.children}),s.subtreeFlags=W.subtreeFlags&65011712,te!==null?O=fi(te,O):(O=os(O,a,i,null),O.flags|=2),O.return=t,s.return=t,s.sibling=O,t.child=s,Or(null,s),s=t.child,O=e.child.memoizedState,O===null?O=kl(i):(a=O.cachePool,a!==null?(W=at._currentValue,a=a.parent!==W?{parent:W,pool:W}:a):a=Vc(),O={baseLanes:O.baseLanes|i,cachePool:a}),s.memoizedState=O,s.childLanes=zl(e,E,i),t.memoizedState=Ol,Or(e.child,s)):(ji(t),i=e.child,e=i.sibling,i=fi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(E=t.deletions,E===null?(t.deletions=[e],t.flags|=16):E.push(e)),t.child=i,t.memoizedState=null,i)}function Nl(e,t){return t=jn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function jn(e,t){return e=zt(22,e,null,t),e.lanes=0,e}function Hl(e,t,i){return vs(t,e.child,null,i),e=Nl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ou(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Za(e.return,t,i)}function jl(e,t,i,s,a,d){var E=e.memoizedState;E===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:a,treeForkCount:d}:(E.isBackwards=t,E.rendering=null,E.renderingStartTime=0,E.last=s,E.tail=i,E.tailMode=a,E.treeForkCount=d)}function cu(e,t,i){var s=t.pendingProps,a=s.revealOrder,d=s.tail;s=s.children;var E=st.current,O=(E&2)!==0;if(O?(E=E&1|2,t.flags|=128):E&=1,V(st,E),pt(e,t,s,i),s=ze?br:0,!O&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ou(e,i,t);else if(e.tag===19)ou(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(a){case"forwards":for(i=t.child,a=null;i!==null;)e=i.alternate,e!==null&&Ln(e)===null&&(a=i),i=i.sibling;i=a,i===null?(a=t.child,t.child=null):(a=i.sibling,i.sibling=null),jl(t,!1,a,i,d,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ln(e)===null){t.child=a;break}e=a.sibling,a.sibling=i,i=a,a=e}jl(t,!0,i,null,d,s);break;case"together":jl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Si(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Fi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Us(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(j(153));if(t.child!==null){for(e=t.child,i=fi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=fi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Ul(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&pn(e)))}function w_(e,t,i){switch(t.tag){case 3:N(t,t.stateNode.containerInfo),ki(t,at,e.memoizedState.cache),cs();break;case 27:case 5:re(t);break;case 4:N(t,t.stateNode.containerInfo);break;case 10:ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hl(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ji(t),t.flags|=128,null):(i&t.child.childLanes)!==0?lu(e,t,i):(ji(t),e=Si(e,t,i),e!==null?e.sibling:null);ji(t);break;case 19:var a=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Us(e,t,i,!1),s=(i&t.childLanes)!==0),a){if(s)return cu(e,t,i);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),V(st,st.current),s)break;return null;case 22:return t.lanes=0,tu(e,t,i,t.pendingProps);case 24:ki(t,at,e.memoizedState.cache)}return Si(e,t,i)}function hu(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ot=!0;else{if(!Ul(e,i)&&(t.flags&128)===0)return ot=!1,w_(e,t,i);ot=(e.flags&131072)!==0}else ot=!1,ze&&(t.flags&1048576)!==0&&Fc(t,br,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=fs(t.elementType),t.type=e,typeof e=="function")Wa(e)?(s=ms(e,s),t.tag=1,t=nu(null,t,e,s,i)):(t.tag=0,t=Bl(null,t,e,s,i));else{if(e!=null){var a=e.$$typeof;if(a===m){t.tag=11,t=Zh(null,t,e,s,i);break e}else if(a===w){t.tag=14,t=Jh(null,t,e,s,i);break e}}throw t=U(e)||e,Error(j(306,t,""))}}return t;case 0:return Bl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,a=ms(s,t.pendingProps),nu(e,t,s,a,i);case 3:e:{if(N(t,t.stateNode.containerInfo),e===null)throw Error(j(387));s=t.pendingProps;var d=t.memoizedState;a=d.element,nl(e,t),Rr(t,s,null,i);var E=t.memoizedState;if(s=E.cache,ki(t,at,s),s!==d.cache&&Ja(t,[at],i,!0),Ar(),s=E.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:E.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=au(e,t,s,i);break e}else if(s!==a){a=Gt(Error(j(424)),t),yr(a),t=au(e,t,s,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ve=Qt(e.firstChild),gt=t,ze=!0,Bi=null,Vt=!0,i=th(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(cs(),s===a){t=Si(e,t,i);break e}pt(e,t,s,i)}t=t.child}return t;case 26:return Hn(e,t),e===null?(i=yd(t.type,null,t.pendingProps,null))?t.memoizedState=i:ze||(i=t.type,e=t.pendingProps,s=ea(ue.current).createElement(i),s[vt]=t,s[Et]=e,St(s,i,e),ft(s),t.stateNode=s):t.memoizedState=yd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return re(t),e===null&&ze&&(s=t.stateNode=pd(t.type,t.pendingProps,ue.current),gt=t,Vt=!0,a=Ve,Yi(t.type)?(So=a,Ve=Qt(s.firstChild)):Ve=a),pt(e,t,t.pendingProps.children,i),Hn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((a=s=Ve)&&(s=ev(s,t.type,t.pendingProps,Vt),s!==null?(t.stateNode=s,gt=t,Ve=Qt(s.firstChild),Vt=!1,a=!0):a=!1),a||Oi(t)),re(t),a=t.type,d=t.pendingProps,E=e!==null?e.memoizedProps:null,s=d.children,_o(a,d)?s=null:E!==null&&_o(a,E)&&(t.flags|=32),t.memoizedState!==null&&(a=dl(e,t,v_,null,null,i),Xr._currentValue=a),Hn(e,t),pt(e,t,s,i),t.child;case 6:return e===null&&ze&&((e=i=Ve)&&(i=tv(i,t.pendingProps,Vt),i!==null?(t.stateNode=i,gt=t,Ve=null,e=!0):e=!1),e||Oi(t)),null;case 13:return lu(e,t,i);case 4:return N(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=vs(t,null,s,i):pt(e,t,s,i),t.child;case 11:return Zh(e,t,t.type,t.pendingProps,i);case 7:return pt(e,t,t.pendingProps,i),t.child;case 8:return pt(e,t,t.pendingProps.children,i),t.child;case 12:return pt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,ki(t,t.type,s.value),pt(e,t,s.children,i),t.child;case 9:return a=t.type._context,s=t.pendingProps.children,us(t),a=mt(a),s=s(a),t.flags|=1,pt(e,t,s,i),t.child;case 14:return Jh(e,t,t.type,t.pendingProps,i);case 15:return eu(e,t,t.type,t.pendingProps,i);case 19:return cu(e,t,i);case 31:return x_(e,t,i);case 22:return tu(e,t,i,t.pendingProps);case 24:return us(t),s=mt(at),e===null?(a=il(),a===null&&(a=Ye,d=el(),a.pooledCache=d,d.refCount++,d!==null&&(a.pooledCacheLanes|=i),a=d),t.memoizedState={parent:s,cache:a},rl(t),ki(t,at,a)):((e.lanes&i)!==0&&(nl(e,t),Rr(t,null,null,i),Ar()),a=e.memoizedState,d=t.memoizedState,a.parent!==s?(a={parent:s,cache:s},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ki(t,at,s)):(s=d.cache,ki(t,at,s),s!==a.cache&&Ja(t,[at],i,!0))),pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(j(156,t.tag))}function bi(e){e.flags|=4}function Il(e,t,i,s,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Hu())e.flags|=8192;else throw _s=Cn,sl}else e.flags&=-16777217}function uu(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ld(t))if(Hu())e.flags|=8192;else throw _s=Cn,sl}function Un(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wo():536870912,e.lanes|=t,Qs|=t)}function kr(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var 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}}function Ke(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var a=e.child;a!==null;)i|=a.lanes|a.childLanes,s|=a.subtreeFlags&65011712,s|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)i|=a.lanes|a.childLanes,s|=a.subtreeFlags,s|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function E_(e,t,i){var s=t.pendingProps;switch(Xa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(t),null;case 1:return Ke(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),gi(at),ne(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(js(t)?bi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ka())),Ke(t),null;case 26:var a=t.type,d=t.memoizedState;return e===null?(bi(t),d!==null?(Ke(t),uu(t,d)):(Ke(t),Il(t,a,null,s,i))):d?d!==e.memoizedState?(bi(t),Ke(t),uu(t,d)):(Ke(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&bi(t),Ke(t),Il(t,a,e,s,i)),null;case 27:if(_e(t),i=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&bi(t);else{if(!s){if(t.stateNode===null)throw Error(j(166));return Ke(t),null}e=Z.current,js(t)?Wc(t):(e=pd(a,s,i),t.stateNode=e,bi(t))}return Ke(t),null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&bi(t);else{if(!s){if(t.stateNode===null)throw Error(j(166));return Ke(t),null}if(d=Z.current,js(t))Wc(t);else{var E=ea(ue.current);switch(d){case 1:d=E.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:d=E.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":d=E.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":d=E.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":d=E.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?E.createElement("select",{is:s.is}):E.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?E.createElement(a,{is:s.is}):E.createElement(a)}}d[vt]=t,d[Et]=s;e:for(E=t.child;E!==null;){if(E.tag===5||E.tag===6)d.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&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}t.stateNode=d;e:switch(St(d,a,s),a){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&bi(t)}}return Ke(t),Il(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&bi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(j(166));if(e=ue.current,js(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,a=gt,a!==null)switch(a.tag){case 27:case 5:s=a.memoizedProps}e[vt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||ld(e.nodeValue,i)),e||Oi(t,!0)}else e=ea(e).createTextNode(s),e[vt]=t,t.stateNode=e}return Ke(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=js(t),i!==null){if(e===null){if(!s)throw Error(j(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(557));e[vt]=t}else cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ke(t),e=!1}else i=Ka(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Ht(t),t):(Ht(t),null);if((t.flags&128)!==0)throw Error(j(558))}return Ke(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=js(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(j(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(j(317));a[vt]=t}else cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ke(t),a=!1}else a=Ka(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ht(t),t):(Ht(t),null)}return Ht(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,a=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(a=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==a&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Un(t,t.updateQueue),Ke(t),null);case 4:return ne(),e===null&&oo(t.stateNode.containerInfo),Ke(t),null;case 10:return gi(t.type),Ke(t),null;case 19:if(z(st),s=t.memoizedState,s===null)return Ke(t),null;if(a=(t.flags&128)!==0,d=s.rendering,d===null)if(a)kr(s,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Ln(e),d!==null){for(t.flags|=128,kr(s,!1),e=d.updateQueue,t.updateQueue=e,Un(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Uc(i,e),i=i.sibling;return V(st,st.current&1|2),ze&&_i(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ce()>Wn&&(t.flags|=128,a=!0,kr(s,!1),t.lanes=4194304)}else{if(!a)if(e=Ln(d),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Un(t,e),kr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!ze)return Ke(t),null}else 2*Ce()-s.renderingStartTime>Wn&&i!==536870912&&(t.flags|=128,a=!0,kr(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ce(),e.sibling=null,i=st.current,V(st,a?i&1|2:i&1),ze&&_i(t,s.treeForkCount),e):(Ke(t),null);case 22:case 23:return Ht(t),cl(),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&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),i=t.updateQueue,i!==null&&Un(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&&z(ds),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),gi(at),Ke(t),null;case 25:return null;case 30:return null}throw Error(j(156,t.tag))}function L_(e,t){switch(Xa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gi(at),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(Ht(t),t.alternate===null)throw Error(j(340));cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ht(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(st),null;case 4:return ne(),null;case 10:return gi(t.type),null;case 22:case 23:return Ht(t),cl(),e!==null&&z(ds),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return gi(at),null;case 25:return null;default:return null}}function du(e,t){switch(Xa(t),t.tag){case 3:gi(at),ne();break;case 26:case 27:case 5:_e(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&Ht(t);break;case 13:Ht(t);break;case 19:z(st);break;case 10:gi(t.type);break;case 22:case 23:Ht(t),cl(),e!==null&&z(ds);break;case 24:gi(at)}}function zr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var a=s.next;i=a;do{if((i.tag&e)===e){s=void 0;var d=i.create,E=i.inst;s=d(),E.destroy=s}i=i.next}while(i!==a)}}catch(O){Pe(t,t.return,O)}}function Ii(e,t,i){try{var s=t.updateQueue,a=s!==null?s.lastEffect:null;if(a!==null){var d=a.next;s=d;do{if((s.tag&e)===e){var E=s.inst,O=E.destroy;if(O!==void 0){E.destroy=void 0,a=t;var W=i,te=O;try{te()}catch(le){Pe(a,W,le)}}}s=s.next}while(s!==d)}}catch(le){Pe(t,t.return,le)}}function fu(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{sh(t,i)}catch(s){Pe(e,e.return,s)}}}function _u(e,t,i){i.props=ms(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Pe(e,t,s)}}function Nr(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:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(a){Pe(e,t,a)}}function ai(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(a){Pe(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(a){Pe(e,t,a)}else i.current=null}function vu(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(a){Pe(e,e.return,a)}}function Pl(e,t,i){try{var s=e.stateNode;X_(s,e.type,i,t),s[Et]=t}catch(a){Pe(e,e.return,a)}}function gu(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yi(e.type)||e.tag===4}function Fl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gu(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&&Yi(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 ql(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ui));else if(s!==4&&(s===27&&Yi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(ql(e,t,i),e=e.sibling;e!==null;)ql(e,t,i),e=e.sibling}function In(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Yi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(In(e,t,i),e=e.sibling;e!==null;)In(e,t,i),e=e.sibling}function mu(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);St(t,s,i),t[vt]=e,t[Et]=i}catch(d){Pe(e,e.return,d)}}var yi=!1,ct=!1,Wl=!1,pu=typeof WeakSet=="function"?WeakSet:Set,_t=null;function A_(e,t){if(e=e.containerInfo,uo=la,e=Tc(e),Ha(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var a=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var E=0,O=-1,W=-1,te=0,le=0,ce=e,ie=null;t:for(;;){for(var ae;ce!==i||a!==0&&ce.nodeType!==3||(O=E+a),ce!==d||s!==0&&ce.nodeType!==3||(W=E+s),ce.nodeType===3&&(E+=ce.nodeValue.length),(ae=ce.firstChild)!==null;)ie=ce,ce=ae;for(;;){if(ce===e)break t;if(ie===i&&++te===a&&(O=E),ie===d&&++le===s&&(W=E),(ae=ce.nextSibling)!==null)break;ce=ie,ie=ce.parentNode}ce=ae}i=O===-1||W===-1?null:{start:O,end:W}}else i=null}i=i||{start:0,end:0}}else i=null;for(fo={focusedElem:e,selectionRange:i},la=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)a=e[i],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,i=t,a=d.memoizedProps,d=d.memoizedState,s=i.stateNode;try{var ge=ms(i.type,a);e=s.getSnapshotBeforeUpdate(ge,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(ye){Pe(i,i.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)go(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":go(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(j(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function Su(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:xi(e,i),s&4&&zr(5,i);break;case 1:if(xi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(E){Pe(i,i.return,E)}else{var a=ms(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(E){Pe(i,i.return,E)}}s&64&&fu(i),s&512&&Nr(i,i.return);break;case 3:if(xi(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{sh(e,t)}catch(E){Pe(i,i.return,E)}}break;case 27:t===null&&s&4&&mu(i);case 26:case 5:xi(e,i),t===null&&s&4&&vu(i),s&512&&Nr(i,i.return);break;case 12:xi(e,i);break;case 31:xi(e,i),s&4&&Cu(e,i);break;case 13:xi(e,i),s&4&&xu(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=N_.bind(null,i),iv(e,i))));break;case 22:if(s=i.memoizedState!==null||yi,!s){t=t!==null&&t.memoizedState!==null||ct,a=yi;var d=ct;yi=s,(ct=t)&&!d?wi(e,i,(i.subtreeFlags&8772)!==0):xi(e,i),yi=a,ct=d}break;case 30:break;default:xi(e,i)}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ba(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 Je=null,At=!1;function Ci(e,t,i){for(i=i.child;i!==null;)yu(e,t,i),i=i.sibling}function yu(e,t,i){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Jt,i)}catch{}switch(i.tag){case 26:ct||ai(i,t),Ci(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ct||ai(i,t);var s=Je,a=At;Yi(i.type)&&(Je=i.stateNode,At=!1),Ci(e,t,i),$r(i.stateNode),Je=s,At=a;break;case 5:ct||ai(i,t);case 6:if(s=Je,a=At,Je=null,Ci(e,t,i),Je=s,At=a,Je!==null)if(At)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(i.stateNode)}catch(d){Pe(i,t,d)}else try{Je.removeChild(i.stateNode)}catch(d){Pe(i,t,d)}break;case 18:Je!==null&&(At?(e=Je,fd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),nr(e)):fd(Je,i.stateNode));break;case 4:s=Je,a=At,Je=i.stateNode.containerInfo,At=!0,Ci(e,t,i),Je=s,At=a;break;case 0:case 11:case 14:case 15:Ii(2,i,t),ct||Ii(4,i,t),Ci(e,t,i);break;case 1:ct||(ai(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&_u(i,t,s)),Ci(e,t,i);break;case 21:Ci(e,t,i);break;case 22:ct=(s=ct)||i.memoizedState!==null,Ci(e,t,i),ct=s;break;default:Ci(e,t,i)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{nr(e)}catch(i){Pe(t,t.return,i)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{nr(e)}catch(i){Pe(t,t.return,i)}}function R_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(j(435,e.tag))}}function Pn(e,t){var i=R_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var a=H_.bind(null,e,s);s.then(a,a)}})}function Rt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var a=i[s],d=e,E=t,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(Yi(O.type)){Je=O.stateNode,At=!1;break e}break;case 5:Je=O.stateNode,At=!1;break e;case 3:case 4:Je=O.stateNode.containerInfo,At=!0;break e}O=O.return}if(Je===null)throw Error(j(160));yu(d,E,a),Je=null,At=!1,d=a.alternate,d!==null&&(d.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e),t=t.sibling}var ti=null;function wu(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(t,e),Dt(e),s&4&&(Ii(3,e,e.return),zr(3,e),Ii(5,e,e.return));break;case 1:Rt(t,e),Dt(e),s&512&&(ct||i===null||ai(i,i.return)),s&64&&yi&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var a=ti;if(Rt(t,e),Dt(e),s&512&&(ct||i===null||ai(i,i.return)),s&4){var d=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,a=a.ownerDocument||a;t:switch(s){case"title":d=a.getElementsByTagName("title")[0],(!d||d[cr]||d[vt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=a.createElement(s),a.head.insertBefore(d,a.querySelector("head > title"))),St(d,s,i),d[vt]=e,ft(d),s=d;break e;case"link":var E=wd("link","href",a).get(s+(i.href||""));if(E){for(var O=0;O<E.length;O++)if(d=E[O],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){E.splice(O,1);break t}}d=a.createElement(s),St(d,s,i),a.head.appendChild(d);break;case"meta":if(E=wd("meta","content",a).get(s+(i.content||""))){for(O=0;O<E.length;O++)if(d=E[O],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){E.splice(O,1);break t}}d=a.createElement(s),St(d,s,i),a.head.appendChild(d);break;default:throw Error(j(468,s))}d[vt]=e,ft(d),s=d}e.stateNode=s}else Ed(a,e.type,e.stateNode);else e.stateNode=xd(a,s,e.memoizedProps);else d!==s?(d===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):d.count--,s===null?Ed(a,e.type,e.stateNode):xd(a,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,i.memoizedProps)}break;case 27:Rt(t,e),Dt(e),s&512&&(ct||i===null||ai(i,i.return)),i!==null&&s&4&&Pl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Rt(t,e),Dt(e),s&512&&(ct||i===null||ai(i,i.return)),e.flags&32){a=e.stateNode;try{Rs(a,"")}catch(ge){Pe(e,e.return,ge)}}s&4&&e.stateNode!=null&&(a=e.memoizedProps,Pl(e,a,i!==null?i.memoizedProps:a)),s&1024&&(Wl=!0);break;case 6:if(Rt(t,e),Dt(e),s&4){if(e.stateNode===null)throw Error(j(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(ge){Pe(e,e.return,ge)}}break;case 3:if(sa=null,a=ti,ti=ta(t.containerInfo),Rt(t,e),ti=a,Dt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{nr(t.containerInfo)}catch(ge){Pe(e,e.return,ge)}Wl&&(Wl=!1,Eu(e));break;case 4:s=ti,ti=ta(e.stateNode.containerInfo),Rt(t,e),Dt(e),ti=s;break;case 12:Rt(t,e),Dt(e);break;case 31:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Pn(e,s)));break;case 13:Rt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(qn=Ce()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Pn(e,s)));break;case 22:a=e.memoizedState!==null;var W=i!==null&&i.memoizedState!==null,te=yi,le=ct;if(yi=te||a,ct=le||W,Rt(t,e),ct=le,yi=te,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(i===null||W||yi||ct||ps(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){W=i=t;try{if(d=W.stateNode,a)E=d.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=W.stateNode;var ce=W.memoizedProps.style,ie=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;O.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ge){Pe(W,W.return,ge)}}}else if(t.tag===6){if(i===null){W=t;try{W.stateNode.nodeValue=a?"":W.memoizedProps}catch(ge){Pe(W,W.return,ge)}}}else if(t.tag===18){if(i===null){W=t;try{var ae=W.stateNode;a?_d(ae,!0):_d(W.stateNode,!1)}catch(ge){Pe(W,W.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,Pn(e,i))));break;case 19:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Pn(e,s)));break;case 30:break;case 21:break;default:Rt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(gu(s)){i=s;break}s=s.return}if(i==null)throw Error(j(160));switch(i.tag){case 27:var a=i.stateNode,d=Fl(e);In(e,d,a);break;case 5:var E=i.stateNode;i.flags&32&&(Rs(E,""),i.flags&=-33);var O=Fl(e);In(e,O,E);break;case 3:case 4:var W=i.stateNode.containerInfo,te=Fl(e);ql(e,te,W);break;default:throw Error(j(161))}}catch(le){Pe(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eu(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Su(e,t.alternate,t),t=t.sibling}function ps(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ii(4,t,t.return),ps(t);break;case 1:ai(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&_u(t,t.return,i),ps(t);break;case 27:$r(t.stateNode);case 26:case 5:ai(t,t.return),ps(t);break;case 22:t.memoizedState===null&&ps(t);break;case 30:ps(t);break;default:ps(t)}e=e.sibling}}function wi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,a=e,d=t,E=d.flags;switch(d.tag){case 0:case 11:case 15:wi(a,d,i),zr(4,d);break;case 1:if(wi(a,d,i),s=d,a=s.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(te){Pe(s,s.return,te)}if(s=d,a=s.updateQueue,a!==null){var O=s.stateNode;try{var W=a.shared.hiddenCallbacks;if(W!==null)for(a.shared.hiddenCallbacks=null,a=0;a<W.length;a++)ih(W[a],O)}catch(te){Pe(s,s.return,te)}}i&&E&64&&fu(d),Nr(d,d.return);break;case 27:mu(d);case 26:case 5:wi(a,d,i),i&&s===null&&E&4&&vu(d),Nr(d,d.return);break;case 12:wi(a,d,i);break;case 31:wi(a,d,i),i&&E&4&&Cu(a,d);break;case 13:wi(a,d,i),i&&E&4&&xu(a,d);break;case 22:d.memoizedState===null&&wi(a,d,i),Nr(d,d.return);break;case 30:break;default:wi(a,d,i)}t=t.sibling}}function $l(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&&Cr(i))}function Gl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cr(e))}function ii(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lu(e,t,i,s),t=t.sibling}function Lu(e,t,i,s){var a=t.flags;switch(t.tag){case 0:case 11:case 15:ii(e,t,i,s),a&2048&&zr(9,t);break;case 1:ii(e,t,i,s);break;case 3:ii(e,t,i,s),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cr(e)));break;case 12:if(a&2048){ii(e,t,i,s),e=t.stateNode;try{var d=t.memoizedProps,E=d.id,O=d.onPostCommit;typeof O=="function"&&O(E,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(W){Pe(t,t.return,W)}}else ii(e,t,i,s);break;case 31:ii(e,t,i,s);break;case 13:ii(e,t,i,s);break;case 23:break;case 22:d=t.stateNode,E=t.alternate,t.memoizedState!==null?d._visibility&2?ii(e,t,i,s):Hr(e,t):d._visibility&2?ii(e,t,i,s):(d._visibility|=2,Xs(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),a&2048&&$l(E,t);break;case 24:ii(e,t,i,s),a&2048&&Gl(t.alternate,t);break;default:ii(e,t,i,s)}}function Xs(e,t,i,s,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,E=t,O=i,W=s,te=E.flags;switch(E.tag){case 0:case 11:case 15:Xs(d,E,O,W,a),zr(8,E);break;case 23:break;case 22:var le=E.stateNode;E.memoizedState!==null?le._visibility&2?Xs(d,E,O,W,a):Hr(d,E):(le._visibility|=2,Xs(d,E,O,W,a)),a&&te&2048&&$l(E.alternate,E);break;case 24:Xs(d,E,O,W,a),a&&te&2048&&Gl(E.alternate,E);break;default:Xs(d,E,O,W,a)}t=t.sibling}}function Hr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,a=s.flags;switch(s.tag){case 22:Hr(i,s),a&2048&&$l(s.alternate,s);break;case 24:Hr(i,s),a&2048&&Gl(s.alternate,s);break;default:Hr(i,s)}t=t.sibling}}var jr=8192;function Vs(e,t,i){if(e.subtreeFlags&jr)for(e=e.child;e!==null;)Au(e,t,i),e=e.sibling}function Au(e,t,i){switch(e.tag){case 26:Vs(e,t,i),e.flags&jr&&e.memoizedState!==null&&_v(i,ti,e.memoizedState,e.memoizedProps);break;case 5:Vs(e,t,i);break;case 3:case 4:var s=ti;ti=ta(e.stateNode.containerInfo),Vs(e,t,i),ti=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=jr,jr=16777216,Vs(e,t,i),jr=s):Vs(e,t,i));break;default:Vs(e,t,i)}}function Ru(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 Ur(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];_t=s,Tu(s,e)}Ru(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Du(e),e=e.sibling}function Du(e){switch(e.tag){case 0:case 11:case 15:Ur(e),e.flags&2048&&Ii(9,e,e.return);break;case 3:Ur(e);break;case 12:Ur(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fn(e)):Ur(e);break;default:Ur(e)}}function Fn(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];_t=s,Tu(s,e)}Ru(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ii(8,t,t.return),Fn(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Fn(t));break;default:Fn(t)}e=e.sibling}}function Tu(e,t){for(;_t!==null;){var i=_t;switch(i.tag){case 0:case 11:case 15:Ii(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:Cr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,_t=s;else e:for(i=e;_t!==null;){s=_t;var a=s.sibling,d=s.return;if(bu(s),s===i){_t=null;break e}if(a!==null){a.return=d,_t=a;break e}_t=d}}}var D_={getCacheForType:function(e){var t=mt(at),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return mt(at).controller.signal}},T_=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ye=null,Te=null,Oe=0,Ie=0,jt=null,Pi=!1,Ks=!1,Yl=!1,Ei=0,it=0,Fi=0,Ss=0,Xl=0,Ut=0,Qs=0,Ir=null,Tt=null,Vl=!1,qn=0,Mu=0,Wn=1/0,$n=null,qi=null,ut=0,Wi=null,Zs=null,Li=0,Kl=0,Ql=null,Bu=null,Pr=0,Zl=null;function It(){return(Ue&2)!==0&&Oe!==0?Oe&-Oe:I.T!==null?ro():Xo()}function Ou(){if(Ut===0)if((Oe&536870912)===0||ze){var e=ts;ts<<=1,(ts&3932160)===0&&(ts=262144),Ut=e}else Ut=536870912;return e=Nt.current,e!==null&&(e.flags|=32),Ut}function Mt(e,t,i){(e===Ye&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(Js(e,0),$i(e,Oe,Ut,!1)),or(e,i),((Ue&2)===0||e!==Ye)&&(e===Ye&&((Ue&2)===0&&(Ss|=i),it===4&&$i(e,Oe,Ut,!1)),li(e))}function ku(e,t,i){if((Ue&6)!==0)throw Error(j(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||lr(e,t),a=s?O_(e,t):eo(e,t,!0),d=s;do{if(a===0){Ks&&!s&&$i(e,t,0,!1);break}else{if(i=e.current.alternate,d&&!M_(i)){a=eo(e,t,!1),d=!1;continue}if(a===2){if(d=t,e.errorRecoveryDisabledLanes&d)var E=0;else E=e.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){t=E;e:{var O=e;a=Ir;var W=O.current.memoizedState.isDehydrated;if(W&&(Js(O,E).flags|=256),E=eo(O,E,!1),E!==2){if(Yl&&!W){O.errorRecoveryDisabledLanes|=d,Ss|=d,a=4;break e}d=Tt,Tt=a,d!==null&&(Tt===null?Tt=d:Tt.push.apply(Tt,d))}a=E}if(d=!1,a!==2)continue}}if(a===1){Js(e,0),$i(e,t,0,!0);break}e:{switch(s=e,d=a,d){case 0:case 1:throw Error(j(345));case 4:if((t&4194048)!==t)break;case 6:$i(s,t,Ut,!Pi);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(j(329))}if((t&62914560)===t&&(a=qn+300-Ce(),10<a)){if($i(s,t,Ut,!Pi),en(s,0,!0)!==0)break e;Li=t,s.timeoutHandle=ud(zu.bind(null,s,i,Tt,$n,Vl,t,Ut,Ss,Qs,Pi,d,"Throttled",-0,0),a);break e}zu(s,i,Tt,$n,Vl,t,Ut,Ss,Qs,Pi,d,null,-0,0)}}break}while(!0);li(e)}function zu(e,t,i,s,a,d,E,O,W,te,le,ce,ie,ae){if(e.timeoutHandle=-1,ce=t.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ui},Au(t,d,ce);var ge=(d&62914560)===d?qn-Ce():(d&4194048)===d?Mu-Ce():0;if(ge=vv(ce,ge),ge!==null){Li=d,e.cancelPendingCommit=ge(qu.bind(null,e,t,d,i,s,a,E,O,W,le,ce,null,ie,ae)),$i(e,d,E,!te);return}}qu(e,t,d,i,s,a,E,O,W)}function M_(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 a=i[s],d=a.getSnapshot;a=a.value;try{if(!kt(d(),a))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 $i(e,t,i,s){t&=~Xl,t&=~Ss,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var a=t;0<a;){var d=31-bt(a),E=1<<d;s[d]=-1,a&=~E}i!==0&&$o(e,i,t)}function Gn(){return(Ue&6)===0?(Fr(0),!1):!0}function Jl(){if(Te!==null){if(Ie===0)var e=Te.return;else e=Te,vi=hs=null,vl(e),qs=null,wr=0,e=Te;for(;e!==null;)du(e.alternate,e),e=e.return;Te=null}}function Js(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Q_(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Li=0,Jl(),Ye=e,Te=i=fi(e.current,null),Oe=t,Ie=0,jt=null,Pi=!1,Ks=lr(e,t),Yl=!1,Qs=Ut=Xl=Ss=Fi=it=0,Tt=Ir=null,Vl=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var a=31-bt(s),d=1<<a;t|=e[a],s&=~d}return Ei=t,fn(),i}function Nu(e,t){Ee=null,I.H=Br,t===Fs||t===yn?(t=Zc(),Ie=3):t===sl?(t=Zc(),Ie=4):Ie=t===Ml?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jt=t,Te===null&&(it=1,zn(e,Gt(t,e.current)))}function Hu(){var e=Nt.current;return e===null?!0:(Oe&4194048)===Oe?Kt===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===Kt:!1}function ju(){var e=I.H;return I.H=Br,e===null?Br:e}function Uu(){var e=I.A;return I.A=D_,e}function Yn(){it=4,Pi||(Oe&4194048)!==Oe&&Nt.current!==null||(Ks=!0),(Fi&134217727)===0&&(Ss&134217727)===0||Ye===null||$i(Ye,Oe,Ut,!1)}function eo(e,t,i){var s=Ue;Ue|=2;var a=ju(),d=Uu();(Ye!==e||Oe!==t)&&($n=null,Js(e,t)),t=!1;var E=it;e:do try{if(Ie!==0&&Te!==null){var O=Te,W=jt;switch(Ie){case 8:Jl(),E=6;break e;case 3:case 2:case 9:case 6:Nt.current===null&&(t=!0);var te=Ie;if(Ie=0,jt=null,er(e,O,W,te),i&&Ks){E=0;break e}break;default:te=Ie,Ie=0,jt=null,er(e,O,W,te)}}B_(),E=it;break}catch(le){Nu(e,le)}while(!0);return t&&e.shellSuspendCounter++,vi=hs=null,Ue=s,I.H=a,I.A=d,Te===null&&(Ye=null,Oe=0,fn()),E}function B_(){for(;Te!==null;)Iu(Te)}function O_(e,t){var i=Ue;Ue|=2;var s=ju(),a=Uu();Ye!==e||Oe!==t?($n=null,Wn=Ce()+500,Js(e,t)):Ks=lr(e,t);e:do try{if(Ie!==0&&Te!==null){t=Te;var d=jt;t:switch(Ie){case 1:Ie=0,jt=null,er(e,t,d,1);break;case 2:case 9:if(Kc(d)){Ie=0,jt=null,Pu(t);break}t=function(){Ie!==2&&Ie!==9||Ye!==e||(Ie=7),li(e)},d.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:Kc(d)?(Ie=0,jt=null,Pu(t)):(Ie=0,jt=null,er(e,t,d,7));break;case 5:var E=null;switch(Te.tag){case 26:E=Te.memoizedState;case 5:case 27:var O=Te;if(E?Ld(E):O.stateNode.complete){Ie=0,jt=null;var W=O.sibling;if(W!==null)Te=W;else{var te=O.return;te!==null?(Te=te,Xn(te)):Te=null}break t}}Ie=0,jt=null,er(e,t,d,5);break;case 6:Ie=0,jt=null,er(e,t,d,6);break;case 8:Jl(),it=6;break e;default:throw Error(j(462))}}k_();break}catch(le){Nu(e,le)}while(!0);return vi=hs=null,I.H=s,I.A=a,Ue=i,Te!==null?0:(Ye=null,Oe=0,fn(),it)}function k_(){for(;Te!==null&&!De();)Iu(Te)}function Iu(e){var t=hu(e.alternate,e,Ei);e.memoizedProps=e.pendingProps,t===null?Xn(e):Te=t}function Pu(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=ru(i,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=ru(i,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:vl(t);default:du(i,t),t=Te=Uc(t,Ei),t=hu(i,t,Ei)}e.memoizedProps=e.pendingProps,t===null?Xn(e):Te=t}function er(e,t,i,s){vi=hs=null,vl(t),qs=null,wr=0;var a=t.return;try{if(C_(e,a,t,i,Oe)){it=1,zn(e,Gt(i,e.current)),Te=null;return}}catch(d){if(a!==null)throw Te=a,d;it=1,zn(e,Gt(i,e.current)),Te=null;return}t.flags&32768?(ze||s===1?e=!0:Ks||(Oe&536870912)!==0?e=!1:(Pi=e=!0,(s===2||s===9||s===3||s===6)&&(s=Nt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Fu(t,e)):Xn(t)}function Xn(e){var t=e;do{if((t.flags&32768)!==0){Fu(t,Pi);return}e=t.return;var i=E_(t.alternate,t,Ei);if(i!==null){Te=i;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);it===0&&(it=5)}function Fu(e,t){do{var i=L_(e.alternate,e);if(i!==null){i.flags&=32767,Te=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Te=e;return}Te=e=i}while(e!==null);it=6,Te=null}function qu(e,t,i,s,a,d,E,O,W){e.cancelPendingCommit=null;do Vn();while(ut!==0);if((Ue&6)!==0)throw Error(j(327));if(t!==null){if(t===e.current)throw Error(j(177));if(d=t.lanes|t.childLanes,d|=Fa,ff(e,i,d,E,O,W),e===Ye&&(Te=Ye=null,Oe=0),Zs=t,Wi=e,Li=i,Kl=d,Ql=a,Bu=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,j_(ht,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=I.T,I.T=null,a=F.p,F.p=2,E=Ue,Ue|=4;try{A_(e,t,i)}finally{Ue=E,F.p=a,I.T=s}}ut=1,Wu(),$u(),Gu()}}function Wu(){if(ut===1){ut=0;var e=Wi,t=Zs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=I.T,I.T=null;var s=F.p;F.p=2;var a=Ue;Ue|=4;try{wu(t,e);var d=fo,E=Tc(e.containerInfo),O=d.focusedElem,W=d.selectionRange;if(E!==O&&O&&O.ownerDocument&&Dc(O.ownerDocument.documentElement,O)){if(W!==null&&Ha(O)){var te=W.start,le=W.end;if(le===void 0&&(le=te),"selectionStart"in O)O.selectionStart=te,O.selectionEnd=Math.min(le,O.value.length);else{var ce=O.ownerDocument||document,ie=ce&&ce.defaultView||window;if(ie.getSelection){var ae=ie.getSelection(),ge=O.textContent.length,ye=Math.min(W.start,ge),Ge=W.end===void 0?ye:Math.min(W.end,ge);!ae.extend&&ye>Ge&&(E=Ge,Ge=ye,ye=E);var Q=Rc(O,ye),X=Rc(O,Ge);if(Q&&X&&(ae.rangeCount!==1||ae.anchorNode!==Q.node||ae.anchorOffset!==Q.offset||ae.focusNode!==X.node||ae.focusOffset!==X.offset)){var ee=ce.createRange();ee.setStart(Q.node,Q.offset),ae.removeAllRanges(),ye>Ge?(ae.addRange(ee),ae.extend(X.node,X.offset)):(ee.setEnd(X.node,X.offset),ae.addRange(ee))}}}}for(ce=[],ae=O;ae=ae.parentNode;)ae.nodeType===1&&ce.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ce.length;O++){var oe=ce[O];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}la=!!uo,fo=uo=null}finally{Ue=a,F.p=s,I.T=i}}e.current=t,ut=2}}function $u(){if(ut===2){ut=0;var e=Wi,t=Zs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=I.T,I.T=null;var s=F.p;F.p=2;var a=Ue;Ue|=4;try{Su(e,t.alternate,t)}finally{Ue=a,F.p=s,I.T=i}}ut=3}}function Gu(){if(ut===4||ut===3){ut=0,ve();var e=Wi,t=Zs,i=Li,s=Bu;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ut=5:(ut=0,Zs=Wi=null,Yu(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(qi=null),pa(i),t=t.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=I.T,a=F.p,F.p=2,I.T=null;try{for(var d=e.onRecoverableError,E=0;E<s.length;E++){var O=s[E];d(O.value,{componentStack:O.stack})}}finally{I.T=t,F.p=a}}(Li&3)!==0&&Vn(),li(e),a=e.pendingLanes,(i&261930)!==0&&(a&42)!==0?e===Zl?Pr++:(Pr=0,Zl=e):Pr=0,Fr(0)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cr(t)))}function Vn(){return Wu(),$u(),Gu(),Xu()}function Xu(){if(ut!==5)return!1;var e=Wi,t=Kl;Kl=0;var i=pa(Li),s=I.T,a=F.p;try{F.p=32>i?32:i,I.T=null,i=Ql,Ql=null;var d=Wi,E=Li;if(ut=0,Zs=Wi=null,Li=0,(Ue&6)!==0)throw Error(j(331));var O=Ue;if(Ue|=4,Du(d.current),Lu(d,d.current,E,i),Ue=O,Fr(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Jt,d)}catch{}return!0}finally{F.p=a,I.T=s,Yu(e,t)}}function Vu(e,t,i){t=Gt(i,t),t=Tl(e.stateNode,t,2),e=Hi(e,t,2),e!==null&&(or(e,2),li(e))}function Pe(e,t,i){if(e.tag===3)Vu(e,e,i);else for(;t!==null;){if(t.tag===3){Vu(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(qi===null||!qi.has(s))){e=Gt(i,e),i=Kh(2),s=Hi(t,i,2),s!==null&&(Qh(i,s,t,e),or(s,2),li(s));break}}t=t.return}}function to(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new T_;var a=new Set;s.set(t,a)}else a=s.get(t),a===void 0&&(a=new Set,s.set(t,a));a.has(i)||(Yl=!0,a.add(i),e=z_.bind(null,e,t,i),t.then(e,e))}function z_(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ye===e&&(Oe&i)===i&&(it===4||it===3&&(Oe&62914560)===Oe&&300>Ce()-qn?(Ue&2)===0&&Js(e,0):Xl|=i,Qs===Oe&&(Qs=0)),li(e)}function Ku(e,t){t===0&&(t=Wo()),e=ls(e,t),e!==null&&(or(e,t),li(e))}function N_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Ku(e,i)}function H_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(i=a.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(j(314))}s!==null&&s.delete(t),Ku(e,i)}function j_(e,t){return Be(e,t)}var Kn=null,tr=null,io=!1,Qn=!1,so=!1,Gi=0;function li(e){e!==tr&&e.next===null&&(tr===null?Kn=tr=e:tr=tr.next=e),Qn=!0,io||(io=!0,I_())}function Fr(e,t){if(!so&&Qn){so=!0;do for(var i=!1,s=Kn;s!==null;){if(e!==0){var a=s.pendingLanes;if(a===0)var d=0;else{var E=s.suspendedLanes,O=s.pingedLanes;d=(1<<31-bt(42|e)+1)-1,d&=a&~(E&~O),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,ed(s,d))}else d=Oe,d=en(s,s===Ye?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||lr(s,d)||(i=!0,ed(s,d));s=s.next}while(i);so=!1}}function U_(){Qu()}function Qu(){Qn=io=!1;var e=0;Gi!==0&&K_()&&(e=Gi);for(var t=Ce(),i=null,s=Kn;s!==null;){var a=s.next,d=Zu(s,t);d===0?(s.next=null,i===null?Kn=a:i.next=a,a===null&&(tr=i)):(i=s,(e!==0||(d&3)!==0)&&(Qn=!0)),s=a}ut!==0&&ut!==5||Fr(e),Gi!==0&&(Gi=0)}function Zu(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var E=31-bt(d),O=1<<E,W=a[E];W===-1?((O&i)===0||(O&s)!==0)&&(a[E]=df(O,t)):W<=t&&(e.expiredLanes|=O),d&=~O}if(t=Ye,i=Oe,i=en(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ae(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||lr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Ae(s),pa(i)){case 2:case 8:i=Ft;break;case 32:i=ht;break;case 268435456:i=et;break;default:i=ht}return s=Ju.bind(null,e),i=Be(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Ae(s),e.callbackPriority=2,e.callbackNode=null,2}function Ju(e,t){if(ut!==0&&ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Vn()&&e.callbackNode!==i)return null;var s=Oe;return s=en(e,e===Ye?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(ku(e,s,t),Zu(e,Ce()),e.callbackNode!=null&&e.callbackNode===i?Ju.bind(null,e):null)}function ed(e,t){if(Vn())return null;ku(e,t,!0)}function I_(){Z_(function(){(Ue&6)!==0?Be(Fe,U_):Qu()})}function ro(){if(Gi===0){var e=Is;e===0&&(e=Ri,Ri<<=1,(Ri&261888)===0&&(Ri=256)),Gi=e}return Gi}function td(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:nn(""+e)}function id(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function P_(e,t,i,s,a){if(t==="submit"&&i&&i.stateNode===a){var d=td((a[Et]||null).action),E=s.submitter;E&&(t=(t=E[Et]||null)?td(t.formAction):E.getAttribute("formAction"),t!==null&&(d=t,E=null));var O=new cn("action","action",null,s,a);e.push({event:O,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gi!==0){var W=E?id(a,E):new FormData(a);wl(i,{pending:!0,data:W,method:a.method,action:d},null,W)}}else typeof d=="function"&&(O.preventDefault(),W=E?id(a,E):new FormData(a),wl(i,{pending:!0,data:W,method:a.method,action:d},d,W))},currentTarget:a}]})}}for(var no=0;no<Pa.length;no++){var ao=Pa[no],F_=ao.toLowerCase(),q_=ao[0].toUpperCase()+ao.slice(1);ei(F_,"on"+q_)}ei(Oc,"onAnimationEnd"),ei(kc,"onAnimationIteration"),ei(zc,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(n_,"onTransitionRun"),ei(a_,"onTransitionStart"),ei(l_,"onTransitionCancel"),ei(Nc,"onTransitionEnd"),Ls("onMouseEnter",["mouseout","mouseover"]),Ls("onMouseLeave",["mouseout","mouseover"]),Ls("onPointerEnter",["pointerout","pointerover"]),Ls("onPointerLeave",["pointerout","pointerover"]),ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ss("onBeforeInput",["compositionend","keypress","textInput","paste"]),ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qr="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(" "),W_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qr));function sd(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],a=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var E=s.length-1;0<=E;E--){var O=s[E],W=O.instance,te=O.currentTarget;if(O=O.listener,W!==d&&a.isPropagationStopped())break e;d=O,a.currentTarget=te;try{d(a)}catch(le){dn(le)}a.currentTarget=null,d=W}else for(E=0;E<s.length;E++){if(O=s[E],W=O.instance,te=O.currentTarget,O=O.listener,W!==d&&a.isPropagationStopped())break e;d=O,a.currentTarget=te;try{d(a)}catch(le){dn(le)}a.currentTarget=null,d=W}}}}function Me(e,t){var i=t[Sa];i===void 0&&(i=t[Sa]=new Set);var s=e+"__bubble";i.has(s)||(rd(t,e,2,!1),i.add(s))}function lo(e,t,i){var s=0;t&&(s|=4),rd(i,e,s,t)}var Zn="_reactListening"+Math.random().toString(36).slice(2);function oo(e){if(!e[Zn]){e[Zn]=!0,Qo.forEach(function(i){i!=="selectionchange"&&(W_.has(i)||lo(i,!1,e),lo(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zn]||(t[Zn]=!0,lo("selectionchange",!1,t))}}function rd(e,t,i,s){switch(Od(t)){case 2:var a=pv;break;case 8:a=Sv;break;default:a=wo}i=a.bind(null,t,i,e),a=void 0,!Ra||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),s?a!==void 0?e.addEventListener(t,i,{capture:!0,passive:a}):e.addEventListener(t,i,!0):a!==void 0?e.addEventListener(t,i,{passive:a}):e.addEventListener(t,i,!1)}function co(e,t,i,s,a){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var E=s.tag;if(E===3||E===4){var O=s.stateNode.containerInfo;if(O===a)break;if(E===4)for(E=s.return;E!==null;){var W=E.tag;if((W===3||W===4)&&E.stateNode.containerInfo===a)return;E=E.return}for(;O!==null;){if(E=xs(O),E===null)return;if(W=E.tag,W===5||W===6||W===26||W===27){s=d=E;continue e}O=O.parentNode}}s=s.return}cc(function(){var te=d,le=La(i),ce=[];e:{var ie=Hc.get(e);if(ie!==void 0){var ae=cn,ge=e;switch(e){case"keypress":if(ln(i)===0)break e;case"keydown":case"keyup":ae=Hf;break;case"focusin":ge="focus",ae=Ba;break;case"focusout":ge="blur",ae=Ba;break;case"beforeblur":case"afterblur":ae=Ba;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":ae=dc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Ef;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=If;break;case Oc:case kc:case zc:ae=Rf;break;case Nc:ae=Ff;break;case"scroll":case"scrollend":ae=xf;break;case"wheel":ae=Wf;break;case"copy":case"cut":case"paste":ae=Tf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=_c;break;case"toggle":case"beforetoggle":ae=Gf}var ye=(t&4)!==0,Ge=!ye&&(e==="scroll"||e==="scrollend"),Q=ye?ie!==null?ie+"Capture":null:ie;ye=[];for(var X=te,ee;X!==null;){var oe=X;if(ee=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||ee===null||Q===null||(oe=ur(X,Q),oe!=null&&ye.push(Wr(X,oe,ee))),Ge)break;X=X.return}0<ye.length&&(ie=new ae(ie,ge,null,i,le),ce.push({event:ie,listeners:ye}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",ie&&i!==Ea&&(ge=i.relatedTarget||i.fromElement)&&(xs(ge)||ge[Cs]))break e;if((ae||ie)&&(ie=le.window===le?le:(ie=le.ownerDocument)?ie.defaultView||ie.parentWindow:window,ae?(ge=i.relatedTarget||i.toElement,ae=te,ge=ge?xs(ge):null,ge!==null&&(Ge=se(ge),ye=ge.tag,ge!==Ge||ye!==5&&ye!==27&&ye!==6)&&(ge=null)):(ae=null,ge=te),ae!==ge)){if(ye=dc,oe="onMouseLeave",Q="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(ye=_c,oe="onPointerLeave",Q="onPointerEnter",X="pointer"),Ge=ae==null?ie:hr(ae),ee=ge==null?ie:hr(ge),ie=new ye(oe,X+"leave",ae,i,le),ie.target=Ge,ie.relatedTarget=ee,oe=null,xs(le)===te&&(ye=new ye(Q,X+"enter",ge,i,le),ye.target=ee,ye.relatedTarget=Ge,oe=ye),Ge=oe,ae&&ge)t:{for(ye=$_,Q=ae,X=ge,ee=0,oe=Q;oe;oe=ye(oe))ee++;oe=0;for(var Se=X;Se;Se=ye(Se))oe++;for(;0<ee-oe;)Q=ye(Q),ee--;for(;0<oe-ee;)X=ye(X),oe--;for(;ee--;){if(Q===X||X!==null&&Q===X.alternate){ye=Q;break t}Q=ye(Q),X=ye(X)}ye=null}else ye=null;ae!==null&&nd(ce,ie,ae,ye,!1),ge!==null&&Ge!==null&&nd(ce,Ge,ge,ye,!0)}}e:{if(ie=te?hr(te):window,ae=ie.nodeName&&ie.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ie.type==="file")var He=Cc;else if(bc(ie))if(xc)He=i_;else{He=e_;var me=Jf}else ae=ie.nodeName,!ae||ae.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?te&&wa(te.elementType)&&(He=Cc):He=t_;if(He&&(He=He(e,te))){yc(ce,He,i,le);break e}me&&me(e,ie,te),e==="focusout"&&te&&ie.type==="number"&&te.memoizedProps.value!=null&&xa(ie,"number",ie.value)}switch(me=te?hr(te):window,e){case"focusin":(bc(me)||me.contentEditable==="true")&&(Bs=me,ja=te,Sr=null);break;case"focusout":Sr=ja=Bs=null;break;case"mousedown":Ua=!0;break;case"contextmenu":case"mouseup":case"dragend":Ua=!1,Mc(ce,i,le);break;case"selectionchange":if(r_)break;case"keydown":case"keyup":Mc(ce,i,le)}var Le;if(ka)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Ms?pc(e,i)&&(ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ke="onCompositionStart");ke&&(vc&&i.locale!=="ko"&&(Ms||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Ms&&(Le=hc()):(Ti=le,Da="value"in Ti?Ti.value:Ti.textContent,Ms=!0)),me=Jn(te,ke),0<me.length&&(ke=new fc(ke,e,null,i,le),ce.push({event:ke,listeners:me}),Le?ke.data=Le:(Le=Sc(i),Le!==null&&(ke.data=Le)))),(Le=Xf?Vf(e,i):Kf(e,i))&&(ke=Jn(te,"onBeforeInput"),0<ke.length&&(me=new fc("onBeforeInput","beforeinput",null,i,le),ce.push({event:me,listeners:ke}),me.data=Le)),P_(ce,e,te,i,le)}sd(ce,t)})}function Wr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Jn(e,t){for(var i=t+"Capture",s=[];e!==null;){var a=e,d=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||d===null||(a=ur(e,i),a!=null&&s.unshift(Wr(e,a,d)),a=ur(e,t),a!=null&&s.push(Wr(e,a,d))),e.tag===3)return s;e=e.return}return[]}function $_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function nd(e,t,i,s,a){for(var d=t._reactName,E=[];i!==null&&i!==s;){var O=i,W=O.alternate,te=O.stateNode;if(O=O.tag,W!==null&&W===s)break;O!==5&&O!==26&&O!==27||te===null||(W=te,a?(te=ur(i,d),te!=null&&E.unshift(Wr(i,te,W))):a||(te=ur(i,d),te!=null&&E.push(Wr(i,te,W)))),i=i.return}E.length!==0&&e.push({event:t,listeners:E})}var G_=/\r\n?/g,Y_=/\u0000|\uFFFD/g;function ad(e){return(typeof e=="string"?e:""+e).replace(G_,`
49
+ `).replace(Y_,"")}function ld(e,t){return t=ad(t),ad(e)===t}function $e(e,t,i,s,a,d){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Rs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Rs(e,""+s);break;case"className":sn(e,"class",s);break;case"tabIndex":sn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":sn(e,i,s);break;case"style":lc(e,s,d);break;case"data":if(t!=="object"){sn(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=nn(""+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 d=="function"&&(i==="formAction"?(t!=="input"&&$e(e,t,"name",a.name,a,null),$e(e,t,"formEncType",a.formEncType,a,null),$e(e,t,"formMethod",a.formMethod,a,null),$e(e,t,"formTarget",a.formTarget,a,null)):($e(e,t,"encType",a.encType,a,null),$e(e,t,"method",a.method,a,null),$e(e,t,"target",a.target,a,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=nn(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=ui);break;case"onScroll":s!=null&&Me("scroll",e);break;case"onScrollEnd":s!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(j(61));if(i=s.__html,i!=null){if(a.children!=null)throw Error(j(60));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=nn(""+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"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":Me("beforetoggle",e),Me("toggle",e),tn(e,"popover",s);break;case"xlinkActuate":hi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":hi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":hi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":hi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":hi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":hi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":hi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":hi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":hi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":tn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=yf.get(i)||i,tn(e,i,s))}}function ho(e,t,i,s,a,d){switch(i){case"style":lc(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(j(61));if(i=s.__html,i!=null){if(a.children!=null)throw Error(j(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Rs(e,s):(typeof s=="number"||typeof s=="bigint")&&Rs(e,""+s);break;case"onScroll":s!=null&&Me("scroll",e);break;case"onScrollEnd":s!=null&&Me("scrollend",e);break;case"onClick":s!=null&&(e.onclick=ui);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zo.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(a=i.endsWith("Capture"),t=i.slice(2,a?i.length-7:void 0),d=e[Et]||null,d=d!=null?d[i]:null,typeof d=="function"&&e.removeEventListener(t,d,a),typeof s=="function")){typeof d!="function"&&d!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,a);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):tn(e,i,s)}}}function St(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var s=!1,a=!1,d;for(d in i)if(i.hasOwnProperty(d)){var E=i[d];if(E!=null)switch(d){case"src":s=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:$e(e,t,d,E,i,null)}}a&&$e(e,t,"srcSet",i.srcSet,i,null),s&&$e(e,t,"src",i.src,i,null);return;case"input":Me("invalid",e);var O=d=E=a=null,W=null,te=null;for(s in i)if(i.hasOwnProperty(s)){var le=i[s];if(le!=null)switch(s){case"name":a=le;break;case"type":E=le;break;case"checked":W=le;break;case"defaultChecked":te=le;break;case"value":d=le;break;case"defaultValue":O=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(j(137,t));break;default:$e(e,t,s,le,i,null)}}sc(e,d,O,W,te,E,a,!1);return;case"select":Me("invalid",e),s=E=d=null;for(a in i)if(i.hasOwnProperty(a)&&(O=i[a],O!=null))switch(a){case"value":d=O;break;case"defaultValue":E=O;break;case"multiple":s=O;default:$e(e,t,a,O,i,null)}t=d,i=E,e.multiple=!!s,t!=null?As(e,!!s,t,!1):i!=null&&As(e,!!s,i,!0);return;case"textarea":Me("invalid",e),d=a=s=null;for(E in i)if(i.hasOwnProperty(E)&&(O=i[E],O!=null))switch(E){case"value":s=O;break;case"defaultValue":a=O;break;case"children":d=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(j(91));break;default:$e(e,t,E,O,i,null)}nc(e,s,a,d);return;case"option":for(W in i)if(i.hasOwnProperty(W)&&(s=i[W],s!=null))switch(W){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:$e(e,t,W,s,i,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(s=0;s<qr.length;s++)Me(qr[s],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("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(te in i)if(i.hasOwnProperty(te)&&(s=i[te],s!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:$e(e,t,te,s,i,null)}return;default:if(wa(t)){for(le in i)i.hasOwnProperty(le)&&(s=i[le],s!==void 0&&ho(e,t,le,s,i,void 0));return}}for(O in i)i.hasOwnProperty(O)&&(s=i[O],s!=null&&$e(e,t,O,s,i,null))}function X_(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 a=null,d=null,E=null,O=null,W=null,te=null,le=null;for(ae in i){var ce=i[ae];if(i.hasOwnProperty(ae)&&ce!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":W=ce;default:s.hasOwnProperty(ae)||$e(e,t,ae,null,s,ce)}}for(var ie in s){var ae=s[ie];if(ce=i[ie],s.hasOwnProperty(ie)&&(ae!=null||ce!=null))switch(ie){case"type":d=ae;break;case"name":a=ae;break;case"checked":te=ae;break;case"defaultChecked":le=ae;break;case"value":E=ae;break;case"defaultValue":O=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(j(137,t));break;default:ae!==ce&&$e(e,t,ie,ae,s,ce)}}Ca(e,E,O,W,te,le,d,a);return;case"select":ae=E=O=ie=null;for(d in i)if(W=i[d],i.hasOwnProperty(d)&&W!=null)switch(d){case"value":break;case"multiple":ae=W;default:s.hasOwnProperty(d)||$e(e,t,d,null,s,W)}for(a in s)if(d=s[a],W=i[a],s.hasOwnProperty(a)&&(d!=null||W!=null))switch(a){case"value":ie=d;break;case"defaultValue":O=d;break;case"multiple":E=d;default:d!==W&&$e(e,t,a,d,s,W)}t=O,i=E,s=ae,ie!=null?As(e,!!i,ie,!1):!!s!=!!i&&(t!=null?As(e,!!i,t,!0):As(e,!!i,i?[]:"",!1));return;case"textarea":ae=ie=null;for(O in i)if(a=i[O],i.hasOwnProperty(O)&&a!=null&&!s.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:$e(e,t,O,null,s,a)}for(E in s)if(a=s[E],d=i[E],s.hasOwnProperty(E)&&(a!=null||d!=null))switch(E){case"value":ie=a;break;case"defaultValue":ae=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(j(91));break;default:a!==d&&$e(e,t,E,a,s,d)}rc(e,ie,ae);return;case"option":for(var ge in i)if(ie=i[ge],i.hasOwnProperty(ge)&&ie!=null&&!s.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:$e(e,t,ge,null,s,ie)}for(W in s)if(ie=s[W],ae=i[W],s.hasOwnProperty(W)&&ie!==ae&&(ie!=null||ae!=null))switch(W){case"selected":e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:$e(e,t,W,ie,s,ae)}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 ye in i)ie=i[ye],i.hasOwnProperty(ye)&&ie!=null&&!s.hasOwnProperty(ye)&&$e(e,t,ye,null,s,ie);for(te in s)if(ie=s[te],ae=i[te],s.hasOwnProperty(te)&&ie!==ae&&(ie!=null||ae!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(j(137,t));break;default:$e(e,t,te,ie,s,ae)}return;default:if(wa(t)){for(var Ge in i)ie=i[Ge],i.hasOwnProperty(Ge)&&ie!==void 0&&!s.hasOwnProperty(Ge)&&ho(e,t,Ge,void 0,s,ie);for(le in s)ie=s[le],ae=i[le],!s.hasOwnProperty(le)||ie===ae||ie===void 0&&ae===void 0||ho(e,t,le,ie,s,ae);return}}for(var Q in i)ie=i[Q],i.hasOwnProperty(Q)&&ie!=null&&!s.hasOwnProperty(Q)&&$e(e,t,Q,null,s,ie);for(ce in s)ie=s[ce],ae=i[ce],!s.hasOwnProperty(ce)||ie===ae||ie==null&&ae==null||$e(e,t,ce,ie,s,ae)}function od(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function V_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var a=i[s],d=a.transferSize,E=a.initiatorType,O=a.duration;if(d&&O&&od(E)){for(E=0,O=a.responseEnd,s+=1;s<i.length;s++){var W=i[s],te=W.startTime;if(te>O)break;var le=W.transferSize,ce=W.initiatorType;le&&od(ce)&&(W=W.responseEnd,E+=le*(W<O?1:(O-te)/(W-te)))}if(--s,t+=8*(d+E)/(a.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 uo=null,fo=null;function ea(e){return e.nodeType===9?e:e.ownerDocument}function cd(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 hd(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 _o(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 vo=null;function K_(){var e=window.event;return e&&e.type==="popstate"?e===vo?!1:(vo=e,!0):(vo=null,!1)}var ud=typeof setTimeout=="function"?setTimeout:void 0,Q_=typeof clearTimeout=="function"?clearTimeout:void 0,dd=typeof Promise=="function"?Promise:void 0,Z_=typeof queueMicrotask=="function"?queueMicrotask:typeof dd<"u"?function(e){return dd.resolve(null).then(e).catch(J_)}:ud;function J_(e){setTimeout(function(){throw e})}function Yi(e){return e==="head"}function fd(e,t){var i=t,s=0;do{var a=i.nextSibling;if(e.removeChild(i),a&&a.nodeType===8)if(i=a.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(a),nr(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")$r(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,$r(i);for(var d=i.firstChild;d;){var E=d.nextSibling,O=d.nodeName;d[cr]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=E}}else i==="body"&&$r(e.ownerDocument.body);i=a}while(i);nr(t)}function _d(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 go(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":go(i),ba(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function ev(e,t,i,s){for(;e.nodeType===1;){var a=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[cr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Qt(e.nextSibling),e===null)break}return null}function tv(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Qt(e.nextSibling),e===null))return null;return e}function vd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Qt(e.nextSibling),e===null))return null;return e}function mo(e){return e.data==="$?"||e.data==="$~"}function po(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function iv(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 Qt(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 So=null;function gd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Qt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function md(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 pd(e,t,i){switch(t=ea(i),e){case"html":if(e=t.documentElement,!e)throw Error(j(452));return e;case"head":if(e=t.head,!e)throw Error(j(453));return e;case"body":if(e=t.body,!e)throw Error(j(454));return e;default:throw Error(j(451))}}function $r(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ba(e)}var Zt=new Map,Sd=new Set;function ta(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ai=F.d;F.d={f:sv,r:rv,D:nv,C:av,L:lv,m:ov,X:hv,S:cv,M:uv};function sv(){var e=Ai.f(),t=Gn();return e||t}function rv(e){var t=ws(e);t!==null&&t.tag===5&&t.type==="form"?Nh(t):Ai.r(e)}var ir=typeof document>"u"?null:document;function bd(e,t,i){var s=ir;if(s&&typeof t=="string"&&t){var a=Wt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof i=="string"&&(a+='[crossorigin="'+i+'"]'),Sd.has(a)||(Sd.add(a),e={rel:e,crossOrigin:i,href:t},s.querySelector(a)===null&&(t=s.createElement("link"),St(t,"link",e),ft(t),s.head.appendChild(t)))}}function nv(e){Ai.D(e),bd("dns-prefetch",e,null)}function av(e,t){Ai.C(e,t),bd("preconnect",e,t)}function lv(e,t,i){Ai.L(e,t,i);var s=ir;if(s&&e&&t){var a='link[rel="preload"][as="'+Wt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(a+='[imagesrcset="'+Wt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(a+='[imagesizes="'+Wt(i.imageSizes)+'"]')):a+='[href="'+Wt(e)+'"]';var d=a;switch(t){case"style":d=sr(e);break;case"script":d=rr(e)}Zt.has(d)||(e=l({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Zt.set(d,e),s.querySelector(a)!==null||t==="style"&&s.querySelector(Gr(d))||t==="script"&&s.querySelector(Yr(d))||(t=s.createElement("link"),St(t,"link",e),ft(t),s.head.appendChild(t)))}}function ov(e,t){Ai.m(e,t);var i=ir;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Wt(s)+'"][href="'+Wt(e)+'"]',d=a;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=rr(e)}if(!Zt.has(d)&&(e=l({rel:"modulepreload",href:e},t),Zt.set(d,e),i.querySelector(a)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Yr(d)))return}s=i.createElement("link"),St(s,"link",e),ft(s),i.head.appendChild(s)}}}function cv(e,t,i){Ai.S(e,t,i);var s=ir;if(s&&e){var a=Es(s).hoistableStyles,d=sr(e);t=t||"default";var E=a.get(d);if(!E){var O={loading:0,preload:null};if(E=s.querySelector(Gr(d)))O.loading=5;else{e=l({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Zt.get(d))&&bo(e,i);var W=E=s.createElement("link");ft(W),St(W,"link",e),W._p=new Promise(function(te,le){W.onload=te,W.onerror=le}),W.addEventListener("load",function(){O.loading|=1}),W.addEventListener("error",function(){O.loading|=2}),O.loading|=4,ia(E,t,s)}E={type:"stylesheet",instance:E,count:1,state:O},a.set(d,E)}}}function hv(e,t){Ai.X(e,t);var i=ir;if(i&&e){var s=Es(i).hoistableScripts,a=rr(e),d=s.get(a);d||(d=i.querySelector(Yr(a)),d||(e=l({src:e,async:!0},t),(t=Zt.get(a))&&yo(e,t),d=i.createElement("script"),ft(d),St(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(a,d))}}function uv(e,t){Ai.M(e,t);var i=ir;if(i&&e){var s=Es(i).hoistableScripts,a=rr(e),d=s.get(a);d||(d=i.querySelector(Yr(a)),d||(e=l({src:e,async:!0,type:"module"},t),(t=Zt.get(a))&&yo(e,t),d=i.createElement("script"),ft(d),St(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(a,d))}}function yd(e,t,i,s){var a=(a=ue.current)?ta(a):null;if(!a)throw Error(j(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=sr(i.href),i=Es(a).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,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=sr(i.href);var d=Es(a).hoistableStyles,E=d.get(e);if(E||(a=a.ownerDocument||a,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,E),(d=a.querySelector(Gr(e)))&&!d._p&&(E.instance=d,E.state.loading=5),Zt.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Zt.set(e,i),d||dv(a,e,i,E.state))),t&&s===null)throw Error(j(528,""));return E}if(t&&s!==null)throw Error(j(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rr(i),i=Es(a).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(j(444,e))}}function sr(e){return'href="'+Wt(e)+'"'}function Gr(e){return'link[rel="stylesheet"]['+e+"]"}function Cd(e){return l({},e,{"data-precedence":e.precedence,precedence:null})}function dv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),St(t,"link",i),ft(t),e.head.appendChild(t))}function rr(e){return'[src="'+Wt(e)+'"]'}function Yr(e){return"script[async]"+e}function xd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Wt(i.href)+'"]');if(s)return t.instance=s,ft(s),s;var a=l({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ft(s),St(s,"style",a),ia(s,i.precedence,e),t.instance=s;case"stylesheet":a=sr(i.href);var d=e.querySelector(Gr(a));if(d)return t.state.loading|=4,t.instance=d,ft(d),d;s=Cd(i),(a=Zt.get(a))&&bo(s,a),d=(e.ownerDocument||e).createElement("link"),ft(d);var E=d;return E._p=new Promise(function(O,W){E.onload=O,E.onerror=W}),St(d,"link",s),t.state.loading|=4,ia(d,i.precedence,e),t.instance=d;case"script":return d=rr(i.src),(a=e.querySelector(Yr(d)))?(t.instance=a,ft(a),a):(s=i,(a=Zt.get(d))&&(s=l({},i),yo(s,a)),e=e.ownerDocument||e,a=e.createElement("script"),ft(a),St(a,"link",s),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(j(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,ia(s,i.precedence,e));return t.instance}function ia(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=s.length?s[s.length-1]:null,d=a,E=0;E<s.length;E++){var O=s[E];if(O.dataset.precedence===t)d=O;else if(d!==a)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function bo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var sa=null;function wd(e,t,i){if(sa===null){var s=new Map,a=sa=new Map;a.set(i,s)}else a=sa,s=a.get(i),s||(s=new Map,a.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),a=0;a<i.length;a++){var d=i[a];if(!(d[cr]||d[vt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var E=d.getAttribute(t)||"";E=e+E;var O=s.get(E);O?O.push(d):s.set(E,[d])}}return s}function Ed(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function fv(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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ld(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _v(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 a=sr(s.href),d=t.querySelector(Gr(a));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ra.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=d,ft(d);return}d=t.ownerDocument||t,s=Cd(s),(a=Zt.get(a))&&bo(s,a),d=d.createElement("link"),ft(d);var E=d;E._p=new Promise(function(O,W){E.onload=O,E.onerror=W}),St(d,"link",s),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ra.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Co=0;function vv(e,t){return e.stylesheets&&e.count===0&&aa(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&aa(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Co===0&&(Co=62500*V_());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&aa(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Co?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(a)}}:null}function ra(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)aa(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var na=null;function aa(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,na=new Map,t.forEach(gv,e),na=null,ra.call(e))}function gv(e,t){if(!(t.state.loading&4)){var i=na.get(e);if(i)var s=i.get(null);else{i=new Map,na.set(e,i);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<a.length;d++){var E=a[d];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(i.set(E.dataset.precedence,E),s=E)}s&&i.set(null,s)}a=t.instance,E=a.getAttribute("data-precedence"),d=i.get(E)||s,d===s&&i.set(null,a),i.set(E,a),this.count++,s=ra.bind(this),a.addEventListener("load",s),a.addEventListener("error",s),d?d.parentNode.insertBefore(a,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Xr={$$typeof:h,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function mv(e,t,i,s,a,d,E,O,W){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=ga(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ga(0),this.hiddenUpdates=ga(null),this.identifierPrefix=s,this.onUncaughtError=a,this.onCaughtError=d,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Ad(e,t,i,s,a,d,E,O,W,te,le,ce){return e=new mv(e,t,i,E,W,te,le,ce,O),t=1,d===!0&&(t|=24),d=zt(3,null,null,t),e.current=d,d.stateNode=e,t=el(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:i,cache:t},rl(d),e}function Rd(e){return e?(e=zs,e):zs}function Dd(e,t,i,s,a,d){a=Rd(a),s.context===null?s.context=a:s.pendingContext=a,s=Ni(t),s.payload={element:i},d=d===void 0?null:d,d!==null&&(s.callback=d),i=Hi(e,s,t),i!==null&&(Mt(i,e,t),Lr(i,e,t))}function Td(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function xo(e,t){Td(e,t),(e=e.alternate)&&Td(e,t)}function Md(e){if(e.tag===13||e.tag===31){var t=ls(e,67108864);t!==null&&Mt(t,e,67108864),xo(e,67108864)}}function Bd(e){if(e.tag===13||e.tag===31){var t=It();t=ma(t);var i=ls(e,t);i!==null&&Mt(i,e,t),xo(e,t)}}var la=!0;function pv(e,t,i,s){var a=I.T;I.T=null;var d=F.p;try{F.p=2,wo(e,t,i,s)}finally{F.p=d,I.T=a}}function Sv(e,t,i,s){var a=I.T;I.T=null;var d=F.p;try{F.p=8,wo(e,t,i,s)}finally{F.p=d,I.T=a}}function wo(e,t,i,s){if(la){var a=Eo(s);if(a===null)co(e,t,s,oa,i),kd(e,s);else if(yv(a,e,t,i,s))s.stopPropagation();else if(kd(e,s),t&4&&-1<bv.indexOf(e)){for(;a!==null;){var d=ws(a);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var E=ci(d.pendingLanes);if(E!==0){var O=d;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var W=1<<31-bt(E);O.entanglements[1]|=W,E&=~W}li(d),(Ue&6)===0&&(Wn=Ce()+500,Fr(0))}}break;case 31:case 13:O=ls(d,2),O!==null&&Mt(O,d,2),Gn(),xo(d,2)}if(d=Eo(s),d===null&&co(e,t,s,oa,i),d===a)break;a=d}a!==null&&s.stopPropagation()}else co(e,t,s,null,i)}}function Eo(e){return e=La(e),Lo(e)}var oa=null;function Lo(e){if(oa=null,e=xs(e),e!==null){var t=se(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=P(t),e!==null)return e;e=null}else if(i===31){if(e=n(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 oa=e,null}function Od(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ze()){case Fe:return 2;case Ft:return 8;case ht:case wt:return 32;case et:return 268435456;default:return 32}default:return 32}}var Ao=!1,Xi=null,Vi=null,Ki=null,Vr=new Map,Kr=new Map,Qi=[],bv="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 kd(e,t){switch(e){case"focusin":case"focusout":Xi=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":Vr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kr.delete(t.pointerId)}}function Qr(e,t,i,s,a,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:d,targetContainers:[a]},t!==null&&(t=ws(t),t!==null&&Md(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function yv(e,t,i,s,a){switch(t){case"focusin":return Xi=Qr(Xi,e,t,i,s,a),!0;case"dragenter":return Vi=Qr(Vi,e,t,i,s,a),!0;case"mouseover":return Ki=Qr(Ki,e,t,i,s,a),!0;case"pointerover":var d=a.pointerId;return Vr.set(d,Qr(Vr.get(d)||null,e,t,i,s,a)),!0;case"gotpointercapture":return d=a.pointerId,Kr.set(d,Qr(Kr.get(d)||null,e,t,i,s,a)),!0}return!1}function zd(e){var t=xs(e.target);if(t!==null){var i=se(t);if(i!==null){if(t=i.tag,t===13){if(t=P(i),t!==null){e.blockedOn=t,Vo(e.priority,function(){Bd(i)});return}}else if(t===31){if(t=n(i),t!==null){e.blockedOn=t,Vo(e.priority,function(){Bd(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 ca(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Eo(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Ea=s,i.target.dispatchEvent(s),Ea=null}else return t=ws(i),t!==null&&Md(t),e.blockedOn=i,!1;t.shift()}return!0}function Nd(e,t,i){ca(e)&&i.delete(t)}function Cv(){Ao=!1,Xi!==null&&ca(Xi)&&(Xi=null),Vi!==null&&ca(Vi)&&(Vi=null),Ki!==null&&ca(Ki)&&(Ki=null),Vr.forEach(Nd),Kr.forEach(Nd)}function ha(e,t){e.blockedOn===t&&(e.blockedOn=null,Ao||(Ao=!0,k.unstable_scheduleCallback(k.unstable_NormalPriority,Cv)))}var ua=null;function Hd(e){ua!==e&&(ua=e,k.unstable_scheduleCallback(k.unstable_NormalPriority,function(){ua===e&&(ua=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],a=e[t+2];if(typeof s!="function"){if(Lo(s||i)===null)continue;break}var d=ws(i);d!==null&&(e.splice(t,3),t-=3,wl(d,{pending:!0,data:a,method:i.method,action:s},s,a))}}))}function nr(e){function t(W){return ha(W,e)}Xi!==null&&ha(Xi,e),Vi!==null&&ha(Vi,e),Ki!==null&&ha(Ki,e),Vr.forEach(t),Kr.forEach(t);for(var i=0;i<Qi.length;i++){var s=Qi[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Qi.length&&(i=Qi[0],i.blockedOn===null);)zd(i),i.blockedOn===null&&Qi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var a=i[s],d=i[s+1],E=a[Et]||null;if(typeof d=="function")E||Hd(i);else if(E){var O=null;if(d&&d.hasAttribute("formAction")){if(a=d,E=d[Et]||null)O=E.formAction;else if(Lo(a)!==null)continue}else O=E.action;typeof O=="function"?i[s+1]=O:(i.splice(s,3),s-=3),Hd(i)}}}function jd(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(E){return a=E})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,a=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),a!==null&&(a(),a=null)}}}function Ro(e){this._internalRoot=e}da.prototype.render=Ro.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(j(409));var i=t.current,s=It();Dd(i,s,e,t,null,null)},da.prototype.unmount=Ro.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dd(e.current,2,null,e,null,null),Gn(),t[Cs]=null}};function da(e){this._internalRoot=e}da.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xo();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Qi.length&&t!==0&&t<Qi[i].priority;i++);Qi.splice(i,0,e),i===0&&zd(e)}};var Ud=Y.version;if(Ud!=="19.2.6")throw Error(j(527,Ud,"19.2.6"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(j(188)):(e=Object.keys(e).join(","),Error(j(268,e)));return e=_(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var xv={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fa.isDisabled&&fa.supportsFiber)try{Jt=fa.inject(xv),dt=fa}catch{}}return Jr.createRoot=function(e,t){if(!J(e))throw Error(j(299));var i=!1,s="",a=Gh,d=Yh,E=Xh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(E=t.onRecoverableError)),t=Ad(e,1,!1,null,null,i,s,null,a,d,E,jd),e[Cs]=t.current,oo(e),new Ro(t)},Jr.hydrateRoot=function(e,t,i){if(!J(e))throw Error(j(299));var s=!1,a="",d=Gh,E=Yh,O=Xh,W=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(a=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError),i.formState!==void 0&&(W=i.formState)),t=Ad(e,1,!0,t,i??null,s,a,W,d,E,O,jd),t.context=Rd(null),i=t.current,s=It(),s=ma(s),a=Ni(s),a.callback=null,Hi(i,a,s),i=s,t.current.lanes=i,or(t,i),li(t),e[Cs]=t.current,oo(e),new da(t)},Jr.version="19.2.6",Jr}var Vd;function Ov(){if(Vd)return Mo.exports;Vd=1;function k(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k)}catch(Y){console.error(Y)}}return k(),Mo.exports=Bv(),Mo.exports}var kv=Ov();function bs(k,Y){const[G,j]=de.useState(null),[J,se]=de.useState(null),P=de.useRef(k);P.current=k;const n=de.useRef(async()=>{try{const f=await P.current();j(f),se(null)}catch(f){se(f)}});return de.useEffect(()=>{let f=!1;const _=async()=>{f||await n.current()};_();const v=setInterval(_,Y);return()=>{f=!0,clearInterval(v)}},[Y]),{data:G,error:J,refresh:()=>void n.current()}}const zo="tono:route";function es(){const[k,Y]=de.useState(window.location.pathname);return de.useEffect(()=>{const j=()=>Y(window.location.pathname);return window.addEventListener("popstate",j),window.addEventListener(zo,j),()=>{window.removeEventListener("popstate",j),window.removeEventListener(zo,j)}},[]),{path:k,navigate:j=>{j!==window.location.pathname&&(window.history.pushState({},"",j),window.dispatchEvent(new Event(zo)))}}}async function ar(k){const Y=await fetch(k);if(!Y.ok)throw new Error(`${k}: ${Y.status}`);return Y.json()}const nt={health:()=>ar("/api/health"),config:()=>ar("/api/config"),tasks:()=>ar("/api/tasks").then(k=>k.tasks),task:k=>ar(`/api/tasks/${k}`).then(Y=>Y.task),sessions:()=>ar("/api/sessions").then(k=>k.sessions),workers:()=>ar("/api/workers").then(k=>k.workers),killSession:async k=>{const Y=await fetch(`/api/sessions/${encodeURIComponent(k)}`,{method:"DELETE"});if(!Y.ok)throw new Error(`kill: ${Y.status}`)},cleanupTask:async k=>{const Y=await fetch(`/api/tasks/${k}/cleanup`,{method:"POST"});if(!Y.ok){const G=await Y.text();throw new Error(`cleanup: ${Y.status} ${G}`)}},rawConfig:async()=>{const k=await fetch("/api/config/raw");if(!k.ok)throw new Error(`config/raw: ${k.status}`);return k.json()},saveRawConfig:async k=>{const Y=await fetch("/api/config/raw",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:k})}),G=await Y.json().catch(()=>({}));if(!Y.ok){const j=G.error??`${Y.status}`;throw new Error(j)}return G},startTask:async k=>{const Y=await fetch("/api/tasks",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)}),G=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(G.error??`${Y.status}`);return G.task},retryTask:async k=>{const Y=await fetch(`/api/tasks/${k}/retry`,{method:"POST"}),G=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(G.error??`${Y.status}`);return G.task},markDone:async k=>{const Y=await fetch(`/api/tasks/${k}/done`,{method:"POST"}),G=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(G.error??`${Y.status}`);return G.task},newShell:async(k={})=>{const Y=await fetch("/api/sessions/shell",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)}),G=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(G.error??`${Y.status}`);return G}};function zv(k){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${k}`}const Nv={neutral:"bg-zinc-800 text-zinc-300 border-zinc-700",blue:"bg-blue-950/60 text-blue-300 border-blue-900",green:"bg-green-950/60 text-green-300 border-green-900",amber:"bg-amber-950/60 text-amber-300 border-amber-900",red:"bg-red-950/60 text-red-300 border-red-900",orange:"bg-orange-950/60 text-orange-300 border-orange-900"};function Ji({tone:k="neutral",children:Y}){return T.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${Nv[k]}`,children:Y})}function Hv(){const{path:k,navigate:Y}=es(),{data:G}=bs(nt.health,5e3),j=(n,f)=>{const _=n==="/"?k==="/":k.startsWith(n);return T.jsx("button",{onClick:()=>Y(n),className:`px-3 py-1.5 text-sm rounded-md transition ${_?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,children:f})},J=G==null?void 0:G.poller.some(n=>n.lastError&&(!n.lastSuccessAt||Date.parse(n.lastSuccessAt)<Date.now()-5*6e4)),se=G==null?void 0:G.workers,P=se?se.connected===0?"red":se.connected<se.total?"amber":"green":"neutral";return T.jsx("header",{className:"border-b border-zinc-800 bg-zinc-950/80 backdrop-blur sticky top-0 z-10",children:T.jsxs("div",{className:"mx-auto max-w-6xl flex items-center gap-4 px-6 py-3",children:[T.jsxs("button",{onClick:()=>Y("/"),className:"text-lg font-semibold tracking-tight text-zinc-100 hover:text-white",children:["tono",T.jsx("span",{children:".sh"})]}),T.jsxs("nav",{className:"flex items-center gap-1",children:[j("/","Dashboard"),j("/workers","Workers"),j("/config","Config")]}),T.jsx("div",{className:"ml-auto flex items-center gap-3 text-xs text-zinc-400",children:G?T.jsxs(T.Fragment,{children:[T.jsxs(Ji,{tone:"neutral",children:["agents: ",Object.keys(G.agents).length]}),T.jsxs(Ji,{tone:J?"red":"green",children:["repos: ",G.reposWatched]}),T.jsx("button",{onClick:()=>Y("/workers"),className:"cursor-pointer",title:"Click for worker details",children:T.jsxs(Ji,{tone:P,children:["workers: ",(se==null?void 0:se.connected)??0,se&&se.total!==se.connected?`/${se.total}`:""]})})]}):T.jsx("span",{className:"text-zinc-600",children:"connecting…"})})]})})}function Xe({variant:k="default",className:Y="",...G}){const j="inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition disabled:opacity-50 disabled:cursor-not-allowed",J={default:"bg-zinc-100 text-zinc-900 hover:bg-white",danger:"bg-red-600 text-white hover:bg-red-500",ghost:"text-zinc-300 hover:bg-zinc-800"}[k];return T.jsx("button",{className:`${j} ${J} ${Y}`,...G})}function jv({config:k,onClose:Y}){var r;const{navigate:G}=es(),j=de.useMemo(()=>Object.keys(k.agents),[k.agents]),[J,se]=de.useState(((r=k.repos[0])==null?void 0:r.slug)??""),[P,n]=de.useState(""),[f,_]=de.useState(""),[v,l]=de.useState(!1),[g,b]=de.useState(null),y=de.useMemo(()=>{const c=k.repos.find(o=>o.slug===J);return!c||!c.agents||c.agents.length===0?j:c.agents.filter(o=>j.includes(o))},[k.repos,J,j]);de.useEffect(()=>{y.length!==0&&(y.includes(f)||_(y[0]))},[y,f]),de.useEffect(()=>{const c=o=>{o.key==="Escape"&&Y()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[Y]);const u=async c=>{c.preventDefault();const o=Number(P);if(!Number.isInteger(o)||o<=0){b("issue number must be a positive integer");return}if(!f){b("pick an agent");return}l(!0),b(null);try{const h=await nt.startTask({repoSlug:J,issueNumber:o,agent:f});Y(),G(`/tasks/${h.id}`)}catch(h){b(h.message)}finally{l(!1)}};return k.repos.length===0?T.jsx(Kd,{onClose:Y,children:T.jsxs("div",{className:"text-sm text-zinc-300",children:["No repos configured yet. Add one on the"," ",T.jsx("button",{className:"text-orange-400 hover:underline",onClick:()=>{Y(),G("/config")},children:"Config page"})," ","first."]})}):T.jsx(Kd,{onClose:Y,children:T.jsxs("form",{onSubmit:u,className:"space-y-3",children:[T.jsxs("div",{children:[T.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Repo"}),T.jsx("select",{value:J,onChange:c=>se(c.target.value),className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm",children:k.repos.map(c=>T.jsx("option",{value:c.slug,children:c.slug},c.slug))})]}),T.jsxs("div",{children:[T.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Agent"}),T.jsx("select",{value:f,onChange:c=>_(c.target.value),className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm",children:y.map(c=>T.jsx("option",{value:c,children:c},c))}),y.length===0&&T.jsx("p",{className:"mt-1 text-xs text-red-300",children:"no agents enabled on this repo"})]}),T.jsxs("div",{children:[T.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Issue number"}),T.jsx("input",{type:"number",min:1,value:P,onChange:c=>n(c.target.value),autoFocus:!0,placeholder:"42",className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm font-mono"}),T.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["tono will fetch the issue body via ",T.jsx("code",{children:"gh"})," and queue an implement task."]})]}),g&&T.jsx("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:g}),T.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[T.jsx(Xe,{type:"button",variant:"ghost",onClick:Y,children:"Cancel"}),T.jsx(Xe,{type:"submit",disabled:v||!P||y.length===0,children:v?"Queuing…":"Start session"})]})]})})}function Kd({children:k,onClose:Y}){return T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onMouseDown:G=>{G.target===G.currentTarget&&Y()},children:T.jsxs("div",{className:"w-full max-w-md rounded-lg border border-zinc-800 bg-zinc-950 p-5 shadow-2xl",children:[T.jsx("h2",{className:"text-base font-semibold text-zinc-100 mb-3",children:"Start a session"}),k]})})}const lf={queued:"queued",assigning:"assigning",running:"running",completed:"completed",pr_open:"PR open",pr_closed:"PR closed",merged:"merged",cleaned:"cleaned",failed:"failed"};function Uv({workers:k,disabled:Y,opening:G,onOpen:j}){const[J,se]=de.useState(!1),P=de.useRef(null);if(de.useEffect(()=>{if(!J)return;const n=f=>{var _;(_=P.current)!=null&&_.contains(f.target)||se(!1)};return window.addEventListener("mousedown",n),()=>window.removeEventListener("mousedown",n)},[J]),k.length===0)return T.jsx(Xe,{variant:"ghost",disabled:!0,title:"No workers connected — start a worker to open a terminal",children:"+ New terminal"});if(k.length===1){const n=k[0];return T.jsx(Xe,{variant:"ghost",disabled:Y,title:`Open a terminal on ${n.hostname}`,onClick:()=>j(n.id),children:G?"Opening…":`+ New terminal (${n.hostname})`})}return T.jsxs("div",{ref:P,className:"relative",children:[T.jsx(Xe,{variant:"ghost",disabled:Y,onClick:()=>se(n=>!n),children:G?"Opening…":"+ New terminal ▾"}),J&&T.jsxs("div",{className:"absolute right-0 z-20 mt-1 w-64 rounded-md border border-zinc-800 bg-zinc-900 shadow-lg overflow-hidden",children:[T.jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-zinc-500 border-b border-zinc-800",children:"Open shell on…"}),k.map(n=>T.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm text-zinc-200 hover:bg-zinc-800 transition flex items-center justify-between gap-2",onClick:()=>{se(!1),j(n.id)},children:[T.jsx("span",{className:"truncate",children:n.hostname}),T.jsx("span",{className:"text-[10px] font-mono text-zinc-500",children:n.id.slice(0,8)})]},n.id))]})]})}const Iv={queued:"neutral",assigning:"blue",running:"blue",completed:"green",pr_open:"amber",pr_closed:"red",merged:"orange",cleaned:"neutral",failed:"red"};function No(k){if(!k)return"—";const Y=Date.now()-Date.parse(k);return Y<6e4?`${Math.round(Y/1e3)}s ago`:Y<36e5?`${Math.round(Y/6e4)}m ago`:Y<864e5?`${Math.round(Y/36e5)}h ago`:`${Math.round(Y/864e5)}d ago`}function Pv(k){return k.status==="queued"?`queued ${No(k.createdAt)}`:k.status==="running"?`started ${No(k.startedAt)}`:`${No(k.completedAt??k.startedAt??k.createdAt)}`}function Fv({task:k}){const{navigate:Y}=es();return T.jsxs("button",{onClick:()=>Y(`/tasks/${k.id}`),className:"group w-full text-left rounded-md border border-zinc-800 bg-zinc-900/50 p-3 hover:border-zinc-700 hover:bg-zinc-900 transition",children:[T.jsxs("div",{className:"flex items-start justify-between gap-2",children:[T.jsxs("span",{className:"text-[11px] font-mono text-zinc-500",children:["#",k.id]}),T.jsx(Ji,{tone:Iv[k.status],children:lf[k.status]})]}),T.jsx("div",{className:"mt-1 text-sm font-medium text-zinc-100 line-clamp-2",children:k.issueTitle}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-zinc-500",children:[T.jsxs("span",{className:"font-mono truncate max-w-[160px]",children:[k.repoSlug,"#",k.issueNumber]}),T.jsx("span",{children:"·"}),T.jsx("span",{children:Pv(k)}),k.prUrl&&T.jsxs(T.Fragment,{children:[T.jsx("span",{children:"·"}),T.jsx("a",{href:k.prUrl,target:"_blank",rel:"noreferrer",onClick:G=>G.stopPropagation(),className:"text-orange-400 hover:underline",children:"PR"})]})]})]})}const qv=[{id:"queued",title:"Queued",hint:"implement + review",match:k=>k.status==="queued",sort:(k,Y)=>Date.parse(k.createdAt)-Date.parse(Y.createdAt),emptyMessage:"Empty."},{id:"building",title:"Building",hint:"implementing an issue",match:k=>k.status==="running"&&k.kind==="implement",sort:(k,Y)=>Date.parse(Y.startedAt??Y.createdAt)-Date.parse(k.startedAt??k.createdAt),emptyMessage:"No implementations running."},{id:"reviewing",title:"Reviewing",hint:"agent is reviewing a PR",match:k=>k.status==="running"&&k.kind==="review",sort:(k,Y)=>Date.parse(Y.startedAt??Y.createdAt)-Date.parse(k.startedAt??k.createdAt),emptyMessage:"No active reviews."},{id:"awaiting-review",title:"Awaiting review",hint:"PR open on GitHub",match:k=>k.status==="pr_open",sort:(k,Y)=>Date.parse(Y.completedAt??Y.createdAt)-Date.parse(k.completedAt??k.createdAt),emptyMessage:"No PRs awaiting review."},{id:"done",title:"Done",hint:"merged · completed · closed · failed",match:k=>k.status==="merged"||k.status==="pr_closed"||k.status==="completed"||k.status==="cleaned"||k.status==="failed",sort:(k,Y)=>Date.parse(Y.completedAt??Y.createdAt)-Date.parse(k.completedAt??k.createdAt),limit:12,emptyMessage:"Nothing finished yet."}];function Wv({column:k,tasks:Y}){const G=Y.filter(k.match);k.sort&&G.sort(k.sort);const j=k.limit?G.slice(0,k.limit):G,J=G.length-j.length;return T.jsxs("div",{className:"flex min-w-[260px] flex-1 flex-col rounded-lg border border-zinc-800 bg-zinc-950/40",children:[T.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-3 py-2",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-zinc-300",children:k.title}),T.jsx("span",{className:"text-[11px] text-zinc-500",children:G.length})]}),k.hint&&T.jsx("span",{className:"text-[10px] text-zinc-600 truncate",children:k.hint})]}),T.jsxs("div",{className:"flex-1 space-y-2 p-2",children:[j.length===0?T.jsx("div",{className:"rounded-md border border-dashed border-zinc-800 px-3 py-6 text-center text-xs text-zinc-600",children:k.emptyMessage??"—"}):j.map(se=>T.jsx(Fv,{task:se},se.id)),J>0&&T.jsxs("div",{className:"text-center text-[11px] text-zinc-500",children:["+",J," more"]})]})]})}function $v(){const{data:k}=bs(nt.tasks,3e3),{data:Y}=bs(nt.sessions,3e3),{data:G}=bs(nt.health,5e3),{data:j}=bs(nt.config,3e4),{data:J}=bs(nt.workers,5e3),{navigate:se}=es(),[P,n]=de.useState(!1),[f,_]=de.useState(!1),v=de.useMemo(()=>(J??[]).filter(u=>u.connected),[J]),l=(Y??[]).filter(u=>u.kind==="shell"&&u.status==="running"),g=de.useMemo(()=>k??[],[k]),b=((G==null?void 0:G.poller)??[]).filter(u=>u.lastError),y=j!==null&&j.repos.length===0;return T.jsxs("div",{className:"mx-auto max-w-[1400px] px-6 py-6 space-y-5",children:[T.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[T.jsx("h1",{className:"text-base font-semibold text-zinc-200",children:"Dashboard"}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Uv,{workers:v,disabled:f,opening:f,onOpen:async u=>{_(!0);try{const{sessionId:r}=await nt.newShell({workerId:u});se(`/shells/${encodeURIComponent(r)}`)}catch(r){alert(r.message)}finally{_(!1)}}}),T.jsx(Xe,{onClick:()=>n(!0),children:"+ Start session"})]})]}),y&&T.jsxs("div",{className:"rounded-md border border-zinc-800 bg-zinc-900/60 px-4 py-3 text-sm text-zinc-300 flex items-center justify-between",children:[T.jsx("span",{children:"No repos configured. Add one to start receiving labeled-issue triggers."}),T.jsx(Xe,{variant:"ghost",onClick:()=>se("/config"),children:"Edit config"})]}),b.length>0&&T.jsxs("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-4 py-3 text-sm text-red-300",children:[T.jsx("div",{className:"font-medium",children:"GitHub poller errors"}),T.jsx("ul",{className:"mt-1 space-y-0.5 text-xs font-mono",children:b.map(u=>T.jsxs("li",{children:[u.repo,": ",u.lastError]},u.repo))})]}),l.length>0&&T.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[T.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs uppercase tracking-wide text-zinc-400",children:["Shells ",T.jsxs("span",{className:"text-[11px] text-zinc-500 normal-case tracking-normal",children:[l.length," live"]})]}),T.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:l.map(u=>T.jsxs("button",{onClick:()=>se(`/shells/${encodeURIComponent(u.id)}`),className:"rounded-md border border-zinc-800 bg-zinc-950/60 px-3 py-2 text-left hover:border-zinc-700 hover:bg-zinc-900 transition flex items-center gap-3",children:[T.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-blue-400 animate-pulse"}),T.jsxs("span",{className:"text-[11px] text-zinc-500 font-mono",children:["pid ",u.pid]}),T.jsx("span",{className:"font-mono text-xs text-zinc-300 truncate",children:u.label??"shell"})]},u.id))})]}),T.jsx("div",{className:"flex gap-3 overflow-x-auto pb-3 lg:overflow-visible",children:qv.map(u=>T.jsx(Wv,{column:u,tasks:g},u.id))}),P&&j&&T.jsx(jv,{config:j,onClose:()=>n(!1)})]})}var Ho={exports:{}},Qd;function Gv(){return Qd||(Qd=1,(function(k,Y){(function(G,j){k.exports=j()})(globalThis,(()=>(()=>{var G={4567:function(P,n,f){var _=this&&this.__decorate||function(o,h,m,C){var S,w=arguments.length,p=w<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,h,m,C);else for(var x=o.length-1;x>=0;x--)(S=o[x])&&(p=(w<3?S(p):w>3?S(h,m,p):S(h,m))||p);return w>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(o,h){return function(m,C){h(m,C,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const l=f(9042),g=f(9924),b=f(844),y=f(4725),u=f(2585),r=f(3656);let c=n.AccessibilityManager=class extends b.Disposable{constructor(o,h,m,C){super(),this._terminal=o,this._coreBrowserService=m,this._renderService=C,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
50
+ `)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,r.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(o){for(let h=0;h<o;h++)this._handleChar(" ")}_handleChar(o){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==o&&(this._charsToAnnounce+=o):this._charsToAnnounce+=o,o===`
51
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,h){this._liveRegionDebouncer.refresh(o,h,this._terminal.rows)}_renderRows(o,h){const m=this._terminal.buffer,C=m.lines.length.toString();for(let S=o;S<=h;S++){const w=m.lines.get(m.ydisp+S),p=[],x=(w==null?void 0:w.translateToString(!0,void 0,void 0,p))||"",L=(m.ydisp+S+1).toString(),B=this._rowElements[S];B&&(x.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=x,this._rowColumns.set(B,p)),B.setAttribute("aria-posinset",L),B.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,h){const m=o.target,C=this._rowElements[h===0?1:this._rowElements.length-2];if(m.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==C)return;let S,w;if(h===0?(S=m,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(S=this._rowElements.shift(),w=m,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:o.anchorNode,offset:o.anchorOffset},m={node:o.focusNode,offset:o.focusOffset};if((h.node.compareDocumentPosition(m.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===m.node&&h.offset>m.offset)&&([h,m]=[m,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const C=this._rowElements.slice(-1)[0];if(m.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(m={node:C,offset:((x=C.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(m.node))return;const S=({node:L,offset:B})=>{const D=L instanceof Text?L.parentNode:L;let M=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(M))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(D);if(!U)return console.warn("columns is null. Race condition?"),null;let K=B<U.length?U[B]:U.slice(-1)[0]+1;return K>=this._terminal.cols&&(++M,K=0),{row:M,column:K}},w=S(h),p=S(m);if(w&&p){if(w.row>p.row||w.row===p.row&&w.column>=p.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(p.row-w.row)*this._terminal.cols-w.column+p.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=c=_([v(1,u.IInstantiationService),v(2,y.ICoreBrowserService),v(3,y.IRenderService)],c)},3614:(P,n)=>{function f(g){return g.replace(/\r?\n/g,"\r")}function _(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function v(g,b,y,u){g=_(g=f(g),y.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(g,!0),b.value=""}function l(g,b,y){const u=y.getBoundingClientRect(),r=g.clientX-u.left-10,c=g.clientY-u.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${r}px`,b.style.top=`${c}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=f,n.bracketTextForPaste=_,n.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},n.handlePasteEvent=function(g,b,y,u){g.stopPropagation(),g.clipboardData&&v(g.clipboardData.getData("text/plain"),b,y,u)},n.paste=v,n.moveTextAreaUnderMouseCursor=l,n.rightClickHandler=function(g,b,y,u,r){l(g,b,y),r&&u.rightClickSelect(g),b.value=u.selectionText,b.select()}},7239:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const _=f(1505);n.ColorContrastCache=class{constructor(){this._color=new _.TwoKeyMap,this._css=new _.TwoKeyMap}setCss(v,l,g){this._css.set(v,l,g)}getCss(v,l){return this._css.get(v,l)}setColor(v,l,g){this._color.set(v,l,g)}getColor(v,l){return this._color.get(v,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(f,_,v,l){f.addEventListener(_,v,l);let g=!1;return{dispose:()=>{g||(g=!0,f.removeEventListener(_,v,l))}}}},3551:function(P,n,f){var _=this&&this.__decorate||function(c,o,h,m){var C,S=arguments.length,w=S<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,o,h,m);else for(var p=c.length-1;p>=0;p--)(C=c[p])&&(w=(S<3?C(w):S>3?C(o,h,w):C(o,h))||w);return S>3&&w&&Object.defineProperty(o,h,w),w},v=this&&this.__param||function(c,o){return function(h,m){o(h,m,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const l=f(3656),g=f(8460),b=f(844),y=f(2585),u=f(4725);let r=n.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(c,o,h,m,C){super(),this._element=c,this._mouseService=o,this._renderService=h,this._bufferService=m,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const o=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const h=c.composedPath();for(let m=0;m<h.length;m++){const C=h[m];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,o){var m,C;this._activeProviderReplies&&o||((m=this._activeProviderReplies)==null||m.forEach((S=>{S==null||S.forEach((w=>{w.link.dispose&&w.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let h=!1;for(const[S,w]of this._linkProviderService.linkProviders.entries())o?(C=this._activeProviderReplies)!=null&&C.get(S)&&(h=this._checkLinkProviderResult(S,c,h)):w.provideLinks(c.y,(p=>{var L,B;if(this._isMouseOut)return;const x=p==null?void 0:p.map((D=>({link:D})));(L=this._activeProviderReplies)==null||L.set(S,x),h=this._checkLinkProviderResult(S,c,h),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,o){const h=new Set;for(let m=0;m<o.size;m++){const C=o.get(m);if(C)for(let S=0;S<C.length;S++){const w=C[S],p=w.link.range.start.y<c?0:w.link.range.start.x,x=w.link.range.end.y>c?this._bufferService.cols:w.link.range.end.x;for(let L=p;L<=x;L++){if(h.has(L)){C.splice(S--,1);break}h.add(L)}}}}_checkLinkProviderResult(c,o,h){var S;if(!this._activeProviderReplies)return h;const m=this._activeProviderReplies.get(c);let C=!1;for(let w=0;w<c;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(C=!0);if(!C&&m){const w=m.find((p=>this._linkAtPosition(p.link,o)));w&&(h=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let w=0;w<this._activeProviderReplies.size;w++){const p=(S=this._activeProviderReplies.get(w))==null?void 0:S.find((x=>this._linkAtPosition(x.link,o)));if(p){h=!0,this._handleNewLink(p);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const o=this._positionFromMouseEvent(c,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,o){this._currentLink&&this._lastMouseEvent&&(!c||!o||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(c.link,o)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var h,m;return(m=(h=this._currentLink)==null?void 0:h.state)==null?void 0:m.decorations.pointerCursor},set:h=>{var m;(m=this._currentLink)!=null&&m.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>{var h,m;return(m=(h=this._currentLink)==null?void 0:h.state)==null?void 0:m.decorations.underline},set:h=>{var m,C,S;(m=this._currentLink)!=null&&m.state&&((S=(C=this._currentLink)==null?void 0:C.state)==null?void 0:S.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const m=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(m,C),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(c,o,h){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(h,o.text)}_fireUnderlineEvent(c,o){const h=c.range,m=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-m-1,h.end.x,h.end.y-m-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(c,o,h){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(h,o.text)}_linkAtPosition(c,o){const h=c.range.start.y*this._bufferService.cols+c.range.start.x,m=c.range.end.y*this._bufferService.cols+c.range.end.x,C=o.y*this._bufferService.cols+o.x;return h<=C&&C<=m}_positionFromMouseEvent(c,o,h){const m=h.getCoords(c,o,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,o,h,m,C){return{x1:c,y1:o,x2:h,y2:m,cols:this._bufferService.cols,fg:C}}};n.Linkifier=r=_([v(1,u.IMouseService),v(2,u.IRenderService),v(3,y.IBufferService),v(4,u.ILinkProviderService)],r)},9042:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,n,f){var _=this&&this.__decorate||function(u,r,c,o){var h,m=arguments.length,C=m<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,r,c,o);else for(var S=u.length-1;S>=0;S--)(h=u[S])&&(C=(m<3?h(C):m>3?h(r,c,C):h(r,c))||C);return m>3&&C&&Object.defineProperty(r,c,C),C},v=this&&this.__param||function(u,r){return function(c,o){r(c,o,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const l=f(511),g=f(2585);let b=n.OscLinkProvider=class{constructor(u,r,c){this._bufferService=u,this._optionsService=r,this._oscLinkService=c}provideLinks(u,r){var x;const c=this._bufferService.buffer.lines.get(u-1);if(!c)return void r(void 0);const o=[],h=this._optionsService.rawOptions.linkHandler,m=new l.CellData,C=c.getTrimmedLength();let S=-1,w=-1,p=!1;for(let L=0;L<C;L++)if(w!==-1||c.hasContent(L)){if(c.loadCell(L,m),m.hasExtendedAttrs()&&m.extended.urlId){if(w===-1){w=L,S=m.extended.urlId;continue}p=m.extended.urlId!==S}else w!==-1&&(p=!0);if(p||w!==-1&&L===C-1){const B=(x=this._oscLinkService.getLinkData(S))==null?void 0:x.uri;if(B){const D={start:{x:w+1,y:u},end:{x:L+(p||L!==C-1?0:1),y:u}};let M=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const U=new URL(B);["http:","https:"].includes(U.protocol)||(M=!0)}catch{M=!0}M||o.push({text:B,range:D,activate:(U,K)=>h?h.activate(U,K,D):y(0,K),hover:(U,K)=>{var I;return(I=h==null?void 0:h.hover)==null?void 0:I.call(h,U,K,D)},leave:(U,K)=>{var I;return(I=h==null?void 0:h.leave)==null?void 0:I.call(h,U,K,D)}})}p=!1,m.hasExtendedAttrs()&&m.extended.urlId?(w=L,S=m.extended.urlId):(w=-1,S=-1)}}r(o)}};function y(u,r){if(confirm(`Do you want to navigate to ${r}?
52
+
53
+ WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=b=_([v(0,g.IBufferService),v(1,g.IOptionsService),v(2,g.IOscLinkService)],b)},6193:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(f,_){this._renderCallback=f,this._coreBrowserService=_,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(f){return this._refreshCallbacks.push(f),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(f,_,v){this._rowCount=v,f=f!==void 0?f:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_,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)return void this._runRefreshCallbacks();const f=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,_),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const f of this._refreshCallbacks)f(0);this._refreshCallbacks=[]}}},3236:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const _=f(3614),v=f(3656),l=f(3551),g=f(9042),b=f(3730),y=f(1680),u=f(3107),r=f(5744),c=f(2950),o=f(1296),h=f(428),m=f(4269),C=f(5114),S=f(8934),w=f(3230),p=f(9312),x=f(4725),L=f(6731),B=f(8055),D=f(8969),M=f(8460),U=f(844),K=f(6114),I=f(8437),F=f(2584),$=f(7399),R=f(5941),H=f(9074),A=f(2585),z=f(5435),V=f(4567),Z=f(779);class he extends D.CoreTerminal{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}constructor(q={}){super(q),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(H.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,ne)=>this.refresh(N,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this.register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,U.toDisposable)((()=>{var N,ne;this._customKeyEventHandler=void 0,(ne=(N=this.element)==null?void 0:N.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(q){if(this._themeService)for(const N of q){let ne,re="";switch(N.index){case 256:ne="foreground",re="10";break;case 257:ne="background",re="11";break;case 258:ne="cursor",re="12";break;default:ne="ansi",re="4;"+N.index}switch(N.type){case 0:const _e=B.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${F.C0.ESC}]${re};${(0,R.toRgbString)(_e)}${F.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((fe=>fe.ansi[N.index]=B.channels.toColor(...N.color)));else{const fe=ne;this._themeService.modifyColors((xe=>xe[fe]=B.channels.toColor(...N.color)))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(q){q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(F.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var q;return(q=this.textarea)==null?void 0:q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(F.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const q=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(q);if(!N)return;const ne=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,_e=N.getWidth(ne),fe=this._renderService.dimensions.css.cell.width*_e,xe=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=xe+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,_.copyHandler)(N,this._selectionService)})));const q=N=>(0,_.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",q)),this.register((0,v.addDisposableDomListener)(this.element,"paste",q)),K.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,_.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,_.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,_.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(q=>this._keyUp(q)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(q=>this._keyDown(q)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(q=>this._keyPress(q)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(q=>this._compositionHelper.compositionupdate(q)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(q=>this._inputEvent(q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(q){var ne;if(!q)throw new Error("Terminal requires a parent element.");if(q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ne=this.element)==null?void 0:ne.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=q.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"),q.appendChild(this.element);const N=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,v.addDisposableDomListener)(this.screenElement,"mousemove",(re=>this.updateCursorStyle(re)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),K.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(C.CoreBrowserService,this.textarea,q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(re=>this._handleTextAreaFocus(re)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((re=>this._onRender.fire(re)))),this.onResize((re=>this._renderService.resize(re.cols,re.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((re=>this.scrollLines(re.amount,re.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(p.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((re=>this.scrollLines(re.amount,re.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((re=>this._renderService.handleSelectionChanged(re.start,re.end,re.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((re=>{this.textarea.value=re,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((re=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(re=>this._selectionService.handleMouseDown(re)))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(re=>this._handleScreenReaderModeOptionChange(re)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(re=>{!this._overviewRulerRenderer&&re&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const q=this,N=this.element;function ne(fe){const xe=q._mouseService.getMouseReportCoords(fe,q.screenElement);if(!xe)return!1;let pe,Ne;switch(fe.overrideType||fe.type){case"mousemove":Ne=32,fe.buttons===void 0?(pe=3,fe.button!==void 0&&(pe=fe.button<3?fe.button:3)):pe=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Ne=0,pe=fe.button<3?fe.button:3;break;case"mousedown":Ne=1,pe=fe.button<3?fe.button:3;break;case"wheel":if(q._customWheelEventHandler&&q._customWheelEventHandler(fe)===!1||q.viewport.getLinesScrolled(fe)===0)return!1;Ne=fe.deltaY<0?0:1,pe=4;break;default:return!1}return!(Ne===void 0||pe===void 0||pe>4)&&q.coreMouseService.triggerMouseEvent({col:xe.col,row:xe.row,x:xe.x,y:xe.y,button:pe,action:Ne,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:fe=>(ne(fe),fe.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(fe)),wheel:fe=>(ne(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ne(fe)},mousemove:fe=>{fe.buttons||ne(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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()),8&fe?re.mousemove||(N.addEventListener("mousemove",_e.mousemove),re.mousemove=_e.mousemove):(N.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&fe?re.wheel||(N.addEventListener("wheel",_e.wheel,{passive:!1}),re.wheel=_e.wheel):(N.removeEventListener("wheel",re.wheel),re.wheel=null),2&fe?re.mouseup||(re.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&fe?re.mousedrag||(re.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(N,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ne(fe),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(fe)}))),this.register((0,v.addDisposableDomListener)(N,"wheel",(fe=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const xe=this.viewport.getLinesScrolled(fe);if(xe===0)return;const pe=F.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Ne="";for(let Qe=0;Qe<Math.abs(xe);Qe++)Ne+=pe;return this.coreService.triggerDataEvent(Ne,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(N,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(N,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(q,N){var ne;(ne=this._renderService)==null||ne.refreshRows(q,N)}updateCursorStyle(q){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(q)?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(q,N,ne=0){var re;ne===1?(super.scrollLines(q,N,ne),this.refresh(0,this.rows-1)):(re=this.viewport)==null||re.scrollLines(q)}paste(q){(0,_.paste)(q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(q){this._customKeyEventHandler=q}attachCustomWheelEventHandler(q){this._customWheelEventHandler=q}registerLinkProvider(q){return this._linkProviderService.registerLinkProvider(q)}registerCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(q);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+q)}registerDecoration(q){return this._decorationService.registerDecoration(q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(q,N,ne){this._selectionService.setSelection(q,N,ne)}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(){var q;(q=this._selectionService)==null||q.clearSelection()}selectAll(){var q;(q=this._selectionService)==null||q.selectAll()}selectLines(q,N){var ne;(ne=this._selectionService)==null||ne.selectLines(q,N)}_keyDown(q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&q.altKey;if(!N&&!this._compositionHelper.keydown(q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||q.key!=="Dead"&&q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,$.evaluateKeyboardEvent)(q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(q),ne.type===3||ne.type===2){const re=this.rows-1;return this.scrollLines(ne.type===2?-re:re),this.cancel(q,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,q)||(ne.cancel&&this.cancel(q,!0),!ne.key||!!(q.key&&!q.ctrlKey&&!q.altKey&&!q.metaKey&&q.key.length===1&&q.key.charCodeAt(0)>=65&&q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==F.C0.ETX&&ne.key!==F.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||q.altKey||q.ctrlKey?this.cancel(q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(q,N){const ne=q.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||q.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||q.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?ne:ne&&(!N.keyCode||N.keyCode>47)}_keyUp(q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1||((function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18})(q)||this.focus(),this.updateCursorStyle(q),this._keyPressHandled=!1)}_keyPress(q){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;if(this.cancel(q),q.charCode)N=q.charCode;else if(q.which===null||q.which===void 0)N=q.keyCode;else{if(q.which===0||q.charCode===0)return!1;N=q.which}return!(!N||(q.altKey||q.ctrlKey||q.metaKey)&&!this._isThirdLevelShift(this.browser,q)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(q){if(q.data&&q.inputType==="insertText"&&(!q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=q.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(q),!0}return!1}resize(q,N){q!==this.cols||N!==this.rows?super.resize(q,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(q,N){var ne,re;(ne=this._charSizeService)==null||ne.measure(),(re=this.viewport)==null||re.syncScrollArea(!0)}clear(){var q;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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(I.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(q=this.viewport)==null||q.reset(),this.refresh(0,this.rows-1)}}reset(){var N,ne;this.options.rows=this.rows,this.options.cols=this.cols;const q=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(ne=this.viewport)==null||ne.reset(),this._customKeyEventHandler=q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var q;(q=this._renderService)==null||q.clearTextureAtlas()}_reportFocus(){var q;(q=this.element)!=null&&q.classList.contains("focus")?this.coreService.triggerDataEvent(F.C0.ESC+"[I"):this.coreService.triggerDataEvent(F.C0.ESC+"[O")}_reportWindowsOptions(q){if(this._renderService)switch(q){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${F.C0.ESC}[4;${ne};${N}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${F.C0.ESC}[6;${_e};${re}t`)}}cancel(q,N){if(this.options.cancelEvents||N)return q.preventDefault(),q.stopPropagation(),!1}}n.Terminal=he},9924:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(f,_=1e3){this._renderCallback=f,this._debounceThresholdMS=_,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(f,_,v){this._rowCount=v,f=f!==void 0?f:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=l-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const f=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,_)}}},1680:function(P,n,f){var _=this&&this.__decorate||function(c,o,h,m){var C,S=arguments.length,w=S<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,o,h,m);else for(var p=c.length-1;p>=0;p--)(C=c[p])&&(w=(S<3?C(w):S>3?C(o,h,w):C(o,h))||w);return S>3&&w&&Object.defineProperty(o,h,w),w},v=this&&this.__param||function(c,o){return function(h,m){o(h,m,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const l=f(3656),g=f(4725),b=f(8460),y=f(844),u=f(2585);let r=n.Viewport=class extends y.Disposable{constructor(c,o,h,m,C,S,w,p){super(),this._viewportElement=c,this._scrollArea=o,this._bufferService=h,this._optionsService=m,this._charSizeService=C,this._renderService=S,this._coreBrowserService=w,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((x=>this._renderDimensions=x))),this._handleThemeChange(p.colors),this.register(p.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(c){if(c)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(c,o){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&h<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const o=this._getPixelsScrolled(c);return o!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(c,o){var p;let h,m="";const C=[],S=o??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let x=c;x<S;x++){const L=w.get(x);if(!L)continue;const B=(p=w.get(x+1))==null?void 0:p.isWrapped;if(m+=L.translateToString(!B),!B||x===w.length-1){const D=document.createElement("div");D.textContent=m,C.push(D),m.length>0&&(h=D),m=""}}return{bufferElements:C,cursorElement:h}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(c,o){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&o.altKey||h==="ctrl"&&o.ctrlKey||h==="shift"&&o.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const o=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}};n.Viewport=r=_([v(2,u.IBufferService),v(3,u.IOptionsService),v(4,g.ICharSizeService),v(5,g.IRenderService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],r)},3107:function(P,n,f){var _=this&&this.__decorate||function(u,r,c,o){var h,m=arguments.length,C=m<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,r,c,o);else for(var S=u.length-1;S>=0;S--)(h=u[S])&&(C=(m<3?h(C):m>3?h(r,c,C):h(r,c))||C);return m>3&&C&&Object.defineProperty(r,c,C),C},v=this&&this.__param||function(u,r){return function(c,o){r(c,o,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const l=f(4725),g=f(844),b=f(2585);let y=n.BufferDecorationRenderer=class extends g.Disposable{constructor(u,r,c,o,h){super(),this._screenElement=u,this._bufferService=r,this._coreBrowserService=c,this._decorationService=o,this._renderService=h,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((m=>this._removeDecoration(m)))),this.register((0,g.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var o;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((o=u==null?void 0:u.options)==null?void 0:o.layer)==="top"),r.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=u.options.x??0;return c&&c>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(u,r),r}_refreshStyle(u){const r=u.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let c=this._decorationElements.get(u);c||(c=this._createElement(u),u.element=c,this._decorationElements.set(u,c),this._container.appendChild(c),u.onDispose((()=>{this._decorationElements.delete(u),c.remove()}))),c.style.top=r*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(c)}}_refreshXPosition(u,r=u.element){if(!r)return;const c=u.options.x??0;(u.options.anchor||"left")==="right"?r.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var r;(r=this._decorationElements.get(u))==null||r.remove(),this._decorationElements.delete(u),u.dispose()}};n.BufferDecorationRenderer=y=_([v(1,b.IBufferService),v(2,l.ICoreBrowserService),v(3,b.IDecorationService),v(4,l.IRenderService)],y)},5871:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=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(f){if(f.options.overviewRulerOptions){for(const _ of this._zones)if(_.color===f.options.overviewRulerOptions.color&&_.position===f.options.overviewRulerOptions.position){if(this._lineIntersectsZone(_,f.marker.line))return;if(this._lineAdjacentToZone(_,f.marker.line,f.options.overviewRulerOptions.position))return void this._addLineToZone(_,f.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=f.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=f.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=f.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=f.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:f.options.overviewRulerOptions.color,position:f.options.overviewRulerOptions.position,startBufferLine:f.marker.line,endBufferLine:f.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(f){this._linePadding=f}_lineIntersectsZone(f,_){return _>=f.startBufferLine&&_<=f.endBufferLine}_lineAdjacentToZone(f,_,v){return _>=f.startBufferLine-this._linePadding[v||"full"]&&_<=f.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(f,_){f.startBufferLine=Math.min(f.startBufferLine,_),f.endBufferLine=Math.max(f.endBufferLine,_)}}},5744:function(P,n,f){var _=this&&this.__decorate||function(h,m,C,S){var w,p=arguments.length,x=p<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,m,C,S);else for(var L=h.length-1;L>=0;L--)(w=h[L])&&(x=(p<3?w(x):p>3?w(m,C,x):w(m,C))||x);return p>3&&x&&Object.defineProperty(m,C,x),x},v=this&&this.__param||function(h,m){return function(C,S){m(C,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const l=f(5871),g=f(4725),b=f(844),y=f(2585),u={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let o=n.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,m,C,S,w,p,x){var B;super(),this._viewportElement=h,this._screenElement=m,this._bufferService=C,this._decorationService=S,this._renderService=w,this._optionsService=p,this._coreBrowserService=x,this._colorZoneStore=new l.ColorZoneStore,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(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var D;(D=this._canvas)==null||D.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const h=Math.floor(this._canvas.width/3),m=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=h,r.center=m,r.right=h,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=r.left,c.right=r.left+r.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,m=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);u.left=m,u.center=m,u.right=m}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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(const m of this._decorationService.decorations)this._colorZoneStore.addDecoration(m);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const m of h)m.position!=="full"&&this._renderColorZone(m);for(const m of h)m.position==="full"&&this._renderColorZone(m);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(c[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-u[h.position||"full"]/2),r[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[h.position||"full"]))}_queueRefresh(h,m){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=m||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=o=_([v(2,y.IBufferService),v(3,y.IDecorationService),v(4,g.IRenderService),v(5,y.IOptionsService),v(6,g.ICoreBrowserService)],o)},2950:function(P,n,f){var _=this&&this.__decorate||function(u,r,c,o){var h,m=arguments.length,C=m<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,r,c,o);else for(var S=u.length-1;S>=0;S--)(h=u[S])&&(C=(m<3?h(C):m>3?h(r,c,C):h(r,c))||C);return m>3&&C&&Object.defineProperty(r,c,C),C},v=this&&this.__param||function(u,r){return function(c,o){r(c,o,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const l=f(4725),g=f(2585),b=f(2584);let y=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,r,c,o,h,m){this._textarea=u,this._compositionView=r,this._bufferService=c,this._optionsService=o,this._coreService=h,this._renderService=m,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,c=r.replace(u,"");this._dataAlreadySent=c,r.length>u.length?this._coreService.triggerDataEvent(c,!0):r.length<u.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):r.length===u.length&&r!==u&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const m=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}u||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=y=_([v(2,g.IBufferService),v(3,g.IOptionsService),v(4,g.ICoreService),v(5,l.IRenderService)],y)},9806:(P,n)=>{function f(_,v,l){const g=l.getBoundingClientRect(),b=_.getComputedStyle(l),y=parseInt(b.getPropertyValue("padding-left")),u=parseInt(b.getPropertyValue("padding-top"));return[v.clientX-g.left-y,v.clientY-g.top-u]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=f,n.getCoords=function(_,v,l,g,b,y,u,r,c){if(!y)return;const o=f(_,v,l);return o?(o[0]=Math.ceil((o[0]+(c?u/2:0))/u),o[1]=Math.ceil(o[1]/r),o[0]=Math.min(Math.max(o[0],1),g+(c?1:0)),o[1]=Math.min(Math.max(o[1],1),b),o):void 0}},9504:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const _=f(2584);function v(r,c,o,h){const m=r-l(r,o),C=c-l(c,o),S=Math.abs(m-C)-(function(w,p,x){let L=0;const B=w-l(w,x),D=p-l(p,x);for(let M=0;M<Math.abs(B-D);M++){const U=g(w,p)==="A"?-1:1,K=x.buffer.lines.get(B+U*M);K!=null&&K.isWrapped&&L++}return L})(r,c,o);return u(S,y(g(r,c),h))}function l(r,c){let o=0,h=c.buffer.lines.get(r),m=h==null?void 0:h.isWrapped;for(;m&&r>=0&&r<c.rows;)o++,h=c.buffer.lines.get(--r),m=h==null?void 0:h.isWrapped;return o}function g(r,c){return r>c?"A":"B"}function b(r,c,o,h,m,C){let S=r,w=c,p="";for(;S!==o||w!==h;)S+=m?1:-1,m&&S>C.cols-1?(p+=C.buffer.translateBufferLineToString(w,!1,r,S),S=0,r=0,w++):!m&&S<0&&(p+=C.buffer.translateBufferLineToString(w,!1,0,r+1),S=C.cols-1,r=S,w--);return p+C.buffer.translateBufferLineToString(w,!1,r,S)}function y(r,c){const o=c?"O":"[";return _.C0.ESC+o+r}function u(r,c){r=Math.floor(r);let o="";for(let h=0;h<r;h++)o+=c;return o}n.moveToCellSequence=function(r,c,o,h){const m=o.buffer.x,C=o.buffer.y;if(!o.buffer.hasScrollback)return(function(p,x,L,B,D,M){return v(x,B,D,M).length===0?"":u(b(p,x,p,x-l(x,D),!1,D).length,y("D",M))})(m,C,0,c,o,h)+v(C,c,o,h)+(function(p,x,L,B,D,M){let U;U=v(x,B,D,M).length>0?B-l(B,D):x;const K=B,I=(function(F,$,R,H,A,z){let V;return V=v(R,H,A,z).length>0?H-l(H,A):$,F<R&&V<=H||F>=R&&V<H?"C":"D"})(p,x,L,B,D,M);return u(b(p,U,L,K,I==="C",D).length,y(I,M))})(m,C,r,c,o,h);let S;if(C===c)return S=m>r?"D":"C",u(Math.abs(m-r),y(S,h));S=C>c?"D":"C";const w=Math.abs(C-c);return u((function(p,x){return x.cols-p})(C>c?r:m,o)+(w-1)*o.cols+1+((C>c?m:r)-1),y(S,h))}},1296:function(P,n,f){var _=this&&this.__decorate||function(M,U,K,I){var F,$=arguments.length,R=$<3?U:I===null?I=Object.getOwnPropertyDescriptor(U,K):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(M,U,K,I);else for(var H=M.length-1;H>=0;H--)(F=M[H])&&(R=($<3?F(R):$>3?F(U,K,R):F(U,K))||R);return $>3&&R&&Object.defineProperty(U,K,R),R},v=this&&this.__param||function(M,U){return function(K,I){U(K,I,M)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const l=f(3787),g=f(2550),b=f(2223),y=f(6171),u=f(6052),r=f(4725),c=f(8055),o=f(8460),h=f(844),m=f(2585),C="xterm-dom-renderer-owner-",S="xterm-rows",w="xterm-fg-",p="xterm-bg-",x="xterm-focus",L="xterm-selection";let B=1,D=n.DomRenderer=class extends h.Disposable{constructor(M,U,K,I,F,$,R,H,A,z,V,Z,he){super(),this._terminal=M,this._document=U,this._element=K,this._screenElement=I,this._viewportElement=F,this._helperContainer=$,this._linkifier2=R,this._charSizeService=A,this._optionsService=z,this._bufferService=V,this._coreBrowserService=Z,this._themeService=he,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(C+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.WidthCache(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(){const M=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*M,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*M),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/M),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/M),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(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,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(M){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${S} { color: ${M.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${S} .xterm-dim { color: ${c.color.multiplyOpacity(M.foreground,.5).css};}`,U+=`${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;}`;const K=`blink_underline_${this._terminalClass}`,I=`blink_bar_${this._terminalClass}`,F=`blink_block_${this._terminalClass}`;U+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${I} { 50% { box-shadow: none; }}`,U+=`@keyframes ${F} { 0% { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css}; } 50% { background-color: inherit; color: ${M.cursor.css}; }}`,U+=`${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${M.cursor.css} !important; color: ${M.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${M.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${M.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${M.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${M.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${M.selectionInactiveBackgroundOpaque.css};}`;for(const[$,R]of M.ansi.entries())U+=`${this._terminalSelector} .${w}${$} { color: ${R.css}; }${this._terminalSelector} .${w}${$}.xterm-dim { color: ${c.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${p}${$} { background-color: ${R.css}; }`;U+=`${this._terminalSelector} .${w}${b.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(M.background).css}; }${this._terminalSelector} .${w}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(M.background),.5).css}; }${this._terminalSelector} .${p}${b.INVERTED_DEFAULT_COLOR} { background-color: ${M.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const M=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${M}px`,this._rowFactory.defaultSpacing=M}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(M,U){for(let K=this._rowElements.length;K<=U;K++){const I=this._document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(M,U){this._refreshRowElements(M,U),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(x),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(M,U,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(M,U,K),this.renderRows(0,this._bufferService.rows-1),!M||!U)return;this._selectionRenderModel.update(this._terminal,M,U,K);const I=this._selectionRenderModel.viewportStartRow,F=this._selectionRenderModel.viewportEndRow,$=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if($>=this._bufferService.rows||R<0)return;const H=this._document.createDocumentFragment();if(K){const A=M[0]>U[0];H.appendChild(this._createSelectionElement($,A?U[0]:M[0],A?M[0]:U[0],R-$+1))}else{const A=I===$?M[0]:0,z=$===F?U[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement($,A,z));const V=R-$-1;if(H.appendChild(this._createSelectionElement($+1,0,this._bufferService.cols,V)),$!==R){const Z=F===R?U[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(R,0,Z))}}this._selectionContainer.appendChild(H)}_createSelectionElement(M,U,K,I=1){const F=this._document.createElement("div"),$=U*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(K-U);return $+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-$),F.style.height=I*this.dimensions.css.cell.height+"px",F.style.top=M*this.dimensions.css.cell.height+"px",F.style.left=`${$}px`,F.style.width=`${R}px`,F}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(const M of this._rowElements)M.replaceChildren()}renderRows(M,U){const K=this._bufferService.buffer,I=K.ybase+K.y,F=Math.min(K.x,this._bufferService.cols-1),$=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,H=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=M;A<=U;A++){const z=A+K.ydisp,V=this._rowElements[A],Z=K.lines.get(z);if(!V||!Z)break;V.replaceChildren(...this._rowFactory.createRow(Z,z,z===I,R,H,F,$,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!0)}_handleLinkLeave(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!1)}_setCellUnderline(M,U,K,I,F,$){K<0&&(M=0),I<0&&(U=0);const R=this._bufferService.rows-1;K=Math.max(Math.min(K,R),0),I=Math.max(Math.min(I,R),0),F=Math.min(F,this._bufferService.cols);const H=this._bufferService.buffer,A=H.ybase+H.y,z=Math.min(H.x,F-1),V=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=K;ue<=I;++ue){const q=ue+H.ydisp,N=this._rowElements[ue],ne=H.lines.get(q);if(!N||!ne)break;N.replaceChildren(...this._rowFactory.createRow(ne,q,q===A,Z,he,z,V,this.dimensions.css.cell.width,this._widthCache,$?ue===K?M:0:-1,$?(ue===I?U:F)-1:-1))}}};n.DomRenderer=D=_([v(7,m.IInstantiationService),v(8,r.ICharSizeService),v(9,m.IOptionsService),v(10,m.IBufferService),v(11,r.ICoreBrowserService),v(12,r.IThemeService)],D)},3787:function(P,n,f){var _=this&&this.__decorate||function(S,w,p,x){var L,B=arguments.length,D=B<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,w,p,x);else for(var M=S.length-1;M>=0;M--)(L=S[M])&&(D=(B<3?L(D):B>3?L(w,p,D):L(w,p))||D);return B>3&&D&&Object.defineProperty(w,p,D),D},v=this&&this.__param||function(S,w){return function(p,x){w(p,x,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const l=f(2223),g=f(643),b=f(511),y=f(2585),u=f(8055),r=f(4725),c=f(4269),o=f(6171),h=f(3734);let m=n.DomRendererRowFactory=class{constructor(S,w,p,x,L,B,D){this._document=S,this._characterJoinerService=w,this._optionsService=p,this._coreBrowserService=x,this._coreService=L,this._decorationService=B,this._themeService=D,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,w,p){this._selectionStart=S,this._selectionEnd=w,this._columnSelectMode=p}createRow(S,w,p,x,L,B,D,M,U,K,I){const F=[],$=this._characterJoinerService.getJoinedCharacters(w),R=this._themeService.colors;let H,A=S.getNoBgTrimmedLength();p&&A<B+1&&(A=B+1);let z=0,V="",Z=0,he=0,ue=0,q=!1,N=0,ne=!1,re=0;const _e=[],fe=K!==-1&&I!==-1;for(let xe=0;xe<A;xe++){S.loadCell(xe,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let Ne=!1,Qe=xe,be=this._workCell;if($.length>0&&xe===$[0][0]){Ne=!0;const Re=$.shift();be=new c.JoinedCellData(this._workCell,S.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),Qe=Re[1]-1,pe=be.getWidth()}const Bt=this._isCellInSelection(xe,w),si=p&&xe===B,Be=fe&&xe>=K&&xe<=I;let Ae=!1;this._decorationService.forEachDecorationAtCell(xe,w,void 0,(Re=>{Ae=!0}));let De=be.getChars()||g.WHITESPACE_CELL_CHAR;if(De===" "&&(be.isUnderline()||be.isOverline())&&(De=" "),re=pe*M-U.get(De,be.isBold(),be.isItalic()),H){if(z&&(Bt&&ne||!Bt&&!ne&&be.bg===Z)&&(Bt&&ne&&R.selectionForeground||be.fg===he)&&be.extended.ext===ue&&Be===q&&re===N&&!si&&!Ne&&!Ae){be.isInvisible()?V+=g.WHITESPACE_CELL_CHAR:V+=De,z++;continue}z&&(H.textContent=V),H=this._document.createElement("span"),z=0,V=""}else H=this._document.createElement("span");if(Z=be.bg,he=be.fg,ue=be.extended.ext,q=Be,N=re,ne=Bt,Ne&&B>=xe&&B<=Qe&&(B=xe),!this._coreService.isCursorHidden&&si&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&_e.push("xterm-cursor-blink"),_e.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(be.isBold()&&_e.push("xterm-bold"),be.isItalic()&&_e.push("xterm-italic"),be.isDim()&&_e.push("xterm-dim"),V=be.isInvisible()?g.WHITESPACE_CELL_CHAR:be.getChars()||g.WHITESPACE_CELL_CHAR,be.isUnderline()&&(_e.push(`xterm-underline-${be.extended.underlineStyle}`),V===" "&&(V=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())H.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Re=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Re<8&&(Re+=8),H.style.textDecorationColor=R.ansi[Re].css}be.isOverline()&&(_e.push("xterm-overline"),V===" "&&(V=" ")),be.isStrikethrough()&&_e.push("xterm-strikethrough"),Be&&(H.style.textDecoration="underline");let ve=be.getFgColor(),Ce=be.getFgColorMode(),Ze=be.getBgColor(),Fe=be.getBgColorMode();const Ft=!!be.isInverse();if(Ft){const Re=ve;ve=Ze,Ze=Re;const Jt=Ce;Ce=Fe,Fe=Jt}let ht,wt,et,qe=!1;switch(this._decorationService.forEachDecorationAtCell(xe,w,void 0,(Re=>{Re.options.layer!=="top"&&qe||(Re.backgroundColorRGB&&(Fe=50331648,Ze=Re.backgroundColorRGB.rgba>>8&16777215,ht=Re.backgroundColorRGB),Re.foregroundColorRGB&&(Ce=50331648,ve=Re.foregroundColorRGB.rgba>>8&16777215,wt=Re.foregroundColorRGB),qe=Re.options.layer==="top")})),!qe&&Bt&&(ht=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,Ze=ht.rgba>>8&16777215,Fe=50331648,qe=!0,R.selectionForeground&&(Ce=50331648,ve=R.selectionForeground.rgba>>8&16777215,wt=R.selectionForeground)),qe&&_e.push("xterm-decoration-top"),Fe){case 16777216:case 33554432:et=R.ansi[Ze],_e.push(`xterm-bg-${Ze}`);break;case 50331648:et=u.channels.toColor(Ze>>16,Ze>>8&255,255&Ze),this._addStyle(H,`background-color:#${C((Ze>>>0).toString(16),"0",6)}`);break;default:Ft?(et=R.foreground,_e.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):et=R.background}switch(ht||be.isDim()&&(ht=u.color.multiplyOpacity(et,.5)),Ce){case 16777216:case 33554432:be.isBold()&&ve<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ve+=8),this._applyMinimumContrast(H,et,R.ansi[ve],be,ht,void 0)||_e.push(`xterm-fg-${ve}`);break;case 50331648:const Re=u.channels.toColor(ve>>16&255,ve>>8&255,255&ve);this._applyMinimumContrast(H,et,Re,be,ht,wt)||this._addStyle(H,`color:#${C(ve.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(H,et,R.foreground,be,ht,wt)||Ft&&_e.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}_e.length&&(H.className=_e.join(" "),_e.length=0),si||Ne||Ae?H.textContent=V:z++,re!==this.defaultSpacing&&(H.style.letterSpacing=`${re}px`),F.push(H),xe=Qe}return H&&z&&(H.textContent=V),F}_applyMinimumContrast(S,w,p,x,L,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const D=this._getContrastCache(x);let M;if(L||B||(M=D.getColor(w.rgba,p.rgba)),M===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);M=u.color.ensureContrastRatio(L||w,B||p,U),D.setColor((L||w).rgba,(B||p).rgba,M??null)}return!!M&&(this._addStyle(S,`color:${M.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,w){S.setAttribute("style",`${S.getAttribute("style")||""}${w};`)}_isCellInSelection(S,w){const p=this._selectionStart,x=this._selectionEnd;return!(!p||!x)&&(this._columnSelectMode?p[0]<=x[0]?S>=p[0]&&w>=p[1]&&S<x[0]&&w<=x[1]:S<p[0]&&w>=p[1]&&S>=x[0]&&w<=x[1]:w>p[1]&&w<x[1]||p[1]===x[1]&&w===p[1]&&S>=p[0]&&S<x[0]||p[1]<x[1]&&w===x[1]&&S<x[0]||p[1]<x[1]&&w===p[1]&&S>=p[0])}};function C(S,w,p){for(;S.length<p;)S=w+S;return S}n.DomRendererRowFactory=m=_([v(1,r.ICharacterJoinerService),v(2,y.IOptionsService),v(3,r.ICoreBrowserService),v(4,y.ICoreService),v(5,y.IDecorationService),v(6,r.IThemeService)],m)},2550:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(f,_){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=f.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";const v=f.createElement("span");v.classList.add("xterm-char-measure-element");const l=f.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const g=f.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=f.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[v,l,g,b],this._container.appendChild(v),this._container.appendChild(l),this._container.appendChild(g),this._container.appendChild(b),_.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(f,_,v,l){f===this._font&&_===this._fontSize&&v===this._weight&&l===this._weightBold||(this._font=f,this._fontSize=_,this._weight=v,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(f,_,v){let l=0;if(!_&&!v&&f.length===1&&(l=f.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const y=this._measure(f,0);return y>0&&(this._flat[l]=y),y}let g=f;_&&(g+="B"),v&&(g+="I");let b=this._holey.get(g);if(b===void 0){let y=0;_&&(y|=1),v&&(y|=2),b=this._measure(f,y),b>0&&this._holey.set(g,b)}return b}_measure(f,_){const v=this._measureElements[_];return v.textContent=f.repeat(32),v.offsetWidth/32}}},2223:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const _=f(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=_.isFirefox||_.isLegacyEdge?"bottom":"ideographic"},6171:(P,n)=>{function f(v){return 57508<=v&&v<=57558}function _(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},n.isPowerlineGlyph=f,n.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},n.isEmoji=_,n.allowRescaling=function(v,l,g,b){return l===1&&g>Math.ceil(1.5*b)&&v!==void 0&&v>255&&!_(v)&&!f(v)&&!(function(y){return 57344<=y&&y<=63743})(v)},n.treatGlyphAsBackgroundColor=function(v){return f(v)||(function(l){return 9472<=l&&l<=9631})(v)},n.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},n.computeNextVariantOffset=function(v,l,g=0){return(v-(2*Math.round(l)-g))%(2*Math.round(l))}},6052:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class f{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(v,l,g,b=!1){if(this.selectionStart=l,this.selectionEnd=g,!l||!g||l[0]===g[0]&&l[1]===g[1])return void this.clear();const y=v.buffers.active.ydisp,u=l[1]-y,r=g[1]-y,c=Math.max(u,0),o=Math.min(r,v.rows-1);c>=v.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=u,this.viewportEndRow=r,this.viewportCappedStartRow=c,this.viewportCappedEndRow=o,this.startCol=l[0],this.endCol=g[0])}isCellSelected(v,l,g){return!!this.hasSelection&&(g-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&g>=this.viewportCappedStartRow&&l<this.endCol&&g<=this.viewportCappedEndRow:l<this.startCol&&g>=this.viewportCappedStartRow&&l>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol)}}n.createSelectionRenderModel=function(){return new f}},456:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(f){this._bufferService=f,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.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()){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?f%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)-1]:[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[Math.max(f,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const f=this.selectionStart,_=this.selectionEnd;return!(!f||!_)&&(f[1]>_[1]||f[1]===_[1]&&f[0]>_[0])}handleTrim(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(P,n,f){var _=this&&this.__decorate||function(o,h,m,C){var S,w=arguments.length,p=w<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,h,m,C);else for(var x=o.length-1;x>=0;x--)(S=o[x])&&(p=(w<3?S(p):w>3?S(h,m,p):S(h,m))||p);return w>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(o,h){return function(m,C){h(m,C,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const l=f(2585),g=f(8460),b=f(844);let y=n.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,h,m){super(),this._optionsService=m,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new r(o,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};n.CharSizeService=y=_([v(2,l.IOptionsService)],y);class u extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,m){h!==void 0&&h>0&&m!==void 0&&m>0&&(this._result.width=h,this._result.height=m)}}class r extends u{constructor(h,m,C){super(),this._document=h,this._parentElement=m,this._optionsService=C,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}}class c extends u{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const m=this._ctx.measureText("W");if(!("width"in m&&"fontBoundingBoxAscent"in m&&"fontBoundingBoxDescent"in m))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(P,n,f){var _=this&&this.__decorate||function(c,o,h,m){var C,S=arguments.length,w=S<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,o,h,m);else for(var p=c.length-1;p>=0;p--)(C=c[p])&&(w=(S<3?C(w):S>3?C(o,h,w):C(o,h))||w);return S>3&&w&&Object.defineProperty(o,h,w),w},v=this&&this.__param||function(c,o){return function(h,m){o(h,m,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const l=f(3734),g=f(643),b=f(511),y=f(2585);class u extends l.AttributeData{constructor(o,h,m){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=h,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=u;let r=n.CharacterJoinerService=class of{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(o){const h={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(h),h.id}deregister(o){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===o)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(o);if(!h||h.length===0)return[];const m=[],C=h.translateToString(!0);let S=0,w=0,p=0,x=h.getFg(0),L=h.getBg(0);for(let B=0;B<h.getTrimmedLength();B++)if(h.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==L){if(B-S>1){const D=this._getJoinedRanges(C,p,w,h,S);for(let M=0;M<D.length;M++)m.push(D[M])}S=B,p=w,x=this._workCell.fg,L=this._workCell.bg}w+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const B=this._getJoinedRanges(C,p,w,h,S);for(let D=0;D<B.length;D++)m.push(B[D])}return m}_getJoinedRanges(o,h,m,C,S){const w=o.substring(h,m);let p=[];try{p=this._characterJoiners[0].handler(w)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const L=this._characterJoiners[x].handler(w);for(let B=0;B<L.length;B++)of._mergeRanges(p,L[B])}catch(L){console.error(L)}return this._stringRangesToCellRanges(p,C,S),p}_stringRangesToCellRanges(o,h,m){let C=0,S=!1,w=0,p=o[C];if(p){for(let x=m;x<this._bufferService.cols;x++){const L=h.getWidth(x),B=h.getString(x).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!S&&p[0]<=w&&(p[0]=x,S=!0),p[1]<=w){if(p[1]=x,p=o[++C],!p)break;p[0]<=w?(p[0]=x,S=!0):S=!1}w+=B}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(o,h){let m=!1;for(let C=0;C<o.length;C++){const S=o[C];if(m){if(h[1]<=S[0])return o[C-1][1]=h[1],o;if(h[1]<=S[1])return o[C-1][1]=Math.max(h[1],S[1]),o.splice(C,1),o;o.splice(C,1),C--}else{if(h[1]<=S[0])return o.splice(C,0,h),o;if(h[1]<=S[1])return S[0]=Math.min(h[0],S[0]),o;h[0]<S[1]&&(S[0]=Math.min(h[0],S[0]),m=!0)}}return m?o[o.length-1][1]=h[1]:o.push(h),o}};n.CharacterJoinerService=r=_([v(0,y.IBufferService)],r)},5114:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const _=f(844),v=f(8460),l=f(3656);class g extends _.Disposable{constructor(u,r,c){super(),this._textarea=u,this._window=r,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((o=>this._screenDprMonitor.setWindow(o)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(u){this._window!==u&&(this._window=u,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}}n.CoreBrowserService=g;class b extends _.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new _.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,_.toDisposable)((()=>this.clearListener())))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)==null||u.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)}}},779:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const _=f(844);class v extends _.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,_.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}n.LinkProviderService=v},8934:function(P,n,f){var _=this&&this.__decorate||function(y,u,r,c){var o,h=arguments.length,m=h<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,r):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(y,u,r,c);else for(var C=y.length-1;C>=0;C--)(o=y[C])&&(m=(h<3?o(m):h>3?o(u,r,m):o(u,r))||m);return h>3&&m&&Object.defineProperty(u,r,m),m},v=this&&this.__param||function(y,u){return function(r,c){u(r,c,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const l=f(4725),g=f(9806);let b=n.MouseService=class{constructor(y,u){this._renderService=y,this._charSizeService=u}getCoords(y,u,r,c,o){return(0,g.getCoords)(window,y,u,r,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(y,u){const r=(0,g.getCoordsRelativeToElement)(window,y,u);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};n.MouseService=b=_([v(0,l.IRenderService),v(1,l.ICharSizeService)],b)},3230:function(P,n,f){var _=this&&this.__decorate||function(o,h,m,C){var S,w=arguments.length,p=w<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,h,m,C);else for(var x=o.length-1;x>=0;x--)(S=o[x])&&(p=(w<3?S(p):w>3?S(h,m,p):S(h,m))||p);return w>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(o,h){return function(m,C){h(m,C,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const l=f(6193),g=f(4725),b=f(8460),y=f(844),u=f(7226),r=f(2585);let c=n.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,h,m,C,S,w,p,x){super(),this._rowCount=o,this._charSizeService=C,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new y.MutableDisposable),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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((L,B)=>this._renderRows(L,B)),p),this.register(this._renderDebouncer),this.register(p.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(m.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(m.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(m.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(p.window,h),this.register(p.onWindowChange((L=>this._registerIntersectionObserver(L,h))))}_registerIntersectionObserver(o,h){if("IntersectionObserver"in o){const m=new o.IntersectionObserver((C=>this._handleIntersectionChange(C[C.length-1])),{threshold:0});m.observe(h),this._observerDisposable.value=(0,y.toDisposable)((()=>m.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,h,m=!1){this._isPaused?this._needsFullRefresh=!0:(m||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,h,this._rowCount))}_renderRows(o,h){this._renderer.value&&(o=Math.min(o,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(o,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:h}),this._onRender.fire({start:o,end:h}),this._isNextRenderRedrawOnly=!0)}resize(o,h){this._rowCount=h,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(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,h;this._renderer.value&&((h=(o=this._renderer.value).clearTextureAtlas)==null||h.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var m;return(m=this._renderer.value)==null?void 0:m.handleResize(o,h)})):this._renderer.value.handleResize(o,h),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,h,m){var C;this._selectionState.start=o,this._selectionState.end=h,this._selectionState.columnSelectMode=m,(C=this._renderer.value)==null||C.handleSelectionChanged(o,h,m)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};n.RenderService=c=_([v(2,r.IOptionsService),v(3,g.ICharSizeService),v(4,r.IDecorationService),v(5,r.IBufferService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],c)},9312:function(P,n,f){var _=this&&this.__decorate||function(p,x,L,B){var D,M=arguments.length,U=M<3?x:B===null?B=Object.getOwnPropertyDescriptor(x,L):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(p,x,L,B);else for(var K=p.length-1;K>=0;K--)(D=p[K])&&(U=(M<3?D(U):M>3?D(x,L,U):D(x,L))||U);return M>3&&U&&Object.defineProperty(x,L,U),U},v=this&&this.__param||function(p,x){return function(L,B){x(L,B,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const l=f(9806),g=f(9504),b=f(456),y=f(4725),u=f(8460),r=f(844),c=f(6114),o=f(4841),h=f(511),m=f(2585),C=" ",S=new RegExp(C,"g");let w=n.SelectionService=class extends r.Disposable{constructor(p,x,L,B,D,M,U,K,I){super(),this._element=p,this._screenElement=x,this._linkifier=L,this._bufferService=B,this._coreService=D,this._mouseService=M,this._optionsService=U,this._renderService=K,this._coreBrowserService=I,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=F=>this._handleMouseMove(F),this._mouseUpListener=F=>this._handleMouseUp(F),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((F=>this._handleTrim(F))),this.register(this._bufferService.buffers.onBufferActivate((F=>this._handleBufferActivate(F)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!p||!x||p[0]===x[0]&&p[1]===x[1])}get selectionText(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!p||!x)return"";const L=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(p[0]===x[0])return"";const D=p[0]<x[0]?p[0]:x[0],M=p[0]<x[0]?x[0]:p[0];for(let U=p[1];U<=x[1];U++){const K=L.translateBufferLineToString(U,!0,D,M);B.push(K)}}else{const D=p[1]===x[1]?x[0]:void 0;B.push(L.translateBufferLineToString(p[1],!0,p[0],D));for(let M=p[1]+1;M<=x[1]-1;M++){const U=L.lines.get(M),K=L.translateBufferLineToString(M,!0);U!=null&&U.isWrapped?B[B.length-1]+=K:B.push(K)}if(p[1]!==x[1]){const M=L.lines.get(x[1]),U=L.translateBufferLineToString(x[1],!0,0,x[0]);M&&M.isWrapped?B[B.length-1]+=U:B.push(U)}}return B.map((D=>D.replace(S," "))).join(c.isWindows?`\r
54
+ `:`
55
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&p&&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(p){const x=this._getMouseBufferCoords(p),L=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(L&&B&&x)&&this._areCoordsInSelection(x,L,B)}isCellInSelection(p,x){const L=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!L||!B)&&this._areCoordsInSelection([p,x],L,B)}_areCoordsInSelection(p,x,L){return p[1]>x[1]&&p[1]<L[1]||x[1]===L[1]&&p[1]===x[1]&&p[0]>=x[0]&&p[0]<L[0]||x[1]<L[1]&&p[1]===L[1]&&p[0]<L[0]||x[1]<L[1]&&p[1]===x[1]&&p[0]>=x[0]}_selectWordAtCursor(p,x){var D,M;const L=(M=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:M.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(p);return!!B&&(this._selectWordAt(B,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,x){this._model.clearSelection(),p=Math.max(p,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const x=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(p){let x=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=L?0:(x>L&&(x-=L),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(p){return c.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),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()),50)}_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(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const x=this._getMouseBufferCoords(p);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(p){return p.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!this._model.selectionEnd)return void this.refresh(!0);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(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const B=L.lines.get(this._model.selectionEnd[1]);B&&B.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[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});const p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const x=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const B=(0,g.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,L=!(!p||!x||p[0]===x[0]&&p[1]===x[1]);L?p&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,x,L)):this._oldHasSelection&&this._fireOnSelectionChange(p,x,L)}_fireOnSelectionChange(p,x,L){this._oldSelectionStart=p,this._oldSelectionEnd=x,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(p,x){let L=x;for(let B=0;x>=B;B++){const D=p.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:D>1&&x!==B&&(L+=D-1)}return L}setSelection(p,x,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,x],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,x,L=!0,B=!0){if(p[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,M=D.lines.get(p[1]);if(!M)return;const U=D.translateBufferLineToString(p[1],!1);let K=this._convertViewportColToCharacterIndex(M,p[0]),I=K;const F=p[0]-K;let $=0,R=0,H=0,A=0;if(U.charAt(K)===" "){for(;K>0&&U.charAt(K-1)===" ";)K--;for(;I<U.length&&U.charAt(I+1)===" ";)I++}else{let Z=p[0],he=p[0];M.getWidth(Z)===0&&($++,Z--),M.getWidth(he)===2&&(R++,he++);const ue=M.getString(he).length;for(ue>1&&(A+=ue-1,I+=ue-1);Z>0&&K>0&&!this._isCharWordSeparator(M.loadCell(Z-1,this._workCell));){M.loadCell(Z-1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===0?($++,Z--):q>1&&(H+=q-1,K-=q-1),K--,Z--}for(;he<M.length&&I+1<U.length&&!this._isCharWordSeparator(M.loadCell(he+1,this._workCell));){M.loadCell(he+1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,he++):q>1&&(A+=q-1,I+=q-1),I++,he++}}I++;let z=K+F-$+H,V=Math.min(this._bufferService.cols,I-K+$+R-H-A);if(x||U.slice(K,I).trim()!==""){if(L&&z===0&&M.getCodePoint(0)!==32){const Z=D.lines.get(p[1]-1);if(Z&&M.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(he){const ue=this._bufferService.cols-he.start;z-=ue,V+=ue}}}if(B&&z+V===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const Z=D.lines.get(p[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const he=this._getWordAt([0,p[1]+1],!1,!1,!0);he&&(V+=he.length)}}return{start:z,length:V}}}_selectWordAt(p,x){const L=this._getWordAt(p,x);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[L.start,p[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(p){const x=this._getWordAt(p,!0);if(x){let L=p[1];for(;x.start<0;)x.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,L]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const x=this._bufferService.buffer.getWrappedRangeForLine(p),L={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=w=_([v(3,m.IBufferService),v(4,m.ICoreService),v(5,y.IMouseService),v(6,m.IOptionsService),v(7,y.IRenderService),v(8,y.ICoreBrowserService)],w)},4725:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const _=f(8343);n.ICharSizeService=(0,_.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,_.createDecorator)("CoreBrowserService"),n.IMouseService=(0,_.createDecorator)("MouseService"),n.IRenderService=(0,_.createDecorator)("RenderService"),n.ISelectionService=(0,_.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,_.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,_.createDecorator)("ThemeService"),n.ILinkProviderService=(0,_.createDecorator)("LinkProviderService")},6731:function(P,n,f){var _=this&&this.__decorate||function(w,p,x,L){var B,D=arguments.length,M=D<3?p:L===null?L=Object.getOwnPropertyDescriptor(p,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,p,x,L);else for(var U=w.length-1;U>=0;U--)(B=w[U])&&(M=(D<3?B(M):D>3?B(p,x,M):B(p,x))||M);return D>3&&M&&Object.defineProperty(p,x,M),M},v=this&&this.__param||function(w,p){return function(x,L){p(x,L,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const l=f(7239),g=f(8055),b=f(8460),y=f(844),u=f(2585),r=g.css.toColor("#ffffff"),c=g.css.toColor("#000000"),o=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let x=0;x<216;x++){const L=p[x/36%6|0],B=p[x/6%6|0],D=p[x%6];w.push({css:g.channels.toCss(L,B,D),rgba:g.channels.toRgba(L,B,D)})}for(let x=0;x<24;x++){const L=8+10*x;w.push({css:g.channels.toCss(L,L,L),rgba:g.channels.toRgba(L,L,L)})}return w})());let C=n.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:c,cursor:o,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:g.color.blend(c,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:g.color.blend(c,m),ansi:n.DEFAULT_ANSI_COLORS.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))))}_setTheme(w={}){const p=this._colors;if(p.foreground=S(w.foreground,r),p.background=S(w.background,c),p.cursor=S(w.cursor,o),p.cursorAccent=S(w.cursorAccent,h),p.selectionBackgroundTransparent=S(w.selectionBackground,m),p.selectionBackgroundOpaque=g.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=S(w.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=g.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=w.selectionForeground?S(w.selectionForeground,g.NULL_COLOR):void 0,p.selectionForeground===g.NULL_COLOR&&(p.selectionForeground=void 0),g.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=g.color.opacity(p.selectionBackgroundTransparent,.3)),g.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=g.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=n.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=S(w.black,n.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=S(w.red,n.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=S(w.green,n.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=S(w.yellow,n.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=S(w.blue,n.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=S(w.magenta,n.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=S(w.cyan,n.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=S(w.white,n.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=S(w.brightBlack,n.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=S(w.brightRed,n.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=S(w.brightGreen,n.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=S(w.brightYellow,n.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=S(w.brightBlue,n.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=S(w.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=S(w.brightCyan,n.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=S(w.brightWhite,n.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const x=Math.min(p.ansi.length-16,w.extendedAnsi.length);for(let L=0;L<x;L++)p.ansi[L+16]=S(w.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(w){w(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()}}};function S(w,p){if(w!==void 0)try{return g.css.toColor(w)}catch{}return p}n.ThemeService=C=_([v(0,u.IOptionsService)],C)},6349:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const _=f(8460),v=f(844);class l extends v.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new _.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new _.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new _.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const y=new Array(b);for(let u=0;u<Math.min(b,this.length);u++)y[u]=this._array[this._getCyclicIndex(u)];this._array=y,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let y=this._length;y<b;y++)this._array[y]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,y){this._array[this._getCyclicIndex(b)]=y}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,y,...u){if(y){for(let r=b;r<this._length-y;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+y)];this._length-=y,this.onDeleteEmitter.fire({index:b,amount:y})}for(let r=this._length-1;r>=b;r--)this._array[this._getCyclicIndex(r+u.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<u.length;r++)this._array[this._getCyclicIndex(b+r)]=u[r];if(u.length&&this.onInsertEmitter.fire({index:b,amount:u.length}),this._length+u.length>this._maxLength){const r=this._length+u.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=u.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,y,u){if(!(y<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let c=y-1;c>=0;c--)this.set(b+c+u,this.get(b+c));const r=b+y+u-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<y;r++)this.set(b+r+u,this.get(b+r))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}n.CircularList=l},1439:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function f(_,v=5){if(typeof _!="object")return _;const l=Array.isArray(_)?[]:{};for(const g in _)l[g]=v<=1?_[g]:_[g]&&f(_[g],v-1);return l}},8055:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let f=0,_=0,v=0,l=0;var g,b,y,u,r;function c(h){const m=h.toString(16);return m.length<2?"0"+m:m}function o(h,m){return h<m?(m+.05)/(h+.05):(h+.05)/(m+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(m,C,S,w){return w!==void 0?`#${c(m)}${c(C)}${c(S)}${c(w)}`:`#${c(m)}${c(C)}${c(S)}`},h.toRgba=function(m,C,S,w=255){return(m<<24|C<<16|S<<8|w)>>>0},h.toColor=function(m,C,S,w){return{css:h.toCss(m,C,S,w),rgba:h.toRgba(m,C,S,w)}}})(g||(n.channels=g={})),(function(h){function m(C,S){return l=Math.round(255*S),[f,_,v]=r.toChannels(C.rgba),{css:g.toCss(f,_,v,l),rgba:g.toRgba(f,_,v,l)}}h.blend=function(C,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const w=S.rgba>>24&255,p=S.rgba>>16&255,x=S.rgba>>8&255,L=C.rgba>>24&255,B=C.rgba>>16&255,D=C.rgba>>8&255;return f=L+Math.round((w-L)*l),_=B+Math.round((p-B)*l),v=D+Math.round((x-D)*l),{css:g.toCss(f,_,v),rgba:g.toRgba(f,_,v)}},h.isOpaque=function(C){return(255&C.rgba)==255},h.ensureContrastRatio=function(C,S,w){const p=r.ensureContrastRatio(C.rgba,S.rgba,w);if(p)return g.toColor(p>>24&255,p>>16&255,p>>8&255)},h.opaque=function(C){const S=(255|C.rgba)>>>0;return[f,_,v]=r.toChannels(S),{css:g.toCss(f,_,v),rgba:S}},h.opacity=m,h.multiplyOpacity=function(C,S){return l=255&C.rgba,m(C,l*S/255)},h.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}})(b||(n.color=b={})),(function(h){let m,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const w=S.getContext("2d",{willReadFrequently:!0});w&&(m=w,m.globalCompositeOperation="copy",C=m.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return f=parseInt(S.slice(1,2).repeat(2),16),_=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),g.toColor(f,_,v);case 5:return f=parseInt(S.slice(1,2).repeat(2),16),_=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),g.toColor(f,_,v,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const w=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return f=parseInt(w[1]),_=parseInt(w[2]),v=parseInt(w[3]),l=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(f,_,v,l);if(!m||!C)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=C,m.fillStyle=S,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[f,_,v,l]=m.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(f,_,v,l),css:S}}})(y||(n.css=y={})),(function(h){function m(C,S,w){const p=C/255,x=S/255,L=w/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}h.relativeLuminance=function(C){return m(C>>16&255,C>>8&255,255&C)},h.relativeLuminance2=m})(u||(n.rgb=u={})),(function(h){function m(S,w,p){const x=S>>24&255,L=S>>16&255,B=S>>8&255;let D=w>>24&255,M=w>>16&255,U=w>>8&255,K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));for(;K<p&&(D>0||M>0||U>0);)D-=Math.max(0,Math.ceil(.1*D)),M-=Math.max(0,Math.ceil(.1*M)),U-=Math.max(0,Math.ceil(.1*U)),K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));return(D<<24|M<<16|U<<8|255)>>>0}function C(S,w,p){const x=S>>24&255,L=S>>16&255,B=S>>8&255;let D=w>>24&255,M=w>>16&255,U=w>>8&255,K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));for(;K<p&&(D<255||M<255||U<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),M=Math.min(255,M+Math.ceil(.1*(255-M))),U=Math.min(255,U+Math.ceil(.1*(255-U))),K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));return(D<<24|M<<16|U<<8|255)>>>0}h.blend=function(S,w){if(l=(255&w)/255,l===1)return w;const p=w>>24&255,x=w>>16&255,L=w>>8&255,B=S>>24&255,D=S>>16&255,M=S>>8&255;return f=B+Math.round((p-B)*l),_=D+Math.round((x-D)*l),v=M+Math.round((L-M)*l),g.toRgba(f,_,v)},h.ensureContrastRatio=function(S,w,p){const x=u.relativeLuminance(S>>8),L=u.relativeLuminance(w>>8);if(o(x,L)<p){if(L<x){const M=m(S,w,p),U=o(x,u.relativeLuminance(M>>8));if(U<p){const K=C(S,w,p);return U>o(x,u.relativeLuminance(K>>8))?M:K}return M}const B=C(S,w,p),D=o(x,u.relativeLuminance(B>>8));if(D<p){const M=m(S,w,p);return D>o(x,u.relativeLuminance(M>>8))?B:M}return B}},h.reduceLuminance=m,h.increaseLuminance=C,h.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(r||(n.rgba=r={})),n.toPaddedHex=c,n.contrastRatio=o},8969:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const _=f(844),v=f(2585),l=f(4348),g=f(7866),b=f(744),y=f(7302),u=f(6975),r=f(8460),c=f(1753),o=f(1480),h=f(7994),m=f(9282),C=f(5435),S=f(5981),w=f(2660);let p=!1;class x extends _.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((B=>{var D;(D=this._onScrollApi)==null||D.fire(B.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(B){for(const D in B)this.optionsService.options[D]=B[D]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new _.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new y.OptionsService(B)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((D=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((D=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new S.WriteBuffer(((D,M)=>this._inputHandler.parse(D,M)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,D){this._writeBuffer.write(B,D)}writeSync(B,D){this._logService.logLevel<=v.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(B,D)}input(B,D=!0){this.coreService.triggerDataEvent(B,D)}resize(B,D){isNaN(B)||isNaN(D)||(B=Math.max(B,b.MINIMUM_COLS),D=Math.max(D,b.MINIMUM_ROWS),this._bufferService.resize(B,D))}scroll(B,D=!1){this._bufferService.scroll(B,D)}scrollLines(B,D,M){this._bufferService.scrollLines(B,D,M)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const D=B-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(B,D){return this._inputHandler.registerEscHandler(B,D)}registerDcsHandler(B,D){return this._inputHandler.registerDcsHandler(B,D)}registerCsiHandler(B,D){return this._inputHandler.registerCsiHandler(B,D)}registerOscHandler(B,D){return this._inputHandler.registerOscHandler(B,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?B=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,_.toDisposable)((()=>{for(const D of B)D.dispose()}))}}}n.CoreTerminal=x},8460:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=f=>(this._listeners.push(f),{dispose:()=>{if(!this._disposed){for(let _=0;_<this._listeners.length;_++)if(this._listeners[_]===f)return void this._listeners.splice(_,1)}}})),this._event}fire(f,_){const v=[];for(let l=0;l<this._listeners.length;l++)v.push(this._listeners[l]);for(let l=0;l<v.length;l++)v[l].call(void 0,f,_)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(f,_){return f((v=>_.fire(v)))},n.runAndSubscribe=function(f,_){return _(void 0),f((v=>_(v)))}},5435:function(P,n,f){var _=this&&this.__decorate||function($,R,H,A){var z,V=arguments.length,Z=V<3?R:A===null?A=Object.getOwnPropertyDescriptor(R,H):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate($,R,H,A);else for(var he=$.length-1;he>=0;he--)(z=$[he])&&(Z=(V<3?z(Z):V>3?z(R,H,Z):z(R,H))||Z);return V>3&&Z&&Object.defineProperty(R,H,Z),Z},v=this&&this.__param||function($,R){return function(H,A){R(H,A,$)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const l=f(2584),g=f(7116),b=f(2015),y=f(844),u=f(482),r=f(8437),c=f(8460),o=f(643),h=f(511),m=f(3734),C=f(2585),S=f(1480),w=f(6242),p=f(6351),x=f(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function D($,R){if($>24)return R.setWinLines||!1;switch($){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var M;(function($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M||(n.WindowsOptionsReportType=M={}));let U=0;class K extends y.Disposable{getAttrData(){return this._curAttrData}constructor(R,H,A,z,V,Z,he,ue,q=new b.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=H,this._coreService=A,this._logService=z,this._optionsService=V,this._oscLinkService=Z,this._coreMouseService=he,this._unicodeService=ue,this._parser=q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.EventEmitter),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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._parser.setCsiHandlerFallback(((N,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:ne.toArray()})})),this._parser.setEscHandlerFallback((N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})})),this._parser.setExecuteHandlerFallback((N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})})),this._parser.setOscHandlerFallback(((N,ne,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:ne,data:re})})),this._parser.setDcsHandlerFallback(((N,ne,re)=>{ne==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:ne,payload:re})})),this._parser.setPrintHandler(((N,ne,re)=>this.print(N,ne,re))),this._parser.registerCsiHandler({final:"@"},(N=>this.insertChars(N))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(N=>this.scrollLeft(N))),this._parser.registerCsiHandler({final:"A"},(N=>this.cursorUp(N))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(N=>this.scrollRight(N))),this._parser.registerCsiHandler({final:"B"},(N=>this.cursorDown(N))),this._parser.registerCsiHandler({final:"C"},(N=>this.cursorForward(N))),this._parser.registerCsiHandler({final:"D"},(N=>this.cursorBackward(N))),this._parser.registerCsiHandler({final:"E"},(N=>this.cursorNextLine(N))),this._parser.registerCsiHandler({final:"F"},(N=>this.cursorPrecedingLine(N))),this._parser.registerCsiHandler({final:"G"},(N=>this.cursorCharAbsolute(N))),this._parser.registerCsiHandler({final:"H"},(N=>this.cursorPosition(N))),this._parser.registerCsiHandler({final:"I"},(N=>this.cursorForwardTab(N))),this._parser.registerCsiHandler({final:"J"},(N=>this.eraseInDisplay(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(N=>this.eraseInDisplay(N,!0))),this._parser.registerCsiHandler({final:"K"},(N=>this.eraseInLine(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(N=>this.eraseInLine(N,!0))),this._parser.registerCsiHandler({final:"L"},(N=>this.insertLines(N))),this._parser.registerCsiHandler({final:"M"},(N=>this.deleteLines(N))),this._parser.registerCsiHandler({final:"P"},(N=>this.deleteChars(N))),this._parser.registerCsiHandler({final:"S"},(N=>this.scrollUp(N))),this._parser.registerCsiHandler({final:"T"},(N=>this.scrollDown(N))),this._parser.registerCsiHandler({final:"X"},(N=>this.eraseChars(N))),this._parser.registerCsiHandler({final:"Z"},(N=>this.cursorBackwardTab(N))),this._parser.registerCsiHandler({final:"`"},(N=>this.charPosAbsolute(N))),this._parser.registerCsiHandler({final:"a"},(N=>this.hPositionRelative(N))),this._parser.registerCsiHandler({final:"b"},(N=>this.repeatPrecedingCharacter(N))),this._parser.registerCsiHandler({final:"c"},(N=>this.sendDeviceAttributesPrimary(N))),this._parser.registerCsiHandler({prefix:">",final:"c"},(N=>this.sendDeviceAttributesSecondary(N))),this._parser.registerCsiHandler({final:"d"},(N=>this.linePosAbsolute(N))),this._parser.registerCsiHandler({final:"e"},(N=>this.vPositionRelative(N))),this._parser.registerCsiHandler({final:"f"},(N=>this.hVPosition(N))),this._parser.registerCsiHandler({final:"g"},(N=>this.tabClear(N))),this._parser.registerCsiHandler({final:"h"},(N=>this.setMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(N=>this.setModePrivate(N))),this._parser.registerCsiHandler({final:"l"},(N=>this.resetMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(N=>this.resetModePrivate(N))),this._parser.registerCsiHandler({final:"m"},(N=>this.charAttributes(N))),this._parser.registerCsiHandler({final:"n"},(N=>this.deviceStatus(N))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(N=>this.deviceStatusPrivate(N))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(N=>this.softReset(N))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(N=>this.setCursorStyle(N))),this._parser.registerCsiHandler({final:"r"},(N=>this.setScrollRegion(N))),this._parser.registerCsiHandler({final:"s"},(N=>this.saveCursor(N))),this._parser.registerCsiHandler({final:"t"},(N=>this.windowOptions(N))),this._parser.registerCsiHandler({final:"u"},(N=>this.restoreCursor(N))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(N=>this.insertColumns(N))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(N=>this.deleteColumns(N))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(N=>this.selectProtected(N))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(N=>this.requestMode(N,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(N=>this.requestMode(N,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new w.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new w.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new w.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new w.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new w.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new w.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new w.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new w.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new w.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new w.OscHandler((N=>this.restoreCursorColor(N)))),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(const N in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},(()=>this.selectCharset("("+N))),this._parser.registerEscHandler({intermediates:")",final:N},(()=>this.selectCharset(")"+N))),this._parser.registerEscHandler({intermediates:"*",final:N},(()=>this.selectCharset("*"+N))),this._parser.registerEscHandler({intermediates:"+",final:N},(()=>this.selectCharset("+"+N))),this._parser.registerEscHandler({intermediates:"-",final:N},(()=>this.selectCharset("-"+N))),this._parser.registerEscHandler({intermediates:".",final:N},(()=>this.selectCharset("."+N))),this._parser.registerEscHandler({intermediates:"/",final:N},(()=>this.selectCharset("/"+N)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((N=>(this._logService.error("Parsing error: ",N),N))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler(((N,ne)=>this.requestStatusString(N,ne))))}_preserveStack(R,H,A,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=H,this._parseStack.decodedLength=A,this._parseStack.position=z}_logSlowResolvingAsync(R){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([R,new Promise(((H,A)=>setTimeout((()=>A("#SLOW_TIMEOUT")),5e3)))]).catch((H=>{if(H!=="#SLOW_TIMEOUT")throw H;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,H){let A,z=this._activeBuffer.x,V=this._activeBuffer.y,Z=0;const he=this._parseStack.paused;if(he){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,H))return this._logSlowResolvingAsync(A),A;z=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>B&&(Z=this._parseStack.position+B)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,(N=>String.fromCharCode(N))).join("")}"`),typeof R=="string"?R.split("").map((N=>N.charCodeAt(0))):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(R.length,B))),he||this._dirtyRowTracker.clearRange(),R.length>B)for(let N=Z;N<R.length;N+=B){const ne=N+B<R.length?N+B:R.length,re=typeof R=="string"?this._stringDecoder.decode(R.substring(N,ne),this._parseBuffer):this._utf8Decoder.decode(R.subarray(N,ne),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,re))return this._preserveStack(z,V,re,N),this._logSlowResolvingAsync(A),A}else if(!he){const N=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,N))return this._preserveStack(z,V,N,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===z&&this._activeBuffer.y===V||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(q,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(R,H,A){let z,V;const Z=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,q=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,ne=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-H>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let _e=this._parser.precedingJoinState;for(let fe=H;fe<A;++fe){if(z=R[fe],z<127&&Z){const Qe=Z[String.fromCharCode(z)];Qe&&(z=Qe.charCodeAt(0))}const xe=this._unicodeService.charProperties(z,_e);V=S.UnicodeService.extractWidth(xe);const pe=S.UnicodeService.extractShouldJoin(xe),Ne=pe?S.UnicodeService.extractWidth(_e):0;if(_e=xe,he&&this._onA11yChar.fire((0,u.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-Ne>ue){if(q){const Qe=re;let be=this._activeBuffer.x-Ne;for(this._activeBuffer.x=Ne,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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ne>0&&re instanceof r.BufferLine&&re.copyCellsFrom(Qe,be,0,Ne,!1);be<ue;)Qe.setCellFromCodepoint(be++,0,1,ne)}else if(this._activeBuffer.x=ue-1,V===2)continue}if(pe&&this._activeBuffer.x){const Qe=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-Qe,z,V);for(let be=V-Ne;--be>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(N&&(re.insertCells(this._activeBuffer.x,V-Ne,this._activeBuffer.getNullCell(ne)),re.getWidth(ue-1)===2&&re.setCellFromCodepoint(ue-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ne)),re.setCellFromCodepoint(this._activeBuffer.x++,z,V,ne),V>0)for(;--V;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=_e,this._activeBuffer.x<ue&&A-H>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,H){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,H):this._parser.registerCsiHandler(R,(A=>!D(A.params[0],this._optionsService.rawOptions.windowOptions)||H(A)))}registerDcsHandler(R,H){return this._parser.registerDcsHandler(R,new p.DcsHandler(H))}registerEscHandler(R,H){return this._parser.registerEscHandler(R,H)}registerOscHandler(R,H){return this._parser.registerOscHandler(R,new w.OscHandler(H))}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(){var R;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&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);H.hasWidth(this._activeBuffer.x)&&!H.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,H){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+H):(this._activeBuffer.x=R,this._activeBuffer.y=H),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,H){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+H)}cursorUp(R){const H=this._activeBuffer.y-this._activeBuffer.scrollTop;return H>=0?this._moveCursor(0,-Math.min(H,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const H=this._activeBuffer.scrollBottom-this._activeBuffer.y;return H>=0?this._moveCursor(0,Math.min(H,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const H=R.params[0];return H===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:H===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=R.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=R.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const H=R.params[0];return H===1&&(this._curAttrData.bg|=536870912),H!==2&&H!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,H,A,z=!1,V=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);Z.replaceCells(H,A,this._activeBuffer.getNullCell(this._eraseAttrData()),V),z&&(Z.isWrapped=!1)}_resetBufferLine(R,H=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),H),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),A.isWrapped=!1)}eraseInDisplay(R,H=!1){let A;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);A<this._bufferService.rows;A++)this._resetBufferLine(A,H);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,H),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,H);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,H);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(R,H=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,H);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,H)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let H=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;H--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let H=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;H--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let H=R.params[0]||1;for(;H--;)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(R){let H=R.params[0]||1;for(;H--;)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(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);z.deleteCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);z.insertCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);z.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);z.deleteCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const H=this._parser.precedingJoinState;if(!H)return!0;const A=R.params[0]||1,z=S.UnicodeService.extractWidth(H),V=this._activeBuffer.x-z,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),he=new Uint32Array(Z.length*A);let ue=0;for(let N=0;N<Z.length;){const ne=Z.codePointAt(N)||0;he[ue++]=ne,N+=ne>65535?2:1}let q=ue;for(let N=1;N<A;++N)he.copyWithin(q,0,ue),q+=ue;return this.print(he,0,q),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let H=0;H<R.length;H++)switch(R.params[H]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let H=0;H<R.length;H++)switch(R.params[H]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let H=0;H<R.length;H++)switch(R.params[H]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let H=0;H<R.length;H++)switch(R.params[H]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[H]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,H){const A=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:V}=this._coreMouseService,Z=this._coreService,{buffers:he,cols:ue}=this._bufferService,{active:q,alt:N}=he,ne=this._optionsService.rawOptions,re=pe=>pe?1:2,_e=R.params[0];return fe=_e,xe=H?_e===2?4:_e===4?re(Z.modes.insertMode):_e===12?3:_e===20?re(ne.convertEol):0:_e===1?re(A.applicationCursorKeys):_e===3?ne.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:_e===6?re(A.origin):_e===7?re(A.wraparound):_e===8?3:_e===9?re(z==="X10"):_e===12?re(ne.cursorBlink):_e===25?re(!Z.isCursorHidden):_e===45?re(A.reverseWraparound):_e===66?re(A.applicationKeypad):_e===67?4:_e===1e3?re(z==="VT200"):_e===1002?re(z==="DRAG"):_e===1003?re(z==="ANY"):_e===1004?re(A.sendFocus):_e===1005?4:_e===1006?re(V==="SGR"):_e===1015?4:_e===1016?re(V==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?re(q===N):_e===2004?re(A.bracketedPasteMode):0,Z.triggerDataEvent(`${l.C0.ESC}[${H?"":"?"}${fe};${xe}$y`),!0;var fe,xe}_updateAttrColor(R,H,A,z,V){return H===2?(R|=50331648,R&=-16777216,R|=m.AttributeData.fromColorRGB([A,z,V])):H===5&&(R&=-50331904,R|=33554432|255&A),R}_extractColor(R,H,A){const z=[0,0,-1,0,0,0];let V=0,Z=0;do{if(z[Z+V]=R.params[H+Z],R.hasSubParams(H+Z)){const he=R.getSubParams(H+Z);let ue=0;do z[1]===5&&(V=1),z[Z+ue+1+V]=he[ue];while(++ue<he.length&&ue+Z+1+V<z.length);break}if(z[1]===5&&Z+V>=2||z[1]===2&&Z+V>=5)break;z[1]&&(V=1)}while(++Z+H<R.length&&Z+V<z.length);for(let he=2;he<z.length;++he)z[he]===-1&&(z[he]=0);switch(z[0]){case 38:A.fg=this._updateAttrColor(A.fg,z[1],z[3],z[4],z[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,z[1],z[3],z[4],z[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,z[1],z[3],z[4],z[5])}return Z}_processUnderline(R,H){H.extended=H.extended.clone(),(!~R||R>5)&&(R=1),H.extended.underlineStyle=R,H.fg|=268435456,R===0&&(H.fg&=-268435457),H.updateExtended()}_processSGR0(R){R.fg=r.DEFAULT_ATTR_DATA.fg,R.bg=r.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const H=R.length;let A;const z=this._curAttrData;for(let V=0;V<H;V++)A=R.params[V],A>=30&&A<=37?(z.fg&=-50331904,z.fg|=16777216|A-30):A>=40&&A<=47?(z.bg&=-50331904,z.bg|=16777216|A-40):A>=90&&A<=97?(z.fg&=-50331904,z.fg|=16777224|A-90):A>=100&&A<=107?(z.bg&=-50331904,z.bg|=16777224|A-100):A===0?this._processSGR0(z):A===1?z.fg|=134217728:A===3?z.bg|=67108864:A===4?(z.fg|=268435456,this._processUnderline(R.hasSubParams(V)?R.getSubParams(V)[0]:1,z)):A===5?z.fg|=536870912:A===7?z.fg|=67108864:A===8?z.fg|=1073741824:A===9?z.fg|=2147483648:A===2?z.bg|=134217728:A===21?this._processUnderline(2,z):A===22?(z.fg&=-134217729,z.bg&=-134217729):A===23?z.bg&=-67108865:A===24?(z.fg&=-268435457,this._processUnderline(0,z)):A===25?z.fg&=-536870913:A===27?z.fg&=-67108865:A===28?z.fg&=-1073741825:A===29?z.fg&=2147483647:A===39?(z.fg&=-67108864,z.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):A===49?(z.bg&=-67108864,z.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?V+=this._extractColor(R,V,z):A===53?z.bg|=1073741824:A===55?z.bg&=-1073741825:A===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):A===100?(z.fg&=-67108864,z.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const H=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${H};${A}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const H=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${H};${A}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.DEFAULT_ATTR_DATA.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(R){const H=R.params[0]||1;switch(H){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=H%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(R){const H=R.params[0]||1;let A;return(R.length<2||(A=R.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>H&&(this._activeBuffer.scrollTop=H-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(R){if(!D(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const H=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:H!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:H!==0&&H!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),H!==0&&H!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:H!==0&&H!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),H!==0&&H!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const H=[],A=R.split(";");for(;A.length>1;){const z=A.shift(),V=A.shift();if(/^\d+$/.exec(z)){const Z=parseInt(z);if(F(Z))if(V==="?")H.push({type:0,index:Z});else{const he=(0,x.parseColor)(V);he&&H.push({type:1,index:Z,color:he})}}}return H.length&&this._onColor.fire(H),!0}setHyperlink(R){const H=R.split(";");return!(H.length<2)&&(H[1]?this._createHyperlink(H[0],H[1]):!H[0]&&this._finishHyperlink())}_createHyperlink(R,H){this._getCurrentLinkId()&&this._finishHyperlink();const A=R.split(":");let z;const V=A.findIndex((Z=>Z.startsWith("id=")));return V!==-1&&(z=A[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:H}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,H){const A=R.split(";");for(let z=0;z<A.length&&!(H>=this._specialColors.length);++z,++H)if(A[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[H]}]);else{const V=(0,x.parseColor)(A[z]);V&&this._onColor.fire([{type:1,index:this._specialColors[H],color:V}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const H=[],A=R.split(";");for(let z=0;z<A.length;++z)if(/^\d+$/.exec(A[z])){const V=parseInt(A[z]);F(V)&&H.push({type:2,index:V})}return H.length&&this._onColor.fire(H),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,g.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(L[R[0]],g.CHARSETS[R[1]]||g.DEFAULT_CHARSET),!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){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new h.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let H=0;H<this._bufferService.rows;++H){const A=this._activeBuffer.ybase+this._activeBuffer.y+H,z=this._activeBuffer.lines.get(A);z&&(z.fill(R),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,H){const A=this._bufferService.buffer,z=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${V}${l.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,H){this._dirtyRowTracker.markRangeDirty(R,H)}}n.InputHandler=K;let I=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,R){$>R&&(U=$,$=R,R=U),$<this.start&&(this.start=$),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function F($){return 0<=$&&$<256}I=_([v(0,C.IBufferService)],I)},844:(P,n)=>{function f(_){for(const v of _)v.dispose();_.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const _ of this._disposables)_.dispose();this._disposables.length=0}register(_){return this._disposables.push(_),_}unregister(_){const v=this._disposables.indexOf(_);v!==-1&&this._disposables.splice(v,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(_){var v;this._isDisposed||_===this._value||((v=this._value)==null||v.dispose(),this._value=_)}clear(){this.value=void 0}dispose(){var _;this._isDisposed=!0,(_=this._value)==null||_.dispose(),this._value=void 0}},n.toDisposable=function(_){return{dispose:_}},n.disposeArray=f,n.getDisposeArrayDisposable=function(_){return{dispose:()=>f(_)}}},1505:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(v,l,g){this._data[v]||(this._data[v]={}),this._data[v][l]=g}get(v,l){return this._data[v]?this._data[v][l]:void 0}clear(){this._data={}}}n.TwoKeyMap=f,n.FourKeyMap=class{constructor(){this._data=new f}set(_,v,l,g,b){this._data.get(_,v)||this._data.set(_,v,new f),this._data.get(_,v).set(l,g,b)}get(_,v,l,g){var b;return(b=this._data.get(_,v))==null?void 0:b.get(l,g)}clear(){this._data.clear()}}},6114:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const f=n.isNode?"node":navigator.userAgent,_=n.isNode?"node":navigator.platform;n.isFirefox=f.includes("Firefox"),n.isLegacyEdge=f.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(f),n.getSafariVersion=function(){if(!n.isSafari)return 0;const v=f.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_),n.isIpad=_==="iPad",n.isIphone=_==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(_),n.isLinux=_.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(f)},6106:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let f=0;n.SortedList=class{constructor(_){this._getKey=_,this._array=[]}clear(){this._array.length=0}insert(_){this._array.length!==0?(f=this._search(this._getKey(_)),this._array.splice(f,0,_)):this._array.push(_)}delete(_){if(this._array.length===0)return!1;const v=this._getKey(_);if(v===void 0||(f=this._search(v),f===-1)||this._getKey(this._array[f])!==v)return!1;do if(this._array[f]===_)return this._array.splice(f,1),!0;while(++f<this._array.length&&this._getKey(this._array[f])===v);return!1}*getKeyIterator(_){if(this._array.length!==0&&(f=this._search(_),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===_))do yield this._array[f];while(++f<this._array.length&&this._getKey(this._array[f])===_)}forEachByKey(_,v){if(this._array.length!==0&&(f=this._search(_),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===_))do v(this._array[f]);while(++f<this._array.length&&this._getKey(this._array[f])===_)}values(){return[...this._array].values()}_search(_){let v=0,l=this._array.length-1;for(;l>=v;){let g=v+l>>1;const b=this._getKey(this._array[g]);if(b>_)l=g-1;else{if(!(b<_)){for(;g>0&&this._getKey(this._array[g-1])===_;)g--;return g}v=g+1}}return v}}},7226:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const _=f(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let y=0,u=0,r=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),u=Math.max(y,u),c=b.timeRemaining(),1.5*u>c)return r-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-y))}ms`),void this._start();r=c}this.clear()}}class l extends v{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const y=Date.now()+b;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}n.PriorityTaskQueue=l,n.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:l,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const _=f(643);n.updateWindowsModeWrappedState=function(v){const l=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),g=l==null?void 0:l.get(v.cols-1),b=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);b&&g&&(b.isWrapped=g[_.CHAR_DATA_CODE_INDEX]!==_.NULL_CELL_CODE&&g[_.CHAR_DATA_CODE_INDEX]!==_.WHITESPACE_CELL_CODE)}},3734:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new _}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new f;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=f;class _{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,g=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=g}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=_},9092:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const _=f(6349),v=f(7226),l=f(3734),g=f(8437),b=f(4634),y=f(511),u=f(643),r=f(4863),c=f(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(o,h,m){this._hasScrollback=o,this._optionsService=h,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,h){return new g.BufferLine(this._bufferService.cols,this.getNullCell(o),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const h=o+this._optionsService.rawOptions.scrollback;return h>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:h}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=g.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,h){const m=this.getNullCell(g.DEFAULT_ATTR_DATA);let C=0;const S=this._getCorrectBufferLength(h);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<o)for(let p=0;p<this.lines.length;p++)C+=+this.lines.get(p).resize(o,m);let w=0;if(this._rows<h)for(let p=this._rows;p<h;p++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(o,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(o,m)));else for(let p=this._rows;p>h;p--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const p=this.lines.length-S;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=S}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,h-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(o,h),this._cols>o))for(let w=0;w<this.lines.length;w++)C+=+this.lines.get(w).resize(o,m);this._cols=o,this._rows=h,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,h){this._cols!==o&&(o>this._cols?this._reflowLarger(o,h):this._reflowSmaller(o,h))}_reflowLarger(o,h){const m=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(m.length>0){const C=(0,b.reflowLargerCreateNewLayout)(this.lines,m);(0,b.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(o,h,C.countRemoved)}}_reflowLargerAdjustViewport(o,h,m){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let S=m;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new g.BufferLine(o,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(o,h){const m=this.getNullCell(g.DEFAULT_ATTR_DATA),C=[];let S=0;for(let w=this.lines.length-1;w>=0;w--){let p=this.lines.get(w);if(!p||!p.isWrapped&&p.getTrimmedLength()<=o)continue;const x=[p];for(;p.isWrapped&&w>0;)p=this.lines.get(--w),x.unshift(p);const L=this.ybase+this.y;if(L>=w&&L<w+x.length)continue;const B=x[x.length-1].getTrimmedLength(),D=(0,b.reflowSmallerGetNewLineLengths)(x,this._cols,o),M=D.length-x.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const K=[];for(let A=0;A<M;A++){const z=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);K.push(z)}K.length>0&&(C.push({start:w+x.length+S,newLines:K}),S+=K.length),x.push(...K);let I=D.length-1,F=D[I];F===0&&(I--,F=D[I]);let $=x.length-M-1,R=B;for(;$>=0;){const A=Math.min(R,F);if(x[I]===void 0)break;if(x[I].copyCellsFrom(x[$],R-A,F-A,A,!0),F-=A,F===0&&(I--,F=D[I]),R-=A,R===0){$--;const z=Math.max($,0);R=(0,b.getWrappedLineTrimmedLength)(x,z,this._cols)}}for(let A=0;A<x.length;A++)D[A]<o&&x[A].setCell(D[A],m);let H=M-U;for(;H-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+h-1)}if(C.length>0){const w=[],p=[];for(let I=0;I<this.lines.length;I++)p.push(this.lines.get(I));const x=this.lines.length;let L=x-1,B=0,D=C[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let M=0;for(let I=Math.min(this.lines.maxLength-1,x+S-1);I>=0;I--)if(D&&D.start>L+M){for(let F=D.newLines.length-1;F>=0;F--)this.lines.set(I--,D.newLines[F]);I++,w.push({index:L+1,amount:D.newLines.length}),M+=D.newLines.length,D=C[++B]}else this.lines.set(I,p[L--]);let U=0;for(let I=w.length-1;I>=0;I--)w[I].index+=U,this.lines.onInsertEmitter.fire(w[I]),U+=w[I].amount;const K=Math.max(0,x+S-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(o,h,m=0,C){const S=this.lines.get(o);return S?S.translateToString(h,m,C):""}getWrappedRangeForLine(o){let h=o,m=o;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:h,last:m}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===o&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const h=new r.Marker(o);return this.markers.push(h),h.register(this.lines.onTrim((m=>{h.line-=m,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((m=>{h.line>=m.index&&(h.line+=m.amount)}))),h.register(this.lines.onDelete((m=>{h.line>=m.index&&h.line<m.index+m.amount&&h.dispose(),h.line>m.index&&(h.line-=m.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const _=f(3734),v=f(511),l=f(643),g=f(482);n.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let b=0;class y{constructor(r,c,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const h=c||v.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let m=0;m<r;++m)this.setCell(m,h);this.length=r}get(r){const c=this._data[3*r+0],o=2097151&c;return[this._data[3*r+1],2097152&c?this._combined[r]:o?(0,g.stringFromCodePoint)(o):"",c>>22,2097152&c?this._combined[r].charCodeAt(this._combined[r].length-1):o]}set(r,c){this._data[3*r+1]=c[l.CHAR_DATA_ATTR_INDEX],c[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=c[1],this._data[3*r+0]=2097152|r|c[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=c[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const c=this._data[3*r+0];return 2097152&c?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&c}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const c=this._data[3*r+0];return 2097152&c?this._combined[r]:2097151&c?(0,g.stringFromCodePoint)(2097151&c):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,c){return b=3*r,c.content=this._data[b+0],c.fg=this._data[b+1],c.bg=this._data[b+2],2097152&c.content&&(c.combinedData=this._combined[r]),268435456&c.bg&&(c.extended=this._extendedAttrs[r]),c}setCell(r,c){2097152&c.content&&(this._combined[r]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[r]=c.extended),this._data[3*r+0]=c.content,this._data[3*r+1]=c.fg,this._data[3*r+2]=c.bg}setCellFromCodepoint(r,c,o,h){268435456&h.bg&&(this._extendedAttrs[r]=h.extended),this._data[3*r+0]=c|o<<22,this._data[3*r+1]=h.fg,this._data[3*r+2]=h.bg}addCodepointToCell(r,c,o){let h=this._data[3*r+0];2097152&h?this._combined[r]+=(0,g.stringFromCodePoint)(c):2097151&h?(this._combined[r]=(0,g.stringFromCodePoint)(2097151&h)+(0,g.stringFromCodePoint)(c),h&=-2097152,h|=2097152):h=c|4194304,o&&(h&=-12582913,h|=o<<22),this._data[3*r+0]=h}insertCells(r,c,o){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,o),c<this.length-r){const h=new v.CellData;for(let m=this.length-r-c-1;m>=0;--m)this.setCell(r+c+m,this.loadCell(r+m,h));for(let m=0;m<c;++m)this.setCell(r+m,o)}else for(let h=r;h<this.length;++h)this.setCell(h,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(r,c,o){if(r%=this.length,c<this.length-r){const h=new v.CellData;for(let m=0;m<this.length-r-c;++m)this.setCell(r+m,this.loadCell(r+c+m,h));for(let m=this.length-c;m<this.length;++m)this.setCell(m,o)}else for(let h=r;h<this.length;++h)this.setCell(h,o);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,o),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,o)}replaceCells(r,c,o,h=!1){if(h)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,o),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,o);r<c&&r<this.length;)this.isProtected(r)||this.setCell(r,o),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,o),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,o);r<c&&r<this.length;)this.setCell(r++,o)}resize(r,c){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const h=new Uint32Array(o);h.set(this._data),this._data=h}for(let h=this.length;h<r;++h)this.setCell(h,c)}else{this._data=this._data.subarray(0,o);const h=Object.keys(this._combined);for(let C=0;C<h.length;C++){const S=parseInt(h[C],10);S>=r&&delete this._combined[S]}const m=Object.keys(this._extendedAttrs);for(let C=0;C<m.length;C++){const S=parseInt(m[C],10);S>=r&&delete this._extendedAttrs[S]}}return this.length=r,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,c=!1){if(c)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,r);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const c in r._combined)this._combined[c]=r._combined[c];this._extendedAttrs={};for(const c in r._extendedAttrs)this._extendedAttrs[c]=r._extendedAttrs[c];this.isWrapped=r.isWrapped}clone(){const r=new y(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const c in this._combined)r._combined[c]=this._combined[c];for(const c in this._extendedAttrs)r._extendedAttrs[c]=this._extendedAttrs[c];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,c,o,h,m){const C=r._data;if(m)for(let w=h-1;w>=0;w--){for(let p=0;p<3;p++)this._data[3*(o+w)+p]=C[3*(c+w)+p];268435456&C[3*(c+w)+2]&&(this._extendedAttrs[o+w]=r._extendedAttrs[c+w])}else for(let w=0;w<h;w++){for(let p=0;p<3;p++)this._data[3*(o+w)+p]=C[3*(c+w)+p];268435456&C[3*(c+w)+2]&&(this._extendedAttrs[o+w]=r._extendedAttrs[c+w])}const S=Object.keys(r._combined);for(let w=0;w<S.length;w++){const p=parseInt(S[w],10);p>=c&&(this._combined[p-c+o]=r._combined[p])}}translateToString(r,c,o,h){c=c??0,o=o??this.length,r&&(o=Math.min(o,this.getTrimmedLength())),h&&(h.length=0);let m="";for(;c<o;){const C=this._data[3*c+0],S=2097151&C,w=2097152&C?this._combined[c]:S?(0,g.stringFromCodePoint)(S):l.WHITESPACE_CELL_CHAR;if(m+=w,h)for(let p=0;p<w.length;++p)h.push(c);c+=C>>22||1}return h&&h.push(c),m}}n.BufferLine=y},4841:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(f,_){if(f.start.y>f.end.y)throw new Error(`Buffer range end (${f.end.x}, ${f.end.y}) cannot be before start (${f.start.x}, ${f.start.y})`);return _*(f.end.y-f.start.y)+(f.end.x-f.start.x+1)}},4634:(P,n)=>{function f(_,v,l){if(v===_.length-1)return _[v].getTrimmedLength();const g=!_[v].hasContent(l-1)&&_[v].getWidth(l-1)===1,b=_[v+1].getWidth(0)===2;return g&&b?l-1:l}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(_,v,l,g,b){const y=[];for(let u=0;u<_.length-1;u++){let r=u,c=_.get(++r);if(!c.isWrapped)continue;const o=[_.get(u)];for(;r<_.length&&c.isWrapped;)o.push(c),c=_.get(++r);if(g>=u&&g<r){u+=o.length-1;continue}let h=0,m=f(o,h,v),C=1,S=0;for(;C<o.length;){const p=f(o,C,v),x=p-S,L=l-m,B=Math.min(x,L);o[h].copyCellsFrom(o[C],S,m,B,!1),m+=B,m===l&&(h++,m=0),S+=B,S===p&&(C++,S=0),m===0&&h!==0&&o[h-1].getWidth(l-1)===2&&(o[h].copyCellsFrom(o[h-1],l-1,m++,1,!1),o[h-1].setCell(l-1,b))}o[h].replaceCells(m,l,b);let w=0;for(let p=o.length-1;p>0&&(p>h||o[p].getTrimmedLength()===0);p--)w++;w>0&&(y.push(u+o.length-w),y.push(w)),u+=o.length-1}return y},n.reflowLargerCreateNewLayout=function(_,v){const l=[];let g=0,b=v[g],y=0;for(let u=0;u<_.length;u++)if(b===u){const r=v[++g];_.onDeleteEmitter.fire({index:u-y,amount:r}),u+=r-1,y+=r,b=v[++g]}else l.push(u);return{layout:l,countRemoved:y}},n.reflowLargerApplyNewLayout=function(_,v){const l=[];for(let g=0;g<v.length;g++)l.push(_.get(v[g]));for(let g=0;g<l.length;g++)_.set(g,l[g]);_.length=v.length},n.reflowSmallerGetNewLineLengths=function(_,v,l){const g=[],b=_.map(((c,o)=>f(_,o,v))).reduce(((c,o)=>c+o));let y=0,u=0,r=0;for(;r<b;){if(b-r<l){g.push(b-r);break}y+=l;const c=f(_,u,v);y>c&&(y-=c,u++);const o=_[u].getWidth(y-1)===2;o&&y--;const h=o?l-1:l;g.push(h),r+=h}return g},n.getWrappedLineTrimmedLength=f},5295:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const _=f(8460),v=f(844),l=f(9092);class g extends v.Disposable{constructor(y,u){super(),this._optionsService=y,this._bufferService=u,this._onBufferActivate=this.register(new _.EventEmitter),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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,u){this._normal.resize(y,u),this._alt.resize(y,u),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}n.BufferSet=g},511:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const _=f(482),v=f(643),l=f(3734);class g extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const u=new g;return u.setFromCharData(y),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(y[v.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(y[v.CHAR_DATA_CHAR_INDEX].length===2){const r=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const c=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(r-55296)+c-56320+65536|y[v.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[v.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=y[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},643:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const _=f(8460),v=f(844);class l{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}n.Marker=l,l._nextId=1},7116:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(P,n)=>{var f,_,v;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
56
+ `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(f||(n.C0=f={})),(function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"})(_||(n.C1=_={})),(function(l){l.ST=`${f.ESC}\\`})(v||(n.C1_ESCAPED=v={}))},7399:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const _=f(2584),v={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:["'",'"']};n.evaluateKeyboardEvent=function(l,g,b,y){const u={type:0,cancel:!1,key:void 0},r=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?u.key=g?_.C0.ESC+"OA":_.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?u.key=g?_.C0.ESC+"OD":_.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?u.key=g?_.C0.ESC+"OC":_.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(u.key=g?_.C0.ESC+"OB":_.C0.ESC+"[B");break;case 8:u.key=l.ctrlKey?"\b":_.C0.DEL,l.altKey&&(u.key=_.C0.ESC+u.key);break;case 9:if(l.shiftKey){u.key=_.C0.ESC+"[Z";break}u.key=_.C0.HT,u.cancel=!0;break;case 13:u.key=l.altKey?_.C0.ESC+_.C0.CR:_.C0.CR,u.cancel=!0;break;case 27:u.key=_.C0.ESC,l.altKey&&(u.key=_.C0.ESC+_.C0.ESC),u.cancel=!0;break;case 37:if(l.metaKey)break;r?(u.key=_.C0.ESC+"[1;"+(r+1)+"D",u.key===_.C0.ESC+"[1;3D"&&(u.key=_.C0.ESC+(b?"b":"[1;5D"))):u.key=g?_.C0.ESC+"OD":_.C0.ESC+"[D";break;case 39:if(l.metaKey)break;r?(u.key=_.C0.ESC+"[1;"+(r+1)+"C",u.key===_.C0.ESC+"[1;3C"&&(u.key=_.C0.ESC+(b?"f":"[1;5C"))):u.key=g?_.C0.ESC+"OC":_.C0.ESC+"[C";break;case 38:if(l.metaKey)break;r?(u.key=_.C0.ESC+"[1;"+(r+1)+"A",b||u.key!==_.C0.ESC+"[1;3A"||(u.key=_.C0.ESC+"[1;5A")):u.key=g?_.C0.ESC+"OA":_.C0.ESC+"[A";break;case 40:if(l.metaKey)break;r?(u.key=_.C0.ESC+"[1;"+(r+1)+"B",b||u.key!==_.C0.ESC+"[1;3B"||(u.key=_.C0.ESC+"[1;5B")):u.key=g?_.C0.ESC+"OB":_.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(u.key=_.C0.ESC+"[2~");break;case 46:u.key=r?_.C0.ESC+"[3;"+(r+1)+"~":_.C0.ESC+"[3~";break;case 36:u.key=r?_.C0.ESC+"[1;"+(r+1)+"H":g?_.C0.ESC+"OH":_.C0.ESC+"[H";break;case 35:u.key=r?_.C0.ESC+"[1;"+(r+1)+"F":g?_.C0.ESC+"OF":_.C0.ESC+"[F";break;case 33:l.shiftKey?u.type=2:l.ctrlKey?u.key=_.C0.ESC+"[5;"+(r+1)+"~":u.key=_.C0.ESC+"[5~";break;case 34:l.shiftKey?u.type=3:l.ctrlKey?u.key=_.C0.ESC+"[6;"+(r+1)+"~":u.key=_.C0.ESC+"[6~";break;case 112:u.key=r?_.C0.ESC+"[1;"+(r+1)+"P":_.C0.ESC+"OP";break;case 113:u.key=r?_.C0.ESC+"[1;"+(r+1)+"Q":_.C0.ESC+"OQ";break;case 114:u.key=r?_.C0.ESC+"[1;"+(r+1)+"R":_.C0.ESC+"OR";break;case 115:u.key=r?_.C0.ESC+"[1;"+(r+1)+"S":_.C0.ESC+"OS";break;case 116:u.key=r?_.C0.ESC+"[15;"+(r+1)+"~":_.C0.ESC+"[15~";break;case 117:u.key=r?_.C0.ESC+"[17;"+(r+1)+"~":_.C0.ESC+"[17~";break;case 118:u.key=r?_.C0.ESC+"[18;"+(r+1)+"~":_.C0.ESC+"[18~";break;case 119:u.key=r?_.C0.ESC+"[19;"+(r+1)+"~":_.C0.ESC+"[19~";break;case 120:u.key=r?_.C0.ESC+"[20;"+(r+1)+"~":_.C0.ESC+"[20~";break;case 121:u.key=r?_.C0.ESC+"[21;"+(r+1)+"~":_.C0.ESC+"[21~";break;case 122:u.key=r?_.C0.ESC+"[23;"+(r+1)+"~":_.C0.ESC+"[23~";break;case 123:u.key=r?_.C0.ESC+"[24;"+(r+1)+"~":_.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(b&&!y||!l.altKey||l.metaKey)!b||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?u.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(u.key=_.C0.US),l.key==="@"&&(u.key=_.C0.NUL)):l.keyCode===65&&(u.type=1);else{const c=v[l.keyCode],o=c==null?void 0:c[l.shiftKey?1:0];if(o)u.key=_.C0.ESC+o;else if(l.keyCode>=65&&l.keyCode<=90){const h=l.ctrlKey?l.keyCode-64:l.keyCode+32;let m=String.fromCharCode(h);l.shiftKey&&(m=m.toUpperCase()),u.key=_.C0.ESC+m}else if(l.keyCode===32)u.key=_.C0.ESC+(l.ctrlKey?_.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let h=l.code.slice(3,4);l.shiftKey||(h=h.toLowerCase()),u.key=_.C0.ESC+h,u.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?u.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?u.key=_.C0.NUL:l.keyCode>=51&&l.keyCode<=55?u.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?u.key=_.C0.DEL:l.keyCode===219?u.key=_.C0.ESC:l.keyCode===220?u.key=_.C0.FS:l.keyCode===221&&(u.key=_.C0.GS)}return u}},482:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},n.utf32ToString=function(f,_=0,v=f.length){let l="";for(let g=_;g<v;++g){let b=f[g];b>65535?(b-=65536,l+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):l+=String.fromCharCode(b)}return l},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,_){const v=f.length;if(!v)return 0;let l=0,g=0;if(this._interim){const b=f.charCodeAt(g++);56320<=b&&b<=57343?_[l++]=1024*(this._interim-55296)+b-56320+65536:(_[l++]=this._interim,_[l++]=b),this._interim=0}for(let b=g;b<v;++b){const y=f.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=v)return this._interim=y,l;const u=f.charCodeAt(b);56320<=u&&u<=57343?_[l++]=1024*(y-55296)+u-56320+65536:(_[l++]=y,_[l++]=u)}else y!==65279&&(_[l++]=y)}return l}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,_){const v=f.length;if(!v)return 0;let l,g,b,y,u=0,r=0,c=0;if(this.interim[0]){let m=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,w=0;for(;(S=63&this.interim[++w])&&w<4;)C<<=6,C|=S;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-w;for(;c<x;){if(c>=v)return 0;if(S=f[c++],(192&S)!=128){c--,m=!0;break}this.interim[w++]=S,C<<=6,C|=63&S}m||(p===2?C<128?c--:_[u++]=C:p===3?C<2048||C>=55296&&C<=57343||C===65279||(_[u++]=C):C<65536||C>1114111||(_[u++]=C)),this.interim.fill(0)}const o=v-4;let h=c;for(;h<v;){for(;!(!(h<o)||128&(l=f[h])||128&(g=f[h+1])||128&(b=f[h+2])||128&(y=f[h+3]));)_[u++]=l,_[u++]=g,_[u++]=b,_[u++]=y,h+=4;if(l=f[h++],l<128)_[u++]=l;else if((224&l)==192){if(h>=v)return this.interim[0]=l,u;if(g=f[h++],(192&g)!=128){h--;continue}if(r=(31&l)<<6|63&g,r<128){h--;continue}_[u++]=r}else if((240&l)==224){if(h>=v)return this.interim[0]=l,u;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=g,u;if(b=f[h++],(192&b)!=128){h--;continue}if(r=(15&l)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;_[u++]=r}else if((248&l)==240){if(h>=v)return this.interim[0]=l,u;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=g,u;if(b=f[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=g,this.interim[2]=b,u;if(y=f[h++],(192&y)!=128){h--;continue}if(r=(7&l)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;_[u++]=r}}return u}}},225:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const _=f(1480),v=[[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]],l=[[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]];let g;n.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;b<v.length;++b)g.fill(0,v[b][0],v[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?g[b]:(function(y,u){let r,c=0,o=u.length-1;if(y<u[0][0]||y>u[o][1])return!1;for(;o>=c;)if(r=c+o>>1,y>u[r][1])c=r+1;else{if(!(y<u[r][0]))return!0;o=r-1}return!1})(b,l)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,y){let u=this.wcwidth(b),r=u===0&&y!==0;if(r){const c=_.UnicodeService.extractWidth(y);c===0?r=!1:c>u&&(u=c)}return _.UnicodeService.createPropertyValue(0,u,r)}}},5981:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const _=f(8460),v=f(844);class l extends v.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,y){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(y),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(y)}_innerWrite(b=0,y=!0){const u=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],c=this._action(r,y);if(c){const h=m=>Date.now()-u>=12?setTimeout((()=>this._innerWrite(0,m))):this._innerWrite(u,m);return void c.catch((m=>(queueMicrotask((()=>{throw m})),Promise.resolve(!1)))).then(h)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-u>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}n.WriteBuffer=l},5941:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const f=/^([\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})$/,_=/^[\da-f]+$/;function v(l,g){const b=l.toString(16),y=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}n.parseColor=function(l){if(!l)return;let g=l.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=f.exec(g);if(b){const y=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/y*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/y*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/y*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),_.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,y=[0,0,0];for(let u=0;u<3;++u){const r=parseInt(g.slice(b*u,b*u+b),16);y[u]=b===1?r<<4:b===2?r:b===3?r>>4:r>>8}return y}},n.toRgbString=function(l,g=16){const[b,y,u]=l;return`rgb:${v(b,g)}/${v(y,g)}/${v(u,g)}`}},5770:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const _=f(482),v=f(8742),l=f(5770),g=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(y,u){this._handlers[y]===void 0&&(this._handlers[y]=[]);const r=this._handlers[y];return r.push(u),{dispose:()=>{const c=r.indexOf(u);c!==-1&&r.splice(c,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(y,u){if(this.reset(),this._ident=y,this._active=this._handlers[y]||g,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(y,u,r){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(y,u,r);else this._handlerFb(this._ident,"PUT",(0,_.utf32ToString)(y,u,r))}unhook(y,u=!0){if(this._active.length){let r=!1,c=this._active.length-1,o=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,r=u,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;c>=0&&(r=this._active[c].unhook(y),r!==!0);c--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,r;c--}for(;c>=0;c--)if(r=this._active[c].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",y);this._active=g,this._ident=0}};const b=new v.Params;b.addParam(0),n.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=b,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():b,this._data="",this._hitLimit=!1}put(y,u,r){this._hitLimit||(this._data+=(0,_.utf32ToString)(y,u,r),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let u=!1;if(this._hitLimit)u=!1;else if(y&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then((r=>(this._params=b,this._data="",this._hitLimit=!1,r)));return this._params=b,this._data="",this._hitLimit=!1,u}}},2015:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const _=f(844),v=f(8742),l=f(6242),g=f(6351);class b{constructor(c){this.table=new Uint8Array(c)}setDefault(c,o){this.table.fill(c<<4|o)}add(c,o,h,m){this.table[o<<8|c]=h<<4|m}addMany(c,o,h,m){for(let C=0;C<c.length;C++)this.table[o<<8|c[C]]=h<<4|m}}n.TransitionTable=b;const y=160;n.VT500_TRANSITION_TABLE=(function(){const r=new b(4095),c=Array.apply(null,Array(256)).map(((w,p)=>p)),o=(w,p)=>c.slice(w,p),h=o(32,127),m=o(0,24);m.push(25),m.push.apply(m,o(28,32));const C=o(0,14);let S;for(S in r.setDefault(1,0),r.addMany(h,0,2,0),C)r.addMany([24,26,153,154],S,3,0),r.addMany(o(128,144),S,3,0),r.addMany(o(144,152),S,3,0),r.add(156,S,0,0),r.add(27,S,11,1),r.add(157,S,4,8),r.addMany([152,158,159],S,0,7),r.add(155,S,11,3),r.add(144,S,11,9);return r.addMany(m,0,3,0),r.addMany(m,1,3,1),r.add(127,1,0,1),r.addMany(m,8,0,8),r.addMany(m,3,3,3),r.add(127,3,0,3),r.addMany(m,4,3,4),r.add(127,4,0,4),r.addMany(m,6,3,6),r.addMany(m,5,3,5),r.add(127,5,0,5),r.addMany(m,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(h,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(o(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(h,7,0,7),r.addMany(m,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(o(64,127),3,7,0),r.addMany(o(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(o(48,60),4,8,4),r.addMany(o(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(o(32,64),6,0,6),r.add(127,6,0,6),r.addMany(o(64,127),6,0,0),r.addMany(o(32,48),3,9,5),r.addMany(o(32,48),5,9,5),r.addMany(o(48,64),5,0,6),r.addMany(o(64,127),5,7,0),r.addMany(o(32,48),4,9,5),r.addMany(o(32,48),1,9,2),r.addMany(o(32,48),2,9,2),r.addMany(o(48,127),2,10,0),r.addMany(o(48,80),1,10,0),r.addMany(o(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(o(96,127),1,10,0),r.add(80,1,11,9),r.addMany(m,9,0,9),r.add(127,9,0,9),r.addMany(o(28,32),9,0,9),r.addMany(o(32,48),9,9,12),r.addMany(o(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(m,11,0,11),r.addMany(o(32,128),11,0,11),r.addMany(o(28,32),11,0,11),r.addMany(m,10,0,10),r.add(127,10,0,10),r.addMany(o(28,32),10,0,10),r.addMany(o(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(o(32,48),10,9,12),r.addMany(m,12,0,12),r.add(127,12,0,12),r.addMany(o(28,32),12,0,12),r.addMany(o(32,48),12,9,12),r.addMany(o(48,64),12,0,11),r.addMany(o(64,127),12,12,13),r.addMany(o(64,127),10,12,13),r.addMany(o(64,127),9,12,13),r.addMany(m,13,13,13),r.addMany(h,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(y,0,2,0),r.add(y,8,5,8),r.add(y,6,0,6),r.add(y,11,0,11),r.add(y,13,13,13),r})();class u extends _.Disposable{constructor(c=n.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(o,h,m)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,h)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,_.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,o=[64,126]){let h=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=c.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<c.intermediates.length;++C){const S=c.intermediates.charCodeAt(C);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=S}}if(c.final.length!==1)throw new Error("final must be a single byte");const m=c.final.charCodeAt(0);if(o[0]>m||m>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return h<<=8,h|=m,h}identToString(c){const o=[];for(;c;)o.push(String.fromCharCode(255&c)),c>>=8;return o.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,o){const h=this._identifier(c,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const m=this._escHandlers[h];return m.push(o),{dispose:()=>{const C=m.indexOf(o);C!==-1&&m.splice(C,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,o){this._executeHandlers[c.charCodeAt(0)]=o}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,o){const h=this._identifier(c);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const m=this._csiHandlers[h];return m.push(o),{dispose:()=>{const C=m.indexOf(o);C!==-1&&m.splice(C,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,o){return this._dcsParser.registerHandler(this._identifier(c),o)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,o){return this._oscParser.registerHandler(c,o)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,o,h,m,C){this._parseStack.state=c,this._parseStack.handlers=o,this._parseStack.handlerPos=h,this._parseStack.transition=m,this._parseStack.chunkPos=C}parse(c,o,h){let m,C=0,S=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&x>-1){for(;x>=0&&(m=p[x](this._params),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 4:if(h===!1&&x>-1){for(;x>=0&&(m=p[x](),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 6:if(C=c[this._parseStack.chunkPos],m=this._dcsParser.unhook(C!==24&&C!==26,h),m)return m;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=c[this._parseStack.chunkPos],m=this._oscParser.end(C!==24&&C!==26,h),m)return m;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=w;p<o;++p){switch(C=c[p],S=this._transitions.table[this.currentState<<8|(C<160?C:y)],S>>4){case 2:for(let M=p+1;;++M){if(M>=o||(C=c[M])<32||C>126&&C<y){this._printHandler(c,p,M),p=M-1;break}if(++M>=o||(C=c[M])<32||C>126&&C<y){this._printHandler(c,p,M),p=M-1;break}if(++M>=o||(C=c[M])<32||C>126&&C<y){this._printHandler(c,p,M),p=M-1;break}if(++M>=o||(C=c[M])<32||C>126&&C<y){this._printHandler(c,p,M),p=M-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|C];let L=x?x.length-1:-1;for(;L>=0&&(m=x[L](this._params),m!==!0);L--)if(m instanceof Promise)return this._preserveStack(3,x,L,S,p),m;L<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++p<o&&(C=c[p])>47&&C<60);p--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const B=this._escHandlers[this._collect<<8|C];let D=B?B.length-1:-1;for(;D>=0&&(m=B[D](),m!==!0);D--)if(m instanceof Promise)return this._preserveStack(4,B,D,S,p),m;D<0&&this._escHandlerFb(this._collect<<8|C),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|C,this._params);break;case 13:for(let M=p+1;;++M)if(M>=o||(C=c[M])===24||C===26||C===27||C>127&&C<y){this._dcsParser.put(c,p,M),p=M-1;break}break;case 14:if(m=this._dcsParser.unhook(C!==24&&C!==26),m)return this._preserveStack(6,[],0,S,p),m;C===27&&(S|=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 M=p+1;;M++)if(M>=o||(C=c[M])<32||C>127&&C<y){this._oscParser.put(c,p,M),p=M-1;break}break;case 6:if(m=this._oscParser.end(C!==24&&C!==26),m)return this._preserveStack(5,[],0,S,p),m;C===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}n.EscapeSequenceParser=u},6242:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const _=f(5770),v=f(482),l=[];n.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const y=this._handlers[g];return y.push(b),{dispose:()=>{const u=y.indexOf(b);u!==-1&&y.splice(u,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,y){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(g,b,y);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(g,b,y))}start(){this.reset(),this._state=1}put(g,b,y){if(this._state!==3){if(this._state===1)for(;b<y;){const u=g[b++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&y-b>0&&this._put(g,b,y)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,u=this._active.length-1,r=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,y=b,r=this._stack.fallThrough,this._stack.paused=!1),!r&&y===!1){for(;u>=0&&(y=this._active[u].end(g),y!==!0);u--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,y;u--}for(;u>=0;u--)if(y=this._active[u].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",g);this._active=l,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,y){this._hitLimit||(this._data+=(0,v.utf32ToString)(g,b,y),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((y=>(this._data="",this._hitLimit=!1,y)));return this._data="",this._hitLimit=!1,b}}},8742:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const f=2147483647;class _{static fromArray(l){const g=new _;if(!l.length)return g;for(let b=Array.isArray(l[0])?1:0;b<l.length;++b){const y=l[b];if(Array.isArray(y))for(let u=0;u<y.length;++u)g.addSubParam(y[u]);else g.addParam(y)}return g}constructor(l=32,g=32){if(this.maxLength=l,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new _(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let g=0;g<this.length;++g){l.push(this.params[g]);const b=this._subParamsIdx[g]>>8,y=255&this._subParamsIdx[g];y-b>0&&l.push(Array.prototype.slice.call(this._subParams,b,y))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>f?f:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>f?f:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const g=this._subParamsIdx[l]>>8,b=255&this._subParamsIdx[l];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const l={};for(let g=0;g<this.length;++g){const b=this._subParamsIdx[g]>>8,y=255&this._subParamsIdx[g];y-b>0&&(l[g]=this._subParams.slice(b,y))}return l}addDigit(l){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,y=b[g-1];b[g-1]=~y?Math.min(10*y+l,f):l}}n.Params=_},5741:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()}loadAddon(f,_){const v={instance:_,dispose:_.dispose,isDisposed:!1};this._addons.push(v),_.dispose=()=>this._wrappedAddonDispose(v),_.activate(f)}_wrappedAddonDispose(f){if(f.isDisposed)return;let _=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===f){_=v;break}if(_===-1)throw new Error("Could not dispose an addon that has not been loaded");f.isDisposed=!0,f.dispose.apply(f.instance),this._addons.splice(_,1)}}},8771:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const _=f(3785),v=f(511);n.BufferApiView=class{constructor(l,g){this._buffer=l,this.type=g}init(l){return this._buffer=l,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(l){const g=this._buffer.lines.get(l);if(g)return new _.BufferLineApiView(g)}getNullCell(){return new v.CellData}}},3785:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const _=f(511);n.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,l){if(!(v<0||v>=this._line.length))return l?(this._line.loadCell(v,l),l):this._line.loadCell(v,new _.CellData)}translateToString(v,l,g){return this._line.translateToString(v,l,g)}}},8285:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const _=f(8771),v=f(8460),l=f(844);class g extends l.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new _.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new _.BufferApiView(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)}}n.BufferNamespaceApi=g},7975:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(f){this._core=f}registerCsiHandler(f,_){return this._core.registerCsiHandler(f,(v=>_(v.toArray())))}addCsiHandler(f,_){return this.registerCsiHandler(f,_)}registerDcsHandler(f,_){return this._core.registerDcsHandler(f,((v,l)=>_(v,l.toArray())))}addDcsHandler(f,_){return this.registerDcsHandler(f,_)}registerEscHandler(f,_){return this._core.registerEscHandler(f,_)}addEscHandler(f,_){return this.registerEscHandler(f,_)}registerOscHandler(f,_){return this._core.registerOscHandler(f,_)}addOscHandler(f,_){return this.registerOscHandler(f,_)}}},7090:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(f){this._core=f}register(f){this._core.unicodeService.register(f)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(f){this._core.unicodeService.activeVersion=f}}},744:function(P,n,f){var _=this&&this.__decorate||function(r,c,o,h){var m,C=arguments.length,S=C<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,c,o,h);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(S=(C<3?m(S):C>3?m(c,o,S):m(c,o))||S);return C>3&&S&&Object.defineProperty(c,o,S),S},v=this&&this.__param||function(r,c){return function(o,h){c(o,h,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const l=f(8460),g=f(844),b=f(5295),y=f(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let u=n.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(r,this))}resize(r,c){this.cols=r,this.rows=c,this.buffers.resize(r,c),this._onResize.fire({cols:r,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,c=!1){const o=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===r.fg&&h.getBg(0)===r.bg||(h=o.getBlankLine(r,c),this._cachedBlankLine=h),h.isWrapped=c;const m=o.ybase+o.scrollTop,C=o.ybase+o.scrollBottom;if(o.scrollTop===0){const S=o.lines.isFull;C===o.lines.length-1?S?o.lines.recycle().copyFrom(h):o.lines.push(h.clone()):o.lines.splice(C+1,0,h.clone()),S?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const S=C-m+1;o.lines.shiftElements(m+1,S-1,-1),o.lines.set(C,h.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(r,c,o){const h=this.buffer;if(r<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else r+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const m=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+r,h.ybase),0),m!==h.ydisp&&(c||this._onScroll.fire(h.ydisp))}};n.BufferService=u=_([v(0,y.IOptionsService)],u)},7994:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(f){this.glevel=f,this.charset=this._charsets[f]}setgCharset(f,_){this._charsets[f]=_,this.glevel===f&&(this.charset=_)}}},1753:function(P,n,f){var _=this&&this.__decorate||function(h,m,C,S){var w,p=arguments.length,x=p<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,m,C,S);else for(var L=h.length-1;L>=0;L--)(w=h[L])&&(x=(p<3?w(x):p>3?w(m,C,x):w(m,C))||x);return p>3&&x&&Object.defineProperty(m,C,x),x},v=this&&this.__param||function(h,m){return function(C,S){m(C,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const l=f(2585),g=f(8460),b=f(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function u(h,m){let C=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(C|=64,C|=h.action):(C|=3&h.button,4&h.button&&(C|=64),8&h.button&&(C|=128),h.action===32?C|=32:h.action!==0||m||(C|=3)),C}const r=String.fromCharCode,c={DEFAULT:h=>{const m=[u(h,!1)+32,h.col+32,h.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${r(m[0])}${r(m[1])}${r(m[2])}`},SGR:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${u(h,!0)};${h.col};${h.row}${m}`},SGR_PIXELS:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${u(h,!0)};${h.x};${h.y}${m}`}};let o=n.CoreMouseService=class extends b.Disposable{constructor(h,m){super(),this._bufferService=h,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(y))this.addProtocol(C,y[C]);for(const C of Object.keys(c))this.addEncoding(C,c[C]);this.reset()}addProtocol(h,m){this._protocols[h]=m}addEncoding(h,m){this._encodings[h]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const m=this._encodings[this._activeEncoding](h);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,m,C){if(C){if(h.x!==m.x||h.y!==m.y)return!1}else if(h.col!==m.col||h.row!==m.row)return!1;return h.button===m.button&&h.action===m.action&&h.ctrl===m.ctrl&&h.alt===m.alt&&h.shift===m.shift}};n.CoreMouseService=o=_([v(0,l.IBufferService),v(1,l.ICoreService)],o)},6975:function(P,n,f){var _=this&&this.__decorate||function(o,h,m,C){var S,w=arguments.length,p=w<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,h,m,C);else for(var x=o.length-1;x>=0;x--)(S=o[x])&&(p=(w<3?S(p):w>3?S(h,m,p):S(h,m))||p);return w>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(o,h){return function(m,C){h(m,C,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const l=f(1439),g=f(8460),b=f(844),y=f(2585),u=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=n.CoreService=class extends b.Disposable{constructor(o,h,m){super(),this._bufferService=o,this._logService=h,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(u),this.decPrivateModes=(0,l.clone)(r)}reset(){this.modes=(0,l.clone)(u),this.decPrivateModes=(0,l.clone)(r)}triggerDataEvent(o,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((C=>C.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(o))}};n.CoreService=c=_([v(0,y.IBufferService),v(1,y.ILogService),v(2,y.IOptionsService)],c)},9074:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const _=f(8055),v=f(8460),l=f(844),g=f(6106);let b=0,y=0;class u extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((o=>o==null?void 0:o.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const h=new r(o);if(h){const m=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),m.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,h,m){let C=0,S=0;for(const w of this._decorations.getKeyIterator(h))C=w.options.x??0,S=C+(w.options.width??1),o>=C&&o<S&&(!m||(w.options.layer??"bottom")===m)&&(yield w)}forEachDecorationAtCell(o,h,m,C){this._decorations.forEachByKey(h,(S=>{b=S.options.x??0,y=b+(S.options.width??1),o>=b&&o<y&&(!m||(S.options.layer??"bottom")===m)&&C(S)}))}}n.DecorationService=u;class r extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=_.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=_.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const _=f(2585),v=f(8343);class l{constructor(...b){this._entries=new Map;for(const[y,u]of b)this.set(y,u)}set(b,y){const u=this._entries.get(b);return this._entries.set(b,y),u}forEach(b){for(const[y,u]of this._entries.entries())b(y,u)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}n.ServiceCollection=l,n.InstantiationService=class{constructor(){this._services=new l,this._services.set(_.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const y=(0,v.getServiceDependencies)(g).sort(((c,o)=>c.index-o.index)),u=[];for(const c of y){const o=this._services.get(c.id);if(!o)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${c.id}.`);u.push(o)}const r=y.length>0?y[0].index:b.length;if(b.length!==r)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${r+1} conflicts with ${b.length} static arguments`);return new g(...b,...u)}}},7866:function(P,n,f){var _=this&&this.__decorate||function(r,c,o,h){var m,C=arguments.length,S=C<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,c,o,h);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(S=(C<3?m(S):C>3?m(c,o,S):m(c,o))||S);return C>3&&S&&Object.defineProperty(c,o,S),S},v=this&&this.__param||function(r,c){return function(o,h){c(o,h,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const l=f(844),g=f(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,u=n.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),y=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let c=0;c<r.length;c++)typeof r[c]=="function"&&(r[c]=r[c]())}_log(r,c,o){this._evalLazyOptionalParams(o),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...o)}trace(r,...c){var o;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,r,c)}debug(r,...c){var o;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,r,c)}info(r,...c){var o;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,r,c)}warn(r,...c){var o;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,r,c)}error(r,...c){var o;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,r,c)}};n.LogService=u=_([v(0,g.IOptionsService)],u),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,c,o){if(typeof o.value!="function")throw new Error("not supported");const h=o.value;o.value=function(...m){if(y.logLevel!==g.LogLevelEnum.TRACE)return h.apply(this,m);y.trace(`GlyphRenderer#${h.name}(${m.map((S=>JSON.stringify(S))).join(", ")})`);const C=h.apply(this,m);return y.trace(`GlyphRenderer#${h.name} return`,C),C}}},7302:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const _=f(8460),v=f(844),l=f(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends v.Disposable{constructor(u){super(),this._onOptionChange=this.register(new _.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const c in u)if(c in r)try{const o=u[c];r[c]=this._sanitizeAndValidateOption(c,o)}catch(o){console.error(o)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(u,r){return this.onOptionChange((c=>{c===u&&r(this.rawOptions[u])}))}onMultipleOptionChange(u,r){return this.onOptionChange((c=>{u.indexOf(c)!==-1&&r()}))}_setupOptions(){const u=c=>{if(!(c in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},r=(c,o)=>{if(!(c in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);o=this._sanitizeAndValidateOption(c,o),this.rawOptions[c]!==o&&(this.rawOptions[c]=o,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const o={get:u.bind(this,c),set:r.bind(this,c)};Object.defineProperty(this.options,c,o)}}_sanitizeAndValidateOption(u,r){switch(u){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[u]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${u}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=g.includes(r)?r:n.DEFAULT_OPTIONS[u];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${u} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${u} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=b},2660:function(P,n,f){var _=this&&this.__decorate||function(b,y,u,r){var c,o=arguments.length,h=o<3?y:r===null?r=Object.getOwnPropertyDescriptor(y,u):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(b,y,u,r);else for(var m=b.length-1;m>=0;m--)(c=b[m])&&(h=(o<3?c(h):o>3?c(y,u,h):c(y,u))||h);return o>3&&h&&Object.defineProperty(y,u,h),h},v=this&&this.__param||function(b,y){return function(u,r){y(u,r,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const l=f(2585);let g=n.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const y=this._bufferService.buffer;if(b.id===void 0){const m=y.addMarker(y.ybase+y.y),C={data:b,id:this._nextId++,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(C,m))),this._dataByLinkId.set(C.id,C),C.id}const u=b,r=this._getEntryIdKey(u),c=this._entriesWithId.get(r);if(c)return this.addLineToLink(c.id,y.ybase+y.y),c.id;const o=y.addMarker(y.ybase+y.y),h={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(h,o))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(b,y){const u=this._dataByLinkId.get(b);if(u&&u.lines.every((r=>r.line!==y))){const r=this._bufferService.buffer.addMarker(y);u.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(u,r)))}}getLinkData(b){var y;return(y=this._dataByLinkId.get(b))==null?void 0:y.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,y){const u=b.lines.indexOf(y);u!==-1&&(b.lines.splice(u,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};n.OscLinkService=g=_([v(0,l.IBufferService)],g)},8343:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const f="di$target",_="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(v){return v[_]||[]},n.createDecorator=function(v){if(n.serviceRegistry.has(v))return n.serviceRegistry.get(v);const l=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,r,c){r[f]===r?r[_].push({id:u,index:c}):(r[_]=[{id:u,index:c}],r[f]=r)})(l,g,y)};return l.toString=()=>v,n.serviceRegistry.set(v,l),l}},2585:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const _=f(8343);var v;n.IBufferService=(0,_.createDecorator)("BufferService"),n.ICoreMouseService=(0,_.createDecorator)("CoreMouseService"),n.ICoreService=(0,_.createDecorator)("CoreService"),n.ICharsetService=(0,_.createDecorator)("CharsetService"),n.IInstantiationService=(0,_.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(v||(n.LogLevelEnum=v={})),n.ILogService=(0,_.createDecorator)("LogService"),n.IOptionsService=(0,_.createDecorator)("OptionsService"),n.IOscLinkService=(0,_.createDecorator)("OscLinkService"),n.IUnicodeService=(0,_.createDecorator)("UnicodeService"),n.IDecorationService=(0,_.createDecorator)("DecorationService")},1480:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const _=f(8460),v=f(225);class l{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,y,u=!1){return(16777215&b)<<3|(3&y)<<1|(u?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new _.EventEmitter,this.onChange=this._onChange.event;const b=new v.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let y=0,u=0;const r=b.length;for(let c=0;c<r;++c){let o=b.charCodeAt(c);if(55296<=o&&o<=56319){if(++c>=r)return y+this.wcwidth(o);const C=b.charCodeAt(c);56320<=C&&C<=57343?o=1024*(o-55296)+C-56320+65536:y+=this.wcwidth(C)}const h=this.charProperties(o,u);let m=l.extractWidth(h);l.extractShouldJoin(h)&&(m-=l.extractWidth(u)),y+=m,u=h}return y}charProperties(b,y){return this._activeProvider.charProperties(b,y)}}n.UnicodeService=l}},j={};function J(P){var n=j[P];if(n!==void 0)return n.exports;var f=j[P]={exports:{}};return G[P].call(f.exports,f,f.exports,J),f.exports}var se={};return(()=>{var P=se;Object.defineProperty(P,"__esModule",{value:!0}),P.Terminal=void 0;const n=J(9042),f=J(3236),_=J(844),v=J(5741),l=J(8285),g=J(7975),b=J(7090),y=["cols","rows"];class u extends _.Disposable{constructor(c){super(),this._core=this.register(new f.Terminal(c)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const o=m=>this._core.options[m],h=(m,C)=>{this._checkReadonlyOptions(m),this._core.options[m]=C};for(const m in this._core.options){const C={get:o.bind(this,m),set:h.bind(this,m)};Object.defineProperty(this._publicOptions,m,C)}}_checkReadonlyOptions(c){if(y.includes(c))throw new Error(`Option "${c}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const o in c)this._publicOptions[o]=c[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,o=!0){this._core.input(c,o)}resize(c,o){this._verifyIntegers(c,o),this._core.resize(c,o)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,o,h){this._verifyIntegers(c,o,h),this._core.select(c,o,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,o){this._verifyIntegers(c,o),this._core.selectLines(c,o)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,o){this._core.write(c,o)}writeln(c,o){this._core.write(c),this._core.write(`\r
57
+ `,o)}paste(c){this._core.paste(c)}refresh(c,o){this._verifyIntegers(c,o),this._core.refresh(c,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return n}_verifyIntegers(...c){for(const o of c)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const o of c)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}P.Terminal=u})(),se})()))})(Ho)),Ho.exports}var Yv=Gv(),jo={exports:{}},Zd;function Xv(){return Zd||(Zd=1,(function(k,Y){(function(G,j){k.exports=j()})(self,(()=>(()=>{var G={};return(()=>{var j=G;Object.defineProperty(j,"__esModule",{value:!0}),j.FitAddon=void 0,j.FitAddon=class{activate(J){this._terminal=J}dispose(){}fit(){const J=this.proposeDimensions();if(!J||!this._terminal||isNaN(J.cols)||isNaN(J.rows))return;const se=this._terminal._core;this._terminal.rows===J.rows&&this._terminal.cols===J.cols||(se._renderService.clear(),this._terminal.resize(J.cols,J.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const J=this._terminal._core,se=J._renderService.dimensions;if(se.css.cell.width===0||se.css.cell.height===0)return;const P=this._terminal.options.scrollback===0?0:J.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(n.getPropertyValue("height")),_=Math.max(0,parseInt(n.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),l=f-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),g=_-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-P;return{cols:Math.max(2,Math.floor(g/se.css.cell.width)),rows:Math.max(1,Math.floor(l/se.css.cell.height))}}}})(),G})()))})(jo)),jo.exports}var Vv=Xv(),Uo={exports:{}},Jd;function Kv(){return Jd||(Jd=1,(function(k,Y){(function(G,j){k.exports=j()})(self,(()=>(()=>{var G={965:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const _=f(374),v=f(509),l=f(855),g=f(859),b=f(381),y=11,u=y*Float32Array.BYTES_PER_ELEMENT;let r,c=0,o=0,h=0;class m extends g.Disposable{constructor(S,w,p,x){super(),this._terminal=S,this._gl=w,this._dimensions=p,this._optionsService=x,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,_.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,_.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,_.throwIfFalsy)((0,b.createProgram)(L,`#version 300 es
58
+ layout (location = 0) in vec2 a_unitquad;
59
+ layout (location = 1) in vec2 a_cellpos;
60
+ layout (location = 2) in vec2 a_offset;
61
+ layout (location = 3) in vec2 a_size;
62
+ layout (location = 4) in float a_texpage;
63
+ layout (location = 5) in vec2 a_texcoord;
64
+ layout (location = 6) in vec2 a_texsize;
65
+
66
+ uniform mat4 u_projection;
67
+ uniform vec2 u_resolution;
68
+
69
+ out vec2 v_texcoord;
70
+ flat out int v_texpage;
71
+
72
+ void main() {
73
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
74
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
75
+ v_texpage = int(a_texpage);
76
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
77
+ }`,(function(I){let F="";for(let $=1;$<I;$++)F+=` else if (v_texpage == ${$}) { outColor = texture(u_texture[${$}], v_texcoord); }`;return`#version 300 es
78
+ precision lowp float;
79
+
80
+ in vec2 v_texcoord;
81
+ flat in int v_texpage;
82
+
83
+ uniform sampler2D u_texture[${I}];
84
+
85
+ out vec4 outColor;
86
+
87
+ void main() {
88
+ if (v_texpage == 0) {
89
+ outColor = texture(u_texture[0], v_texcoord);
90
+ } ${F}
91
+ }`})(v.TextureAtlas.maxAtlasPages))),this.register((0,g.toDisposable)((()=>L.deleteProgram(this._program)))),this._projectionLocation=(0,_.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,_.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,_.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const B=new Float32Array([0,0,1,0,0,1,1,1]),D=L.createBuffer();this.register((0,g.toDisposable)((()=>L.deleteBuffer(D)))),L.bindBuffer(L.ARRAY_BUFFER,D),L.bufferData(L.ARRAY_BUFFER,B,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const M=new Uint8Array([0,1,2,3]),U=L.createBuffer();this.register((0,g.toDisposable)((()=>L.deleteBuffer(U)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,U),L.bufferData(L.ELEMENT_ARRAY_BUFFER,M,L.STATIC_DRAW),this._attributesBuffer=(0,_.throwIfFalsy)(L.createBuffer()),this.register((0,g.toDisposable)((()=>L.deleteBuffer(this._attributesBuffer)))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,u,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,u,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,u,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,u,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,u,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,u,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const K=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let I=0;I<v.TextureAtlas.maxAtlasPages;I++)K[I]=I;L.uniform1iv(this._textureLocation,K),L.uniformMatrix4fv(this._projectionLocation,!1,b.PROJECTION_MATRIX),this._atlasTextures=[];for(let I=0;I<v.TextureAtlas.maxAtlasPages;I++){const F=new b.GLTexture((0,_.throwIfFalsy)(L.createTexture()));this.register((0,g.toDisposable)((()=>L.deleteTexture(F.texture)))),L.activeTexture(L.TEXTURE0+I),L.bindTexture(L.TEXTURE_2D,F.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[I]=F}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(S,w,p,x,L,B,D,M,U){this._updateCell(this._vertices.attributes,S,w,p,x,L,B,D,M,U)}_updateCell(S,w,p,x,L,B,D,M,U,K){c=(p*this._terminal.cols+w)*y,x!==l.NULL_CELL_CODE&&x!==void 0?this._atlas&&(r=M&&M.length>1?this._atlas.getRasterizedGlyphCombinedChar(M,L,B,D,!1):this._atlas.getRasterizedGlyph(x,L,B,D,!1),o=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==K&&r.offset.x>o?(h=r.offset.x-o,S[c]=-(r.offset.x-h)+this._dimensions.device.char.left,S[c+1]=-r.offset.y+this._dimensions.device.char.top,S[c+2]=(r.size.x-h)/this._dimensions.device.canvas.width,S[c+3]=r.size.y/this._dimensions.device.canvas.height,S[c+4]=r.texturePage,S[c+5]=r.texturePositionClipSpace.x+h/this._atlas.pages[r.texturePage].canvas.width,S[c+6]=r.texturePositionClipSpace.y,S[c+7]=r.sizeClipSpace.x-h/this._atlas.pages[r.texturePage].canvas.width,S[c+8]=r.sizeClipSpace.y):(S[c]=-r.offset.x+this._dimensions.device.char.left,S[c+1]=-r.offset.y+this._dimensions.device.char.top,S[c+2]=r.size.x/this._dimensions.device.canvas.width,S[c+3]=r.size.y/this._dimensions.device.canvas.height,S[c+4]=r.texturePage,S[c+5]=r.texturePositionClipSpace.x,S[c+6]=r.texturePositionClipSpace.y,S[c+7]=r.sizeClipSpace.x,S[c+8]=r.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,_.allowRescaling)(x,U,r.size.x,this._dimensions.device.cell.width)&&(S[c+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):S.fill(0,c,c+y-1-2)}clear(){const S=this._terminal,w=S.cols*S.rows*y;this._vertices.count!==w?this._vertices.attributes=new Float32Array(w):this._vertices.attributes.fill(0);let p=0;for(;p<this._vertices.attributesBuffers.length;p++)this._vertices.count!==w?this._vertices.attributesBuffers[p]=new Float32Array(w):this._vertices.attributesBuffers[p].fill(0);this._vertices.count=w,p=0;for(let x=0;x<S.rows;x++)for(let L=0;L<S.cols;L++)this._vertices.attributes[p+9]=L/S.cols,this._vertices.attributes[p+10]=x/S.rows,p+=y}handleResize(){const S=this._gl;S.useProgram(this._program),S.viewport(0,0,S.canvas.width,S.canvas.height),S.uniform2f(this._resolutionLocation,S.canvas.width,S.canvas.height),this.clear()}render(S){if(!this._atlas)return;const w=this._gl;w.useProgram(this._program),w.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const p=this._vertices.attributesBuffers[this._activeBuffer];let x=0;for(let L=0;L<S.lineLengths.length;L++){const B=L*this._terminal.cols*y,D=this._vertices.attributes.subarray(B,B+S.lineLengths[L]*y);p.set(D,x),x+=D.length}w.bindBuffer(w.ARRAY_BUFFER,this._attributesBuffer),w.bufferData(w.ARRAY_BUFFER,p.subarray(0,x),w.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(w,this._atlas,L);w.drawElementsInstanced(w.TRIANGLE_STRIP,4,w.UNSIGNED_BYTE,0,x/y)}setAtlas(S){this._atlas=S;for(const w of this._atlasTextures)w.version=-1}_bindAtlasPageTexture(S,w,p){S.activeTexture(S.TEXTURE0+p),S.bindTexture(S.TEXTURE_2D,this._atlasTextures[p].texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,S.RGBA,S.UNSIGNED_BYTE,w.pages[p].canvas),S.generateMipmap(S.TEXTURE_2D),this._atlasTextures[p].version=w.pages[p].version}setDimensions(S){this._dimensions=S}}n.GlyphRenderer=m},742:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const _=f(374),v=f(859),l=f(310),g=f(381),b=8*Float32Array.BYTES_PER_ELEMENT;class y{constructor(){this.attributes=new Float32Array(160),this.count=0}}let u=0,r=0,c=0,o=0,h=0,m=0,C=0;class S extends v.Disposable{constructor(p,x,L,B){super(),this._terminal=p,this._gl=x,this._dimensions=L,this._themeService=B,this._vertices=new y,this._verticesCursor=new y;const D=this._gl;this._program=(0,_.throwIfFalsy)((0,g.createProgram)(D,`#version 300 es
92
+ layout (location = 0) in vec2 a_position;
93
+ layout (location = 1) in vec2 a_size;
94
+ layout (location = 2) in vec4 a_color;
95
+ layout (location = 3) in vec2 a_unitquad;
96
+
97
+ uniform mat4 u_projection;
98
+
99
+ out vec4 v_color;
100
+
101
+ void main() {
102
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
103
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
104
+ v_color = a_color;
105
+ }`,`#version 300 es
106
+ precision lowp float;
107
+
108
+ in vec4 v_color;
109
+
110
+ out vec4 outColor;
111
+
112
+ void main() {
113
+ outColor = v_color;
114
+ }`)),this.register((0,v.toDisposable)((()=>D.deleteProgram(this._program)))),this._projectionLocation=(0,_.throwIfFalsy)(D.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=D.createVertexArray(),D.bindVertexArray(this._vertexArrayObject);const M=new Float32Array([0,0,1,0,0,1,1,1]),U=D.createBuffer();this.register((0,v.toDisposable)((()=>D.deleteBuffer(U)))),D.bindBuffer(D.ARRAY_BUFFER,U),D.bufferData(D.ARRAY_BUFFER,M,D.STATIC_DRAW),D.enableVertexAttribArray(3),D.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const K=new Uint8Array([0,1,2,3]),I=D.createBuffer();this.register((0,v.toDisposable)((()=>D.deleteBuffer(I)))),D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,I),D.bufferData(D.ELEMENT_ARRAY_BUFFER,K,D.STATIC_DRAW),this._attributesBuffer=(0,_.throwIfFalsy)(D.createBuffer()),this.register((0,v.toDisposable)((()=>D.deleteBuffer(this._attributesBuffer)))),D.bindBuffer(D.ARRAY_BUFFER,this._attributesBuffer),D.enableVertexAttribArray(0),D.vertexAttribPointer(0,2,D.FLOAT,!1,b,0),D.vertexAttribDivisor(0,1),D.enableVertexAttribArray(1),D.vertexAttribPointer(1,2,D.FLOAT,!1,b,2*Float32Array.BYTES_PER_ELEMENT),D.vertexAttribDivisor(1,1),D.enableVertexAttribArray(2),D.vertexAttribPointer(2,4,D.FLOAT,!1,b,4*Float32Array.BYTES_PER_ELEMENT),D.vertexAttribDivisor(2,1),this._updateCachedColors(B.colors),this.register(this._themeService.onChangeColors((F=>{this._updateCachedColors(F),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(p){const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),x.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,p.attributes,x.DYNAMIC_DRAW),x.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,p.count)}handleResize(){this._updateViewportRectangle()}setDimensions(p){this._dimensions=p}_updateCachedColors(p){this._bgFloat=this._colorToFloat32Array(p.background),this._cursorFloat=this._colorToFloat32Array(p.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(p){const x=this._terminal,L=this._vertices;let B,D,M,U,K,I,F,$,R,H,A,z=1;for(B=0;B<x.rows;B++){for(M=-1,U=0,K=0,I=!1,D=0;D<x.cols;D++)F=(B*x.cols+D)*l.RENDER_MODEL_INDICIES_PER_CELL,$=p.cells[F+l.RENDER_MODEL_BG_OFFSET],R=p.cells[F+l.RENDER_MODEL_FG_OFFSET],H=!!(67108864&R),($!==U||R!==K&&(I||H))&&((U!==0||I&&K!==0)&&(A=8*z++,this._updateRectangle(L,A,K,U,M,D,B)),M=D,U=$,K=R,I=H);(U!==0||I&&K!==0)&&(A=8*z++,this._updateRectangle(L,A,K,U,M,x.cols,B))}L.count=z}updateCursor(p){const x=this._verticesCursor,L=p.cursor;if(!L||L.style==="block")return void(x.count=0);let B,D=0;L.style!=="bar"&&L.style!=="outline"||(B=8*D++,this._addRectangleFloat(x.attributes,B,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(B=8*D++,this._addRectangleFloat(x.attributes,B,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(B=8*D++,this._addRectangleFloat(x.attributes,B,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),B=8*D++,this._addRectangleFloat(x.attributes,B,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),x.count=D}_updateRectangle(p,x,L,B,D,M,U){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:u=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:u=(16777215&L)<<8;break;default:u=this._themeService.colors.foreground.rgba}else switch(50331648&B){case 16777216:case 33554432:u=this._themeService.colors.ansi[255&B].rgba;break;case 50331648:u=(16777215&B)<<8;break;default:u=this._themeService.colors.background.rgba}p.attributes.length<x+4&&(p.attributes=(0,g.expandFloat32Array)(p.attributes,this._terminal.rows*this._terminal.cols*8)),r=D*this._dimensions.device.cell.width,c=U*this._dimensions.device.cell.height,o=(u>>24&255)/255,h=(u>>16&255)/255,m=(u>>8&255)/255,C=1,this._addRectangle(p.attributes,x,r,c,(M-D)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,o,h,m,C)}_addRectangle(p,x,L,B,D,M,U,K,I,F){p[x]=L/this._dimensions.device.canvas.width,p[x+1]=B/this._dimensions.device.canvas.height,p[x+2]=D/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=U,p[x+5]=K,p[x+6]=I,p[x+7]=F}_addRectangleFloat(p,x,L,B,D,M,U){p[x]=L/this._dimensions.device.canvas.width,p[x+1]=B/this._dimensions.device.canvas.height,p[x+2]=D/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=U[0],p[x+5]=U[1],p[x+6]=U[2],p[x+7]=U[3]}_colorToFloat32Array(p){return new Float32Array([(p.rgba>>24&255)/255,(p.rgba>>16&255)/255,(p.rgba>>8&255)/255,(255&p.rgba)/255])}}n.RectangleRenderer=S},310:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderModel=n.COMBINED_CHAR_BIT_MASK=n.RENDER_MODEL_EXT_OFFSET=n.RENDER_MODEL_FG_OFFSET=n.RENDER_MODEL_BG_OFFSET=n.RENDER_MODEL_INDICIES_PER_CELL=void 0;const _=f(296);n.RENDER_MODEL_INDICIES_PER_CELL=4,n.RENDER_MODEL_BG_OFFSET=1,n.RENDER_MODEL_FG_OFFSET=2,n.RENDER_MODEL_EXT_OFFSET=3,n.COMBINED_CHAR_BIT_MASK=2147483648,n.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,_.createSelectionRenderModel)()}resize(v,l){const g=v*l*n.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const _=f(820),v=f(274),l=f(627),g=f(457),b=f(56),y=f(374),u=f(345),r=f(859),c=f(147),o=f(782),h=f(855),m=f(965),C=f(742),S=f(310),w=f(733);class p extends r.Disposable{constructor(D,M,U,K,I,F,$,R,H){super(),this._terminal=D,this._characterJoinerService=M,this._charSizeService=U,this._coreBrowserService=K,this._coreService=I,this._decorationService=F,this._optionsService=$,this._themeService=R,this._cursorBlinkStateManager=new r.MutableDisposable,this._charAtlasDisposable=this.register(new r.MutableDisposable),this._observerDisposable=this.register(new r.MutableDisposable),this._model=new S.RenderModel,this._workCell=new o.CellData,this._workCell2=new o.CellData,this._rectangleRenderer=this.register(new r.MutableDisposable),this._glyphRenderer=this.register(new r.MutableDisposable),this._onChangeTextureAtlas=this.register(new u.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new u.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new u.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new u.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new w.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,$,this._themeService)],this.dimensions=(0,y.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register($.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const A={antialias:!1,depth:!1,preserveDrawingBuffer:H};if(this._gl=this._canvas.getContext("webgl2",A),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextlost",(z=>{console.log("webglcontextlost event received"),z.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(z)}),3e3)}))),this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextrestored",(z=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((z,V)=>this._setCanvasDevicePixelDimensions(z,V))),this.register(this._coreBrowserService.onWindowChange((z=>{this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,z,((V,Z)=>this._setCanvasDevicePixelDimensions(V,Z)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,r.toDisposable)((()=>{var z;for(const V of this._renderLayers)V.dispose();(z=this._canvas.parentElement)==null||z.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var D;return(D=this._charAtlas)==null?void 0:D.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(D,M){var U,K,I,F;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const $ of this._renderLayers)$.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`,(U=this._rectangleRenderer.value)==null||U.setDimensions(this.dimensions),(K=this._rectangleRenderer.value)==null||K.handleResize(),(I=this._glyphRenderer.value)==null||I.setDimensions(this.dimensions),(F=this._glyphRenderer.value)==null||F.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var D;for(const M of this._renderLayers)M.handleBlur(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.pause(),this._requestRedrawViewport()}handleFocus(){var D;for(const M of this._renderLayers)M.handleFocus(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.resume(),this._requestRedrawViewport()}handleSelectionChanged(D,M,U){for(const K of this._renderLayers)K.handleSelectionChanged(this._terminal,D,M,U);this._model.selection.update(this._core,D,M,U),this._requestRedrawViewport()}handleCursorMove(){var D;for(const M of this._renderLayers)M.handleCursorMove(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new C.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new m.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var M;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const D=(0,l.acquireTextureAtlas)(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._charAtlas!==D&&(this._onChangeTextureAtlas.fire(D.pages[0].canvas),this._charAtlasDisposable.value=(0,r.getDisposeArrayDisposable)([(0,u.forwardEvent)(D.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,u.forwardEvent)(D.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=D,this._charAtlas.warmUp(),(M=this._glyphRenderer.value)==null||M.setAtlas(this._charAtlas)}_clearModel(D){var M;this._model.clear(),D&&((M=this._glyphRenderer.value)==null||M.clear())}clearTextureAtlas(){var D;(D=this._charAtlas)==null||D.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var D;this._clearModel(!0);for(const M of this._renderLayers)M.reset(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(D){return-1}deregisterCharacterJoiner(D){return!1}renderRows(D,M){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,D,M);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(D,M),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new g.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(D,M){const U=this._core;let K,I,F,$,R,H,A,z,V,Z,he,ue,q,N,ne=this._workCell;D=L(D,U.rows-1,0),M=L(M,U.rows-1,0);const re=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=re-U.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let xe=-1;const pe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Ne=!1;for(I=D;I<=M;I++)for(F=I+U.buffer.ydisp,$=U.buffer.lines.get(F),this._model.lineLengths[I]=0,R=this._characterJoinerService.getJoinedCharacters(F),q=0;q<U.cols;q++)if(K=this._cellColorResolver.result.bg,$.loadCell(q,ne),q===0&&(K=this._cellColorResolver.result.bg),H=!1,A=q,R.length>0&&q===R[0][0]&&(H=!0,z=R.shift(),ne=new x(ne,$.translateToString(!0,z[0],z[1]),z[1]-z[0]),A=z[1]-1),V=ne.getChars(),Z=ne.getCode(),ue=(I*U.cols+q)*S.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ne,q,F,this.dimensions.device.cell.width),pe&&F===re&&(q===fe&&(this._model.cursor={x:fe,y:_e,width:ne.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},xe=fe+ne.getWidth()-1),q>=fe&&q<=xe&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.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)),Z!==h.NULL_CELL_CODE&&(this._model.lineLengths[I]=q+1),(this._model.cells[ue]!==Z||this._model.cells[ue+S.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ue+S.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ue+S.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Ne=!0,V.length>1&&(Z|=S.COMBINED_CHAR_BIT_MASK),this._model.cells[ue]=Z,this._model.cells[ue+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ue+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ue+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,he=ne.getWidth(),this._glyphRenderer.value.updateCell(q,I,Z,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,V,he,K),H))for(ne=this._workCell,q++;q<A;q++)N=(I*U.cols+q)*S.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(q,I,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[N]=h.NULL_CELL_CODE,this._model.cells[N+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[N+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[N+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Ne&&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(D,M){this._canvas.width===D&&this._canvas.height===M||(this._canvas.width=D,this._canvas.height=M,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const D=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:D,end:D})}}n.WebglRenderer=p;class x extends c.AttributeData{constructor(D,M,U){super(),this.content=0,this.combinedData="",this.fg=D.fg,this.bg=D.bg,this.combinedData=M,this._width=U}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(D){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(B,D,M=0){return Math.max(Math.min(B,D),M)}n.JoinedCellData=x},381:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const _=f(374);function v(l,g,b){const y=(0,_.throwIfFalsy)(l.createShader(g));if(l.shaderSource(y,b),l.compileShader(y),l.getShaderParameter(y,l.COMPILE_STATUS))return y;console.error(l.getShaderInfoLog(y)),l.deleteShader(y)}n.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),n.createProgram=function(l,g,b){const y=(0,_.throwIfFalsy)(l.createProgram());if(l.attachShader(y,(0,_.throwIfFalsy)(v(l,l.VERTEX_SHADER,g))),l.attachShader(y,(0,_.throwIfFalsy)(v(l,l.FRAGMENT_SHADER,b))),l.linkProgram(y),l.getProgramParameter(y,l.LINK_STATUS))return y;console.error(l.getProgramInfoLog(y)),l.deleteProgram(y)},n.createShader=v,n.expandFloat32Array=function(l,g){const b=Math.min(2*l.length,g),y=new Float32Array(b);for(let u=0;u<l.length;u++)y[u]=l[u];return y},n.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const _=f(627),v=f(237),l=f(374),g=f(859);class b extends g.Disposable{constructor(u,r,c,o,h,m,C,S){super(),this._container=r,this._alpha=h,this._coreBrowserService=m,this._optionsService=C,this._themeService=S,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-${c}-layer`),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((w=>{this._refreshCharAtlas(u,w),this.reset(u)}))),this.register((0,g.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(u){}handleFocus(u){}handleCursorMove(u){}handleGridChanged(u,r,c){}handleSelectionChanged(u,r,c,o=!1){}_setTransparency(u,r){if(r===this._alpha)return;const c=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,c),this._refreshCharAtlas(u,this._themeService.colors),this.handleGridChanged(u,0,u.rows-1)}_refreshCharAtlas(u,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,_.acquireTextureAtlas)(u,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(u,r){this._deviceCellWidth=r.device.cell.width,this._deviceCellHeight=r.device.cell.height,this._deviceCharWidth=r.device.char.width,this._deviceCharHeight=r.device.char.height,this._deviceCharLeft=r.device.char.left,this._deviceCharTop=r.device.char.top,this._canvas.width=r.device.canvas.width,this._canvas.height=r.device.canvas.height,this._canvas.style.width=`${r.css.canvas.width}px`,this._canvas.style.height=`${r.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(u,this._themeService.colors)}_fillBottomLineAtCells(u,r,c=1){this._ctx.fillRect(u*this._deviceCellWidth,(r+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,c*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(u,r,c,o){this._alpha?this._ctx.clearRect(u*this._deviceCellWidth,r*this._deviceCellHeight,c*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(u*this._deviceCellWidth,r*this._deviceCellHeight,c*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(u,r,c,o){this._ctx.font=this._getFont(u,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(c,o,r.getWidth()),this._ctx.fillText(r.getChars(),c*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(u,r,c){this._ctx.beginPath(),this._ctx.rect(u*this._deviceCellWidth,r*this._deviceCellHeight,c*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(u,r,c){return`${c?"italic":""} ${r?u.options.fontWeightBold:u.options.fontWeight} ${u.options.fontSize*this._coreBrowserService.dpr}px ${u.options.fontFamily}`}}n.BaseRenderLayer=b},733:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const _=f(197),v=f(237),l=f(592);class g extends l.BaseRenderLayer{constructor(y,u,r,c,o,h,m){super(r,y,"link",u,!0,o,h,m),this.register(c.onShowLinkUnderline((C=>this._handleShowLinkUnderline(C)))),this.register(c.onHideLinkUnderline((C=>this._handleHideLinkUnderline(C))))}resize(y,u){super.resize(y,u),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,_.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let u=y.y1+1;u<y.y2;u++)this._fillBottomLineAtCells(0,u,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}n.LinkRenderLayer=g},820:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(f,_,v,l){f.addEventListener(_,v,l);let g=!1;return{dispose:()=>{g||(g=!0,f.removeEventListener(_,v,l))}}}},274:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const _=f(855),v=f(160),l=f(374);let g,b=0,y=0,u=!1,r=!1,c=!1,o=0;n.CellColorResolver=class{constructor(h,m,C,S,w,p){this._terminal=h,this._optionService=m,this._selectionRenderModel=C,this._decorationService=S,this._coreBrowserService=w,this._themeService=p,this.result={fg:0,bg:0,ext:0}}resolve(h,m,C,S){if(this.result.bg=h.bg,this.result.fg=h.fg,this.result.ext=268435456&h.bg?h.extended.ext:0,y=0,b=0,r=!1,u=!1,c=!1,g=this._themeService.colors,o=0,h.getCode()!==_.NULL_CELL_CODE&&h.extended.underlineStyle===4){const w=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));o=m*S%(2*Math.round(w))}if(this._decorationService.forEachDecorationAtCell(m,C,"bottom",(w=>{w.backgroundColorRGB&&(y=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(b=w.foregroundColorRGB.rgba>>8&16777215,u=!0)})),c=this._selectionRenderModel.isCellSelected(this._terminal,m,C),c){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}y=v.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,g.selectionForeground&&(b=g.selectionForeground.rgba>>8&16777215,u=!0),(0,l.treatGlyphAsBackgroundColor)(h.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)b=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=v.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}u=!0}}this._decorationService.forEachDecorationAtCell(m,C,"top",(w=>{w.backgroundColorRGB&&(y=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(b=w.foregroundColorRGB.rgba>>8&16777215,u=!0)})),r&&(y=c?-16777216&h.bg&-134217729|y|50331648:-16777216&h.bg|y|50331648),u&&(b=-16777216&h.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!u&&(b=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,u=!0),!r&&u&&(y=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),g=void 0,this.result.bg=r?y:this.result.bg,this.result.fg=u?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=o<<29&3758096384}}},627:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const _=f(509),v=f(197),l=[];n.acquireTextureAtlas=function(g,b,y,u,r,c,o,h){const m=(0,v.generateConfig)(u,r,c,o,b,y,h);for(let w=0;w<l.length;w++){const p=l[w],x=p.ownedBy.indexOf(g);if(x>=0){if((0,v.configEquals)(p.config,m))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),l.splice(w,1)):p.ownedBy.splice(x,1);break}}for(let w=0;w<l.length;w++){const p=l[w];if((0,v.configEquals)(p.config,m))return p.ownedBy.push(g),p.atlas}const C=g._core,S={atlas:new _.TextureAtlas(document,m,C.unicodeService),config:m,ownedBy:[g]};return l.push(S),S.atlas},n.removeTerminalFromCache=function(g){for(let b=0;b<l.length;b++){const y=l[b].ownedBy.indexOf(g);if(y!==-1){l[b].ownedBy.length===1?(l[b].atlas.dispose(),l.splice(b,1)):l[b].ownedBy.splice(y,1);break}}}},197:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const _=f(160);n.generateConfig=function(v,l,g,b,y,u,r){const c={foreground:u.foreground,background:u.background,cursor:_.NULL_COLOR,cursorAccent:_.NULL_COLOR,selectionForeground:_.NULL_COLOR,selectionBackgroundTransparent:_.NULL_COLOR,selectionBackgroundOpaque:_.NULL_COLOR,selectionInactiveBackgroundTransparent:_.NULL_COLOR,selectionInactiveBackgroundOpaque:_.NULL_COLOR,ansi:u.ansi.slice(),contrastCache:u.contrastCache,halfContrastCache:u.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:r,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:v,deviceCellHeight:l,deviceCharWidth:g,deviceCharHeight:b,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:c}},n.configEquals=function(v,l){for(let g=0;g<v.colors.ansi.length;g++)if(v.colors.ansi[g].rgba!==l.colors.ansi[g].rgba)return!1;return v.devicePixelRatio===l.devicePixelRatio&&v.customGlyphs===l.customGlyphs&&v.lineHeight===l.lineHeight&&v.letterSpacing===l.letterSpacing&&v.fontFamily===l.fontFamily&&v.fontSize===l.fontSize&&v.fontWeight===l.fontWeight&&v.fontWeightBold===l.fontWeightBold&&v.allowTransparency===l.allowTransparency&&v.deviceCharWidth===l.deviceCharWidth&&v.deviceCharHeight===l.deviceCharHeight&&v.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&v.minimumContrastRatio===l.minimumContrastRatio&&v.colors.foreground.rgba===l.colors.foreground.rgba&&v.colors.background.rgba===l.colors.background.rgba},n.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const _=f(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=_.isFirefox||_.isLegacyEdge?"bottom":"ideographic"},457:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(f,_){this._renderCallback=f,this._coreBrowserService=_,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(f=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const _=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,_>0)return void this._restartInterval(_)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const _=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(_)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),f)}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()}}},860:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const _=f(374);n.blockElementDefinitions={"▀":[{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}]};const v={"░":[[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]]};n.boxDrawingDefinitions={"─":{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:(u,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(u,r)=>`M${.5-u},0 L${.5-u},1 M${.5+u},0 L${.5+u},1`},"╒":{1:(u,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(u,r)=>`M${.5-u},1 L${.5-u},.5 L1,.5 M${.5+u},.5 L${.5+u},1`},"╔":{1:(u,r)=>`M1,${.5-r} L${.5-u},${.5-r} L${.5-u},1 M1,${.5+r} L${.5+u},${.5+r} L${.5+u},1`},"╕":{1:(u,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(u,r)=>`M${.5+u},1 L${.5+u},.5 L0,.5 M${.5-u},.5 L${.5-u},1`},"╗":{1:(u,r)=>`M0,${.5+r} L${.5-u},${.5+r} L${.5-u},1 M0,${.5-r} L${.5+u},${.5-r} L${.5+u},1`},"╘":{1:(u,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(u,r)=>`M1,.5 L${.5-u},.5 L${.5-u},0 M${.5+u},.5 L${.5+u},0`},"╚":{1:(u,r)=>`M1,${.5-r} L${.5+u},${.5-r} L${.5+u},0 M1,${.5+r} L${.5-u},${.5+r} L${.5-u},0`},"╛":{1:(u,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(u,r)=>`M0,.5 L${.5+u},.5 L${.5+u},0 M${.5-u},.5 L${.5-u},0`},"╝":{1:(u,r)=>`M0,${.5-r} L${.5-u},${.5-r} L${.5-u},0 M0,${.5+r} L${.5+u},${.5+r} L${.5+u},0`},"╞":{1:(u,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(u,r)=>`M${.5-u},0 L${.5-u},1 M${.5+u},0 L${.5+u},1 M${.5+u},.5 L1,.5`},"╠":{1:(u,r)=>`M${.5-u},0 L${.5-u},1 M1,${.5+r} L${.5+u},${.5+r} L${.5+u},1 M1,${.5-r} L${.5+u},${.5-r} L${.5+u},0`},"╡":{1:(u,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(u,r)=>`M0,.5 L${.5-u},.5 M${.5-u},0 L${.5-u},1 M${.5+u},0 L${.5+u},1`},"╣":{1:(u,r)=>`M${.5+u},0 L${.5+u},1 M0,${.5+r} L${.5-u},${.5+r} L${.5-u},1 M0,${.5-r} L${.5-u},${.5-r} L${.5-u},0`},"╤":{1:(u,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(u,r)=>`M0,.5 L1,.5 M${.5-u},.5 L${.5-u},1 M${.5+u},.5 L${.5+u},1`},"╦":{1:(u,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-u},${.5+r} L${.5-u},1 M1,${.5+r} L${.5+u},${.5+r} L${.5+u},1`},"╧":{1:(u,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(u,r)=>`M0,.5 L1,.5 M${.5-u},.5 L${.5-u},0 M${.5+u},.5 L${.5+u},0`},"╩":{1:(u,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-u},${.5-r} L${.5-u},0 M1,${.5-r} L${.5+u},${.5-r} L${.5+u},0`},"╪":{1:(u,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(u,r)=>`M0,.5 L1,.5 M${.5-u},0 L${.5-u},1 M${.5+u},0 L${.5+u},1`},"╬":{1:(u,r)=>`M0,${.5+r} L${.5-u},${.5+r} L${.5-u},1 M1,${.5+r} L${.5+u},${.5+r} L${.5+u},1 M0,${.5-r} L${.5-u},${.5-r} L${.5-u},0 M1,${.5-r} L${.5+u},${.5-r} L${.5+u},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:(u,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(u,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(u,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(u,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{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}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(u,r,c,o,h,m,C,S){const w=n.blockElementDefinitions[r];if(w)return(function(B,D,M,U,K,I){for(let F=0;F<D.length;F++){const $=D[F],R=K/8,H=I/8;B.fillRect(M+$.x*R,U+$.y*H,$.w*R,$.h*H)}})(u,w,c,o,h,m),!0;const p=v[r];if(p)return(function(B,D,M,U,K,I){let F=l.get(D);F||(F=new Map,l.set(D,F));const $=B.fillStyle;if(typeof $!="string")throw new Error(`Unexpected fillStyle type "${$}"`);let R=F.get($);if(!R){const H=D[0].length,A=D.length,z=B.canvas.ownerDocument.createElement("canvas");z.width=H,z.height=A;const V=(0,_.throwIfFalsy)(z.getContext("2d")),Z=new ImageData(H,A);let he,ue,q,N;if($.startsWith("#"))he=parseInt($.slice(1,3),16),ue=parseInt($.slice(3,5),16),q=parseInt($.slice(5,7),16),N=$.length>7&&parseInt($.slice(7,9),16)||1;else{if(!$.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${$}" when drawing pattern glyph`);[he,ue,q,N]=$.substring(5,$.length-1).split(",").map((ne=>parseFloat(ne)))}for(let ne=0;ne<A;ne++)for(let re=0;re<H;re++)Z.data[4*(ne*H+re)]=he,Z.data[4*(ne*H+re)+1]=ue,Z.data[4*(ne*H+re)+2]=q,Z.data[4*(ne*H+re)+3]=D[ne][re]*(255*N);V.putImageData(Z,0,0),R=(0,_.throwIfFalsy)(B.createPattern(z,null)),F.set($,R)}B.fillStyle=R,B.fillRect(M,U,K,I)})(u,p,c,o,h,m),!0;const x=n.boxDrawingDefinitions[r];if(x)return(function(B,D,M,U,K,I,F){B.strokeStyle=B.fillStyle;for(const[$,R]of Object.entries(D)){let H;B.beginPath(),B.lineWidth=F*Number.parseInt($),H=typeof R=="function"?R(.15,.15/I*K):R;for(const A of H.split(" ")){const z=A[0],V=b[z];if(!V){console.error(`Could not find drawing instructions for "${z}"`);continue}const Z=A.substring(1).split(",");Z[0]&&Z[1]&&V(B,y(Z,K,I,M,U,!0,F))}B.stroke(),B.closePath()}})(u,x,c,o,h,m,S),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(B,D,M,U,K,I,F,$){const R=new Path2D;R.rect(M,U,K,I),B.clip(R),B.beginPath();const H=F/12;B.lineWidth=$*H;for(const A of D.d.split(" ")){const z=A[0],V=b[z];if(!V){console.error(`Could not find drawing instructions for "${z}"`);continue}const Z=A.substring(1).split(",");Z[0]&&Z[1]&&V(B,y(Z,K,I,M,U,!1,$,(D.leftPadding??0)*(H/2),(D.rightPadding??0)*(H/2)))}D.type===1?(B.strokeStyle=B.fillStyle,B.stroke()):B.fill(),B.closePath()})(u,L,c,o,h,m,C,S),!0)};const l=new Map;function g(u,r,c=0){return Math.max(Math.min(u,r),c)}const b={C:(u,r)=>u.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(u,r)=>u.lineTo(r[0],r[1]),M:(u,r)=>u.moveTo(r[0],r[1])};function y(u,r,c,o,h,m,C,S=0,w=0){const p=u.map((x=>parseFloat(x)||parseInt(x)));if(p.length<2)throw new Error("Too few arguments for instruction");for(let x=0;x<p.length;x+=2)p[x]*=r-S*C-w*C,m&&p[x]!==0&&(p[x]=g(Math.round(p[x]+.5)-.5,r,0)),p[x]+=o+S*C;for(let x=1;x<p.length;x+=2)p[x]*=c,m&&p[x]!==0&&(p[x]=g(Math.round(p[x]+.5)-.5,c,0)),p[x]+=h;return p}},56:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const _=f(859);n.observeDevicePixelDimensions=function(v,l,g){let b=new l.ResizeObserver((y=>{const u=y.find((o=>o.target===v));if(!u)return;if(!("devicePixelContentBoxSize"in u))return b==null||b.disconnect(),void(b=void 0);const r=u.devicePixelContentBoxSize[0].inlineSize,c=u.devicePixelContentBoxSize[0].blockSize;r>0&&c>0&&g(r,c)}));try{b.observe(v,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,_.toDisposable)((()=>b==null?void 0:b.disconnect()))}},374:(P,n)=>{function f(v){return 57508<=v&&v<=57558}function _(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},n.isPowerlineGlyph=f,n.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},n.isEmoji=_,n.allowRescaling=function(v,l,g,b){return l===1&&g>Math.ceil(1.5*b)&&v!==void 0&&v>255&&!_(v)&&!f(v)&&!(function(y){return 57344<=y&&y<=63743})(v)},n.treatGlyphAsBackgroundColor=function(v){return f(v)||(function(l){return 9472<=l&&l<=9631})(v)},n.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},n.computeNextVariantOffset=function(v,l,g=0){return(v-(2*Math.round(l)-g))%(2*Math.round(l))}},296:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class f{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(v,l,g,b=!1){if(this.selectionStart=l,this.selectionEnd=g,!l||!g||l[0]===g[0]&&l[1]===g[1])return void this.clear();const y=v.buffers.active.ydisp,u=l[1]-y,r=g[1]-y,c=Math.max(u,0),o=Math.min(r,v.rows-1);c>=v.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=u,this.viewportEndRow=r,this.viewportCappedStartRow=c,this.viewportCappedEndRow=o,this.startCol=l[0],this.endCol=g[0])}isCellSelected(v,l,g){return!!this.hasSelection&&(g-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&g>=this.viewportCappedStartRow&&l<this.endCol&&g<=this.viewportCappedEndRow:l<this.startCol&&g>=this.viewportCappedStartRow&&l>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol)}}n.createSelectionRenderModel=function(){return new f}},509:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const _=f(237),v=f(860),l=f(374),g=f(160),b=f(345),y=f(485),u=f(385),r=f(147),c=f(855),o={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}};let h;class m{get pages(){return this._pages}constructor(x,L,B){this._document=x,this._config=L,this._unicodeService=B,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new b.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new b.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=w(x,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const x of this.pages)x.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const x=new u.IdleTaskQueue;for(let L=33;L<126;L++)x.enqueue((()=>{if(!this._cacheMap.get(L,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT)){const B=this._drawToCache(L,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT);this._cacheMap.set(L,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT,B)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const x of this._pages)x.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(m.maxAtlasPages&&this._pages.length>=Math.max(4,m.maxAtlasPages)){const L=this._pages.filter((F=>2*F.canvas.width<=(m.maxTextureSize||4096))).sort(((F,$)=>$.canvas.width!==F.canvas.width?$.canvas.width-F.canvas.width:$.percentageUsed-F.percentageUsed));let B=-1,D=0;for(let F=0;F<L.length;F++)if(L[F].canvas.width!==D)B=F,D=L[F].canvas.width;else if(F-B==3)break;const M=L.slice(B,B+4),U=M.map((F=>F.glyphs[0].texturePage)).sort(((F,$)=>F>$?1:-1)),K=this.pages.length-M.length,I=this._mergePages(M,K);I.version++;for(let F=U.length-1;F>=0;F--)this._deletePage(U[F]);this.pages.push(I),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(I.canvas)}const x=new C(this._document,this._textureSize);return this._pages.push(x),this._activePages.push(x),this._onAddTextureAtlasCanvas.fire(x.canvas),x}_mergePages(x,L){const B=2*x[0].canvas.width,D=new C(this._document,B,x);for(const[M,U]of x.entries()){const K=M*U.canvas.width%B,I=Math.floor(M/2)*U.canvas.height;D.ctx.drawImage(U.canvas,K,I);for(const $ of U.glyphs)$.texturePage=L,$.sizeClipSpace.x=$.size.x/B,$.sizeClipSpace.y=$.size.y/B,$.texturePosition.x+=K,$.texturePosition.y+=I,$.texturePositionClipSpace.x=$.texturePosition.x/B,$.texturePositionClipSpace.y=$.texturePosition.y/B;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const F=this._activePages.indexOf(U);F!==-1&&this._activePages.splice(F,1)}return D}_deletePage(x){this._pages.splice(x,1);for(let L=x;L<this._pages.length;L++){const B=this._pages[L];for(const D of B.glyphs)D.texturePage--;B.version++}}getRasterizedGlyphCombinedChar(x,L,B,D,M){return this._getFromCacheMap(this._cacheMapCombined,x,L,B,D,M)}getRasterizedGlyph(x,L,B,D,M){return this._getFromCacheMap(this._cacheMap,x,L,B,D,M)}_getFromCacheMap(x,L,B,D,M,U=!1){return h=x.get(L,B,D,M),h||(h=this._drawToCache(L,B,D,M,U),x.set(L,B,D,M,h)),h}_getColorFromAnsiIndex(x){if(x>=this._config.colors.ansi.length)throw new Error("No color found for idx "+x);return this._config.colors.ansi[x]}_getBackgroundColor(x,L,B,D){if(this._config.allowTransparency)return g.NULL_COLOR;let M;switch(x){case 16777216:case 33554432:M=this._getColorFromAnsiIndex(L);break;case 50331648:const U=r.AttributeData.toColorRGB(L);M=g.channels.toColor(U[0],U[1],U[2]);break;default:M=B?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return M}_getForegroundColor(x,L,B,D,M,U,K,I,F,$){const R=this._getMinimumContrastColor(x,L,B,D,M,U,K,F,I,$);if(R)return R;let H;switch(M){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&F&&U<8&&(U+=8),H=this._getColorFromAnsiIndex(U);break;case 50331648:const A=r.AttributeData.toColorRGB(U);H=g.channels.toColor(A[0],A[1],A[2]);break;default:H=K?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(H=g.color.opaque(H)),I&&(H=g.color.multiplyOpacity(H,_.DIM_OPACITY)),H}_resolveBackgroundRgba(x,L,B){switch(x){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return B?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(x,L,B,D){switch(x){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return B?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(x,L,B,D,M,U,K,I,F,$){if(this._config.minimumContrastRatio===1||$)return;const R=this._getContrastCache(F),H=R.getColor(x,D);if(H!==void 0)return H||void 0;const A=this._resolveBackgroundRgba(L,B,K),z=this._resolveForegroundRgba(M,U,K,I),V=g.rgba.ensureContrastRatio(A,z,this._config.minimumContrastRatio/(F?2:1));if(!V)return void R.setColor(x,D,null);const Z=g.channels.toColor(V>>24&255,V>>16&255,V>>8&255);return R.setColor(x,D,Z),Z}_getContrastCache(x){return x?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(x,L,B,D,M=!1){const U=typeof x=="number"?String.fromCharCode(x):x,K=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width<K&&(this._tmpCanvas.width=K);const I=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<I&&(this._tmpCanvas.height=I),this._tmpCtx.save(),this._workAttributeData.fg=B,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=D,this._workAttributeData.isInvisible())return o;const F=!!this._workAttributeData.isBold(),$=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),H=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),z=!!this._workAttributeData.isStrikethrough(),V=!!this._workAttributeData.isOverline();let Z=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),ue=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if($){const ve=Z;Z=ue,ue=ve;const Ce=he;he=q,q=Ce}const N=this._getBackgroundColor(q,ue,$,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ne=F?this._config.fontWeightBold:this._config.fontWeight,re=H?"italic":"";this._tmpCtx.font=`${re} ${ne} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=_.TEXT_BASELINE;const _e=U.length===1&&(0,l.isPowerlineGlyph)(U.charCodeAt(0)),fe=U.length===1&&(0,l.isRestrictedPowerlineGlyph)(U.charCodeAt(0)),xe=this._getForegroundColor(L,q,ue,B,he,Z,$,R,F,(0,l.treatGlyphAsBackgroundColor)(U.charCodeAt(0)));this._tmpCtx.fillStyle=xe.css;const pe=fe?0:4;let Ne=!1;this._config.customGlyphs!==!1&&(Ne=(0,v.tryDrawCustomChar)(this._tmpCtx,U,pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Qe,be=!_e;if(Qe=typeof x=="number"?this._unicodeService.wcwidth(x):this._unicodeService.getStringCellWidth(x),A){this._tmpCtx.save();const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ce=ve%2==1?.5:0;if(this._tmpCtx.lineWidth=ve,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())be=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{be=!1;let et=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&et<8&&(et+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(et).css}this._tmpCtx.beginPath();const Ze=pe,Fe=Math.ceil(pe+this._config.deviceCharHeight)-Ce-(M?2*ve:0),Ft=Fe+ve,ht=Fe+2*ve;let wt=this._workAttributeData.getUnderlineVariantOffset();for(let et=0;et<Qe;et++){this._tmpCtx.save();const qe=Ze+et*this._config.deviceCellWidth,Re=Ze+(et+1)*this._config.deviceCellWidth,Jt=qe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(qe,Fe),this._tmpCtx.lineTo(Re,Fe),this._tmpCtx.moveTo(qe,ht),this._tmpCtx.lineTo(Re,ht);break;case 3:const dt=ve<=1?ht:Math.ceil(pe+this._config.deviceCharHeight-ve/2)-Ce,Ot=ve<=1?Fe:Math.ceil(pe+this._config.deviceCharHeight+ve/2)-Ce,bt=new Path2D;bt.rect(qe,Fe,this._config.deviceCellWidth,ht-Fe),this._tmpCtx.clip(bt),this._tmpCtx.moveTo(qe-this._config.deviceCellWidth/2,Ft),this._tmpCtx.bezierCurveTo(qe-this._config.deviceCellWidth/2,Ot,qe,Ot,qe,Ft),this._tmpCtx.bezierCurveTo(qe,dt,Jt,dt,Jt,Ft),this._tmpCtx.bezierCurveTo(Jt,Ot,Re,Ot,Re,Ft),this._tmpCtx.bezierCurveTo(Re,dt,Re+this._config.deviceCellWidth/2,dt,Re+this._config.deviceCellWidth/2,Ft);break;case 4:const ys=wt===0?0:wt>=ve?2*ve-wt:ve-wt;wt>=ve||ys===0?(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(qe+ys,Fe),this._tmpCtx.lineTo(Re,Fe)):(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(qe,Fe),this._tmpCtx.lineTo(qe+ys,Fe),this._tmpCtx.moveTo(qe+ys+ve,Fe),this._tmpCtx.lineTo(Re,Fe)),wt=(0,l.computeNextVariantOffset)(Re-qe,ve,wt);break;case 5:const _a=.6,va=.3,Ri=Re-qe,ts=Math.floor(_a*Ri),is=Math.floor(va*Ri),ci=Ri-ts-is;this._tmpCtx.setLineDash([ts,is,ci]),this._tmpCtx.moveTo(qe,Fe),this._tmpCtx.lineTo(Re,Fe);break;default:this._tmpCtx.moveTo(qe,Fe),this._tmpCtx.lineTo(Re,Fe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ne&&this._config.fontSize>=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const et=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in et&&et.actualBoundingBoxDescent>0){this._tmpCtx.save();const qe=new Path2D;qe.rect(Ze,Fe-Math.ceil(ve/2),this._config.deviceCellWidth*Qe,ht-Fe+Math.ceil(ve/2)),this._tmpCtx.clip(qe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=N.css,this._tmpCtx.strokeText(U,pe,pe+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(V){const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ce=ve%2==1?.5:0;this._tmpCtx.lineWidth=ve,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(pe,pe+Ce),this._tmpCtx.lineTo(pe+this._config.deviceCharWidth*Qe,pe+Ce),this._tmpCtx.stroke()}if(Ne||this._tmpCtx.fillText(U,pe,pe+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let ve=S(this._tmpCtx.getImageData(pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight),N,xe,be);if(ve)for(let Ce=1;Ce<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,pe,pe+this._config.deviceCharHeight-Ce),ve=S(this._tmpCtx.getImageData(pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight),N,xe,be),ve);Ce++);}if(z){const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ce=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ve,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(pe,pe+Math.floor(this._config.deviceCharHeight/2)-Ce),this._tmpCtx.lineTo(pe+this._config.deviceCharWidth*Qe,pe+Math.floor(this._config.deviceCharHeight/2)-Ce),this._tmpCtx.stroke()}this._tmpCtx.restore();const Bt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let si;if(si=this._config.allowTransparency?(function(ve){for(let Ce=0;Ce<ve.data.length;Ce+=4)if(ve.data[Ce+3]>0)return!1;return!0})(Bt):S(Bt,N,xe,be),si)return o;const Be=this._findGlyphBoundingBox(Bt,this._workBoundingBox,K,fe,Ne,pe);let Ae,De;for(;;){if(this._activePages.length===0){const ve=this._createNewPage();Ae=ve,De=ve.currentRow,De.height=Be.size.y;break}Ae=this._activePages[this._activePages.length-1],De=Ae.currentRow;for(const ve of this._activePages)Be.size.y<=ve.currentRow.height&&(Ae=ve,De=ve.currentRow);for(let ve=this._activePages.length-1;ve>=0;ve--)for(const Ce of this._activePages[ve].fixedRows)Ce.height<=De.height&&Be.size.y<=Ce.height&&(Ae=this._activePages[ve],De=Ce);if(De.y+Be.size.y>=Ae.canvas.height||De.height>Be.size.y+2){let ve=!1;if(Ae.currentRow.y+Ae.currentRow.height+Be.size.y>=Ae.canvas.height){let Ce;for(const Ze of this._activePages)if(Ze.currentRow.y+Ze.currentRow.height+Be.size.y<Ze.canvas.height){Ce=Ze;break}if(Ce)Ae=Ce;else if(m.maxAtlasPages&&this._pages.length>=m.maxAtlasPages&&De.y+Be.size.y<=Ae.canvas.height&&De.height>=Be.size.y&&De.x+Be.size.x<=Ae.canvas.width)ve=!0;else{const Ze=this._createNewPage();Ae=Ze,De=Ze.currentRow,De.height=Be.size.y,ve=!0}}ve||(Ae.currentRow.height>0&&Ae.fixedRows.push(Ae.currentRow),De={x:0,y:Ae.currentRow.y+Ae.currentRow.height,height:Be.size.y},Ae.fixedRows.push(De),Ae.currentRow={x:0,y:De.y+De.height,height:0})}if(De.x+Be.size.x<=Ae.canvas.width)break;De===Ae.currentRow?(De.x=0,De.y+=De.height,De.height=0):Ae.fixedRows.splice(Ae.fixedRows.indexOf(De),1)}return Be.texturePage=this._pages.indexOf(Ae),Be.texturePosition.x=De.x,Be.texturePosition.y=De.y,Be.texturePositionClipSpace.x=De.x/Ae.canvas.width,Be.texturePositionClipSpace.y=De.y/Ae.canvas.height,Be.sizeClipSpace.x/=Ae.canvas.width,Be.sizeClipSpace.y/=Ae.canvas.height,De.height=Math.max(De.height,Be.size.y),De.x+=Be.size.x,Ae.ctx.putImageData(Bt,Be.texturePosition.x-this._workBoundingBox.left,Be.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Be.size.x,Be.size.y),Ae.addGlyph(Be),Ae.version++,Be}_findGlyphBoundingBox(x,L,B,D,M,U){L.top=0;const K=D?this._config.deviceCellHeight:this._tmpCanvas.height,I=D?this._config.deviceCellWidth:B;let F=!1;for(let $=0;$<K;$++){for(let R=0;R<I;R++){const H=$*this._tmpCanvas.width*4+4*R+3;if(x.data[H]!==0){L.top=$,F=!0;break}}if(F)break}L.left=0,F=!1;for(let $=0;$<U+I;$++){for(let R=0;R<K;R++){const H=R*this._tmpCanvas.width*4+4*$+3;if(x.data[H]!==0){L.left=$,F=!0;break}}if(F)break}L.right=I,F=!1;for(let $=U+I-1;$>=U;$--){for(let R=0;R<K;R++){const H=R*this._tmpCanvas.width*4+4*$+3;if(x.data[H]!==0){L.right=$,F=!0;break}}if(F)break}L.bottom=K,F=!1;for(let $=K-1;$>=0;$--){for(let R=0;R<I;R++){const H=$*this._tmpCanvas.width*4+4*R+3;if(x.data[H]!==0){L.bottom=$,F=!0;break}}if(F)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+U+(D||M?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+U+(D||M?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=m;class C{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(x){this._glyphs.push(x),this._usedPixels+=x.size.x*x.size.y}constructor(x,L,B){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],B)for(const D of B)this._glyphs.push(...D.glyphs),this._usedPixels+=D._usedPixels;this.canvas=w(x,L,L),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 S(p,x,L,B){const D=x.rgba>>>24,M=x.rgba>>>16&255,U=x.rgba>>>8&255,K=L.rgba>>>24,I=L.rgba>>>16&255,F=L.rgba>>>8&255,$=Math.floor((Math.abs(D-K)+Math.abs(M-I)+Math.abs(U-F))/12);let R=!0;for(let H=0;H<p.data.length;H+=4)p.data[H]===D&&p.data[H+1]===M&&p.data[H+2]===U||B&&Math.abs(p.data[H]-D)+Math.abs(p.data[H+1]-M)+Math.abs(p.data[H+2]-U)<$?p.data[H+3]=0:R=!1;return R}function w(p,x,L){const B=p.createElement("canvas");return B.width=x,B.height=L,B}},160:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let f=0,_=0,v=0,l=0;var g,b,y,u,r;function c(h){const m=h.toString(16);return m.length<2?"0"+m:m}function o(h,m){return h<m?(m+.05)/(h+.05):(h+.05)/(m+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(m,C,S,w){return w!==void 0?`#${c(m)}${c(C)}${c(S)}${c(w)}`:`#${c(m)}${c(C)}${c(S)}`},h.toRgba=function(m,C,S,w=255){return(m<<24|C<<16|S<<8|w)>>>0},h.toColor=function(m,C,S,w){return{css:h.toCss(m,C,S,w),rgba:h.toRgba(m,C,S,w)}}})(g||(n.channels=g={})),(function(h){function m(C,S){return l=Math.round(255*S),[f,_,v]=r.toChannels(C.rgba),{css:g.toCss(f,_,v,l),rgba:g.toRgba(f,_,v,l)}}h.blend=function(C,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const w=S.rgba>>24&255,p=S.rgba>>16&255,x=S.rgba>>8&255,L=C.rgba>>24&255,B=C.rgba>>16&255,D=C.rgba>>8&255;return f=L+Math.round((w-L)*l),_=B+Math.round((p-B)*l),v=D+Math.round((x-D)*l),{css:g.toCss(f,_,v),rgba:g.toRgba(f,_,v)}},h.isOpaque=function(C){return(255&C.rgba)==255},h.ensureContrastRatio=function(C,S,w){const p=r.ensureContrastRatio(C.rgba,S.rgba,w);if(p)return g.toColor(p>>24&255,p>>16&255,p>>8&255)},h.opaque=function(C){const S=(255|C.rgba)>>>0;return[f,_,v]=r.toChannels(S),{css:g.toCss(f,_,v),rgba:S}},h.opacity=m,h.multiplyOpacity=function(C,S){return l=255&C.rgba,m(C,l*S/255)},h.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}})(b||(n.color=b={})),(function(h){let m,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const w=S.getContext("2d",{willReadFrequently:!0});w&&(m=w,m.globalCompositeOperation="copy",C=m.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return f=parseInt(S.slice(1,2).repeat(2),16),_=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),g.toColor(f,_,v);case 5:return f=parseInt(S.slice(1,2).repeat(2),16),_=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),g.toColor(f,_,v,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const w=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return f=parseInt(w[1]),_=parseInt(w[2]),v=parseInt(w[3]),l=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(f,_,v,l);if(!m||!C)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=C,m.fillStyle=S,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[f,_,v,l]=m.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(f,_,v,l),css:S}}})(y||(n.css=y={})),(function(h){function m(C,S,w){const p=C/255,x=S/255,L=w/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}h.relativeLuminance=function(C){return m(C>>16&255,C>>8&255,255&C)},h.relativeLuminance2=m})(u||(n.rgb=u={})),(function(h){function m(S,w,p){const x=S>>24&255,L=S>>16&255,B=S>>8&255;let D=w>>24&255,M=w>>16&255,U=w>>8&255,K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));for(;K<p&&(D>0||M>0||U>0);)D-=Math.max(0,Math.ceil(.1*D)),M-=Math.max(0,Math.ceil(.1*M)),U-=Math.max(0,Math.ceil(.1*U)),K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));return(D<<24|M<<16|U<<8|255)>>>0}function C(S,w,p){const x=S>>24&255,L=S>>16&255,B=S>>8&255;let D=w>>24&255,M=w>>16&255,U=w>>8&255,K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));for(;K<p&&(D<255||M<255||U<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),M=Math.min(255,M+Math.ceil(.1*(255-M))),U=Math.min(255,U+Math.ceil(.1*(255-U))),K=o(u.relativeLuminance2(D,M,U),u.relativeLuminance2(x,L,B));return(D<<24|M<<16|U<<8|255)>>>0}h.blend=function(S,w){if(l=(255&w)/255,l===1)return w;const p=w>>24&255,x=w>>16&255,L=w>>8&255,B=S>>24&255,D=S>>16&255,M=S>>8&255;return f=B+Math.round((p-B)*l),_=D+Math.round((x-D)*l),v=M+Math.round((L-M)*l),g.toRgba(f,_,v)},h.ensureContrastRatio=function(S,w,p){const x=u.relativeLuminance(S>>8),L=u.relativeLuminance(w>>8);if(o(x,L)<p){if(L<x){const M=m(S,w,p),U=o(x,u.relativeLuminance(M>>8));if(U<p){const K=C(S,w,p);return U>o(x,u.relativeLuminance(K>>8))?M:K}return M}const B=C(S,w,p),D=o(x,u.relativeLuminance(B>>8));if(D<p){const M=m(S,w,p);return D>o(x,u.relativeLuminance(M>>8))?B:M}return B}},h.reduceLuminance=m,h.increaseLuminance=C,h.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(r||(n.rgba=r={})),n.toPaddedHex=c,n.contrastRatio=o},345:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=f=>(this._listeners.push(f),{dispose:()=>{if(!this._disposed){for(let _=0;_<this._listeners.length;_++)if(this._listeners[_]===f)return void this._listeners.splice(_,1)}}})),this._event}fire(f,_){const v=[];for(let l=0;l<this._listeners.length;l++)v.push(this._listeners[l]);for(let l=0;l<v.length;l++)v[l].call(void 0,f,_)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(f,_){return f((v=>_.fire(v)))},n.runAndSubscribe=function(f,_){return _(void 0),f((v=>_(v)))}},859:(P,n)=>{function f(_){for(const v of _)v.dispose();_.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const _ of this._disposables)_.dispose();this._disposables.length=0}register(_){return this._disposables.push(_),_}unregister(_){const v=this._disposables.indexOf(_);v!==-1&&this._disposables.splice(v,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(_){var v;this._isDisposed||_===this._value||((v=this._value)==null||v.dispose(),this._value=_)}clear(){this.value=void 0}dispose(){var _;this._isDisposed=!0,(_=this._value)==null||_.dispose(),this._value=void 0}},n.toDisposable=function(_){return{dispose:_}},n.disposeArray=f,n.getDisposeArrayDisposable=function(_){return{dispose:()=>f(_)}}},485:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(v,l,g){this._data[v]||(this._data[v]={}),this._data[v][l]=g}get(v,l){return this._data[v]?this._data[v][l]:void 0}clear(){this._data={}}}n.TwoKeyMap=f,n.FourKeyMap=class{constructor(){this._data=new f}set(_,v,l,g,b){this._data.get(_,v)||this._data.set(_,v,new f),this._data.get(_,v).set(l,g,b)}get(_,v,l,g){var b;return(b=this._data.get(_,v))==null?void 0:b.get(l,g)}clear(){this._data.clear()}}},399:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const f=n.isNode?"node":navigator.userAgent,_=n.isNode?"node":navigator.platform;n.isFirefox=f.includes("Firefox"),n.isLegacyEdge=f.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(f),n.getSafariVersion=function(){if(!n.isSafari)return 0;const v=f.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_),n.isIpad=_==="iPad",n.isIphone=_==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(_),n.isLinux=_.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(f)},385:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const _=f(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let y=0,u=0,r=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),u=Math.max(y,u),c=b.timeRemaining(),1.5*u>c)return r-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-y))}ms`),void this._start();r=c}this.clear()}}class l extends v{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const y=Date.now()+b;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}n.PriorityTaskQueue=l,n.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:l,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new _}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new f;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=f;class _{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,g=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=g}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=_},782:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const _=f(133),v=f(855),l=f(147);class g extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const u=new g;return u.setFromCharData(y),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(y[v.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(y[v.CHAR_DATA_CHAR_INDEX].length===2){const r=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const c=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(r-55296)+c-56320+65536|y[v.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[v.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=y[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},855:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},n.utf32ToString=function(f,_=0,v=f.length){let l="";for(let g=_;g<v;++g){let b=f[g];b>65535?(b-=65536,l+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):l+=String.fromCharCode(b)}return l},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,_){const v=f.length;if(!v)return 0;let l=0,g=0;if(this._interim){const b=f.charCodeAt(g++);56320<=b&&b<=57343?_[l++]=1024*(this._interim-55296)+b-56320+65536:(_[l++]=this._interim,_[l++]=b),this._interim=0}for(let b=g;b<v;++b){const y=f.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=v)return this._interim=y,l;const u=f.charCodeAt(b);56320<=u&&u<=57343?_[l++]=1024*(y-55296)+u-56320+65536:(_[l++]=y,_[l++]=u)}else y!==65279&&(_[l++]=y)}return l}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,_){const v=f.length;if(!v)return 0;let l,g,b,y,u=0,r=0,c=0;if(this.interim[0]){let m=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,w=0;for(;(S=63&this.interim[++w])&&w<4;)C<<=6,C|=S;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-w;for(;c<x;){if(c>=v)return 0;if(S=f[c++],(192&S)!=128){c--,m=!0;break}this.interim[w++]=S,C<<=6,C|=63&S}m||(p===2?C<128?c--:_[u++]=C:p===3?C<2048||C>=55296&&C<=57343||C===65279||(_[u++]=C):C<65536||C>1114111||(_[u++]=C)),this.interim.fill(0)}const o=v-4;let h=c;for(;h<v;){for(;!(!(h<o)||128&(l=f[h])||128&(g=f[h+1])||128&(b=f[h+2])||128&(y=f[h+3]));)_[u++]=l,_[u++]=g,_[u++]=b,_[u++]=y,h+=4;if(l=f[h++],l<128)_[u++]=l;else if((224&l)==192){if(h>=v)return this.interim[0]=l,u;if(g=f[h++],(192&g)!=128){h--;continue}if(r=(31&l)<<6|63&g,r<128){h--;continue}_[u++]=r}else if((240&l)==224){if(h>=v)return this.interim[0]=l,u;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=g,u;if(b=f[h++],(192&b)!=128){h--;continue}if(r=(15&l)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;_[u++]=r}else if((248&l)==240){if(h>=v)return this.interim[0]=l,u;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=g,u;if(b=f[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=g,this.interim[2]=b,u;if(y=f[h++],(192&y)!=128){h--;continue}if(r=(7&l)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;_[u++]=r}}return u}}},776:function(P,n,f){var _=this&&this.__decorate||function(r,c,o,h){var m,C=arguments.length,S=C<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,c,o,h);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(S=(C<3?m(S):C>3?m(c,o,S):m(c,o))||S);return C>3&&S&&Object.defineProperty(c,o,S),S},v=this&&this.__param||function(r,c){return function(o,h){c(o,h,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const l=f(859),g=f(97),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,u=n.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),y=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let c=0;c<r.length;c++)typeof r[c]=="function"&&(r[c]=r[c]())}_log(r,c,o){this._evalLazyOptionalParams(o),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...o)}trace(r,...c){var o;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,r,c)}debug(r,...c){var o;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,r,c)}info(r,...c){var o;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,r,c)}warn(r,...c){var o;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,r,c)}error(r,...c){var o;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,r,c)}};n.LogService=u=_([v(0,g.IOptionsService)],u),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,c,o){if(typeof o.value!="function")throw new Error("not supported");const h=o.value;o.value=function(...m){if(y.logLevel!==g.LogLevelEnum.TRACE)return h.apply(this,m);y.trace(`GlyphRenderer#${h.name}(${m.map((S=>JSON.stringify(S))).join(", ")})`);const C=h.apply(this,m);return y.trace(`GlyphRenderer#${h.name} return`,C),C}}},726:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const f="di$target",_="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(v){return v[_]||[]},n.createDecorator=function(v){if(n.serviceRegistry.has(v))return n.serviceRegistry.get(v);const l=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,r,c){r[f]===r?r[_].push({id:u,index:c}):(r[_]=[{id:u,index:c}],r[f]=r)})(l,g,y)};return l.toString=()=>v,n.serviceRegistry.set(v,l),l}},97:(P,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const _=f(726);var v;n.IBufferService=(0,_.createDecorator)("BufferService"),n.ICoreMouseService=(0,_.createDecorator)("CoreMouseService"),n.ICoreService=(0,_.createDecorator)("CoreService"),n.ICharsetService=(0,_.createDecorator)("CharsetService"),n.IInstantiationService=(0,_.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(v||(n.LogLevelEnum=v={})),n.ILogService=(0,_.createDecorator)("LogService"),n.IOptionsService=(0,_.createDecorator)("OptionsService"),n.IOscLinkService=(0,_.createDecorator)("OscLinkService"),n.IUnicodeService=(0,_.createDecorator)("UnicodeService"),n.IDecorationService=(0,_.createDecorator)("DecorationService")}},j={};function J(P){var n=j[P];if(n!==void 0)return n.exports;var f=j[P]={exports:{}};return G[P].call(f.exports,f,f.exports,J),f.exports}var se={};return(()=>{var P=se;Object.defineProperty(P,"__esModule",{value:!0}),P.WebglAddon=void 0;const n=J(345),f=J(859),_=J(399),v=J(666),l=J(776);class g extends f.Disposable{constructor(y){if(_.isSafari&&(0,_.getSafariVersion)()<16){const u={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",u))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const u=y._core;if(!y.element)return void this.register(u.onWillOpen((()=>this.activate(y))));this._terminal=y;const r=u.coreService,c=u.optionsService,o=u,h=o._renderService,m=o._characterJoinerService,C=o._charSizeService,S=o._coreBrowserService,w=o._decorationService,p=o._logService,x=o._themeService;(0,l.setTraceLogger)(p),this._renderer=this.register(new v.WebglRenderer(y,m,C,S,r,w,c,x,this._preserveDrawingBuffer)),this.register((0,n.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,n.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),h.setRenderer(this._renderer),this.register((0,f.toDisposable)((()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(y.cols,y.rows)})))}get textureAtlas(){var y;return(y=this._renderer)==null?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)==null||y.clearTextureAtlas()}}P.WebglAddon=g})(),se})()))})(Uo)),Uo.exports}var Qv=Kv(),Io={exports:{}},ef;function Zv(){return ef||(ef=1,(function(k,Y){(function(G,j){k.exports=j()})(self,(()=>(()=>{var G={6:(P,n)=>{function f(v){try{const l=new URL(v),g=l.password&&l.username?`${l.protocol}//${l.username}:${l.password}@${l.host}`:l.username?`${l.protocol}//${l.username}@${l.host}`:`${l.protocol}//${l.host}`;return v.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(v,l,g,b={}){this._terminal=v,this._regex=l,this._handler=g,this._options=b}provideLinks(v,l){const g=_.computeLink(v,this._regex,this._terminal,this._handler);l(this._addCallbacks(g))}_addCallbacks(v){return v.map((l=>(l.leave=this._options.leave,l.hover=(g,b)=>{if(this._options.hover){const{range:y}=l;this._options.hover(g,b,y)}},l)))}};class _{static computeLink(l,g,b,y){const u=new RegExp(g.source,(g.flags||"")+"g"),[r,c]=_._getWindowedLineStrings(l-1,b),o=r.join("");let h;const m=[];for(;h=u.exec(o);){const C=h[0];if(!f(C))continue;const[S,w]=_._mapStrIdx(b,c,0,h.index),[p,x]=_._mapStrIdx(b,S,w,C.length);if(S===-1||w===-1||p===-1||x===-1)continue;const L={start:{x:w+1,y:S+1},end:{x,y:p+1}};m.push({range:L,text:C,activate:y})}return m}static _getWindowedLineStrings(l,g){let b,y=l,u=l,r=0,c="";const o=[];if(b=g.buffer.active.getLine(l)){const h=b.translateToString(!0);if(b.isWrapped&&h[0]!==" "){for(r=0;(b=g.buffer.active.getLine(--y))&&r<2048&&(c=b.translateToString(!0),r+=c.length,o.push(c),b.isWrapped&&c.indexOf(" ")===-1););o.reverse()}for(o.push(h),r=0;(b=g.buffer.active.getLine(++u))&&b.isWrapped&&r<2048&&(c=b.translateToString(!0),r+=c.length,o.push(c),c.indexOf(" ")===-1););}return[o,y]}static _mapStrIdx(l,g,b,y){const u=l.buffer.active,r=u.getNullCell();let c=b;for(;y;){const o=u.getLine(g);if(!o)return[-1,-1];for(let h=c;h<o.length;++h){o.getCell(h,r);const m=r.getChars();if(r.getWidth()&&(y-=m.length||1,h===o.length-1&&m==="")){const C=u.getLine(g+1);C&&C.isWrapped&&(C.getCell(0,r),r.getWidth()===2&&(y+=1))}if(y<0)return[g,h]}g++,c=0}return[g,c]}}n.LinkComputer=_}},j={};function J(P){var n=j[P];if(n!==void 0)return n.exports;var f=j[P]={exports:{}};return G[P](f,f.exports,J),f.exports}var se={};return(()=>{var P=se;Object.defineProperty(P,"__esModule",{value:!0}),P.WebLinksAddon=void 0;const n=J(6),f=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function _(v,l){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}P.WebLinksAddon=class{constructor(v=_,l={}){this._handler=v,this._options=l}activate(v){this._terminal=v;const l=this._options,g=l.urlRegex||f;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,g,this._handler,l))}dispose(){var v;(v=this._linkProvider)==null||v.dispose()}}})(),se})()))})(Io)),Io.exports}var Jv=Zv();const eg={background:"#09090b",foreground:"#e4e4e7",cursor:"#f97316",cursorAccent:"#09090b",selectionBackground:"#3f3f46",selectionInactiveBackground:"#27272a",black:"#27272a",red:"#f87171",green:"#86efac",yellow:"#fde68a",blue:"#93c5fd",magenta:"#f0abfc",cyan:"#67e8f9",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#fca5a5",brightGreen:"#bbf7d0",brightYellow:"#fef3c7",brightBlue:"#bfdbfe",brightMagenta:"#f5d0fe",brightCyan:"#a5f3fc",brightWhite:"#fafafa"},tg='"JetBrains Mono", ui-monospace, "SF Mono", "Menlo", monospace';function cf({sessionId:k,onExit:Y}){const G=de.useRef(null);return de.useEffect(()=>{var l;if(!G.current)return;const j=new Yv.Terminal({fontFamily:tg,fontSize:13,fontWeight:400,fontWeightBold:600,lineHeight:1.35,letterSpacing:0,cursorBlink:!0,cursorStyle:"block",cursorWidth:1,scrollback:8e3,smoothScrollDuration:80,drawBoldTextInBrightColors:!1,minimumContrastRatio:1,allowProposedApi:!0,theme:eg}),J=new Vv.FitAddon;j.loadAddon(J),j.loadAddon(new Jv.WebLinksAddon),j.open(G.current);let se=null;try{se=new Qv.WebglAddon,se.onContextLoss(()=>{se==null||se.dispose(),se=null}),j.loadAddon(se)}catch{}requestAnimationFrame(()=>{try{J.fit()}catch{}});const P=new WebSocket(zv(`/api/sessions/${encodeURIComponent(k)}/pty`));P.binaryType="arraybuffer";let n=!1;P.onmessage=g=>{if(typeof g.data=="string"){try{const y=JSON.parse(g.data);if(y.type==="hello"){n=!0;const u=J.proposeDimensions();u&&P.send(JSON.stringify({type:"resize",cols:u.cols,rows:u.rows}))}else y.type==="exit"&&(Y==null||Y({exitCode:y.exitCode}))}catch{}return}const b=g.data instanceof ArrayBuffer?new Uint8Array(g.data):g.data;j.write(b)},P.onclose=()=>{j.write(`\r
115
+ \x1B[38;5;245m[connection closed]\x1B[0m\r
116
+ `)},P.onerror=()=>{j.write(`\r
117
+ \x1B[38;5;167m[websocket error]\x1B[0m\r
118
+ `)};const f=j.onData(g=>{P.readyState===WebSocket.OPEN&&P.send(JSON.stringify({type:"input",data:g}))}),_=()=>{try{if(J.fit(),P.readyState===WebSocket.OPEN&&n){const g=J.proposeDimensions();g&&P.send(JSON.stringify({type:"resize",cols:g.cols,rows:g.rows}))}}catch{}},v=new ResizeObserver(_);return v.observe(G.current),typeof document<"u"&&((l=document.fonts)!=null&&l.ready)&&document.fonts.ready.then(()=>{try{J.fit()}catch{}}),()=>{v.disconnect(),f.dispose();try{P.close()}catch{}try{se==null||se.dispose()}catch{}j.dispose()}},[k,Y]),T.jsx("div",{ref:G,className:"h-full w-full"})}const ig={queued:"bg-zinc-500",assigning:"bg-blue-300 animate-pulse",running:"bg-blue-400 animate-pulse",completed:"bg-green-500",pr_open:"bg-amber-400",pr_closed:"bg-rose-500",merged:"bg-orange-500",cleaned:"bg-zinc-600",failed:"bg-red-500"};function sg({status:k}){return T.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${ig[k]}`,"aria-label":k})}const rg={queued:"neutral",assigning:"blue",running:"blue",completed:"green",pr_open:"amber",pr_closed:"red",merged:"orange",cleaned:"neutral",failed:"red"};function ng({taskId:k}){const{navigate:Y}=es(),[G,j]=de.useState(null),[J,se]=de.useState([]),[P,n]=de.useState(null);de.useEffect(()=>{let _=!1;const v=async()=>{try{const[g,b]=await Promise.all([nt.task(k),nt.sessions()]);if(_)return;j(g),se(b)}catch(g){_||n(g)}};v();const l=setInterval(v,4e3);return()=>{_=!0,clearInterval(l)}},[k]);const f=J.find(_=>_.taskId===k&&_.status==="running");return P?T.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 text-red-300",children:["Failed to load: ",P.message]}):G?T.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-6 flex flex-col gap-4 h-[calc(100vh-65px)]",children:[T.jsxs("div",{className:"flex items-center gap-3",children:[T.jsx(Xe,{variant:"ghost",onClick:()=>Y("/"),children:"← Back"}),T.jsx(sg,{status:G.status}),T.jsxs("span",{className:"font-mono text-xs text-zinc-500",children:["#",G.id]}),T.jsx("h1",{className:"text-lg font-semibold text-zinc-100 truncate",children:G.issueTitle}),T.jsx(Ji,{tone:rg[G.status],children:lf[G.status]})]}),T.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-zinc-500",children:[T.jsxs("span",{className:"font-mono",children:[G.kind==="review"?"PR":"issue"," ",G.repoSlug,"#",G.issueNumber]}),T.jsx("span",{children:"·"}),T.jsxs("span",{children:["branch ",T.jsx("code",{className:"text-zinc-300",children:G.branch})]}),T.jsx("span",{children:"·"}),T.jsxs("span",{children:["agent ",T.jsx("code",{className:"text-zinc-300",children:G.agent})]}),T.jsx("span",{children:"·"}),T.jsxs("span",{children:["kind ",T.jsx("code",{className:"text-zinc-300",children:G.kind})]}),G.prUrl&&T.jsxs(T.Fragment,{children:[T.jsx("span",{children:"·"}),T.jsx("a",{className:"text-orange-400 hover:underline",href:G.prUrl,target:"_blank",rel:"noreferrer",children:G.prUrl.replace("https://github.com/","")})]}),G.exitCode!==null&&T.jsxs(T.Fragment,{children:[T.jsx("span",{children:"·"}),T.jsxs("span",{children:["exit ",G.exitCode]})]}),T.jsx("span",{className:"ml-auto"}),f?T.jsxs("div",{className:"flex items-center gap-2",children:[G.status==="running"&&T.jsx(Xe,{variant:"ghost",onClick:async()=>{try{j(await nt.markDone(G.id))}catch(_){alert(_.message)}},children:"Mark done"}),T.jsx(Xe,{variant:"danger",onClick:async()=>{if(confirm("Send SIGTERM to this session?"))try{await nt.killSession(f.id)}catch(_){alert(_.message)}},children:"Kill session"})]}):T.jsxs("div",{className:"flex items-center gap-2",children:[G.status!=="queued"&&G.status!=="running"&&T.jsx(Xe,{onClick:async()=>{try{await nt.retryTask(G.id),j(await nt.task(G.id))}catch(_){alert(_.message)}},children:"Resume"}),(G.status==="completed"||G.status==="failed"||G.status==="merged"||G.status==="pr_open"||G.status==="pr_closed"||G.status==="cleaned")&&T.jsx(Xe,{variant:"ghost",onClick:async()=>{if(confirm("Remove the worktree for this task?"))try{await nt.cleanupTask(G.id),Y("/")}catch(_){alert(_.message)}},children:"Cleanup worktree"})]})]}),T.jsxs("div",{className:"flex-1 min-h-[400px] overflow-hidden rounded-xl border border-zinc-800 bg-zinc-950 shadow-[0_0_0_1px_rgba(255,255,255,0.02)_inset,0_20px_60px_-20px_rgba(0,0,0,0.6)]",children:[T.jsxs("div",{className:"flex items-center gap-1.5 border-b border-zinc-800/80 px-3 py-2",children:[T.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),T.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),T.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),T.jsxs("span",{className:"ml-3 text-[11px] font-mono text-zinc-500 truncate",children:[G.repoSlug," · ",G.branch]})]}),T.jsx("div",{className:"h-[calc(100%-37px)] p-3",children:f?T.jsx(cf,{sessionId:f.id}):T.jsx("div",{className:"h-full flex items-center justify-center text-sm text-zinc-500",children:G.status==="queued"?"Waiting in queue — terminal will attach when the task starts.":"No live session for this task. Output is preserved at ~/.tono/logs/task-"+G.id+".log."})})]})]}):T.jsx("div",{className:"mx-auto max-w-4xl px-6 py-12 text-zinc-500",children:"Loading…"})}function ag({sessionId:k}){const{navigate:Y}=es(),[G,j]=de.useState(null),[J,se]=de.useState(null);return de.useEffect(()=>{let P=!1;const n=async()=>{try{const _=await nt.sessions();if(P)return;j(_.find(v=>v.id===k)??null)}catch(_){P||se(_.message)}};n();const f=setInterval(n,4e3);return()=>{P=!0,clearInterval(f)}},[k]),J?T.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 text-red-300",children:["Failed to load: ",J]}):G?T.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-6 flex flex-col gap-4 h-[calc(100vh-65px)]",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[T.jsx(Xe,{variant:"ghost",onClick:()=>Y("/"),children:"← Back"}),T.jsx(Ji,{tone:G.status==="running"?"blue":"neutral",children:G.status}),T.jsx("h1",{className:"text-base font-medium text-zinc-100",children:"Shell"}),T.jsx("span",{className:"text-xs text-zinc-500 font-mono truncate",children:G.label??"—"}),T.jsx("span",{className:"ml-auto"}),G.status==="running"&&T.jsx(Xe,{variant:"danger",onClick:async()=>{if(confirm("Close this shell?"))try{await nt.killSession(G.id)}catch(P){alert(P.message)}},children:"Close shell"})]}),T.jsxs("div",{className:"flex-1 min-h-[400px] overflow-hidden rounded-xl border border-zinc-800 bg-zinc-950 shadow-[0_0_0_1px_rgba(255,255,255,0.02)_inset,0_20px_60px_-20px_rgba(0,0,0,0.6)]",children:[T.jsxs("div",{className:"flex items-center gap-1.5 border-b border-zinc-800/80 px-3 py-2",children:[T.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),T.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),T.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),T.jsx("span",{className:"ml-3 text-[11px] font-mono text-zinc-500 truncate",children:G.label??`shell · pid ${G.pid}`})]}),T.jsx("div",{className:"h-[calc(100%-37px)] p-3",children:T.jsx(cf,{sessionId:G.id})})]})]}):T.jsx("div",{className:"mx-auto max-w-4xl px-6 py-12 text-zinc-500",children:"Loading shell…"})}function lg(){const[k,Y]=de.useState(null),[G,j]=de.useState(""),[J,se]=de.useState(""),[P,n]=de.useState(!0),[f,_]=de.useState(null),v=de.useCallback(async()=>{n(!0),_(null);try{const b=await nt.rawConfig();se(b.path),j(b.content),Y(JSON.parse(b.content))}catch(b){_(b.message)}finally{n(!1)}},[]);de.useEffect(()=>{v()},[v]);const l=de.useCallback(async b=>{if(!k)throw new Error("config not loaded");const y=b(k),u=JSON.stringify(y,null,2);await nt.saveRawConfig(u),Y(y),j(u)},[k]),g=de.useCallback(async b=>{await nt.saveRawConfig(b),j(b),Y(JSON.parse(b))},[]);return{cfg:k,rawText:G,path:J,loading:P,loadError:f,save:l,saveRaw:g,reload:v}}function oi({title:k,action:Y,children:G}){return T.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 backdrop-blur-sm",children:[(k||Y)&&T.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-4 py-3",children:[T.jsx("div",{className:"text-sm font-medium text-zinc-200",children:k}),Y]}),T.jsx("div",{className:"p-4",children:G})]})}function Pt({className:k="",...Y}){return T.jsx("input",{className:`w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-500 outline-none focus:border-zinc-500 disabled:opacity-50 ${k}`,...Y})}function Ct({label:k,hint:Y,children:G}){return T.jsxs("label",{className:"block",children:[T.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-400",children:k}),Y&&T.jsx("span",{className:"text-[11px] text-zinc-500",children:Y})]}),G]})}function og({cfg:k,save:Y}){const[G,j]=de.useState(k.server.host),[J,se]=de.useState(String(k.server.port)),[P,n]=de.useState(!1),[f,_]=de.useState(null);de.useEffect(()=>{j(k.server.host),se(String(k.server.port))},[k.server.host,k.server.port]);const v=G!==k.server.host||J!==String(k.server.port),l=async()=>{_(null);const g=Number(J);if(!Number.isInteger(g)||g<1||g>65535){_("port must be 1–65535");return}n(!0);try{await Y(b=>({...b,server:{host:G,port:g}}))}catch(b){_(b.message)}finally{n(!1)}};return T.jsxs(oi,{title:"Server",action:T.jsx(Xe,{disabled:!v||P,onClick:l,children:P?"Saving…":"Save"}),children:[T.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[T.jsx(Ct,{label:"Host",hint:"0.0.0.0 = LAN, 127.0.0.1 = local only",children:T.jsx(Pt,{value:G,onChange:g=>j(g.target.value)})}),T.jsx(Ct,{label:"Port",children:T.jsx(Pt,{type:"number",min:1,max:65535,value:J,onChange:g=>se(g.target.value)})})]}),f&&T.jsx("div",{className:"mt-3 rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300 whitespace-pre-wrap",children:f}),T.jsx("p",{className:"mt-3 text-[11px] text-zinc-500",children:"Restart the gateway after changing host or port."})]})}function cg({cfg:k,save:Y}){const[G,j]=de.useState(String(k.github.pollIntervalSeconds)),[J,se]=de.useState(!1),[P,n]=de.useState(null);de.useEffect(()=>{j(String(k.github.pollIntervalSeconds))},[k.github.pollIntervalSeconds]);const f=Number(G)!==k.github.pollIntervalSeconds,_=async()=>{n(null);const v=Number(G);if(!Number.isInteger(v)||v<10||v>3600){n("poll interval must be 10–3600 seconds");return}se(!0);try{await Y(l=>({...l,github:{...l.github,pollIntervalSeconds:v}}))}catch(l){n(l.message)}finally{se(!1)}};return T.jsxs(oi,{title:"GitHub",action:T.jsx(Xe,{disabled:!f||J,onClick:_,children:J?"Saving…":"Save"}),children:[T.jsx(Ct,{label:"Poll interval (seconds)",hint:"how often the poller checks for newly-labeled issues and PRs",children:T.jsx(Pt,{type:"number",min:10,max:3600,value:G,onChange:v=>j(v.target.value)})}),T.jsxs("p",{className:"mt-3 text-[11px] text-zinc-500",children:["Trigger labels are convention-based. Each agent listens for ",T.jsx("code",{children:"tono-<name>"})," on issues and"," ",T.jsx("code",{children:"tono-<name>-review"})," on PRs."]}),P&&T.jsx("div",{className:"mt-3 rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:P})]})}function hg({cfg:k,save:Y}){const[G,j]=de.useState(k.workspaces.root),[J,se]=de.useState(!1),[P,n]=de.useState(null);de.useEffect(()=>j(k.workspaces.root),[k.workspaces.root]);const f=G!==k.workspaces.root,_=async()=>{if(n(null),!G.trim()){n("workspace root must not be empty");return}se(!0);try{await Y(v=>({...v,workspaces:{root:G.trim()}}))}catch(v){n(v.message)}finally{se(!1)}};return T.jsxs(oi,{title:"Workspaces",action:T.jsx(Xe,{disabled:!f||J,onClick:_,children:J?"Saving…":"Save"}),children:[T.jsx(Ct,{label:"Root path",hint:"bare clones land at <root>/.bare/, worktrees at <root>/<owner>__<repo>__issue-N/",children:T.jsx(Pt,{value:G,onChange:v=>j(v.target.value),placeholder:"~/.tono/workspaces"})}),P&&T.jsx("div",{className:"mt-3 rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:P})]})}const ug=/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;function dg({cfg:k,agents:Y,save:G}){return T.jsxs(oi,{title:T.jsxs("span",{className:"flex items-center gap-2",children:["Repos",T.jsx("span",{className:"text-xs text-zinc-500",children:k.repos.length})]}),children:[T.jsxs("div",{className:"space-y-2",children:[k.repos.map((j,J)=>T.jsx(_g,{repo:j,agents:Y,onSave:async se=>{await G(P=>({...P,repos:P.repos.map((n,f)=>f===J?se:n)}))},onRemove:async()=>{confirm(`Remove ${j.slug}?`)&&await G(se=>({...se,repos:se.repos.filter((P,n)=>n!==J)}))}},`${j.slug}-${J}`)),k.repos.length===0&&T.jsx("div",{className:"rounded-md border border-dashed border-zinc-800 px-4 py-6 text-center text-sm text-zinc-500",children:"No repos yet. Add one below."}),T.jsx(gg,{agents:Y,existing:k.repos.map(j=>j.slug),onAdd:async j=>{await G(J=>({...J,repos:[...J.repos,j]}))}})]}),T.jsxs("p",{className:"mt-3 text-[11px] text-zinc-500",children:["Each enrolled agent listens for ",T.jsx("code",{children:"tono-<name>"})," on issues and"," ",T.jsx("code",{children:"tono-<name>-review"})," on pull requests."]})]})}function tf(k){return k==="claude-code"?"claude":k}function sf(k,Y){return k&&k.length>0?k:Y}function fg(k,Y){return k.defaultAgent&&Y.includes(k.defaultAgent)?k.defaultAgent:Y.length===1?Y[0]:null}function _g({repo:k,agents:Y,onSave:G,onRemove:j}){const[J,se]=de.useState(!1),[P,n]=de.useState(k.path??""),[f,_]=de.useState(k.baseBranch),[v,l]=de.useState(new Set(sf(k.agents,Y))),[g,b]=de.useState(k.defaultAgent??""),[y,u]=de.useState(!1),[r,c]=de.useState(null);if(!J){const m=sf(k.agents,Y),C=fg(k,m);return T.jsxs("div",{className:"rounded-md border border-zinc-800 bg-zinc-900/40 px-3 py-2 min-w-0",children:[T.jsxs("div",{className:"flex items-start justify-between gap-2",children:[T.jsx("code",{className:"text-zinc-100 text-sm break-all",children:k.slug}),T.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[T.jsx(Xe,{variant:"ghost",onClick:()=>se(!0),children:"Edit"}),T.jsx(Xe,{variant:"danger",onClick:j,children:"Remove"})]})]}),T.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-zinc-400",children:[T.jsxs("span",{children:["base ",T.jsx("span",{className:"text-zinc-200",children:k.baseBranch})]}),T.jsx("span",{className:"text-zinc-600",children:"·"}),T.jsxs("span",{children:["agents ",T.jsx("span",{className:"text-zinc-200",children:m.join(", ")||"(none)"})]}),k.agents===void 0&&T.jsx("span",{className:"text-[10px] text-zinc-500 uppercase",children:"all"}),T.jsx("span",{className:"text-zinc-600",children:"·"}),T.jsxs("span",{children:["default"," ",T.jsx("span",{className:"text-zinc-200",children:C??"(none — bare labels ignored)"}),C&&!k.defaultAgent&&T.jsx("span",{className:"ml-1 text-[10px] text-zinc-500 uppercase",children:"only enrolled"})]})]}),T.jsx("div",{className:"mt-1 text-xs text-zinc-500 font-mono break-all",children:k.path??T.jsx("span",{className:"italic",children:"tono will bare-clone via gh"})}),m.length>0&&T.jsx("div",{className:"mt-1 flex flex-wrap gap-1 text-[10px] text-zinc-500",children:m.map(S=>T.jsxs("span",{children:[T.jsxs("code",{className:"text-zinc-300",children:["tono-",tf(S)]})," / ",T.jsxs("code",{className:"text-zinc-300",children:["tono-",tf(S),"-review"]})]},S))})]})}const o=async()=>{if(c(null),!f.trim()){c("base branch is required");return}if(v.size===0){c("at least one agent must be enrolled");return}u(!0);try{const m=Y.filter(w=>v.has(w)),C=m.length===Y.length,S=m.length>1&&g&&v.has(g);await G({slug:k.slug,baseBranch:f.trim(),...P.trim()?{path:P.trim()}:{},...C?{}:{agents:m},...S?{defaultAgent:g}:{}}),se(!1)}catch(m){c(m.message)}finally{u(!1)}},h=Y.filter(m=>v.has(m));return T.jsxs("div",{className:"rounded-md border border-zinc-700 bg-zinc-900/60 p-3 space-y-3",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("code",{className:"text-sm text-zinc-100",children:k.slug}),T.jsx("span",{className:"text-[11px] text-zinc-500",children:"slug isn't editable; remove and re-add to rename"})]}),T.jsx(Ct,{label:"Path to local clone",hint:"optional; blank = bare-clone via gh",children:T.jsx(Pt,{value:P,onChange:m=>n(m.target.value),placeholder:"/Users/me/code/repo (or leave blank)"})}),T.jsx(Ct,{label:"Base branch",children:T.jsx(Pt,{value:f,onChange:m=>_(m.target.value)})}),T.jsx(hf,{agents:Y,enrolled:v,onToggle:m=>{const C=new Set(v);C.has(m)?C.delete(m):C.add(m),l(C)}}),h.length>1&&T.jsx(vg,{enrolled:h,value:g,onChange:b}),r&&T.jsx("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:r}),T.jsxs("div",{className:"flex justify-end gap-2",children:[T.jsx(Xe,{variant:"ghost",disabled:y,onClick:()=>se(!1),children:"Cancel"}),T.jsx(Xe,{disabled:y,onClick:o,children:y?"Saving…":"Save"})]})]})}function vg({enrolled:k,value:Y,onChange:G}){return T.jsx(Ct,{label:"Default agent",hint:"handles bare `tono` and `tono-review` labels",children:T.jsxs("select",{value:Y,onChange:j=>G(j.target.value),className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm",children:[T.jsx("option",{value:"",children:"(no default — bare labels ignored)"}),k.map(j=>T.jsx("option",{value:j,children:j},j))]})})}function hf({agents:k,enrolled:Y,onToggle:G}){return T.jsxs("div",{children:[T.jsx("div",{className:"text-xs text-zinc-400 mb-1",children:"Enrolled agents"}),T.jsx("div",{className:"flex flex-wrap gap-3",children:k.length===0?T.jsx("span",{className:"text-xs text-zinc-500 italic",children:"no agents declared in config"}):k.map(j=>T.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-zinc-200",children:[T.jsx("input",{type:"checkbox",checked:Y.has(j),onChange:()=>G(j),className:"h-4 w-4 accent-orange-500"}),T.jsx("span",{children:j})]},j))})]})}function gg({agents:k,existing:Y,onAdd:G}){const[j,J]=de.useState(""),[se,P]=de.useState(""),[n,f]=de.useState("main"),[_,v]=de.useState(new Set(k)),[l,g]=de.useState(!1),[b,y]=de.useState(null),u=async()=>{y(null);const r=j.trim();if(!ug.test(r)){y("slug must be owner/repo");return}if(Y.includes(r)){y("repo is already configured");return}if(_.size===0){y("at least one agent must be enrolled");return}g(!0);try{const c=k.filter(h=>_.has(h)),o=c.length===k.length;await G({slug:r,baseBranch:n.trim()||"main",...se.trim()?{path:se.trim()}:{},...o?{}:{agents:c}}),J(""),P(""),f("main"),v(new Set(k))}catch(c){y(c.message)}finally{g(!1)}};return T.jsxs("div",{className:"rounded-md border border-dashed border-zinc-700 bg-zinc-900/30 p-3 space-y-3",children:[T.jsx("div",{className:"text-xs uppercase tracking-wide text-zinc-400",children:"Add a repo"}),T.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[T.jsx(Ct,{label:"Slug",hint:"owner/repo on GitHub",children:T.jsx(Pt,{value:j,onChange:r=>J(r.target.value),placeholder:"loopedautomation/mono"})}),T.jsx(Ct,{label:"Path to local clone",hint:"optional; blank = tono bare-clones",children:T.jsx(Pt,{value:se,onChange:r=>P(r.target.value),placeholder:"(blank = bare-clone via gh)"})})]}),T.jsx(Ct,{label:"Base branch",children:T.jsx(Pt,{value:n,onChange:r=>f(r.target.value),placeholder:"main"})}),T.jsx(hf,{agents:k,enrolled:_,onToggle:r=>{const c=new Set(_);c.has(r)?c.delete(r):c.add(r),v(c)}}),b&&T.jsx("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:b}),T.jsx("div",{className:"flex justify-end",children:T.jsx(Xe,{disabled:l||!j.trim(),onClick:u,children:l?"Adding…":"+ Add repo"})})]})}function rf({className:k="",...Y}){return T.jsx("textarea",{className:`w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm font-mono text-zinc-100 placeholder:text-zinc-500 outline-none focus:border-zinc-500 disabled:opacity-50 resize-y ${k}`,...Y})}const nf={command:"",args:[],concurrency:{implement:1,review:2},promptTemplates:{implement:"",review:""}};function mg({name:k,cfg:Y,save:G}){var p,x,L,B;const j=Y.agents[k]??nf,[J,se]=de.useState(j.command),[P,n]=de.useState(j.args.join(" ")),[f,_]=de.useState(String(j.concurrency.implement)),[v,l]=de.useState(String(j.concurrency.review)),[g,b]=de.useState(((p=j.promptTemplates)==null?void 0:p.implement)??""),[y,u]=de.useState(((x=j.promptTemplates)==null?void 0:x.review)??""),[r,c]=de.useState(!1),[o,h]=de.useState(null);de.useEffect(()=>{var M,U;const D=Y.agents[k]??nf;se(D.command),n(D.args.join(" ")),_(String(D.concurrency.implement)),l(String(D.concurrency.review)),b(((M=D.promptTemplates)==null?void 0:M.implement)??""),u(((U=D.promptTemplates)==null?void 0:U.review)??"")},[Y.agents,k]);const m=P.length===0?[]:P.split(/\s+/).filter(Boolean),C=J!==j.command||m.join(" ")!==j.args.join(" ")||Number(f)!==j.concurrency.implement||Number(v)!==j.concurrency.review||g!==(((L=j.promptTemplates)==null?void 0:L.implement)??"")||y!==(((B=j.promptTemplates)==null?void 0:B.review)??""),S=async()=>{if(h(null),!J.trim()){h("command is required");return}if(!g.trim()||!y.trim()){h("both prompt templates are required");return}const D=Number(f),M=Number(v);if(!Number.isInteger(D)||D<0||D>32||!Number.isInteger(M)||M<0||M>32){h("concurrency must be 0–32");return}c(!0);try{await G(U=>({...U,agents:{...U.agents,[k]:{command:J.trim(),args:m,concurrency:{implement:D,review:M},promptTemplates:{implement:g,review:y}}}}))}catch(U){h(U.message)}finally{c(!1)}},w=k==="claude-code"?"claude":k;return T.jsxs(oi,{title:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsxs("span",{children:["Agent ",T.jsx("code",{className:"text-zinc-400 text-xs",children:k})]}),T.jsxs("span",{className:"text-[10px] text-zinc-500",children:["implement: ",T.jsxs("code",{className:"text-zinc-300",children:["tono-",w]})," · review: ",T.jsxs("code",{className:"text-zinc-300 ml-1",children:["tono-",w,"-review"]})]})]}),action:T.jsx(Xe,{disabled:!C||r,onClick:S,children:r?"Saving…":"Save"}),children:[T.jsxs("div",{className:"space-y-3",children:[T.jsx(Ct,{label:"Command",hint:"must be on $PATH",children:T.jsx(Pt,{value:J,onChange:D=>se(D.target.value),placeholder:"claude"})}),T.jsx(Ct,{label:"Args",hint:"space-separated; use {prompt} placeholder if the CLI takes prompt as a flag",children:T.jsx(Pt,{value:P,onChange:D=>n(D.target.value),placeholder:"--dangerously-skip-permissions"})}),T.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[T.jsx(Ct,{label:"Concurrency (implement)",hint:"max simultaneous issue tasks",children:T.jsx(Pt,{type:"number",min:0,max:32,value:f,onChange:D=>_(D.target.value)})}),T.jsx(Ct,{label:"Concurrency (review)",hint:"max simultaneous PR reviews",children:T.jsx(Pt,{type:"number",min:0,max:32,value:v,onChange:D=>l(D.target.value)})})]}),T.jsx(Ct,{label:"Implement prompt template",hint:"placeholders: {issueNumber} {issueTitle} {issueBody} {repoSlug} {baseBranch} {branch}",children:T.jsx(rf,{value:g,onChange:D=>b(D.target.value),rows:8,placeholder:"You are working on..."})}),T.jsx(Ct,{label:"Review prompt template",hint:"placeholders include {prUrl} for the PR being reviewed",children:T.jsx(rf,{value:y,onChange:D=>u(D.target.value),rows:8,placeholder:"You are reviewing PR #{issueNumber}..."})})]}),o&&T.jsx("div",{className:"mt-3 rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:o})]})}const Po='You are working on GitHub issue #{issueNumber} in {repoSlug}.\n\nTitle: {issueTitle}\n\n{issueBody}\n\nImplement the changes needed to resolve this issue. The current branch is {branch}, based on {baseBranch}. When implementation is complete, commit with a clear message, push the branch with `git push -u origin {branch}`, and open a pull request with `gh pr create --base {baseBranch} --fill`. If the issue is unclear or unsafe to proceed, leave a comment on the issue explaining why with `gh issue comment {issueNumber} --body "<reason>"` and stop.',Fo=`You are reviewing GitHub PR #{issueNumber} in {repoSlug}: "{issueTitle}".
119
+ PR URL: {prUrl}
120
+ The PR's head branch ({branch}) is checked out at the current working directory.
121
+
122
+ Description:
123
+ {issueBody}
124
+
125
+ Read the diff (\`gh pr diff {issueNumber}\`) and inspect the changed files. Form a thorough review: correctness, edge cases, security, performance, readability.
126
+
127
+ When done, post your review with \`gh pr review {issueNumber} --comment --body "<review body>"\` (use --request-changes if blocking, or --approve if good to merge). For inline file/line comments use \`gh api repos/{repoSlug}/pulls/{issueNumber}/comments\`.
128
+
129
+ Do not push commits. Do not create new PRs.`,af=[{type:"claude-code",label:"Claude Code",defaults:{command:"claude",args:["--dangerously-skip-permissions"],concurrency:{implement:2,review:4},promptTemplates:{implement:Po,review:Fo}}},{type:"codex",label:"Codex CLI",defaults:{command:"codex",args:[],concurrency:{implement:1,review:2},promptTemplates:{implement:Po,review:Fo}}},{type:"opencode",label:"OpenCode",defaults:{command:"opencode",args:["run","{prompt}"],concurrency:{implement:1,review:2},promptTemplates:{implement:Po,review:Fo}}}];function pg({cfg:k,save:Y}){var v;const G=de.useMemo(()=>af.filter(l=>!k.agents[l.type]),[k.agents]),[j,J]=de.useState(((v=G[0])==null?void 0:v.type)??""),[se,P]=de.useState(!1),[n,f]=de.useState(null);if(G.length===0)return null;j&&!G.find(l=>l.type===j)&&J(G[0].type);const _=async()=>{f(null);const l=af.find(g=>g.type===j);if(l){P(!0);try{await Y(g=>({...g,agents:{...g.agents,[l.type]:l.defaults}}))}catch(g){f(g.message)}finally{P(!1)}}};return T.jsxs(oi,{title:"Add agent",children:[T.jsxs("div",{className:"flex items-end gap-3",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Agent type"}),T.jsx("select",{value:j,onChange:l=>J(l.target.value),className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm",children:G.map(l=>T.jsxs("option",{value:l.type,children:[l.label," (",l.type,")"]},l.type))})]}),T.jsx(Xe,{disabled:se||!j,onClick:_,children:se?"Adding…":"+ Add"})]}),T.jsxs("p",{className:"mt-2 text-[11px] text-zinc-500",children:["Adds the agent with default ",T.jsx("code",{className:"text-zinc-300",children:"command"}),", ",T.jsx("code",{className:"text-zinc-300",children:"args"}),", concurrency, and prompt templates. Edit the new section below to tune. The CLI must exist on ",T.jsx("code",{className:"text-zinc-300",children:"$PATH"})," for tono to spawn it."]}),n&&T.jsx("div",{className:"mt-3 rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:n})]})}function Sg({initial:k,path:Y,onSave:G}){const[j,J]=de.useState(k),[se,P]=de.useState(!1),[n,f]=de.useState(null),[_,v]=de.useState(null),l=de.useRef(null);de.useEffect(()=>{J(k)},[k]);const g=j!==k,b=async()=>{P(!0),f(null);try{await G(j),v(new Date)}catch(u){f(u.message)}finally{P(!1)}},y=u=>{if(u.key==="Tab"){u.preventDefault();const r=l.current;if(!r)return;const{selectionStart:c,selectionEnd:o}=r,h=j.slice(0,c)+" "+j.slice(o);J(h),requestAnimationFrame(()=>{r.selectionStart=r.selectionEnd=c+2})}(u.metaKey||u.ctrlKey)&&u.key==="s"&&(u.preventDefault(),g&&!se&&b())};return T.jsxs(oi,{title:T.jsxs(T.Fragment,{children:["Raw JSON ",T.jsx("span",{className:"text-xs text-zinc-500 font-mono",children:Y})]}),action:T.jsxs("div",{className:"flex items-center gap-2",children:[_&&!g&&!n&&T.jsxs("span",{className:"text-xs text-green-400",children:["saved ",_.toLocaleTimeString()]}),g&&T.jsx("span",{className:"text-xs text-amber-400",children:"unsaved"}),T.jsx(Xe,{variant:"ghost",disabled:!g||se,onClick:()=>J(k),children:"Revert"}),T.jsx(Xe,{disabled:!g||se,onClick:b,children:se?"Saving…":"Save"})]}),children:[n&&T.jsx("div",{className:"mb-3 rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-sm text-red-300 whitespace-pre-wrap font-mono",children:n}),T.jsx("textarea",{ref:l,value:j,onChange:u=>J(u.target.value),onKeyDown:y,spellCheck:!1,className:"w-full min-h-[60vh] rounded-md border border-zinc-800 bg-zinc-950 p-3 font-mono text-sm text-zinc-100 outline-none focus:border-zinc-600 resize-y"}),T.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Validates against the schema on save. ⌘S to save."})]})}function bg(){const{cfg:k,rawText:Y,path:G,loading:j,loadError:J,save:se,saveRaw:P}=lg(),[n,f]=de.useState(!1);if(j)return T.jsx("div",{className:"mx-auto max-w-4xl px-6 py-12 text-zinc-500",children:"Loading…"});if(J||!k)return T.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 text-red-300",children:["Failed to load config: ",J??"unknown error"]});const _=Object.keys(k.agents);return T.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-6 space-y-4",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("h1",{className:"text-base font-semibold text-zinc-200",children:"Config"}),T.jsxs(Xe,{variant:"ghost",onClick:()=>f(v=>!v),children:[n?"Hide":"Show"," raw JSON"]})]}),T.jsx(og,{cfg:k,save:se}),T.jsx(cg,{cfg:k,save:se}),T.jsx(hg,{cfg:k,save:se}),T.jsx(dg,{cfg:k,agents:_,save:se}),_.map(v=>T.jsx(mg,{name:v,cfg:k,save:se},v)),T.jsx(pg,{cfg:k,save:se}),n&&T.jsx(Sg,{initial:Y,path:G,onSave:P}),T.jsxs("p",{className:"text-[11px] text-zinc-500",children:["Edits write directly to ",T.jsx("code",{className:"text-zinc-300",children:G}),". Schema-validated on save. Trigger labels are convention-based: ",T.jsx("code",{className:"text-zinc-300",children:"tono-<agent>"})," for issues,"," ",T.jsx("code",{className:"text-zinc-300",children:"tono-<agent>-review"})," for PRs. Server host / port require ",T.jsx("code",{className:"text-zinc-300",children:"tono gateway restart"}),"."]})]})}function yg(k){if(!k)return"—";const Y=Date.now()-Date.parse(k);return Y<5e3?"just now":Y<6e4?`${Math.round(Y/1e3)}s ago`:Y<36e5?`${Math.round(Y/6e4)}m ago`:Y<864e5?`${Math.round(Y/36e5)}h ago`:`${Math.round(Y/864e5)}d ago`}function Cg(k){const Y=new Map;for(const G of k)if(!(!G.connected||!G.capacity))for(const[j,J]of Object.entries(G.capacity.byAgent)){if(!J)continue;let se=Y.get(j);se||(se={agent:j,freeImplement:0,freeReview:0,workersWithAgent:0},Y.set(j,se)),se.freeImplement+=J.implement,se.freeReview+=J.review,se.workersWithAgent+=1}return[...Y.values()].sort((G,j)=>G.agent.localeCompare(j.agent))}function xg({worker:k}){const{navigate:Y}=es(),G=k.hostname==="(local)",j=yg(k.lastSeenAt),J=k.capabilities?Object.entries(k.capabilities.agents).sort((n,f)=>n[0].localeCompare(f[0])):[],se=n=>{var f;return((f=k.capacity)==null?void 0:f.byAgent[n])??null},P=k.runningSessions.length;return T.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 backdrop-blur-sm",children:[T.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-4 py-3",children:[T.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${k.connected?"bg-green-400":"bg-zinc-600"}`,"aria-hidden":"true"}),T.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:k.hostname}),G&&T.jsx(Ji,{tone:"neutral",children:"embedded"}),k.tonoVersion&&T.jsxs("span",{className:"text-[11px] text-zinc-500 font-mono",children:["v",k.tonoVersion]})]}),T.jsx(Ji,{tone:k.connected?"green":"neutral",children:k.connected?"connected":"offline"})]}),T.jsxs("div",{className:"p-4 space-y-3",children:[T.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[T.jsx("div",{className:"text-zinc-500",children:"last heartbeat"}),T.jsx("div",{className:"text-zinc-300 text-right font-mono",children:j}),T.jsx("div",{className:"text-zinc-500",children:"platform"}),T.jsxs("div",{className:"text-zinc-300 text-right font-mono",children:[k.os??"?","/",k.arch??"?"]}),T.jsx("div",{className:"text-zinc-500",children:"worker id"}),T.jsx("div",{className:"text-zinc-300 text-right font-mono truncate",children:k.id.slice(0,8)})]}),T.jsxs("div",{className:"border-t border-zinc-800 pt-3 space-y-2",children:[T.jsx("div",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"agents · capacity (free)"}),J.length===0?T.jsx("div",{className:"text-xs text-zinc-500",children:"no agents advertised"}):T.jsx("div",{className:"space-y-1",children:J.map(([n,f])=>{const _=se(n);return T.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[T.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T.jsx("span",{className:"text-zinc-200 font-mono truncate",children:n}),f.version&&T.jsx("span",{className:"text-zinc-500 truncate",children:f.version})]}),T.jsx("div",{className:"font-mono text-zinc-400 whitespace-nowrap",children:_?T.jsxs(T.Fragment,{children:["impl ",T.jsx("span",{className:"text-zinc-200",children:_.implement}),T.jsx("span",{className:"mx-1 text-zinc-600",children:"·"}),"rev ",T.jsx("span",{className:"text-zinc-200",children:_.review})]}):T.jsx("span",{className:"text-zinc-600",children:"—"})})]},n)})})]}),k.connected&&T.jsxs("div",{className:"border-t border-zinc-800 pt-3",children:[T.jsxs("div",{className:"text-[11px] uppercase tracking-wide text-zinc-500 mb-2",children:["running (",P,")"]}),P===0?T.jsx("div",{className:"text-xs text-zinc-500",children:"idle"}):T.jsx("div",{className:"flex flex-wrap gap-1",children:k.runningSessions.map(n=>T.jsxs("button",{onClick:()=>Y(`/tasks/${n.taskId}`),className:"text-xs font-mono px-2 py-0.5 rounded border border-zinc-700 bg-zinc-800/40 text-zinc-300 hover:border-zinc-600 hover:bg-zinc-800 transition",children:["#",n.taskId]},n.sessionId))})]})]})]})}function wg({workers:k}){const Y=de.useMemo(()=>Cg(k),[k]),G=k.filter(J=>J.connected).length,j=k.length;return G===0?T.jsx(oi,{title:"Capacity",children:T.jsxs("div",{className:"text-sm text-zinc-400",children:["No workers connected."," ",j>0?`${j} worker(s) registered but currently offline.`:"Run `tono start` (single-machine) or `tono worker start --gateway <host>:<port>` on another machine."]})}):T.jsxs(oi,{title:"Total free capacity",children:[T.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Y.map(J=>T.jsxs("div",{className:"flex items-center justify-between rounded border border-zinc-800 bg-zinc-900/30 px-3 py-2",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsx("div",{className:"text-sm font-mono text-zinc-200 truncate",children:J.agent}),T.jsxs("div",{className:"text-[11px] text-zinc-500",children:["across ",J.workersWithAgent," worker",J.workersWithAgent===1?"":"s"]})]}),T.jsxs("div",{className:"text-right whitespace-nowrap",children:[T.jsxs("div",{className:"text-sm",children:[T.jsx("span",{className:"text-zinc-400",children:"implement "}),T.jsx("span",{className:"font-mono text-zinc-100",children:J.freeImplement})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("span",{className:"text-zinc-400",children:"review "}),T.jsx("span",{className:"font-mono text-zinc-100",children:J.freeReview})]})]})]},J.agent))}),T.jsxs("div",{className:"mt-3 text-xs text-zinc-500",children:[G," of ",j," worker",j===1?"":"s"," connected. Capacity is summed across all workers; the scheduler dispatches each task to a worker that has free slots for the (agent, kind)."]})]})}function Eg(){const{data:k,error:Y}=bs(nt.workers,3e3),G=k??[],j=de.useMemo(()=>[...G].sort((J,se)=>J.connected!==se.connected?J.connected?-1:1:J.hostname==="(local)"&&se.hostname!=="(local)"?-1:se.hostname==="(local)"&&J.hostname!=="(local)"?1:J.hostname.localeCompare(se.hostname)),[G]);return T.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-6 space-y-6",children:[T.jsx("div",{className:"flex items-center justify-between gap-4",children:T.jsxs("div",{children:[T.jsx("h1",{className:"text-xl font-semibold text-zinc-100",children:"Workers"}),T.jsx("p",{className:"text-sm text-zinc-500",children:"Machines connected to this gateway and the agent capacity they advertise."})]})}),Y&&T.jsxs("div",{className:"rounded-md border border-red-900/60 bg-red-950/40 px-3 py-2 text-sm text-red-300",children:["failed to load workers: ",Y.message]}),T.jsx(wg,{workers:j}),j.length===0?T.jsx(oi,{children:T.jsxs("div",{className:"text-sm text-zinc-400",children:["No workers have connected yet. The embedded worker should appear within a few seconds of starting the gateway. To add capacity from another machine on your tailnet, run:",T.jsx("pre",{className:"mt-3 rounded bg-zinc-900 p-3 text-xs text-zinc-300 overflow-x-auto",children:"tono worker start --gateway <gateway-host>:7040"})]})}):T.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:j.map(J=>T.jsx(xg,{worker:J},J.id))})]})}function Lg(){const{path:k}=es();let Y;const G=k.match(/^\/tasks\/(\d+)\/?$/),j=k.match(/^\/shells\/([^/]+)\/?$/);return G?Y=T.jsx(ng,{taskId:Number(G[1])}):j?Y=T.jsx(ag,{sessionId:decodeURIComponent(j[1])}):k.startsWith("/workers")?Y=T.jsx(Eg,{}):k.startsWith("/config")||k.startsWith("/settings")?Y=T.jsx(bg,{}):Y=T.jsx($v,{}),T.jsxs("div",{className:"min-h-screen flex flex-col",children:[T.jsx(Hv,{}),T.jsx("main",{className:"flex-1",children:Y})]})}const uf=document.getElementById("root");if(!uf)throw new Error("No #root element");kv.createRoot(uf).render(T.jsx(de.StrictMode,{children:T.jsx(Lg,{})}));