tono 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +21 -674
  2. package/README.md +300 -0
  3. package/dist/cli/commands/config.js +86 -0
  4. package/dist/cli/commands/config.js.map +1 -0
  5. package/dist/cli/commands/configure.js +260 -0
  6. package/dist/cli/commands/configure.js.map +1 -0
  7. package/dist/cli/commands/gateway.js +194 -0
  8. package/dist/cli/commands/gateway.js.map +1 -0
  9. package/dist/cli/commands/init.js +89 -0
  10. package/dist/cli/commands/init.js.map +1 -0
  11. package/dist/cli/commands/open.js +23 -0
  12. package/dist/cli/commands/open.js.map +1 -0
  13. package/dist/cli/commands/start.js +116 -0
  14. package/dist/cli/commands/start.js.map +1 -0
  15. package/dist/cli/index.js +78 -0
  16. package/dist/cli/index.js.map +1 -0
  17. package/dist/cli/launchd.js +56 -0
  18. package/dist/cli/launchd.js.map +1 -0
  19. package/dist/cli/prompt.js +46 -0
  20. package/dist/cli/prompt.js.map +1 -0
  21. package/dist/server/agents/claude-code.js +80 -0
  22. package/dist/server/agents/claude-code.js.map +1 -0
  23. package/dist/server/agents/codex.js +52 -0
  24. package/dist/server/agents/codex.js.map +1 -0
  25. package/dist/server/agents/opencode.js +50 -0
  26. package/dist/server/agents/opencode.js.map +1 -0
  27. package/dist/server/agents/registry.js +16 -0
  28. package/dist/server/agents/registry.js.map +1 -0
  29. package/dist/server/agents/types.js +40 -0
  30. package/dist/server/agents/types.js.map +1 -0
  31. package/dist/server/app.js +324 -0
  32. package/dist/server/app.js.map +1 -0
  33. package/dist/server/config/load.js +91 -0
  34. package/dist/server/config/load.js.map +1 -0
  35. package/dist/server/config/manager.js +38 -0
  36. package/dist/server/config/manager.js.map +1 -0
  37. package/dist/server/config/schema.json +151 -0
  38. package/dist/server/db/client.js +136 -0
  39. package/dist/server/db/client.js.map +1 -0
  40. package/dist/server/db/queries.js +158 -0
  41. package/dist/server/db/queries.js.map +1 -0
  42. package/dist/server/db/schema.sql +61 -0
  43. package/dist/server/events.js +5 -0
  44. package/dist/server/events.js.map +1 -0
  45. package/dist/server/git/worktrees.js +225 -0
  46. package/dist/server/git/worktrees.js.map +1 -0
  47. package/dist/server/github/gh.js +172 -0
  48. package/dist/server/github/gh.js.map +1 -0
  49. package/dist/server/pty/manager.js +129 -0
  50. package/dist/server/pty/manager.js.map +1 -0
  51. package/dist/server/pty/ring-buffer.js +40 -0
  52. package/dist/server/pty/ring-buffer.js.map +1 -0
  53. package/dist/server/server.js +36 -0
  54. package/dist/server/server.js.map +1 -0
  55. package/dist/server/workers/github-poller.js +185 -0
  56. package/dist/server/workers/github-poller.js.map +1 -0
  57. package/dist/server/workers/pr-watcher.js +111 -0
  58. package/dist/server/workers/pr-watcher.js.map +1 -0
  59. package/dist/server/workers/scheduler.js +209 -0
  60. package/dist/server/workers/scheduler.js.map +1 -0
  61. package/dist/server/ws/pty.js +72 -0
  62. package/dist/server/ws/pty.js.map +1 -0
  63. package/dist/shared/types.js +23 -0
  64. package/dist/shared/types.js.map +1 -0
  65. package/dist/web/assets/index-5VFn-lxF.js +129 -0
  66. package/dist/web/assets/index-CZHd5NaX.css +1 -0
  67. package/dist/web/index.html +19 -0
  68. package/package.json +79 -6
  69. package/scripts/fix-node-pty.mjs +35 -0
  70. package/index.js +0 -2
@@ -0,0 +1,129 @@
1
+ (function(){const Q=document.createElement("link").relList;if(Q&&Q.supports&&Q.supports("modulepreload"))return;for(const ne of document.querySelectorAll('link[rel="modulepreload"]'))I(ne);new MutationObserver(ne=>{for(const le of ne)if(le.type==="childList")for(const q of le.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&I(q)}).observe(document,{childList:!0,subtree:!0});function V(ne){const le={};return ne.integrity&&(le.integrity=ne.integrity),ne.referrerPolicy&&(le.referrerPolicy=ne.referrerPolicy),ne.crossOrigin==="use-credentials"?le.credentials="include":ne.crossOrigin==="anonymous"?le.credentials="omit":le.credentials="same-origin",le}function I(ne){if(ne.ep)return;ne.ep=!0;const le=V(ne);fetch(ne.href,le)}})();var Do={exports:{}},Vr={};/**
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 Vr;Id=1;var N=Symbol.for("react.transitional.element"),Q=Symbol.for("react.fragment");function V(I,ne,le){var q=null;if(le!==void 0&&(q=""+le),ne.key!==void 0&&(q=""+ne.key),"key"in ne){le={};for(var n in ne)n!=="key"&&(le[n]=ne[n])}else le=ne;return ne=le.ref,{$$typeof:N,type:I,key:q,ref:ne!==void 0?ne:null,props:le}}return Vr.Fragment=Q,Vr.jsx=V,Vr.jsxs=V,Vr}var Pd;function Lv(){return Pd||(Pd=1,Do.exports=Ev()),Do.exports}var H=Lv(),To={exports:{}},xe={};/**
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 xe;Fd=1;var N=Symbol.for("react.transitional.element"),Q=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),q=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),o=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(){}},d=Object.assign,r={};function c(A,O,Y){this.props=A,this.context=O,this.refs=r,this.updater=Y||y}c.prototype.isReactComponent={},c.prototype.setState=function(A,O){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,O,"setState")},c.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function l(){}l.prototype=c.prototype;function h(A,O,Y){this.props=A,this.context=O,this.refs=r,this.updater=Y||y}var m=h.prototype=new l;m.constructor=h,d(m,c.prototype),m.isPureReactComponent=!0;var w=Array.isArray;function S(){}var x={H:null,A:null,T:null,S:null},p=Object.prototype.hasOwnProperty;function C(A,O,Y){var Z=Y.ref;return{$$typeof:N,type:A,key:O,ref:Z!==void 0?Z:null,props:Y}}function L(A,O){return C(A.type,O,A.props)}function M(A){return typeof A=="object"&&A!==null&&A.$$typeof===N}function D(A){var O={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(Y){return O[Y]})}var T=/\/+/g;function j(A,O){return typeof A=="object"&&A!==null&&A.key!=null?D(""+A.key):O.toString(36)}function X(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(O){A.status==="pending"&&(A.status="fulfilled",A.value=O)},function(O){A.status==="pending"&&(A.status="rejected",A.reason=O)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function U(A,O,Y,Z,he){var ue=typeof A;(ue==="undefined"||ue==="boolean")&&(A=null);var F=!1;if(A===null)F=!0;else switch(ue){case"bigint":case"string":case"number":F=!0;break;case"object":switch(A.$$typeof){case N:case Q:F=!0;break;case v:return F=A._init,U(F(A._payload),O,Y,Z,he)}}if(F)return he=he(A),F=Z===""?"."+j(A,0):Z,w(he)?(Y="",F!=null&&(Y=F.replace(T,"$&/")+"/"),U(he,O,Y,"",function(ie){return ie})):he!=null&&(M(he)&&(he=L(he,Y+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(T,"$&/")+"/")+F)),O.push(he)),1;F=0;var k=Z===""?".":Z+":";if(w(A))for(var se=0;se<A.length;se++)Z=A[se],ue=k+j(Z,se),F+=U(Z,O,Y,ue,he);else if(se=b(A),typeof se=="function")for(A=se.call(A),se=0;!(Z=A.next()).done;)Z=Z.value,ue=k+j(Z,se++),F+=U(Z,O,Y,ue,he);else if(ue==="object"){if(typeof A.then=="function")return U(X(A),O,Y,Z,he);throw O=String(A),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return F}function P(A,O,Y){if(A==null)return A;var Z=[],he=0;return U(A,Z,"","",function(ue){return O.call(Y,ue,he++)}),Z}function G(A){if(A._status===-1){var O=A._result;O=O(),O.then(function(Y){(A._status===0||A._status===-1)&&(A._status=1,A._result=Y)},function(Y){(A._status===0||A._status===-1)&&(A._status=2,A._result=Y)}),A._status===-1&&(A._status=0,A._result=O)}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 O=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(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},z={map:P,forEach:function(A,O,Y){P(A,function(){O.apply(this,arguments)},Y)},count:function(A){var O=0;return P(A,function(){O++}),O},toArray:function(A){return P(A,function(O){return O})||[]},only:function(A){if(!M(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return xe.Activity=o,xe.Children=z,xe.Component=c,xe.Fragment=V,xe.Profiler=ne,xe.PureComponent=h,xe.StrictMode=I,xe.Suspense=f,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,xe.__COMPILER_RUNTIME={__proto__:null,c:function(A){return x.H.useMemoCache(A)}},xe.cache=function(A){return function(){return A.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(A,O,Y){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var Z=d({},A.props),he=A.key;if(O!=null)for(ue in O.key!==void 0&&(he=""+O.key),O)!p.call(O,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&O.ref===void 0||(Z[ue]=O[ue]);var ue=arguments.length-2;if(ue===1)Z.children=Y;else if(1<ue){for(var F=Array(ue),k=0;k<ue;k++)F[k]=arguments[k+2];Z.children=F}return C(A.type,he,Z)},xe.createContext=function(A){return A={$$typeof:q,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:le,_context:A},A},xe.createElement=function(A,O,Y){var Z,he={},ue=null;if(O!=null)for(Z in O.key!==void 0&&(ue=""+O.key),O)p.call(O,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(he[Z]=O[Z]);var F=arguments.length-2;if(F===1)he.children=Y;else if(1<F){for(var k=Array(F),se=0;se<F;se++)k[se]=arguments[se+2];he.children=k}if(A&&A.defaultProps)for(Z in F=A.defaultProps,F)he[Z]===void 0&&(he[Z]=F[Z]);return C(A,ue,he)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(A){return{$$typeof:n,render:A}},xe.isValidElement=M,xe.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:G}},xe.memo=function(A,O){return{$$typeof:_,type:A,compare:O===void 0?null:O}},xe.startTransition=function(A){var O=x.T,Y={};x.T=Y;try{var Z=A(),he=x.S;he!==null&&he(Y,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(S,R)}catch(ue){R(ue)}finally{O!==null&&Y.types!==null&&(O.types=Y.types),x.T=O}},xe.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},xe.use=function(A){return x.H.use(A)},xe.useActionState=function(A,O,Y){return x.H.useActionState(A,O,Y)},xe.useCallback=function(A,O){return x.H.useCallback(A,O)},xe.useContext=function(A){return x.H.useContext(A)},xe.useDebugValue=function(){},xe.useDeferredValue=function(A,O){return x.H.useDeferredValue(A,O)},xe.useEffect=function(A,O){return x.H.useEffect(A,O)},xe.useEffectEvent=function(A){return x.H.useEffectEvent(A)},xe.useId=function(){return x.H.useId()},xe.useImperativeHandle=function(A,O,Y){return x.H.useImperativeHandle(A,O,Y)},xe.useInsertionEffect=function(A,O){return x.H.useInsertionEffect(A,O)},xe.useLayoutEffect=function(A,O){return x.H.useLayoutEffect(A,O)},xe.useMemo=function(A,O){return x.H.useMemo(A,O)},xe.useOptimistic=function(A,O){return x.H.useOptimistic(A,O)},xe.useReducer=function(A,O,Y){return x.H.useReducer(A,O,Y)},xe.useRef=function(A){return x.H.useRef(A)},xe.useState=function(A){return x.H.useState(A)},xe.useSyncExternalStore=function(A,O,Y){return x.H.useSyncExternalStore(A,O,Y)},xe.useTransition=function(){return x.H.useTransition()},xe.version="19.2.6",xe}var qd;function qo(){return qd||(qd=1,To.exports=Av()),To.exports}var fe=qo(),Mo={exports:{}},Kr={},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(N){function Q(U,P){var G=U.length;U.push(P);e:for(;0<G;){var R=G-1>>>1,z=U[R];if(0<ne(z,P))U[R]=P,U[G]=z,G=R;else break e}}function V(U){return U.length===0?null:U[0]}function I(U){if(U.length===0)return null;var P=U[0],G=U.pop();if(G!==P){U[0]=G;e:for(var R=0,z=U.length,A=z>>>1;R<A;){var O=2*(R+1)-1,Y=U[O],Z=O+1,he=U[Z];if(0>ne(Y,G))Z<z&&0>ne(he,Y)?(U[R]=he,U[Z]=G,R=Z):(U[R]=Y,U[O]=G,R=O);else if(Z<z&&0>ne(he,G))U[R]=he,U[Z]=G,R=Z;else break e}}return P}function ne(U,P){var G=U.sortIndex-P.sortIndex;return G!==0?G:U.id-P.id}if(N.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var le=performance;N.unstable_now=function(){return le.now()}}else{var q=Date,n=q.now();N.unstable_now=function(){return q.now()-n}}var f=[],_=[],v=1,o=null,g=3,b=!1,y=!1,d=!1,r=!1,c=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function m(U){for(var P=V(_);P!==null;){if(P.callback===null)I(_);else if(P.startTime<=U)I(_),P.sortIndex=P.expirationTime,Q(f,P);else break;P=V(_)}}function w(U){if(d=!1,m(U),!y)if(V(f)!==null)y=!0,S||(S=!0,D());else{var P=V(_);P!==null&&X(w,P.startTime-U)}}var S=!1,x=-1,p=5,C=-1;function L(){return r?!0:!(N.unstable_now()-C<p)}function M(){if(r=!1,S){var U=N.unstable_now();C=U;var P=!0;try{e:{y=!1,d&&(d=!1,l(x),x=-1),b=!0;var G=g;try{t:{for(m(U),o=V(f);o!==null&&!(o.expirationTime>U&&L());){var R=o.callback;if(typeof R=="function"){o.callback=null,g=o.priorityLevel;var z=R(o.expirationTime<=U);if(U=N.unstable_now(),typeof z=="function"){o.callback=z,m(U),P=!0;break t}o===V(f)&&I(f),m(U)}else I(f);o=V(f)}if(o!==null)P=!0;else{var A=V(_);A!==null&&X(w,A.startTime-U),P=!1}}break e}finally{o=null,g=G,b=!1}P=void 0}}finally{P?D():S=!1}}}var D;if(typeof h=="function")D=function(){h(M)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,j=T.port2;T.port1.onmessage=M,D=function(){j.postMessage(null)}}else D=function(){c(M,0)};function X(U,P){x=c(function(){U(N.unstable_now())},P)}N.unstable_IdlePriority=5,N.unstable_ImmediatePriority=1,N.unstable_LowPriority=4,N.unstable_NormalPriority=3,N.unstable_Profiling=null,N.unstable_UserBlockingPriority=2,N.unstable_cancelCallback=function(U){U.callback=null},N.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):p=0<U?Math.floor(1e3/U):5},N.unstable_getCurrentPriorityLevel=function(){return g},N.unstable_next=function(U){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var G=g;g=P;try{return U()}finally{g=G}},N.unstable_requestPaint=function(){r=!0},N.unstable_runWithPriority=function(U,P){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var G=g;g=U;try{return P()}finally{g=G}},N.unstable_scheduleCallback=function(U,P,G){var R=N.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?R+G:R):G=R,U){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=G+z,U={id:v++,callback:P,priorityLevel:U,startTime:G,expirationTime:z,sortIndex:-1},G>R?(U.sortIndex=G,Q(_,U),V(f)===null&&U===V(_)&&(d?(l(x),x=-1):d=!0,X(w,G-R))):(U.sortIndex=z,Q(f,U),y||b||(y=!0,S||(S=!0,D()))),U},N.unstable_shouldYield=L,N.unstable_wrapCallback=function(U){var P=g;return function(){var G=g;g=P;try{return U.apply(this,arguments)}finally{g=G}}}})(Oo)),Oo}var Gd;function Dv(){return Gd||(Gd=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 $d;function Tv(){if($d)return yt;$d=1;var N=qo();function Q(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 V(){}var I={d:{f:V,r:function(){throw Error(Q(522))},D:V,C:V,L:V,m:V,X:V,S:V,M:V},p:0,findDOMNode:null},ne=Symbol.for("react.portal");function le(f,_,v){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ne,key:o==null?null:""+o,children:f,containerInfo:_,implementation:v}}var q=N.__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=I,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(Q(299));return le(f,_,null,v)},yt.flushSync=function(f){var _=q.T,v=I.p;try{if(q.T=null,I.p=2,f)return f()}finally{q.T=_,I.p=v,I.d.f()}},yt.preconnect=function(f,_){typeof f=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,I.d.C(f,_))},yt.prefetchDNS=function(f){typeof f=="string"&&I.d.D(f)},yt.preinit=function(f,_){if(typeof f=="string"&&_&&typeof _.as=="string"){var v=_.as,o=n(v,_.crossOrigin),g=typeof _.integrity=="string"?_.integrity:void 0,b=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;v==="style"?I.d.S(f,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:o,integrity:g,fetchPriority:b}):v==="script"&&I.d.X(f,{crossOrigin:o,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);I.d.M(f,{crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&I.d.M(f)},yt.preload=function(f,_){if(typeof f=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var v=_.as,o=n(v,_.crossOrigin);I.d.L(f,v,{crossOrigin:o,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);I.d.m(f,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else I.d.m(f)},yt.requestFormReset=function(f){I.d.r(f)},yt.unstable_batchedUpdates=function(f,_){return f(_)},yt.useFormState=function(f,_,v){return q.H.useFormState(f,_,v)},yt.useFormStatus=function(){return q.H.useHostTransitionStatus()},yt.version="19.2.6",yt}var Yd;function Mv(){if(Yd)return ko.exports;Yd=1;function N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N)}catch(Q){console.error(Q)}}return N(),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 Kr;Xd=1;var N=Dv(),Q=qo(),V=Mv();function I(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 ne(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function le(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 q(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(le(e)!==e)throw Error(I(188))}function _(e){var t=e.alternate;if(!t){if(t=le(e),t===null)throw Error(I(188));return t!==e?null:e}for(var i=e,s=t;;){var a=i.return;if(a===null)break;var u=a.alternate;if(u===null){if(s=a.return,s!==null){i=s;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===i)return f(a),e;if(u===s)return f(a),t;u=u.sibling}throw Error(I(188))}if(i.return!==s.return)i=a,s=u;else{for(var E=!1,B=a.child;B;){if(B===i){E=!0,i=a,s=u;break}if(B===s){E=!0,s=a,i=u;break}B=B.sibling}if(!E){for(B=u.child;B;){if(B===i){E=!0,i=u,s=a;break}if(B===s){E=!0,s=u,i=a;break}B=B.sibling}if(!E)throw Error(I(189))}}if(i.alternate!==s)throw Error(I(190))}if(i.tag!==3)throw Error(I(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 o=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function D(e){return e===null||typeof e!="object"?null:(e=M&&e[M]||e["@@iterator"],typeof e=="function"?e:null)}var T=Symbol.for("react.client.reference");function j(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===T?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case c:return"Profiler";case r:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList";case C:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case y:return"Portal";case h:return e.displayName||"Context";case l: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 x:return t=e.displayName||null,t!==null?t:j(e.type)||"Memo";case p:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var X=Array.isArray,U=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=V.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},R=[],z=-1;function A(e){return{current:e}}function O(e){0>z||(e.current=R[z],R[z]=null,z--)}function Y(e,t){z++,R[z]=e.current,e.current=t}var Z=A(null),he=A(null),ue=A(null),F=A(null);function k(e,t){switch(Y(ue,t),Y(he,e),Y(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}}O(Z),Y(Z,e)}function se(){O(Z),O(he),O(ue)}function ie(e){e.memoizedState!==null&&Y(F,e);var t=Z.current,i=hd(t,e.type);t!==i&&(Y(he,e),Y(Z,i))}function _e(e){he.current===e&&(O(Z),O(he)),F.current===e&&(O(F),Gr._currentValue=G)}var de,we;function pe(e){if(de===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||"",we=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+de+e+we}var He=!1;function Qe(e,t){if(!e||He)return"";He=!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(re){var te=re}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(re){te=re}e.call(ce.prototype)}}else{try{throw Error()}catch(re){te=re}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(re){if(re&&te&&typeof re.stack=="string")return[re.stack,te.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 u=s.DetermineComponentFrameRoot(),E=u[0],B=u[1];if(E&&B){var W=E.split(`
44
+ `),ee=B.split(`
45
+ `);for(a=s=0;s<W.length&&!W[s].includes("DetermineComponentFrameRoot");)s++;for(;a<ee.length&&!ee[a].includes("DetermineComponentFrameRoot");)a++;if(s===W.length||a===ee.length)for(s=W.length-1,a=ee.length-1;1<=s&&0<=a&&W[s]!==ee[a];)a--;for(;1<=s&&0<=a;s--,a--)if(W[s]!==ee[a]){if(s!==1||a!==1)do if(s--,a--,0>a||W[s]!==ee[a]){var ae=`
46
+ `+W[s].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=s&&0<=a);break}}}finally{He=!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=N.unstable_scheduleCallback,Ae=N.unstable_cancelCallback,De=N.unstable_shouldYield,ve=N.unstable_requestPaint,Ce=N.unstable_now,Ze=N.unstable_getCurrentPriorityLevel,Fe=N.unstable_ImmediatePriority,Ft=N.unstable_UserBlockingPriority,ct=N.unstable_NormalPriority,xt=N.unstable_LowPriority,et=N.unstable_IdlePriority,qe=N.log,Re=N.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,Ss=Math.log,_a=Math.LN2;function va(e){return e>>>=0,e===0?32:31-(Ss(e)/_a|0)|0}var Ai=256,Zi=262144,Ji=4194304;function oi(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,u=e.suspendedLanes,E=e.pingedLanes;e=e.warmLanes;var B=s&134217727;return B!==0?(s=B&~u,s!==0?a=oi(s):(E&=B,E!==0?a=oi(E):i||(i=B&~e,i!==0&&(a=oi(i))))):(B=s&~u,B!==0?a=oi(B):E!==0?a=oi(E):i||(i=s&~e,i!==0&&(a=oi(i)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,i=t&-t,u>=i||u===32&&(i&4194048)!==0)?t:a}function rr(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=Ji;return Ji<<=1,(Ji&62914560)===0&&(Ji=4194304),e}function ga(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function nr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ff(e,t,i,s,a,u){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 B=e.entanglements,W=e.expirationTimes,ee=e.hiddenUpdates;for(i=E&~i;0<i;){var ae=31-bt(i),ce=1<<ae;B[ae]=0,W[ae]=-1;var te=ee[ae];if(te!==null)for(ee[ae]=null,ae=0;ae<te.length;ae++){var re=te[ae];re!==null&&(re.lane&=-536870913)}i&=~ce}s!==0&&Go(e,s,0),u!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=u&~(E&~t))}function Go(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 $o(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=P.p;return e!==0?e:(e=window.event,e===void 0?32:Od(e.type))}function Vo(e,t){var i=P.p;try{return P.p=e,t()}finally{P.p=i}}var Ri=Math.random().toString(36).slice(2),vt="__reactFiber$"+Ri,Et="__reactProps$"+Ri,bs="__reactContainer$"+Ri,Sa="__reactEvents$"+Ri,_f="__reactListeners$"+Ri,vf="__reactHandles$"+Ri,Ko="__reactResources$"+Ri,ar="__reactMarker$"+Ri;function ba(e){delete e[vt],delete e[Et],delete e[Sa],delete e[_f],delete e[vf]}function ys(e){var t=e[vt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[bs]||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 Cs(e){if(e=e[vt]||e[bs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function lr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(I(33))}function ws(e){var t=e[Ko];return t||(t=e[Ko]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[ar]=!0}var Qo=new Set,Zo={};function es(e,t){xs(e,t),xs(e+"Capture",t)}function xs(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 ci(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,u=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(E){i=""+E,u.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,u,E,B){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?wa(e,E,qt(t)):i!=null?wa(e,E,qt(i)):s!=null&&e.removeAttribute("value"),a==null&&u!=null&&(e.defaultChecked=!!u),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?e.name=""+qt(B):e.removeAttribute("name")}function sc(e,t,i,s,a,u,E,B){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||i!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){ya(e);return}i=i!=null?""+qt(i):"",t=t!=null?""+qt(t):i,B||t===e.value||(e.value=t),e.defaultValue=t}s=s??a,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=B?e.checked:!!s,e.defaultChecked=!!s,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(e.name=E),ya(e)}function wa(e,t,i){t==="number"&&rn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Es(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(I(92));if(X(s)){if(1<s.length)throw Error(I(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 Ls(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(I(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 u in t)t.hasOwnProperty(u)&&ac(e,u,t[u])}function xa(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 hi(){}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 As=null,Rs=null;function oc(e){var t=Cs(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(I(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&&Es(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,(As!==null||Rs!==null)&&($n(),As&&(t=As,e=Rs,Rs=As=null,oc(t),e)))for(t=0;t<e.length;t++)oc(e[t])}}function or(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(I(231,t,typeof i));return i}var ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ra=!1;if(ui)try{var cr={};Object.defineProperty(cr,"passive",{get:function(){Ra=!0}}),window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Ra=!1}var Di=null,Da=null,an=null;function hc(){if(an)return an;var e,t=Da,i=t.length,s,a="value"in Di?Di.value:Di.textContent,u=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[u-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,u,E){this._reactName=i,this._targetInst=a,this.type=s,this.nativeEvent=u,this.target=E,this.currentTarget=null;for(var B in e)e.hasOwnProperty(B)&&(i=e[B],this[B]=i?i(u):u[B]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?on:uc,this.isPropagationStopped=uc,this}return o(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 ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=Lt(ts),hr=o({},ts,{view:0,detail:0}),wf=Lt(hr),Ta,Ma,ur,hn=o({},hr,{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!==ur&&(ur&&e.type==="mousemove"?(Ta=e.screenX-ur.screenX,Ma=e.screenY-ur.screenY):Ma=Ta=0,ur=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:Ma}}),dc=Lt(hn),xf=o({},hn,{dataTransfer:0}),Ef=Lt(xf),Lf=o({},hr,{relatedTarget:0}),Ba=Lt(Lf),Af=o({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),Rf=Lt(Af),Df=o({},ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tf=Lt(Df),Mf=o({},ts,{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 Hf=o({},hr,{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}}),Nf=Lt(Hf),jf=o({},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=o({},hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oa}),If=Lt(Uf),Pf=o({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ff=Lt(Pf),qf=o({},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),Gf=o({},ts,{newState:0,oldState:0}),$f=Lt(Gf),Yf=[9,13,27,32],ka=ui&&"CompositionEvent"in window,dr=null;ui&&"documentMode"in document&&(dr=document.documentMode);var Xf=ui&&"TextEvent"in window&&!dr,vc=ui&&(!ka||dr&&8<dr&&11>=dr),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 Ds=!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(Ds)return e==="compositionend"||!ka&&pc(e,t)?(e=hc(),an=Da=Di=null,Ds=!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){As?Rs?Rs.push(s):Rs=[s]:As=s,t=Jn(t,"onChange"),0<t.length&&(i=new cn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var fr=null,_r=null;function Zf(e){sd(e,0)}function un(e){var t=lr(e);if(ic(t))return e}function Cc(e,t){if(e==="change")return t}var wc=!1;if(ui){var za;if(ui){var Ha="oninput"in document;if(!Ha){var xc=document.createElement("div");xc.setAttribute("oninput","return;"),Ha=typeof xc.oninput=="function"}za=Ha}else za=!1;wc=za&&(!document.documentMode||9<document.documentMode)}function Ec(){fr&&(fr.detachEvent("onpropertychange",Lc),_r=fr=null)}function Lc(e){if(e.propertyName==="value"&&un(_r)){var t=[];yc(t,_r,e,La(e)),cc(Zf,t)}}function Jf(e,t,i){e==="focusin"?(Ec(),fr=t,_r=i,fr.attachEvent("onpropertychange",Lc)):e==="focusout"&&Ec()}function e_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return un(_r)}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 vr(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 Na(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_=ui&&"documentMode"in document&&11>=document.documentMode,Ts=null,ja=null,gr=null,Ua=!1;function Mc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ua||Ts==null||Ts!==rn(s)||(s=Ts,"selectionStart"in s&&Na(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}),gr&&vr(gr,s)||(gr=s,s=Jn(ja,"onSelect"),0<s.length&&(t=new cn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Ts)))}function is(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ms={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},Ia={},Bc={};ui&&(Bc=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function ss(e){if(Ia[e])return Ia[e];if(!Ms[e])return e;var t=Ms[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Bc)return Ia[e]=t[i];return e}var Oc=ss("animationend"),kc=ss("animationiteration"),zc=ss("animationstart"),n_=ss("transitionrun"),a_=ss("transitionstart"),l_=ss("transitioncancel"),Hc=ss("transitionend"),Nc=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){Nc.set(e,t),es(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)},Gt=[],Bs=0,Fa=0;function fn(){for(var e=Bs,t=Fa=Bs=0;t<e;){var i=Gt[t];Gt[t++]=null;var s=Gt[t];Gt[t++]=null;var a=Gt[t];Gt[t++]=null;var u=Gt[t];if(Gt[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}u!==0&&jc(i,a,u)}}function _n(e,t,i,s){Gt[Bs++]=e,Gt[Bs++]=t,Gt[Bs++]=i,Gt[Bs++]=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 rs(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,u=e.return;u!==null;)u.childLanes|=i,s=u.alternate,s!==null&&(s.childLanes|=i),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(a=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,a&&t!==null&&(a=31-bt(i),e=u.hiddenUpdates,s=e[a],s===null?e[a]=[t]:s.push(t),t.lane=i|536870912),u):null}function vn(e){if(50<jr)throw jr=0,Zl=null,Error(I(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Os={};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 di(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,u){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 C:return e=zt(31,i,t,a),e.elementType=C,e.lanes=u,e;case d:return ns(i.children,a,u,t);case r:E=8,a|=24;break;case c:return e=zt(12,i,t,a|2),e.elementType=c,e.lanes=u,e;case w:return e=zt(13,i,t,a),e.elementType=w,e.lanes=u,e;case S:return e=zt(19,i,t,a),e.elementType=S,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h:E=10;break e;case l:E=9;break e;case m:E=11;break e;case x:E=14;break e;case p:E=16,s=null;break e}E=29,i=Error(I(130,e===null?"null":typeof e,"")),s=null}return t=zt(E,i,t,a),t.elementType=e,t.type=s,t.lanes=u,t}function ns(e,t,i,s){return e=zt(7,e,s,t),e.lanes=i,e}function Ga(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 $a(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 $t(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 ks=[],zs=0,mn=null,mr=0,Yt=[],Xt=0,Ti=null,ri=1,ni="";function fi(e,t){ks[zs++]=mr,ks[zs++]=mn,mn=e,mr=t}function Fc(e,t,i){Yt[Xt++]=ri,Yt[Xt++]=ni,Yt[Xt++]=Ti,Ti=e;var s=ri;e=ni;var a=32-bt(s)-1;s&=~(1<<a),i+=1;var u=32-bt(t)+a;if(30<u){var E=a-a%5;u=(s&(1<<E)-1).toString(32),s>>=E,a-=E,ri=1<<32-bt(t)+a|i<<a|s,ni=u+e}else ri=1<<u|i<<a|s,ni=e}function Ya(e){e.return!==null&&(fi(e,1),Fc(e,1,0))}function Xa(e){for(;e===mn;)mn=ks[--zs],ks[zs]=null,mr=ks[--zs],ks[zs]=null;for(;e===Ti;)Ti=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++]=Ti,ri=t.id,ni=t.overflow,Ti=e}var gt=null,Xe=null,ze=!1,Mi=null,Vt=!1,Va=Error(I(519));function Bi(e){var t=Error(I(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr($t(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<Ir.length;i++)Me(Ir[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=hi),t=!0):t=!1,t||Bi(e,!0)}function Gc(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 Hs(e){if(e!==gt)return!1;if(!ze)return Gc(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&&Xe&&Bi(e),Gc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));Xe=gd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));Xe=gd(e)}else t===27?(t=Xe,$i(e.type)?(e=So,So=null,Xe=e):Xe=t):Xe=gt?Qt(e.stateNode.nextSibling):null;return!0}function as(){Xe=gt=null,ze=!1}function Ka(){var e=Mi;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Mi=null),e}function pr(e){Mi===null?Mi=[e]:Mi.push(e)}var Qa=A(null),ls=null,_i=null;function Oi(e,t,i){Y(Qa,t._currentValue),t._currentValue=i}function vi(e){e._currentValue=Qa.current,O(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 u=a.dependencies;if(u!==null){var E=a.child;u=u.firstContext;e:for(;u!==null;){var B=u;u=a;for(var W=0;W<t.length;W++)if(B.context===t[W]){u.lanes|=i,B=u.alternate,B!==null&&(B.lanes|=i),Za(u.return,i,e),s||(E=null);break e}u=B.next}}else if(a.tag===18){if(E=a.return,E===null)throw Error(I(341));E.lanes|=i,u=E.alternate,u!==null&&(u.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 Ns(e,t,i,s){e=null;for(var a=t,u=!1;a!==null;){if(!u){if((a.flags&524288)!==0)u=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var E=a.alternate;if(E===null)throw Error(I(387));if(E=E.memoizedProps,E!==null){var B=a.type;kt(a.pendingProps.value,E.value)||(e!==null?e.push(B):e=[B])}}else if(a===F.current){if(E=a.alternate,E===null)throw Error(I(387));E.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Gr):e=[Gr])}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 os(e){ls=e,_i=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return $c(ls,e)}function Sn(e,t){return ls===null&&os(e),$c(e,t)}function $c(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},_i===null){if(e===null)throw Error(I(308));_i=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _i=_i.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_=N.unstable_scheduleCallback,u_=N.unstable_NormalPriority,nt={$$typeof:h,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function el(){return{controller:new c_,data:new Map,refCount:0}}function Sr(e){e.refCount--,e.refCount===0&&h_(u_,function(){e.controller.abort()})}var br=null,tl=0,js=0,Us=null;function d_(e,t){if(br===null){var i=br=[];tl=0,js=ro(),Us={status:"pending",value:void 0,then:function(s){i.push(s)}}}return tl++,t.then(Yc,Yc),t}function Yc(){if(--tl===0&&br!==null){Us!==null&&(Us.status="fulfilled");var e=br;br=null,js=0,Us=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=U.S;U.S=function(e,t){Mu=Ce(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&d_(e,t),Xc!==null&&Xc(e,t)};var cs=A(null);function il(){var e=cs.current;return e!==null?e:Ye.pooledCache}function bn(e,t){t===null?Y(cs,cs.current):Y(cs,t.pool)}function Vc(){var e=il();return e===null?null:{parent:nt._currentValue,pool:e}}var Is=Error(I(460)),sl=Error(I(474)),yn=Error(I(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(hi,hi),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(hi,hi);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(I(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 us=t,Is}}function hs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(us=i,Is):i}}var us=null;function Zc(){if(us===null)throw Error(I(459));var e=us;return us=null,e}function Jc(e){if(e===Is||e===yn)throw Error(I(483))}var Ps=null,yr=0;function wn(e){var t=yr;return yr+=1,Ps===null&&(Ps=[]),Qc(Ps,e,t)}function Cr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xn(e,t){throw t.$$typeof===g?Error(I(525)):(e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function eh(e){function t(K,$){if(e){var J=K.deletions;J===null?(K.deletions=[$],K.flags|=16):J.push($)}}function i(K,$){if(!e)return null;for(;$!==null;)t(K,$),$=$.sibling;return null}function s(K){for(var $=new Map;K!==null;)K.key!==null?$.set(K.key,K):$.set(K.index,K),K=K.sibling;return $}function a(K,$){return K=di(K,$),K.index=0,K.sibling=null,K}function u(K,$,J){return K.index=J,e?(J=K.alternate,J!==null?(J=J.index,J<$?(K.flags|=67108866,$):J):(K.flags|=67108866,$)):(K.flags|=1048576,$)}function E(K){return e&&K.alternate===null&&(K.flags|=67108866),K}function B(K,$,J,oe){return $===null||$.tag!==6?($=Ga(J,K.mode,oe),$.return=K,$):($=a($,J),$.return=K,$)}function W(K,$,J,oe){var Se=J.type;return Se===d?ae(K,$,J.props.children,oe,J.key):$!==null&&($.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===p&&hs(Se)===$.type)?($=a($,J.props),Cr($,J),$.return=K,$):($=gn(J.type,J.key,J.props,null,K.mode,oe),Cr($,J),$.return=K,$)}function ee(K,$,J,oe){return $===null||$.tag!==4||$.stateNode.containerInfo!==J.containerInfo||$.stateNode.implementation!==J.implementation?($=$a(J,K.mode,oe),$.return=K,$):($=a($,J.children||[]),$.return=K,$)}function ae(K,$,J,oe,Se){return $===null||$.tag!==7?($=ns(J,K.mode,oe,Se),$.return=K,$):($=a($,J),$.return=K,$)}function ce(K,$,J){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Ga(""+$,K.mode,J),$.return=K,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return J=gn($.type,$.key,$.props,null,K.mode,J),Cr(J,$),J.return=K,J;case y:return $=$a($,K.mode,J),$.return=K,$;case p:return $=hs($),ce(K,$,J)}if(X($)||D($))return $=ns($,K.mode,J,null),$.return=K,$;if(typeof $.then=="function")return ce(K,wn($),J);if($.$$typeof===h)return ce(K,Sn(K,$),J);xn(K,$)}return null}function te(K,$,J,oe){var Se=$!==null?$.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Se!==null?null:B(K,$,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===Se?W(K,$,J,oe):null;case y:return J.key===Se?ee(K,$,J,oe):null;case p:return J=hs(J),te(K,$,J,oe)}if(X(J)||D(J))return Se!==null?null:ae(K,$,J,oe,null);if(typeof J.then=="function")return te(K,$,wn(J),oe);if(J.$$typeof===h)return te(K,$,Sn(K,J),oe);xn(K,J)}return null}function re(K,$,J,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return K=K.get(J)||null,B($,K,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return K=K.get(oe.key===null?J:oe.key)||null,W($,K,oe,Se);case y:return K=K.get(oe.key===null?J:oe.key)||null,ee($,K,oe,Se);case p:return oe=hs(oe),re(K,$,J,oe,Se)}if(X(oe)||D(oe))return K=K.get(J)||null,ae($,K,oe,Se,null);if(typeof oe.then=="function")return re(K,$,J,wn(oe),Se);if(oe.$$typeof===h)return re(K,$,J,Sn($,oe),Se);xn($,oe)}return null}function ge(K,$,J,oe){for(var Se=null,Ne=null,me=$,Le=$=0,ke=null;me!==null&&Le<J.length;Le++){me.index>Le?(ke=me,me=null):ke=me.sibling;var je=te(K,me,J[Le],oe);if(je===null){me===null&&(me=ke);break}e&&me&&je.alternate===null&&t(K,me),$=u(je,$,Le),Ne===null?Se=je:Ne.sibling=je,Ne=je,me=ke}if(Le===J.length)return i(K,me),ze&&fi(K,Le),Se;if(me===null){for(;Le<J.length;Le++)me=ce(K,J[Le],oe),me!==null&&($=u(me,$,Le),Ne===null?Se=me:Ne.sibling=me,Ne=me);return ze&&fi(K,Le),Se}for(me=s(me);Le<J.length;Le++)ke=re(me,K,Le,J[Le],oe),ke!==null&&(e&&ke.alternate!==null&&me.delete(ke.key===null?Le:ke.key),$=u(ke,$,Le),Ne===null?Se=ke:Ne.sibling=ke,Ne=ke);return e&&me.forEach(function(Qi){return t(K,Qi)}),ze&&fi(K,Le),Se}function ye(K,$,J,oe){if(J==null)throw Error(I(151));for(var Se=null,Ne=null,me=$,Le=$=0,ke=null,je=J.next();me!==null&&!je.done;Le++,je=J.next()){me.index>Le?(ke=me,me=null):ke=me.sibling;var Qi=te(K,me,je.value,oe);if(Qi===null){me===null&&(me=ke);break}e&&me&&Qi.alternate===null&&t(K,me),$=u(Qi,$,Le),Ne===null?Se=Qi:Ne.sibling=Qi,Ne=Qi,me=ke}if(je.done)return i(K,me),ze&&fi(K,Le),Se;if(me===null){for(;!je.done;Le++,je=J.next())je=ce(K,je.value,oe),je!==null&&($=u(je,$,Le),Ne===null?Se=je:Ne.sibling=je,Ne=je);return ze&&fi(K,Le),Se}for(me=s(me);!je.done;Le++,je=J.next())je=re(me,K,Le,je.value,oe),je!==null&&(e&&je.alternate!==null&&me.delete(je.key===null?Le:je.key),$=u(je,$,Le),Ne===null?Se=je:Ne.sibling=je,Ne=je);return e&&me.forEach(function(xv){return t(K,xv)}),ze&&fi(K,Le),Se}function $e(K,$,J,oe){if(typeof J=="object"&&J!==null&&J.type===d&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var Se=J.key;$!==null;){if($.key===Se){if(Se=J.type,Se===d){if($.tag===7){i(K,$.sibling),oe=a($,J.props.children),oe.return=K,K=oe;break e}}else if($.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===p&&hs(Se)===$.type){i(K,$.sibling),oe=a($,J.props),Cr(oe,J),oe.return=K,K=oe;break e}i(K,$);break}else t(K,$);$=$.sibling}J.type===d?(oe=ns(J.props.children,K.mode,oe,J.key),oe.return=K,K=oe):(oe=gn(J.type,J.key,J.props,null,K.mode,oe),Cr(oe,J),oe.return=K,K=oe)}return E(K);case y:e:{for(Se=J.key;$!==null;){if($.key===Se)if($.tag===4&&$.stateNode.containerInfo===J.containerInfo&&$.stateNode.implementation===J.implementation){i(K,$.sibling),oe=a($,J.children||[]),oe.return=K,K=oe;break e}else{i(K,$);break}else t(K,$);$=$.sibling}oe=$a(J,K.mode,oe),oe.return=K,K=oe}return E(K);case p:return J=hs(J),$e(K,$,J,oe)}if(X(J))return ge(K,$,J,oe);if(D(J)){if(Se=D(J),typeof Se!="function")throw Error(I(150));return J=Se.call(J),ye(K,$,J,oe)}if(typeof J.then=="function")return $e(K,$,wn(J),oe);if(J.$$typeof===h)return $e(K,$,Sn(K,J),oe);xn(K,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,$!==null&&$.tag===6?(i(K,$.sibling),oe=a($,J),oe.return=K,K=oe):(i(K,$),oe=Ga(J,K.mode,oe),oe.return=K,K=oe),E(K)):i(K,$)}return function(K,$,J,oe){try{yr=0;var Se=$e(K,$,J,oe);return Ps=null,Se}catch(me){if(me===Is||me===yn)throw me;var Ne=zt(29,me,null,K.mode);return Ne.lanes=oe,Ne.return=K,Ne}finally{}}}var ds=eh(!0),th=eh(!1),ki=!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 zi(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 wr(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,$o(e,i)}}function al(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var a=null,u=null;if(i=i.firstBaseUpdate,i!==null){do{var E={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};u===null?a=u=E:u=u.next=E,i=i.next}while(i!==null);u===null?a=u=t:u=u.next=t}else a=u=t;i={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:u,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 xr(){if(ll){var e=Us;if(e!==null)throw e}}function Er(e,t,i,s){ll=!1;var a=e.updateQueue;ki=!1;var u=a.firstBaseUpdate,E=a.lastBaseUpdate,B=a.shared.pending;if(B!==null){a.shared.pending=null;var W=B,ee=W.next;W.next=null,E===null?u=ee:E.next=ee,E=W;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,B=ae.lastBaseUpdate,B!==E&&(B===null?ae.firstBaseUpdate=ee:B.next=ee,ae.lastBaseUpdate=W))}if(u!==null){var ce=a.baseState;E=0,ae=ee=W=null,B=u;do{var te=B.lane&-536870913,re=te!==B.lane;if(re?(Oe&te)===te:(s&te)===te){te!==0&&te===js&&(ll=!0),ae!==null&&(ae=ae.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var ge=e,ye=B;te=t;var $e=i;switch(ye.tag){case 1:if(ge=ye.payload,typeof ge=="function"){ce=ge.call($e,ce,te);break e}ce=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=ye.payload,te=typeof ge=="function"?ge.call($e,ce,te):ge,te==null)break e;ce=o({},ce,te);break e;case 2:ki=!0}}te=B.callback,te!==null&&(e.flags|=64,re&&(e.flags|=8192),re=a.callbacks,re===null?a.callbacks=[te]:re.push(te))}else re={lane:te,tag:B.tag,payload:B.payload,callback:B.callback,next:null},ae===null?(ee=ae=re,W=ce):ae=ae.next=re,E|=te;if(B=B.next,B===null){if(B=a.shared.pending,B===null)break;re=B,B=re.next,re.next=null,a.lastBaseUpdate=re,a.shared.pending=null}}while(!0);ae===null&&(W=ce),a.baseState=W,a.firstBaseUpdate=ee,a.lastBaseUpdate=ae,u===null&&(a.shared.lanes=0),Pi|=E,e.lanes=E,e.memoizedState=ce}}function ih(e,t){if(typeof e!="function")throw Error(I(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 Fs=A(null),En=A(0);function rh(e,t){e=xi,Y(En,e),Y(Fs,t),xi=e|t.baseLanes}function ol(){Y(En,xi),Y(Fs,Fs.current)}function cl(){xi=En.current,O(Fs),O(En)}var Ht=A(null),Kt=null;function Ni(e){var t=e.alternate;Y(st,st.current&1),Y(Ht,e),Kt===null&&(t===null||Fs.current!==null||t.memoizedState!==null)&&(Kt=e)}function hl(e){Y(st,st.current),Y(Ht,e),Kt===null&&(Kt=e)}function nh(e){e.tag===22?(Y(st,st.current),Y(Ht,e),Kt===null&&(Kt=e)):ji()}function ji(){Y(st,st.current),Y(Ht,Ht.current)}function Nt(e){O(Ht),Kt===e&&(Kt=null),O(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 gi=0,Ee=null,We=null,at=null,An=!1,qs=!1,fs=!1,Rn=0,Lr=0,Ws=null,__=0;function tt(){throw Error(I(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,u){return gi=u,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Fh:Al,fs=!1,u=i(s,a),fs=!1,qs&&(u=lh(t,i,s,a)),ah(e),u}function ah(e){U.H=Dr;var t=We!==null&&We.next!==null;if(gi=0,at=We=Ee=null,An=!1,Lr=0,Ws=null,t)throw Error(I(300));e===null||lt||(e=e.dependencies,e!==null&&pn(e)&&(lt=!0))}function lh(e,t,i,s){Ee=e;var a=0;do{if(qs&&(Ws=null),Lr=0,qs=!1,25<=a)throw Error(I(301));if(a+=1,at=We=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}U.H=qh,u=t(i,s)}while(qs);return u}function v_(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Ar(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}gi=0,at=We=Ee=null,qs=!1,Lr=Rn=0,Ws=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Ee.memoizedState=at=e:at=at.next=e,at}function rt(){if(We===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=at===null?Ee.memoizedState:at.next;if(t!==null)at=t,We=e;else{if(e===null)throw Ee.alternate===null?Error(I(467)):Error(I(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},at===null?Ee.memoizedState=at=e:at=at.next=e}return at}function Dn(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ar(e){var t=Lr;return Lr+=1,Ws===null&&(Ws=[]),e=Qc(Ws,e,t),t=Ee,(at===null?t.memoizedState:at.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Fh:Al),e}function Tn(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ar(e);if(e.$$typeof===h)return mt(e)}throw Error(I(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 mi(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(I(311));s.lastRenderedReducer=i;var a=e.baseQueue,u=s.pending;if(u!==null){if(a!==null){var E=a.next;a.next=u.next,u.next=E}t.baseQueue=a=u,s.pending=null}if(u=e.baseState,a===null)e.memoizedState=u;else{t=a.next;var B=E=null,W=null,ee=t,ae=!1;do{var ce=ee.lane&-536870913;if(ce!==ee.lane?(Oe&ce)===ce:(gi&ce)===ce){var te=ee.revertLane;if(te===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ce===js&&(ae=!0);else if((gi&te)===te){ee=ee.next,te===js&&(ae=!0);continue}else ce={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},W===null?(B=W=ce,E=u):W=W.next=ce,Ee.lanes|=te,Pi|=te;ce=ee.action,fs&&i(u,ce),u=ee.hasEagerState?ee.eagerState:i(u,ce)}else te={lane:ce,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},W===null?(B=W=te,E=u):W=W.next=te,Ee.lanes|=ce,Pi|=ce;ee=ee.next}while(ee!==null&&ee!==t);if(W===null?E=u:W.next=B,!kt(u,e.memoizedState)&&(lt=!0,ae&&(i=Us,i!==null)))throw i;e.memoizedState=u,e.baseState=E,e.baseQueue=W,s.lastRenderedState=u}return a===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function pl(e){var t=rt(),i=t.queue;if(i===null)throw Error(I(311));i.lastRenderedReducer=e;var s=i.dispatch,a=i.pending,u=t.memoizedState;if(a!==null){i.pending=null;var E=a=a.next;do u=e(u,E.action),E=E.next;while(E!==a);kt(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),i.lastRenderedState=u}return[u,s]}function oh(e,t,i){var s=Ee,a=rt(),u=ze;if(u){if(i===void 0)throw Error(I(407));i=i()}else i=t();var E=!kt((We||a).memoizedState,i);if(E&&(a.memoizedState=i,lt=!0),a=a.queue,yl(uh.bind(null,s,a,e),[e]),a.getSnapshot!==t||E||at!==null&&at.memoizedState.tag&1){if(s.flags|=2048,Gs(9,{destroy:void 0},hh.bind(null,s,a,i,t),null),Ye===null)throw Error(I(349));u||(gi&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=rs(e,2);t!==null&&Mt(t,e,2)}function Sl(e){var t=Ct();if(typeof e=="function"){var i=e;if(e=i(),fs){Ot(!0);try{i()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:e},t}function _h(e,t,i,s){return e.baseState=i,ml(e,We,typeof s=="function"?s:mi)}function g_(e,t,i,s,a){if(kn(e))throw Error(I(485));if(e=t.action,e!==null){var u={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){u.listeners.push(E)}};U.T!==null?i(!0):u.isTransition=!1,s(u),i=t.pending,i===null?(u.next=t.pending=u,vh(t,u)):(u.next=i.next,t.pending=i.next=u)}}function vh(e,t){var i=t.action,s=t.payload,a=e.state;if(t.isTransition){var u=U.T,E={};U.T=E;try{var B=i(a,s),W=U.S;W!==null&&W(E,B),gh(e,t,B)}catch(ee){bl(e,t,ee)}finally{u!==null&&E.types!==null&&(u.types=E.types),U.T=u}}else try{u=i(a,s),gh(e,t,u)}catch(ee){bl(e,t,ee)}}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(Xe){t:{for(var a=Xe,u=Vt;a.nodeType!==8;){if(!u){a=null;break t}if(a=Qt(a.nextSibling),a===null){a=null;break t}}u=a.data,a=u==="F!"||u==="F"?a:null}if(a){Xe=Qt(a.nextSibling),s=a.data==="F!";break e}}Bi(s)}s=!1}s&&(t=i[0])}}return i=Ct(),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),u=Ll.bind(null,Ee,!1,s.queue),s=Ct(),a={state:t,dispatch:null,action:e,pending:null},s.queue=a,i=g_.bind(null,Ee,a,u,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(mi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Ar(t)}catch(E){throw E===Is?yn:E}else s=t;t=rt();var a=t.queue,u=a.dispatch;return i!==t.memoizedState&&(Ee.flags|=2048,Gs(9,{destroy:void 0},m_.bind(null,a,i),null)),[s,u,e]}function m_(e,t){e.action=t}function wh(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 Gs(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 xh(){return rt().memoizedState}function Bn(e,t,i,s){var a=Ct();Ee.flags|=e,a.memoizedState=Gs(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 u=a.memoizedState.inst;We!==null&&s!==null&&ul(s,We.memoizedState.deps)?a.memoizedState=Gs(t,u,i,s):(Ee.flags|=e,a.memoizedState=Gs(1|t,u,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(I(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(),fs){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[s,t],s}function wl(e,t,i){return i===void 0||(gi&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ou(),Ee.lanes|=e,Pi|=e,i)}function Oh(e,t,i,s){return kt(i,t)?i:Fs.current!==null?(e=wl(e,i,s),kt(e,t)||(lt=!0),e):(gi&42)===0||(gi&1073741824)!==0&&(Oe&261930)===0?(lt=!0,e.memoizedState=i):(e=Ou(),Ee.lanes|=e,Pi|=e,t)}function kh(e,t,i,s,a){var u=P.p;P.p=u!==0&&8>u?u:8;var E=U.T,B={};U.T=B,Ll(e,!1,t,i);try{var W=a(),ee=U.S;if(ee!==null&&ee(B,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ae=f_(W,s);Rr(e,t,ae,It(e))}else Rr(e,t,s,It(e))}catch(ce){Rr(e,t,{then:function(){},status:"rejected",reason:ce},It())}finally{P.p=u,E!==null&&B.types!==null&&(E.types=B.types),U.T=E}}function S_(){}function xl(e,t,i,s){if(e.tag!==5)throw Error(I(476));var a=zh(e).queue;kh(e,a,t,G,i===null?S_:function(){return Hh(e),i(s)})}function zh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:G},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hh(e){var t=zh(e);t.next===null&&(t=e.alternate.memoizedState),Rr(e,t.next.queue,{},It())}function El(){return mt(Gr)}function Nh(){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=zi(i);var s=Hi(t,e,i);s!==null&&(Mt(s,t,i),wr(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();Rr(e,t,i,s)}function Rr(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 u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var E=t.lastRenderedState,B=u(E,i);if(a.hasEagerState=!0,a.eagerState=B,kt(B,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(I(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){qs=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,$o(e,i)}}var Dr={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};Dr.useEffectEvent=tt;var Fh={readContext:mt,use:Tn,useCallback:function(e,t){return Ct().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=Ct();t=t===void 0?null:t;var s=e();if(fs){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Ct();if(i!==void 0){var a=i(t);if(fs){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=Ct();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=Ct();return wl(i,e,t)},useTransition:function(){var e=Sl(!1);return e=kh.bind(null,Ee,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Ee,a=Ct();if(ze){if(i===void 0)throw Error(I(407));i=i()}else{if(i=t(),Ye===null)throw Error(I(349));(Oe&127)!==0||ch(s,t,i)}a.memoizedState=i;var u={value:i,getSnapshot:t};return a.queue=u,Eh(uh.bind(null,s,u,e),[e]),s.flags|=2048,Gs(9,{destroy:void 0},hh.bind(null,s,u,i,t),null),i},useId:function(){var e=Ct(),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=Ct();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 Ct().memoizedState=b_.bind(null,Ee)},useEffectEvent:function(e){var t=Ct(),i={impl:e};return t.memoizedState=i,function(){if((Ue&2)!==0)throw Error(I(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:xh,useState:function(){return Mn(mi)},useDebugValue:Cl,useDeferredValue:function(e,t){var i=rt();return Oh(i,We.memoizedState,e,t)},useTransition:function(){var e=Mn(mi)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:Ar(e),t]},useSyncExternalStore:oh,useId:Nh,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:xh,useState:function(){return pl(mi)},useDebugValue:Cl,useDeferredValue:function(e,t){var i=rt();return We===null?wl(i,e,t):Oh(i,We.memoizedState,e,t)},useTransition:function(){var e=pl(mi)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:Ar(e),t]},useSyncExternalStore:oh,useId:Nh,useHostTransitionStatus:El,useFormState:wh,useActionState:wh,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:o({},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=zi(s);a.payload=t,i!=null&&(a.callback=i),t=Hi(e,a,s),t!==null&&(Mt(t,e,s),wr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=It(),a=zi(s);a.tag=1,a.payload=t,i!=null&&(a.callback=i),t=Hi(e,a,s),t!==null&&(Mt(t,e,s),wr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=It(),s=zi(i);s.tag=2,t!=null&&(s.callback=t),t=Hi(e,s,i),t!==null&&(Mt(t,e,i),wr(t,e,i))}};function Wh(e,t,i,s,a,u,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,u,E):t.prototype&&t.prototype.isPureReactComponent?!vr(i,s)||!vr(a,u):!0}function Gh(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 _s(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=o({},i));for(var a in e)i[a]===void 0&&(i[a]=e[a])}return i}function $h(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=zi(i),i.tag=3,i.payload={element:null},i.callback=function(){zn(e,t)},i}function Kh(e){return e=zi(e),e.tag=3,e}function Qh(e,t,i,s){var a=i.type.getDerivedStateFromError;if(typeof a=="function"){var u=s.value;e.payload=function(){return a(u)},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"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var B=s.stack;this.componentDidCatch(s.value,{componentStack:B!==null?B:""})})}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&&Ns(t,i,a,!0),i=Ht.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(I(435,i.tag))}return to(e,s,a),Yn(),!1}if(ze)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,s!==Va&&(e=Error(I(422),{cause:s}),pr($t(e,i)))):(s!==Va&&(t=Error(I(423),{cause:s}),pr($t(t,i))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,s=$t(s,i),a=Tl(e.stateNode,s,a),al(e,a),it!==4&&(it=2)),!1;var u=Error(I(520),{cause:s});if(u=$t(u,i),Nr===null?Nr=[u]:Nr.push(u),it!==4&&(it=2),t===null)return!0;s=$t(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,u=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Fi===null||!Fi.has(u))))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(I(461)),lt=!1;function pt(e,t,i,s){t.child=e===null?th(t,null,i,s):ds(t,e.child,i,s)}function Zh(e,t,i,s,a){i=i.render;var u=t.ref;if("ref"in s){var E={};for(var B in s)B!=="ref"&&(E[B]=s[B])}else E=s;return os(t),s=dl(e,t,i,E,u,a),B=fl(),e!==null&&!lt?(_l(e,t,a),pi(e,t,a)):(ze&&B&&Ya(t),t.flags|=1,pt(e,t,s,a),t.child)}function Jh(e,t,i,s,a){if(e===null){var u=i.type;return typeof u=="function"&&!Wa(u)&&u.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=u,eu(e,t,u,s,a)):(e=gn(i.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Ul(e,a)){var E=u.memoizedProps;if(i=i.compare,i=i!==null?i:vr,i(E,s)&&e.ref===t.ref)return pi(e,t,a)}return t.flags|=1,e=di(u,s),e.ref=t.ref,e.return=t,t.child=e}function eu(e,t,i,s,a){if(e!==null){var u=e.memoizedProps;if(vr(u,s)&&e.ref===t.ref)if(lt=!1,t.pendingProps=s=u,Ul(e,a))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,pi(e,t,a)}return Bl(e,t,i,s,a)}function tu(e,t,i,s){var a=s.children,u=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(u=u!==null?u.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&~u}else s=0,t.child=null;return iu(e,t,u,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bn(t,u!==null?u.cachePool:null),u!==null?rh(t,u):ol(),nh(t);else return s=t.lanes=536870912,iu(e,t,u!==null?u.baseLanes|i:i,i,s)}else u!==null?(bn(t,u.cachePool),rh(t,u),ji(),t.memoizedState=null):(e!==null&&bn(t,null),ol(),ji());return pt(e,t,a,i),t.child}function Tr(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 u=il();return u=u===null?null:{parent:nt._currentValue,pool:u},t.memoizedState={baseLanes:i,cachePool:u},e!==null&&bn(t,null),ol(),nh(t),e!==null&&Ns(e,t,s,!0),t.childLanes=a,null}function Hn(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 ds(t,e.child,null,i),e=Hn(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function w_(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=Hn(t,s),t.lanes=536870912,Tr(null,e);if(hl(t),(e=Xe)?(e=vd(e,Vt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:ri,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,gt=t,Xe=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return Hn(t,s)}var u=e.memoizedState;if(u!==null){var E=u.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(I(558));else if(lt||Ns(e,t,i,!1),a=(i&e.childLanes)!==0,lt||a){if(s=Ye,s!==null&&(E=Yo(s,i),E!==0&&E!==u.retryLane))throw u.retryLane=E,rs(e,E),Mt(s,e,E),Ml;Yn(),t=su(e,t,i)}else e=u.treeContext,Xe=Qt(E.nextSibling),gt=t,ze=!0,Mi=null,Vt=!1,e!==null&&qc(t,e),t=Hn(t,s),t.flags|=4096;return t}return e=di(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Nn(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(I(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Bl(e,t,i,s,a){return os(t),i=dl(e,t,i,s,void 0,a),s=fl(),e!==null&&!lt?(_l(e,t,a),pi(e,t,a)):(ze&&s&&Ya(t),t.flags|=1,pt(e,t,i,a),t.child)}function ru(e,t,i,s,a,u){return os(t),t.updateQueue=null,i=lh(t,s,i,a),ah(e),s=fl(),e!==null&&!lt?(_l(e,t,u),pi(e,t,u)):(ze&&s&&Ya(t),t.flags|=1,pt(e,t,i,u),t.child)}function nu(e,t,i,s,a){if(os(t),t.stateNode===null){var u=Os,E=i.contextType;typeof E=="object"&&E!==null&&(u=mt(E)),u=new i(s,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Dl,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=s,u.state=t.memoizedState,u.refs={},rl(t),E=i.contextType,u.context=typeof E=="object"&&E!==null?mt(E):Os,u.state=t.memoizedState,E=i.getDerivedStateFromProps,typeof E=="function"&&(Rl(t,i,E,s),u.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(E=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),E!==u.state&&Dl.enqueueReplaceState(u,u.state,null),Er(t,s,u,a),xr(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){u=t.stateNode;var B=t.memoizedProps,W=_s(i,B);u.props=W;var ee=u.context,ae=i.contextType;E=Os,typeof ae=="object"&&ae!==null&&(E=mt(ae));var ce=i.getDerivedStateFromProps;ae=typeof ce=="function"||typeof u.getSnapshotBeforeUpdate=="function",B=t.pendingProps!==B,ae||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(B||ee!==E)&&Gh(t,u,s,E),ki=!1;var te=t.memoizedState;u.state=te,Er(t,s,u,a),xr(),ee=t.memoizedState,B||te!==ee||ki?(typeof ce=="function"&&(Rl(t,i,ce,s),ee=t.memoizedState),(W=ki||Wh(t,i,W,s,te,ee,E))?(ae||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=ee),u.props=s,u.state=ee,u.context=E,s=W):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{u=t.stateNode,nl(e,t),E=t.memoizedProps,ae=_s(i,E),u.props=ae,ce=t.pendingProps,te=u.context,ee=i.contextType,W=Os,typeof ee=="object"&&ee!==null&&(W=mt(ee)),B=i.getDerivedStateFromProps,(ee=typeof B=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(E!==ce||te!==W)&&Gh(t,u,s,W),ki=!1,te=t.memoizedState,u.state=te,Er(t,s,u,a),xr();var re=t.memoizedState;E!==ce||te!==re||ki||e!==null&&e.dependencies!==null&&pn(e.dependencies)?(typeof B=="function"&&(Rl(t,i,B,s),re=t.memoizedState),(ae=ki||Wh(t,i,ae,s,te,re,W)||e!==null&&e.dependencies!==null&&pn(e.dependencies))?(ee||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(s,re,W),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(s,re,W)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||E===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||E===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=re),u.props=s,u.state=re,u.context=W,s=ae):(typeof u.componentDidUpdate!="function"||E===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||E===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),s=!1)}return u=s,Nn(e,t),s=(t.flags&128)!==0,u||s?(u=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&s?(t.child=ds(t,e.child,null,a),t.child=ds(t,null,i,a)):pt(e,t,i,a),t.memoizedState=u.state,e=t.child):e=pi(e,t,a),e}function au(e,t,i,s){return as(),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,u=(t.flags&128)!==0,E;if((E=u)||(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?Ni(t):ji(),(e=Xe)?(e=vd(e,Vt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:ri,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,gt=t,Xe=null)):e=null,e===null)throw Bi(t);return po(e)?t.lanes=32:t.lanes=536870912,null}var B=s.children;return s=s.fallback,a?(ji(),a=t.mode,B=jn({mode:"hidden",children:B},a),s=ns(s,a,i,null),B.return=t,s.return=t,B.sibling=s,t.child=B,s=t.child,s.memoizedState=kl(i),s.childLanes=zl(e,E,i),t.memoizedState=Ol,Tr(null,s)):(Ni(t),Hl(t,B))}var W=e.memoizedState;if(W!==null&&(B=W.dehydrated,B!==null)){if(u)t.flags&256?(Ni(t),t.flags&=-257,t=Nl(e,t,i)):t.memoizedState!==null?(ji(),t.child=e.child,t.flags|=128,t=null):(ji(),B=s.fallback,a=t.mode,s=jn({mode:"visible",children:s.children},a),B=ns(B,a,i,null),B.flags|=2,s.return=t,B.return=t,s.sibling=B,t.child=s,ds(t,e.child,null,i),s=t.child,s.memoizedState=kl(i),s.childLanes=zl(e,E,i),t.memoizedState=Ol,t=Tr(null,s));else if(Ni(t),po(B)){if(E=B.nextSibling&&B.nextSibling.dataset,E)var ee=E.dgst;E=ee,s=Error(I(419)),s.stack="",s.digest=E,pr({value:s,source:null,stack:null}),t=Nl(e,t,i)}else if(lt||Ns(e,t,i,!1),E=(i&e.childLanes)!==0,lt||E){if(E=Ye,E!==null&&(s=Yo(E,i),s!==0&&s!==W.retryLane))throw W.retryLane=s,rs(e,s),Mt(E,e,s),Ml;mo(B)||Yn(),t=Nl(e,t,i)}else mo(B)?(t.flags|=192,t.child=e.child,t=null):(e=W.treeContext,Xe=Qt(B.nextSibling),gt=t,ze=!0,Mi=null,Vt=!1,e!==null&&qc(t,e),t=Hl(t,s.children),t.flags|=4096);return t}return a?(ji(),B=s.fallback,a=t.mode,W=e.child,ee=W.sibling,s=di(W,{mode:"hidden",children:s.children}),s.subtreeFlags=W.subtreeFlags&65011712,ee!==null?B=di(ee,B):(B=ns(B,a,i,null),B.flags|=2),B.return=t,s.return=t,s.sibling=B,t.child=s,Tr(null,s),s=t.child,B=e.child.memoizedState,B===null?B=kl(i):(a=B.cachePool,a!==null?(W=nt._currentValue,a=a.parent!==W?{parent:W,pool:W}:a):a=Vc(),B={baseLanes:B.baseLanes|i,cachePool:a}),s.memoizedState=B,s.childLanes=zl(e,E,i),t.memoizedState=Ol,Tr(e.child,s)):(Ni(t),i=e.child,e=i.sibling,i=di(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 Hl(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 Nl(e,t,i){return ds(t,e.child,null,i),e=Hl(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,u){var E=e.memoizedState;E===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:a,treeForkCount:u}:(E.isBackwards=t,E.rendering=null,E.renderingStartTime=0,E.last=s,E.tail=i,E.tailMode=a,E.treeForkCount=u)}function cu(e,t,i){var s=t.pendingProps,a=s.revealOrder,u=s.tail;s=s.children;var E=st.current,B=(E&2)!==0;if(B?(E=E&1|2,t.flags|=128):E&=1,Y(st,E),pt(e,t,s,i),s=ze?mr:0,!B&&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,u,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,u,s);break;case"together":jl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function pi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Pi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Ns(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,i=di(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=di(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 x_(e,t,i){switch(t.tag){case 3:k(t,t.stateNode.containerInfo),Oi(t,nt,e.memoizedState.cache),as();break;case 27:case 5:ie(t);break;case 4:k(t,t.stateNode.containerInfo);break;case 10:Oi(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?(Ni(t),t.flags|=128,null):(i&t.child.childLanes)!==0?lu(e,t,i):(Ni(t),e=pi(e,t,i),e!==null?e.sibling:null);Ni(t);break;case 19:var a=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Ns(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),Y(st,st.current),s)break;return null;case 22:return t.lanes=0,tu(e,t,i,t.pendingProps);case 24:Oi(t,nt,e.memoizedState.cache)}return pi(e,t,i)}function hu(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!Ul(e,i)&&(t.flags&128)===0)return lt=!1,x_(e,t,i);lt=(e.flags&131072)!==0}else lt=!1,ze&&(t.flags&1048576)!==0&&Fc(t,mr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=hs(t.elementType),t.type=e,typeof e=="function")Wa(e)?(s=_s(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===x){t.tag=14,t=Jh(null,t,e,s,i);break e}}throw t=j(e)||e,Error(I(306,t,""))}}return t;case 0:return Bl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,a=_s(s,t.pendingProps),nu(e,t,s,a,i);case 3:e:{if(k(t,t.stateNode.containerInfo),e===null)throw Error(I(387));s=t.pendingProps;var u=t.memoizedState;a=u.element,nl(e,t),Er(t,s,null,i);var E=t.memoizedState;if(s=E.cache,Oi(t,nt,s),s!==u.cache&&Ja(t,[nt],i,!0),xr(),s=E.element,u.isDehydrated)if(u={element:s,isDehydrated:!1,cache:E.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=au(e,t,s,i);break e}else if(s!==a){a=$t(Error(I(424)),t),pr(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(Xe=Qt(e.firstChild),gt=t,ze=!0,Mi=null,Vt=!0,i=th(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(as(),s===a){t=pi(e,t,i);break e}pt(e,t,s,i)}t=t.child}return t;case 26:return Nn(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 ie(t),e===null&&ze&&(s=t.stateNode=pd(t.type,t.pendingProps,ue.current),gt=t,Vt=!0,a=Xe,$i(t.type)?(So=a,Xe=Qt(s.firstChild)):Xe=a),pt(e,t,t.pendingProps.children,i),Nn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((a=s=Xe)&&(s=ev(s,t.type,t.pendingProps,Vt),s!==null?(t.stateNode=s,gt=t,Xe=Qt(s.firstChild),Vt=!1,a=!0):a=!1),a||Bi(t)),ie(t),a=t.type,u=t.pendingProps,E=e!==null?e.memoizedProps:null,s=u.children,_o(a,u)?s=null:E!==null&&_o(a,E)&&(t.flags|=32),t.memoizedState!==null&&(a=dl(e,t,v_,null,null,i),Gr._currentValue=a),Nn(e,t),pt(e,t,s,i),t.child;case 6:return e===null&&ze&&((e=i=Xe)&&(i=tv(i,t.pendingProps,Vt),i!==null?(t.stateNode=i,gt=t,Xe=null,e=!0):e=!1),e||Bi(t)),null;case 13:return lu(e,t,i);case 4:return k(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ds(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,Oi(t,t.type,s.value),pt(e,t,s.children,i),t.child;case 9:return a=t.type._context,s=t.pendingProps.children,os(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 w_(e,t,i);case 22:return tu(e,t,i,t.pendingProps);case 24:return os(t),s=mt(nt),e===null?(a=il(),a===null&&(a=Ye,u=el(),a.pooledCache=u,u.refCount++,u!==null&&(a.pooledCacheLanes|=i),a=u),t.memoizedState={parent:s,cache:a},rl(t),Oi(t,nt,a)):((e.lanes&i)!==0&&(nl(e,t),Er(t,null,null,i),xr()),a=e.memoizedState,u=t.memoizedState,a.parent!==s?(a={parent:s,cache:s},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Oi(t,nt,s)):(s=u.cache,Oi(t,nt,s),s!==a.cache&&Ja(t,[nt],i,!0))),pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(I(156,t.tag))}function Si(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(Nu())e.flags|=8192;else throw us=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(Nu())e.flags|=8192;else throw us=Cn,sl}function Un(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wo():536870912,e.lanes|=t,Vs|=t)}function Mr(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 Ve(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 Ve(t),null;case 1:return Ve(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),vi(nt),se(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Hs(t)?Si(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ka())),Ve(t),null;case 26:var a=t.type,u=t.memoizedState;return e===null?(Si(t),u!==null?(Ve(t),uu(t,u)):(Ve(t),Il(t,a,null,s,i))):u?u!==e.memoizedState?(Si(t),Ve(t),uu(t,u)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Si(t),Ve(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&&Si(t);else{if(!s){if(t.stateNode===null)throw Error(I(166));return Ve(t),null}e=Z.current,Hs(t)?Wc(t):(e=pd(a,s,i),t.stateNode=e,Si(t))}return Ve(t),null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(!s){if(t.stateNode===null)throw Error(I(166));return Ve(t),null}if(u=Z.current,Hs(t))Wc(t);else{var E=ea(ue.current);switch(u){case 1:u=E.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:u=E.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":u=E.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":u=E.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":u=E.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof s.is=="string"?E.createElement("select",{is:s.is}):E.createElement("select"),s.multiple?u.multiple=!0:s.size&&(u.size=s.size);break;default:u=typeof s.is=="string"?E.createElement(a,{is:s.is}):E.createElement(a)}}u[vt]=t,u[Et]=s;e:for(E=t.child;E!==null;){if(E.tag===5||E.tag===6)u.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=u;e:switch(St(u,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&&Si(t)}}return Ve(t),Il(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(e=ue.current,Hs(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||Bi(t,!0)}else e=ea(e).createTextNode(s),e[vt]=t,t.stateNode=e}return Ve(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Hs(t),i!==null){if(e===null){if(!s)throw Error(I(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(557));e[vt]=t}else as(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else i=Ka(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(I(558))}return Ve(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(I(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(I(317));a[vt]=t}else as(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),a=!1}else a=Ka(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(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),u=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==a&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Un(t,t.updateQueue),Ve(t),null);case 4:return se(),e===null&&oo(t.stateNode.containerInfo),Ve(t),null;case 10:return vi(t.type),Ve(t),null;case 19:if(O(st),s=t.memoizedState,s===null)return Ve(t),null;if(a=(t.flags&128)!==0,u=s.rendering,u===null)if(a)Mr(s,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Ln(e),u!==null){for(t.flags|=128,Mr(s,!1),e=u.updateQueue,t.updateQueue=e,Un(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Uc(i,e),i=i.sibling;return Y(st,st.current&1|2),ze&&fi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ce()>Wn&&(t.flags|=128,a=!0,Mr(s,!1),t.lanes=4194304)}else{if(!a)if(e=Ln(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Un(t,e),Mr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!u.alternate&&!ze)return Ve(t),null}else 2*Ce()-s.renderingStartTime>Wn&&i!==536870912&&(t.flags|=128,a=!0,Mr(s,!1),t.lanes=4194304);s.isBackwards?(u.sibling=t.child,t.child=u):(e=s.last,e!==null?e.sibling=u:t.child=u,s.last=u)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ce(),e.sibling=null,i=st.current,Y(st,a?i&1|2:i&1),ze&&fi(t,s.treeForkCount),e):(Ve(t),null);case 22:case 23:return Nt(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&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(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&&O(cs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),vi(nt),Ve(t),null;case 25:return null;case 30:return null}throw Error(I(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 vi(nt),se(),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(Nt(t),t.alternate===null)throw Error(I(340));as()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));as()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(st),null;case 4:return se(),null;case 10:return vi(t.type),null;case 22:case 23:return Nt(t),cl(),e!==null&&O(cs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return vi(nt),null;case 25:return null;default:return null}}function du(e,t){switch(Xa(t),t.tag){case 3:vi(nt),se();break;case 26:case 27:case 5:_e(t);break;case 4:se();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:O(st);break;case 10:vi(t.type);break;case 22:case 23:Nt(t),cl(),e!==null&&O(cs);break;case 24:vi(nt)}}function Br(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 u=i.create,E=i.inst;s=u(),E.destroy=s}i=i.next}while(i!==a)}}catch(B){Pe(t,t.return,B)}}function Ui(e,t,i){try{var s=t.updateQueue,a=s!==null?s.lastEffect:null;if(a!==null){var u=a.next;s=u;do{if((s.tag&e)===e){var E=s.inst,B=E.destroy;if(B!==void 0){E.destroy=void 0,a=t;var W=i,ee=B;try{ee()}catch(ae){Pe(a,W,ae)}}}s=s.next}while(s!==u)}}catch(ae){Pe(t,t.return,ae)}}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=_s(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Pe(e,t,s)}}function Or(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&&$i(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&&$i(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=hi));else if(s!==4&&(s===27&&$i(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&&$i(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(u){Pe(e,e.return,u)}}var bi=!1,ot=!1,Wl=!1,pu=typeof WeakSet=="function"?WeakSet:Set,_t=null;function A_(e,t){if(e=e.containerInfo,uo=la,e=Tc(e),Na(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,u=s.focusNode;s=s.focusOffset;try{i.nodeType,u.nodeType}catch{i=null;break e}var E=0,B=-1,W=-1,ee=0,ae=0,ce=e,te=null;t:for(;;){for(var re;ce!==i||a!==0&&ce.nodeType!==3||(B=E+a),ce!==u||s!==0&&ce.nodeType!==3||(W=E+s),ce.nodeType===3&&(E+=ce.nodeValue.length),(re=ce.firstChild)!==null;)te=ce,ce=re;for(;;){if(ce===e)break t;if(te===i&&++ee===a&&(B=E),te===u&&++ae===s&&(W=E),(re=ce.nextSibling)!==null)break;ce=te,te=ce.parentNode}ce=re}i=B===-1||W===-1?null:{start:B,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,u=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&&u!==null){e=void 0,i=t,a=u.memoizedProps,u=u.memoizedState,s=i.stateNode;try{var ge=_s(i.type,a);e=s.getSnapshotBeforeUpdate(ge,u),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(I(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:Ci(e,i),s&4&&Br(5,i);break;case 1:if(Ci(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(E){Pe(i,i.return,E)}else{var a=_s(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&&Or(i,i.return);break;case 3:if(Ci(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:Ci(e,i),t===null&&s&4&&vu(i),s&512&&Or(i,i.return);break;case 12:Ci(e,i);break;case 31:Ci(e,i),s&4&&Cu(e,i);break;case 13:Ci(e,i),s&4&&wu(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=H_.bind(null,i),iv(e,i))));break;case 22:if(s=i.memoizedState!==null||bi,!s){t=t!==null&&t.memoizedState!==null||ot,a=bi;var u=ot;bi=s,(ot=t)&&!u?wi(e,i,(i.subtreeFlags&8772)!==0):Ci(e,i),bi=a,ot=u}break;case 30:break;default:Ci(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 yi(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:ot||ai(i,t),yi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ot||ai(i,t);var s=Je,a=At;$i(i.type)&&(Je=i.stateNode,At=!1),yi(e,t,i),Fr(i.stateNode),Je=s,At=a;break;case 5:ot||ai(i,t);case 6:if(s=Je,a=At,Je=null,yi(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(u){Pe(i,t,u)}else try{Je.removeChild(i.stateNode)}catch(u){Pe(i,t,u)}break;case 18:Je!==null&&(At?(e=Je,fd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),sr(e)):fd(Je,i.stateNode));break;case 4:s=Je,a=At,Je=i.stateNode.containerInfo,At=!0,yi(e,t,i),Je=s,At=a;break;case 0:case 11:case 14:case 15:Ui(2,i,t),ot||Ui(4,i,t),yi(e,t,i);break;case 1:ot||(ai(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&_u(i,t,s)),yi(e,t,i);break;case 21:yi(e,t,i);break;case 22:ot=(s=ot)||i.memoizedState!==null,yi(e,t,i),ot=s;break;default:yi(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{sr(e)}catch(i){Pe(t,t.return,i)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{sr(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(I(435,e.tag))}}function Pn(e,t){var i=R_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var a=N_.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],u=e,E=t,B=E;e:for(;B!==null;){switch(B.tag){case 27:if($i(B.type)){Je=B.stateNode,At=!1;break e}break;case 5:Je=B.stateNode,At=!1;break e;case 3:case 4:Je=B.stateNode.containerInfo,At=!0;break e}B=B.return}if(Je===null)throw Error(I(160));yu(u,E,a),Je=null,At=!1,u=a.alternate,u!==null&&(u.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xu(t,e),t=t.sibling}var ti=null;function xu(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&&(Ui(3,e,e.return),Br(3,e),Ui(5,e,e.return));break;case 1:Rt(t,e),Dt(e),s&512&&(ot||i===null||ai(i,i.return)),s&64&&bi&&(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&&(ot||i===null||ai(i,i.return)),s&4){var u=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":u=a.getElementsByTagName("title")[0],(!u||u[ar]||u[vt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=a.createElement(s),a.head.insertBefore(u,a.querySelector("head > title"))),St(u,s,i),u[vt]=e,ft(u),s=u;break e;case"link":var E=xd("link","href",a).get(s+(i.href||""));if(E){for(var B=0;B<E.length;B++)if(u=E[B],u.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&u.getAttribute("rel")===(i.rel==null?null:i.rel)&&u.getAttribute("title")===(i.title==null?null:i.title)&&u.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){E.splice(B,1);break t}}u=a.createElement(s),St(u,s,i),a.head.appendChild(u);break;case"meta":if(E=xd("meta","content",a).get(s+(i.content||""))){for(B=0;B<E.length;B++)if(u=E[B],u.getAttribute("content")===(i.content==null?null:""+i.content)&&u.getAttribute("name")===(i.name==null?null:i.name)&&u.getAttribute("property")===(i.property==null?null:i.property)&&u.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&u.getAttribute("charset")===(i.charSet==null?null:i.charSet)){E.splice(B,1);break t}}u=a.createElement(s),St(u,s,i),a.head.appendChild(u);break;default:throw Error(I(468,s))}u[vt]=e,ft(u),s=u}e.stateNode=s}else Ed(a,e.type,e.stateNode);else e.stateNode=wd(a,s,e.memoizedProps);else u!==s?(u===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):u.count--,s===null?Ed(a,e.type,e.stateNode):wd(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&&(ot||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&&(ot||i===null||ai(i,i.return)),e.flags&32){a=e.stateNode;try{Ls(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(I(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{sr(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,ee=bi,ae=ot;if(bi=ee||a,ot=ae||W,Rt(t,e),ot=ae,bi=ee,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(i===null||W||bi||ot||vs(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){W=i=t;try{if(u=W.stateNode,a)E=u.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{B=W.stateNode;var ce=W.memoizedProps.style,te=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;B.style.display=te==null||typeof te=="boolean"?"":(""+te).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 re=W.stateNode;a?_d(re,!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(I(160));switch(i.tag){case 27:var a=i.stateNode,u=Fl(e);In(e,u,a);break;case 5:var E=i.stateNode;i.flags&32&&(Ls(E,""),i.flags&=-33);var B=Fl(e);In(e,B,E);break;case 3:case 4:var W=i.stateNode.containerInfo,ee=Fl(e);ql(e,ee,W);break;default:throw Error(I(161))}}catch(ae){Pe(e,e.return,ae)}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 Ci(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Su(e,t.alternate,t),t=t.sibling}function vs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ui(4,t,t.return),vs(t);break;case 1:ai(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&_u(t,t.return,i),vs(t);break;case 27:Fr(t.stateNode);case 26:case 5:ai(t,t.return),vs(t);break;case 22:t.memoizedState===null&&vs(t);break;case 30:vs(t);break;default:vs(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,u=t,E=u.flags;switch(u.tag){case 0:case 11:case 15:wi(a,u,i),Br(4,u);break;case 1:if(wi(a,u,i),s=u,a=s.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(ee){Pe(s,s.return,ee)}if(s=u,a=s.updateQueue,a!==null){var B=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],B)}catch(ee){Pe(s,s.return,ee)}}i&&E&64&&fu(u),Or(u,u.return);break;case 27:mu(u);case 26:case 5:wi(a,u,i),i&&s===null&&E&4&&vu(u),Or(u,u.return);break;case 12:wi(a,u,i);break;case 31:wi(a,u,i),i&&E&4&&Cu(a,u);break;case 13:wi(a,u,i),i&&E&4&&wu(a,u);break;case 22:u.memoizedState===null&&wi(a,u,i),Or(u,u.return);break;case 30:break;default:wi(a,u,i)}t=t.sibling}}function Gl(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&&Sr(i))}function $l(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Sr(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&&Br(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&&Sr(e)));break;case 12:if(a&2048){ii(e,t,i,s),e=t.stateNode;try{var u=t.memoizedProps,E=u.id,B=u.onPostCommit;typeof B=="function"&&B(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:u=t.stateNode,E=t.alternate,t.memoizedState!==null?u._visibility&2?ii(e,t,i,s):kr(e,t):u._visibility&2?ii(e,t,i,s):(u._visibility|=2,$s(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Gl(E,t);break;case 24:ii(e,t,i,s),a&2048&&$l(t.alternate,t);break;default:ii(e,t,i,s)}}function $s(e,t,i,s,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,E=t,B=i,W=s,ee=E.flags;switch(E.tag){case 0:case 11:case 15:$s(u,E,B,W,a),Br(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?$s(u,E,B,W,a):kr(u,E):(ae._visibility|=2,$s(u,E,B,W,a)),a&&ee&2048&&Gl(E.alternate,E);break;case 24:$s(u,E,B,W,a),a&&ee&2048&&$l(E.alternate,E);break;default:$s(u,E,B,W,a)}t=t.sibling}}function kr(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:kr(i,s),a&2048&&Gl(s.alternate,s);break;case 24:kr(i,s),a&2048&&$l(s.alternate,s);break;default:kr(i,s)}t=t.sibling}}var zr=8192;function Ys(e,t,i){if(e.subtreeFlags&zr)for(e=e.child;e!==null;)Au(e,t,i),e=e.sibling}function Au(e,t,i){switch(e.tag){case 26:Ys(e,t,i),e.flags&zr&&e.memoizedState!==null&&_v(i,ti,e.memoizedState,e.memoizedProps);break;case 5:Ys(e,t,i);break;case 3:case 4:var s=ti;ti=ta(e.stateNode.containerInfo),Ys(e,t,i),ti=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=zr,zr=16777216,Ys(e,t,i),zr=s):Ys(e,t,i));break;default:Ys(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 Hr(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:Hr(e),e.flags&2048&&Ui(9,e,e.return);break;case 3:Hr(e);break;case 12:Hr(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)):Hr(e);break;default:Hr(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:Ui(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:Ui(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:Sr(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,u=s.return;if(bu(s),s===i){_t=null;break e}if(a!==null){a.return=u,_t=a;break e}_t=u}}}var D_={getCacheForType:function(e){var t=mt(nt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return mt(nt).controller.signal}},T_=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ye=null,Te=null,Oe=0,Ie=0,jt=null,Ii=!1,Xs=!1,Yl=!1,xi=0,it=0,Pi=0,gs=0,Xl=0,Ut=0,Vs=0,Nr=null,Tt=null,Vl=!1,qn=0,Mu=0,Wn=1/0,Gn=null,Fi=null,ht=0,qi=null,Ks=null,Ei=0,Kl=0,Ql=null,Bu=null,jr=0,Zl=null;function It(){return(Ue&2)!==0&&Oe!==0?Oe&-Oe:U.T!==null?ro():Xo()}function Ou(){if(Ut===0)if((Oe&536870912)===0||ze){var e=Zi;Zi<<=1,(Zi&3932160)===0&&(Zi=262144),Ut=e}else Ut=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Ut}function Mt(e,t,i){(e===Ye&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(Qs(e,0),Wi(e,Oe,Ut,!1)),nr(e,i),((Ue&2)===0||e!==Ye)&&(e===Ye&&((Ue&2)===0&&(gs|=i),it===4&&Wi(e,Oe,Ut,!1)),li(e))}function ku(e,t,i){if((Ue&6)!==0)throw Error(I(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||rr(e,t),a=s?O_(e,t):eo(e,t,!0),u=s;do{if(a===0){Xs&&!s&&Wi(e,t,0,!1);break}else{if(i=e.current.alternate,u&&!M_(i)){a=eo(e,t,!1),u=!1;continue}if(a===2){if(u=t,e.errorRecoveryDisabledLanes&u)var E=0;else E=e.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){t=E;e:{var B=e;a=Nr;var W=B.current.memoizedState.isDehydrated;if(W&&(Qs(B,E).flags|=256),E=eo(B,E,!1),E!==2){if(Yl&&!W){B.errorRecoveryDisabledLanes|=u,gs|=u,a=4;break e}u=Tt,Tt=a,u!==null&&(Tt===null?Tt=u:Tt.push.apply(Tt,u))}a=E}if(u=!1,a!==2)continue}}if(a===1){Qs(e,0),Wi(e,t,0,!0);break}e:{switch(s=e,u=a,u){case 0:case 1:throw Error(I(345));case 4:if((t&4194048)!==t)break;case 6:Wi(s,t,Ut,!Ii);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(I(329))}if((t&62914560)===t&&(a=qn+300-Ce(),10<a)){if(Wi(s,t,Ut,!Ii),en(s,0,!0)!==0)break e;Ei=t,s.timeoutHandle=ud(zu.bind(null,s,i,Tt,Gn,Vl,t,Ut,gs,Vs,Ii,u,"Throttled",-0,0),a);break e}zu(s,i,Tt,Gn,Vl,t,Ut,gs,Vs,Ii,u,null,-0,0)}}break}while(!0);li(e)}function zu(e,t,i,s,a,u,E,B,W,ee,ae,ce,te,re){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:hi},Au(t,u,ce);var ge=(u&62914560)===u?qn-Ce():(u&4194048)===u?Mu-Ce():0;if(ge=vv(ce,ge),ge!==null){Ei=u,e.cancelPendingCommit=ge(qu.bind(null,e,t,u,i,s,a,E,B,W,ae,ce,null,te,re)),Wi(e,u,E,!ee);return}}qu(e,t,u,i,s,a,E,B,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],u=a.getSnapshot;a=a.value;try{if(!kt(u(),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 Wi(e,t,i,s){t&=~Xl,t&=~gs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var a=t;0<a;){var u=31-bt(a),E=1<<u;s[u]=-1,a&=~E}i!==0&&Go(e,i,t)}function $n(){return(Ue&6)===0?(Ur(0),!1):!0}function Jl(){if(Te!==null){if(Ie===0)var e=Te.return;else e=Te,_i=ls=null,vl(e),Ps=null,yr=0,e=Te;for(;e!==null;)du(e.alternate,e),e=e.return;Te=null}}function Qs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Q_(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ei=0,Jl(),Ye=e,Te=i=di(e.current,null),Oe=t,Ie=0,jt=null,Ii=!1,Xs=rr(e,t),Yl=!1,Vs=Ut=Xl=gs=Pi=it=0,Tt=Nr=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),u=1<<a;t|=e[a],s&=~u}return xi=t,fn(),i}function Hu(e,t){Ee=null,U.H=Dr,t===Is||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,$t(t,e.current)))}function Nu(){var e=Ht.current;return e===null?!0:(Oe&4194048)===Oe?Kt===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===Kt:!1}function ju(){var e=U.H;return U.H=Dr,e===null?Dr:e}function Uu(){var e=U.A;return U.A=D_,e}function Yn(){it=4,Ii||(Oe&4194048)!==Oe&&Ht.current!==null||(Xs=!0),(Pi&134217727)===0&&(gs&134217727)===0||Ye===null||Wi(Ye,Oe,Ut,!1)}function eo(e,t,i){var s=Ue;Ue|=2;var a=ju(),u=Uu();(Ye!==e||Oe!==t)&&(Gn=null,Qs(e,t)),t=!1;var E=it;e:do try{if(Ie!==0&&Te!==null){var B=Te,W=jt;switch(Ie){case 8:Jl(),E=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var ee=Ie;if(Ie=0,jt=null,Zs(e,B,W,ee),i&&Xs){E=0;break e}break;default:ee=Ie,Ie=0,jt=null,Zs(e,B,W,ee)}}B_(),E=it;break}catch(ae){Hu(e,ae)}while(!0);return t&&e.shellSuspendCounter++,_i=ls=null,Ue=s,U.H=a,U.A=u,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?(Gn=null,Wn=Ce()+500,Qs(e,t)):Xs=rr(e,t);e:do try{if(Ie!==0&&Te!==null){t=Te;var u=jt;t:switch(Ie){case 1:Ie=0,jt=null,Zs(e,t,u,1);break;case 2:case 9:if(Kc(u)){Ie=0,jt=null,Pu(t);break}t=function(){Ie!==2&&Ie!==9||Ye!==e||(Ie=7),li(e)},u.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:Kc(u)?(Ie=0,jt=null,Pu(t)):(Ie=0,jt=null,Zs(e,t,u,7));break;case 5:var E=null;switch(Te.tag){case 26:E=Te.memoizedState;case 5:case 27:var B=Te;if(E?Ld(E):B.stateNode.complete){Ie=0,jt=null;var W=B.sibling;if(W!==null)Te=W;else{var ee=B.return;ee!==null?(Te=ee,Xn(ee)):Te=null}break t}}Ie=0,jt=null,Zs(e,t,u,5);break;case 6:Ie=0,jt=null,Zs(e,t,u,6);break;case 8:Jl(),it=6;break e;default:throw Error(I(462))}}k_();break}catch(ae){Hu(e,ae)}while(!0);return _i=ls=null,U.H=s,U.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,xi);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,xi),t=hu(i,t,xi)}e.memoizedProps=e.pendingProps,t===null?Xn(e):Te=t}function Zs(e,t,i,s){_i=ls=null,vl(t),Ps=null,yr=0;var a=t.return;try{if(C_(e,a,t,i,Oe)){it=1,zn(e,$t(i,e.current)),Te=null;return}}catch(u){if(a!==null)throw Te=a,u;it=1,zn(e,$t(i,e.current)),Te=null;return}t.flags&32768?(ze||s===1?e=!0:Xs||(Oe&536870912)!==0?e=!1:(Ii=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ht.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,Ii);return}e=t.return;var i=E_(t.alternate,t,xi);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,u,E,B,W){e.cancelPendingCommit=null;do Vn();while(ht!==0);if((Ue&6)!==0)throw Error(I(327));if(t!==null){if(t===e.current)throw Error(I(177));if(u=t.lanes|t.childLanes,u|=Fa,ff(e,i,u,E,B,W),e===Ye&&(Te=Ye=null,Oe=0),Ks=t,qi=e,Ei=i,Kl=u,Ql=a,Bu=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,j_(ct,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,a=P.p,P.p=2,E=Ue,Ue|=4;try{A_(e,t,i)}finally{Ue=E,P.p=a,U.T=s}}ht=1,Wu(),Gu(),$u()}}function Wu(){if(ht===1){ht=0;var e=qi,t=Ks,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var s=P.p;P.p=2;var a=Ue;Ue|=4;try{xu(t,e);var u=fo,E=Tc(e.containerInfo),B=u.focusedElem,W=u.selectionRange;if(E!==B&&B&&B.ownerDocument&&Dc(B.ownerDocument.documentElement,B)){if(W!==null&&Na(B)){var ee=W.start,ae=W.end;if(ae===void 0&&(ae=ee),"selectionStart"in B)B.selectionStart=ee,B.selectionEnd=Math.min(ae,B.value.length);else{var ce=B.ownerDocument||document,te=ce&&ce.defaultView||window;if(te.getSelection){var re=te.getSelection(),ge=B.textContent.length,ye=Math.min(W.start,ge),$e=W.end===void 0?ye:Math.min(W.end,ge);!re.extend&&ye>$e&&(E=$e,$e=ye,ye=E);var K=Rc(B,ye),$=Rc(B,$e);if(K&&$&&(re.rangeCount!==1||re.anchorNode!==K.node||re.anchorOffset!==K.offset||re.focusNode!==$.node||re.focusOffset!==$.offset)){var J=ce.createRange();J.setStart(K.node,K.offset),re.removeAllRanges(),ye>$e?(re.addRange(J),re.extend($.node,$.offset)):(J.setEnd($.node,$.offset),re.addRange(J))}}}}for(ce=[],re=B;re=re.parentNode;)re.nodeType===1&&ce.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<ce.length;B++){var oe=ce[B];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}la=!!uo,fo=uo=null}finally{Ue=a,P.p=s,U.T=i}}e.current=t,ht=2}}function Gu(){if(ht===2){ht=0;var e=qi,t=Ks,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var s=P.p;P.p=2;var a=Ue;Ue|=4;try{Su(e,t.alternate,t)}finally{Ue=a,P.p=s,U.T=i}}ht=3}}function $u(){if(ht===4||ht===3){ht=0,ve();var e=qi,t=Ks,i=Ei,s=Bu;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ht=5:(ht=0,Ks=qi=null,Yu(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Fi=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=U.T,a=P.p,P.p=2,U.T=null;try{for(var u=e.onRecoverableError,E=0;E<s.length;E++){var B=s[E];u(B.value,{componentStack:B.stack})}}finally{U.T=t,P.p=a}}(Ei&3)!==0&&Vn(),li(e),a=e.pendingLanes,(i&261930)!==0&&(a&42)!==0?e===Zl?jr++:(jr=0,Zl=e):jr=0,Ur(0)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Sr(t)))}function Vn(){return Wu(),Gu(),$u(),Xu()}function Xu(){if(ht!==5)return!1;var e=qi,t=Kl;Kl=0;var i=pa(Ei),s=U.T,a=P.p;try{P.p=32>i?32:i,U.T=null,i=Ql,Ql=null;var u=qi,E=Ei;if(ht=0,Ks=qi=null,Ei=0,(Ue&6)!==0)throw Error(I(331));var B=Ue;if(Ue|=4,Du(u.current),Lu(u,u.current,E,i),Ue=B,Ur(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Jt,u)}catch{}return!0}finally{P.p=a,U.T=s,Yu(e,t)}}function Vu(e,t,i){t=$t(i,t),t=Tl(e.stateNode,t,2),e=Hi(e,t,2),e!==null&&(nr(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"&&(Fi===null||!Fi.has(s))){e=$t(i,e),i=Kh(2),s=Hi(t,i,2),s!==null&&(Qh(i,s,t,e),nr(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&&Qs(e,0):Xl|=i,Vs===Oe&&(Vs=0)),li(e)}function Ku(e,t){t===0&&(t=Wo()),e=rs(e,t),e!==null&&(nr(e,t),li(e))}function H_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Ku(e,i)}function N_(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(I(314))}s!==null&&s.delete(t),Ku(e,i)}function j_(e,t){return Be(e,t)}var Kn=null,Js=null,io=!1,Qn=!1,so=!1,Gi=0;function li(e){e!==Js&&e.next===null&&(Js===null?Kn=Js=e:Js=Js.next=e),Qn=!0,io||(io=!0,I_())}function Ur(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 u=0;else{var E=s.suspendedLanes,B=s.pingedLanes;u=(1<<31-bt(42|e)+1)-1,u&=a&~(E&~B),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(i=!0,ed(s,u))}else u=Oe,u=en(s,s===Ye?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(u&3)===0||rr(s,u)||(i=!0,ed(s,u));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,u=Zu(s,t);u===0?(s.next=null,i===null?Kn=a:i.next=a,a===null&&(Js=i)):(i=s,(e!==0||(u&3)!==0)&&(Qn=!0)),s=a}ht!==0&&ht!==5||Ur(e),Gi!==0&&(Gi=0)}function Zu(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var E=31-bt(u),B=1<<E,W=a[E];W===-1?((B&i)===0||(B&s)!==0)&&(a[E]=df(B,t)):W<=t&&(e.expiredLanes|=B),u&=~B}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||rr(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=ct;break;case 268435456:i=et;break;default:i=ct}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(ht!==0&&ht!==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=js;e===0&&(e=Ai,Ai<<=1,(Ai&261888)===0&&(Ai=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 u=td((a[Et]||null).action),E=s.submitter;E&&(t=(t=E[Et]||null)?td(t.formAction):E.getAttribute("formAction"),t!==null&&(u=t,E=null));var B=new cn("action","action",null,s,a);e.push({event:B,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gi!==0){var W=E?id(a,E):new FormData(a);xl(i,{pending:!0,data:W,method:a.method,action:u},null,W)}}else typeof u=="function"&&(B.preventDefault(),W=E?id(a,E):new FormData(a),xl(i,{pending:!0,data:W,method:a.method,action:u},u,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(Hc,"onTransitionEnd"),xs("onMouseEnter",["mouseout","mouseover"]),xs("onMouseLeave",["mouseout","mouseover"]),xs("onPointerEnter",["pointerout","pointerover"]),xs("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="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(Ir));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 u=void 0;if(t)for(var E=s.length-1;0<=E;E--){var B=s[E],W=B.instance,ee=B.currentTarget;if(B=B.listener,W!==u&&a.isPropagationStopped())break e;u=B,a.currentTarget=ee;try{u(a)}catch(ae){dn(ae)}a.currentTarget=null,u=W}else for(E=0;E<s.length;E++){if(B=s[E],W=B.instance,ee=B.currentTarget,B=B.listener,W!==u&&a.isPropagationStopped())break e;u=B,a.currentTarget=ee;try{u(a)}catch(ae){dn(ae)}a.currentTarget=null,u=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=xo}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 u=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 B=s.stateNode.containerInfo;if(B===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(;B!==null;){if(E=ys(B),E===null)return;if(W=E.tag,W===5||W===6||W===26||W===27){s=u=E;continue e}B=B.parentNode}}s=s.return}cc(function(){var ee=u,ae=La(i),ce=[];e:{var te=Nc.get(e);if(te!==void 0){var re=cn,ge=e;switch(e){case"keypress":if(ln(i)===0)break e;case"keydown":case"keyup":re=Nf;break;case"focusin":ge="focus",re=Ba;break;case"focusout":ge="blur",re=Ba;break;case"beforeblur":case"afterblur":re=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":re=dc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=Ef;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=If;break;case Oc:case kc:case zc:re=Rf;break;case Hc:re=Ff;break;case"scroll":case"scrollend":re=wf;break;case"wheel":re=Wf;break;case"copy":case"cut":case"paste":re=Tf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=_c;break;case"toggle":case"beforetoggle":re=$f}var ye=(t&4)!==0,$e=!ye&&(e==="scroll"||e==="scrollend"),K=ye?te!==null?te+"Capture":null:te;ye=[];for(var $=ee,J;$!==null;){var oe=$;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||K===null||(oe=or($,K),oe!=null&&ye.push(Pr($,oe,J))),$e)break;$=$.return}0<ye.length&&(te=new re(te,ge,null,i,ae),ce.push({event:te,listeners:ye}))}}if((t&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",re=e==="mouseout"||e==="pointerout",te&&i!==Ea&&(ge=i.relatedTarget||i.fromElement)&&(ys(ge)||ge[bs]))break e;if((re||te)&&(te=ae.window===ae?ae:(te=ae.ownerDocument)?te.defaultView||te.parentWindow:window,re?(ge=i.relatedTarget||i.toElement,re=ee,ge=ge?ys(ge):null,ge!==null&&($e=le(ge),ye=ge.tag,ge!==$e||ye!==5&&ye!==27&&ye!==6)&&(ge=null)):(re=null,ge=ee),re!==ge)){if(ye=dc,oe="onMouseLeave",K="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ye=_c,oe="onPointerLeave",K="onPointerEnter",$="pointer"),$e=re==null?te:lr(re),J=ge==null?te:lr(ge),te=new ye(oe,$+"leave",re,i,ae),te.target=$e,te.relatedTarget=J,oe=null,ys(ae)===ee&&(ye=new ye(K,$+"enter",ge,i,ae),ye.target=J,ye.relatedTarget=$e,oe=ye),$e=oe,re&&ge)t:{for(ye=G_,K=re,$=ge,J=0,oe=K;oe;oe=ye(oe))J++;oe=0;for(var Se=$;Se;Se=ye(Se))oe++;for(;0<J-oe;)K=ye(K),J--;for(;0<oe-J;)$=ye($),oe--;for(;J--;){if(K===$||$!==null&&K===$.alternate){ye=K;break t}K=ye(K),$=ye($)}ye=null}else ye=null;re!==null&&nd(ce,te,re,ye,!1),ge!==null&&$e!==null&&nd(ce,$e,ge,ye,!0)}}e:{if(te=ee?lr(ee):window,re=te.nodeName&&te.nodeName.toLowerCase(),re==="select"||re==="input"&&te.type==="file")var Ne=Cc;else if(bc(te))if(wc)Ne=i_;else{Ne=e_;var me=Jf}else re=te.nodeName,!re||re.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&xa(ee.elementType)&&(Ne=Cc):Ne=t_;if(Ne&&(Ne=Ne(e,ee))){yc(ce,Ne,i,ae);break e}me&&me(e,te,ee),e==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&wa(te,"number",te.value)}switch(me=ee?lr(ee):window,e){case"focusin":(bc(me)||me.contentEditable==="true")&&(Ts=me,ja=ee,gr=null);break;case"focusout":gr=ja=Ts=null;break;case"mousedown":Ua=!0;break;case"contextmenu":case"mouseup":case"dragend":Ua=!1,Mc(ce,i,ae);break;case"selectionchange":if(r_)break;case"keydown":case"keyup":Mc(ce,i,ae)}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 Ds?pc(e,i)&&(ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ke="onCompositionStart");ke&&(vc&&i.locale!=="ko"&&(Ds||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Ds&&(Le=hc()):(Di=ae,Da="value"in Di?Di.value:Di.textContent,Ds=!0)),me=Jn(ee,ke),0<me.length&&(ke=new fc(ke,e,null,i,ae),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(ee,"onBeforeInput"),0<ke.length&&(me=new fc("onBeforeInput","beforeinput",null,i,ae),ce.push({event:me,listeners:ke}),me.data=Le)),P_(ce,e,ee,i,ae)}sd(ce,t)})}function Pr(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,u=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||u===null||(a=or(e,i),a!=null&&s.unshift(Pr(e,a,u)),a=or(e,t),a!=null&&s.push(Pr(e,a,u))),e.tag===3)return s;e=e.return}return[]}function G_(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 u=t._reactName,E=[];i!==null&&i!==s;){var B=i,W=B.alternate,ee=B.stateNode;if(B=B.tag,W!==null&&W===s)break;B!==5&&B!==26&&B!==27||ee===null||(W=ee,a?(ee=or(i,u),ee!=null&&E.unshift(Pr(i,ee,W))):a||(ee=or(i,u),ee!=null&&E.push(Pr(i,ee,W)))),i=i.return}E.length!==0&&e.push({event:t,listeners:E})}var $_=/\r\n?/g,Y_=/\u0000|\uFFFD/g;function ad(e){return(typeof e=="string"?e:""+e).replace($_,`
49
+ `).replace(Y_,"")}function ld(e,t){return t=ad(t),ad(e)===t}function Ge(e,t,i,s,a,u){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Ls(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Ls(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,u);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 u=="function"&&(i==="formAction"?(t!=="input"&&Ge(e,t,"name",a.name,a,null),Ge(e,t,"formEncType",a.formEncType,a,null),Ge(e,t,"formMethod",a.formMethod,a,null),Ge(e,t,"formTarget",a.formTarget,a,null)):(Ge(e,t,"encType",a.encType,a,null),Ge(e,t,"method",a.method,a,null),Ge(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=hi);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(I(61));if(i=s.__html,i!=null){if(a.children!=null)throw Error(I(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":ci(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ci(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ci(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ci(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ci(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ci(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ci(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ci(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ci(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,u){switch(i){case"style":lc(e,s,u);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(I(61));if(i=s.__html,i!=null){if(a.children!=null)throw Error(I(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Ls(e,s):(typeof s=="number"||typeof s=="bigint")&&Ls(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=hi);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),u=e[Et]||null,u=u!=null?u[i]:null,typeof u=="function"&&e.removeEventListener(t,u,a),typeof s=="function")){typeof u!="function"&&u!==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,u;for(u in i)if(i.hasOwnProperty(u)){var E=i[u];if(E!=null)switch(u){case"src":s=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(I(137,t));default:Ge(e,t,u,E,i,null)}}a&&Ge(e,t,"srcSet",i.srcSet,i,null),s&&Ge(e,t,"src",i.src,i,null);return;case"input":Me("invalid",e);var B=u=E=a=null,W=null,ee=null;for(s in i)if(i.hasOwnProperty(s)){var ae=i[s];if(ae!=null)switch(s){case"name":a=ae;break;case"type":E=ae;break;case"checked":W=ae;break;case"defaultChecked":ee=ae;break;case"value":u=ae;break;case"defaultValue":B=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(I(137,t));break;default:Ge(e,t,s,ae,i,null)}}sc(e,u,B,W,ee,E,a,!1);return;case"select":Me("invalid",e),s=E=u=null;for(a in i)if(i.hasOwnProperty(a)&&(B=i[a],B!=null))switch(a){case"value":u=B;break;case"defaultValue":E=B;break;case"multiple":s=B;default:Ge(e,t,a,B,i,null)}t=u,i=E,e.multiple=!!s,t!=null?Es(e,!!s,t,!1):i!=null&&Es(e,!!s,i,!0);return;case"textarea":Me("invalid",e),u=a=s=null;for(E in i)if(i.hasOwnProperty(E)&&(B=i[E],B!=null))switch(E){case"value":s=B;break;case"defaultValue":a=B;break;case"children":u=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(I(91));break;default:Ge(e,t,E,B,i,null)}nc(e,s,a,u);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:Ge(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<Ir.length;s++)Me(Ir[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(ee in i)if(i.hasOwnProperty(ee)&&(s=i[ee],s!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(I(137,t));default:Ge(e,t,ee,s,i,null)}return;default:if(xa(t)){for(ae in i)i.hasOwnProperty(ae)&&(s=i[ae],s!==void 0&&ho(e,t,ae,s,i,void 0));return}}for(B in i)i.hasOwnProperty(B)&&(s=i[B],s!=null&&Ge(e,t,B,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,u=null,E=null,B=null,W=null,ee=null,ae=null;for(re in i){var ce=i[re];if(i.hasOwnProperty(re)&&ce!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":W=ce;default:s.hasOwnProperty(re)||Ge(e,t,re,null,s,ce)}}for(var te in s){var re=s[te];if(ce=i[te],s.hasOwnProperty(te)&&(re!=null||ce!=null))switch(te){case"type":u=re;break;case"name":a=re;break;case"checked":ee=re;break;case"defaultChecked":ae=re;break;case"value":E=re;break;case"defaultValue":B=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(I(137,t));break;default:re!==ce&&Ge(e,t,te,re,s,ce)}}Ca(e,E,B,W,ee,ae,u,a);return;case"select":re=E=B=te=null;for(u in i)if(W=i[u],i.hasOwnProperty(u)&&W!=null)switch(u){case"value":break;case"multiple":re=W;default:s.hasOwnProperty(u)||Ge(e,t,u,null,s,W)}for(a in s)if(u=s[a],W=i[a],s.hasOwnProperty(a)&&(u!=null||W!=null))switch(a){case"value":te=u;break;case"defaultValue":B=u;break;case"multiple":E=u;default:u!==W&&Ge(e,t,a,u,s,W)}t=B,i=E,s=re,te!=null?Es(e,!!i,te,!1):!!s!=!!i&&(t!=null?Es(e,!!i,t,!0):Es(e,!!i,i?[]:"",!1));return;case"textarea":re=te=null;for(B in i)if(a=i[B],i.hasOwnProperty(B)&&a!=null&&!s.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:Ge(e,t,B,null,s,a)}for(E in s)if(a=s[E],u=i[E],s.hasOwnProperty(E)&&(a!=null||u!=null))switch(E){case"value":te=a;break;case"defaultValue":re=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(I(91));break;default:a!==u&&Ge(e,t,E,a,s,u)}rc(e,te,re);return;case"option":for(var ge in i)if(te=i[ge],i.hasOwnProperty(ge)&&te!=null&&!s.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:Ge(e,t,ge,null,s,te)}for(W in s)if(te=s[W],re=i[W],s.hasOwnProperty(W)&&te!==re&&(te!=null||re!=null))switch(W){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Ge(e,t,W,te,s,re)}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)te=i[ye],i.hasOwnProperty(ye)&&te!=null&&!s.hasOwnProperty(ye)&&Ge(e,t,ye,null,s,te);for(ee in s)if(te=s[ee],re=i[ee],s.hasOwnProperty(ee)&&te!==re&&(te!=null||re!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(I(137,t));break;default:Ge(e,t,ee,te,s,re)}return;default:if(xa(t)){for(var $e in i)te=i[$e],i.hasOwnProperty($e)&&te!==void 0&&!s.hasOwnProperty($e)&&ho(e,t,$e,void 0,s,te);for(ae in s)te=s[ae],re=i[ae],!s.hasOwnProperty(ae)||te===re||te===void 0&&re===void 0||ho(e,t,ae,te,s,re);return}}for(var K in i)te=i[K],i.hasOwnProperty(K)&&te!=null&&!s.hasOwnProperty(K)&&Ge(e,t,K,null,s,te);for(ce in s)te=s[ce],re=i[ce],!s.hasOwnProperty(ce)||te===re||te==null&&re==null||Ge(e,t,ce,te,s,re)}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],u=a.transferSize,E=a.initiatorType,B=a.duration;if(u&&B&&od(E)){for(E=0,B=a.responseEnd,s+=1;s<i.length;s++){var W=i[s],ee=W.startTime;if(ee>B)break;var ae=W.transferSize,ce=W.initiatorType;ae&&od(ce)&&(W=W.responseEnd,E+=ae*(W<B?1:(B-ee)/(W-ee)))}if(--s,t+=8*(u+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 $i(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),sr(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Fr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Fr(i);for(var u=i.firstChild;u;){var E=u.nextSibling,B=u.nodeName;u[ar]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&u.rel.toLowerCase()==="stylesheet"||i.removeChild(u),u=E}}else i==="body"&&Fr(e.ownerDocument.body);i=a}while(i);sr(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[ar])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==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(u=e.getAttribute("src"),(u!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===u)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(I(452));return e;case"head":if(e=t.head,!e)throw Error(I(453));return e;case"body":if(e=t.body,!e)throw Error(I(454));return e;default:throw Error(I(451))}}function Fr(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 Li=P.d;P.d={f:sv,r:rv,D:nv,C:av,L:lv,m:ov,X:hv,S:cv,M:uv};function sv(){var e=Li.f(),t=$n();return e||t}function rv(e){var t=Cs(e);t!==null&&t.tag===5&&t.type==="form"?Hh(t):Li.r(e)}var er=typeof document>"u"?null:document;function bd(e,t,i){var s=er;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){Li.D(e),bd("dns-prefetch",e,null)}function av(e,t){Li.C(e,t),bd("preconnect",e,t)}function lv(e,t,i){Li.L(e,t,i);var s=er;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 u=a;switch(t){case"style":u=tr(e);break;case"script":u=ir(e)}Zt.has(u)||(e=o({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Zt.set(u,e),s.querySelector(a)!==null||t==="style"&&s.querySelector(qr(u))||t==="script"&&s.querySelector(Wr(u))||(t=s.createElement("link"),St(t,"link",e),ft(t),s.head.appendChild(t)))}}function ov(e,t){Li.m(e,t);var i=er;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Wt(s)+'"][href="'+Wt(e)+'"]',u=a;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ir(e)}if(!Zt.has(u)&&(e=o({rel:"modulepreload",href:e},t),Zt.set(u,e),i.querySelector(a)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Wr(u)))return}s=i.createElement("link"),St(s,"link",e),ft(s),i.head.appendChild(s)}}}function cv(e,t,i){Li.S(e,t,i);var s=er;if(s&&e){var a=ws(s).hoistableStyles,u=tr(e);t=t||"default";var E=a.get(u);if(!E){var B={loading:0,preload:null};if(E=s.querySelector(qr(u)))B.loading=5;else{e=o({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Zt.get(u))&&bo(e,i);var W=E=s.createElement("link");ft(W),St(W,"link",e),W._p=new Promise(function(ee,ae){W.onload=ee,W.onerror=ae}),W.addEventListener("load",function(){B.loading|=1}),W.addEventListener("error",function(){B.loading|=2}),B.loading|=4,ia(E,t,s)}E={type:"stylesheet",instance:E,count:1,state:B},a.set(u,E)}}}function hv(e,t){Li.X(e,t);var i=er;if(i&&e){var s=ws(i).hoistableScripts,a=ir(e),u=s.get(a);u||(u=i.querySelector(Wr(a)),u||(e=o({src:e,async:!0},t),(t=Zt.get(a))&&yo(e,t),u=i.createElement("script"),ft(u),St(u,"link",e),i.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(a,u))}}function uv(e,t){Li.M(e,t);var i=er;if(i&&e){var s=ws(i).hoistableScripts,a=ir(e),u=s.get(a);u||(u=i.querySelector(Wr(a)),u||(e=o({src:e,async:!0,type:"module"},t),(t=Zt.get(a))&&yo(e,t),u=i.createElement("script"),ft(u),St(u,"link",e),i.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(a,u))}}function yd(e,t,i,s){var a=(a=ue.current)?ta(a):null;if(!a)throw Error(I(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=tr(i.href),i=ws(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=tr(i.href);var u=ws(a).hoistableStyles,E=u.get(e);if(E||(a=a.ownerDocument||a,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,E),(u=a.querySelector(qr(e)))&&!u._p&&(E.instance=u,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),u||dv(a,e,i,E.state))),t&&s===null)throw Error(I(528,""));return E}if(t&&s!==null)throw Error(I(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ir(i),i=ws(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(I(444,e))}}function tr(e){return'href="'+Wt(e)+'"'}function qr(e){return'link[rel="stylesheet"]['+e+"]"}function Cd(e){return o({},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 ir(e){return'[src="'+Wt(e)+'"]'}function Wr(e){return"script[async]"+e}function wd(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=o({},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=tr(i.href);var u=e.querySelector(qr(a));if(u)return t.state.loading|=4,t.instance=u,ft(u),u;s=Cd(i),(a=Zt.get(a))&&bo(s,a),u=(e.ownerDocument||e).createElement("link"),ft(u);var E=u;return E._p=new Promise(function(B,W){E.onload=B,E.onerror=W}),St(u,"link",s),t.state.loading|=4,ia(u,i.precedence,e),t.instance=u;case"script":return u=ir(i.src),(a=e.querySelector(Wr(u)))?(t.instance=a,ft(a),a):(s=i,(a=Zt.get(u))&&(s=o({},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(I(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,u=a,E=0;E<s.length;E++){var B=s[E];if(B.dataset.precedence===t)u=B;else if(u!==a)break}u?u.parentNode.insertBefore(e,u.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 xd(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 u=i[a];if(!(u[ar]||u[vt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var E=u.getAttribute(t)||"";E=e+E;var B=s.get(E);B?B.push(u):s.set(E,[u])}}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=tr(s.href),u=t.querySelector(qr(a));if(u){t=u._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=u,ft(u);return}u=t.ownerDocument||t,s=Cd(s),(a=Zt.get(a))&&bo(s,a),u=u.createElement("link"),ft(u);var E=u;E._p=new Promise(function(B,W){E.onload=B,E.onerror=W}),St(u,"link",s),i.instance=u}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 u=e.unsuspend;e.unsuspend=null,u()}},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 u=e.unsuspend;e.unsuspend=null,u()}},(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]"),u=0;u<a.length;u++){var E=a[u];(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"),u=i.get(E)||s,u===s&&i.set(null,a),i.set(E,a),this.count++,s=ra.bind(this),a.addEventListener("load",s),a.addEventListener("error",s),u?u.parentNode.insertBefore(a,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Gr={$$typeof:h,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function mv(e,t,i,s,a,u,E,B,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=u,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Ad(e,t,i,s,a,u,E,B,W,ee,ae,ce){return e=new mv(e,t,i,E,W,ee,ae,ce,B),t=1,u===!0&&(t|=24),u=zt(3,null,null,t),e.current=u,u.stateNode=e,t=el(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:s,isDehydrated:i,cache:t},rl(u),e}function Rd(e){return e?(e=Os,e):Os}function Dd(e,t,i,s,a,u){a=Rd(a),s.context===null?s.context=a:s.pendingContext=a,s=zi(t),s.payload={element:i},u=u===void 0?null:u,u!==null&&(s.callback=u),i=Hi(e,s,t),i!==null&&(Mt(i,e,t),wr(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 wo(e,t){Td(e,t),(e=e.alternate)&&Td(e,t)}function Md(e){if(e.tag===13||e.tag===31){var t=rs(e,67108864);t!==null&&Mt(t,e,67108864),wo(e,67108864)}}function Bd(e){if(e.tag===13||e.tag===31){var t=It();t=ma(t);var i=rs(e,t);i!==null&&Mt(i,e,t),wo(e,t)}}var la=!0;function pv(e,t,i,s){var a=U.T;U.T=null;var u=P.p;try{P.p=2,xo(e,t,i,s)}finally{P.p=u,U.T=a}}function Sv(e,t,i,s){var a=U.T;U.T=null;var u=P.p;try{P.p=8,xo(e,t,i,s)}finally{P.p=u,U.T=a}}function xo(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 u=Cs(a);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var E=oi(u.pendingLanes);if(E!==0){var B=u;for(B.pendingLanes|=2,B.entangledLanes|=2;E;){var W=1<<31-bt(E);B.entanglements[1]|=W,E&=~W}li(u),(Ue&6)===0&&(Wn=Ce()+500,Ur(0))}}break;case 31:case 13:B=rs(u,2),B!==null&&Mt(B,u,2),$n(),wo(u,2)}if(u=Eo(s),u===null&&co(e,t,s,oa,i),u===a)break;a=u}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=ys(e),e!==null){var t=le(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=q(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 ct:case xt:return 32;case et:return 268435456;default:return 32}default:return 32}}var Ao=!1,Yi=null,Xi=null,Vi=null,$r=new Map,Yr=new Map,Ki=[],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":Yi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":$r.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yr.delete(t.pointerId)}}function Xr(e,t,i,s,a,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:u,targetContainers:[a]},t!==null&&(t=Cs(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 Yi=Xr(Yi,e,t,i,s,a),!0;case"dragenter":return Xi=Xr(Xi,e,t,i,s,a),!0;case"mouseover":return Vi=Xr(Vi,e,t,i,s,a),!0;case"pointerover":var u=a.pointerId;return $r.set(u,Xr($r.get(u)||null,e,t,i,s,a)),!0;case"gotpointercapture":return u=a.pointerId,Yr.set(u,Xr(Yr.get(u)||null,e,t,i,s,a)),!0}return!1}function zd(e){var t=ys(e.target);if(t!==null){var i=le(t);if(i!==null){if(t=i.tag,t===13){if(t=q(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=Cs(i),t!==null&&Md(t),e.blockedOn=i,!1;t.shift()}return!0}function Hd(e,t,i){ca(e)&&i.delete(t)}function Cv(){Ao=!1,Yi!==null&&ca(Yi)&&(Yi=null),Xi!==null&&ca(Xi)&&(Xi=null),Vi!==null&&ca(Vi)&&(Vi=null),$r.forEach(Hd),Yr.forEach(Hd)}function ha(e,t){e.blockedOn===t&&(e.blockedOn=null,Ao||(Ao=!0,N.unstable_scheduleCallback(N.unstable_NormalPriority,Cv)))}var ua=null;function Nd(e){ua!==e&&(ua=e,N.unstable_scheduleCallback(N.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 u=Cs(i);u!==null&&(e.splice(t,3),t-=3,xl(u,{pending:!0,data:a,method:i.method,action:s},s,a))}}))}function sr(e){function t(W){return ha(W,e)}Yi!==null&&ha(Yi,e),Xi!==null&&ha(Xi,e),Vi!==null&&ha(Vi,e),$r.forEach(t),Yr.forEach(t);for(var i=0;i<Ki.length;i++){var s=Ki[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ki.length&&(i=Ki[0],i.blockedOn===null);)zd(i),i.blockedOn===null&&Ki.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var a=i[s],u=i[s+1],E=a[Et]||null;if(typeof u=="function")E||Nd(i);else if(E){var B=null;if(u&&u.hasAttribute("formAction")){if(a=u,E=u[Et]||null)B=E.formAction;else if(Lo(a)!==null)continue}else B=E.action;typeof B=="function"?i[s+1]=B:(i.splice(s,3),s-=3),Nd(i)}}}function jd(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.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 u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.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(I(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),$n(),t[bs]=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<Ki.length&&t!==0&&t<Ki[i].priority;i++);Ki.splice(i,0,e),i===0&&zd(e)}};var Ud=Q.version;if(Ud!=="19.2.6")throw Error(I(527,Ud,"19.2.6"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=_(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var wv={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:U,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(wv),dt=fa}catch{}}return Kr.createRoot=function(e,t){if(!ne(e))throw Error(I(299));var i=!1,s="",a=$h,u=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&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(E=t.onRecoverableError)),t=Ad(e,1,!1,null,null,i,s,null,a,u,E,jd),e[bs]=t.current,oo(e),new Ro(t)},Kr.hydrateRoot=function(e,t,i){if(!ne(e))throw Error(I(299));var s=!1,a="",u=$h,E=Yh,B=Xh,W=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(a=i.identifierPrefix),i.onUncaughtError!==void 0&&(u=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(B=i.onRecoverableError),i.formState!==void 0&&(W=i.formState)),t=Ad(e,1,!0,t,i??null,s,a,W,u,E,B,jd),t.context=Rd(null),i=t.current,s=It(),s=ma(s),a=zi(s),a.callback=null,Hi(i,a,s),i=s,t.current.lanes=i,nr(t,i),li(t),e[bs]=t.current,oo(e),new da(t)},Kr.version="19.2.6",Kr}var Vd;function Ov(){if(Vd)return Mo.exports;Vd=1;function N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N)}catch(Q){console.error(Q)}}return N(),Mo.exports=Bv(),Mo.exports}var kv=Ov();function Zr(N,Q){const[V,I]=fe.useState(null),[ne,le]=fe.useState(null),q=fe.useRef(N);q.current=N;const n=fe.useRef(async()=>{try{const f=await q.current();I(f),le(null)}catch(f){le(f)}});return fe.useEffect(()=>{let f=!1;const _=async()=>{f||await n.current()};_();const v=setInterval(_,Q);return()=>{f=!0,clearInterval(v)}},[Q]),{data:V,error:ne,refresh:()=>void n.current()}}const zo="tono:route";function ms(){const[N,Q]=fe.useState(window.location.pathname);return fe.useEffect(()=>{const I=()=>Q(window.location.pathname);return window.addEventListener("popstate",I),window.addEventListener(zo,I),()=>{window.removeEventListener("popstate",I),window.removeEventListener(zo,I)}},[]),{path:N,navigate:I=>{I!==window.location.pathname&&(window.history.pushState({},"",I),window.dispatchEvent(new Event(zo)))}}}async function Qr(N){const Q=await fetch(N);if(!Q.ok)throw new Error(`${N}: ${Q.status}`);return Q.json()}const ut={health:()=>Qr("/api/health"),config:()=>Qr("/api/config"),tasks:()=>Qr("/api/tasks").then(N=>N.tasks),task:N=>Qr(`/api/tasks/${N}`).then(Q=>Q.task),sessions:()=>Qr("/api/sessions").then(N=>N.sessions),killSession:async N=>{const Q=await fetch(`/api/sessions/${encodeURIComponent(N)}`,{method:"DELETE"});if(!Q.ok)throw new Error(`kill: ${Q.status}`)},cleanupTask:async N=>{const Q=await fetch(`/api/tasks/${N}/cleanup`,{method:"POST"});if(!Q.ok){const V=await Q.text();throw new Error(`cleanup: ${Q.status} ${V}`)}},rawConfig:async()=>{const N=await fetch("/api/config/raw");if(!N.ok)throw new Error(`config/raw: ${N.status}`);return N.json()},saveRawConfig:async N=>{const Q=await fetch("/api/config/raw",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:N})}),V=await Q.json().catch(()=>({}));if(!Q.ok){const I=V.error??`${Q.status}`;throw new Error(I)}return V},startTask:async N=>{const Q=await fetch("/api/tasks",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(N)}),V=await Q.json().catch(()=>({}));if(!Q.ok)throw new Error(V.error??`${Q.status}`);return V.task},retryTask:async N=>{const Q=await fetch(`/api/tasks/${N}/retry`,{method:"POST"}),V=await Q.json().catch(()=>({}));if(!Q.ok)throw new Error(V.error??`${Q.status}`);return V.task},markDone:async N=>{const Q=await fetch(`/api/tasks/${N}/done`,{method:"POST"}),V=await Q.json().catch(()=>({}));if(!Q.ok)throw new Error(V.error??`${Q.status}`);return V.task},newShell:async N=>{const Q=await fetch("/api/sessions/shell",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(N?{cwd:N}:{})}),V=await Q.json().catch(()=>({}));if(!Q.ok)throw new Error(V.error??`${Q.status}`);return V}};function zv(N){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${N}`}const Hv={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 Jr({tone:N="neutral",children:Q}){return H.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${Hv[N]}`,children:Q})}function Nv(){const{path:N,navigate:Q}=ms(),{data:V}=Zr(ut.health,5e3),I=(le,q)=>{const n=le==="/"?N==="/":N.startsWith(le);return H.jsx("button",{onClick:()=>Q(le),className:`px-3 py-1.5 text-sm rounded-md transition ${n?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,children:q})},ne=V==null?void 0:V.poller.some(le=>le.lastError&&(!le.lastSuccessAt||Date.parse(le.lastSuccessAt)<Date.now()-5*6e4));return H.jsx("header",{className:"border-b border-zinc-800 bg-zinc-950/80 backdrop-blur sticky top-0 z-10",children:H.jsxs("div",{className:"mx-auto max-w-6xl flex items-center gap-4 px-6 py-3",children:[H.jsxs("button",{onClick:()=>Q("/"),className:"text-lg font-semibold tracking-tight text-zinc-100 hover:text-white",children:["tono",H.jsx("span",{children:".sh"})]}),H.jsxs("nav",{className:"flex items-center gap-1",children:[I("/","Dashboard"),I("/config","Config")]}),H.jsx("div",{className:"ml-auto flex items-center gap-3 text-xs text-zinc-400",children:V?H.jsxs(H.Fragment,{children:[H.jsxs(Jr,{tone:"neutral",children:["agents: ",Object.keys(V.agents).length]}),H.jsxs(Jr,{tone:ne?"red":"green",children:["repos: ",V.reposWatched]})]}):H.jsx("span",{className:"text-zinc-600",children:"connecting…"})})]})})}function Ke({variant:N="default",className:Q="",...V}){const I="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",ne={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"}[N];return H.jsx("button",{className:`${I} ${ne} ${Q}`,...V})}function jv({config:N,onClose:Q}){var r;const{navigate:V}=ms(),I=fe.useMemo(()=>Object.keys(N.agents),[N.agents]),[ne,le]=fe.useState(((r=N.repos[0])==null?void 0:r.slug)??""),[q,n]=fe.useState(""),[f,_]=fe.useState(""),[v,o]=fe.useState(!1),[g,b]=fe.useState(null),y=fe.useMemo(()=>{const c=N.repos.find(l=>l.slug===ne);return!c||!c.agents||c.agents.length===0?I:c.agents.filter(l=>I.includes(l))},[N.repos,ne,I]);fe.useEffect(()=>{y.length!==0&&(y.includes(f)||_(y[0]))},[y,f]),fe.useEffect(()=>{const c=l=>{l.key==="Escape"&&Q()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[Q]);const d=async c=>{c.preventDefault();const l=Number(q);if(!Number.isInteger(l)||l<=0){b("issue number must be a positive integer");return}if(!f){b("pick an agent");return}o(!0),b(null);try{const h=await ut.startTask({repoSlug:ne,issueNumber:l,agent:f});Q(),V(`/tasks/${h.id}`)}catch(h){b(h.message)}finally{o(!1)}};return N.repos.length===0?H.jsx(Kd,{onClose:Q,children:H.jsxs("div",{className:"text-sm text-zinc-300",children:["No repos configured yet. Add one on the"," ",H.jsx("button",{className:"text-orange-400 hover:underline",onClick:()=>{Q(),V("/config")},children:"Config page"})," ","first."]})}):H.jsx(Kd,{onClose:Q,children:H.jsxs("form",{onSubmit:d,className:"space-y-3",children:[H.jsxs("div",{children:[H.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Repo"}),H.jsx("select",{value:ne,onChange:c=>le(c.target.value),className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm",children:N.repos.map(c=>H.jsx("option",{value:c.slug,children:c.slug},c.slug))})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Agent"}),H.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=>H.jsx("option",{value:c,children:c},c))}),y.length===0&&H.jsx("p",{className:"mt-1 text-xs text-red-300",children:"no agents enabled on this repo"})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Issue number"}),H.jsx("input",{type:"number",min:1,value:q,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"}),H.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["tono will fetch the issue body via ",H.jsx("code",{children:"gh"})," and queue an implement task."]})]}),g&&H.jsx("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:g}),H.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[H.jsx(Ke,{type:"button",variant:"ghost",onClick:Q,children:"Cancel"}),H.jsx(Ke,{type:"submit",disabled:v||!q||y.length===0,children:v?"Queuing…":"Start session"})]})]})})}function Kd({children:N,onClose:Q}){return H.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onMouseDown:V=>{V.target===V.currentTarget&&Q()},children:H.jsxs("div",{className:"w-full max-w-md rounded-lg border border-zinc-800 bg-zinc-950 p-5 shadow-2xl",children:[H.jsx("h2",{className:"text-base font-semibold text-zinc-100 mb-3",children:"Start a session"}),N]})})}const lf={queued:"queued",running:"running",completed:"completed",pr_open:"PR open",pr_closed:"PR closed",merged:"merged",cleaned:"cleaned",failed:"failed"},Uv={queued:"neutral",running:"blue",completed:"green",pr_open:"amber",pr_closed:"red",merged:"orange",cleaned:"neutral",failed:"red"};function Ho(N){if(!N)return"—";const Q=Date.now()-Date.parse(N);return Q<6e4?`${Math.round(Q/1e3)}s ago`:Q<36e5?`${Math.round(Q/6e4)}m ago`:Q<864e5?`${Math.round(Q/36e5)}h ago`:`${Math.round(Q/864e5)}d ago`}function Iv(N){return N.status==="queued"?`queued ${Ho(N.createdAt)}`:N.status==="running"?`started ${Ho(N.startedAt)}`:`${Ho(N.completedAt??N.startedAt??N.createdAt)}`}function Pv({task:N}){const{navigate:Q}=ms();return H.jsxs("button",{onClick:()=>Q(`/tasks/${N.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:[H.jsxs("div",{className:"flex items-start justify-between gap-2",children:[H.jsxs("span",{className:"text-[11px] font-mono text-zinc-500",children:["#",N.id]}),H.jsx(Jr,{tone:Uv[N.status],children:lf[N.status]})]}),H.jsx("div",{className:"mt-1 text-sm font-medium text-zinc-100 line-clamp-2",children:N.issueTitle}),H.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-zinc-500",children:[H.jsxs("span",{className:"font-mono truncate max-w-[160px]",children:[N.repoSlug,"#",N.issueNumber]}),H.jsx("span",{children:"·"}),H.jsx("span",{children:Iv(N)}),N.prUrl&&H.jsxs(H.Fragment,{children:[H.jsx("span",{children:"·"}),H.jsx("a",{href:N.prUrl,target:"_blank",rel:"noreferrer",onClick:V=>V.stopPropagation(),className:"text-orange-400 hover:underline",children:"PR"})]})]})]})}const Fv=[{id:"queued",title:"Queued",match:N=>N.status==="queued",sort:(N,Q)=>Date.parse(N.createdAt)-Date.parse(Q.createdAt),emptyMessage:"Empty."},{id:"running",title:"Running",match:N=>N.status==="running",sort:(N,Q)=>Date.parse(Q.startedAt??Q.createdAt)-Date.parse(N.startedAt??N.createdAt),emptyMessage:"No active sessions."},{id:"review",title:"Awaiting review",hint:"PR open on GitHub",match:N=>N.status==="pr_open",sort:(N,Q)=>Date.parse(Q.completedAt??Q.createdAt)-Date.parse(N.completedAt??N.createdAt),emptyMessage:"No PRs awaiting review."},{id:"done",title:"Done",hint:"merged · completed · closed",match:N=>N.status==="merged"||N.status==="pr_closed"||N.status==="completed"||N.status==="cleaned",sort:(N,Q)=>Date.parse(Q.completedAt??Q.createdAt)-Date.parse(N.completedAt??N.createdAt),limit:12,emptyMessage:"Nothing finished yet."},{id:"failed",title:"Failed",hint:"needs attention",match:N=>N.status==="failed",sort:(N,Q)=>Date.parse(Q.completedAt??Q.createdAt)-Date.parse(N.completedAt??N.createdAt),limit:12,emptyMessage:"—"}];function qv({column:N,tasks:Q}){const V=Q.filter(N.match);N.sort&&V.sort(N.sort);const I=N.limit?V.slice(0,N.limit):V,ne=V.length-I.length;return H.jsxs("div",{className:"flex min-w-[260px] flex-1 flex-col rounded-lg border border-zinc-800 bg-zinc-950/40",children:[H.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-3 py-2",children:[H.jsxs("div",{className:"flex items-center gap-2",children:[H.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-zinc-300",children:N.title}),H.jsx("span",{className:"text-[11px] text-zinc-500",children:V.length})]}),N.hint&&H.jsx("span",{className:"text-[10px] text-zinc-600 truncate",children:N.hint})]}),H.jsxs("div",{className:"flex-1 space-y-2 p-2",children:[I.length===0?H.jsx("div",{className:"rounded-md border border-dashed border-zinc-800 px-3 py-6 text-center text-xs text-zinc-600",children:N.emptyMessage??"—"}):I.map(le=>H.jsx(Pv,{task:le},le.id)),ne>0&&H.jsxs("div",{className:"text-center text-[11px] text-zinc-500",children:["+",ne," more"]})]})]})}function Wv(){const{data:N}=Zr(ut.tasks,3e3),{data:Q}=Zr(ut.sessions,3e3),{data:V}=Zr(ut.health,5e3),{data:I}=Zr(ut.config,3e4),{navigate:ne}=ms(),[le,q]=fe.useState(!1),[n,f]=fe.useState(!1),_=(Q??[]).filter(b=>b.kind==="shell"&&b.status==="running"),v=fe.useMemo(()=>N??[],[N]),o=((V==null?void 0:V.poller)??[]).filter(b=>b.lastError),g=I!==null&&I.repos.length===0;return H.jsxs("div",{className:"mx-auto max-w-[1400px] px-6 py-6 space-y-5",children:[H.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[H.jsx("h1",{className:"text-base font-semibold text-zinc-200",children:"Dashboard"}),H.jsxs("div",{className:"flex items-center gap-2",children:[H.jsx(Ke,{variant:"ghost",disabled:n,onClick:async()=>{f(!0);try{const{sessionId:b}=await ut.newShell();ne(`/shells/${encodeURIComponent(b)}`)}catch(b){alert(b.message)}finally{f(!1)}},children:n?"Opening…":"+ New terminal"}),H.jsx(Ke,{onClick:()=>q(!0),children:"+ Start session"})]})]}),g&&H.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:[H.jsx("span",{children:"No repos configured. Add one to start receiving labeled-issue triggers."}),H.jsx(Ke,{variant:"ghost",onClick:()=>ne("/config"),children:"Edit config"})]}),o.length>0&&H.jsxs("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-4 py-3 text-sm text-red-300",children:[H.jsx("div",{className:"font-medium",children:"GitHub poller errors"}),H.jsx("ul",{className:"mt-1 space-y-0.5 text-xs font-mono",children:o.map(b=>H.jsxs("li",{children:[b.repo,": ",b.lastError]},b.repo))})]}),_.length>0&&H.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[H.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs uppercase tracking-wide text-zinc-400",children:["Shells ",H.jsxs("span",{className:"text-[11px] text-zinc-500 normal-case tracking-normal",children:[_.length," live"]})]}),H.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:_.map(b=>H.jsxs("button",{onClick:()=>ne(`/shells/${encodeURIComponent(b.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:[H.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-blue-400 animate-pulse"}),H.jsxs("span",{className:"text-[11px] text-zinc-500 font-mono",children:["pid ",b.pid]}),H.jsx("span",{className:"font-mono text-xs text-zinc-300 truncate",children:b.label??"shell"})]},b.id))})]}),H.jsx("div",{className:"flex gap-3 overflow-x-auto pb-3 lg:overflow-visible",children:Fv.map(b=>H.jsx(qv,{column:b,tasks:v},b.id))}),le&&I&&H.jsx(jv,{config:I,onClose:()=>q(!1)})]})}var No={exports:{}},Qd;function Gv(){return Qd||(Qd=1,(function(N,Q){(function(V,I){N.exports=I()})(globalThis,(()=>(()=>{var V={4567:function(q,n,f){var _=this&&this.__decorate||function(l,h,m,w){var S,x=arguments.length,p=x<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,m):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(l,h,m,w);else for(var C=l.length-1;C>=0;C--)(S=l[C])&&(p=(x<3?S(p):x>3?S(h,m,p):S(h,m))||p);return x>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(l,h){return function(m,w){h(m,w,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const o=f(9042),g=f(9924),b=f(844),y=f(4725),d=f(2585),r=f(3656);let c=n.AccessibilityManager=class extends b.Disposable{constructor(l,h,m,w){super(),this._terminal=l,this._coreBrowserService=m,this._renderService=w,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(l){for(let h=0;h<l;h++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
51
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,h){this._liveRegionDebouncer.refresh(l,h,this._terminal.rows)}_renderRows(l,h){const m=this._terminal.buffer,w=m.lines.length.toString();for(let S=l;S<=h;S++){const x=m.lines.get(m.ydisp+S),p=[],C=(x==null?void 0:x.translateToString(!0,void 0,void 0,p))||"",L=(m.ydisp+S+1).toString(),M=this._rowElements[S];M&&(C.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=C,this._rowColumns.set(M,p)),M.setAttribute("aria-posinset",L),M.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,h){const m=l.target,w=this._rowElements[h===0?1:this._rowElements.length-2];if(m.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==w)return;let S,x;if(h===0?(S=m,x=this._rowElements.pop(),this._rowContainer.removeChild(x)):(S=this._rowElements.shift(),x=m,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),x.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(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var C;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:l.anchorNode,offset:l.anchorOffset},m={node:l.focusNode,offset:l.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 w=this._rowElements.slice(-1)[0];if(m.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(m={node:w,offset:((C=w.textContent)==null?void 0:C.length)??0}),!this._rowContainer.contains(m.node))return;const S=({node:L,offset:M})=>{const D=L instanceof Text?L.parentNode:L;let T=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(D);if(!j)return console.warn("columns is null. Race condition?"),null;let X=M<j.length?j[M]:j.slice(-1)[0]+1;return X>=this._terminal.cols&&(++T,X=0),{row:T,column:X}},x=S(h),p=S(m);if(x&&p){if(x.row>p.row||x.row===p.row&&x.column>=p.column)throw new Error("invalid range");this._terminal.select(x.column,x.row,(p.row-x.row)*this._terminal.cols-x.column+p.column)}}_handleResize(l){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>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=c=_([v(1,d.IInstantiationService),v(2,y.ICoreBrowserService),v(3,y.IRenderService)],c)},3614:(q,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,d){g=_(g=f(g),y.decPrivateModes.bracketedPasteMode&&d.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(g,!0),b.value=""}function o(g,b,y){const d=y.getBoundingClientRect(),r=g.clientX-d.left-10,c=g.clientY-d.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,d){g.stopPropagation(),g.clipboardData&&v(g.clipboardData.getData("text/plain"),b,y,d)},n.paste=v,n.moveTextAreaUnderMouseCursor=o,n.rightClickHandler=function(g,b,y,d,r){o(g,b,y),r&&d.rightClickSelect(g),b.value=d.selectionText,b.select()}},7239:(q,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,o,g){this._css.set(v,o,g)}getCss(v,o){return this._css.get(v,o)}setColor(v,o,g){this._color.set(v,o,g)}getColor(v,o){return this._color.get(v,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(f,_,v,o){f.addEventListener(_,v,o);let g=!1;return{dispose:()=>{g||(g=!0,f.removeEventListener(_,v,o))}}}},3551:function(q,n,f){var _=this&&this.__decorate||function(c,l,h,m){var w,S=arguments.length,x=S<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,l,h,m);else for(var p=c.length-1;p>=0;p--)(w=c[p])&&(x=(S<3?w(x):S>3?w(l,h,x):w(l,h))||x);return S>3&&x&&Object.defineProperty(l,h,x),x},v=this&&this.__param||function(c,l){return function(h,m){l(h,m,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const o=f(3656),g=f(8460),b=f(844),y=f(2585),d=f(4725);let r=n.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(c,l,h,m,w){super(),this._element=c,this._mouseService=l,this._renderService=h,this._bufferService=m,this._linkProviderService=w,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,o.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const l=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const h=c.composedPath();for(let m=0;m<h.length;m++){const w=h[m];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_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,l){var m,w;this._activeProviderReplies&&l||((m=this._activeProviderReplies)==null||m.forEach((S=>{S==null||S.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let h=!1;for(const[S,x]of this._linkProviderService.linkProviders.entries())l?(w=this._activeProviderReplies)!=null&&w.get(S)&&(h=this._checkLinkProviderResult(S,c,h)):x.provideLinks(c.y,(p=>{var L,M;if(this._isMouseOut)return;const C=p==null?void 0:p.map((D=>({link:D})));(L=this._activeProviderReplies)==null||L.set(S,C),h=this._checkLinkProviderResult(S,c,h),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,l){const h=new Set;for(let m=0;m<l.size;m++){const w=l.get(m);if(w)for(let S=0;S<w.length;S++){const x=w[S],p=x.link.range.start.y<c?0:x.link.range.start.x,C=x.link.range.end.y>c?this._bufferService.cols:x.link.range.end.x;for(let L=p;L<=C;L++){if(h.has(L)){w.splice(S--,1);break}h.add(L)}}}}_checkLinkProviderResult(c,l,h){var S;if(!this._activeProviderReplies)return h;const m=this._activeProviderReplies.get(c);let w=!1;for(let x=0;x<c;x++)this._activeProviderReplies.has(x)&&!this._activeProviderReplies.get(x)||(w=!0);if(!w&&m){const x=m.find((p=>this._linkAtPosition(p.link,l)));x&&(h=!0,this._handleNewLink(x))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let x=0;x<this._activeProviderReplies.size;x++){const p=(S=this._activeProviderReplies.get(x))==null?void 0:S.find((C=>this._linkAtPosition(C.link,l)));if(p){h=!0,this._handleNewLink(p);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const l=this._positionFromMouseEvent(c,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,l){this._currentLink&&this._lastMouseEvent&&(!c||!l||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=l)&&(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 l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(c.link,l)&&(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,w,S;(m=this._currentLink)!=null&&m.state&&((S=(w=this._currentLink)==null?void 0:w.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,w=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(m,w),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(c,l,h){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(h,l.text)}_fireUnderlineEvent(c,l){const h=c.range,m=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-m-1,h.end.x,h.end.y-m-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(c,l,h){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(h,l.text)}_linkAtPosition(c,l){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,w=l.y*this._bufferService.cols+l.x;return h<=w&&w<=m}_positionFromMouseEvent(c,l,h){const m=h.getCoords(c,l,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,l,h,m,w){return{x1:c,y1:l,x2:h,y2:m,cols:this._bufferService.cols,fg:w}}};n.Linkifier=r=_([v(1,d.IMouseService),v(2,d.IRenderService),v(3,y.IBufferService),v(4,d.ILinkProviderService)],r)},9042:(q,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(q,n,f){var _=this&&this.__decorate||function(d,r,c,l){var h,m=arguments.length,w=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,r,c,l);else for(var S=d.length-1;S>=0;S--)(h=d[S])&&(w=(m<3?h(w):m>3?h(r,c,w):h(r,c))||w);return m>3&&w&&Object.defineProperty(r,c,w),w},v=this&&this.__param||function(d,r){return function(c,l){r(c,l,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const o=f(511),g=f(2585);let b=n.OscLinkProvider=class{constructor(d,r,c){this._bufferService=d,this._optionsService=r,this._oscLinkService=c}provideLinks(d,r){var C;const c=this._bufferService.buffer.lines.get(d-1);if(!c)return void r(void 0);const l=[],h=this._optionsService.rawOptions.linkHandler,m=new o.CellData,w=c.getTrimmedLength();let S=-1,x=-1,p=!1;for(let L=0;L<w;L++)if(x!==-1||c.hasContent(L)){if(c.loadCell(L,m),m.hasExtendedAttrs()&&m.extended.urlId){if(x===-1){x=L,S=m.extended.urlId;continue}p=m.extended.urlId!==S}else x!==-1&&(p=!0);if(p||x!==-1&&L===w-1){const M=(C=this._oscLinkService.getLinkData(S))==null?void 0:C.uri;if(M){const D={start:{x:x+1,y:d},end:{x:L+(p||L!==w-1?0:1),y:d}};let T=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const j=new URL(M);["http:","https:"].includes(j.protocol)||(T=!0)}catch{T=!0}T||l.push({text:M,range:D,activate:(j,X)=>h?h.activate(j,X,D):y(0,X),hover:(j,X)=>{var U;return(U=h==null?void 0:h.hover)==null?void 0:U.call(h,j,X,D)},leave:(j,X)=>{var U;return(U=h==null?void 0:h.leave)==null?void 0:U.call(h,j,X,D)}})}p=!1,m.hasExtendedAttrs()&&m.extended.urlId?(x=L,S=m.extended.urlId):(x=-1,S=-1)}}r(l)}};function y(d,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:(q,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:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const _=f(3614),v=f(3656),o=f(3551),g=f(9042),b=f(3730),y=f(1680),d=f(3107),r=f(5744),c=f(2950),l=f(1296),h=f(428),m=f(4269),w=f(5114),S=f(8934),x=f(3230),p=f(9312),C=f(4725),L=f(6731),M=f(8055),D=f(8969),T=f(8460),j=f(844),X=f(6114),U=f(8437),P=f(2584),G=f(7399),R=f(5941),z=f(9074),A=f(2585),O=f(5435),Y=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(F={}){super(F),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new j.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(z.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(C.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((k,se)=>this.refresh(k,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((k=>this._reportWindowsOptions(k)))),this.register(this._inputHandler.onColor((k=>this._handleColorEvent(k)))),this.register((0,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((k=>this._afterResize(k.cols,k.rows)))),this.register((0,j.toDisposable)((()=>{var k,se;this._customKeyEventHandler=void 0,(se=(k=this.element)==null?void 0:k.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(F){if(this._themeService)for(const k of F){let se,ie="";switch(k.index){case 256:se="foreground",ie="10";break;case 257:se="background",ie="11";break;case 258:se="cursor",ie="12";break;default:se="ansi",ie="4;"+k.index}switch(k.type){case 0:const _e=M.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[k.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${P.C0.ESC}]${ie};${(0,R.toRgbString)(_e)}${P.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((de=>de.ansi[k.index]=M.channels.toColor(...k.color)));else{const de=se;this._themeService.modifyColors((we=>we[de]=M.channels.toColor(...k.color)))}break;case 2:this._themeService.restoreColor(k.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(F){F?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(F){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var F;return(F=this.textarea)==null?void 0:F.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.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 F=this.buffer.ybase+this.buffer.y,k=this.buffer.lines.get(F);if(!k)return;const se=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,_e=k.getWidth(se),de=this._renderService.dimensions.css.cell.width*_e,we=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=we+"px",this.textarea.style.width=de+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(k=>{this.hasSelection()&&(0,_.copyHandler)(k,this._selectionService)})));const F=k=>(0,_.handlePasteEvent)(k,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",F)),this.register((0,v.addDisposableDomListener)(this.element,"paste",F)),X.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(k=>{k.button===2&&(0,_.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(k=>{(0,_.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(k=>{k.button===1&&(0,_.moveTextAreaUnderMouseCursor)(k,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(F=>this._keyUp(F)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(F=>this._keyDown(F)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(F=>this._keyPress(F)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(F=>this._compositionHelper.compositionupdate(F)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(F=>this._inputEvent(F)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(F){var se;if(!F)throw new Error("Terminal requires a parent element.");if(F.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((se=this.element)==null?void 0:se.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=F.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"),F.appendChild(this.element);const k=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.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",(ie=>this.updateCursorStyle(ie)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),k.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),X.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(w.CoreBrowserService,this.textarea,F.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(C.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ie=>this._handleTextAreaFocus(ie)))),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(C.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(C.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(C.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(x.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(C.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ie=>this._onRender.fire(ie)))),this.onResize((ie=>this._renderService.resize(ie.cols,ie.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(C.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(o.Linkifier,this.screenElement)),this.element.appendChild(k);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((ie=>this.scrollLines(ie.amount,ie.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(C.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ie=>this._renderService.handleSelectionChanged(ie.start,ie.end,ie.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ie=>{this.textarea.value=ie,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ie=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(d.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(ie=>this._selectionService.handleMouseDown(ie)))),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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ie=>this._handleScreenReaderModeOptionChange(ie)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ie=>{!this._overviewRulerRenderer&&ie&&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(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const F=this,k=this.element;function se(de){const we=F._mouseService.getMouseReportCoords(de,F.screenElement);if(!we)return!1;let pe,He;switch(de.overrideType||de.type){case"mousemove":He=32,de.buttons===void 0?(pe=3,de.button!==void 0&&(pe=de.button<3?de.button:3)):pe=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":He=0,pe=de.button<3?de.button:3;break;case"mousedown":He=1,pe=de.button<3?de.button:3;break;case"wheel":if(F._customWheelEventHandler&&F._customWheelEventHandler(de)===!1||F.viewport.getLinesScrolled(de)===0)return!1;He=de.deltaY<0?0:1,pe=4;break;default:return!1}return!(He===void 0||pe===void 0||pe>4)&&F.coreMouseService.triggerMouseEvent({col:we.col,row:we.row,x:we.x,y:we.y,button:pe,action:He,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:de=>(se(de),de.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(de)),wheel:de=>(se(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&se(de)},mousemove:de=>{de.buttons||se(de)}};this.register(this.coreMouseService.onProtocolChange((de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),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&de?ie.mousemove||(k.addEventListener("mousemove",_e.mousemove),ie.mousemove=_e.mousemove):(k.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&de?ie.wheel||(k.addEventListener("wheel",_e.wheel,{passive:!1}),ie.wheel=_e.wheel):(k.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&de?ie.mouseup||(ie.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&de?ie.mousedrag||(ie.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(k,"mousedown",(de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return se(de),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(de)}))),this.register((0,v.addDisposableDomListener)(k,"wheel",(de=>{if(!ie.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(de)===!1)return!1;if(!this.buffer.hasScrollback){const we=this.viewport.getLinesScrolled(de);if(we===0)return;const pe=P.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let He="";for(let Qe=0;Qe<Math.abs(we);Qe++)He+=pe;return this.coreService.triggerDataEvent(He,!0),this.cancel(de,!0)}return this.viewport.handleWheel(de)?this.cancel(de):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(k,"touchstart",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(k,"touchmove",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)}),{passive:!1}))}refresh(F,k){var se;(se=this._renderService)==null||se.refreshRows(F,k)}updateCursorStyle(F){var k;(k=this._selectionService)!=null&&k.shouldColumnSelect(F)?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(F,k,se=0){var ie;se===1?(super.scrollLines(F,k,se),this.refresh(0,this.rows-1)):(ie=this.viewport)==null||ie.scrollLines(F)}paste(F){(0,_.paste)(F,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(F){this._customKeyEventHandler=F}attachCustomWheelEventHandler(F){this._customWheelEventHandler=F}registerLinkProvider(F){return this._linkProviderService.registerLinkProvider(F)}registerCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const k=this._characterJoinerService.register(F);return this.refresh(0,this.rows-1),k}deregisterCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(F)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(F){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+F)}registerDecoration(F){return this._decorationService.registerDecoration(F)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(F,k,se){this._selectionService.setSelection(F,k,se)}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 F;(F=this._selectionService)==null||F.clearSelection()}selectAll(){var F;(F=this._selectionService)==null||F.selectAll()}selectLines(F,k){var se;(se=this._selectionService)==null||se.selectLines(F,k)}_keyDown(F){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;const k=this.browser.isMac&&this.options.macOptionIsMeta&&F.altKey;if(!k&&!this._compositionHelper.keydown(F))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;k||F.key!=="Dead"&&F.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,G.evaluateKeyboardEvent)(F,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(F),se.type===3||se.type===2){const ie=this.rows-1;return this.scrollLines(se.type===2?-ie:ie),this.cancel(F,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,F)||(se.cancel&&this.cancel(F,!0),!se.key||!!(F.key&&!F.ctrlKey&&!F.altKey&&!F.metaKey&&F.key.length===1&&F.key.charCodeAt(0)>=65&&F.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==P.C0.ETX&&se.key!==P.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||F.altKey||F.ctrlKey?this.cancel(F,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(F,k){const se=F.isMac&&!this.options.macOptionIsMeta&&k.altKey&&!k.ctrlKey&&!k.metaKey||F.isWindows&&k.altKey&&k.ctrlKey&&!k.metaKey||F.isWindows&&k.getModifierState("AltGraph");return k.type==="keypress"?se:se&&(!k.keyCode||k.keyCode>47)}_keyUp(F){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1||((function(k){return k.keyCode===16||k.keyCode===17||k.keyCode===18})(F)||this.focus(),this.updateCursorStyle(F),this._keyPressHandled=!1)}_keyPress(F){let k;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;if(this.cancel(F),F.charCode)k=F.charCode;else if(F.which===null||F.which===void 0)k=F.keyCode;else{if(F.which===0||F.charCode===0)return!1;k=F.which}return!(!k||(F.altKey||F.ctrlKey||F.metaKey)&&!this._isThirdLevelShift(this.browser,F)||(k=String.fromCharCode(k),this._onKey.fire({key:k,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(k,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(F){if(F.data&&F.inputType==="insertText"&&(!F.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const k=F.data;return this.coreService.triggerDataEvent(k,!0),this.cancel(F),!0}return!1}resize(F,k){F!==this.cols||k!==this.rows?super.resize(F,k):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(F,k){var se,ie;(se=this._charSizeService)==null||se.measure(),(ie=this.viewport)==null||ie.syncScrollArea(!0)}clear(){var F;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 k=1;k<this.rows;k++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(F=this.viewport)==null||F.reset(),this.refresh(0,this.rows-1)}}reset(){var k,se;this.options.rows=this.rows,this.options.cols=this.cols;const F=this._customKeyEventHandler;this._setup(),super.reset(),(k=this._selectionService)==null||k.reset(),this._decorationService.reset(),(se=this.viewport)==null||se.reset(),this._customKeyEventHandler=F,this.refresh(0,this.rows-1)}clearTextureAtlas(){var F;(F=this._renderService)==null||F.clearTextureAtlas()}_reportFocus(){var F;(F=this.element)!=null&&F.classList.contains("focus")?this.coreService.triggerDataEvent(P.C0.ESC+"[I"):this.coreService.triggerDataEvent(P.C0.ESC+"[O")}_reportWindowsOptions(F){if(this._renderService)switch(F){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const k=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[4;${se};${k}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[6;${_e};${ie}t`)}}cancel(F,k){if(this.options.cancelEvents||k)return F.preventDefault(),F.stopPropagation(),!1}}n.Terminal=he},9924:(q,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 o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=o-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(q,n,f){var _=this&&this.__decorate||function(c,l,h,m){var w,S=arguments.length,x=S<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,l,h,m);else for(var p=c.length-1;p>=0;p--)(w=c[p])&&(x=(S<3?w(x):S>3?w(l,h,x):w(l,h))||x);return S>3&&x&&Object.defineProperty(l,h,x),x},v=this&&this.__param||function(c,l){return function(h,m){l(h,m,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const o=f(3656),g=f(4725),b=f(8460),y=f(844),d=f(2585);let r=n.Viewport=class extends y.Disposable{constructor(c,l,h,m,w,S,x,p){super(),this._viewportElement=c,this._scrollArea=l,this._bufferService=h,this._optionsService=m,this._charSizeService=w,this._renderService=S,this._coreBrowserService=x,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,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((C=>this._renderDimensions=C))),this._handleThemeChange(p.colors),this.register(p.onChangeColors((C=>this._handleThemeChange(C)))),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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,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,l){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&h<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const l=this._getPixelsScrolled(c);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(c,l))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,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 l=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(c,l){var p;let h,m="";const w=[],S=l??this._bufferService.buffer.lines.length,x=this._bufferService.buffer.lines;for(let C=c;C<S;C++){const L=x.get(C);if(!L)continue;const M=(p=x.get(C+1))==null?void 0:p.isWrapped;if(m+=L.translateToString(!M),!M||C===x.length-1){const D=document.createElement("div");D.textContent=m,w.push(D),m.length>0&&(h=D),m=""}}return{bufferElements:w,cursorElement:h}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let l=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(c,l){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&l.altKey||h==="ctrl"&&l.ctrlKey||h==="shift"&&l.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 l=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(c,l))}};n.Viewport=r=_([v(2,d.IBufferService),v(3,d.IOptionsService),v(4,g.ICharSizeService),v(5,g.IRenderService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],r)},3107:function(q,n,f){var _=this&&this.__decorate||function(d,r,c,l){var h,m=arguments.length,w=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,r,c,l);else for(var S=d.length-1;S>=0;S--)(h=d[S])&&(w=(m<3?h(w):m>3?h(r,c,w):h(r,c))||w);return m>3&&w&&Object.defineProperty(r,c,w),w},v=this&&this.__param||function(d,r){return function(c,l){r(c,l,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const o=f(4725),g=f(844),b=f(2585);let y=n.BufferDecorationRenderer=class extends g.Disposable{constructor(d,r,c,l,h){super(),this._screenElement=d,this._bufferService=r,this._coreBrowserService=c,this._decorationService=l,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 d of this._decorationService.decorations)this._renderDecoration(d);this._dimensionsChanged=!1}_renderDecoration(d){this._refreshStyle(d),this._dimensionsChanged&&this._refreshXPosition(d)}_createElement(d){var l;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((l=d==null?void 0:d.options)==null?void 0:l.layer)==="top"),r.style.width=`${Math.round((d.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(d.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(d.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=d.options.x??0;return c&&c>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(d,r),r}_refreshStyle(d){const r=d.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)d.element&&(d.element.style.display="none",d.onRenderEmitter.fire(d.element));else{let c=this._decorationElements.get(d);c||(c=this._createElement(d),d.element=c,this._decorationElements.set(d,c),this._container.appendChild(c),d.onDispose((()=>{this._decorationElements.delete(d),c.remove()}))),c.style.top=r*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",d.onRenderEmitter.fire(c)}}_refreshXPosition(d,r=d.element){if(!r)return;const c=d.options.x??0;(d.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(d){var r;(r=this._decorationElements.get(d))==null||r.remove(),this._decorationElements.delete(d),d.dispose()}};n.BufferDecorationRenderer=y=_([v(1,b.IBufferService),v(2,o.ICoreBrowserService),v(3,b.IDecorationService),v(4,o.IRenderService)],y)},5871:(q,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(q,n,f){var _=this&&this.__decorate||function(h,m,w,S){var x,p=arguments.length,C=p<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,m,w,S);else for(var L=h.length-1;L>=0;L--)(x=h[L])&&(C=(p<3?x(C):p>3?x(m,w,C):x(m,w))||C);return p>3&&C&&Object.defineProperty(m,w,C),C},v=this&&this.__param||function(h,m){return function(w,S){m(w,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const o=f(5871),g=f(4725),b=f(844),y=f(2585),d={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 l=n.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,m,w,S,x,p,C){var M;super(),this._viewportElement=h,this._screenElement=m,this._bufferService=w,this._decorationService=S,this._renderService=x,this._optionsService=p,this._coreBrowserService=C,this._colorZoneStore=new o.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(),(M=this._viewportElement.parentElement)==null||M.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(){d.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);d.left=m,d.center=m,d.right=m}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.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)-d[h.position||"full"]/2),r[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+d[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=l=_([v(2,y.IBufferService),v(3,y.IDecorationService),v(4,g.IRenderService),v(5,y.IOptionsService),v(6,g.ICoreBrowserService)],l)},2950:function(q,n,f){var _=this&&this.__decorate||function(d,r,c,l){var h,m=arguments.length,w=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,r,c,l);else for(var S=d.length-1;S>=0;S--)(h=d[S])&&(w=(m<3?h(w):m>3?h(r,c,w):h(r,c))||w);return m>3&&w&&Object.defineProperty(r,c,w),w},v=this&&this.__param||function(d,r){return function(c,l){r(c,l,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const o=f(4725),g=f(2585),b=f(2584);let y=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(d,r,c,l,h,m){this._textarea=d,this._compositionView=r,this._bufferService=c,this._optionsService=l,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(d){this._compositionView.textContent=d.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(d){if(this._isComposing||this._isSendingComposition){if(d.keyCode===229||d.keyCode===16||d.keyCode===17||d.keyCode===18)return!1;this._finalizeComposition(!1)}return d.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(d){if(this._compositionView.classList.remove("active"),this._isComposing=!1,d){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 d=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,c=r.replace(d,"");this._dataAlreadySent=c,r.length>d.length?this._coreService.triggerDataEvent(c,!0):r.length<d.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):r.length===d.length&&r!==d&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(d){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,l=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=l+"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=l+"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"}d||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=y=_([v(2,g.IBufferService),v(3,g.IOptionsService),v(4,g.ICoreService),v(5,o.IRenderService)],y)},9806:(q,n)=>{function f(_,v,o){const g=o.getBoundingClientRect(),b=_.getComputedStyle(o),y=parseInt(b.getPropertyValue("padding-left")),d=parseInt(b.getPropertyValue("padding-top"));return[v.clientX-g.left-y,v.clientY-g.top-d]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=f,n.getCoords=function(_,v,o,g,b,y,d,r,c){if(!y)return;const l=f(_,v,o);return l?(l[0]=Math.ceil((l[0]+(c?d/2:0))/d),l[1]=Math.ceil(l[1]/r),l[0]=Math.min(Math.max(l[0],1),g+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),b),l):void 0}},9504:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const _=f(2584);function v(r,c,l,h){const m=r-o(r,l),w=c-o(c,l),S=Math.abs(m-w)-(function(x,p,C){let L=0;const M=x-o(x,C),D=p-o(p,C);for(let T=0;T<Math.abs(M-D);T++){const j=g(x,p)==="A"?-1:1,X=C.buffer.lines.get(M+j*T);X!=null&&X.isWrapped&&L++}return L})(r,c,l);return d(S,y(g(r,c),h))}function o(r,c){let l=0,h=c.buffer.lines.get(r),m=h==null?void 0:h.isWrapped;for(;m&&r>=0&&r<c.rows;)l++,h=c.buffer.lines.get(--r),m=h==null?void 0:h.isWrapped;return l}function g(r,c){return r>c?"A":"B"}function b(r,c,l,h,m,w){let S=r,x=c,p="";for(;S!==l||x!==h;)S+=m?1:-1,m&&S>w.cols-1?(p+=w.buffer.translateBufferLineToString(x,!1,r,S),S=0,r=0,x++):!m&&S<0&&(p+=w.buffer.translateBufferLineToString(x,!1,0,r+1),S=w.cols-1,r=S,x--);return p+w.buffer.translateBufferLineToString(x,!1,r,S)}function y(r,c){const l=c?"O":"[";return _.C0.ESC+l+r}function d(r,c){r=Math.floor(r);let l="";for(let h=0;h<r;h++)l+=c;return l}n.moveToCellSequence=function(r,c,l,h){const m=l.buffer.x,w=l.buffer.y;if(!l.buffer.hasScrollback)return(function(p,C,L,M,D,T){return v(C,M,D,T).length===0?"":d(b(p,C,p,C-o(C,D),!1,D).length,y("D",T))})(m,w,0,c,l,h)+v(w,c,l,h)+(function(p,C,L,M,D,T){let j;j=v(C,M,D,T).length>0?M-o(M,D):C;const X=M,U=(function(P,G,R,z,A,O){let Y;return Y=v(R,z,A,O).length>0?z-o(z,A):G,P<R&&Y<=z||P>=R&&Y<z?"C":"D"})(p,C,L,M,D,T);return d(b(p,j,L,X,U==="C",D).length,y(U,T))})(m,w,r,c,l,h);let S;if(w===c)return S=m>r?"D":"C",d(Math.abs(m-r),y(S,h));S=w>c?"D":"C";const x=Math.abs(w-c);return d((function(p,C){return C.cols-p})(w>c?r:m,l)+(x-1)*l.cols+1+((w>c?m:r)-1),y(S,h))}},1296:function(q,n,f){var _=this&&this.__decorate||function(T,j,X,U){var P,G=arguments.length,R=G<3?j:U===null?U=Object.getOwnPropertyDescriptor(j,X):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(T,j,X,U);else for(var z=T.length-1;z>=0;z--)(P=T[z])&&(R=(G<3?P(R):G>3?P(j,X,R):P(j,X))||R);return G>3&&R&&Object.defineProperty(j,X,R),R},v=this&&this.__param||function(T,j){return function(X,U){j(X,U,T)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const o=f(3787),g=f(2550),b=f(2223),y=f(6171),d=f(6052),r=f(4725),c=f(8055),l=f(8460),h=f(844),m=f(2585),w="xterm-dom-renderer-owner-",S="xterm-rows",x="xterm-fg-",p="xterm-bg-",C="xterm-focus",L="xterm-selection";let M=1,D=n.DomRenderer=class extends h.Disposable{constructor(T,j,X,U,P,G,R,z,A,O,Y,Z,he){super(),this._terminal=T,this._document=j,this._element=X,this._screenElement=U,this._viewportElement=P,this._helperContainer=G,this._linkifier2=R,this._charSizeService=A,this._optionsService=O,this._bufferService=Y,this._coreBrowserService=Z,this._themeService=he,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,d.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.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=z.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(w+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(w+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 T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const j=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=j,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(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let j=`${this._terminalSelector} .${S} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;j+=`${this._terminalSelector} .${S} .xterm-dim { color: ${c.color.multiplyOpacity(T.foreground,.5).css};}`,j+=`${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 X=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,P=`blink_block_${this._terminalClass}`;j+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,j+=`@keyframes ${U} { 50% { box-shadow: none; }}`,j+=`@keyframes ${P} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,j+=`${this._terminalSelector} .${S}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${S}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${S}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,j+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[G,R]of T.ansi.entries())j+=`${this._terminalSelector} .${x}${G} { color: ${R.css}; }${this._terminalSelector} .${x}${G}.xterm-dim { color: ${c.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${p}${G} { background-color: ${R.css}; }`;j+=`${this._terminalSelector} .${x}${b.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(T.background).css}; }${this._terminalSelector} .${x}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${p}${b.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=j}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,j){for(let X=this._rowElements.length;X<=j;X++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>j;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,j){this._refreshRowElements(T,j),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(C),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(C),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,j,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,j,X),this.renderRows(0,this._bufferService.rows-1),!T||!j)return;this._selectionRenderModel.update(this._terminal,T,j,X);const U=this._selectionRenderModel.viewportStartRow,P=this._selectionRenderModel.viewportEndRow,G=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(G>=this._bufferService.rows||R<0)return;const z=this._document.createDocumentFragment();if(X){const A=T[0]>j[0];z.appendChild(this._createSelectionElement(G,A?j[0]:T[0],A?T[0]:j[0],R-G+1))}else{const A=U===G?T[0]:0,O=G===P?j[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(G,A,O));const Y=R-G-1;if(z.appendChild(this._createSelectionElement(G+1,0,this._bufferService.cols,Y)),G!==R){const Z=P===R?j[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(R,0,Z))}}this._selectionContainer.appendChild(z)}_createSelectionElement(T,j,X,U=1){const P=this._document.createElement("div"),G=j*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(X-j);return G+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-G),P.style.height=U*this.dimensions.css.cell.height+"px",P.style.top=T*this.dimensions.css.cell.height+"px",P.style.left=`${G}px`,P.style.width=`${R}px`,P}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 T of this._rowElements)T.replaceChildren()}renderRows(T,j){const X=this._bufferService.buffer,U=X.ybase+X.y,P=Math.min(X.x,this._bufferService.cols-1),G=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=T;A<=j;A++){const O=A+X.ydisp,Y=this._rowElements[A],Z=X.lines.get(O);if(!Y||!Z)break;Y.replaceChildren(...this._rowFactory.createRow(Z,O,O===U,R,z,P,G,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,j,X,U,P,G){X<0&&(T=0),U<0&&(j=0);const R=this._bufferService.rows-1;X=Math.max(Math.min(X,R),0),U=Math.max(Math.min(U,R),0),P=Math.min(P,this._bufferService.cols);const z=this._bufferService.buffer,A=z.ybase+z.y,O=Math.min(z.x,P-1),Y=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=X;ue<=U;++ue){const F=ue+z.ydisp,k=this._rowElements[ue],se=z.lines.get(F);if(!k||!se)break;k.replaceChildren(...this._rowFactory.createRow(se,F,F===A,Z,he,O,Y,this.dimensions.css.cell.width,this._widthCache,G?ue===X?T:0:-1,G?(ue===U?j:P)-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(q,n,f){var _=this&&this.__decorate||function(S,x,p,C){var L,M=arguments.length,D=M<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,p):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,p,C);else for(var T=S.length-1;T>=0;T--)(L=S[T])&&(D=(M<3?L(D):M>3?L(x,p,D):L(x,p))||D);return M>3&&D&&Object.defineProperty(x,p,D),D},v=this&&this.__param||function(S,x){return function(p,C){x(p,C,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const o=f(2223),g=f(643),b=f(511),y=f(2585),d=f(8055),r=f(4725),c=f(4269),l=f(6171),h=f(3734);let m=n.DomRendererRowFactory=class{constructor(S,x,p,C,L,M,D){this._document=S,this._characterJoinerService=x,this._optionsService=p,this._coreBrowserService=C,this._coreService=L,this._decorationService=M,this._themeService=D,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,x,p){this._selectionStart=S,this._selectionEnd=x,this._columnSelectMode=p}createRow(S,x,p,C,L,M,D,T,j,X,U){const P=[],G=this._characterJoinerService.getJoinedCharacters(x),R=this._themeService.colors;let z,A=S.getNoBgTrimmedLength();p&&A<M+1&&(A=M+1);let O=0,Y="",Z=0,he=0,ue=0,F=!1,k=0,se=!1,ie=0;const _e=[],de=X!==-1&&U!==-1;for(let we=0;we<A;we++){S.loadCell(we,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let He=!1,Qe=we,be=this._workCell;if(G.length>0&&we===G[0][0]){He=!0;const Re=G.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(we,x),si=p&&we===M,Be=de&&we>=X&&we<=U;let Ae=!1;this._decorationService.forEachDecorationAtCell(we,x,void 0,(Re=>{Ae=!0}));let De=be.getChars()||g.WHITESPACE_CELL_CHAR;if(De===" "&&(be.isUnderline()||be.isOverline())&&(De=" "),ie=pe*T-j.get(De,be.isBold(),be.isItalic()),z){if(O&&(Bt&&se||!Bt&&!se&&be.bg===Z)&&(Bt&&se&&R.selectionForeground||be.fg===he)&&be.extended.ext===ue&&Be===F&&ie===k&&!si&&!He&&!Ae){be.isInvisible()?Y+=g.WHITESPACE_CELL_CHAR:Y+=De,O++;continue}O&&(z.textContent=Y),z=this._document.createElement("span"),O=0,Y=""}else z=this._document.createElement("span");if(Z=be.bg,he=be.fg,ue=be.extended.ext,F=Be,k=ie,se=Bt,He&&M>=we&&M<=Qe&&(M=we),!this._coreService.isCursorHidden&&si&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&_e.push("xterm-cursor-blink"),_e.push(C==="bar"?"xterm-cursor-bar":C==="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"),Y=be.isInvisible()?g.WHITESPACE_CELL_CHAR:be.getChars()||g.WHITESPACE_CELL_CHAR,be.isUnderline()&&(_e.push(`xterm-underline-${be.extended.underlineStyle}`),Y===" "&&(Y=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Re=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Re<8&&(Re+=8),z.style.textDecorationColor=R.ansi[Re].css}be.isOverline()&&(_e.push("xterm-overline"),Y===" "&&(Y=" ")),be.isStrikethrough()&&_e.push("xterm-strikethrough"),Be&&(z.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 ct,xt,et,qe=!1;switch(this._decorationService.forEachDecorationAtCell(we,x,void 0,(Re=>{Re.options.layer!=="top"&&qe||(Re.backgroundColorRGB&&(Fe=50331648,Ze=Re.backgroundColorRGB.rgba>>8&16777215,ct=Re.backgroundColorRGB),Re.foregroundColorRGB&&(Ce=50331648,ve=Re.foregroundColorRGB.rgba>>8&16777215,xt=Re.foregroundColorRGB),qe=Re.options.layer==="top")})),!qe&&Bt&&(ct=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,Ze=ct.rgba>>8&16777215,Fe=50331648,qe=!0,R.selectionForeground&&(Ce=50331648,ve=R.selectionForeground.rgba>>8&16777215,xt=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=d.channels.toColor(Ze>>16,Ze>>8&255,255&Ze),this._addStyle(z,`background-color:#${w((Ze>>>0).toString(16),"0",6)}`);break;default:Ft?(et=R.foreground,_e.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):et=R.background}switch(ct||be.isDim()&&(ct=d.color.multiplyOpacity(et,.5)),Ce){case 16777216:case 33554432:be.isBold()&&ve<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ve+=8),this._applyMinimumContrast(z,et,R.ansi[ve],be,ct,void 0)||_e.push(`xterm-fg-${ve}`);break;case 50331648:const Re=d.channels.toColor(ve>>16&255,ve>>8&255,255&ve);this._applyMinimumContrast(z,et,Re,be,ct,xt)||this._addStyle(z,`color:#${w(ve.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,et,R.foreground,be,ct,xt)||Ft&&_e.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}_e.length&&(z.className=_e.join(" "),_e.length=0),si||He||Ae?z.textContent=Y:O++,ie!==this.defaultSpacing&&(z.style.letterSpacing=`${ie}px`),P.push(z),we=Qe}return z&&O&&(z.textContent=Y),P}_applyMinimumContrast(S,x,p,C,L,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(C.getCode()))return!1;const D=this._getContrastCache(C);let T;if(L||M||(T=D.getColor(x.rgba,p.rgba)),T===void 0){const j=this._optionsService.rawOptions.minimumContrastRatio/(C.isDim()?2:1);T=d.color.ensureContrastRatio(L||x,M||p,j),D.setColor((L||x).rgba,(M||p).rgba,T??null)}return!!T&&(this._addStyle(S,`color:${T.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,x){S.setAttribute("style",`${S.getAttribute("style")||""}${x};`)}_isCellInSelection(S,x){const p=this._selectionStart,C=this._selectionEnd;return!(!p||!C)&&(this._columnSelectMode?p[0]<=C[0]?S>=p[0]&&x>=p[1]&&S<C[0]&&x<=C[1]:S<p[0]&&x>=p[1]&&S>=C[0]&&x<=C[1]:x>p[1]&&x<C[1]||p[1]===C[1]&&x===p[1]&&S>=p[0]&&S<C[0]||p[1]<C[1]&&x===C[1]&&S<C[0]||p[1]<C[1]&&x===p[1]&&S>=p[0])}};function w(S,x,p){for(;S.length<p;)S=x+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:(q,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 o=f.createElement("span");o.classList.add("xterm-char-measure-element"),o.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,o,g,b],this._container.appendChild(v),this._container.appendChild(o),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,o){f===this._font&&_===this._fontSize&&v===this._weight&&o===this._weightBold||(this._font=f,this._fontSize=_,this._weight=v,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(f,_,v){let o=0;if(!_&&!v&&f.length===1&&(o=f.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];const y=this._measure(f,0);return y>0&&(this._flat[o]=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:(q,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:(q,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,o,g,b){return o===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(o){return 9472<=o&&o<=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,o,g=0){return(v-(2*Math.round(o)-g))%(2*Math.round(o))}},6052:(q,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,o,g,b=!1){if(this.selectionStart=o,this.selectionEnd=g,!o||!g||o[0]===g[0]&&o[1]===g[1])return void this.clear();const y=v.buffers.active.ydisp,d=o[1]-y,r=g[1]-y,c=Math.max(d,0),l=Math.min(r,v.rows-1);c>=v.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=d,this.viewportEndRow=r,this.viewportCappedStartRow=c,this.viewportCappedEndRow=l,this.startCol=o[0],this.endCol=g[0])}isCellSelected(v,o,g){return!!this.hasSelection&&(g-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&g>=this.viewportCappedStartRow&&o<this.endCol&&g<=this.viewportCappedEndRow:o<this.startCol&&g>=this.viewportCappedStartRow&&o>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&o>=this.startCol)}}n.createSelectionRenderModel=function(){return new f}},456:(q,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(q,n,f){var _=this&&this.__decorate||function(l,h,m,w){var S,x=arguments.length,p=x<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,m):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(l,h,m,w);else for(var C=l.length-1;C>=0;C--)(S=l[C])&&(p=(x<3?S(p):x>3?S(h,m,p):S(h,m))||p);return x>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(l,h){return function(m,w){h(m,w,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const o=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(l,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(l,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};n.CharSizeService=y=_([v(2,o.IOptionsService)],y);class d 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 d{constructor(h,m,w){super(),this._document=h,this._parentElement=m,this._optionsService=w,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 d{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(q,n,f){var _=this&&this.__decorate||function(c,l,h,m){var w,S=arguments.length,x=S<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,l,h,m);else for(var p=c.length-1;p>=0;p--)(w=c[p])&&(x=(S<3?w(x):S>3?w(l,h,x):w(l,h))||x);return S>3&&x&&Object.defineProperty(l,h,x),x},v=this&&this.__param||function(c,l){return function(h,m){l(h,m,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const o=f(3734),g=f(643),b=f(511),y=f(2585);class d extends o.AttributeData{constructor(l,h,m){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=h,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=d;let r=n.CharacterJoinerService=class of{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(l){const h={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(h),h.id}deregister(l){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===l)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(l);if(!h||h.length===0)return[];const m=[],w=h.translateToString(!0);let S=0,x=0,p=0,C=h.getFg(0),L=h.getBg(0);for(let M=0;M<h.getTrimmedLength();M++)if(h.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(M-S>1){const D=this._getJoinedRanges(w,p,x,h,S);for(let T=0;T<D.length;T++)m.push(D[T])}S=M,p=x,C=this._workCell.fg,L=this._workCell.bg}x+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const M=this._getJoinedRanges(w,p,x,h,S);for(let D=0;D<M.length;D++)m.push(M[D])}return m}_getJoinedRanges(l,h,m,w,S){const x=l.substring(h,m);let p=[];try{p=this._characterJoiners[0].handler(x)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(x);for(let M=0;M<L.length;M++)of._mergeRanges(p,L[M])}catch(L){console.error(L)}return this._stringRangesToCellRanges(p,w,S),p}_stringRangesToCellRanges(l,h,m){let w=0,S=!1,x=0,p=l[w];if(p){for(let C=m;C<this._bufferService.cols;C++){const L=h.getWidth(C),M=h.getString(C).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!S&&p[0]<=x&&(p[0]=C,S=!0),p[1]<=x){if(p[1]=C,p=l[++w],!p)break;p[0]<=x?(p[0]=C,S=!0):S=!1}x+=M}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(l,h){let m=!1;for(let w=0;w<l.length;w++){const S=l[w];if(m){if(h[1]<=S[0])return l[w-1][1]=h[1],l;if(h[1]<=S[1])return l[w-1][1]=Math.max(h[1],S[1]),l.splice(w,1),l;l.splice(w,1),w--}else{if(h[1]<=S[0])return l.splice(w,0,h),l;if(h[1]<=S[1])return S[0]=Math.min(h[0],S[0]),l;h[0]<S[1]&&(S[0]=Math.min(h[0],S[0]),m=!0)}}return m?l[l.length-1][1]=h[1]:l.push(h),l}};n.CharacterJoinerService=r=_([v(0,y.IBufferService)],r)},5114:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const _=f(844),v=f(8460),o=f(3656);class g extends _.Disposable{constructor(d,r,c){super(),this._textarea=d,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((l=>this._screenDprMonitor.setWindow(l)))),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(d){this._window!==d&&(this._window=d,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(d){super(),this._parentWindow=d,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(d){this._parentWindow=d,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,o.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var d;this._outerListener&&((d=this._resolutionMediaMatchList)==null||d.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:(q,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(q,n,f){var _=this&&this.__decorate||function(y,d,r,c){var l,h=arguments.length,m=h<3?d:c===null?c=Object.getOwnPropertyDescriptor(d,r):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(y,d,r,c);else for(var w=y.length-1;w>=0;w--)(l=y[w])&&(m=(h<3?l(m):h>3?l(d,r,m):l(d,r))||m);return h>3&&m&&Object.defineProperty(d,r,m),m},v=this&&this.__param||function(y,d){return function(r,c){d(r,c,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const o=f(4725),g=f(9806);let b=n.MouseService=class{constructor(y,d){this._renderService=y,this._charSizeService=d}getCoords(y,d,r,c,l){return(0,g.getCoords)(window,y,d,r,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(y,d){const r=(0,g.getCoordsRelativeToElement)(window,y,d);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,o.IRenderService),v(1,o.ICharSizeService)],b)},3230:function(q,n,f){var _=this&&this.__decorate||function(l,h,m,w){var S,x=arguments.length,p=x<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,m):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(l,h,m,w);else for(var C=l.length-1;C>=0;C--)(S=l[C])&&(p=(x<3?S(p):x>3?S(h,m,p):S(h,m))||p);return x>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(l,h){return function(m,w){h(m,w,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const o=f(6193),g=f(4725),b=f(8460),y=f(844),d=f(7226),r=f(2585);let c=n.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,h,m,w,S,x,p,C){super(),this._rowCount=l,this._charSizeService=w,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new d.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 o.RenderDebouncer(((L,M)=>this._renderRows(L,M)),p),this.register(this._renderDebouncer),this.register(p.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(x.onResize((()=>this._fullRefresh()))),this.register(x.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(x.cols,x.rows),this._fullRefresh()}))),this.register(m.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(x.buffer.y,x.buffer.y,!0)))),this.register(C.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(p.window,h),this.register(p.onWindowChange((L=>this._registerIntersectionObserver(L,h))))}_registerIntersectionObserver(l,h){if("IntersectionObserver"in l){const m=new l.IntersectionObserver((w=>this._handleIntersectionChange(w[w.length-1])),{threshold:0});m.observe(h),this._observerDisposable.value=(0,y.toDisposable)((()=>m.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,h,m=!1){this._isPaused?this._needsFullRefresh=!0:(m||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,h,this._rowCount))}_renderRows(l,h){this._renderer.value&&(l=Math.min(l,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(l,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:l,end:h}),this._onRender.fire({start:l,end:h}),this._isNextRenderRedrawOnly=!0)}resize(l,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,h;this._renderer.value&&((h=(l=this._renderer.value).clearTextureAtlas)==null||h.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var m;return(m=this._renderer.value)==null?void 0:m.handleResize(l,h)})):this._renderer.value.handleResize(l,h),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,h,m){var w;this._selectionState.start=l,this._selectionState.end=h,this._selectionState.columnSelectMode=m,(w=this._renderer.value)==null||w.handleSelectionChanged(l,h,m)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.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(q,n,f){var _=this&&this.__decorate||function(p,C,L,M){var D,T=arguments.length,j=T<3?C:M===null?M=Object.getOwnPropertyDescriptor(C,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,C,L,M);else for(var X=p.length-1;X>=0;X--)(D=p[X])&&(j=(T<3?D(j):T>3?D(C,L,j):D(C,L))||j);return T>3&&j&&Object.defineProperty(C,L,j),j},v=this&&this.__param||function(p,C){return function(L,M){C(L,M,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const o=f(9806),g=f(9504),b=f(456),y=f(4725),d=f(8460),r=f(844),c=f(6114),l=f(4841),h=f(511),m=f(2585),w=" ",S=new RegExp(w,"g");let x=n.SelectionService=class extends r.Disposable{constructor(p,C,L,M,D,T,j,X,U){super(),this._element=p,this._screenElement=C,this._linkifier=L,this._bufferService=M,this._coreService=D,this._mouseService=T,this._optionsService=j,this._renderService=X,this._coreBrowserService=U,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 d.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new d.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=P=>this._handleMouseMove(P),this._mouseUpListener=P=>this._handleMouseUp(P),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((P=>this._handleTrim(P))),this.register(this._bufferService.buffers.onBufferActivate((P=>this._handleBufferActivate(P)))),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,C=this._model.finalSelectionEnd;return!(!p||!C||p[0]===C[0]&&p[1]===C[1])}get selectionText(){const p=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;if(!p||!C)return"";const L=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(p[0]===C[0])return"";const D=p[0]<C[0]?p[0]:C[0],T=p[0]<C[0]?C[0]:p[0];for(let j=p[1];j<=C[1];j++){const X=L.translateBufferLineToString(j,!0,D,T);M.push(X)}}else{const D=p[1]===C[1]?C[0]:void 0;M.push(L.translateBufferLineToString(p[1],!0,p[0],D));for(let T=p[1]+1;T<=C[1]-1;T++){const j=L.lines.get(T),X=L.translateBufferLineToString(T,!0);j!=null&&j.isWrapped?M[M.length-1]+=X:M.push(X)}if(p[1]!==C[1]){const T=L.lines.get(C[1]),j=L.translateBufferLineToString(C[1],!0,0,C[0]);T&&T.isWrapped?M[M.length-1]+=j:M.push(j)}}return M.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 C=this._getMouseBufferCoords(p),L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(L&&M&&C)&&this._areCoordsInSelection(C,L,M)}isCellInSelection(p,C){const L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!L||!M)&&this._areCoordsInSelection([p,C],L,M)}_areCoordsInSelection(p,C,L){return p[1]>C[1]&&p[1]<L[1]||C[1]===L[1]&&p[1]===C[1]&&p[0]>=C[0]&&p[0]<L[0]||C[1]<L[1]&&p[1]===L[1]&&p[0]<L[0]||C[1]<L[1]&&p[1]===C[1]&&p[0]>=C[0]}_selectWordAtCursor(p,C){var D,T;const L=(T=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:T.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(p);return!!M&&(this._selectWordAt(M,C),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,C){this._model.clearSelection(),p=Math.max(p,0),C=Math.min(C,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,C],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const C=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(C)return C[0]--,C[1]--,C[1]+=this._bufferService.buffer.ydisp,C}_getMouseEventScrollAmount(p){let C=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return C>=0&&C<=L?0:(C>L&&(C-=L),C=Math.min(Math.max(C,-50),50),C/=50,C/Math.abs(C)+Math.round(14*C))}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 C=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);C&&C.length!==this._model.selectionStart[0]&&C.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const C=this._getMouseBufferCoords(p);C&&(this._activeSelectionMode=2,this._selectLineAt(C[1]))}shouldColumnSelect(p){return p.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const C=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 M=L.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}C&&C[0]===this._model.selectionEnd[0]&&C[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 C=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&C<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 M=(0,g.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,C=this._model.finalSelectionEnd,L=!(!p||!C||p[0]===C[0]&&p[1]===C[1]);L?p&&C&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&C[0]===this._oldSelectionEnd[0]&&C[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,C,L)):this._oldHasSelection&&this._fireOnSelectionChange(p,C,L)}_fireOnSelectionChange(p,C,L){this._oldSelectionStart=p,this._oldSelectionEnd=C,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim((C=>this._handleTrim(C)))}_convertViewportColToCharacterIndex(p,C){let L=C;for(let M=0;C>=M;M++){const D=p.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:D>1&&C!==M&&(L+=D-1)}return L}setSelection(p,C,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,C],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,C,L=!0,M=!0){if(p[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,T=D.lines.get(p[1]);if(!T)return;const j=D.translateBufferLineToString(p[1],!1);let X=this._convertViewportColToCharacterIndex(T,p[0]),U=X;const P=p[0]-X;let G=0,R=0,z=0,A=0;if(j.charAt(X)===" "){for(;X>0&&j.charAt(X-1)===" ";)X--;for(;U<j.length&&j.charAt(U+1)===" ";)U++}else{let Z=p[0],he=p[0];T.getWidth(Z)===0&&(G++,Z--),T.getWidth(he)===2&&(R++,he++);const ue=T.getString(he).length;for(ue>1&&(A+=ue-1,U+=ue-1);Z>0&&X>0&&!this._isCharWordSeparator(T.loadCell(Z-1,this._workCell));){T.loadCell(Z-1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===0?(G++,Z--):F>1&&(z+=F-1,X-=F-1),X--,Z--}for(;he<T.length&&U+1<j.length&&!this._isCharWordSeparator(T.loadCell(he+1,this._workCell));){T.loadCell(he+1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,he++):F>1&&(A+=F-1,U+=F-1),U++,he++}}U++;let O=X+P-G+z,Y=Math.min(this._bufferService.cols,U-X+G+R-z-A);if(C||j.slice(X,U).trim()!==""){if(L&&O===0&&T.getCodePoint(0)!==32){const Z=D.lines.get(p[1]-1);if(Z&&T.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;O-=ue,Y+=ue}}}if(M&&O+Y===this._bufferService.cols&&T.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&&(Y+=he.length)}}return{start:O,length:Y}}}_selectWordAt(p,C){const L=this._getWordAt(p,C);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 C=this._getWordAt(p,!0);if(C){let L=p[1];for(;C.start<0;)C.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;C.start+C.length>this._bufferService.cols;)C.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?C.start:C.start+C.length,L]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const C=this._bufferService.buffer.getWrappedRangeForLine(p),L={start:{x:0,y:C.first},end:{x:this._bufferService.cols-1,y:C.last}};this._model.selectionStart=[0,C.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=x=_([v(3,m.IBufferService),v(4,m.ICoreService),v(5,y.IMouseService),v(6,m.IOptionsService),v(7,y.IRenderService),v(8,y.ICoreBrowserService)],x)},4725:(q,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(q,n,f){var _=this&&this.__decorate||function(x,p,C,L){var M,D=arguments.length,T=D<3?p:L===null?L=Object.getOwnPropertyDescriptor(p,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,p,C,L);else for(var j=x.length-1;j>=0;j--)(M=x[j])&&(T=(D<3?M(T):D>3?M(p,C,T):M(p,C))||T);return D>3&&T&&Object.defineProperty(p,C,T),T},v=this&&this.__param||function(x,p){return function(C,L){p(C,L,x)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const o=f(7239),g=f(8055),b=f(8460),y=f(844),d=f(2585),r=g.css.toColor("#ffffff"),c=g.css.toColor("#000000"),l=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 x=[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 C=0;C<216;C++){const L=p[C/36%6|0],M=p[C/6%6|0],D=p[C%6];x.push({css:g.channels.toCss(L,M,D),rgba:g.channels.toRgba(L,M,D)})}for(let C=0;C<24;C++){const L=8+10*C;x.push({css:g.channels.toCss(L,L,L),rgba:g.channels.toRgba(L,L,L)})}return x})());let w=n.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(x){super(),this._optionsService=x,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:c,cursor:l,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(x={}){const p=this._colors;if(p.foreground=S(x.foreground,r),p.background=S(x.background,c),p.cursor=S(x.cursor,l),p.cursorAccent=S(x.cursorAccent,h),p.selectionBackgroundTransparent=S(x.selectionBackground,m),p.selectionBackgroundOpaque=g.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=S(x.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=g.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=x.selectionForeground?S(x.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(x.black,n.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=S(x.red,n.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=S(x.green,n.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=S(x.yellow,n.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=S(x.blue,n.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=S(x.magenta,n.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=S(x.cyan,n.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=S(x.white,n.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=S(x.brightBlack,n.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=S(x.brightRed,n.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=S(x.brightGreen,n.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=S(x.brightYellow,n.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=S(x.brightBlue,n.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=S(x.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=S(x.brightCyan,n.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=S(x.brightWhite,n.DEFAULT_ANSI_COLORS[15]),x.extendedAnsi){const C=Math.min(p.ansi.length-16,x.extendedAnsi.length);for(let L=0;L<C;L++)p.ansi[L+16]=S(x.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(x){this._restoreColor(x),this._onChangeColors.fire(this.colors)}_restoreColor(x){if(x!==void 0)switch(x){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[x]=this._restoreColors.ansi[x]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(x){x(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(x,p){if(x!==void 0)try{return g.css.toColor(x)}catch{}return p}n.ThemeService=w=_([v(0,d.IOptionsService)],w)},6349:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const _=f(8460),v=f(844);class o 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 d=0;d<Math.min(b,this.length);d++)y[d]=this._array[this._getCyclicIndex(d)];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,...d){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+d.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<d.length;r++)this._array[this._getCyclicIndex(b+r)]=d[r];if(d.length&&this.onInsertEmitter.fire({index:b,amount:d.length}),this._length+d.length>this._maxLength){const r=this._length+d.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=d.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,y,d){if(!(y<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+d<0)throw new Error("Cannot shift elements in list beyond index 0");if(d>0){for(let c=y-1;c>=0;c--)this.set(b+c+d,this.get(b+c));const r=b+y+d-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+d,this.get(b+r))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}n.CircularList=o},1439:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function f(_,v=5){if(typeof _!="object")return _;const o=Array.isArray(_)?[]:{};for(const g in _)o[g]=v<=1?_[g]:_[g]&&f(_[g],v-1);return o}},8055:(q,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,o=0;var g,b,y,d,r;function c(h){const m=h.toString(16);return m.length<2?"0"+m:m}function l(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,w,S,x){return x!==void 0?`#${c(m)}${c(w)}${c(S)}${c(x)}`:`#${c(m)}${c(w)}${c(S)}`},h.toRgba=function(m,w,S,x=255){return(m<<24|w<<16|S<<8|x)>>>0},h.toColor=function(m,w,S,x){return{css:h.toCss(m,w,S,x),rgba:h.toRgba(m,w,S,x)}}})(g||(n.channels=g={})),(function(h){function m(w,S){return o=Math.round(255*S),[f,_,v]=r.toChannels(w.rgba),{css:g.toCss(f,_,v,o),rgba:g.toRgba(f,_,v,o)}}h.blend=function(w,S){if(o=(255&S.rgba)/255,o===1)return{css:S.css,rgba:S.rgba};const x=S.rgba>>24&255,p=S.rgba>>16&255,C=S.rgba>>8&255,L=w.rgba>>24&255,M=w.rgba>>16&255,D=w.rgba>>8&255;return f=L+Math.round((x-L)*o),_=M+Math.round((p-M)*o),v=D+Math.round((C-D)*o),{css:g.toCss(f,_,v),rgba:g.toRgba(f,_,v)}},h.isOpaque=function(w){return(255&w.rgba)==255},h.ensureContrastRatio=function(w,S,x){const p=r.ensureContrastRatio(w.rgba,S.rgba,x);if(p)return g.toColor(p>>24&255,p>>16&255,p>>8&255)},h.opaque=function(w){const S=(255|w.rgba)>>>0;return[f,_,v]=r.toChannels(S),{css:g.toCss(f,_,v),rgba:S}},h.opacity=m,h.multiplyOpacity=function(w,S){return o=255&w.rgba,m(w,o*S/255)},h.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}})(b||(n.color=b={})),(function(h){let m,w;try{const S=document.createElement("canvas");S.width=1,S.height=1;const x=S.getContext("2d",{willReadFrequently:!0});x&&(m=x,m.globalCompositeOperation="copy",w=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),o=parseInt(S.slice(4,5).repeat(2),16),g.toColor(f,_,v,o);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 x=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(x)return f=parseInt(x[1]),_=parseInt(x[2]),v=parseInt(x[3]),o=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),g.toColor(f,_,v,o);if(!m||!w)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=w,m.fillStyle=S,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[f,_,v,o]=m.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(f,_,v,o),css:S}}})(y||(n.css=y={})),(function(h){function m(w,S,x){const p=w/255,C=S/255,L=x/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}h.relativeLuminance=function(w){return m(w>>16&255,w>>8&255,255&w)},h.relativeLuminance2=m})(d||(n.rgb=d={})),(function(h){function m(S,x,p){const C=S>>24&255,L=S>>16&255,M=S>>8&255;let D=x>>24&255,T=x>>16&255,j=x>>8&255,X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));for(;X<p&&(D>0||T>0||j>0);)D-=Math.max(0,Math.ceil(.1*D)),T-=Math.max(0,Math.ceil(.1*T)),j-=Math.max(0,Math.ceil(.1*j)),X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));return(D<<24|T<<16|j<<8|255)>>>0}function w(S,x,p){const C=S>>24&255,L=S>>16&255,M=S>>8&255;let D=x>>24&255,T=x>>16&255,j=x>>8&255,X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));for(;X<p&&(D<255||T<255||j<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),T=Math.min(255,T+Math.ceil(.1*(255-T))),j=Math.min(255,j+Math.ceil(.1*(255-j))),X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));return(D<<24|T<<16|j<<8|255)>>>0}h.blend=function(S,x){if(o=(255&x)/255,o===1)return x;const p=x>>24&255,C=x>>16&255,L=x>>8&255,M=S>>24&255,D=S>>16&255,T=S>>8&255;return f=M+Math.round((p-M)*o),_=D+Math.round((C-D)*o),v=T+Math.round((L-T)*o),g.toRgba(f,_,v)},h.ensureContrastRatio=function(S,x,p){const C=d.relativeLuminance(S>>8),L=d.relativeLuminance(x>>8);if(l(C,L)<p){if(L<C){const T=m(S,x,p),j=l(C,d.relativeLuminance(T>>8));if(j<p){const X=w(S,x,p);return j>l(C,d.relativeLuminance(X>>8))?T:X}return T}const M=w(S,x,p),D=l(C,d.relativeLuminance(M>>8));if(D<p){const T=m(S,x,p);return D>l(C,d.relativeLuminance(T>>8))?M:T}return M}},h.reduceLuminance=m,h.increaseLuminance=w,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=l},8969:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const _=f(844),v=f(2585),o=f(4348),g=f(7866),b=f(744),y=f(7302),d=f(6975),r=f(8460),c=f(1753),l=f(1480),h=f(7994),m=f(9282),w=f(5435),S=f(5981),x=f(2660);let p=!1;class C extends _.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((M=>{var D;(D=this._onScrollApi)==null||D.fire(M.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(M){for(const D in M)this.optionsService.options[D]=M[D]}constructor(M){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 o.InstantiationService,this.optionsService=this.register(new y.OptionsService(M)),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(d.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(l.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(x.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.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,T)=>this._inputHandler.parse(D,T)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,D){this._writeBuffer.write(M,D)}writeSync(M,D){this._logService.logLevel<=v.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(M,D)}input(M,D=!0){this.coreService.triggerDataEvent(M,D)}resize(M,D){isNaN(M)||isNaN(D)||(M=Math.max(M,b.MINIMUM_COLS),D=Math.max(D,b.MINIMUM_ROWS),this._bufferService.resize(M,D))}scroll(M,D=!1){this._bufferService.scroll(M,D)}scrollLines(M,D,T){this._bufferService.scrollLines(M,D,T)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const D=M-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(M,D){return this._inputHandler.registerEscHandler(M,D)}registerDcsHandler(M,D){return this._inputHandler.registerDcsHandler(M,D)}registerCsiHandler(M,D){return this._inputHandler.registerCsiHandler(M,D)}registerOscHandler(M,D){return this._inputHandler.registerOscHandler(M,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?M=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,_.toDisposable)((()=>{for(const D of M)D.dispose()}))}}}n.CoreTerminal=C},8460:(q,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 o=0;o<this._listeners.length;o++)v.push(this._listeners[o]);for(let o=0;o<v.length;o++)v[o].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(q,n,f){var _=this&&this.__decorate||function(G,R,z,A){var O,Y=arguments.length,Z=Y<3?R:A===null?A=Object.getOwnPropertyDescriptor(R,z):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(G,R,z,A);else for(var he=G.length-1;he>=0;he--)(O=G[he])&&(Z=(Y<3?O(Z):Y>3?O(R,z,Z):O(R,z))||Z);return Y>3&&Z&&Object.defineProperty(R,z,Z),Z},v=this&&this.__param||function(G,R){return function(z,A){R(z,A,G)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const o=f(2584),g=f(7116),b=f(2015),y=f(844),d=f(482),r=f(8437),c=f(8460),l=f(643),h=f(511),m=f(3734),w=f(2585),S=f(1480),x=f(6242),p=f(6351),C=f(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function D(G,R){if(G>24)return R.setWinLines||!1;switch(G){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 T;(function(G){G[G.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",G[G.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(n.WindowsOptionsReportType=T={}));let j=0;class X extends y.Disposable{getAttrData(){return this._curAttrData}constructor(R,z,A,O,Y,Z,he,ue,F=new b.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=z,this._coreService=A,this._logService=O,this._optionsService=Y,this._oscLinkService=Z,this._coreMouseService=he,this._unicodeService=ue,this._parser=F,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new d.StringToUtf32,this._utf8Decoder=new d.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 U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._parser.setCsiHandlerFallback(((k,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:se.toArray()})})),this._parser.setEscHandlerFallback((k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})})),this._parser.setExecuteHandlerFallback((k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})})),this._parser.setOscHandlerFallback(((k,se,ie)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:se,data:ie})})),this._parser.setDcsHandlerFallback(((k,se,ie)=>{se==="HOOK"&&(ie=ie.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:se,payload:ie})})),this._parser.setPrintHandler(((k,se,ie)=>this.print(k,se,ie))),this._parser.registerCsiHandler({final:"@"},(k=>this.insertChars(k))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(k=>this.scrollLeft(k))),this._parser.registerCsiHandler({final:"A"},(k=>this.cursorUp(k))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(k=>this.scrollRight(k))),this._parser.registerCsiHandler({final:"B"},(k=>this.cursorDown(k))),this._parser.registerCsiHandler({final:"C"},(k=>this.cursorForward(k))),this._parser.registerCsiHandler({final:"D"},(k=>this.cursorBackward(k))),this._parser.registerCsiHandler({final:"E"},(k=>this.cursorNextLine(k))),this._parser.registerCsiHandler({final:"F"},(k=>this.cursorPrecedingLine(k))),this._parser.registerCsiHandler({final:"G"},(k=>this.cursorCharAbsolute(k))),this._parser.registerCsiHandler({final:"H"},(k=>this.cursorPosition(k))),this._parser.registerCsiHandler({final:"I"},(k=>this.cursorForwardTab(k))),this._parser.registerCsiHandler({final:"J"},(k=>this.eraseInDisplay(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(k=>this.eraseInDisplay(k,!0))),this._parser.registerCsiHandler({final:"K"},(k=>this.eraseInLine(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(k=>this.eraseInLine(k,!0))),this._parser.registerCsiHandler({final:"L"},(k=>this.insertLines(k))),this._parser.registerCsiHandler({final:"M"},(k=>this.deleteLines(k))),this._parser.registerCsiHandler({final:"P"},(k=>this.deleteChars(k))),this._parser.registerCsiHandler({final:"S"},(k=>this.scrollUp(k))),this._parser.registerCsiHandler({final:"T"},(k=>this.scrollDown(k))),this._parser.registerCsiHandler({final:"X"},(k=>this.eraseChars(k))),this._parser.registerCsiHandler({final:"Z"},(k=>this.cursorBackwardTab(k))),this._parser.registerCsiHandler({final:"`"},(k=>this.charPosAbsolute(k))),this._parser.registerCsiHandler({final:"a"},(k=>this.hPositionRelative(k))),this._parser.registerCsiHandler({final:"b"},(k=>this.repeatPrecedingCharacter(k))),this._parser.registerCsiHandler({final:"c"},(k=>this.sendDeviceAttributesPrimary(k))),this._parser.registerCsiHandler({prefix:">",final:"c"},(k=>this.sendDeviceAttributesSecondary(k))),this._parser.registerCsiHandler({final:"d"},(k=>this.linePosAbsolute(k))),this._parser.registerCsiHandler({final:"e"},(k=>this.vPositionRelative(k))),this._parser.registerCsiHandler({final:"f"},(k=>this.hVPosition(k))),this._parser.registerCsiHandler({final:"g"},(k=>this.tabClear(k))),this._parser.registerCsiHandler({final:"h"},(k=>this.setMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(k=>this.setModePrivate(k))),this._parser.registerCsiHandler({final:"l"},(k=>this.resetMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(k=>this.resetModePrivate(k))),this._parser.registerCsiHandler({final:"m"},(k=>this.charAttributes(k))),this._parser.registerCsiHandler({final:"n"},(k=>this.deviceStatus(k))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(k=>this.deviceStatusPrivate(k))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(k=>this.softReset(k))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(k=>this.setCursorStyle(k))),this._parser.registerCsiHandler({final:"r"},(k=>this.setScrollRegion(k))),this._parser.registerCsiHandler({final:"s"},(k=>this.saveCursor(k))),this._parser.registerCsiHandler({final:"t"},(k=>this.windowOptions(k))),this._parser.registerCsiHandler({final:"u"},(k=>this.restoreCursor(k))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(k=>this.insertColumns(k))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(k=>this.deleteColumns(k))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(k=>this.selectProtected(k))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(k=>this.requestMode(k,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(k=>this.requestMode(k,!1))),this._parser.setExecuteHandler(o.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(o.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(o.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(o.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(o.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(o.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(o.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(o.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(o.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new x.OscHandler((k=>(this.setTitle(k),this.setIconName(k),!0)))),this._parser.registerOscHandler(1,new x.OscHandler((k=>this.setIconName(k)))),this._parser.registerOscHandler(2,new x.OscHandler((k=>this.setTitle(k)))),this._parser.registerOscHandler(4,new x.OscHandler((k=>this.setOrReportIndexedColor(k)))),this._parser.registerOscHandler(8,new x.OscHandler((k=>this.setHyperlink(k)))),this._parser.registerOscHandler(10,new x.OscHandler((k=>this.setOrReportFgColor(k)))),this._parser.registerOscHandler(11,new x.OscHandler((k=>this.setOrReportBgColor(k)))),this._parser.registerOscHandler(12,new x.OscHandler((k=>this.setOrReportCursorColor(k)))),this._parser.registerOscHandler(104,new x.OscHandler((k=>this.restoreIndexedColor(k)))),this._parser.registerOscHandler(110,new x.OscHandler((k=>this.restoreFgColor(k)))),this._parser.registerOscHandler(111,new x.OscHandler((k=>this.restoreBgColor(k)))),this._parser.registerOscHandler(112,new x.OscHandler((k=>this.restoreCursorColor(k)))),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 k in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},(()=>this.selectCharset("("+k))),this._parser.registerEscHandler({intermediates:")",final:k},(()=>this.selectCharset(")"+k))),this._parser.registerEscHandler({intermediates:"*",final:k},(()=>this.selectCharset("*"+k))),this._parser.registerEscHandler({intermediates:"+",final:k},(()=>this.selectCharset("+"+k))),this._parser.registerEscHandler({intermediates:"-",final:k},(()=>this.selectCharset("-"+k))),this._parser.registerEscHandler({intermediates:".",final:k},(()=>this.selectCharset("."+k))),this._parser.registerEscHandler({intermediates:"/",final:k},(()=>this.selectCharset("/"+k)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((k=>(this._logService.error("Parsing error: ",k),k))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler(((k,se)=>this.requestStatusString(k,se))))}_preserveStack(R,z,A,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=A,this._parseStack.position=O}_logSlowResolvingAsync(R){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([R,new Promise(((z,A)=>setTimeout((()=>A("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,z){let A,O=this._activeBuffer.x,Y=this._activeBuffer.y,Z=0;const he=this._parseStack.paused;if(he){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(A),A;O=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>M&&(Z=this._parseStack.position+M)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,(k=>String.fromCharCode(k))).join("")}"`),typeof R=="string"?R.split("").map((k=>k.charCodeAt(0))):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(R.length,M))),he||this._dirtyRowTracker.clearRange(),R.length>M)for(let k=Z;k<R.length;k+=M){const se=k+M<R.length?k+M:R.length,ie=typeof R=="string"?this._stringDecoder.decode(R.substring(k,se),this._parseBuffer):this._utf8Decoder.decode(R.subarray(k,se),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,ie))return this._preserveStack(O,Y,ie,k),this._logSlowResolvingAsync(A),A}else if(!he){const k=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,k))return this._preserveStack(O,Y,k,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===O&&this._activeBuffer.y===Y||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),F=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);F<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(F,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(R,z,A){let O,Y;const Z=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,se=this._curAttrData;let ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-z>0&&ie.getWidth(this._activeBuffer.x-1)===2&&ie.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let _e=this._parser.precedingJoinState;for(let de=z;de<A;++de){if(O=R[de],O<127&&Z){const Qe=Z[String.fromCharCode(O)];Qe&&(O=Qe.charCodeAt(0))}const we=this._unicodeService.charProperties(O,_e);Y=S.UnicodeService.extractWidth(we);const pe=S.UnicodeService.extractShouldJoin(we),He=pe?S.UnicodeService.extractWidth(_e):0;if(_e=we,he&&this._onA11yChar.fire((0,d.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-He>ue){if(F){const Qe=ie;let be=this._activeBuffer.x-He;for(this._activeBuffer.x=He,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),ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&ie instanceof r.BufferLine&&ie.copyCellsFrom(Qe,be,0,He,!1);be<ue;)Qe.setCellFromCodepoint(be++,0,1,se)}else if(this._activeBuffer.x=ue-1,Y===2)continue}if(pe&&this._activeBuffer.x){const Qe=ie.getWidth(this._activeBuffer.x-1)?1:2;ie.addCodepointToCell(this._activeBuffer.x-Qe,O,Y);for(let be=Y-He;--be>=0;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(k&&(ie.insertCells(this._activeBuffer.x,Y-He,this._activeBuffer.getNullCell(se)),ie.getWidth(ue-1)===2&&ie.setCellFromCodepoint(ue-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,se)),ie.setCellFromCodepoint(this._activeBuffer.x++,O,Y,se),Y>0)for(;--Y;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=_e,this._activeBuffer.x<ue&&A-z>0&&ie.getWidth(this._activeBuffer.x)===0&&!ie.hasContent(this._activeBuffer.x)&&ie.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,z){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,z):this._parser.registerCsiHandler(R,(A=>!D(A.params[0],this._optionsService.rawOptions.windowOptions)||z(A)))}registerDcsHandler(R,z){return this._parser.registerDcsHandler(R,new p.DcsHandler(z))}registerEscHandler(R,z){return this._parser.registerEscHandler(R,z)}registerOscHandler(R,z){return this._parser.registerOscHandler(R,new x.OscHandler(z))}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 z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);z.hasWidth(this._activeBuffer.x)&&!z.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,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=R,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+z)}cursorUp(R){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,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 z=R.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=R.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=R.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const z=R.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,z,A,O=!1,Y=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);Z.replaceCells(z,A,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),O&&(Z.isWrapped=!1)}_resetBufferLine(R,z=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),A.isWrapped=!1)}eraseInDisplay(R,z=!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,z);A<this._bufferService.rows;A++)this._resetBufferLine(A,z);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,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,z);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(R,z=!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,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let z=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,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;z--;)this._activeBuffer.lines.splice(Y-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 z=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 O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;z--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(O,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 z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.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 z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let z=R.params[0]||1;for(;z--;)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 z=R.params[0]||1;for(;z--;)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 z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.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 z=this._parser.precedingJoinState;if(!z)return!0;const A=R.params[0]||1,O=S.UnicodeService.extractWidth(z),Y=this._activeBuffer.x-O,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),he=new Uint32Array(Z.length*A);let ue=0;for(let k=0;k<Z.length;){const se=Z.codePointAt(k)||0;he[ue++]=se,k+=se>65535?2:1}let F=ue;for(let k=1;k<A;++k)he.copyWithin(F,0,ue),F+=ue;return this.print(he,0,F),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let z=0;z<R.length;z++)switch(R.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let z=0;z<R.length;z++)switch(R.params[z]){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 z=0;z<R.length;z++)switch(R.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let z=0;z<R.length;z++)switch(R.params[z]){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[z]===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,z){const A=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:Y}=this._coreMouseService,Z=this._coreService,{buffers:he,cols:ue}=this._bufferService,{active:F,alt:k}=he,se=this._optionsService.rawOptions,ie=pe=>pe?1:2,_e=R.params[0];return de=_e,we=z?_e===2?4:_e===4?ie(Z.modes.insertMode):_e===12?3:_e===20?ie(se.convertEol):0:_e===1?ie(A.applicationCursorKeys):_e===3?se.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:_e===6?ie(A.origin):_e===7?ie(A.wraparound):_e===8?3:_e===9?ie(O==="X10"):_e===12?ie(se.cursorBlink):_e===25?ie(!Z.isCursorHidden):_e===45?ie(A.reverseWraparound):_e===66?ie(A.applicationKeypad):_e===67?4:_e===1e3?ie(O==="VT200"):_e===1002?ie(O==="DRAG"):_e===1003?ie(O==="ANY"):_e===1004?ie(A.sendFocus):_e===1005?4:_e===1006?ie(Y==="SGR"):_e===1015?4:_e===1016?ie(Y==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?ie(F===k):_e===2004?ie(A.bracketedPasteMode):0,Z.triggerDataEvent(`${o.C0.ESC}[${z?"":"?"}${de};${we}$y`),!0;var de,we}_updateAttrColor(R,z,A,O,Y){return z===2?(R|=50331648,R&=-16777216,R|=m.AttributeData.fromColorRGB([A,O,Y])):z===5&&(R&=-50331904,R|=33554432|255&A),R}_extractColor(R,z,A){const O=[0,0,-1,0,0,0];let Y=0,Z=0;do{if(O[Z+Y]=R.params[z+Z],R.hasSubParams(z+Z)){const he=R.getSubParams(z+Z);let ue=0;do O[1]===5&&(Y=1),O[Z+ue+1+Y]=he[ue];while(++ue<he.length&&ue+Z+1+Y<O.length);break}if(O[1]===5&&Z+Y>=2||O[1]===2&&Z+Y>=5)break;O[1]&&(Y=1)}while(++Z+z<R.length&&Z+Y<O.length);for(let he=2;he<O.length;++he)O[he]===-1&&(O[he]=0);switch(O[0]){case 38:A.fg=this._updateAttrColor(A.fg,O[1],O[3],O[4],O[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,O[1],O[3],O[4],O[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,O[1],O[3],O[4],O[5])}return Z}_processUnderline(R,z){z.extended=z.extended.clone(),(!~R||R>5)&&(R=1),z.extended.underlineStyle=R,z.fg|=268435456,R===0&&(z.fg&=-268435457),z.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 z=R.length;let A;const O=this._curAttrData;for(let Y=0;Y<z;Y++)A=R.params[Y],A>=30&&A<=37?(O.fg&=-50331904,O.fg|=16777216|A-30):A>=40&&A<=47?(O.bg&=-50331904,O.bg|=16777216|A-40):A>=90&&A<=97?(O.fg&=-50331904,O.fg|=16777224|A-90):A>=100&&A<=107?(O.bg&=-50331904,O.bg|=16777224|A-100):A===0?this._processSGR0(O):A===1?O.fg|=134217728:A===3?O.bg|=67108864:A===4?(O.fg|=268435456,this._processUnderline(R.hasSubParams(Y)?R.getSubParams(Y)[0]:1,O)):A===5?O.fg|=536870912:A===7?O.fg|=67108864:A===8?O.fg|=1073741824:A===9?O.fg|=2147483648:A===2?O.bg|=134217728:A===21?this._processUnderline(2,O):A===22?(O.fg&=-134217729,O.bg&=-134217729):A===23?O.bg&=-67108865:A===24?(O.fg&=-268435457,this._processUnderline(0,O)):A===25?O.fg&=-536870913:A===27?O.fg&=-67108865:A===28?O.fg&=-1073741825:A===29?O.fg&=2147483647:A===39?(O.fg&=-67108864,O.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):A===49?(O.bg&=-67108864,O.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?Y+=this._extractColor(R,Y,O):A===53?O.bg|=1073741824:A===55?O.bg&=-1073741825:A===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):A===100?(O.fg&=-67108864,O.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.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(`${o.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${z};${A}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const z=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${z};${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 z=R.params[0]||1;switch(z){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=z%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(R){const z=R.params[0]||1;let A;return(R.length<2||(A=R.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>z&&(this._activeBuffer.scrollTop=z-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 z=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==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 z=[],A=R.split(";");for(;A.length>1;){const O=A.shift(),Y=A.shift();if(/^\d+$/.exec(O)){const Z=parseInt(O);if(P(Z))if(Y==="?")z.push({type:0,index:Z});else{const he=(0,C.parseColor)(Y);he&&z.push({type:1,index:Z,color:he})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(R){const z=R.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(R,z){this._getCurrentLinkId()&&this._finishHyperlink();const A=R.split(":");let O;const Y=A.findIndex((Z=>Z.startsWith("id=")));return Y!==-1&&(O=A[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,z){const A=R.split(";");for(let O=0;O<A.length&&!(z>=this._specialColors.length);++O,++z)if(A[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const Y=(0,C.parseColor)(A[O]);Y&&this._onColor.fire([{type:1,index:this._specialColors[z],color:Y}])}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 z=[],A=R.split(";");for(let O=0;O<A.length;++O)if(/^\d+$/.exec(A[O])){const Y=parseInt(A[O]);P(Y)&&z.push({type:2,index:Y})}return z.length&&this._onColor.fire(z),!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 z=0;z<this._bufferService.rows;++z){const A=this._activeBuffer.ybase+this._activeBuffer.y+z,O=this._activeBuffer.lines.get(A);O&&(O.fill(R),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,z){const A=this._bufferService.buffer,O=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${Y}${o.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}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,z){this._dirtyRowTracker.markRangeDirty(R,z)}}n.InputHandler=X;let U=class{constructor(G){this._bufferService=G,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(G){G<this.start?this.start=G:G>this.end&&(this.end=G)}markRangeDirty(G,R){G>R&&(j=G,G=R,R=j),G<this.start&&(this.start=G),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function P(G){return 0<=G&&G<256}U=_([v(0,w.IBufferService)],U)},844:(q,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:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(v,o,g){this._data[v]||(this._data[v]={}),this._data[v][o]=g}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}n.TwoKeyMap=f,n.FourKeyMap=class{constructor(){this._data=new f}set(_,v,o,g,b){this._data.get(_,v)||this._data.set(_,v,new f),this._data.get(_,v).set(o,g,b)}get(_,v,o,g){var b;return(b=this._data.get(_,v))==null?void 0:b.get(o,g)}clear(){this._data.clear()}}},6114:(q,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:(q,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,o=this._array.length-1;for(;o>=v;){let g=v+o>>1;const b=this._getKey(this._array[g]);if(b>_)o=g-1;else{if(!(b<_)){for(;g>0&&this._getKey(this._array[g-1])===_;)g--;return g}v=g+1}}return v}}},7226:(q,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,d=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),d=Math.max(y,d),c=b.timeRemaining(),1.5*d>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 o 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=o,n.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:o,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const _=f(643);n.updateWindowsModeWrappedState=function(v){const o=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),g=o==null?void 0:o.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:(q,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(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new f;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}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(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,g=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=g}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=_},9092:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const _=f(6349),v=f(7226),o=f(3734),g=f(8437),b=f(4634),y=f(511),d=f(643),r=f(4863),c=f(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(l,h,m){this._hasScrollback=l,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,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,d.WHITESPACE_CELL_CHAR,d.WHITESPACE_CELL_WIDTH,d.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(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,h){return new g.BufferLine(this._bufferService.cols,this.getNullCell(l),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const h=l+this._optionsService.rawOptions.scrollback;return h>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:h}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=g.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(l))}}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(l,h){const m=this.getNullCell(g.DEFAULT_ATTR_DATA);let w=0;const S=this._getCorrectBufferLength(h);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<l)for(let p=0;p<this.lines.length;p++)w+=+this.lines.get(p).resize(l,m);let x=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(l,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+x+1?(this.ybase--,x++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(l,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,l-1),this.y=Math.min(this.y,h-1),x&&(this.y+=x),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(l,h),this._cols>l))for(let x=0;x<this.lines.length;x++)w+=+this.lines.get(x).resize(l,m);this._cols=l,this._rows=h,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,h){this._cols!==l&&(l>this._cols?this._reflowLarger(l,h):this._reflowSmaller(l,h))}_reflowLarger(l,h){const m=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(m.length>0){const w=(0,b.reflowLargerCreateNewLayout)(this.lines,m);(0,b.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(l,h,w.countRemoved)}}_reflowLargerAdjustViewport(l,h,m){const w=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(l,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(l,h){const m=this.getNullCell(g.DEFAULT_ATTR_DATA),w=[];let S=0;for(let x=this.lines.length-1;x>=0;x--){let p=this.lines.get(x);if(!p||!p.isWrapped&&p.getTrimmedLength()<=l)continue;const C=[p];for(;p.isWrapped&&x>0;)p=this.lines.get(--x),C.unshift(p);const L=this.ybase+this.y;if(L>=x&&L<x+C.length)continue;const M=C[C.length-1].getTrimmedLength(),D=(0,b.reflowSmallerGetNewLineLengths)(C,this._cols,l),T=D.length-C.length;let j;j=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const X=[];for(let A=0;A<T;A++){const O=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);X.push(O)}X.length>0&&(w.push({start:x+C.length+S,newLines:X}),S+=X.length),C.push(...X);let U=D.length-1,P=D[U];P===0&&(U--,P=D[U]);let G=C.length-T-1,R=M;for(;G>=0;){const A=Math.min(R,P);if(C[U]===void 0)break;if(C[U].copyCellsFrom(C[G],R-A,P-A,A,!0),P-=A,P===0&&(U--,P=D[U]),R-=A,R===0){G--;const O=Math.max(G,0);R=(0,b.getWrappedLineTrimmedLength)(C,O,this._cols)}}for(let A=0;A<C.length;A++)D[A]<l&&C[A].setCell(D[A],m);let z=T-j;for(;z-- >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+T,this.ybase+h-1)}if(w.length>0){const x=[],p=[];for(let U=0;U<this.lines.length;U++)p.push(this.lines.get(U));const C=this.lines.length;let L=C-1,M=0,D=w[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let T=0;for(let U=Math.min(this.lines.maxLength-1,C+S-1);U>=0;U--)if(D&&D.start>L+T){for(let P=D.newLines.length-1;P>=0;P--)this.lines.set(U--,D.newLines[P]);U++,x.push({index:L+1,amount:D.newLines.length}),T+=D.newLines.length,D=w[++M]}else this.lines.set(U,p[L--]);let j=0;for(let U=x.length-1;U>=0;U--)x[U].index+=j,this.lines.onInsertEmitter.fire(x[U]),j+=x[U].amount;const X=Math.max(0,C+S-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(l,h,m=0,w){const S=this.lines.get(l);return S?S.translateToString(h,m,w):""}getWrappedRangeForLine(l){let h=l,m=l;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(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===l&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const h=new r.Marker(l);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(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const _=f(3734),v=f(511),o=f(643),g=f(482);n.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let b=0;class y{constructor(r,c,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const h=c||v.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.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],l=2097151&c;return[this._data[3*r+1],2097152&c?this._combined[r]:l?(0,g.stringFromCodePoint)(l):"",c>>22,2097152&c?this._combined[r].charCodeAt(this._combined[r].length-1):l]}set(r,c){this._data[3*r+1]=c[o.CHAR_DATA_ATTR_INDEX],c[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=c[1],this._data[3*r+0]=2097152|r|c[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=c[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[o.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,l,h){268435456&h.bg&&(this._extendedAttrs[r]=h.extended),this._data[3*r+0]=c|l<<22,this._data[3*r+1]=h.fg,this._data[3*r+2]=h.bg}addCodepointToCell(r,c,l){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,l&&(h&=-12582913,h|=l<<22),this._data[3*r+0]=h}insertCells(r,c,l){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),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,l)}else for(let h=r;h<this.length;++h)this.setCell(h,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(r,c,l){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,l)}else for(let h=r;h<this.length;++h)this.setCell(h,l);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,l)}replaceCells(r,c,l,h=!1){if(h)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,l),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,l);r<c&&r<this.length;)this.isProtected(r)||this.setCell(r,l),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,l);r<c&&r<this.length;)this.setCell(r++,l)}resize(r,c){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const h=new Uint32Array(l);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,l);const h=Object.keys(this._combined);for(let w=0;w<h.length;w++){const S=parseInt(h[w],10);S>=r&&delete this._combined[S]}const m=Object.keys(this._extendedAttrs);for(let w=0;w<m.length;w++){const S=parseInt(m[w],10);S>=r&&delete this._extendedAttrs[S]}}return this.length=r,4*l*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 l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,r);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,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,l,h,m){const w=r._data;if(m)for(let x=h-1;x>=0;x--){for(let p=0;p<3;p++)this._data[3*(l+x)+p]=w[3*(c+x)+p];268435456&w[3*(c+x)+2]&&(this._extendedAttrs[l+x]=r._extendedAttrs[c+x])}else for(let x=0;x<h;x++){for(let p=0;p<3;p++)this._data[3*(l+x)+p]=w[3*(c+x)+p];268435456&w[3*(c+x)+2]&&(this._extendedAttrs[l+x]=r._extendedAttrs[c+x])}const S=Object.keys(r._combined);for(let x=0;x<S.length;x++){const p=parseInt(S[x],10);p>=c&&(this._combined[p-c+l]=r._combined[p])}}translateToString(r,c,l,h){c=c??0,l=l??this.length,r&&(l=Math.min(l,this.getTrimmedLength())),h&&(h.length=0);let m="";for(;c<l;){const w=this._data[3*c+0],S=2097151&w,x=2097152&w?this._combined[c]:S?(0,g.stringFromCodePoint)(S):o.WHITESPACE_CELL_CHAR;if(m+=x,h)for(let p=0;p<x.length;++p)h.push(c);c+=w>>22||1}return h&&h.push(c),m}}n.BufferLine=y},4841:(q,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:(q,n)=>{function f(_,v,o){if(v===_.length-1)return _[v].getTrimmedLength();const g=!_[v].hasContent(o-1)&&_[v].getWidth(o-1)===1,b=_[v+1].getWidth(0)===2;return g&&b?o-1:o}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(_,v,o,g,b){const y=[];for(let d=0;d<_.length-1;d++){let r=d,c=_.get(++r);if(!c.isWrapped)continue;const l=[_.get(d)];for(;r<_.length&&c.isWrapped;)l.push(c),c=_.get(++r);if(g>=d&&g<r){d+=l.length-1;continue}let h=0,m=f(l,h,v),w=1,S=0;for(;w<l.length;){const p=f(l,w,v),C=p-S,L=o-m,M=Math.min(C,L);l[h].copyCellsFrom(l[w],S,m,M,!1),m+=M,m===o&&(h++,m=0),S+=M,S===p&&(w++,S=0),m===0&&h!==0&&l[h-1].getWidth(o-1)===2&&(l[h].copyCellsFrom(l[h-1],o-1,m++,1,!1),l[h-1].setCell(o-1,b))}l[h].replaceCells(m,o,b);let x=0;for(let p=l.length-1;p>0&&(p>h||l[p].getTrimmedLength()===0);p--)x++;x>0&&(y.push(d+l.length-x),y.push(x)),d+=l.length-1}return y},n.reflowLargerCreateNewLayout=function(_,v){const o=[];let g=0,b=v[g],y=0;for(let d=0;d<_.length;d++)if(b===d){const r=v[++g];_.onDeleteEmitter.fire({index:d-y,amount:r}),d+=r-1,y+=r,b=v[++g]}else o.push(d);return{layout:o,countRemoved:y}},n.reflowLargerApplyNewLayout=function(_,v){const o=[];for(let g=0;g<v.length;g++)o.push(_.get(v[g]));for(let g=0;g<o.length;g++)_.set(g,o[g]);_.length=v.length},n.reflowSmallerGetNewLineLengths=function(_,v,o){const g=[],b=_.map(((c,l)=>f(_,l,v))).reduce(((c,l)=>c+l));let y=0,d=0,r=0;for(;r<b;){if(b-r<o){g.push(b-r);break}y+=o;const c=f(_,d,v);y>c&&(y-=c,d++);const l=_[d].getWidth(y-1)===2;l&&y--;const h=l?o-1:o;g.push(h),r+=h}return g},n.getWrappedLineTrimmedLength=f},5295:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const _=f(8460),v=f(844),o=f(9092);class g extends v.Disposable{constructor(y,d){super(),this._optionsService=y,this._bufferService=d,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 o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.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,d){this._normal.resize(y,d),this._alt.resize(y,d),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}n.BufferSet=g},511:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const _=f(482),v=f(643),o=f(3734);class g extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const d=new g;return d.setFromCharData(y),d}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 d=!1;if(y[v.CHAR_DATA_CHAR_INDEX].length>2)d=!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:d=!0}else d=!0}else this.content=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[v.CHAR_DATA_WIDTH_INDEX]<<22;d&&(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:(q,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:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const _=f(8460),v=f(844);class o{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=o._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=o,o._nextId=1},7116:(q,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:(q,n)=>{var f,_,v;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
56
+ `,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL=""})(f||(n.C0=f={})),(function(o){o.PAD="€",o.HOP="",o.BPH="‚",o.NBH="ƒ",o.IND="„",o.NEL="…",o.SSA="†",o.ESA="‡",o.HTS="ˆ",o.HTJ="‰",o.VTS="Š",o.PLD="‹",o.PLU="Œ",o.RI="",o.SS2="Ž",o.SS3="",o.DCS="",o.PU1="‘",o.PU2="’",o.STS="“",o.CCH="”",o.MW="•",o.SPA="–",o.EPA="—",o.SOS="˜",o.SGCI="™",o.SCI="š",o.CSI="›",o.ST="œ",o.OSC="",o.PM="ž",o.APC="Ÿ"})(_||(n.C1=_={})),(function(o){o.ST=`${f.ESC}\\`})(v||(n.C1_ESCAPED=v={}))},7399:(q,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(o,g,b,y){const d={type:0,cancel:!1,key:void 0},r=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?d.key=g?_.C0.ESC+"OA":_.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?d.key=g?_.C0.ESC+"OD":_.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?d.key=g?_.C0.ESC+"OC":_.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(d.key=g?_.C0.ESC+"OB":_.C0.ESC+"[B");break;case 8:d.key=o.ctrlKey?"\b":_.C0.DEL,o.altKey&&(d.key=_.C0.ESC+d.key);break;case 9:if(o.shiftKey){d.key=_.C0.ESC+"[Z";break}d.key=_.C0.HT,d.cancel=!0;break;case 13:d.key=o.altKey?_.C0.ESC+_.C0.CR:_.C0.CR,d.cancel=!0;break;case 27:d.key=_.C0.ESC,o.altKey&&(d.key=_.C0.ESC+_.C0.ESC),d.cancel=!0;break;case 37:if(o.metaKey)break;r?(d.key=_.C0.ESC+"[1;"+(r+1)+"D",d.key===_.C0.ESC+"[1;3D"&&(d.key=_.C0.ESC+(b?"b":"[1;5D"))):d.key=g?_.C0.ESC+"OD":_.C0.ESC+"[D";break;case 39:if(o.metaKey)break;r?(d.key=_.C0.ESC+"[1;"+(r+1)+"C",d.key===_.C0.ESC+"[1;3C"&&(d.key=_.C0.ESC+(b?"f":"[1;5C"))):d.key=g?_.C0.ESC+"OC":_.C0.ESC+"[C";break;case 38:if(o.metaKey)break;r?(d.key=_.C0.ESC+"[1;"+(r+1)+"A",b||d.key!==_.C0.ESC+"[1;3A"||(d.key=_.C0.ESC+"[1;5A")):d.key=g?_.C0.ESC+"OA":_.C0.ESC+"[A";break;case 40:if(o.metaKey)break;r?(d.key=_.C0.ESC+"[1;"+(r+1)+"B",b||d.key!==_.C0.ESC+"[1;3B"||(d.key=_.C0.ESC+"[1;5B")):d.key=g?_.C0.ESC+"OB":_.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(d.key=_.C0.ESC+"[2~");break;case 46:d.key=r?_.C0.ESC+"[3;"+(r+1)+"~":_.C0.ESC+"[3~";break;case 36:d.key=r?_.C0.ESC+"[1;"+(r+1)+"H":g?_.C0.ESC+"OH":_.C0.ESC+"[H";break;case 35:d.key=r?_.C0.ESC+"[1;"+(r+1)+"F":g?_.C0.ESC+"OF":_.C0.ESC+"[F";break;case 33:o.shiftKey?d.type=2:o.ctrlKey?d.key=_.C0.ESC+"[5;"+(r+1)+"~":d.key=_.C0.ESC+"[5~";break;case 34:o.shiftKey?d.type=3:o.ctrlKey?d.key=_.C0.ESC+"[6;"+(r+1)+"~":d.key=_.C0.ESC+"[6~";break;case 112:d.key=r?_.C0.ESC+"[1;"+(r+1)+"P":_.C0.ESC+"OP";break;case 113:d.key=r?_.C0.ESC+"[1;"+(r+1)+"Q":_.C0.ESC+"OQ";break;case 114:d.key=r?_.C0.ESC+"[1;"+(r+1)+"R":_.C0.ESC+"OR";break;case 115:d.key=r?_.C0.ESC+"[1;"+(r+1)+"S":_.C0.ESC+"OS";break;case 116:d.key=r?_.C0.ESC+"[15;"+(r+1)+"~":_.C0.ESC+"[15~";break;case 117:d.key=r?_.C0.ESC+"[17;"+(r+1)+"~":_.C0.ESC+"[17~";break;case 118:d.key=r?_.C0.ESC+"[18;"+(r+1)+"~":_.C0.ESC+"[18~";break;case 119:d.key=r?_.C0.ESC+"[19;"+(r+1)+"~":_.C0.ESC+"[19~";break;case 120:d.key=r?_.C0.ESC+"[20;"+(r+1)+"~":_.C0.ESC+"[20~";break;case 121:d.key=r?_.C0.ESC+"[21;"+(r+1)+"~":_.C0.ESC+"[21~";break;case 122:d.key=r?_.C0.ESC+"[23;"+(r+1)+"~":_.C0.ESC+"[23~";break;case 123:d.key=r?_.C0.ESC+"[24;"+(r+1)+"~":_.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(b&&!y||!o.altKey||o.metaKey)!b||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?d.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(d.key=_.C0.US),o.key==="@"&&(d.key=_.C0.NUL)):o.keyCode===65&&(d.type=1);else{const c=v[o.keyCode],l=c==null?void 0:c[o.shiftKey?1:0];if(l)d.key=_.C0.ESC+l;else if(o.keyCode>=65&&o.keyCode<=90){const h=o.ctrlKey?o.keyCode-64:o.keyCode+32;let m=String.fromCharCode(h);o.shiftKey&&(m=m.toUpperCase()),d.key=_.C0.ESC+m}else if(o.keyCode===32)d.key=_.C0.ESC+(o.ctrlKey?_.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let h=o.code.slice(3,4);o.shiftKey||(h=h.toLowerCase()),d.key=_.C0.ESC+h,d.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?d.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?d.key=_.C0.NUL:o.keyCode>=51&&o.keyCode<=55?d.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?d.key=_.C0.DEL:o.keyCode===219?d.key=_.C0.ESC:o.keyCode===220?d.key=_.C0.FS:o.keyCode===221&&(d.key=_.C0.GS)}return d}},482:(q,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 o="";for(let g=_;g<v;++g){let b=f[g];b>65535?(b-=65536,o+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):o+=String.fromCharCode(b)}return o},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,_){const v=f.length;if(!v)return 0;let o=0,g=0;if(this._interim){const b=f.charCodeAt(g++);56320<=b&&b<=57343?_[o++]=1024*(this._interim-55296)+b-56320+65536:(_[o++]=this._interim,_[o++]=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,o;const d=f.charCodeAt(b);56320<=d&&d<=57343?_[o++]=1024*(y-55296)+d-56320+65536:(_[o++]=y,_[o++]=d)}else y!==65279&&(_[o++]=y)}return o}},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 o,g,b,y,d=0,r=0,c=0;if(this.interim[0]){let m=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let S,x=0;for(;(S=63&this.interim[++x])&&x<4;)w<<=6,w|=S;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=p-x;for(;c<C;){if(c>=v)return 0;if(S=f[c++],(192&S)!=128){c--,m=!0;break}this.interim[x++]=S,w<<=6,w|=63&S}m||(p===2?w<128?c--:_[d++]=w:p===3?w<2048||w>=55296&&w<=57343||w===65279||(_[d++]=w):w<65536||w>1114111||(_[d++]=w)),this.interim.fill(0)}const l=v-4;let h=c;for(;h<v;){for(;!(!(h<l)||128&(o=f[h])||128&(g=f[h+1])||128&(b=f[h+2])||128&(y=f[h+3]));)_[d++]=o,_[d++]=g,_[d++]=b,_[d++]=y,h+=4;if(o=f[h++],o<128)_[d++]=o;else if((224&o)==192){if(h>=v)return this.interim[0]=o,d;if(g=f[h++],(192&g)!=128){h--;continue}if(r=(31&o)<<6|63&g,r<128){h--;continue}_[d++]=r}else if((240&o)==224){if(h>=v)return this.interim[0]=o,d;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=g,d;if(b=f[h++],(192&b)!=128){h--;continue}if(r=(15&o)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;_[d++]=r}else if((248&o)==240){if(h>=v)return this.interim[0]=o,d;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=g,d;if(b=f[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=g,this.interim[2]=b,d;if(y=f[h++],(192&y)!=128){h--;continue}if(r=(7&o)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;_[d++]=r}}return d}}},225:(q,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]],o=[[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,d){let r,c=0,l=d.length-1;if(y<d[0][0]||y>d[l][1])return!1;for(;l>=c;)if(r=c+l>>1,y>d[r][1])c=r+1;else{if(!(y<d[r][0]))return!0;l=r-1}return!1})(b,o)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,y){let d=this.wcwidth(b),r=d===0&&y!==0;if(r){const c=_.UnicodeService.extractWidth(y);c===0?r=!1:c>d&&(d=c)}return _.UnicodeService.createPropertyValue(0,d,r)}}},5981:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const _=f(8460),v=f(844);class o 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 d;for(this._isSyncWriting=!0;d=this._writeBuffer.shift();){this._action(d);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 d=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()-d>=12?setTimeout((()=>this._innerWrite(0,m))):this._innerWrite(d,m);return void c.catch((m=>(queueMicrotask((()=>{throw m})),Promise.resolve(!1)))).then(h)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-d>=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=o},5941:(q,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(o,g){const b=o.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(o){if(!o)return;let g=o.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 d=0;d<3;++d){const r=parseInt(g.slice(b*d,b*d+b),16);y[d]=b===1?r<<4:b===2?r:b===3?r>>4:r>>8}return y}},n.toRgbString=function(o,g=16){const[b,y,d]=o;return`rgb:${v(b,g)}/${v(y,g)}/${v(d,g)}`}},5770:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const _=f(482),v=f(8742),o=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,d){this._handlers[y]===void 0&&(this._handlers[y]=[]);const r=this._handlers[y];return r.push(d),{dispose:()=>{const c=r.indexOf(d);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,d){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(d);else this._handlerFb(this._ident,"HOOK",d)}put(y,d,r){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(y,d,r);else this._handlerFb(this._ident,"PUT",(0,_.utf32ToString)(y,d,r))}unhook(y,d=!0){if(this._active.length){let r=!1,c=this._active.length-1,l=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,r=d,l=this._stack.fallThrough,this._stack.paused=!1),!l&&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,d,r){this._hitLimit||(this._data+=(0,_.utf32ToString)(y,d,r),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let d=!1;if(this._hitLimit)d=!1;else if(y&&(d=this._handler(this._data,this._params),d instanceof Promise))return d.then((r=>(this._params=b,this._data="",this._hitLimit=!1,r)));return this._params=b,this._data="",this._hitLimit=!1,d}}},2015:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const _=f(844),v=f(8742),o=f(6242),g=f(6351);class b{constructor(c){this.table=new Uint8Array(c)}setDefault(c,l){this.table.fill(c<<4|l)}add(c,l,h,m){this.table[l<<8|c]=h<<4|m}addMany(c,l,h,m){for(let w=0;w<c.length;w++)this.table[l<<8|c[w]]=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(((x,p)=>p)),l=(x,p)=>c.slice(x,p),h=l(32,127),m=l(0,24);m.push(25),m.push.apply(m,l(28,32));const w=l(0,14);let S;for(S in r.setDefault(1,0),r.addMany(h,0,2,0),w)r.addMany([24,26,153,154],S,3,0),r.addMany(l(128,144),S,3,0),r.addMany(l(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(l(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(l(64,127),3,7,0),r.addMany(l(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(l(48,60),4,8,4),r.addMany(l(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(l(32,64),6,0,6),r.add(127,6,0,6),r.addMany(l(64,127),6,0,0),r.addMany(l(32,48),3,9,5),r.addMany(l(32,48),5,9,5),r.addMany(l(48,64),5,0,6),r.addMany(l(64,127),5,7,0),r.addMany(l(32,48),4,9,5),r.addMany(l(32,48),1,9,2),r.addMany(l(32,48),2,9,2),r.addMany(l(48,127),2,10,0),r.addMany(l(48,80),1,10,0),r.addMany(l(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(l(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(l(28,32),9,0,9),r.addMany(l(32,48),9,9,12),r.addMany(l(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(m,11,0,11),r.addMany(l(32,128),11,0,11),r.addMany(l(28,32),11,0,11),r.addMany(m,10,0,10),r.add(127,10,0,10),r.addMany(l(28,32),10,0,10),r.addMany(l(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(l(32,48),10,9,12),r.addMany(m,12,0,12),r.add(127,12,0,12),r.addMany(l(28,32),12,0,12),r.addMany(l(32,48),12,9,12),r.addMany(l(48,64),12,0,11),r.addMany(l(64,127),12,12,13),r.addMany(l(64,127),10,12,13),r.addMany(l(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 d 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=(l,h,m)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,h)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,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 o.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,l=[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 w=0;w<c.intermediates.length;++w){const S=c.intermediates.charCodeAt(w);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(l[0]>m||m>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return h<<=8,h|=m,h}identToString(c){const l=[];for(;c;)l.push(String.fromCharCode(255&c)),c>>=8;return l.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,l){const h=this._identifier(c,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const m=this._escHandlers[h];return m.push(l),{dispose:()=>{const w=m.indexOf(l);w!==-1&&m.splice(w,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,l){this._executeHandlers[c.charCodeAt(0)]=l}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,l){const h=this._identifier(c);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const m=this._csiHandlers[h];return m.push(l),{dispose:()=>{const w=m.indexOf(l);w!==-1&&m.splice(w,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,l){return this._dcsParser.registerHandler(this._identifier(c),l)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,l){return this._oscParser.registerHandler(c,l)}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,l,h,m,w){this._parseStack.state=c,this._parseStack.handlers=l,this._parseStack.handlerPos=h,this._parseStack.transition=m,this._parseStack.chunkPos=w}parse(c,l,h){let m,w=0,S=0,x=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,x=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 C=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&C>-1){for(;C>=0&&(m=p[C](this._params),m!==!0);C--)if(m instanceof Promise)return this._parseStack.handlerPos=C,m}this._parseStack.handlers=[];break;case 4:if(h===!1&&C>-1){for(;C>=0&&(m=p[C](),m!==!0);C--)if(m instanceof Promise)return this._parseStack.handlerPos=C,m}this._parseStack.handlers=[];break;case 6:if(w=c[this._parseStack.chunkPos],m=this._dcsParser.unhook(w!==24&&w!==26,h),m)return m;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=c[this._parseStack.chunkPos],m=this._oscParser.end(w!==24&&w!==26,h),m)return m;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,x=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=x;p<l;++p){switch(w=c[p],S=this._transitions.table[this.currentState<<8|(w<160?w:y)],S>>4){case 2:for(let T=p+1;;++T){if(T>=l||(w=c[T])<32||w>126&&w<y){this._printHandler(c,p,T),p=T-1;break}if(++T>=l||(w=c[T])<32||w>126&&w<y){this._printHandler(c,p,T),p=T-1;break}if(++T>=l||(w=c[T])<32||w>126&&w<y){this._printHandler(c,p,T),p=T-1;break}if(++T>=l||(w=c[T])<32||w>126&&w<y){this._printHandler(c,p,T),p=T-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const C=this._csiHandlers[this._collect<<8|w];let L=C?C.length-1:-1;for(;L>=0&&(m=C[L](this._params),m!==!0);L--)if(m instanceof Promise)return this._preserveStack(3,C,L,S,p),m;L<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++p<l&&(w=c[p])>47&&w<60);p--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const M=this._escHandlers[this._collect<<8|w];let D=M?M.length-1:-1;for(;D>=0&&(m=M[D](),m!==!0);D--)if(m instanceof Promise)return this._preserveStack(4,M,D,S,p),m;D<0&&this._escHandlerFb(this._collect<<8|w),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|w,this._params);break;case 13:for(let T=p+1;;++T)if(T>=l||(w=c[T])===24||w===26||w===27||w>127&&w<y){this._dcsParser.put(c,p,T),p=T-1;break}break;case 14:if(m=this._dcsParser.unhook(w!==24&&w!==26),m)return this._preserveStack(6,[],0,S,p),m;w===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 T=p+1;;T++)if(T>=l||(w=c[T])<32||w>127&&w<y){this._oscParser.put(c,p,T),p=T-1;break}break;case 6:if(m=this._oscParser.end(w!==24&&w!==26),m)return this._preserveStack(5,[],0,S,p),m;w===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}n.EscapeSequenceParser=d},6242:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const _=f(5770),v=f(482),o=[];n.OscParser=class{constructor(){this._state=0,this._active=o,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 d=y.indexOf(b);d!==-1&&y.splice(d,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=o}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=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,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 d=this._active.length-1;d>=0;d--)this._active[d].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 d=g[b++];if(d===59){this._state=2,this._start();break}if(d<48||57<d)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+d-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,d=this._active.length-1,r=!1;if(this._stack.paused&&(d=this._stack.loopPosition-1,y=b,r=this._stack.fallThrough,this._stack.paused=!1),!r&&y===!1){for(;d>=0&&(y=this._active[d].end(g),y!==!0);d--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!1,y;d--}for(;d>=0;d--)if(y=this._active[d].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",g);this._active=o,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:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const f=2147483647;class _{static fromArray(o){const g=new _;if(!o.length)return g;for(let b=Array.isArray(o[0])?1:0;b<o.length;++b){const y=o[b];if(Array.isArray(y))for(let d=0;d<y.length;++d)g.addSubParam(y[d]);else g.addParam(y)}return g}constructor(o=32,g=32){if(this.maxLength=o,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new _(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let g=0;g<this.length;++g){o.push(this.params[g]);const b=this._subParamsIdx[g]>>8,y=255&this._subParamsIdx[g];y-b>0&&o.push(Array.prototype.slice.call(this._subParams,b,y))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>f?f:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>f?f:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const g=this._subParamsIdx[o]>>8,b=255&this._subParamsIdx[o];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const o={};for(let g=0;g<this.length;++g){const b=this._subParamsIdx[g]>>8,y=255&this._subParamsIdx[g];y-b>0&&(o[g]=this._subParams.slice(b,y))}return o}addDigit(o){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+o,f):o}}n.Params=_},5741:(q,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:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const _=f(3785),v=f(511);n.BufferApiView=class{constructor(o,g){this._buffer=o,this.type=g}init(o){return this._buffer=o,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(o){const g=this._buffer.lines.get(o);if(g)return new _.BufferLineApiView(g)}getNullCell(){return new v.CellData}}},3785:(q,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,o){if(!(v<0||v>=this._line.length))return o?(this._line.loadCell(v,o),o):this._line.loadCell(v,new _.CellData)}translateToString(v,o,g){return this._line.translateToString(v,o,g)}}},8285:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const _=f(8771),v=f(8460),o=f(844);class g extends o.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:(q,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,o)=>_(v,o.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:(q,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(q,n,f){var _=this&&this.__decorate||function(r,c,l,h){var m,w=arguments.length,S=w<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,c,l,h);else for(var x=r.length-1;x>=0;x--)(m=r[x])&&(S=(w<3?m(S):w>3?m(c,l,S):m(c,l))||S);return w>3&&S&&Object.defineProperty(c,l,S),S},v=this&&this.__param||function(r,c){return function(l,h){c(l,h,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const o=f(8460),g=f(844),b=f(5295),y=f(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let d=n.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.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 l=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===r.fg&&h.getBg(0)===r.bg||(h=l.getBlankLine(r,c),this._cachedBlankLine=h),h.isWrapped=c;const m=l.ybase+l.scrollTop,w=l.ybase+l.scrollBottom;if(l.scrollTop===0){const S=l.lines.isFull;w===l.lines.length-1?S?l.lines.recycle().copyFrom(h):l.lines.push(h.clone()):l.lines.splice(w+1,0,h.clone()),S?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const S=w-m+1;l.lines.shiftElements(m+1,S-1,-1),l.lines.set(w,h.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(r,c,l){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=d=_([v(0,y.IOptionsService)],d)},7994:(q,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(q,n,f){var _=this&&this.__decorate||function(h,m,w,S){var x,p=arguments.length,C=p<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,m,w,S);else for(var L=h.length-1;L>=0;L--)(x=h[L])&&(C=(p<3?x(C):p>3?x(m,w,C):x(m,w))||C);return p>3&&C&&Object.defineProperty(m,w,C),C},v=this&&this.__param||function(h,m){return function(w,S){m(w,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const o=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 d(h,m){let w=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(w|=64,w|=h.action):(w|=3&h.button,4&h.button&&(w|=64),8&h.button&&(w|=128),h.action===32?w|=32:h.action!==0||m||(w|=3)),w}const r=String.fromCharCode,c={DEFAULT:h=>{const m=[d(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[<${d(h,!0)};${h.col};${h.row}${m}`},SGR_PIXELS:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${d(h,!0)};${h.x};${h.y}${m}`}};let l=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 w of Object.keys(y))this.addProtocol(w,y[w]);for(const w of Object.keys(c))this.addEncoding(w,c[w]);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,w){if(w){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=l=_([v(0,o.IBufferService),v(1,o.ICoreService)],l)},6975:function(q,n,f){var _=this&&this.__decorate||function(l,h,m,w){var S,x=arguments.length,p=x<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,m):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(l,h,m,w);else for(var C=l.length-1;C>=0;C--)(S=l[C])&&(p=(x<3?S(p):x>3?S(h,m,p):S(h,m))||p);return x>3&&p&&Object.defineProperty(h,m,p),p},v=this&&this.__param||function(l,h){return function(m,w){h(m,w,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const o=f(1439),g=f(8460),b=f(844),y=f(2585),d=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(l,h,m){super(),this._bufferService=l,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,o.clone)(d),this.decPrivateModes=(0,o.clone)(r)}reset(){this.modes=(0,o.clone)(d),this.decPrivateModes=(0,o.clone)(r)}triggerDataEvent(l,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 "${l}"`,(()=>l.split("").map((w=>w.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(l))}};n.CoreService=c=_([v(0,y.IBufferService),v(1,y.ILogService),v(2,y.IOptionsService)],c)},9074:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const _=f(8055),v=f(8460),o=f(844),g=f(6106);let b=0,y=0;class d extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((l=>l==null?void 0:l.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,o.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const h=new r(l);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 l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,h,m){let w=0,S=0;for(const x of this._decorations.getKeyIterator(h))w=x.options.x??0,S=w+(x.options.width??1),l>=w&&l<S&&(!m||(x.options.layer??"bottom")===m)&&(yield x)}forEachDecorationAtCell(l,h,m,w){this._decorations.forEachByKey(h,(S=>{b=S.options.x??0,y=b+(S.options.width??1),l>=b&&l<y&&(!m||(S.options.layer??"bottom")===m)&&w(S)}))}}n.DecorationService=d;class r extends o.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(l){super(),this.options=l,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=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const _=f(2585),v=f(8343);class o{constructor(...b){this._entries=new Map;for(const[y,d]of b)this.set(y,d)}set(b,y){const d=this._entries.get(b);return this._entries.set(b,y),d}forEach(b){for(const[y,d]of this._entries.entries())b(y,d)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}n.ServiceCollection=o,n.InstantiationService=class{constructor(){this._services=new o,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,l)=>c.index-l.index)),d=[];for(const c of y){const l=this._services.get(c.id);if(!l)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${c.id}.`);d.push(l)}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,...d)}}},7866:function(q,n,f){var _=this&&this.__decorate||function(r,c,l,h){var m,w=arguments.length,S=w<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,c,l,h);else for(var x=r.length-1;x>=0;x--)(m=r[x])&&(S=(w<3?m(S):w>3?m(c,l,S):m(c,l))||S);return w>3&&S&&Object.defineProperty(c,l,S),S},v=this&&this.__param||function(r,c){return function(l,h){c(l,h,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const o=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,d=n.LogService=class extends o.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,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...l)}trace(r,...c){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,c)}debug(r,...c){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,c)}info(r,...c){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,c)}warn(r,...c){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,c)}error(r,...c){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,c)}};n.LogService=d=_([v(0,g.IOptionsService)],d),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,c,l){if(typeof l.value!="function")throw new Error("not supported");const h=l.value;l.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 w=h.apply(this,m);return y.trace(`GlyphRenderer#${h.name} return`,w),w}}},7302:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const _=f(8460),v=f(844),o=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:o.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(d){super(),this._onOptionChange=this.register(new _.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const c in d)if(c in r)try{const l=d[c];r[c]=this._sanitizeAndValidateOption(c,l)}catch(l){console.error(l)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(d,r){return this.onOptionChange((c=>{c===d&&r(this.rawOptions[d])}))}onMultipleOptionChange(d,r){return this.onOptionChange((c=>{d.indexOf(c)!==-1&&r()}))}_setupOptions(){const d=c=>{if(!(c in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},r=(c,l)=>{if(!(c in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);l=this._sanitizeAndValidateOption(c,l),this.rawOptions[c]!==l&&(this.rawOptions[c]=l,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const l={get:d.bind(this,c),set:r.bind(this,c)};Object.defineProperty(this.options,c,l)}}_sanitizeAndValidateOption(d,r){switch(d){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[d]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${d}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[d]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=g.includes(r)?r:n.DEFAULT_OPTIONS[d];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${d} 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(`${d} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${d} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${d} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=b},2660:function(q,n,f){var _=this&&this.__decorate||function(b,y,d,r){var c,l=arguments.length,h=l<3?y:r===null?r=Object.getOwnPropertyDescriptor(y,d):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(b,y,d,r);else for(var m=b.length-1;m>=0;m--)(c=b[m])&&(h=(l<3?c(h):l>3?c(y,d,h):c(y,d))||h);return l>3&&h&&Object.defineProperty(y,d,h),h},v=this&&this.__param||function(b,y){return function(d,r){y(d,r,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const o=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),w={data:b,id:this._nextId++,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(w,m))),this._dataByLinkId.set(w.id,w),w.id}const d=b,r=this._getEntryIdKey(d),c=this._entriesWithId.get(r);if(c)return this.addLineToLink(c.id,y.ybase+y.y),c.id;const l=y.addMarker(y.ybase+y.y),h={id:this._nextId++,key:this._getEntryIdKey(d),data:d,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(h,l))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(b,y){const d=this._dataByLinkId.get(b);if(d&&d.lines.every((r=>r.line!==y))){const r=this._bufferService.buffer.addMarker(y);d.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(d,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 d=b.lines.indexOf(y);d!==-1&&(b.lines.splice(d,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,o.IBufferService)],g)},8343:(q,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 o=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(d,r,c){r[f]===r?r[_].push({id:d,index:c}):(r[_]=[{id:d,index:c}],r[f]=r)})(o,g,y)};return o.toString=()=>v,n.serviceRegistry.set(v,o),o}},2585:(q,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(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.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:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const _=f(8460),v=f(225);class o{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,y,d=!1){return(16777215&b)<<3|(3&y)<<1|(d?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,d=0;const r=b.length;for(let c=0;c<r;++c){let l=b.charCodeAt(c);if(55296<=l&&l<=56319){if(++c>=r)return y+this.wcwidth(l);const w=b.charCodeAt(c);56320<=w&&w<=57343?l=1024*(l-55296)+w-56320+65536:y+=this.wcwidth(w)}const h=this.charProperties(l,d);let m=o.extractWidth(h);o.extractShouldJoin(h)&&(m-=o.extractWidth(d)),y+=m,d=h}return y}charProperties(b,y){return this._activeProvider.charProperties(b,y)}}n.UnicodeService=o}},I={};function ne(q){var n=I[q];if(n!==void 0)return n.exports;var f=I[q]={exports:{}};return V[q].call(f.exports,f,f.exports,ne),f.exports}var le={};return(()=>{var q=le;Object.defineProperty(q,"__esModule",{value:!0}),q.Terminal=void 0;const n=ne(9042),f=ne(3236),_=ne(844),v=ne(5741),o=ne(8285),g=ne(7975),b=ne(7090),y=["cols","rows"];class d 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 l=m=>this._core.options[m],h=(m,w)=>{this._checkReadonlyOptions(m),this._core.options[m]=w};for(const m in this._core.options){const w={get:l.bind(this,m),set:h.bind(this,m)};Object.defineProperty(this._publicOptions,m,w)}}_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 o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const l in c)this._publicOptions[l]=c[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,l=!0){this._core.input(c,l)}resize(c,l){this._verifyIntegers(c,l),this._core.resize(c,l)}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,l,h){this._verifyIntegers(c,l,h),this._core.select(c,l,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,l){this._verifyIntegers(c,l),this._core.selectLines(c,l)}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,l){this._core.write(c,l)}writeln(c,l){this._core.write(c),this._core.write(`\r
57
+ `,l)}paste(c){this._core.paste(c)}refresh(c,l){this._verifyIntegers(c,l),this._core.refresh(c,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return n}_verifyIntegers(...c){for(const l of c)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const l of c)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}q.Terminal=d})(),le})()))})(No)),No.exports}var $v=Gv(),jo={exports:{}},Zd;function Yv(){return Zd||(Zd=1,(function(N,Q){(function(V,I){N.exports=I()})(self,(()=>(()=>{var V={};return(()=>{var I=V;Object.defineProperty(I,"__esModule",{value:!0}),I.FitAddon=void 0,I.FitAddon=class{activate(ne){this._terminal=ne}dispose(){}fit(){const ne=this.proposeDimensions();if(!ne||!this._terminal||isNaN(ne.cols)||isNaN(ne.rows))return;const le=this._terminal._core;this._terminal.rows===ne.rows&&this._terminal.cols===ne.cols||(le._renderService.clear(),this._terminal.resize(ne.cols,ne.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const ne=this._terminal._core,le=ne._renderService.dimensions;if(le.css.cell.width===0||le.css.cell.height===0)return;const q=this._terminal.options.scrollback===0?0:ne.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),o=f-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),g=_-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-q;return{cols:Math.max(2,Math.floor(g/le.css.cell.width)),rows:Math.max(1,Math.floor(o/le.css.cell.height))}}}})(),V})()))})(jo)),jo.exports}var Xv=Yv(),Uo={exports:{}},Jd;function Vv(){return Jd||(Jd=1,(function(N,Q){(function(V,I){N.exports=I()})(self,(()=>(()=>{var V={965:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const _=f(374),v=f(509),o=f(855),g=f(859),b=f(381),y=11,d=y*Float32Array.BYTES_PER_ELEMENT;let r,c=0,l=0,h=0;class m extends g.Disposable{constructor(S,x,p,C){super(),this._terminal=S,this._gl=x,this._dimensions=p,this._optionsService=C,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(U){let P="";for(let G=1;G<U;G++)P+=` else if (v_texpage == ${G}) { outColor = texture(u_texture[${G}], 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[${U}];
84
+
85
+ out vec4 outColor;
86
+
87
+ void main() {
88
+ if (v_texpage == 0) {
89
+ outColor = texture(u_texture[0], v_texcoord);
90
+ } ${P}
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 M=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,M,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const T=new Uint8Array([0,1,2,3]),j=L.createBuffer();this.register((0,g.toDisposable)((()=>L.deleteBuffer(j)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,j),L.bufferData(L.ELEMENT_ARRAY_BUFFER,T,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,d,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,d,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,d,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,d,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,d,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,d,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const X=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let U=0;U<v.TextureAtlas.maxAtlasPages;U++)X[U]=U;L.uniform1iv(this._textureLocation,X),L.uniformMatrix4fv(this._projectionLocation,!1,b.PROJECTION_MATRIX),this._atlasTextures=[];for(let U=0;U<v.TextureAtlas.maxAtlasPages;U++){const P=new b.GLTexture((0,_.throwIfFalsy)(L.createTexture()));this.register((0,g.toDisposable)((()=>L.deleteTexture(P.texture)))),L.activeTexture(L.TEXTURE0+U),L.bindTexture(L.TEXTURE_2D,P.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[U]=P}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,x,p,C,L,M,D,T,j){this._updateCell(this._vertices.attributes,S,x,p,C,L,M,D,T,j)}_updateCell(S,x,p,C,L,M,D,T,j,X){c=(p*this._terminal.cols+x)*y,C!==o.NULL_CELL_CODE&&C!==void 0?this._atlas&&(r=T&&T.length>1?this._atlas.getRasterizedGlyphCombinedChar(T,L,M,D,!1):this._atlas.getRasterizedGlyph(C,L,M,D,!1),l=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==X&&r.offset.x>l?(h=r.offset.x-l,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)(C,j,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,x=S.cols*S.rows*y;this._vertices.count!==x?this._vertices.attributes=new Float32Array(x):this._vertices.attributes.fill(0);let p=0;for(;p<this._vertices.attributesBuffers.length;p++)this._vertices.count!==x?this._vertices.attributesBuffers[p]=new Float32Array(x):this._vertices.attributesBuffers[p].fill(0);this._vertices.count=x,p=0;for(let C=0;C<S.rows;C++)for(let L=0;L<S.cols;L++)this._vertices.attributes[p+9]=L/S.cols,this._vertices.attributes[p+10]=C/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 x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const p=this._vertices.attributesBuffers[this._activeBuffer];let C=0;for(let L=0;L<S.lineLengths.length;L++){const M=L*this._terminal.cols*y,D=this._vertices.attributes.subarray(M,M+S.lineLengths[L]*y);p.set(D,C),C+=D.length}x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,p.subarray(0,C),x.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(x,this._atlas,L);x.drawElementsInstanced(x.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,C/y)}setAtlas(S){this._atlas=S;for(const x of this._atlasTextures)x.version=-1}_bindAtlasPageTexture(S,x,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,x.pages[p].canvas),S.generateMipmap(S.TEXTURE_2D),this._atlasTextures[p].version=x.pages[p].version}setDimensions(S){this._dimensions=S}}n.GlyphRenderer=m},742:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const _=f(374),v=f(859),o=f(310),g=f(381),b=8*Float32Array.BYTES_PER_ELEMENT;class y{constructor(){this.attributes=new Float32Array(160),this.count=0}}let d=0,r=0,c=0,l=0,h=0,m=0,w=0;class S extends v.Disposable{constructor(p,C,L,M){super(),this._terminal=p,this._gl=C,this._dimensions=L,this._themeService=M,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 T=new Float32Array([0,0,1,0,0,1,1,1]),j=D.createBuffer();this.register((0,v.toDisposable)((()=>D.deleteBuffer(j)))),D.bindBuffer(D.ARRAY_BUFFER,j),D.bufferData(D.ARRAY_BUFFER,T,D.STATIC_DRAW),D.enableVertexAttribArray(3),D.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const X=new Uint8Array([0,1,2,3]),U=D.createBuffer();this.register((0,v.toDisposable)((()=>D.deleteBuffer(U)))),D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,U),D.bufferData(D.ELEMENT_ARRAY_BUFFER,X,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(M.colors),this.register(this._themeService.onChangeColors((P=>{this._updateCachedColors(P),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(p){const C=this._gl;C.useProgram(this._program),C.bindVertexArray(this._vertexArrayObject),C.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.bufferData(C.ARRAY_BUFFER,p.attributes,C.DYNAMIC_DRAW),C.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,C.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 C=this._terminal,L=this._vertices;let M,D,T,j,X,U,P,G,R,z,A,O=1;for(M=0;M<C.rows;M++){for(T=-1,j=0,X=0,U=!1,D=0;D<C.cols;D++)P=(M*C.cols+D)*o.RENDER_MODEL_INDICIES_PER_CELL,G=p.cells[P+o.RENDER_MODEL_BG_OFFSET],R=p.cells[P+o.RENDER_MODEL_FG_OFFSET],z=!!(67108864&R),(G!==j||R!==X&&(U||z))&&((j!==0||U&&X!==0)&&(A=8*O++,this._updateRectangle(L,A,X,j,T,D,M)),T=D,j=G,X=R,U=z);(j!==0||U&&X!==0)&&(A=8*O++,this._updateRectangle(L,A,X,j,T,C.cols,M))}L.count=O}updateCursor(p){const C=this._verticesCursor,L=p.cursor;if(!L||L.style==="block")return void(C.count=0);let M,D=0;L.style!=="bar"&&L.style!=="outline"||(M=8*D++,this._addRectangleFloat(C.attributes,M,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"||(M=8*D++,this._addRectangleFloat(C.attributes,M,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"&&(M=8*D++,this._addRectangleFloat(C.attributes,M,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),M=8*D++,this._addRectangleFloat(C.attributes,M,(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)),C.count=D}_updateRectangle(p,C,L,M,D,T,j){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:d=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:d=(16777215&L)<<8;break;default:d=this._themeService.colors.foreground.rgba}else switch(50331648&M){case 16777216:case 33554432:d=this._themeService.colors.ansi[255&M].rgba;break;case 50331648:d=(16777215&M)<<8;break;default:d=this._themeService.colors.background.rgba}p.attributes.length<C+4&&(p.attributes=(0,g.expandFloat32Array)(p.attributes,this._terminal.rows*this._terminal.cols*8)),r=D*this._dimensions.device.cell.width,c=j*this._dimensions.device.cell.height,l=(d>>24&255)/255,h=(d>>16&255)/255,m=(d>>8&255)/255,w=1,this._addRectangle(p.attributes,C,r,c,(T-D)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,l,h,m,w)}_addRectangle(p,C,L,M,D,T,j,X,U,P){p[C]=L/this._dimensions.device.canvas.width,p[C+1]=M/this._dimensions.device.canvas.height,p[C+2]=D/this._dimensions.device.canvas.width,p[C+3]=T/this._dimensions.device.canvas.height,p[C+4]=j,p[C+5]=X,p[C+6]=U,p[C+7]=P}_addRectangleFloat(p,C,L,M,D,T,j){p[C]=L/this._dimensions.device.canvas.width,p[C+1]=M/this._dimensions.device.canvas.height,p[C+2]=D/this._dimensions.device.canvas.width,p[C+3]=T/this._dimensions.device.canvas.height,p[C+4]=j[0],p[C+5]=j[1],p[C+6]=j[2],p[C+7]=j[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:(q,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,o){const g=v*o*n.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(o))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const _=f(820),v=f(274),o=f(627),g=f(457),b=f(56),y=f(374),d=f(345),r=f(859),c=f(147),l=f(782),h=f(855),m=f(965),w=f(742),S=f(310),x=f(733);class p extends r.Disposable{constructor(D,T,j,X,U,P,G,R,z){super(),this._terminal=D,this._characterJoinerService=T,this._charSizeService=j,this._coreBrowserService=X,this._coreService=U,this._decorationService=P,this._optionsService=G,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 l.CellData,this._workCell2=new l.CellData,this._rectangleRenderer=this.register(new r.MutableDisposable),this._glyphRenderer=this.register(new r.MutableDisposable),this._onChangeTextureAtlas=this.register(new d.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new d.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new d.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new d.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 x.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,G,this._themeService)],this.dimensions=(0,y.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(G.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const A={antialias:!1,depth:!1,preserveDrawingBuffer:z};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",(O=>{console.log("webglcontextlost event received"),O.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(O)}),3e3)}))),this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextrestored",(O=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,o.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((O,Y)=>this._setCanvasDevicePixelDimensions(O,Y))),this.register(this._coreBrowserService.onWindowChange((O=>{this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,O,((Y,Z)=>this._setCanvasDevicePixelDimensions(Y,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 O;for(const Y of this._renderLayers)Y.dispose();(O=this._canvas.parentElement)==null||O.removeChild(this._canvas),(0,o.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,T){var j,X,U,P;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const G of this._renderLayers)G.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`,(j=this._rectangleRenderer.value)==null||j.setDimensions(this.dimensions),(X=this._rectangleRenderer.value)==null||X.handleResize(),(U=this._glyphRenderer.value)==null||U.setDimensions(this.dimensions),(P=this._glyphRenderer.value)==null||P.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var D;for(const T of this._renderLayers)T.handleBlur(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.pause(),this._requestRedrawViewport()}handleFocus(){var D;for(const T of this._renderLayers)T.handleFocus(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.resume(),this._requestRedrawViewport()}handleSelectionChanged(D,T,j){for(const X of this._renderLayers)X.handleSelectionChanged(this._terminal,D,T,j);this._model.selection.update(this._core,D,T,j),this._requestRedrawViewport()}handleCursorMove(){var D;for(const T of this._renderLayers)T.handleCursorMove(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new w.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 T;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const D=(0,o.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,d.forwardEvent)(D.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,d.forwardEvent)(D.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=D,this._charAtlas.warmUp(),(T=this._glyphRenderer.value)==null||T.setAtlas(this._charAtlas)}_clearModel(D){var T;this._model.clear(),D&&((T=this._glyphRenderer.value)==null||T.clear())}clearTextureAtlas(){var D;(D=this._charAtlas)==null||D.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var D;this._clearModel(!0);for(const T of this._renderLayers)T.reset(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(D){return-1}deregisterCharacterJoiner(D){return!1}renderRows(D,T){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 j of this._renderLayers)j.handleGridChanged(this._terminal,D,T);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(D,T),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,T){const j=this._core;let X,U,P,G,R,z,A,O,Y,Z,he,ue,F,k,se=this._workCell;D=L(D,j.rows-1,0),T=L(T,j.rows-1,0);const ie=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=ie-j.buffer.ydisp,de=Math.min(this._terminal.buffer.active.cursorX,j.cols-1);let we=-1;const pe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let He=!1;for(U=D;U<=T;U++)for(P=U+j.buffer.ydisp,G=j.buffer.lines.get(P),this._model.lineLengths[U]=0,R=this._characterJoinerService.getJoinedCharacters(P),F=0;F<j.cols;F++)if(X=this._cellColorResolver.result.bg,G.loadCell(F,se),F===0&&(X=this._cellColorResolver.result.bg),z=!1,A=F,R.length>0&&F===R[0][0]&&(z=!0,O=R.shift(),se=new C(se,G.translateToString(!0,O[0],O[1]),O[1]-O[0]),A=O[1]-1),Y=se.getChars(),Z=se.getCode(),ue=(U*j.cols+F)*S.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(se,F,P,this.dimensions.device.cell.width),pe&&P===ie&&(F===de&&(this._model.cursor={x:de,y:_e,width:se.getWidth(),style:this._coreBrowserService.isFocused?j.options.cursorStyle||"block":j.options.cursorInactiveStyle,cursorWidth:j.options.cursorWidth,dpr:this._devicePixelRatio},we=de+se.getWidth()-1),F>=de&&F<=we&&(this._coreBrowserService.isFocused&&(j.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&j.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[U]=F+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)&&(He=!0,Y.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=se.getWidth(),this._glyphRenderer.value.updateCell(F,U,Z,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Y,he,X),z))for(se=this._workCell,F++;F<A;F++)k=(U*j.cols+F)*S.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(F,U,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[k]=h.NULL_CELL_CODE,this._model.cells[k+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[k+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[k+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;He&&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,T){this._canvas.width===D&&this._canvas.height===T||(this._canvas.width=D,this._canvas.height=T,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 C extends c.AttributeData{constructor(D,T,j){super(),this.content=0,this.combinedData="",this.fg=D.fg,this.bg=D.bg,this.combinedData=T,this._width=j}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(M,D,T=0){return Math.max(Math.min(M,D),T)}n.JoinedCellData=C},381:(q,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(o,g,b){const y=(0,_.throwIfFalsy)(o.createShader(g));if(o.shaderSource(y,b),o.compileShader(y),o.getShaderParameter(y,o.COMPILE_STATUS))return y;console.error(o.getShaderInfoLog(y)),o.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(o,g,b){const y=(0,_.throwIfFalsy)(o.createProgram());if(o.attachShader(y,(0,_.throwIfFalsy)(v(o,o.VERTEX_SHADER,g))),o.attachShader(y,(0,_.throwIfFalsy)(v(o,o.FRAGMENT_SHADER,b))),o.linkProgram(y),o.getProgramParameter(y,o.LINK_STATUS))return y;console.error(o.getProgramInfoLog(y)),o.deleteProgram(y)},n.createShader=v,n.expandFloat32Array=function(o,g){const b=Math.min(2*o.length,g),y=new Float32Array(b);for(let d=0;d<o.length;d++)y[d]=o[d];return y},n.GLTexture=class{constructor(o){this.texture=o,this.version=-1}}},592:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const _=f(627),v=f(237),o=f(374),g=f(859);class b extends g.Disposable{constructor(d,r,c,l,h,m,w,S){super(),this._container=r,this._alpha=h,this._coreBrowserService=m,this._optionsService=w,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=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((x=>{this._refreshCharAtlas(d,x),this.reset(d)}))),this.register((0,g.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(d){}handleFocus(d){}handleCursorMove(d){}handleGridChanged(d,r,c){}handleSelectionChanged(d,r,c,l=!1){}_setTransparency(d,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(d,this._themeService.colors),this.handleGridChanged(d,0,d.rows-1)}_refreshCharAtlas(d,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,_.acquireTextureAtlas)(d,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(d,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(d,this._themeService.colors)}_fillBottomLineAtCells(d,r,c=1){this._ctx.fillRect(d*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(d,r,c,l){this._alpha?this._ctx.clearRect(d*this._deviceCellWidth,r*this._deviceCellHeight,c*this._deviceCellWidth,l*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(d*this._deviceCellWidth,r*this._deviceCellHeight,c*this._deviceCellWidth,l*this._deviceCellHeight))}_fillCharTrueColor(d,r,c,l){this._ctx.font=this._getFont(d,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(c,l,r.getWidth()),this._ctx.fillText(r.getChars(),c*this._deviceCellWidth+this._deviceCharLeft,l*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(d,r,c){this._ctx.beginPath(),this._ctx.rect(d*this._deviceCellWidth,r*this._deviceCellHeight,c*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(d,r,c){return`${c?"italic":""} ${r?d.options.fontWeightBold:d.options.fontWeight} ${d.options.fontSize*this._coreBrowserService.dpr}px ${d.options.fontFamily}`}}n.BaseRenderLayer=b},733:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const _=f(197),v=f(237),o=f(592);class g extends o.BaseRenderLayer{constructor(y,d,r,c,l,h,m){super(r,y,"link",d,!0,l,h,m),this.register(c.onShowLinkUnderline((w=>this._handleShowLinkUnderline(w)))),this.register(c.onHideLinkUnderline((w=>this._handleHideLinkUnderline(w))))}resize(y,d){super.resize(y,d),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 d=y.y1+1;d<y.y2;d++)this._fillBottomLineAtCells(0,d,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}n.LinkRenderLayer=g},820:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(f,_,v,o){f.addEventListener(_,v,o);let g=!1;return{dispose:()=>{g||(g=!0,f.removeEventListener(_,v,o))}}}},274:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const _=f(855),v=f(160),o=f(374);let g,b=0,y=0,d=!1,r=!1,c=!1,l=0;n.CellColorResolver=class{constructor(h,m,w,S,x,p){this._terminal=h,this._optionService=m,this._selectionRenderModel=w,this._decorationService=S,this._coreBrowserService=x,this._themeService=p,this.result={fg:0,bg:0,ext:0}}resolve(h,m,w,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,d=!1,c=!1,g=this._themeService.colors,l=0,h.getCode()!==_.NULL_CELL_CODE&&h.extended.underlineStyle===4){const x=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));l=m*S%(2*Math.round(x))}if(this._decorationService.forEachDecorationAtCell(m,w,"bottom",(x=>{x.backgroundColorRGB&&(y=x.backgroundColorRGB.rgba>>8&16777215,r=!0),x.foregroundColorRGB&&(b=x.foregroundColorRGB.rgba>>8&16777215,d=!0)})),c=this._selectionRenderModel.isCellSelected(this._terminal,m,w),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,d=!0),(0,o.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}d=!0}}this._decorationService.forEachDecorationAtCell(m,w,"top",(x=>{x.backgroundColorRGB&&(y=x.backgroundColorRGB.rgba>>8&16777215,r=!0),x.foregroundColorRGB&&(b=x.foregroundColorRGB.rgba>>8&16777215,d=!0)})),r&&(y=c?-16777216&h.bg&-134217729|y|50331648:-16777216&h.bg|y|50331648),d&&(b=-16777216&h.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!d&&(b=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,d=!0),!r&&d&&(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=d?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=l<<29&3758096384}}},627:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const _=f(509),v=f(197),o=[];n.acquireTextureAtlas=function(g,b,y,d,r,c,l,h){const m=(0,v.generateConfig)(d,r,c,l,b,y,h);for(let x=0;x<o.length;x++){const p=o[x],C=p.ownedBy.indexOf(g);if(C>=0){if((0,v.configEquals)(p.config,m))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),o.splice(x,1)):p.ownedBy.splice(C,1);break}}for(let x=0;x<o.length;x++){const p=o[x];if((0,v.configEquals)(p.config,m))return p.ownedBy.push(g),p.atlas}const w=g._core,S={atlas:new _.TextureAtlas(document,m,w.unicodeService),config:m,ownedBy:[g]};return o.push(S),S.atlas},n.removeTerminalFromCache=function(g){for(let b=0;b<o.length;b++){const y=o[b].ownedBy.indexOf(g);if(y!==-1){o[b].ownedBy.length===1?(o[b].atlas.dispose(),o.splice(b,1)):o[b].ownedBy.splice(y,1);break}}}},197:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const _=f(160);n.generateConfig=function(v,o,g,b,y,d,r){const c={foreground:d.foreground,background:d.background,cursor:_.NULL_COLOR,cursorAccent:_.NULL_COLOR,selectionForeground:_.NULL_COLOR,selectionBackgroundTransparent:_.NULL_COLOR,selectionBackgroundOpaque:_.NULL_COLOR,selectionInactiveBackgroundTransparent:_.NULL_COLOR,selectionInactiveBackgroundOpaque:_.NULL_COLOR,ansi:d.ansi.slice(),contrastCache:d.contrastCache,halfContrastCache:d.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:r,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:v,deviceCellHeight:o,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,o){for(let g=0;g<v.colors.ansi.length;g++)if(v.colors.ansi[g].rgba!==o.colors.ansi[g].rgba)return!1;return v.devicePixelRatio===o.devicePixelRatio&&v.customGlyphs===o.customGlyphs&&v.lineHeight===o.lineHeight&&v.letterSpacing===o.letterSpacing&&v.fontFamily===o.fontFamily&&v.fontSize===o.fontSize&&v.fontWeight===o.fontWeight&&v.fontWeightBold===o.fontWeightBold&&v.allowTransparency===o.allowTransparency&&v.deviceCharWidth===o.deviceCharWidth&&v.deviceCharHeight===o.deviceCharHeight&&v.drawBoldTextInBrightColors===o.drawBoldTextInBrightColors&&v.minimumContrastRatio===o.minimumContrastRatio&&v.colors.foreground.rgba===o.colors.foreground.rgba&&v.colors.background.rgba===o.colors.background.rgba},n.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(q,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:(q,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:(q,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:(d,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(d,r)=>`M${.5-d},0 L${.5-d},1 M${.5+d},0 L${.5+d},1`},"╒":{1:(d,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(d,r)=>`M${.5-d},1 L${.5-d},.5 L1,.5 M${.5+d},.5 L${.5+d},1`},"╔":{1:(d,r)=>`M1,${.5-r} L${.5-d},${.5-r} L${.5-d},1 M1,${.5+r} L${.5+d},${.5+r} L${.5+d},1`},"╕":{1:(d,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(d,r)=>`M${.5+d},1 L${.5+d},.5 L0,.5 M${.5-d},.5 L${.5-d},1`},"╗":{1:(d,r)=>`M0,${.5+r} L${.5-d},${.5+r} L${.5-d},1 M0,${.5-r} L${.5+d},${.5-r} L${.5+d},1`},"╘":{1:(d,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(d,r)=>`M1,.5 L${.5-d},.5 L${.5-d},0 M${.5+d},.5 L${.5+d},0`},"╚":{1:(d,r)=>`M1,${.5-r} L${.5+d},${.5-r} L${.5+d},0 M1,${.5+r} L${.5-d},${.5+r} L${.5-d},0`},"╛":{1:(d,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(d,r)=>`M0,.5 L${.5+d},.5 L${.5+d},0 M${.5-d},.5 L${.5-d},0`},"╝":{1:(d,r)=>`M0,${.5-r} L${.5-d},${.5-r} L${.5-d},0 M0,${.5+r} L${.5+d},${.5+r} L${.5+d},0`},"╞":{1:(d,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(d,r)=>`M${.5-d},0 L${.5-d},1 M${.5+d},0 L${.5+d},1 M${.5+d},.5 L1,.5`},"╠":{1:(d,r)=>`M${.5-d},0 L${.5-d},1 M1,${.5+r} L${.5+d},${.5+r} L${.5+d},1 M1,${.5-r} L${.5+d},${.5-r} L${.5+d},0`},"╡":{1:(d,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(d,r)=>`M0,.5 L${.5-d},.5 M${.5-d},0 L${.5-d},1 M${.5+d},0 L${.5+d},1`},"╣":{1:(d,r)=>`M${.5+d},0 L${.5+d},1 M0,${.5+r} L${.5-d},${.5+r} L${.5-d},1 M0,${.5-r} L${.5-d},${.5-r} L${.5-d},0`},"╤":{1:(d,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(d,r)=>`M0,.5 L1,.5 M${.5-d},.5 L${.5-d},1 M${.5+d},.5 L${.5+d},1`},"╦":{1:(d,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-d},${.5+r} L${.5-d},1 M1,${.5+r} L${.5+d},${.5+r} L${.5+d},1`},"╧":{1:(d,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(d,r)=>`M0,.5 L1,.5 M${.5-d},.5 L${.5-d},0 M${.5+d},.5 L${.5+d},0`},"╩":{1:(d,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-d},${.5-r} L${.5-d},0 M1,${.5-r} L${.5+d},${.5-r} L${.5+d},0`},"╪":{1:(d,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(d,r)=>`M0,.5 L1,.5 M${.5-d},0 L${.5-d},1 M${.5+d},0 L${.5+d},1`},"╬":{1:(d,r)=>`M0,${.5+r} L${.5-d},${.5+r} L${.5-d},1 M1,${.5+r} L${.5+d},${.5+r} L${.5+d},1 M0,${.5-r} L${.5-d},${.5-r} L${.5-d},0 M1,${.5-r} L${.5+d},${.5-r} L${.5+d},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:(d,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(d,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(d,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(d,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(d,r,c,l,h,m,w,S){const x=n.blockElementDefinitions[r];if(x)return(function(M,D,T,j,X,U){for(let P=0;P<D.length;P++){const G=D[P],R=X/8,z=U/8;M.fillRect(T+G.x*R,j+G.y*z,G.w*R,G.h*z)}})(d,x,c,l,h,m),!0;const p=v[r];if(p)return(function(M,D,T,j,X,U){let P=o.get(D);P||(P=new Map,o.set(D,P));const G=M.fillStyle;if(typeof G!="string")throw new Error(`Unexpected fillStyle type "${G}"`);let R=P.get(G);if(!R){const z=D[0].length,A=D.length,O=M.canvas.ownerDocument.createElement("canvas");O.width=z,O.height=A;const Y=(0,_.throwIfFalsy)(O.getContext("2d")),Z=new ImageData(z,A);let he,ue,F,k;if(G.startsWith("#"))he=parseInt(G.slice(1,3),16),ue=parseInt(G.slice(3,5),16),F=parseInt(G.slice(5,7),16),k=G.length>7&&parseInt(G.slice(7,9),16)||1;else{if(!G.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${G}" when drawing pattern glyph`);[he,ue,F,k]=G.substring(5,G.length-1).split(",").map((se=>parseFloat(se)))}for(let se=0;se<A;se++)for(let ie=0;ie<z;ie++)Z.data[4*(se*z+ie)]=he,Z.data[4*(se*z+ie)+1]=ue,Z.data[4*(se*z+ie)+2]=F,Z.data[4*(se*z+ie)+3]=D[se][ie]*(255*k);Y.putImageData(Z,0,0),R=(0,_.throwIfFalsy)(M.createPattern(O,null)),P.set(G,R)}M.fillStyle=R,M.fillRect(T,j,X,U)})(d,p,c,l,h,m),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(M,D,T,j,X,U,P){M.strokeStyle=M.fillStyle;for(const[G,R]of Object.entries(D)){let z;M.beginPath(),M.lineWidth=P*Number.parseInt(G),z=typeof R=="function"?R(.15,.15/U*X):R;for(const A of z.split(" ")){const O=A[0],Y=b[O];if(!Y){console.error(`Could not find drawing instructions for "${O}"`);continue}const Z=A.substring(1).split(",");Z[0]&&Z[1]&&Y(M,y(Z,X,U,T,j,!0,P))}M.stroke(),M.closePath()}})(d,C,c,l,h,m,S),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(M,D,T,j,X,U,P,G){const R=new Path2D;R.rect(T,j,X,U),M.clip(R),M.beginPath();const z=P/12;M.lineWidth=G*z;for(const A of D.d.split(" ")){const O=A[0],Y=b[O];if(!Y){console.error(`Could not find drawing instructions for "${O}"`);continue}const Z=A.substring(1).split(",");Z[0]&&Z[1]&&Y(M,y(Z,X,U,T,j,!1,G,(D.leftPadding??0)*(z/2),(D.rightPadding??0)*(z/2)))}D.type===1?(M.strokeStyle=M.fillStyle,M.stroke()):M.fill(),M.closePath()})(d,L,c,l,h,m,w,S),!0)};const o=new Map;function g(d,r,c=0){return Math.max(Math.min(d,r),c)}const b={C:(d,r)=>d.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(d,r)=>d.lineTo(r[0],r[1]),M:(d,r)=>d.moveTo(r[0],r[1])};function y(d,r,c,l,h,m,w,S=0,x=0){const p=d.map((C=>parseFloat(C)||parseInt(C)));if(p.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<p.length;C+=2)p[C]*=r-S*w-x*w,m&&p[C]!==0&&(p[C]=g(Math.round(p[C]+.5)-.5,r,0)),p[C]+=l+S*w;for(let C=1;C<p.length;C+=2)p[C]*=c,m&&p[C]!==0&&(p[C]=g(Math.round(p[C]+.5)-.5,c,0)),p[C]+=h;return p}},56:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const _=f(859);n.observeDevicePixelDimensions=function(v,o,g){let b=new o.ResizeObserver((y=>{const d=y.find((l=>l.target===v));if(!d)return;if(!("devicePixelContentBoxSize"in d))return b==null||b.disconnect(),void(b=void 0);const r=d.devicePixelContentBoxSize[0].inlineSize,c=d.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:(q,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,o,g,b){return o===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(o){return 9472<=o&&o<=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,o,g=0){return(v-(2*Math.round(o)-g))%(2*Math.round(o))}},296:(q,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,o,g,b=!1){if(this.selectionStart=o,this.selectionEnd=g,!o||!g||o[0]===g[0]&&o[1]===g[1])return void this.clear();const y=v.buffers.active.ydisp,d=o[1]-y,r=g[1]-y,c=Math.max(d,0),l=Math.min(r,v.rows-1);c>=v.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=d,this.viewportEndRow=r,this.viewportCappedStartRow=c,this.viewportCappedEndRow=l,this.startCol=o[0],this.endCol=g[0])}isCellSelected(v,o,g){return!!this.hasSelection&&(g-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&g>=this.viewportCappedStartRow&&o<this.endCol&&g<=this.viewportCappedEndRow:o<this.startCol&&g>=this.viewportCappedStartRow&&o>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&o>=this.startCol)}}n.createSelectionRenderModel=function(){return new f}},509:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const _=f(237),v=f(860),o=f(374),g=f(160),b=f(345),y=f(485),d=f(385),r=f(147),c=f(855),l={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(C,L,M){this._document=C,this._config=L,this._unicodeService=M,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=x(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new d.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT)){const M=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,M)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.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((P=>2*P.canvas.width<=(m.maxTextureSize||4096))).sort(((P,G)=>G.canvas.width!==P.canvas.width?G.canvas.width-P.canvas.width:G.percentageUsed-P.percentageUsed));let M=-1,D=0;for(let P=0;P<L.length;P++)if(L[P].canvas.width!==D)M=P,D=L[P].canvas.width;else if(P-M==3)break;const T=L.slice(M,M+4),j=T.map((P=>P.glyphs[0].texturePage)).sort(((P,G)=>P>G?1:-1)),X=this.pages.length-T.length,U=this._mergePages(T,X);U.version++;for(let P=j.length-1;P>=0;P--)this._deletePage(j[P]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const C=new w(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const M=2*C[0].canvas.width,D=new w(this._document,M,C);for(const[T,j]of C.entries()){const X=T*j.canvas.width%M,U=Math.floor(T/2)*j.canvas.height;D.ctx.drawImage(j.canvas,X,U);for(const G of j.glyphs)G.texturePage=L,G.sizeClipSpace.x=G.size.x/M,G.sizeClipSpace.y=G.size.y/M,G.texturePosition.x+=X,G.texturePosition.y+=U,G.texturePositionClipSpace.x=G.texturePosition.x/M,G.texturePositionClipSpace.y=G.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(j.canvas);const P=this._activePages.indexOf(j);P!==-1&&this._activePages.splice(P,1)}return D}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const M=this._pages[L];for(const D of M.glyphs)D.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(C,L,M,D,T){return this._getFromCacheMap(this._cacheMapCombined,C,L,M,D,T)}getRasterizedGlyph(C,L,M,D,T){return this._getFromCacheMap(this._cacheMap,C,L,M,D,T)}_getFromCacheMap(C,L,M,D,T,j=!1){return h=C.get(L,M,D,T),h||(h=this._drawToCache(L,M,D,T,j),C.set(L,M,D,T,h)),h}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,M,D){if(this._config.allowTransparency)return g.NULL_COLOR;let T;switch(C){case 16777216:case 33554432:T=this._getColorFromAnsiIndex(L);break;case 50331648:const j=r.AttributeData.toColorRGB(L);T=g.channels.toColor(j[0],j[1],j[2]);break;default:T=M?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return T}_getForegroundColor(C,L,M,D,T,j,X,U,P,G){const R=this._getMinimumContrastColor(C,L,M,D,T,j,X,P,U,G);if(R)return R;let z;switch(T){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&j<8&&(j+=8),z=this._getColorFromAnsiIndex(j);break;case 50331648:const A=r.AttributeData.toColorRGB(j);z=g.channels.toColor(A[0],A[1],A[2]);break;default:z=X?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(z=g.color.opaque(z)),U&&(z=g.color.multiplyOpacity(z,_.DIM_OPACITY)),z}_resolveBackgroundRgba(C,L,M){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,M,D){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,M,D,T,j,X,U,P,G){if(this._config.minimumContrastRatio===1||G)return;const R=this._getContrastCache(P),z=R.getColor(C,D);if(z!==void 0)return z||void 0;const A=this._resolveBackgroundRgba(L,M,X),O=this._resolveForegroundRgba(T,j,X,U),Y=g.rgba.ensureContrastRatio(A,O,this._config.minimumContrastRatio/(P?2:1));if(!Y)return void R.setColor(C,D,null);const Z=g.channels.toColor(Y>>24&255,Y>>16&255,Y>>8&255);return R.setColor(C,D,Z),Z}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,M,D,T=!1){const j=typeof C=="number"?String.fromCharCode(C):C,X=Math.min(this._config.deviceCellWidth*Math.max(j.length,2)+4,this._textureSize);this._tmpCanvas.width<X&&(this._tmpCanvas.width=X);const U=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<U&&(this._tmpCanvas.height=U),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=D,this._workAttributeData.isInvisible())return l;const P=!!this._workAttributeData.isBold(),G=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),z=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),O=!!this._workAttributeData.isStrikethrough(),Y=!!this._workAttributeData.isOverline();let Z=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),ue=this._workAttributeData.getBgColor(),F=this._workAttributeData.getBgColorMode();if(G){const ve=Z;Z=ue,ue=ve;const Ce=he;he=F,F=Ce}const k=this._getBackgroundColor(F,ue,G,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=k.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const se=P?this._config.fontWeightBold:this._config.fontWeight,ie=z?"italic":"";this._tmpCtx.font=`${ie} ${se} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=_.TEXT_BASELINE;const _e=j.length===1&&(0,o.isPowerlineGlyph)(j.charCodeAt(0)),de=j.length===1&&(0,o.isRestrictedPowerlineGlyph)(j.charCodeAt(0)),we=this._getForegroundColor(L,F,ue,M,he,Z,G,R,P,(0,o.treatGlyphAsBackgroundColor)(j.charCodeAt(0)));this._tmpCtx.fillStyle=we.css;const pe=de?0:4;let He=!1;this._config.customGlyphs!==!1&&(He=(0,v.tryDrawCustomChar)(this._tmpCtx,j,pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Qe,be=!_e;if(Qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),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-(T?2*ve:0),Ft=Fe+ve,ct=Fe+2*ve;let xt=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,ct),this._tmpCtx.lineTo(Re,ct);break;case 3:const dt=ve<=1?ct: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,ct-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 Ss=xt===0?0:xt>=ve?2*ve-xt:ve-xt;xt>=ve||Ss===0?(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(qe+Ss,Fe),this._tmpCtx.lineTo(Re,Fe)):(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(qe,Fe),this._tmpCtx.lineTo(qe+Ss,Fe),this._tmpCtx.moveTo(qe+Ss+ve,Fe),this._tmpCtx.lineTo(Re,Fe)),xt=(0,o.computeNextVariantOffset)(Re-qe,ve,xt);break;case 5:const _a=.6,va=.3,Ai=Re-qe,Zi=Math.floor(_a*Ai),Ji=Math.floor(va*Ai),oi=Ai-Zi-Ji;this._tmpCtx.setLineDash([Zi,Ji,oi]),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(),!He&&this._config.fontSize>=12&&!this._config.allowTransparency&&j!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const et=this._tmpCtx.measureText(j);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,ct-Fe+Math.ceil(ve/2)),this._tmpCtx.clip(qe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=k.css,this._tmpCtx.strokeText(j,pe,pe+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Y){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(He||this._tmpCtx.fillText(j,pe,pe+this._config.deviceCharHeight),j==="_"&&!this._config.allowTransparency){let ve=S(this._tmpCtx.getImageData(pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight),k,we,be);if(ve)for(let Ce=1;Ce<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=k.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(j,pe,pe+this._config.deviceCharHeight-Ce),ve=S(this._tmpCtx.getImageData(pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight),k,we,be),ve);Ce++);}if(O){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,k,we,be),si)return l;const Be=this._findGlyphBoundingBox(Bt,this._workBoundingBox,X,de,He,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(C,L,M,D,T,j){L.top=0;const X=D?this._config.deviceCellHeight:this._tmpCanvas.height,U=D?this._config.deviceCellWidth:M;let P=!1;for(let G=0;G<X;G++){for(let R=0;R<U;R++){const z=G*this._tmpCanvas.width*4+4*R+3;if(C.data[z]!==0){L.top=G,P=!0;break}}if(P)break}L.left=0,P=!1;for(let G=0;G<j+U;G++){for(let R=0;R<X;R++){const z=R*this._tmpCanvas.width*4+4*G+3;if(C.data[z]!==0){L.left=G,P=!0;break}}if(P)break}L.right=U,P=!1;for(let G=j+U-1;G>=j;G--){for(let R=0;R<X;R++){const z=R*this._tmpCanvas.width*4+4*G+3;if(C.data[z]!==0){L.right=G,P=!0;break}}if(P)break}L.bottom=X,P=!1;for(let G=X-1;G>=0;G--){for(let R=0;R<U;R++){const z=G*this._tmpCanvas.width*4+4*R+3;if(C.data[z]!==0){L.bottom=G,P=!0;break}}if(P)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+j+(D||T?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+j+(D||T?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=m;class w{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const D of M)this._glyphs.push(...D.glyphs),this._usedPixels+=D._usedPixels;this.canvas=x(C,L,L),this.ctx=(0,o.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,C,L,M){const D=C.rgba>>>24,T=C.rgba>>>16&255,j=C.rgba>>>8&255,X=L.rgba>>>24,U=L.rgba>>>16&255,P=L.rgba>>>8&255,G=Math.floor((Math.abs(D-X)+Math.abs(T-U)+Math.abs(j-P))/12);let R=!0;for(let z=0;z<p.data.length;z+=4)p.data[z]===D&&p.data[z+1]===T&&p.data[z+2]===j||M&&Math.abs(p.data[z]-D)+Math.abs(p.data[z+1]-T)+Math.abs(p.data[z+2]-j)<G?p.data[z+3]=0:R=!1;return R}function x(p,C,L){const M=p.createElement("canvas");return M.width=C,M.height=L,M}},160:(q,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,o=0;var g,b,y,d,r;function c(h){const m=h.toString(16);return m.length<2?"0"+m:m}function l(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,w,S,x){return x!==void 0?`#${c(m)}${c(w)}${c(S)}${c(x)}`:`#${c(m)}${c(w)}${c(S)}`},h.toRgba=function(m,w,S,x=255){return(m<<24|w<<16|S<<8|x)>>>0},h.toColor=function(m,w,S,x){return{css:h.toCss(m,w,S,x),rgba:h.toRgba(m,w,S,x)}}})(g||(n.channels=g={})),(function(h){function m(w,S){return o=Math.round(255*S),[f,_,v]=r.toChannels(w.rgba),{css:g.toCss(f,_,v,o),rgba:g.toRgba(f,_,v,o)}}h.blend=function(w,S){if(o=(255&S.rgba)/255,o===1)return{css:S.css,rgba:S.rgba};const x=S.rgba>>24&255,p=S.rgba>>16&255,C=S.rgba>>8&255,L=w.rgba>>24&255,M=w.rgba>>16&255,D=w.rgba>>8&255;return f=L+Math.round((x-L)*o),_=M+Math.round((p-M)*o),v=D+Math.round((C-D)*o),{css:g.toCss(f,_,v),rgba:g.toRgba(f,_,v)}},h.isOpaque=function(w){return(255&w.rgba)==255},h.ensureContrastRatio=function(w,S,x){const p=r.ensureContrastRatio(w.rgba,S.rgba,x);if(p)return g.toColor(p>>24&255,p>>16&255,p>>8&255)},h.opaque=function(w){const S=(255|w.rgba)>>>0;return[f,_,v]=r.toChannels(S),{css:g.toCss(f,_,v),rgba:S}},h.opacity=m,h.multiplyOpacity=function(w,S){return o=255&w.rgba,m(w,o*S/255)},h.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}})(b||(n.color=b={})),(function(h){let m,w;try{const S=document.createElement("canvas");S.width=1,S.height=1;const x=S.getContext("2d",{willReadFrequently:!0});x&&(m=x,m.globalCompositeOperation="copy",w=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),o=parseInt(S.slice(4,5).repeat(2),16),g.toColor(f,_,v,o);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 x=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(x)return f=parseInt(x[1]),_=parseInt(x[2]),v=parseInt(x[3]),o=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),g.toColor(f,_,v,o);if(!m||!w)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=w,m.fillStyle=S,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[f,_,v,o]=m.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(f,_,v,o),css:S}}})(y||(n.css=y={})),(function(h){function m(w,S,x){const p=w/255,C=S/255,L=x/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}h.relativeLuminance=function(w){return m(w>>16&255,w>>8&255,255&w)},h.relativeLuminance2=m})(d||(n.rgb=d={})),(function(h){function m(S,x,p){const C=S>>24&255,L=S>>16&255,M=S>>8&255;let D=x>>24&255,T=x>>16&255,j=x>>8&255,X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));for(;X<p&&(D>0||T>0||j>0);)D-=Math.max(0,Math.ceil(.1*D)),T-=Math.max(0,Math.ceil(.1*T)),j-=Math.max(0,Math.ceil(.1*j)),X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));return(D<<24|T<<16|j<<8|255)>>>0}function w(S,x,p){const C=S>>24&255,L=S>>16&255,M=S>>8&255;let D=x>>24&255,T=x>>16&255,j=x>>8&255,X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));for(;X<p&&(D<255||T<255||j<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),T=Math.min(255,T+Math.ceil(.1*(255-T))),j=Math.min(255,j+Math.ceil(.1*(255-j))),X=l(d.relativeLuminance2(D,T,j),d.relativeLuminance2(C,L,M));return(D<<24|T<<16|j<<8|255)>>>0}h.blend=function(S,x){if(o=(255&x)/255,o===1)return x;const p=x>>24&255,C=x>>16&255,L=x>>8&255,M=S>>24&255,D=S>>16&255,T=S>>8&255;return f=M+Math.round((p-M)*o),_=D+Math.round((C-D)*o),v=T+Math.round((L-T)*o),g.toRgba(f,_,v)},h.ensureContrastRatio=function(S,x,p){const C=d.relativeLuminance(S>>8),L=d.relativeLuminance(x>>8);if(l(C,L)<p){if(L<C){const T=m(S,x,p),j=l(C,d.relativeLuminance(T>>8));if(j<p){const X=w(S,x,p);return j>l(C,d.relativeLuminance(X>>8))?T:X}return T}const M=w(S,x,p),D=l(C,d.relativeLuminance(M>>8));if(D<p){const T=m(S,x,p);return D>l(C,d.relativeLuminance(T>>8))?M:T}return M}},h.reduceLuminance=m,h.increaseLuminance=w,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=l},345:(q,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 o=0;o<this._listeners.length;o++)v.push(this._listeners[o]);for(let o=0;o<v.length;o++)v[o].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:(q,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:(q,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(v,o,g){this._data[v]||(this._data[v]={}),this._data[v][o]=g}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}n.TwoKeyMap=f,n.FourKeyMap=class{constructor(){this._data=new f}set(_,v,o,g,b){this._data.get(_,v)||this._data.set(_,v,new f),this._data.get(_,v).set(o,g,b)}get(_,v,o,g){var b;return(b=this._data.get(_,v))==null?void 0:b.get(o,g)}clear(){this._data.clear()}}},399:(q,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:(q,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,d=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),d=Math.max(y,d),c=b.timeRemaining(),1.5*d>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 o 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=o,n.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:o,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(q,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(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new f;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}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(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,g=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=g}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=_},782:(q,n,f)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const _=f(133),v=f(855),o=f(147);class g extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const d=new g;return d.setFromCharData(y),d}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 d=!1;if(y[v.CHAR_DATA_CHAR_INDEX].length>2)d=!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:d=!0}else d=!0}else this.content=y[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[v.CHAR_DATA_WIDTH_INDEX]<<22;d&&(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:(q,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:(q,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 o="";for(let g=_;g<v;++g){let b=f[g];b>65535?(b-=65536,o+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):o+=String.fromCharCode(b)}return o},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,_){const v=f.length;if(!v)return 0;let o=0,g=0;if(this._interim){const b=f.charCodeAt(g++);56320<=b&&b<=57343?_[o++]=1024*(this._interim-55296)+b-56320+65536:(_[o++]=this._interim,_[o++]=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,o;const d=f.charCodeAt(b);56320<=d&&d<=57343?_[o++]=1024*(y-55296)+d-56320+65536:(_[o++]=y,_[o++]=d)}else y!==65279&&(_[o++]=y)}return o}},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 o,g,b,y,d=0,r=0,c=0;if(this.interim[0]){let m=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let S,x=0;for(;(S=63&this.interim[++x])&&x<4;)w<<=6,w|=S;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=p-x;for(;c<C;){if(c>=v)return 0;if(S=f[c++],(192&S)!=128){c--,m=!0;break}this.interim[x++]=S,w<<=6,w|=63&S}m||(p===2?w<128?c--:_[d++]=w:p===3?w<2048||w>=55296&&w<=57343||w===65279||(_[d++]=w):w<65536||w>1114111||(_[d++]=w)),this.interim.fill(0)}const l=v-4;let h=c;for(;h<v;){for(;!(!(h<l)||128&(o=f[h])||128&(g=f[h+1])||128&(b=f[h+2])||128&(y=f[h+3]));)_[d++]=o,_[d++]=g,_[d++]=b,_[d++]=y,h+=4;if(o=f[h++],o<128)_[d++]=o;else if((224&o)==192){if(h>=v)return this.interim[0]=o,d;if(g=f[h++],(192&g)!=128){h--;continue}if(r=(31&o)<<6|63&g,r<128){h--;continue}_[d++]=r}else if((240&o)==224){if(h>=v)return this.interim[0]=o,d;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=g,d;if(b=f[h++],(192&b)!=128){h--;continue}if(r=(15&o)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;_[d++]=r}else if((248&o)==240){if(h>=v)return this.interim[0]=o,d;if(g=f[h++],(192&g)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=g,d;if(b=f[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=g,this.interim[2]=b,d;if(y=f[h++],(192&y)!=128){h--;continue}if(r=(7&o)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;_[d++]=r}}return d}}},776:function(q,n,f){var _=this&&this.__decorate||function(r,c,l,h){var m,w=arguments.length,S=w<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,c,l,h);else for(var x=r.length-1;x>=0;x--)(m=r[x])&&(S=(w<3?m(S):w>3?m(c,l,S):m(c,l))||S);return w>3&&S&&Object.defineProperty(c,l,S),S},v=this&&this.__param||function(r,c){return function(l,h){c(l,h,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const o=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,d=n.LogService=class extends o.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,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...l)}trace(r,...c){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,c)}debug(r,...c){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,c)}info(r,...c){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,c)}warn(r,...c){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,c)}error(r,...c){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,c)}};n.LogService=d=_([v(0,g.IOptionsService)],d),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,c,l){if(typeof l.value!="function")throw new Error("not supported");const h=l.value;l.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 w=h.apply(this,m);return y.trace(`GlyphRenderer#${h.name} return`,w),w}}},726:(q,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 o=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(d,r,c){r[f]===r?r[_].push({id:d,index:c}):(r[_]=[{id:d,index:c}],r[f]=r)})(o,g,y)};return o.toString=()=>v,n.serviceRegistry.set(v,o),o}},97:(q,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(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.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")}},I={};function ne(q){var n=I[q];if(n!==void 0)return n.exports;var f=I[q]={exports:{}};return V[q].call(f.exports,f,f.exports,ne),f.exports}var le={};return(()=>{var q=le;Object.defineProperty(q,"__esModule",{value:!0}),q.WebglAddon=void 0;const n=ne(345),f=ne(859),_=ne(399),v=ne(666),o=ne(776);class g extends f.Disposable{constructor(y){if(_.isSafari&&(0,_.getSafariVersion)()<16){const d={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",d))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 d=y._core;if(!y.element)return void this.register(d.onWillOpen((()=>this.activate(y))));this._terminal=y;const r=d.coreService,c=d.optionsService,l=d,h=l._renderService,m=l._characterJoinerService,w=l._charSizeService,S=l._coreBrowserService,x=l._decorationService,p=l._logService,C=l._themeService;(0,o.setTraceLogger)(p),this._renderer=this.register(new v.WebglRenderer(y,m,w,S,r,x,c,C,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()}}q.WebglAddon=g})(),le})()))})(Uo)),Uo.exports}var Kv=Vv(),Io={exports:{}},ef;function Qv(){return ef||(ef=1,(function(N,Q){(function(V,I){N.exports=I()})(self,(()=>(()=>{var V={6:(q,n)=>{function f(v){try{const o=new URL(v),g=o.password&&o.username?`${o.protocol}//${o.username}:${o.password}@${o.host}`:o.username?`${o.protocol}//${o.username}@${o.host}`:`${o.protocol}//${o.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,o,g,b={}){this._terminal=v,this._regex=o,this._handler=g,this._options=b}provideLinks(v,o){const g=_.computeLink(v,this._regex,this._terminal,this._handler);o(this._addCallbacks(g))}_addCallbacks(v){return v.map((o=>(o.leave=this._options.leave,o.hover=(g,b)=>{if(this._options.hover){const{range:y}=o;this._options.hover(g,b,y)}},o)))}};class _{static computeLink(o,g,b,y){const d=new RegExp(g.source,(g.flags||"")+"g"),[r,c]=_._getWindowedLineStrings(o-1,b),l=r.join("");let h;const m=[];for(;h=d.exec(l);){const w=h[0];if(!f(w))continue;const[S,x]=_._mapStrIdx(b,c,0,h.index),[p,C]=_._mapStrIdx(b,S,x,w.length);if(S===-1||x===-1||p===-1||C===-1)continue;const L={start:{x:x+1,y:S+1},end:{x:C,y:p+1}};m.push({range:L,text:w,activate:y})}return m}static _getWindowedLineStrings(o,g){let b,y=o,d=o,r=0,c="";const l=[];if(b=g.buffer.active.getLine(o)){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,l.push(c),b.isWrapped&&c.indexOf(" ")===-1););l.reverse()}for(l.push(h),r=0;(b=g.buffer.active.getLine(++d))&&b.isWrapped&&r<2048&&(c=b.translateToString(!0),r+=c.length,l.push(c),c.indexOf(" ")===-1););}return[l,y]}static _mapStrIdx(o,g,b,y){const d=o.buffer.active,r=d.getNullCell();let c=b;for(;y;){const l=d.getLine(g);if(!l)return[-1,-1];for(let h=c;h<l.length;++h){l.getCell(h,r);const m=r.getChars();if(r.getWidth()&&(y-=m.length||1,h===l.length-1&&m==="")){const w=d.getLine(g+1);w&&w.isWrapped&&(w.getCell(0,r),r.getWidth()===2&&(y+=1))}if(y<0)return[g,h]}g++,c=0}return[g,c]}}n.LinkComputer=_}},I={};function ne(q){var n=I[q];if(n!==void 0)return n.exports;var f=I[q]={exports:{}};return V[q](f,f.exports,ne),f.exports}var le={};return(()=>{var q=le;Object.defineProperty(q,"__esModule",{value:!0}),q.WebLinksAddon=void 0;const n=ne(6),f=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function _(v,o){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}q.WebLinksAddon=class{constructor(v=_,o={}){this._handler=v,this._options=o}activate(v){this._terminal=v;const o=this._options,g=o.urlRegex||f;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,g,this._handler,o))}dispose(){var v;(v=this._linkProvider)==null||v.dispose()}}})(),le})()))})(Io)),Io.exports}var Zv=Qv();const Jv={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"},eg='"JetBrains Mono", ui-monospace, "SF Mono", "Menlo", monospace';function cf({sessionId:N,onExit:Q}){const V=fe.useRef(null);return fe.useEffect(()=>{var o;if(!V.current)return;const I=new $v.Terminal({fontFamily:eg,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:Jv}),ne=new Xv.FitAddon;I.loadAddon(ne),I.loadAddon(new Zv.WebLinksAddon),I.open(V.current);let le=null;try{le=new Kv.WebglAddon,le.onContextLoss(()=>{le==null||le.dispose(),le=null}),I.loadAddon(le)}catch{}requestAnimationFrame(()=>{try{ne.fit()}catch{}});const q=new WebSocket(zv(`/api/sessions/${encodeURIComponent(N)}/pty`));q.binaryType="arraybuffer";let n=!1;q.onmessage=g=>{if(typeof g.data=="string"){try{const y=JSON.parse(g.data);if(y.type==="hello"){n=!0;const d=ne.proposeDimensions();d&&q.send(JSON.stringify({type:"resize",cols:d.cols,rows:d.rows}))}else y.type==="exit"&&(Q==null||Q({exitCode:y.exitCode}))}catch{}return}const b=g.data instanceof ArrayBuffer?new Uint8Array(g.data):g.data;I.write(b)},q.onclose=()=>{I.write(`\r
115
+ \x1B[38;5;245m[connection closed]\x1B[0m\r
116
+ `)},q.onerror=()=>{I.write(`\r
117
+ \x1B[38;5;167m[websocket error]\x1B[0m\r
118
+ `)};const f=I.onData(g=>{q.readyState===WebSocket.OPEN&&q.send(JSON.stringify({type:"input",data:g}))}),_=()=>{try{if(ne.fit(),q.readyState===WebSocket.OPEN&&n){const g=ne.proposeDimensions();g&&q.send(JSON.stringify({type:"resize",cols:g.cols,rows:g.rows}))}}catch{}},v=new ResizeObserver(_);return v.observe(V.current),typeof document<"u"&&((o=document.fonts)!=null&&o.ready)&&document.fonts.ready.then(()=>{try{ne.fit()}catch{}}),()=>{v.disconnect(),f.dispose();try{q.close()}catch{}try{le==null||le.dispose()}catch{}I.dispose()}},[N,Q]),H.jsx("div",{ref:V,className:"h-full w-full"})}const tg={queued:"bg-zinc-500",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 ig({status:N}){return H.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${tg[N]}`,"aria-label":N})}const sg={queued:"neutral",running:"blue",completed:"green",pr_open:"amber",pr_closed:"red",merged:"orange",cleaned:"neutral",failed:"red"};function rg({taskId:N}){const{navigate:Q}=ms(),[V,I]=fe.useState(null),[ne,le]=fe.useState([]),[q,n]=fe.useState(null);fe.useEffect(()=>{let _=!1;const v=async()=>{try{const[g,b]=await Promise.all([ut.task(N),ut.sessions()]);if(_)return;I(g),le(b)}catch(g){_||n(g)}};v();const o=setInterval(v,4e3);return()=>{_=!0,clearInterval(o)}},[N]);const f=ne.find(_=>_.taskId===N&&_.status==="running");return q?H.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 text-red-300",children:["Failed to load: ",q.message]}):V?H.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-6 flex flex-col gap-4 h-[calc(100vh-65px)]",children:[H.jsxs("div",{className:"flex items-center gap-3",children:[H.jsx(Ke,{variant:"ghost",onClick:()=>Q("/"),children:"← Back"}),H.jsx(ig,{status:V.status}),H.jsxs("span",{className:"font-mono text-xs text-zinc-500",children:["#",V.id]}),H.jsx("h1",{className:"text-lg font-semibold text-zinc-100 truncate",children:V.issueTitle}),H.jsx(Jr,{tone:sg[V.status],children:lf[V.status]})]}),H.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-zinc-500",children:[H.jsxs("span",{className:"font-mono",children:[V.kind==="review"?"PR":"issue"," ",V.repoSlug,"#",V.issueNumber]}),H.jsx("span",{children:"·"}),H.jsxs("span",{children:["branch ",H.jsx("code",{className:"text-zinc-300",children:V.branch})]}),H.jsx("span",{children:"·"}),H.jsxs("span",{children:["agent ",H.jsx("code",{className:"text-zinc-300",children:V.agent})]}),H.jsx("span",{children:"·"}),H.jsxs("span",{children:["kind ",H.jsx("code",{className:"text-zinc-300",children:V.kind})]}),V.prUrl&&H.jsxs(H.Fragment,{children:[H.jsx("span",{children:"·"}),H.jsx("a",{className:"text-orange-400 hover:underline",href:V.prUrl,target:"_blank",rel:"noreferrer",children:V.prUrl.replace("https://github.com/","")})]}),V.exitCode!==null&&H.jsxs(H.Fragment,{children:[H.jsx("span",{children:"·"}),H.jsxs("span",{children:["exit ",V.exitCode]})]}),H.jsx("span",{className:"ml-auto"}),f?H.jsxs("div",{className:"flex items-center gap-2",children:[V.status==="running"&&H.jsx(Ke,{variant:"ghost",onClick:async()=>{try{I(await ut.markDone(V.id))}catch(_){alert(_.message)}},children:"Mark done"}),H.jsx(Ke,{variant:"danger",onClick:async()=>{if(confirm("Send SIGTERM to this session?"))try{await ut.killSession(f.id)}catch(_){alert(_.message)}},children:"Kill session"})]}):H.jsxs("div",{className:"flex items-center gap-2",children:[V.status!=="queued"&&V.status!=="running"&&H.jsx(Ke,{onClick:async()=>{try{await ut.retryTask(V.id),I(await ut.task(V.id))}catch(_){alert(_.message)}},children:"Resume"}),(V.status==="completed"||V.status==="failed"||V.status==="merged"||V.status==="pr_open"||V.status==="pr_closed"||V.status==="cleaned")&&H.jsx(Ke,{variant:"ghost",onClick:async()=>{if(confirm("Remove the worktree for this task?"))try{await ut.cleanupTask(V.id),Q("/")}catch(_){alert(_.message)}},children:"Cleanup worktree"})]})]}),H.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:[H.jsxs("div",{className:"flex items-center gap-1.5 border-b border-zinc-800/80 px-3 py-2",children:[H.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),H.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),H.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),H.jsxs("span",{className:"ml-3 text-[11px] font-mono text-zinc-500 truncate",children:[V.repoSlug," · ",V.branch]})]}),H.jsx("div",{className:"h-[calc(100%-37px)] p-3",children:f?H.jsx(cf,{sessionId:f.id}):H.jsx("div",{className:"h-full flex items-center justify-center text-sm text-zinc-500",children:V.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-"+V.id+".log."})})]})]}):H.jsx("div",{className:"mx-auto max-w-4xl px-6 py-12 text-zinc-500",children:"Loading…"})}function ng({sessionId:N}){const{navigate:Q}=ms(),[V,I]=fe.useState(null),[ne,le]=fe.useState(null);return fe.useEffect(()=>{let q=!1;const n=async()=>{try{const _=await ut.sessions();if(q)return;I(_.find(v=>v.id===N)??null)}catch(_){q||le(_.message)}};n();const f=setInterval(n,4e3);return()=>{q=!0,clearInterval(f)}},[N]),ne?H.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 text-red-300",children:["Failed to load: ",ne]}):V?H.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-6 flex flex-col gap-4 h-[calc(100vh-65px)]",children:[H.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[H.jsx(Ke,{variant:"ghost",onClick:()=>Q("/"),children:"← Back"}),H.jsx(Jr,{tone:V.status==="running"?"blue":"neutral",children:V.status}),H.jsx("h1",{className:"text-base font-medium text-zinc-100",children:"Shell"}),H.jsx("span",{className:"text-xs text-zinc-500 font-mono truncate",children:V.label??"—"}),H.jsx("span",{className:"ml-auto"}),V.status==="running"&&H.jsx(Ke,{variant:"danger",onClick:async()=>{if(confirm("Close this shell?"))try{await ut.killSession(V.id)}catch(q){alert(q.message)}},children:"Close shell"})]}),H.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:[H.jsxs("div",{className:"flex items-center gap-1.5 border-b border-zinc-800/80 px-3 py-2",children:[H.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),H.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),H.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-zinc-700"}),H.jsx("span",{className:"ml-3 text-[11px] font-mono text-zinc-500 truncate",children:V.label??`shell · pid ${V.pid}`})]}),H.jsx("div",{className:"h-[calc(100%-37px)] p-3",children:H.jsx(cf,{sessionId:V.id})})]})]}):H.jsx("div",{className:"mx-auto max-w-4xl px-6 py-12 text-zinc-500",children:"Loading shell…"})}function ag(){const[N,Q]=fe.useState(null),[V,I]=fe.useState(""),[ne,le]=fe.useState(""),[q,n]=fe.useState(!0),[f,_]=fe.useState(null),v=fe.useCallback(async()=>{n(!0),_(null);try{const b=await ut.rawConfig();le(b.path),I(b.content),Q(JSON.parse(b.content))}catch(b){_(b.message)}finally{n(!1)}},[]);fe.useEffect(()=>{v()},[v]);const o=fe.useCallback(async b=>{if(!N)throw new Error("config not loaded");const y=b(N),d=JSON.stringify(y,null,2);await ut.saveRawConfig(d),Q(y),I(d)},[N]),g=fe.useCallback(async b=>{await ut.saveRawConfig(b),I(b),Q(JSON.parse(b))},[]);return{cfg:N,rawText:V,path:ne,loading:q,loadError:f,save:o,saveRaw:g,reload:v}}function ps({title:N,action:Q,children:V}){return H.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 backdrop-blur-sm",children:[(N||Q)&&H.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-4 py-3",children:[H.jsx("div",{className:"text-sm font-medium text-zinc-200",children:N}),Q]}),H.jsx("div",{className:"p-4",children:V})]})}function Pt({className:N="",...Q}){return H.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 ${N}`,...Q})}function wt({label:N,hint:Q,children:V}){return H.jsxs("label",{className:"block",children:[H.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[H.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-400",children:N}),Q&&H.jsx("span",{className:"text-[11px] text-zinc-500",children:Q})]}),V]})}function lg({cfg:N,save:Q}){const[V,I]=fe.useState(N.server.host),[ne,le]=fe.useState(String(N.server.port)),[q,n]=fe.useState(!1),[f,_]=fe.useState(null);fe.useEffect(()=>{I(N.server.host),le(String(N.server.port))},[N.server.host,N.server.port]);const v=V!==N.server.host||ne!==String(N.server.port),o=async()=>{_(null);const g=Number(ne);if(!Number.isInteger(g)||g<1||g>65535){_("port must be 1–65535");return}n(!0);try{await Q(b=>({...b,server:{host:V,port:g}}))}catch(b){_(b.message)}finally{n(!1)}};return H.jsxs(ps,{title:"Server",action:H.jsx(Ke,{disabled:!v||q,onClick:o,children:q?"Saving…":"Save"}),children:[H.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[H.jsx(wt,{label:"Host",hint:"0.0.0.0 = LAN, 127.0.0.1 = local only",children:H.jsx(Pt,{value:V,onChange:g=>I(g.target.value)})}),H.jsx(wt,{label:"Port",children:H.jsx(Pt,{type:"number",min:1,max:65535,value:ne,onChange:g=>le(g.target.value)})})]}),f&&H.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}),H.jsx("p",{className:"mt-3 text-[11px] text-zinc-500",children:"Restart the gateway after changing host or port."})]})}function og({cfg:N,save:Q}){const[V,I]=fe.useState(String(N.github.pollIntervalSeconds)),[ne,le]=fe.useState(!1),[q,n]=fe.useState(null);fe.useEffect(()=>{I(String(N.github.pollIntervalSeconds))},[N.github.pollIntervalSeconds]);const f=Number(V)!==N.github.pollIntervalSeconds,_=async()=>{n(null);const v=Number(V);if(!Number.isInteger(v)||v<10||v>3600){n("poll interval must be 10–3600 seconds");return}le(!0);try{await Q(o=>({...o,github:{...o.github,pollIntervalSeconds:v}}))}catch(o){n(o.message)}finally{le(!1)}};return H.jsxs(ps,{title:"GitHub",action:H.jsx(Ke,{disabled:!f||ne,onClick:_,children:ne?"Saving…":"Save"}),children:[H.jsx(wt,{label:"Poll interval (seconds)",hint:"how often the poller checks for newly-labeled issues and PRs",children:H.jsx(Pt,{type:"number",min:10,max:3600,value:V,onChange:v=>I(v.target.value)})}),H.jsxs("p",{className:"mt-3 text-[11px] text-zinc-500",children:["Trigger labels are convention-based. Each agent listens for ",H.jsx("code",{children:"tono-<name>"})," on issues and"," ",H.jsx("code",{children:"tono-<name>-review"})," on PRs."]}),q&&H.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:q})]})}function cg({cfg:N,save:Q}){const[V,I]=fe.useState(N.workspaces.root),[ne,le]=fe.useState(!1),[q,n]=fe.useState(null);fe.useEffect(()=>I(N.workspaces.root),[N.workspaces.root]);const f=V!==N.workspaces.root,_=async()=>{if(n(null),!V.trim()){n("workspace root must not be empty");return}le(!0);try{await Q(v=>({...v,workspaces:{root:V.trim()}}))}catch(v){n(v.message)}finally{le(!1)}};return H.jsxs(ps,{title:"Workspaces",action:H.jsx(Ke,{disabled:!f||ne,onClick:_,children:ne?"Saving…":"Save"}),children:[H.jsx(wt,{label:"Root path",hint:"bare clones land at <root>/.bare/, worktrees at <root>/<owner>__<repo>__issue-N/",children:H.jsx(Pt,{value:V,onChange:v=>I(v.target.value),placeholder:"~/.tono/workspaces"})}),q&&H.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:q})]})}const hg=/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;function ug({cfg:N,agents:Q,save:V}){return H.jsxs(ps,{title:H.jsxs("span",{className:"flex items-center gap-2",children:["Repos",H.jsx("span",{className:"text-xs text-zinc-500",children:N.repos.length})]}),children:[H.jsxs("div",{className:"space-y-2",children:[N.repos.map((I,ne)=>H.jsx(dg,{repo:I,agents:Q,onSave:async le=>{await V(q=>({...q,repos:q.repos.map((n,f)=>f===ne?le:n)}))},onRemove:async()=>{confirm(`Remove ${I.slug}?`)&&await V(le=>({...le,repos:le.repos.filter((q,n)=>n!==ne)}))}},`${I.slug}-${ne}`)),N.repos.length===0&&H.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."}),H.jsx(fg,{agents:Q,existing:N.repos.map(I=>I.slug),onAdd:async I=>{await V(ne=>({...ne,repos:[...ne.repos,I]}))}})]}),H.jsxs("p",{className:"mt-3 text-[11px] text-zinc-500",children:["Each enrolled agent listens for ",H.jsx("code",{children:"tono-<name>"})," on issues and"," ",H.jsx("code",{children:"tono-<name>-review"})," on pull requests."]})]})}function tf(N){return N==="claude-code"?"claude":N}function sf(N,Q){return N&&N.length>0?N:Q}function dg({repo:N,agents:Q,onSave:V,onRemove:I}){const[ne,le]=fe.useState(!1),[q,n]=fe.useState(N.path??""),[f,_]=fe.useState(N.baseBranch),[v,o]=fe.useState(new Set(sf(N.agents,Q))),[g,b]=fe.useState(!1),[y,d]=fe.useState(null);if(!ne){const c=sf(N.agents,Q);return H.jsxs("div",{className:"rounded-md border border-zinc-800 bg-zinc-900/40 px-3 py-2 min-w-0",children:[H.jsxs("div",{className:"flex items-start justify-between gap-2",children:[H.jsx("code",{className:"text-zinc-100 text-sm break-all",children:N.slug}),H.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[H.jsx(Ke,{variant:"ghost",onClick:()=>le(!0),children:"Edit"}),H.jsx(Ke,{variant:"danger",onClick:I,children:"Remove"})]})]}),H.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-zinc-400",children:[H.jsxs("span",{children:["base ",H.jsx("span",{className:"text-zinc-200",children:N.baseBranch})]}),H.jsx("span",{className:"text-zinc-600",children:"·"}),H.jsxs("span",{children:["agents ",H.jsx("span",{className:"text-zinc-200",children:c.join(", ")||"(none)"})]}),N.agents===void 0&&H.jsx("span",{className:"text-[10px] text-zinc-500 uppercase",children:"all"})]}),H.jsx("div",{className:"mt-1 text-xs text-zinc-500 font-mono break-all",children:N.path??H.jsx("span",{className:"italic",children:"tono will bare-clone via gh"})}),c.length>0&&H.jsx("div",{className:"mt-1 flex flex-wrap gap-1 text-[10px] text-zinc-500",children:c.map(l=>H.jsxs("span",{children:[H.jsxs("code",{className:"text-zinc-300",children:["tono-",tf(l)]})," / ",H.jsxs("code",{className:"text-zinc-300",children:["tono-",tf(l),"-review"]})]},l))})]})}const r=async()=>{if(d(null),!f.trim()){d("base branch is required");return}if(v.size===0){d("at least one agent must be enrolled");return}b(!0);try{const c=Q.filter(h=>v.has(h)),l=c.length===Q.length;await V({slug:N.slug,baseBranch:f.trim(),...q.trim()?{path:q.trim()}:{},...l?{}:{agents:c}}),le(!1)}catch(c){d(c.message)}finally{b(!1)}};return H.jsxs("div",{className:"rounded-md border border-zinc-700 bg-zinc-900/60 p-3 space-y-3",children:[H.jsxs("div",{className:"flex items-center justify-between",children:[H.jsx("code",{className:"text-sm text-zinc-100",children:N.slug}),H.jsx("span",{className:"text-[11px] text-zinc-500",children:"slug isn't editable; remove and re-add to rename"})]}),H.jsx(wt,{label:"Path to local clone",hint:"optional; blank = bare-clone via gh",children:H.jsx(Pt,{value:q,onChange:c=>n(c.target.value),placeholder:"/Users/me/code/repo (or leave blank)"})}),H.jsx(wt,{label:"Base branch",children:H.jsx(Pt,{value:f,onChange:c=>_(c.target.value)})}),H.jsx(hf,{agents:Q,enrolled:v,onToggle:c=>{const l=new Set(v);l.has(c)?l.delete(c):l.add(c),o(l)}}),y&&H.jsx("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:y}),H.jsxs("div",{className:"flex justify-end gap-2",children:[H.jsx(Ke,{variant:"ghost",disabled:g,onClick:()=>le(!1),children:"Cancel"}),H.jsx(Ke,{disabled:g,onClick:r,children:g?"Saving…":"Save"})]})]})}function hf({agents:N,enrolled:Q,onToggle:V}){return H.jsxs("div",{children:[H.jsx("div",{className:"text-xs text-zinc-400 mb-1",children:"Enrolled agents"}),H.jsx("div",{className:"flex flex-wrap gap-3",children:N.length===0?H.jsx("span",{className:"text-xs text-zinc-500 italic",children:"no agents declared in config"}):N.map(I=>H.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-zinc-200",children:[H.jsx("input",{type:"checkbox",checked:Q.has(I),onChange:()=>V(I),className:"h-4 w-4 accent-orange-500"}),H.jsx("span",{children:I})]},I))})]})}function fg({agents:N,existing:Q,onAdd:V}){const[I,ne]=fe.useState(""),[le,q]=fe.useState(""),[n,f]=fe.useState("main"),[_,v]=fe.useState(new Set(N)),[o,g]=fe.useState(!1),[b,y]=fe.useState(null),d=async()=>{y(null);const r=I.trim();if(!hg.test(r)){y("slug must be owner/repo");return}if(Q.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=N.filter(h=>_.has(h)),l=c.length===N.length;await V({slug:r,baseBranch:n.trim()||"main",...le.trim()?{path:le.trim()}:{},...l?{}:{agents:c}}),ne(""),q(""),f("main"),v(new Set(N))}catch(c){y(c.message)}finally{g(!1)}};return H.jsxs("div",{className:"rounded-md border border-dashed border-zinc-700 bg-zinc-900/30 p-3 space-y-3",children:[H.jsx("div",{className:"text-xs uppercase tracking-wide text-zinc-400",children:"Add a repo"}),H.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[H.jsx(wt,{label:"Slug",hint:"owner/repo on GitHub",children:H.jsx(Pt,{value:I,onChange:r=>ne(r.target.value),placeholder:"loopedautomation/mono"})}),H.jsx(wt,{label:"Path to local clone",hint:"optional; blank = tono bare-clones",children:H.jsx(Pt,{value:le,onChange:r=>q(r.target.value),placeholder:"(blank = bare-clone via gh)"})})]}),H.jsx(wt,{label:"Base branch",children:H.jsx(Pt,{value:n,onChange:r=>f(r.target.value),placeholder:"main"})}),H.jsx(hf,{agents:N,enrolled:_,onToggle:r=>{const c=new Set(_);c.has(r)?c.delete(r):c.add(r),v(c)}}),b&&H.jsx("div",{className:"rounded-md border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-300",children:b}),H.jsx("div",{className:"flex justify-end",children:H.jsx(Ke,{disabled:o||!I.trim(),onClick:d,children:o?"Adding…":"+ Add repo"})})]})}function rf({className:N="",...Q}){return H.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 ${N}`,...Q})}const nf={command:"",args:[],concurrency:{implement:1,review:2},promptTemplates:{implement:"",review:""}};function _g({name:N,cfg:Q,save:V}){var p,C,L,M;const I=Q.agents[N]??nf,[ne,le]=fe.useState(I.command),[q,n]=fe.useState(I.args.join(" ")),[f,_]=fe.useState(String(I.concurrency.implement)),[v,o]=fe.useState(String(I.concurrency.review)),[g,b]=fe.useState(((p=I.promptTemplates)==null?void 0:p.implement)??""),[y,d]=fe.useState(((C=I.promptTemplates)==null?void 0:C.review)??""),[r,c]=fe.useState(!1),[l,h]=fe.useState(null);fe.useEffect(()=>{var T,j;const D=Q.agents[N]??nf;le(D.command),n(D.args.join(" ")),_(String(D.concurrency.implement)),o(String(D.concurrency.review)),b(((T=D.promptTemplates)==null?void 0:T.implement)??""),d(((j=D.promptTemplates)==null?void 0:j.review)??"")},[Q.agents,N]);const m=q.length===0?[]:q.split(/\s+/).filter(Boolean),w=ne!==I.command||m.join(" ")!==I.args.join(" ")||Number(f)!==I.concurrency.implement||Number(v)!==I.concurrency.review||g!==(((L=I.promptTemplates)==null?void 0:L.implement)??"")||y!==(((M=I.promptTemplates)==null?void 0:M.review)??""),S=async()=>{if(h(null),!ne.trim()){h("command is required");return}if(!g.trim()||!y.trim()){h("both prompt templates are required");return}const D=Number(f),T=Number(v);if(!Number.isInteger(D)||D<0||D>32||!Number.isInteger(T)||T<0||T>32){h("concurrency must be 0–32");return}c(!0);try{await V(j=>({...j,agents:{...j.agents,[N]:{command:ne.trim(),args:m,concurrency:{implement:D,review:T},promptTemplates:{implement:g,review:y}}}}))}catch(j){h(j.message)}finally{c(!1)}},x=N==="claude-code"?"claude":N;return H.jsxs(ps,{title:H.jsxs("span",{className:"flex items-center gap-2",children:[H.jsxs("span",{children:["Agent ",H.jsx("code",{className:"text-zinc-400 text-xs",children:N})]}),H.jsxs("span",{className:"text-[10px] text-zinc-500",children:["implement: ",H.jsxs("code",{className:"text-zinc-300",children:["tono-",x]})," · review: ",H.jsxs("code",{className:"text-zinc-300 ml-1",children:["tono-",x,"-review"]})]})]}),action:H.jsx(Ke,{disabled:!w||r,onClick:S,children:r?"Saving…":"Save"}),children:[H.jsxs("div",{className:"space-y-3",children:[H.jsx(wt,{label:"Command",hint:"must be on $PATH",children:H.jsx(Pt,{value:ne,onChange:D=>le(D.target.value),placeholder:"claude"})}),H.jsx(wt,{label:"Args",hint:"space-separated; use {prompt} placeholder if the CLI takes prompt as a flag",children:H.jsx(Pt,{value:q,onChange:D=>n(D.target.value),placeholder:"--dangerously-skip-permissions"})}),H.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[H.jsx(wt,{label:"Concurrency (implement)",hint:"max simultaneous issue tasks",children:H.jsx(Pt,{type:"number",min:0,max:32,value:f,onChange:D=>_(D.target.value)})}),H.jsx(wt,{label:"Concurrency (review)",hint:"max simultaneous PR reviews",children:H.jsx(Pt,{type:"number",min:0,max:32,value:v,onChange:D=>o(D.target.value)})})]}),H.jsx(wt,{label:"Implement prompt template",hint:"placeholders: {issueNumber} {issueTitle} {issueBody} {repoSlug} {baseBranch} {branch}",children:H.jsx(rf,{value:g,onChange:D=>b(D.target.value),rows:8,placeholder:"You are working on..."})}),H.jsx(wt,{label:"Review prompt template",hint:"placeholders include {prUrl} for the PR being reviewed",children:H.jsx(rf,{value:y,onChange:D=>d(D.target.value),rows:8,placeholder:"You are reviewing PR #{issueNumber}..."})})]}),l&&H.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:l})]})}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 vg({cfg:N,save:Q}){var v;const V=fe.useMemo(()=>af.filter(o=>!N.agents[o.type]),[N.agents]),[I,ne]=fe.useState(((v=V[0])==null?void 0:v.type)??""),[le,q]=fe.useState(!1),[n,f]=fe.useState(null);if(V.length===0)return null;I&&!V.find(o=>o.type===I)&&ne(V[0].type);const _=async()=>{f(null);const o=af.find(g=>g.type===I);if(o){q(!0);try{await Q(g=>({...g,agents:{...g.agents,[o.type]:o.defaults}}))}catch(g){f(g.message)}finally{q(!1)}}};return H.jsxs(ps,{title:"Add agent",children:[H.jsxs("div",{className:"flex items-end gap-3",children:[H.jsxs("div",{className:"flex-1",children:[H.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Agent type"}),H.jsx("select",{value:I,onChange:o=>ne(o.target.value),className:"w-full rounded-md border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm",children:V.map(o=>H.jsxs("option",{value:o.type,children:[o.label," (",o.type,")"]},o.type))})]}),H.jsx(Ke,{disabled:le||!I,onClick:_,children:le?"Adding…":"+ Add"})]}),H.jsxs("p",{className:"mt-2 text-[11px] text-zinc-500",children:["Adds the agent with default ",H.jsx("code",{className:"text-zinc-300",children:"command"}),", ",H.jsx("code",{className:"text-zinc-300",children:"args"}),", concurrency, and prompt templates. Edit the new section below to tune. The CLI must exist on ",H.jsx("code",{className:"text-zinc-300",children:"$PATH"})," for tono to spawn it."]}),n&&H.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 gg({initial:N,path:Q,onSave:V}){const[I,ne]=fe.useState(N),[le,q]=fe.useState(!1),[n,f]=fe.useState(null),[_,v]=fe.useState(null),o=fe.useRef(null);fe.useEffect(()=>{ne(N)},[N]);const g=I!==N,b=async()=>{q(!0),f(null);try{await V(I),v(new Date)}catch(d){f(d.message)}finally{q(!1)}},y=d=>{if(d.key==="Tab"){d.preventDefault();const r=o.current;if(!r)return;const{selectionStart:c,selectionEnd:l}=r,h=I.slice(0,c)+" "+I.slice(l);ne(h),requestAnimationFrame(()=>{r.selectionStart=r.selectionEnd=c+2})}(d.metaKey||d.ctrlKey)&&d.key==="s"&&(d.preventDefault(),g&&!le&&b())};return H.jsxs(ps,{title:H.jsxs(H.Fragment,{children:["Raw JSON ",H.jsx("span",{className:"text-xs text-zinc-500 font-mono",children:Q})]}),action:H.jsxs("div",{className:"flex items-center gap-2",children:[_&&!g&&!n&&H.jsxs("span",{className:"text-xs text-green-400",children:["saved ",_.toLocaleTimeString()]}),g&&H.jsx("span",{className:"text-xs text-amber-400",children:"unsaved"}),H.jsx(Ke,{variant:"ghost",disabled:!g||le,onClick:()=>ne(N),children:"Revert"}),H.jsx(Ke,{disabled:!g||le,onClick:b,children:le?"Saving…":"Save"})]}),children:[n&&H.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}),H.jsx("textarea",{ref:o,value:I,onChange:d=>ne(d.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"}),H.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Validates against the schema on save. ⌘S to save."})]})}function mg(){const{cfg:N,rawText:Q,path:V,loading:I,loadError:ne,save:le,saveRaw:q}=ag(),[n,f]=fe.useState(!1);if(I)return H.jsx("div",{className:"mx-auto max-w-4xl px-6 py-12 text-zinc-500",children:"Loading…"});if(ne||!N)return H.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 text-red-300",children:["Failed to load config: ",ne??"unknown error"]});const _=Object.keys(N.agents);return H.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-6 space-y-4",children:[H.jsxs("div",{className:"flex items-center justify-between",children:[H.jsx("h1",{className:"text-base font-semibold text-zinc-200",children:"Config"}),H.jsxs(Ke,{variant:"ghost",onClick:()=>f(v=>!v),children:[n?"Hide":"Show"," raw JSON"]})]}),H.jsx(lg,{cfg:N,save:le}),H.jsx(og,{cfg:N,save:le}),H.jsx(cg,{cfg:N,save:le}),H.jsx(ug,{cfg:N,agents:_,save:le}),_.map(v=>H.jsx(_g,{name:v,cfg:N,save:le},v)),H.jsx(vg,{cfg:N,save:le}),n&&H.jsx(gg,{initial:Q,path:V,onSave:q}),H.jsxs("p",{className:"text-[11px] text-zinc-500",children:["Edits write directly to ",H.jsx("code",{className:"text-zinc-300",children:V}),". Schema-validated on save. Trigger labels are convention-based: ",H.jsx("code",{className:"text-zinc-300",children:"tono-<agent>"})," for issues,"," ",H.jsx("code",{className:"text-zinc-300",children:"tono-<agent>-review"})," for PRs. Server host / port require ",H.jsx("code",{className:"text-zinc-300",children:"tono gateway restart"}),"."]})]})}function pg(){const{path:N}=ms();let Q;const V=N.match(/^\/tasks\/(\d+)\/?$/),I=N.match(/^\/shells\/([^/]+)\/?$/);return V?Q=H.jsx(rg,{taskId:Number(V[1])}):I?Q=H.jsx(ng,{sessionId:decodeURIComponent(I[1])}):N.startsWith("/config")||N.startsWith("/settings")?Q=H.jsx(mg,{}):Q=H.jsx(Wv,{}),H.jsxs("div",{className:"min-h-screen flex flex-col",children:[H.jsx(Nv,{}),H.jsx("main",{className:"flex-1",children:Q})]})}const uf=document.getElementById("root");if(!uf)throw new Error("No #root element");kv.createRoot(uf).render(H.jsx(fe.StrictMode,{children:H.jsx(pg,{})}));