@sapiom/harness 0.1.5 → 0.1.6

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 (86) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cli/bin.js +24 -7
  3. package/dist/cli/bin.js.map +1 -1
  4. package/dist/cli/consent.js +1 -1
  5. package/dist/core/adapters/adapter.d.ts +2 -2
  6. package/dist/core/api-key-provider.d.ts +79 -0
  7. package/dist/core/api-key-provider.d.ts.map +1 -0
  8. package/dist/core/api-key-provider.js +91 -0
  9. package/dist/core/api-key-provider.js.map +1 -0
  10. package/dist/core/canvas-run-state.d.ts +9 -5
  11. package/dist/core/canvas-run-state.d.ts.map +1 -1
  12. package/dist/core/canvas-run-state.js +42 -13
  13. package/dist/core/canvas-run-state.js.map +1 -1
  14. package/dist/core/definition-slug-resolver.d.ts +13 -0
  15. package/dist/core/definition-slug-resolver.d.ts.map +1 -1
  16. package/dist/core/definition-slug-resolver.js +29 -0
  17. package/dist/core/definition-slug-resolver.js.map +1 -1
  18. package/dist/core/render-local-run.d.ts +82 -0
  19. package/dist/core/render-local-run.d.ts.map +1 -0
  20. package/dist/core/render-local-run.js +105 -0
  21. package/dist/core/render-local-run.js.map +1 -0
  22. package/dist/core/render-log-slice.d.ts +30 -0
  23. package/dist/core/render-log-slice.d.ts.map +1 -0
  24. package/dist/core/render-log-slice.js +49 -0
  25. package/dist/core/render-log-slice.js.map +1 -0
  26. package/dist/core/render-run-state.d.ts.map +1 -1
  27. package/dist/core/render-run-state.js +30 -49
  28. package/dist/core/render-run-state.js.map +1 -1
  29. package/dist/core/run-local-bootstrap.d.ts +93 -0
  30. package/dist/core/run-local-bootstrap.d.ts.map +1 -0
  31. package/dist/core/run-local-bootstrap.js +155 -0
  32. package/dist/core/run-local-bootstrap.js.map +1 -0
  33. package/dist/core/run-state.d.ts +16 -1
  34. package/dist/core/run-state.d.ts.map +1 -1
  35. package/dist/core/run-state.js +75 -25
  36. package/dist/core/run-state.js.map +1 -1
  37. package/dist/core/stub-feedback.d.ts +52 -0
  38. package/dist/core/stub-feedback.d.ts.map +1 -0
  39. package/dist/core/stub-feedback.js +33 -0
  40. package/dist/core/stub-feedback.js.map +1 -0
  41. package/dist/server/actions.d.ts +139 -0
  42. package/dist/server/actions.d.ts.map +1 -0
  43. package/dist/server/actions.js +430 -0
  44. package/dist/server/actions.js.map +1 -0
  45. package/dist/server/auth-routes.d.ts +92 -0
  46. package/dist/server/auth-routes.d.ts.map +1 -0
  47. package/dist/server/auth-routes.js +151 -0
  48. package/dist/server/auth-routes.js.map +1 -0
  49. package/dist/server/index.d.ts.map +1 -1
  50. package/dist/server/index.js +0 -0
  51. package/dist/server/index.js.map +1 -1
  52. package/dist/server/rest.d.ts.map +1 -1
  53. package/dist/server/rest.js +0 -2
  54. package/dist/server/rest.js.map +1 -1
  55. package/dist/server/runs.d.ts +16 -15
  56. package/dist/server/runs.d.ts.map +1 -1
  57. package/dist/server/runs.js +15 -80
  58. package/dist/server/runs.js.map +1 -1
  59. package/dist/server/static.d.ts +15 -1
  60. package/dist/server/static.d.ts.map +1 -1
  61. package/dist/server/static.js +54 -4
  62. package/dist/server/static.js.map +1 -1
  63. package/dist/shared/types.d.ts +79 -35
  64. package/dist/shared/types.d.ts.map +1 -1
  65. package/dist/shared/types.js.map +1 -1
  66. package/dist/web/assets/index-DCtyI4VW.css +32 -0
  67. package/dist/web/assets/index-WSw5RvYR.js +445 -0
  68. package/dist/web/canvas/sess-boot/index.html +305 -0
  69. package/dist/web/index.html +4 -9
  70. package/dist/web/welcome-hero-dark.png +0 -0
  71. package/dist/web/welcome-hero-light.png +0 -0
  72. package/package.json +6 -3
  73. package/dist/core/run-spend.d.ts +0 -55
  74. package/dist/core/run-spend.d.ts.map +0 -1
  75. package/dist/core/run-spend.js +0 -109
  76. package/dist/core/run-spend.js.map +0 -1
  77. package/dist/core/run-transactions.d.ts +0 -60
  78. package/dist/core/run-transactions.d.ts.map +0 -1
  79. package/dist/core/run-transactions.js +0 -129
  80. package/dist/core/run-transactions.js.map +0 -1
  81. package/dist/server/skills.d.ts +0 -51
  82. package/dist/server/skills.d.ts.map +0 -1
  83. package/dist/server/skills.js +0 -312
  84. package/dist/server/skills.js.map +0 -1
  85. package/dist/web/assets/index-DM84J83Y.js +0 -234
  86. package/dist/web/assets/index-DemtWW4L.css +0 -32
@@ -1,234 +0,0 @@
1
- var Iv=Object.defineProperty;var Pv=(x,H,I)=>H in x?Iv(x,H,{enumerable:!0,configurable:!0,writable:!0,value:I}):x[H]=I;var Do=(x,H,I)=>Pv(x,typeof H!="symbol"?H+"":H,I);(function(){const H=document.createElement("link").relList;if(H&&H.supports&&H.supports("modulepreload"))return;for(const $ of document.querySelectorAll('link[rel="modulepreload"]'))M($);new MutationObserver($=>{for(const Q of $)if(Q.type==="childList")for(const P of Q.addedNodes)P.tagName==="LINK"&&P.rel==="modulepreload"&&M(P)}).observe(document,{childList:!0,subtree:!0});function I($){const Q={};return $.integrity&&(Q.integrity=$.integrity),$.referrerPolicy&&(Q.referrerPolicy=$.referrerPolicy),$.crossOrigin==="use-credentials"?Q.credentials="include":$.crossOrigin==="anonymous"?Q.credentials="omit":Q.credentials="same-origin",Q}function M($){if($.ep)return;$.ep=!0;const Q=I($);fetch($.href,Q)}})();var Ro={exports:{}},Kr={};/**
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 Xf;function Wv(){if(Xf)return Kr;Xf=1;var x=Symbol.for("react.transitional.element"),H=Symbol.for("react.fragment");function I(M,$,Q){var P=null;if(Q!==void 0&&(P=""+Q),$.key!==void 0&&(P=""+$.key),"key"in $){Q={};for(var u in $)u!=="key"&&(Q[u]=$[u])}else Q=$;return $=Q.ref,{$$typeof:x,type:M,key:P,ref:$!==void 0?$:null,props:Q}}return Kr.Fragment=H,Kr.jsx=I,Kr.jsxs=I,Kr}var $f;function Fv(){return $f||($f=1,Ro.exports=Wv()),Ro.exports}var k=Fv(),To={exports:{}},be={};/**
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 Vf;function Kv(){if(Vf)return be;Vf=1;var x=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),P=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,l={};function c(D,O,G){this.props=D,this.context=O,this.refs=l,this.updater=G||E}c.prototype.isReactComponent={},c.prototype.setState=function(D,O){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,O,"setState")},c.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function n(){}n.prototype=c.prototype;function o(D,O,G){this.props=D,this.context=O,this.refs=l,this.updater=G||E}var _=o.prototype=new n;_.constructor=o,v(_,c.prototype),_.isPureReactComponent=!0;var b=Array.isArray;function w(){}var C={H:null,A:null,T:null,S:null},m=Object.prototype.hasOwnProperty;function A(D,O,G){var ae=G.ref;return{$$typeof:x,type:D,key:O,ref:ae!==void 0?ae:null,props:G}}function j(D,O){return A(D.type,O,D.props)}function U(D){return typeof D=="object"&&D!==null&&D.$$typeof===x}function W(D){var O={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(G){return O[G]})}var z=/\/+/g;function re(D,O){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):O.toString(36)}function ce(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(w,w):(D.status="pending",D.then(function(O){D.status==="pending"&&(D.status="fulfilled",D.value=O)},function(O){D.status==="pending"&&(D.status="rejected",D.reason=O)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function F(D,O,G,ae,J){var V=typeof D;(V==="undefined"||V==="boolean")&&(D=null);var N=!1;if(D===null)N=!0;else switch(V){case"bigint":case"string":case"number":N=!0;break;case"object":switch(D.$$typeof){case x:case H:N=!0;break;case g:return N=D._init,F(N(D._payload),O,G,ae,J)}}if(N)return J=J(D),N=ae===""?"."+re(D,0):ae,b(J)?(G="",N!=null&&(G=N.replace(z,"$&/")+"/"),F(J,O,G,"",function(le){return le})):J!=null&&(U(J)&&(J=j(J,G+(J.key==null||D&&D.key===J.key?"":(""+J.key).replace(z,"$&/")+"/")+N)),O.push(J)),1;N=0;var R=ae===""?".":ae+":";if(b(D))for(var Z=0;Z<D.length;Z++)ae=D[Z],V=R+re(ae,Z),N+=F(ae,O,G,V,J);else if(Z=S(D),typeof Z=="function")for(D=Z.call(D),Z=0;!(ae=D.next()).done;)ae=ae.value,V=R+re(ae,Z++),N+=F(ae,O,G,V,J);else if(V==="object"){if(typeof D.then=="function")return F(ce(D),O,G,ae,J);throw O=String(D),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return N}function K(D,O,G){if(D==null)return D;var ae=[],J=0;return F(D,ae,"","",function(V){return O.call(G,V,J++)}),ae}function te(D){if(D._status===-1){var O=D._result;O=O(),O.then(function(G){(D._status===0||D._status===-1)&&(D._status=1,D._result=G)},function(G){(D._status===0||D._status===-1)&&(D._status=2,D._result=G)}),D._status===-1&&(D._status=0,D._result=O)}if(D._status===1)return D._result.default;throw D._result}var T=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},B={map:K,forEach:function(D,O,G){K(D,function(){O.apply(this,arguments)},G)},count:function(D){var O=0;return K(D,function(){O++}),O},toArray:function(D){return K(D,function(O){return O})||[]},only:function(D){if(!U(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return be.Activity=h,be.Children=B,be.Component=c,be.Fragment=I,be.Profiler=$,be.PureComponent=o,be.StrictMode=M,be.Suspense=f,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,be.__COMPILER_RUNTIME={__proto__:null,c:function(D){return C.H.useMemoCache(D)}},be.cache=function(D){return function(){return D.apply(null,arguments)}},be.cacheSignal=function(){return null},be.cloneElement=function(D,O,G){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ae=v({},D.props),J=D.key;if(O!=null)for(V in O.key!==void 0&&(J=""+O.key),O)!m.call(O,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&O.ref===void 0||(ae[V]=O[V]);var V=arguments.length-2;if(V===1)ae.children=G;else if(1<V){for(var N=Array(V),R=0;R<V;R++)N[R]=arguments[R+2];ae.children=N}return A(D.type,J,ae)},be.createContext=function(D){return D={$$typeof:P,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:Q,_context:D},D},be.createElement=function(D,O,G){var ae,J={},V=null;if(O!=null)for(ae in O.key!==void 0&&(V=""+O.key),O)m.call(O,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(J[ae]=O[ae]);var N=arguments.length-2;if(N===1)J.children=G;else if(1<N){for(var R=Array(N),Z=0;Z<N;Z++)R[Z]=arguments[Z+2];J.children=R}if(D&&D.defaultProps)for(ae in N=D.defaultProps,N)J[ae]===void 0&&(J[ae]=N[ae]);return A(D,V,J)},be.createRef=function(){return{current:null}},be.forwardRef=function(D){return{$$typeof:u,render:D}},be.isValidElement=U,be.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:te}},be.memo=function(D,O){return{$$typeof:d,type:D,compare:O===void 0?null:O}},be.startTransition=function(D){var O=C.T,G={};C.T=G;try{var ae=D(),J=C.S;J!==null&&J(G,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(w,T)}catch(V){T(V)}finally{O!==null&&G.types!==null&&(O.types=G.types),C.T=O}},be.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},be.use=function(D){return C.H.use(D)},be.useActionState=function(D,O,G){return C.H.useActionState(D,O,G)},be.useCallback=function(D,O){return C.H.useCallback(D,O)},be.useContext=function(D){return C.H.useContext(D)},be.useDebugValue=function(){},be.useDeferredValue=function(D,O){return C.H.useDeferredValue(D,O)},be.useEffect=function(D,O){return C.H.useEffect(D,O)},be.useEffectEvent=function(D){return C.H.useEffectEvent(D)},be.useId=function(){return C.H.useId()},be.useImperativeHandle=function(D,O,G){return C.H.useImperativeHandle(D,O,G)},be.useInsertionEffect=function(D,O){return C.H.useInsertionEffect(D,O)},be.useLayoutEffect=function(D,O){return C.H.useLayoutEffect(D,O)},be.useMemo=function(D,O){return C.H.useMemo(D,O)},be.useOptimistic=function(D,O){return C.H.useOptimistic(D,O)},be.useReducer=function(D,O,G){return C.H.useReducer(D,O,G)},be.useRef=function(D){return C.H.useRef(D)},be.useState=function(D){return C.H.useState(D)},be.useSyncExternalStore=function(D,O,G){return C.H.useSyncExternalStore(D,O,G)},be.useTransition=function(){return C.H.useTransition()},be.version="19.2.7",be}var Zf;function Ko(){return Zf||(Zf=1,To.exports=Kv()),To.exports}var ee=Ko(),ko={exports:{}},Yr={},Lo={exports:{}},Mo={};/**
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 Qf;function Yv(){return Qf||(Qf=1,(function(x){function H(F,K){var te=F.length;F.push(K);e:for(;0<te;){var T=te-1>>>1,B=F[T];if(0<$(B,K))F[T]=K,F[te]=B,te=T;else break e}}function I(F){return F.length===0?null:F[0]}function M(F){if(F.length===0)return null;var K=F[0],te=F.pop();if(te!==K){F[0]=te;e:for(var T=0,B=F.length,D=B>>>1;T<D;){var O=2*(T+1)-1,G=F[O],ae=O+1,J=F[ae];if(0>$(G,te))ae<B&&0>$(J,G)?(F[T]=J,F[ae]=te,T=ae):(F[T]=G,F[O]=te,T=O);else if(ae<B&&0>$(J,te))F[T]=J,F[ae]=te,T=ae;else break e}}return K}function $(F,K){var te=F.sortIndex-K.sortIndex;return te!==0?te:F.id-K.id}if(x.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var Q=performance;x.unstable_now=function(){return Q.now()}}else{var P=Date,u=P.now();x.unstable_now=function(){return P.now()-u}}var f=[],d=[],g=1,h=null,p=3,S=!1,E=!1,v=!1,l=!1,c=typeof setTimeout=="function"?setTimeout:null,n=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;function _(F){for(var K=I(d);K!==null;){if(K.callback===null)M(d);else if(K.startTime<=F)M(d),K.sortIndex=K.expirationTime,H(f,K);else break;K=I(d)}}function b(F){if(v=!1,_(F),!E)if(I(f)!==null)E=!0,w||(w=!0,W());else{var K=I(d);K!==null&&ce(b,K.startTime-F)}}var w=!1,C=-1,m=5,A=-1;function j(){return l?!0:!(x.unstable_now()-A<m)}function U(){if(l=!1,w){var F=x.unstable_now();A=F;var K=!0;try{e:{E=!1,v&&(v=!1,n(C),C=-1),S=!0;var te=p;try{t:{for(_(F),h=I(f);h!==null&&!(h.expirationTime>F&&j());){var T=h.callback;if(typeof T=="function"){h.callback=null,p=h.priorityLevel;var B=T(h.expirationTime<=F);if(F=x.unstable_now(),typeof B=="function"){h.callback=B,_(F),K=!0;break t}h===I(f)&&M(f),_(F)}else M(f);h=I(f)}if(h!==null)K=!0;else{var D=I(d);D!==null&&ce(b,D.startTime-F),K=!1}}break e}finally{h=null,p=te,S=!1}K=void 0}}finally{K?W():w=!1}}}var W;if(typeof o=="function")W=function(){o(U)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,re=z.port2;z.port1.onmessage=U,W=function(){re.postMessage(null)}}else W=function(){c(U,0)};function ce(F,K){C=c(function(){F(x.unstable_now())},K)}x.unstable_IdlePriority=5,x.unstable_ImmediatePriority=1,x.unstable_LowPriority=4,x.unstable_NormalPriority=3,x.unstable_Profiling=null,x.unstable_UserBlockingPriority=2,x.unstable_cancelCallback=function(F){F.callback=null},x.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<F?Math.floor(1e3/F):5},x.unstable_getCurrentPriorityLevel=function(){return p},x.unstable_next=function(F){switch(p){case 1:case 2:case 3:var K=3;break;default:K=p}var te=p;p=K;try{return F()}finally{p=te}},x.unstable_requestPaint=function(){l=!0},x.unstable_runWithPriority=function(F,K){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var te=p;p=F;try{return K()}finally{p=te}},x.unstable_scheduleCallback=function(F,K,te){var T=x.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?T+te:T):te=T,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=te+B,F={id:g++,callback:K,priorityLevel:F,startTime:te,expirationTime:B,sortIndex:-1},te>T?(F.sortIndex=te,H(d,F),I(f)===null&&F===I(d)&&(v?(n(C),C=-1):v=!0,ce(b,te-T))):(F.sortIndex=B,H(f,F),E||S||(E=!0,w||(w=!0,W()))),F},x.unstable_shouldYield=j,x.unstable_wrapCallback=function(F){var K=p;return function(){var te=p;p=K;try{return F.apply(this,arguments)}finally{p=te}}}})(Mo)),Mo}var Jf;function Gv(){return Jf||(Jf=1,Lo.exports=Yv()),Lo.exports}var Oo={exports:{}},ht={};/**
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 ed;function Xv(){if(ed)return ht;ed=1;var x=Ko();function H(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function I(){}var M={d:{f:I,r:function(){throw Error(H(522))},D:I,C:I,L:I,m:I,X:I,S:I,M:I},p:0,findDOMNode:null},$=Symbol.for("react.portal");function Q(f,d,g){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:h==null?null:""+h,children:f,containerInfo:d,implementation:g}}var P=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,ht.createPortal=function(f,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(H(299));return Q(f,d,null,g)},ht.flushSync=function(f){var d=P.T,g=M.p;try{if(P.T=null,M.p=2,f)return f()}finally{P.T=d,M.p=g,M.d.f()}},ht.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,M.d.C(f,d))},ht.prefetchDNS=function(f){typeof f=="string"&&M.d.D(f)},ht.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var g=d.as,h=u(g,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?M.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:p,fetchPriority:S}):g==="script"&&M.d.X(f,{crossOrigin:h,integrity:p,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ht.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=u(d.as,d.crossOrigin);M.d.M(f,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&M.d.M(f)},ht.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,h=u(g,d.crossOrigin);M.d.L(f,g,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ht.preloadModule=function(f,d){if(typeof f=="string")if(d){var g=u(d.as,d.crossOrigin);M.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else M.d.m(f)},ht.requestFormReset=function(f){M.d.r(f)},ht.unstable_batchedUpdates=function(f,d){return f(d)},ht.useFormState=function(f,d,g){return P.H.useFormState(f,d,g)},ht.useFormStatus=function(){return P.H.useHostTransitionStatus()},ht.version="19.2.7",ht}var td;function $v(){if(td)return Oo.exports;td=1;function x(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x)}catch(H){console.error(H)}}return x(),Oo.exports=Xv(),Oo.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 id;function Vv(){if(id)return Yr;id=1;var x=Gv(),H=Ko(),I=$v();function M(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 $(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Q(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function P(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(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(Q(e)!==e)throw Error(M(188))}function d(e){var t=e.alternate;if(!t){if(t=Q(e),t===null)throw Error(M(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===i)return f(r),e;if(a===s)return f(r),t;a=a.sibling}throw Error(M(188))}if(i.return!==s.return)i=r,s=a;else{for(var y=!1,L=r.child;L;){if(L===i){y=!0,i=r,s=a;break}if(L===s){y=!0,s=r,i=a;break}L=L.sibling}if(!y){for(L=a.child;L;){if(L===i){y=!0,i=a,s=r;break}if(L===s){y=!0,s=a,i=r;break}L=L.sibling}if(!y)throw Error(M(189))}}if(i.alternate!==s)throw Error(M(190))}if(i.tag!==3)throw Error(M(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),n=Symbol.for("react.consumer"),o=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var z=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case c:return"Profiler";case l:return"StrictMode";case b:return"Suspense";case w:return"SuspenseList";case A:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case o:return e.displayName||"Context";case n:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case m:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ce=Array.isArray,F=H.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=I.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},T=[],B=-1;function D(e){return{current:e}}function O(e){0>B||(e.current=T[B],T[B]=null,B--)}function G(e,t){B++,T[B]=e.current,e.current=t}var ae=D(null),J=D(null),V=D(null),N=D(null);function R(e,t){switch(G(V,t),G(J,e),G(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mf(t),e=gf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(ae),G(ae,e)}function Z(){O(ae),O(J),O(V)}function le(e){e.memoizedState!==null&&G(N,e);var t=ae.current,i=gf(t,e.type);t!==i&&(G(J,e),G(ae,i))}function de(e){J.current===e&&(O(ae),O(J)),N.current===e&&(O(N),Ir._currentValue=te)}var _e,Ee;function Le(e){if(_e===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||"",Ee=-1<i.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+_e+e+Ee}var ve=!1;function De(e,t){if(!e||ve)return"";ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(oe){var ne=oe}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(oe){ne=oe}e.call(fe.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=s.DetermineComponentFrameRoot(),y=a[0],L=a[1];if(y&&L){var q=y.split(`
44
- `),se=L.split(`
45
- `);for(r=s=0;s<q.length&&!q[s].includes("DetermineComponentFrameRoot");)s++;for(;r<se.length&&!se[r].includes("DetermineComponentFrameRoot");)r++;if(s===q.length||r===se.length)for(s=q.length-1,r=se.length-1;1<=s&&0<=r&&q[s]!==se[r];)r--;for(;1<=s&&0<=r;s--,r--)if(q[s]!==se[r]){if(s!==1||r!==1)do if(s--,r--,0>r||q[s]!==se[r]){var ue=`
46
- `+q[s].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=s&&0<=r);break}}}finally{ve=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Le(i):""}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le("Lazy");case 13:return e.child!==t&&t!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return De(e.type,!1);case 11:return De(e.type.render,!1);case 1:return De(e.type,!0);case 31:return Le("Activity");default:return""}}function Pt(e){try{var t="",i=null;do t+=ye(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
47
- Error generating stack: `+s.message+`
48
- `+s.stack}}var Wt=Object.prototype.hasOwnProperty,$t=x.unstable_scheduleCallback,Ft=x.unstable_cancelCallback,gi=x.unstable_shouldYield,dt=x.unstable_requestPaint,tt=x.unstable_now,Lt=x.unstable_getCurrentPriorityLevel,Si=x.unstable_ImmediatePriority,_s=x.unstable_UserBlockingPriority,bt=x.unstable_NormalPriority,vs=x.unstable_LowPriority,Kt=x.unstable_IdlePriority,Yi=x.log,Ie=x.unstable_setDisableYieldValue,Gi=null,Ct=null;function yi(e){if(typeof Yi=="function"&&Ie(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Gi,e)}catch{}}var wt=Math.clz32?Math.clz32:Dd,xd=Math.log,Ad=Math.LN2;function Dd(e){return e>>>=0,e===0?32:31-(xd(e)/Ad|0)|0}var Xr=256,$r=262144,Vr=4194304;function Xi(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 Zr(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,a=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var L=s&134217727;return L!==0?(s=L&~a,s!==0?r=Xi(s):(y&=L,y!==0?r=Xi(y):i||(i=L&~e,i!==0&&(r=Xi(i))))):(L=s&~a,L!==0?r=Xi(L):y!==0?r=Xi(y):i||(i=s&~e,i!==0&&(r=Xi(i)))),r===0?0:t!==0&&t!==r&&(t&a)===0&&(a=r&-r,i=t&-t,a>=i||a===32&&(i&4194048)!==0)?t:r}function er(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Rd(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 Zo(){var e=Vr;return Vr<<=1,(Vr&62914560)===0&&(Vr=4194304),e}function _a(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function tr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Td(e,t,i,s,r,a){var y=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 L=e.entanglements,q=e.expirationTimes,se=e.hiddenUpdates;for(i=y&~i;0<i;){var ue=31-wt(i),fe=1<<ue;L[ue]=0,q[ue]=-1;var ne=se[ue];if(ne!==null)for(se[ue]=null,ue=0;ue<ne.length;ue++){var oe=ne[ue];oe!==null&&(oe.lane&=-536870913)}i&=~fe}s!==0&&Qo(e,s,0),a!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=a&~(y&~t))}function Qo(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-wt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Jo(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-wt(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function ec(e,t){var i=t&-t;return i=(i&42)!==0?1:va(i),(i&(e.suspendedLanes|t))!==0?0:i}function va(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 tc(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:If(e.type))}function ic(e,t){var i=K.p;try{return K.p=e,t()}finally{K.p=i}}var bi=Math.random().toString(36).slice(2),nt="__reactFiber$"+bi,_t="__reactProps$"+bi,ps="__reactContainer$"+bi,ma="__reactEvents$"+bi,kd="__reactListeners$"+bi,Ld="__reactHandles$"+bi,sc="__reactResources$"+bi,ir="__reactMarker$"+bi;function ga(e){delete e[nt],delete e[_t],delete e[ma],delete e[kd],delete e[Ld]}function ms(e){var t=e[nt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ps]||i[nt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=xf(e);e!==null;){if(i=e[nt])return i;e=xf(e)}return t}e=i,i=e.parentNode}return null}function gs(e){if(e=e[nt]||e[ps]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function sr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(M(33))}function Ss(e){var t=e[sc];return t||(t=e[sc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function st(e){e[ir]=!0}var rc=new Set,nc={};function $i(e,t){ys(e,t),ys(e+"Capture",t)}function ys(e,t){for(nc[e]=t,e=0;e<t.length;e++)rc.add(t[e])}var Md=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]*$"),ac={},lc={};function Od(e){return Wt.call(lc,e)?!0:Wt.call(ac,e)?!1:Md.test(e)?lc[e]=!0:(ac[e]=!0,!1)}function Qr(e,t,i){if(Od(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 Jr(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 ei(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 Mt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bd(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,a=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(y){i=""+y,a.call(this,y)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(y){i=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sa(e){if(!e._valueTracker){var t=oc(e)?"checked":"value";e._valueTracker=Bd(e,t,""+e[t])}}function cc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=oc(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function en(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 Nd=/[\n"\\]/g;function Ot(e){return e.replace(Nd,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ya(e,t,i,s,r,a,y,L){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Mt(t)):e.value!==""+Mt(t)&&(e.value=""+Mt(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?ba(e,y,Mt(t)):i!=null?ba(e,y,Mt(i)):s!=null&&e.removeAttribute("value"),r==null&&a!=null&&(e.defaultChecked=!!a),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.name=""+Mt(L):e.removeAttribute("name")}function uc(e,t,i,s,r,a,y,L){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||i!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Sa(e);return}i=i!=null?""+Mt(i):"",t=t!=null?""+Mt(t):i,L||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=L?e.checked:!!s,e.defaultChecked=!!s,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Sa(e)}function ba(e,t,i){t==="number"&&en(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function bs(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Mt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function hc(e,t,i){if(t!=null&&(t=""+Mt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Mt(i):""}function fc(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(M(92));if(ce(s)){if(1<s.length)throw Error(M(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Mt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Sa(e)}function Cs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Hd=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 dc(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||Hd.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function _c(e,t,i){if(t!=null&&typeof t!="object")throw Error(M(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 r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&dc(e,r,s)}else for(var a in t)t.hasOwnProperty(a)&&dc(e,a,t[a])}function Ca(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 jd=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"]]),zd=/^[\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 tn(e){return zd.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ti(){}var wa=null;function Ea(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ws=null,Es=null;function vc(e){var t=gs(e);if(t&&(e=t.stateNode)){var i=e[_t]||null;e:switch(e=t.stateNode,t.type){case"input":if(ya(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="'+Ot(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[_t]||null;if(!r)throw Error(M(90));ya(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&cc(s)}break e;case"textarea":hc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&bs(e,!!i.multiple,t,!1)}}}var xa=!1;function pc(e,t,i){if(xa)return e(t,i);xa=!0;try{var s=e(t);return s}finally{if(xa=!1,(ws!==null||Es!==null)&&(Wn(),ws&&(t=ws,e=Es,Es=ws=null,vc(t),e)))for(t=0;t<e.length;t++)vc(e[t])}}function rr(e,t){var i=e.stateNode;if(i===null)return null;var s=i[_t]||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(M(231,t,typeof i));return i}var ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Aa=!1;if(ii)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){Aa=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{Aa=!1}var Ci=null,Da=null,sn=null;function mc(){if(sn)return sn;var e,t=Da,i=t.length,s,r="value"in Ci?Ci.value:Ci.textContent,a=r.length;for(e=0;e<i&&t[e]===r[e];e++);var y=i-e;for(s=1;s<=y&&t[i-s]===r[a-s];s++);return sn=r.slice(e,1<s?1-s:void 0)}function rn(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 nn(){return!0}function gc(){return!1}function vt(e){function t(i,s,r,a,y){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=y,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(i=e[L],this[L]=i?i(a):a[L]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?nn:gc,this.isPropagationStopped=gc,this}return h(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=nn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},an=vt(Vi),ar=h({},Vi,{view:0,detail:0}),Ud=vt(ar),Ra,Ta,lr,ln=h({},ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:La,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!==lr&&(lr&&e.type==="mousemove"?(Ra=e.screenX-lr.screenX,Ta=e.screenY-lr.screenY):Ta=Ra=0,lr=e),Ra)},movementY:function(e){return"movementY"in e?e.movementY:Ta}}),Sc=vt(ln),qd=h({},ln,{dataTransfer:0}),Id=vt(qd),Pd=h({},ar,{relatedTarget:0}),ka=vt(Pd),Wd=h({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),Fd=vt(Wd),Kd=h({},Vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yd=vt(Kd),Gd=h({},Vi,{data:0}),yc=vt(Gd),Xd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$d={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"},Vd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vd[e])?!!t[e]:!1}function La(){return Zd}var Qd=h({},ar,{key:function(e){if(e.key){var t=Xd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$d[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:La,charCode:function(e){return e.type==="keypress"?rn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jd=vt(Qd),e_=h({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bc=vt(e_),t_=h({},ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:La}),i_=vt(t_),s_=h({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),r_=vt(s_),n_=h({},ln,{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}),a_=vt(n_),l_=h({},Vi,{newState:0,oldState:0}),o_=vt(l_),c_=[9,13,27,32],Ma=ii&&"CompositionEvent"in window,or=null;ii&&"documentMode"in document&&(or=document.documentMode);var u_=ii&&"TextEvent"in window&&!or,Cc=ii&&(!Ma||or&&8<or&&11>=or),wc=" ",Ec=!1;function xc(e,t){switch(e){case"keyup":return c_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ac(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function h_(e,t){switch(e){case"compositionend":return Ac(t);case"keypress":return t.which!==32?null:(Ec=!0,wc);case"textInput":return e=t.data,e===wc&&Ec?null:e;default:return null}}function f_(e,t){if(xs)return e==="compositionend"||!Ma&&xc(e,t)?(e=mc(),sn=Da=Ci=null,xs=!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 Cc&&t.locale!=="ko"?null:t.data;default:return null}}var d_={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 Dc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!d_[e.type]:t==="textarea"}function Rc(e,t,i,s){ws?Es?Es.push(s):Es=[s]:ws=s,t=Vn(t,"onChange"),0<t.length&&(i=new an("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var cr=null,ur=null;function __(e){hf(e,0)}function on(e){var t=sr(e);if(cc(t))return e}function Tc(e,t){if(e==="change")return t}var kc=!1;if(ii){var Oa;if(ii){var Ba="oninput"in document;if(!Ba){var Lc=document.createElement("div");Lc.setAttribute("oninput","return;"),Ba=typeof Lc.oninput=="function"}Oa=Ba}else Oa=!1;kc=Oa&&(!document.documentMode||9<document.documentMode)}function Mc(){cr&&(cr.detachEvent("onpropertychange",Oc),ur=cr=null)}function Oc(e){if(e.propertyName==="value"&&on(ur)){var t=[];Rc(t,ur,e,Ea(e)),pc(__,t)}}function v_(e,t,i){e==="focusin"?(Mc(),cr=t,ur=i,cr.attachEvent("onpropertychange",Oc)):e==="focusout"&&Mc()}function p_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return on(ur)}function m_(e,t){if(e==="click")return on(t)}function g_(e,t){if(e==="input"||e==="change")return on(t)}function S_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:S_;function hr(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!Wt.call(t,r)||!Et(e[r],t[r]))return!1}return!0}function Bc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nc(e,t){var i=Bc(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=Bc(i)}}function Hc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=en(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=en(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 y_=ii&&"documentMode"in document&&11>=document.documentMode,As=null,Ha=null,fr=null,ja=!1;function zc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ja||As==null||As!==en(s)||(s=As,"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}),fr&&hr(fr,s)||(fr=s,s=Vn(Ha,"onSelect"),0<s.length&&(t=new an("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=As)))}function Zi(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ds={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionrun:Zi("Transition","TransitionRun"),transitionstart:Zi("Transition","TransitionStart"),transitioncancel:Zi("Transition","TransitionCancel"),transitionend:Zi("Transition","TransitionEnd")},za={},Uc={};ii&&(Uc=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function Qi(e){if(za[e])return za[e];if(!Ds[e])return e;var t=Ds[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Uc)return za[e]=t[i];return e}var qc=Qi("animationend"),Ic=Qi("animationiteration"),Pc=Qi("animationstart"),b_=Qi("transitionrun"),C_=Qi("transitionstart"),w_=Qi("transitioncancel"),Wc=Qi("transitionend"),Fc=new Map,Ua="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(" ");Ua.push("scrollEnd");function Yt(e,t){Fc.set(e,t),$i(t,[e])}var cn=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)},Bt=[],Rs=0,qa=0;function un(){for(var e=Rs,t=qa=Rs=0;t<e;){var i=Bt[t];Bt[t++]=null;var s=Bt[t];Bt[t++]=null;var r=Bt[t];Bt[t++]=null;var a=Bt[t];if(Bt[t++]=null,s!==null&&r!==null){var y=s.pending;y===null?r.next=r:(r.next=y.next,y.next=r),s.pending=r}a!==0&&Kc(i,r,a)}}function hn(e,t,i,s){Bt[Rs++]=e,Bt[Rs++]=t,Bt[Rs++]=i,Bt[Rs++]=s,qa|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ia(e,t,i,s){return hn(e,t,i,s),fn(e)}function Ji(e,t){return hn(e,null,null,t),fn(e)}function Kc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,a=e.return;a!==null;)a.childLanes|=i,s=a.alternate,s!==null&&(s.childLanes|=i),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(r=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,r&&t!==null&&(r=31-wt(i),e=a.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),a):null}function fn(e){if(50<Br)throw Br=0,Vl=null,Error(M(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ts={};function E_(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 xt(e,t,i,s){return new E_(e,t,i,s)}function Pa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var i=e.alternate;return i===null?(i=xt(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 Yc(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 dn(e,t,i,s,r,a){var y=0;if(s=e,typeof e=="function")Pa(e)&&(y=1);else if(typeof e=="string")y=Tv(e,i,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case A:return e=xt(31,i,t,r),e.elementType=A,e.lanes=a,e;case v:return es(i.children,r,a,t);case l:y=8,r|=24;break;case c:return e=xt(12,i,t,r|2),e.elementType=c,e.lanes=a,e;case b:return e=xt(13,i,t,r),e.elementType=b,e.lanes=a,e;case w:return e=xt(19,i,t,r),e.elementType=w,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case o:y=10;break e;case n:y=9;break e;case _:y=11;break e;case C:y=14;break e;case m:y=16,s=null;break e}y=29,i=Error(M(130,e===null?"null":typeof e,"")),s=null}return t=xt(y,i,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function es(e,t,i,s){return e=xt(7,e,s,t),e.lanes=i,e}function Wa(e,t,i){return e=xt(6,e,null,t),e.lanes=i,e}function Gc(e){var t=xt(18,null,null,0);return t.stateNode=e,t}function Fa(e,t,i){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xc=new WeakMap;function Nt(e,t){if(typeof e=="object"&&e!==null){var i=Xc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Pt(t)},Xc.set(e,t),t)}return{value:e,source:t,stack:Pt(t)}}var ks=[],Ls=0,_n=null,dr=0,Ht=[],jt=0,wi=null,Vt=1,Zt="";function ri(e,t){ks[Ls++]=dr,ks[Ls++]=_n,_n=e,dr=t}function $c(e,t,i){Ht[jt++]=Vt,Ht[jt++]=Zt,Ht[jt++]=wi,wi=e;var s=Vt;e=Zt;var r=32-wt(s)-1;s&=~(1<<r),i+=1;var a=32-wt(t)+r;if(30<a){var y=r-r%5;a=(s&(1<<y)-1).toString(32),s>>=y,r-=y,Vt=1<<32-wt(t)+r|i<<r|s,Zt=a+e}else Vt=1<<a|i<<r|s,Zt=e}function Ka(e){e.return!==null&&(ri(e,1),$c(e,1,0))}function Ya(e){for(;e===_n;)_n=ks[--Ls],ks[Ls]=null,dr=ks[--Ls],ks[Ls]=null;for(;e===wi;)wi=Ht[--jt],Ht[jt]=null,Zt=Ht[--jt],Ht[jt]=null,Vt=Ht[--jt],Ht[jt]=null}function Vc(e,t){Ht[jt++]=Vt,Ht[jt++]=Zt,Ht[jt++]=wi,Vt=t.id,Zt=t.overflow,wi=e}var at=null,Pe=null,ke=!1,Ei=null,zt=!1,Ga=Error(M(519));function xi(e){var t=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _r(Nt(t,e)),Ga}function Zc(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[nt]=e,t[_t]=s,i){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(i=0;i<Hr.length;i++)Ae(Hr[i],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),uc(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),fc(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||vf(t.textContent,i)?(s.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),s.onScroll!=null&&Ae("scroll",t),s.onScrollEnd!=null&&Ae("scrollend",t),s.onClick!=null&&(t.onclick=ti),t=!0):t=!1,t||xi(e,!0)}function Qc(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:zt=!1;return;case 27:case 3:zt=!0;return;default:at=at.return}}function Ms(e){if(e!==at)return!1;if(!ke)return Qc(e),ke=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||ho(e.type,e.memoizedProps)),i=!i),i&&Pe&&xi(e),Qc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));Pe=Ef(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));Pe=Ef(e)}else t===27?(t=Pe,Ui(e.type)?(e=mo,mo=null,Pe=e):Pe=t):Pe=at?qt(e.stateNode.nextSibling):null;return!0}function ts(){Pe=at=null,ke=!1}function Xa(){var e=Ei;return e!==null&&(St===null?St=e:St.push.apply(St,e),Ei=null),e}function _r(e){Ei===null?Ei=[e]:Ei.push(e)}var $a=D(null),is=null,ni=null;function Ai(e,t,i){G($a,t._currentValue),t._currentValue=i}function ai(e){e._currentValue=$a.current,O($a)}function Va(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 Za(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){var y=r.child;a=a.firstContext;e:for(;a!==null;){var L=a;a=r;for(var q=0;q<t.length;q++)if(L.context===t[q]){a.lanes|=i,L=a.alternate,L!==null&&(L.lanes|=i),Va(a.return,i,e),s||(y=null);break e}a=L.next}}else if(r.tag===18){if(y=r.return,y===null)throw Error(M(341));y.lanes|=i,a=y.alternate,a!==null&&(a.lanes|=i),Va(y,i,e),y=null}else y=r.child;if(y!==null)y.return=r;else for(y=r;y!==null;){if(y===e){y=null;break}if(r=y.sibling,r!==null){r.return=y.return,y=r;break}y=y.return}r=y}}function Os(e,t,i,s){e=null;for(var r=t,a=!1;r!==null;){if(!a){if((r.flags&524288)!==0)a=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var y=r.alternate;if(y===null)throw Error(M(387));if(y=y.memoizedProps,y!==null){var L=r.type;Et(r.pendingProps.value,y.value)||(e!==null?e.push(L):e=[L])}}else if(r===N.current){if(y=r.alternate,y===null)throw Error(M(387));y.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Ir):e=[Ir])}r=r.return}e!==null&&Za(t,e,i,s),t.flags|=262144}function vn(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ss(e){is=e,ni=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return Jc(is,e)}function pn(e,t){return is===null&&ss(e),Jc(e,t)}function Jc(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ni===null){if(e===null)throw Error(M(308));ni=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ni=ni.next=t;return i}var x_=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()})}},A_=x.unstable_scheduleCallback,D_=x.unstable_NormalPriority,Ze={$$typeof:o,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qa(){return{controller:new x_,data:new Map,refCount:0}}function vr(e){e.refCount--,e.refCount===0&&A_(D_,function(){e.controller.abort()})}var pr=null,Ja=0,Bs=0,Ns=null;function R_(e,t){if(pr===null){var i=pr=[];Ja=0,Bs=io(),Ns={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Ja++,t.then(eu,eu),t}function eu(){if(--Ja===0&&pr!==null){Ns!==null&&(Ns.status="fulfilled");var e=pr;pr=null,Bs=0,Ns=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function T_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var tu=F.S;F.S=function(e,t){zh=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&R_(e,t),tu!==null&&tu(e,t)};var rs=D(null);function el(){var e=rs.current;return e!==null?e:qe.pooledCache}function mn(e,t){t===null?G(rs,rs.current):G(rs,t.pool)}function iu(){var e=el();return e===null?null:{parent:Ze._currentValue,pool:e}}var Hs=Error(M(460)),tl=Error(M(474)),gn=Error(M(542)),Sn={then:function(){}};function su(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ru(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(ti,ti),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,au(e),e;default:if(typeof t.status=="string")t.then(ti,ti);else{if(e=qe,e!==null&&100<e.shellSuspendCounter)throw Error(M(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,au(e),e}throw as=t,Hs}}function ns(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(as=i,Hs):i}}var as=null;function nu(){if(as===null)throw Error(M(459));var e=as;return as=null,e}function au(e){if(e===Hs||e===gn)throw Error(M(483))}var js=null,mr=0;function yn(e){var t=mr;return mr+=1,js===null&&(js=[]),ru(js,e,t)}function gr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function bn(e,t){throw t.$$typeof===p?Error(M(525)):(e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function lu(e){function t(X,Y){if(e){var ie=X.deletions;ie===null?(X.deletions=[Y],X.flags|=16):ie.push(Y)}}function i(X,Y){if(!e)return null;for(;Y!==null;)t(X,Y),Y=Y.sibling;return null}function s(X){for(var Y=new Map;X!==null;)X.key!==null?Y.set(X.key,X):Y.set(X.index,X),X=X.sibling;return Y}function r(X,Y){return X=si(X,Y),X.index=0,X.sibling=null,X}function a(X,Y,ie){return X.index=ie,e?(ie=X.alternate,ie!==null?(ie=ie.index,ie<Y?(X.flags|=67108866,Y):ie):(X.flags|=67108866,Y)):(X.flags|=1048576,Y)}function y(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function L(X,Y,ie,he){return Y===null||Y.tag!==6?(Y=Wa(ie,X.mode,he),Y.return=X,Y):(Y=r(Y,ie),Y.return=X,Y)}function q(X,Y,ie,he){var ge=ie.type;return ge===v?ue(X,Y,ie.props.children,he,ie.key):Y!==null&&(Y.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===m&&ns(ge)===Y.type)?(Y=r(Y,ie.props),gr(Y,ie),Y.return=X,Y):(Y=dn(ie.type,ie.key,ie.props,null,X.mode,he),gr(Y,ie),Y.return=X,Y)}function se(X,Y,ie,he){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ie.containerInfo||Y.stateNode.implementation!==ie.implementation?(Y=Fa(ie,X.mode,he),Y.return=X,Y):(Y=r(Y,ie.children||[]),Y.return=X,Y)}function ue(X,Y,ie,he,ge){return Y===null||Y.tag!==7?(Y=es(ie,X.mode,he,ge),Y.return=X,Y):(Y=r(Y,ie),Y.return=X,Y)}function fe(X,Y,ie){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=Wa(""+Y,X.mode,ie),Y.return=X,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:return ie=dn(Y.type,Y.key,Y.props,null,X.mode,ie),gr(ie,Y),ie.return=X,ie;case E:return Y=Fa(Y,X.mode,ie),Y.return=X,Y;case m:return Y=ns(Y),fe(X,Y,ie)}if(ce(Y)||W(Y))return Y=es(Y,X.mode,ie,null),Y.return=X,Y;if(typeof Y.then=="function")return fe(X,yn(Y),ie);if(Y.$$typeof===o)return fe(X,pn(X,Y),ie);bn(X,Y)}return null}function ne(X,Y,ie,he){var ge=Y!==null?Y.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ge!==null?null:L(X,Y,""+ie,he);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case S:return ie.key===ge?q(X,Y,ie,he):null;case E:return ie.key===ge?se(X,Y,ie,he):null;case m:return ie=ns(ie),ne(X,Y,ie,he)}if(ce(ie)||W(ie))return ge!==null?null:ue(X,Y,ie,he,null);if(typeof ie.then=="function")return ne(X,Y,yn(ie),he);if(ie.$$typeof===o)return ne(X,Y,pn(X,ie),he);bn(X,ie)}return null}function oe(X,Y,ie,he,ge){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return X=X.get(ie)||null,L(Y,X,""+he,ge);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case S:return X=X.get(he.key===null?ie:he.key)||null,q(Y,X,he,ge);case E:return X=X.get(he.key===null?ie:he.key)||null,se(Y,X,he,ge);case m:return he=ns(he),oe(X,Y,ie,he,ge)}if(ce(he)||W(he))return X=X.get(ie)||null,ue(Y,X,he,ge,null);if(typeof he.then=="function")return oe(X,Y,ie,yn(he),ge);if(he.$$typeof===o)return oe(X,Y,ie,pn(Y,he),ge);bn(Y,he)}return null}function pe(X,Y,ie,he){for(var ge=null,Me=null,me=Y,we=Y=0,Te=null;me!==null&&we<ie.length;we++){me.index>we?(Te=me,me=null):Te=me.sibling;var Oe=ne(X,me,ie[we],he);if(Oe===null){me===null&&(me=Te);break}e&&me&&Oe.alternate===null&&t(X,me),Y=a(Oe,Y,we),Me===null?ge=Oe:Me.sibling=Oe,Me=Oe,me=Te}if(we===ie.length)return i(X,me),ke&&ri(X,we),ge;if(me===null){for(;we<ie.length;we++)me=fe(X,ie[we],he),me!==null&&(Y=a(me,Y,we),Me===null?ge=me:Me.sibling=me,Me=me);return ke&&ri(X,we),ge}for(me=s(me);we<ie.length;we++)Te=oe(me,X,we,ie[we],he),Te!==null&&(e&&Te.alternate!==null&&me.delete(Te.key===null?we:Te.key),Y=a(Te,Y,we),Me===null?ge=Te:Me.sibling=Te,Me=Te);return e&&me.forEach(function(Fi){return t(X,Fi)}),ke&&ri(X,we),ge}function Se(X,Y,ie,he){if(ie==null)throw Error(M(151));for(var ge=null,Me=null,me=Y,we=Y=0,Te=null,Oe=ie.next();me!==null&&!Oe.done;we++,Oe=ie.next()){me.index>we?(Te=me,me=null):Te=me.sibling;var Fi=ne(X,me,Oe.value,he);if(Fi===null){me===null&&(me=Te);break}e&&me&&Fi.alternate===null&&t(X,me),Y=a(Fi,Y,we),Me===null?ge=Fi:Me.sibling=Fi,Me=Fi,me=Te}if(Oe.done)return i(X,me),ke&&ri(X,we),ge;if(me===null){for(;!Oe.done;we++,Oe=ie.next())Oe=fe(X,Oe.value,he),Oe!==null&&(Y=a(Oe,Y,we),Me===null?ge=Oe:Me.sibling=Oe,Me=Oe);return ke&&ri(X,we),ge}for(me=s(me);!Oe.done;we++,Oe=ie.next())Oe=oe(me,X,we,Oe.value,he),Oe!==null&&(e&&Oe.alternate!==null&&me.delete(Oe.key===null?we:Oe.key),Y=a(Oe,Y,we),Me===null?ge=Oe:Me.sibling=Oe,Me=Oe);return e&&me.forEach(function(qv){return t(X,qv)}),ke&&ri(X,we),ge}function Ue(X,Y,ie,he){if(typeof ie=="object"&&ie!==null&&ie.type===v&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case S:e:{for(var ge=ie.key;Y!==null;){if(Y.key===ge){if(ge=ie.type,ge===v){if(Y.tag===7){i(X,Y.sibling),he=r(Y,ie.props.children),he.return=X,X=he;break e}}else if(Y.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===m&&ns(ge)===Y.type){i(X,Y.sibling),he=r(Y,ie.props),gr(he,ie),he.return=X,X=he;break e}i(X,Y);break}else t(X,Y);Y=Y.sibling}ie.type===v?(he=es(ie.props.children,X.mode,he,ie.key),he.return=X,X=he):(he=dn(ie.type,ie.key,ie.props,null,X.mode,he),gr(he,ie),he.return=X,X=he)}return y(X);case E:e:{for(ge=ie.key;Y!==null;){if(Y.key===ge)if(Y.tag===4&&Y.stateNode.containerInfo===ie.containerInfo&&Y.stateNode.implementation===ie.implementation){i(X,Y.sibling),he=r(Y,ie.children||[]),he.return=X,X=he;break e}else{i(X,Y);break}else t(X,Y);Y=Y.sibling}he=Fa(ie,X.mode,he),he.return=X,X=he}return y(X);case m:return ie=ns(ie),Ue(X,Y,ie,he)}if(ce(ie))return pe(X,Y,ie,he);if(W(ie)){if(ge=W(ie),typeof ge!="function")throw Error(M(150));return ie=ge.call(ie),Se(X,Y,ie,he)}if(typeof ie.then=="function")return Ue(X,Y,yn(ie),he);if(ie.$$typeof===o)return Ue(X,Y,pn(X,ie),he);bn(X,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Y!==null&&Y.tag===6?(i(X,Y.sibling),he=r(Y,ie),he.return=X,X=he):(i(X,Y),he=Wa(ie,X.mode,he),he.return=X,X=he),y(X)):i(X,Y)}return function(X,Y,ie,he){try{mr=0;var ge=Ue(X,Y,ie,he);return js=null,ge}catch(me){if(me===Hs||me===gn)throw me;var Me=xt(29,me,null,X.mode);return Me.lanes=he,Me.return=X,Me}finally{}}}var ls=lu(!0),ou=lu(!1),Di=!1;function il(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sl(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 Ri(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ti(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Be&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=fn(e),Kc(e,null,i),t}return hn(e,s,t,i),fn(e)}function Sr(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,Jo(e,i)}}function rl(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,a=null;if(i=i.firstBaseUpdate,i!==null){do{var y={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};a===null?r=a=y:a=a.next=y,i=i.next}while(i!==null);a===null?r=a=t:a=a.next=t}else r=a=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,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 nl=!1;function yr(){if(nl){var e=Ns;if(e!==null)throw e}}function br(e,t,i,s){nl=!1;var r=e.updateQueue;Di=!1;var a=r.firstBaseUpdate,y=r.lastBaseUpdate,L=r.shared.pending;if(L!==null){r.shared.pending=null;var q=L,se=q.next;q.next=null,y===null?a=se:y.next=se,y=q;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,L=ue.lastBaseUpdate,L!==y&&(L===null?ue.firstBaseUpdate=se:L.next=se,ue.lastBaseUpdate=q))}if(a!==null){var fe=r.baseState;y=0,ue=se=q=null,L=a;do{var ne=L.lane&-536870913,oe=ne!==L.lane;if(oe?(Re&ne)===ne:(s&ne)===ne){ne!==0&&ne===Bs&&(nl=!0),ue!==null&&(ue=ue.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var pe=e,Se=L;ne=t;var Ue=i;switch(Se.tag){case 1:if(pe=Se.payload,typeof pe=="function"){fe=pe.call(Ue,fe,ne);break e}fe=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Se.payload,ne=typeof pe=="function"?pe.call(Ue,fe,ne):pe,ne==null)break e;fe=h({},fe,ne);break e;case 2:Di=!0}}ne=L.callback,ne!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=r.callbacks,oe===null?r.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ue===null?(se=ue=oe,q=fe):ue=ue.next=oe,y|=ne;if(L=L.next,L===null){if(L=r.shared.pending,L===null)break;oe=L,L=oe.next,oe.next=null,r.lastBaseUpdate=oe,r.shared.pending=null}}while(!0);ue===null&&(q=fe),r.baseState=q,r.firstBaseUpdate=se,r.lastBaseUpdate=ue,a===null&&(r.shared.lanes=0),Bi|=y,e.lanes=y,e.memoizedState=fe}}function cu(e,t){if(typeof e!="function")throw Error(M(191,e));e.call(t)}function uu(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)cu(i[e],t)}var zs=D(null),Cn=D(0);function hu(e,t){e=vi,G(Cn,e),G(zs,t),vi=e|t.baseLanes}function al(){G(Cn,vi),G(zs,zs.current)}function ll(){vi=Cn.current,O(zs),O(Cn)}var At=D(null),Ut=null;function ki(e){var t=e.alternate;G(Xe,Xe.current&1),G(At,e),Ut===null&&(t===null||zs.current!==null||t.memoizedState!==null)&&(Ut=e)}function ol(e){G(Xe,Xe.current),G(At,e),Ut===null&&(Ut=e)}function fu(e){e.tag===22?(G(Xe,Xe.current),G(At,e),Ut===null&&(Ut=e)):Li()}function Li(){G(Xe,Xe.current),G(At,At.current)}function Dt(e){O(At),Ut===e&&(Ut=null),O(Xe)}var Xe=D(0);function wn(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||vo(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 li=0,Ce=null,je=null,Qe=null,En=!1,Us=!1,os=!1,xn=0,Cr=0,qs=null,k_=0;function Ye(){throw Error(M(321))}function cl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Et(e[i],t[i]))return!1;return!0}function ul(e,t,i,s,r,a){return li=a,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?$u:xl,os=!1,a=i(s,r),os=!1,Us&&(a=_u(t,i,s,r)),du(e),a}function du(e){F.H=xr;var t=je!==null&&je.next!==null;if(li=0,Qe=je=Ce=null,En=!1,Cr=0,qs=null,t)throw Error(M(300));e===null||Je||(e=e.dependencies,e!==null&&vn(e)&&(Je=!0))}function _u(e,t,i,s){Ce=e;var r=0;do{if(Us&&(qs=null),Cr=0,Us=!1,25<=r)throw Error(M(301));if(r+=1,Qe=je=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}F.H=Vu,a=t(i,s)}while(Us);return a}function L_(){var e=F.H,t=e.useState()[0];return t=typeof t.then=="function"?wr(t):t,e=e.useState()[0],(je!==null?je.memoizedState:null)!==e&&(Ce.flags|=1024),t}function hl(){var e=xn!==0;return xn=0,e}function fl(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function dl(e){if(En){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}En=!1}li=0,Qe=je=Ce=null,Us=!1,Cr=xn=0,qs=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?Ce.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function $e(){if(je===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=je.next;var t=Qe===null?Ce.memoizedState:Qe.next;if(t!==null)Qe=t,je=e;else{if(e===null)throw Ce.alternate===null?Error(M(467)):Error(M(310));je=e,e={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},Qe===null?Ce.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function An(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wr(e){var t=Cr;return Cr+=1,qs===null&&(qs=[]),e=ru(qs,e,t),t=Ce,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?$u:xl),e}function Dn(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wr(e);if(e.$$typeof===o)return lt(e)}throw Error(M(438,String(e)))}function _l(e){var t=null,i=Ce.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Ce.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=An(),Ce.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]=j;return t.index++,i}function oi(e,t){return typeof t=="function"?t(e):t}function Rn(e){var t=$e();return vl(t,je,e)}function vl(e,t,i){var s=e.queue;if(s===null)throw Error(M(311));s.lastRenderedReducer=i;var r=e.baseQueue,a=s.pending;if(a!==null){if(r!==null){var y=r.next;r.next=a.next,a.next=y}t.baseQueue=r=a,s.pending=null}if(a=e.baseState,r===null)e.memoizedState=a;else{t=r.next;var L=y=null,q=null,se=t,ue=!1;do{var fe=se.lane&-536870913;if(fe!==se.lane?(Re&fe)===fe:(li&fe)===fe){var ne=se.revertLane;if(ne===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),fe===Bs&&(ue=!0);else if((li&ne)===ne){se=se.next,ne===Bs&&(ue=!0);continue}else fe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},q===null?(L=q=fe,y=a):q=q.next=fe,Ce.lanes|=ne,Bi|=ne;fe=se.action,os&&i(a,fe),a=se.hasEagerState?se.eagerState:i(a,fe)}else ne={lane:fe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},q===null?(L=q=ne,y=a):q=q.next=ne,Ce.lanes|=fe,Bi|=fe;se=se.next}while(se!==null&&se!==t);if(q===null?y=a:q.next=L,!Et(a,e.memoizedState)&&(Je=!0,ue&&(i=Ns,i!==null)))throw i;e.memoizedState=a,e.baseState=y,e.baseQueue=q,s.lastRenderedState=a}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function pl(e){var t=$e(),i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,a=t.memoizedState;if(r!==null){i.pending=null;var y=r=r.next;do a=e(a,y.action),y=y.next;while(y!==r);Et(a,t.memoizedState)||(Je=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),i.lastRenderedState=a}return[a,s]}function vu(e,t,i){var s=Ce,r=$e(),a=ke;if(a){if(i===void 0)throw Error(M(407));i=i()}else i=t();var y=!Et((je||r).memoizedState,i);if(y&&(r.memoizedState=i,Je=!0),r=r.queue,Sl(gu.bind(null,s,r,e),[e]),r.getSnapshot!==t||y||Qe!==null&&Qe.memoizedState.tag&1){if(s.flags|=2048,Is(9,{destroy:void 0},mu.bind(null,s,r,i,t),null),qe===null)throw Error(M(349));a||(li&127)!==0||pu(s,t,i)}return i}function pu(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ce.updateQueue,t===null?(t=An(),Ce.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function mu(e,t,i,s){t.value=i,t.getSnapshot=s,Su(t)&&yu(e)}function gu(e,t,i){return i(function(){Su(t)&&yu(e)})}function Su(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Et(e,i)}catch{return!0}}function yu(e){var t=Ji(e,2);t!==null&&yt(t,e,2)}function ml(e){var t=ft();if(typeof e=="function"){var i=e;if(e=i(),os){yi(!0);try{i()}finally{yi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:e},t}function bu(e,t,i,s){return e.baseState=i,vl(e,je,typeof s=="function"?s:oi)}function M_(e,t,i,s,r){if(Ln(e))throw Error(M(485));if(e=t.action,e!==null){var a={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){a.listeners.push(y)}};F.T!==null?i(!0):a.isTransition=!1,s(a),i=t.pending,i===null?(a.next=t.pending=a,Cu(t,a)):(a.next=i.next,t.pending=i.next=a)}}function Cu(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var a=F.T,y={};F.T=y;try{var L=i(r,s),q=F.S;q!==null&&q(y,L),wu(e,t,L)}catch(se){gl(e,t,se)}finally{a!==null&&y.types!==null&&(a.types=y.types),F.T=a}}else try{a=i(r,s),wu(e,t,a)}catch(se){gl(e,t,se)}}function wu(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Eu(e,t,s)},function(s){return gl(e,t,s)}):Eu(e,t,i)}function Eu(e,t,i){t.status="fulfilled",t.value=i,xu(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Cu(e,i)))}function gl(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,xu(t),t=t.next;while(t!==s)}e.action=null}function xu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Au(e,t){return t}function Du(e,t){if(ke){var i=qe.formState;if(i!==null){e:{var s=Ce;if(ke){if(Pe){t:{for(var r=Pe,a=zt;r.nodeType!==8;){if(!a){r=null;break t}if(r=qt(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){Pe=qt(r.nextSibling),s=r.data==="F!";break e}}xi(s)}s=!1}s&&(t=i[0])}}return i=ft(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Au,lastRenderedState:t},i.queue=s,i=Yu.bind(null,Ce,s),s.dispatch=i,s=ml(!1),a=El.bind(null,Ce,!1,s.queue),s=ft(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=M_.bind(null,Ce,r,a,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function Ru(e){var t=$e();return Tu(t,je,e)}function Tu(e,t,i){if(t=vl(e,t,Au)[0],e=Rn(oi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=wr(t)}catch(y){throw y===Hs?gn:y}else s=t;t=$e();var r=t.queue,a=r.dispatch;return i!==t.memoizedState&&(Ce.flags|=2048,Is(9,{destroy:void 0},O_.bind(null,r,i),null)),[s,a,e]}function O_(e,t){e.action=t}function ku(e){var t=$e(),i=je;if(i!==null)return Tu(t,i,e);$e(),t=t.memoizedState,i=$e();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Is(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=An(),Ce.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 Lu(){return $e().memoizedState}function Tn(e,t,i,s){var r=ft();Ce.flags|=e,r.memoizedState=Is(1|t,{destroy:void 0},i,s===void 0?null:s)}function kn(e,t,i,s){var r=$e();s=s===void 0?null:s;var a=r.memoizedState.inst;je!==null&&s!==null&&cl(s,je.memoizedState.deps)?r.memoizedState=Is(t,a,i,s):(Ce.flags|=e,r.memoizedState=Is(1|t,a,i,s))}function Mu(e,t){Tn(8390656,8,e,t)}function Sl(e,t){kn(2048,8,e,t)}function B_(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=An(),Ce.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Ou(e){var t=$e().memoizedState;return B_({ref:t,nextImpl:e}),function(){if((Be&2)!==0)throw Error(M(440));return t.impl.apply(void 0,arguments)}}function Bu(e,t){return kn(4,2,e,t)}function Nu(e,t){return kn(4,4,e,t)}function Hu(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 ju(e,t,i){i=i!=null?i.concat([e]):null,kn(4,4,Hu.bind(null,t,e),i)}function yl(){}function zu(e,t){var i=$e();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&cl(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Uu(e,t){var i=$e();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&cl(t,s[1]))return s[0];if(s=e(),os){yi(!0);try{e()}finally{yi(!1)}}return i.memoizedState=[s,t],s}function bl(e,t,i){return i===void 0||(li&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=qh(),Ce.lanes|=e,Bi|=e,i)}function qu(e,t,i,s){return Et(i,t)?i:zs.current!==null?(e=bl(e,i,s),Et(e,t)||(Je=!0),e):(li&42)===0||(li&1073741824)!==0&&(Re&261930)===0?(Je=!0,e.memoizedState=i):(e=qh(),Ce.lanes|=e,Bi|=e,t)}function Iu(e,t,i,s,r){var a=K.p;K.p=a!==0&&8>a?a:8;var y=F.T,L={};F.T=L,El(e,!1,t,i);try{var q=r(),se=F.S;if(se!==null&&se(L,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ue=T_(q,s);Er(e,t,ue,kt(e))}else Er(e,t,s,kt(e))}catch(fe){Er(e,t,{then:function(){},status:"rejected",reason:fe},kt())}finally{K.p=a,y!==null&&L.types!==null&&(y.types=L.types),F.T=y}}function N_(){}function Cl(e,t,i,s){if(e.tag!==5)throw Error(M(476));var r=Pu(e).queue;Iu(e,r,t,te,i===null?N_:function(){return Wu(e),i(s)})}function Pu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:te},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wu(e){var t=Pu(e);t.next===null&&(t=e.alternate.memoizedState),Er(e,t.next.queue,{},kt())}function wl(){return lt(Ir)}function Fu(){return $e().memoizedState}function Ku(){return $e().memoizedState}function H_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=kt();e=Ri(i);var s=Ti(t,e,i);s!==null&&(yt(s,t,i),Sr(s,t,i)),t={cache:Qa()},e.payload=t;return}t=t.return}}function j_(e,t,i){var s=kt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ln(e)?Gu(t,i):(i=Ia(e,t,i,s),i!==null&&(yt(i,e,s),Xu(i,t,s)))}function Yu(e,t,i){var s=kt();Er(e,t,i,s)}function Er(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ln(e))Gu(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var y=t.lastRenderedState,L=a(y,i);if(r.hasEagerState=!0,r.eagerState=L,Et(L,y))return hn(e,t,r,0),qe===null&&un(),!1}catch{}finally{}if(i=Ia(e,t,r,s),i!==null)return yt(i,e,s),Xu(i,t,s),!0}return!1}function El(e,t,i,s){if(s={lane:2,revertLane:io(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ln(e)){if(t)throw Error(M(479))}else t=Ia(e,i,s,2),t!==null&&yt(t,e,2)}function Ln(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Gu(e,t){Us=En=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Xu(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Jo(e,i)}}var xr={readContext:lt,use:Dn,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};xr.useEffectEvent=Ye;var $u={readContext:lt,use:Dn,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Mu,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Tn(4194308,4,Hu.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Tn(4194308,4,e,t)},useInsertionEffect:function(e,t){Tn(4,2,e,t)},useMemo:function(e,t){var i=ft();t=t===void 0?null:t;var s=e();if(os){yi(!0);try{e()}finally{yi(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ft();if(i!==void 0){var r=i(t);if(os){yi(!0);try{i(t)}finally{yi(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=j_.bind(null,Ce,e),[s.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=ml(e);var t=e.queue,i=Yu.bind(null,Ce,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:yl,useDeferredValue:function(e,t){var i=ft();return bl(i,e,t)},useTransition:function(){var e=ml(!1);return e=Iu.bind(null,Ce,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Ce,r=ft();if(ke){if(i===void 0)throw Error(M(407));i=i()}else{if(i=t(),qe===null)throw Error(M(349));(Re&127)!==0||pu(s,t,i)}r.memoizedState=i;var a={value:i,getSnapshot:t};return r.queue=a,Mu(gu.bind(null,s,a,e),[e]),s.flags|=2048,Is(9,{destroy:void 0},mu.bind(null,s,a,i,t),null),i},useId:function(){var e=ft(),t=qe.identifierPrefix;if(ke){var i=Zt,s=Vt;i=(s&~(1<<32-wt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=xn++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=k_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wl,useFormState:Du,useActionState:Du,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=El.bind(null,Ce,!0,i),i.dispatch=t,[e,t]},useMemoCache:_l,useCacheRefresh:function(){return ft().memoizedState=H_.bind(null,Ce)},useEffectEvent:function(e){var t=ft(),i={impl:e};return t.memoizedState=i,function(){if((Be&2)!==0)throw Error(M(440));return i.impl.apply(void 0,arguments)}}},xl={readContext:lt,use:Dn,useCallback:zu,useContext:lt,useEffect:Sl,useImperativeHandle:ju,useInsertionEffect:Bu,useLayoutEffect:Nu,useMemo:Uu,useReducer:Rn,useRef:Lu,useState:function(){return Rn(oi)},useDebugValue:yl,useDeferredValue:function(e,t){var i=$e();return qu(i,je.memoizedState,e,t)},useTransition:function(){var e=Rn(oi)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:wr(e),t]},useSyncExternalStore:vu,useId:Fu,useHostTransitionStatus:wl,useFormState:Ru,useActionState:Ru,useOptimistic:function(e,t){var i=$e();return bu(i,je,e,t)},useMemoCache:_l,useCacheRefresh:Ku};xl.useEffectEvent=Ou;var Vu={readContext:lt,use:Dn,useCallback:zu,useContext:lt,useEffect:Sl,useImperativeHandle:ju,useInsertionEffect:Bu,useLayoutEffect:Nu,useMemo:Uu,useReducer:pl,useRef:Lu,useState:function(){return pl(oi)},useDebugValue:yl,useDeferredValue:function(e,t){var i=$e();return je===null?bl(i,e,t):qu(i,je.memoizedState,e,t)},useTransition:function(){var e=pl(oi)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:wr(e),t]},useSyncExternalStore:vu,useId:Fu,useHostTransitionStatus:wl,useFormState:ku,useActionState:ku,useOptimistic:function(e,t){var i=$e();return je!==null?bu(i,je,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:_l,useCacheRefresh:Ku};Vu.useEffectEvent=Ou;function Al(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:h({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Dl={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=kt(),r=Ri(s);r.payload=t,i!=null&&(r.callback=i),t=Ti(e,r,s),t!==null&&(yt(t,e,s),Sr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=kt(),r=Ri(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=Ti(e,r,s),t!==null&&(yt(t,e,s),Sr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=kt(),s=Ri(i);s.tag=2,t!=null&&(s.callback=t),t=Ti(e,s,i),t!==null&&(yt(t,e,i),Sr(t,e,i))}};function Zu(e,t,i,s,r,a,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,y):t.prototype&&t.prototype.isPureReactComponent?!hr(i,s)||!hr(r,a):!0}function Qu(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 cs(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=h({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function Ju(e){cn(e)}function eh(e){console.error(e)}function th(e){cn(e)}function Mn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function ih(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Rl(e,t,i){return i=Ri(i),i.tag=3,i.payload={element:null},i.callback=function(){Mn(e,t)},i}function sh(e){return e=Ri(e),e.tag=3,e}function rh(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var a=s.value;e.payload=function(){return r(a)},e.callback=function(){ih(t,i,s)}}var y=i.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){ih(t,i,s),typeof r!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var L=s.stack;this.componentDidCatch(s.value,{componentStack:L!==null?L:""})})}function z_(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Os(t,i,r,!0),i=At.current,i!==null){switch(i.tag){case 31:case 13:return Ut===null?Fn():i.alternate===null&&Ge===0&&(Ge=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===Sn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Jl(e,s,r)),!1;case 22:return i.flags|=65536,s===Sn?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)),Jl(e,s,r)),!1}throw Error(M(435,i.tag))}return Jl(e,s,r),Fn(),!1}if(ke)return t=At.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Ga&&(e=Error(M(422),{cause:s}),_r(Nt(e,i)))):(s!==Ga&&(t=Error(M(423),{cause:s}),_r(Nt(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Nt(s,i),r=Rl(e.stateNode,s,r),rl(e,r),Ge!==4&&(Ge=2)),!1;var a=Error(M(520),{cause:s});if(a=Nt(a,i),Or===null?Or=[a]:Or.push(a),Ge!==4&&(Ge=2),t===null)return!0;s=Nt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=Rl(i.stateNode,s,e),rl(i,e),!1;case 1:if(t=i.type,a=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Ni===null||!Ni.has(a))))return i.flags|=65536,r&=-r,i.lanes|=r,r=sh(r),rh(r,e,i,s),rl(i,r),!1}i=i.return}while(i!==null);return!1}var Tl=Error(M(461)),Je=!1;function ot(e,t,i,s){t.child=e===null?ou(t,null,i,s):ls(t,e.child,i,s)}function nh(e,t,i,s,r){i=i.render;var a=t.ref;if("ref"in s){var y={};for(var L in s)L!=="ref"&&(y[L]=s[L])}else y=s;return ss(t),s=ul(e,t,i,y,a,r),L=hl(),e!==null&&!Je?(fl(e,t,r),ci(e,t,r)):(ke&&L&&Ka(t),t.flags|=1,ot(e,t,s,r),t.child)}function ah(e,t,i,s,r){if(e===null){var a=i.type;return typeof a=="function"&&!Pa(a)&&a.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=a,lh(e,t,a,s,r)):(e=dn(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jl(e,r)){var y=a.memoizedProps;if(i=i.compare,i=i!==null?i:hr,i(y,s)&&e.ref===t.ref)return ci(e,t,r)}return t.flags|=1,e=si(a,s),e.ref=t.ref,e.return=t,t.child=e}function lh(e,t,i,s,r){if(e!==null){var a=e.memoizedProps;if(hr(a,s)&&e.ref===t.ref)if(Je=!1,t.pendingProps=s=a,jl(e,r))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,ci(e,t,r)}return kl(e,t,i,s,r)}function oh(e,t,i,s){var r=s.children,a=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(a=a!==null?a.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~a}else s=0,t.child=null;return ch(e,t,a,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mn(t,a!==null?a.cachePool:null),a!==null?hu(t,a):al(),fu(t);else return s=t.lanes=536870912,ch(e,t,a!==null?a.baseLanes|i:i,i,s)}else a!==null?(mn(t,a.cachePool),hu(t,a),Li(),t.memoizedState=null):(e!==null&&mn(t,null),al(),Li());return ot(e,t,r,i),t.child}function Ar(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ch(e,t,i,s,r){var a=el();return a=a===null?null:{parent:Ze._currentValue,pool:a},t.memoizedState={baseLanes:i,cachePool:a},e!==null&&mn(t,null),al(),fu(t),e!==null&&Os(e,t,s,!0),t.childLanes=r,null}function On(e,t){return t=Nn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uh(e,t,i){return ls(t,e.child,null,i),e=On(t,t.pendingProps),e.flags|=2,Dt(t),t.memoizedState=null,e}function U_(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(s.mode==="hidden")return e=On(t,s),t.lanes=536870912,Ar(null,e);if(ol(t),(e=Pe)?(e=wf(e,zt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi!==null?{id:Vt,overflow:Zt}:null,retryLane:536870912,hydrationErrors:null},i=Gc(e),i.return=t,t.child=i,at=t,Pe=null)):e=null,e===null)throw xi(t);return t.lanes=536870912,null}return On(t,s)}var a=e.memoizedState;if(a!==null){var y=a.dehydrated;if(ol(t),r)if(t.flags&256)t.flags&=-257,t=uh(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(M(558));else if(Je||Os(e,t,i,!1),r=(i&e.childLanes)!==0,Je||r){if(s=qe,s!==null&&(y=ec(s,i),y!==0&&y!==a.retryLane))throw a.retryLane=y,Ji(e,y),yt(s,e,y),Tl;Fn(),t=uh(e,t,i)}else e=a.treeContext,Pe=qt(y.nextSibling),at=t,ke=!0,Ei=null,zt=!1,e!==null&&Vc(t,e),t=On(t,s),t.flags|=4096;return t}return e=si(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bn(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(M(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function kl(e,t,i,s,r){return ss(t),i=ul(e,t,i,s,void 0,r),s=hl(),e!==null&&!Je?(fl(e,t,r),ci(e,t,r)):(ke&&s&&Ka(t),t.flags|=1,ot(e,t,i,r),t.child)}function hh(e,t,i,s,r,a){return ss(t),t.updateQueue=null,i=_u(t,s,i,r),du(e),s=hl(),e!==null&&!Je?(fl(e,t,a),ci(e,t,a)):(ke&&s&&Ka(t),t.flags|=1,ot(e,t,i,a),t.child)}function fh(e,t,i,s,r){if(ss(t),t.stateNode===null){var a=Ts,y=i.contextType;typeof y=="object"&&y!==null&&(a=lt(y)),a=new i(s,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Dl,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=s,a.state=t.memoizedState,a.refs={},il(t),y=i.contextType,a.context=typeof y=="object"&&y!==null?lt(y):Ts,a.state=t.memoizedState,y=i.getDerivedStateFromProps,typeof y=="function"&&(Al(t,i,y,s),a.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(y=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),y!==a.state&&Dl.enqueueReplaceState(a,a.state,null),br(t,s,a,r),yr(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){a=t.stateNode;var L=t.memoizedProps,q=cs(i,L);a.props=q;var se=a.context,ue=i.contextType;y=Ts,typeof ue=="object"&&ue!==null&&(y=lt(ue));var fe=i.getDerivedStateFromProps;ue=typeof fe=="function"||typeof a.getSnapshotBeforeUpdate=="function",L=t.pendingProps!==L,ue||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(L||se!==y)&&Qu(t,a,s,y),Di=!1;var ne=t.memoizedState;a.state=ne,br(t,s,a,r),yr(),se=t.memoizedState,L||ne!==se||Di?(typeof fe=="function"&&(Al(t,i,fe,s),se=t.memoizedState),(q=Di||Zu(t,i,q,s,ne,se,y))?(ue||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=se),a.props=s,a.state=se,a.context=y,s=q):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,sl(e,t),y=t.memoizedProps,ue=cs(i,y),a.props=ue,fe=t.pendingProps,ne=a.context,se=i.contextType,q=Ts,typeof se=="object"&&se!==null&&(q=lt(se)),L=i.getDerivedStateFromProps,(se=typeof L=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(y!==fe||ne!==q)&&Qu(t,a,s,q),Di=!1,ne=t.memoizedState,a.state=ne,br(t,s,a,r),yr();var oe=t.memoizedState;y!==fe||ne!==oe||Di||e!==null&&e.dependencies!==null&&vn(e.dependencies)?(typeof L=="function"&&(Al(t,i,L,s),oe=t.memoizedState),(ue=Di||Zu(t,i,ue,s,ne,oe,q)||e!==null&&e.dependencies!==null&&vn(e.dependencies))?(se||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,oe,q),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,oe,q)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||y===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=oe),a.props=s,a.state=oe,a.context=q,s=ue):(typeof a.componentDidUpdate!="function"||y===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),s=!1)}return a=s,Bn(e,t),s=(t.flags&128)!==0,a||s?(a=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&s?(t.child=ls(t,e.child,null,r),t.child=ls(t,null,i,r)):ot(e,t,i,r),t.memoizedState=a.state,e=t.child):e=ci(e,t,r),e}function dh(e,t,i,s){return ts(),t.flags|=256,ot(e,t,i,s),t.child}var Ll={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ml(e){return{baseLanes:e,cachePool:iu()}}function Ol(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Tt),e}function _h(e,t,i){var s=t.pendingProps,r=!1,a=(t.flags&128)!==0,y;if((y=a)||(y=e!==null&&e.memoizedState===null?!1:(Xe.current&2)!==0),y&&(r=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(r?ki(t):Li(),(e=Pe)?(e=wf(e,zt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi!==null?{id:Vt,overflow:Zt}:null,retryLane:536870912,hydrationErrors:null},i=Gc(e),i.return=t,t.child=i,at=t,Pe=null)):e=null,e===null)throw xi(t);return po(e)?t.lanes=32:t.lanes=536870912,null}var L=s.children;return s=s.fallback,r?(Li(),r=t.mode,L=Nn({mode:"hidden",children:L},r),s=es(s,r,i,null),L.return=t,s.return=t,L.sibling=s,t.child=L,s=t.child,s.memoizedState=Ml(i),s.childLanes=Ol(e,y,i),t.memoizedState=Ll,Ar(null,s)):(ki(t),Bl(t,L))}var q=e.memoizedState;if(q!==null&&(L=q.dehydrated,L!==null)){if(a)t.flags&256?(ki(t),t.flags&=-257,t=Nl(e,t,i)):t.memoizedState!==null?(Li(),t.child=e.child,t.flags|=128,t=null):(Li(),L=s.fallback,r=t.mode,s=Nn({mode:"visible",children:s.children},r),L=es(L,r,i,null),L.flags|=2,s.return=t,L.return=t,s.sibling=L,t.child=s,ls(t,e.child,null,i),s=t.child,s.memoizedState=Ml(i),s.childLanes=Ol(e,y,i),t.memoizedState=Ll,t=Ar(null,s));else if(ki(t),po(L)){if(y=L.nextSibling&&L.nextSibling.dataset,y)var se=y.dgst;y=se,s=Error(M(419)),s.stack="",s.digest=y,_r({value:s,source:null,stack:null}),t=Nl(e,t,i)}else if(Je||Os(e,t,i,!1),y=(i&e.childLanes)!==0,Je||y){if(y=qe,y!==null&&(s=ec(y,i),s!==0&&s!==q.retryLane))throw q.retryLane=s,Ji(e,s),yt(y,e,s),Tl;vo(L)||Fn(),t=Nl(e,t,i)}else vo(L)?(t.flags|=192,t.child=e.child,t=null):(e=q.treeContext,Pe=qt(L.nextSibling),at=t,ke=!0,Ei=null,zt=!1,e!==null&&Vc(t,e),t=Bl(t,s.children),t.flags|=4096);return t}return r?(Li(),L=s.fallback,r=t.mode,q=e.child,se=q.sibling,s=si(q,{mode:"hidden",children:s.children}),s.subtreeFlags=q.subtreeFlags&65011712,se!==null?L=si(se,L):(L=es(L,r,i,null),L.flags|=2),L.return=t,s.return=t,s.sibling=L,t.child=s,Ar(null,s),s=t.child,L=e.child.memoizedState,L===null?L=Ml(i):(r=L.cachePool,r!==null?(q=Ze._currentValue,r=r.parent!==q?{parent:q,pool:q}:r):r=iu(),L={baseLanes:L.baseLanes|i,cachePool:r}),s.memoizedState=L,s.childLanes=Ol(e,y,i),t.memoizedState=Ll,Ar(e.child,s)):(ki(t),i=e.child,e=i.sibling,i=si(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=i,t.memoizedState=null,i)}function Bl(e,t){return t=Nn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Nn(e,t){return e=xt(22,e,null,t),e.lanes=0,e}function Nl(e,t,i){return ls(t,e.child,null,i),e=Bl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vh(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Va(e.return,t,i)}function Hl(e,t,i,s,r,a){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:a}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=i,y.tailMode=r,y.treeForkCount=a)}function ph(e,t,i){var s=t.pendingProps,r=s.revealOrder,a=s.tail;s=s.children;var y=Xe.current,L=(y&2)!==0;if(L?(y=y&1|2,t.flags|=128):y&=1,G(Xe,y),ot(e,t,s,i),s=ke?dr:0,!L&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vh(e,i,t);else if(e.tag===19)vh(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&wn(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),Hl(t,!1,r,i,a,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&wn(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}Hl(t,!0,i,null,a,s);break;case"together":Hl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function ci(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Bi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,i=si(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=si(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function jl(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vn(e)))}function q_(e,t,i){switch(t.tag){case 3:R(t,t.stateNode.containerInfo),Ai(t,Ze,e.memoizedState.cache),ts();break;case 27:case 5:le(t);break;case 4:R(t,t.stateNode.containerInfo);break;case 10:Ai(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ol(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ki(t),t.flags|=128,null):(i&t.child.childLanes)!==0?_h(e,t,i):(ki(t),e=ci(e,t,i),e!==null?e.sibling:null);ki(t);break;case 19:var r=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Os(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return ph(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),G(Xe,Xe.current),s)break;return null;case 22:return t.lanes=0,oh(e,t,i,t.pendingProps);case 24:Ai(t,Ze,e.memoizedState.cache)}return ci(e,t,i)}function mh(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!jl(e,i)&&(t.flags&128)===0)return Je=!1,q_(e,t,i);Je=(e.flags&131072)!==0}else Je=!1,ke&&(t.flags&1048576)!==0&&$c(t,dr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=ns(t.elementType),t.type=e,typeof e=="function")Pa(e)?(s=cs(e,s),t.tag=1,t=fh(null,t,e,s,i)):(t.tag=0,t=kl(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===_){t.tag=11,t=nh(null,t,e,s,i);break e}else if(r===C){t.tag=14,t=ah(null,t,e,s,i);break e}}throw t=re(e)||e,Error(M(306,t,""))}}return t;case 0:return kl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=cs(s,t.pendingProps),fh(e,t,s,r,i);case 3:e:{if(R(t,t.stateNode.containerInfo),e===null)throw Error(M(387));s=t.pendingProps;var a=t.memoizedState;r=a.element,sl(e,t),br(t,s,null,i);var y=t.memoizedState;if(s=y.cache,Ai(t,Ze,s),s!==a.cache&&Za(t,[Ze],i,!0),yr(),s=y.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=dh(e,t,s,i);break e}else if(s!==r){r=Nt(Error(M(424)),t),_r(r),t=dh(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(Pe=qt(e.firstChild),at=t,ke=!0,Ei=null,zt=!0,i=ou(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ts(),s===r){t=ci(e,t,i);break e}ot(e,t,s,i)}t=t.child}return t;case 26:return Bn(e,t),e===null?(i=Tf(t.type,null,t.pendingProps,null))?t.memoizedState=i:ke||(i=t.type,e=t.pendingProps,s=Zn(V.current).createElement(i),s[nt]=t,s[_t]=e,ct(s,i,e),st(s),t.stateNode=s):t.memoizedState=Tf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&ke&&(s=t.stateNode=Af(t.type,t.pendingProps,V.current),at=t,zt=!0,r=Pe,Ui(t.type)?(mo=r,Pe=qt(s.firstChild)):Pe=r),ot(e,t,t.pendingProps.children,i),Bn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((r=s=Pe)&&(s=pv(s,t.type,t.pendingProps,zt),s!==null?(t.stateNode=s,at=t,Pe=qt(s.firstChild),zt=!1,r=!0):r=!1),r||xi(t)),le(t),r=t.type,a=t.pendingProps,y=e!==null?e.memoizedProps:null,s=a.children,ho(r,a)?s=null:y!==null&&ho(r,y)&&(t.flags|=32),t.memoizedState!==null&&(r=ul(e,t,L_,null,null,i),Ir._currentValue=r),Bn(e,t),ot(e,t,s,i),t.child;case 6:return e===null&&ke&&((e=i=Pe)&&(i=mv(i,t.pendingProps,zt),i!==null?(t.stateNode=i,at=t,Pe=null,e=!0):e=!1),e||xi(t)),null;case 13:return _h(e,t,i);case 4:return R(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ls(t,null,s,i):ot(e,t,s,i),t.child;case 11:return nh(e,t,t.type,t.pendingProps,i);case 7:return ot(e,t,t.pendingProps,i),t.child;case 8:return ot(e,t,t.pendingProps.children,i),t.child;case 12:return ot(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Ai(t,t.type,s.value),ot(e,t,s.children,i),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,ss(t),r=lt(r),s=s(r),t.flags|=1,ot(e,t,s,i),t.child;case 14:return ah(e,t,t.type,t.pendingProps,i);case 15:return lh(e,t,t.type,t.pendingProps,i);case 19:return ph(e,t,i);case 31:return U_(e,t,i);case 22:return oh(e,t,i,t.pendingProps);case 24:return ss(t),s=lt(Ze),e===null?(r=el(),r===null&&(r=qe,a=Qa(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=i),r=a),t.memoizedState={parent:s,cache:r},il(t),Ai(t,Ze,r)):((e.lanes&i)!==0&&(sl(e,t),br(t,null,null,i),yr()),r=e.memoizedState,a=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Ai(t,Ze,s)):(s=a.cache,Ai(t,Ze,s),s!==r.cache&&Za(t,[Ze],i,!0))),ot(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(M(156,t.tag))}function ui(e){e.flags|=4}function zl(e,t,i,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Fh())e.flags|=8192;else throw as=Sn,tl}else e.flags&=-16777217}function gh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bf(t))if(Fh())e.flags|=8192;else throw as=Sn,tl}function Hn(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zo():536870912,e.lanes|=t,Ks|=t)}function Dr(e,t){if(!ke)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 We(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function I_(e,t,i){var s=t.pendingProps;switch(Ya(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return We(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ai(Ze),Z(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ms(t)?ui(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xa())),We(t),null;case 26:var r=t.type,a=t.memoizedState;return e===null?(ui(t),a!==null?(We(t),gh(t,a)):(We(t),zl(t,r,null,s,i))):a?a!==e.memoizedState?(ui(t),We(t),gh(t,a)):(We(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ui(t),We(t),zl(t,r,e,s,i)),null;case 27:if(de(t),i=V.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ui(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return We(t),null}e=ae.current,Ms(t)?Zc(t):(e=Af(r,s,i),t.stateNode=e,ui(t))}return We(t),null;case 5:if(de(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ui(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return We(t),null}if(a=ae.current,Ms(t))Zc(t);else{var y=Zn(V.current);switch(a){case 1:a=y.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=y.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":a=y.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":a=y.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":a=y.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof s.is=="string"?y.createElement("select",{is:s.is}):y.createElement("select"),s.multiple?a.multiple=!0:s.size&&(a.size=s.size);break;default:a=typeof s.is=="string"?y.createElement(r,{is:s.is}):y.createElement(r)}}a[nt]=t,a[_t]=s;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)a.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=a;e:switch(ct(a,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ui(t)}}return We(t),zl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ui(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(M(166));if(e=V.current,Ms(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=at,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[nt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||vf(e.nodeValue,i)),e||xi(t,!0)}else e=Zn(e).createTextNode(s),e[nt]=t,t.stateNode=e}return We(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ms(t),i!==null){if(e===null){if(!s)throw Error(M(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(557));e[nt]=t}else ts(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else i=Xa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Dt(t),t):(Dt(t),null);if((t.flags&128)!==0)throw Error(M(558))}return We(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ms(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(M(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(M(317));r[nt]=t}else ts(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),r=!1}else r=Xa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Dt(t),t):(Dt(t),null)}return Dt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Hn(t,t.updateQueue),We(t),null);case 4:return Z(),e===null&&ao(t.stateNode.containerInfo),We(t),null;case 10:return ai(t.type),We(t),null;case 19:if(O(Xe),s=t.memoizedState,s===null)return We(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Dr(s,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=wn(e),a!==null){for(t.flags|=128,Dr(s,!1),e=a.updateQueue,t.updateQueue=e,Hn(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Yc(i,e),i=i.sibling;return G(Xe,Xe.current&1|2),ke&&ri(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&tt()>In&&(t.flags|=128,r=!0,Dr(s,!1),t.lanes=4194304)}else{if(!r)if(e=wn(a),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hn(t,e),Dr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!ke)return We(t),null}else 2*tt()-s.renderingStartTime>In&&i!==536870912&&(t.flags|=128,r=!0,Dr(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(e=s.last,e!==null?e.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=tt(),e.sibling=null,i=Xe.current,G(Xe,r?i&1|2:i&1),ke&&ri(t,s.treeForkCount),e):(We(t),null);case 22:case 23:return Dt(t),ll(),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&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),i=t.updateQueue,i!==null&&Hn(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(rs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ai(Ze),We(t),null;case 25:return null;case 30:return null}throw Error(M(156,t.tag))}function P_(e,t){switch(Ya(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ai(Ze),Z(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(Dt(t),t.alternate===null)throw Error(M(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Dt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(Xe),null;case 4:return Z(),null;case 10:return ai(t.type),null;case 22:case 23:return Dt(t),ll(),e!==null&&O(rs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ai(Ze),null;case 25:return null;default:return null}}function Sh(e,t){switch(Ya(t),t.tag){case 3:ai(Ze),Z();break;case 26:case 27:case 5:de(t);break;case 4:Z();break;case 31:t.memoizedState!==null&&Dt(t);break;case 13:Dt(t);break;case 19:O(Xe);break;case 10:ai(t.type);break;case 22:case 23:Dt(t),ll(),e!==null&&O(rs);break;case 24:ai(Ze)}}function Rr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var a=i.create,y=i.inst;s=a(),y.destroy=s}i=i.next}while(i!==r)}}catch(L){He(t,t.return,L)}}function Mi(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var a=r.next;s=a;do{if((s.tag&e)===e){var y=s.inst,L=y.destroy;if(L!==void 0){y.destroy=void 0,r=t;var q=i,se=L;try{se()}catch(ue){He(r,q,ue)}}}s=s.next}while(s!==a)}}catch(ue){He(t,t.return,ue)}}function yh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{uu(t,i)}catch(s){He(e,e.return,s)}}}function bh(e,t,i){i.props=cs(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){He(e,t,s)}}function Tr(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(r){He(e,t,r)}}function Qt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){He(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){He(e,t,r)}else i.current=null}function Ch(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){He(e,e.return,r)}}function Ul(e,t,i){try{var s=e.stateNode;uv(s,e.type,i,t),s[_t]=t}catch(r){He(e,e.return,r)}}function wh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ui(e.type)||e.tag===4}function ql(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wh(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&&Ui(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 Il(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=ti));else if(s!==4&&(s===27&&Ui(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Il(e,t,i),e=e.sibling;e!==null;)Il(e,t,i),e=e.sibling}function jn(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&&Ui(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(jn(e,t,i),e=e.sibling;e!==null;)jn(e,t,i),e=e.sibling}function Eh(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ct(t,s,i),t[nt]=e,t[_t]=i}catch(a){He(e,e.return,a)}}var hi=!1,et=!1,Pl=!1,xh=typeof WeakSet=="function"?WeakSet:Set,rt=null;function W_(e,t){if(e=e.containerInfo,co=ra,e=jc(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 r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{i.nodeType,a.nodeType}catch{i=null;break e}var y=0,L=-1,q=-1,se=0,ue=0,fe=e,ne=null;t:for(;;){for(var oe;fe!==i||r!==0&&fe.nodeType!==3||(L=y+r),fe!==a||s!==0&&fe.nodeType!==3||(q=y+s),fe.nodeType===3&&(y+=fe.nodeValue.length),(oe=fe.firstChild)!==null;)ne=fe,fe=oe;for(;;){if(fe===e)break t;if(ne===i&&++se===r&&(L=y),ne===a&&++ue===s&&(q=y),(oe=fe.nextSibling)!==null)break;fe=ne,ne=fe.parentNode}fe=oe}i=L===-1||q===-1?null:{start:L,end:q}}else i=null}i=i||{start:0,end:0}}else i=null;for(uo={focusedElem:e,selectionRange:i},ra=!1,rt=t;rt!==null;)if(t=rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rt=e;else for(;rt!==null;){switch(t=rt,a=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++)r=e[i],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,i=t,r=a.memoizedProps,a=a.memoizedState,s=i.stateNode;try{var pe=cs(i.type,r);e=s.getSnapshotBeforeUpdate(pe,a),s.__reactInternalSnapshotBeforeUpdate=e}catch(Se){He(i,i.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)_o(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_o(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(M(163))}if(e=t.sibling,e!==null){e.return=t.return,rt=e;break}rt=t.return}}function Ah(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:di(e,i),s&4&&Rr(5,i);break;case 1:if(di(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(y){He(i,i.return,y)}else{var r=cs(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){He(i,i.return,y)}}s&64&&yh(i),s&512&&Tr(i,i.return);break;case 3:if(di(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{uu(e,t)}catch(y){He(i,i.return,y)}}break;case 27:t===null&&s&4&&Eh(i);case 26:case 5:di(e,i),t===null&&s&4&&Ch(i),s&512&&Tr(i,i.return);break;case 12:di(e,i);break;case 31:di(e,i),s&4&&Th(e,i);break;case 13:di(e,i),s&4&&kh(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Q_.bind(null,i),gv(e,i))));break;case 22:if(s=i.memoizedState!==null||hi,!s){t=t!==null&&t.memoizedState!==null||et,r=hi;var a=et;hi=s,(et=t)&&!a?_i(e,i,(i.subtreeFlags&8772)!==0):di(e,i),hi=r,et=a}break;case 30:break;default:di(e,i)}}function Dh(e){var t=e.alternate;t!==null&&(e.alternate=null,Dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ga(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 Fe=null,pt=!1;function fi(e,t,i){for(i=i.child;i!==null;)Rh(e,t,i),i=i.sibling}function Rh(e,t,i){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Gi,i)}catch{}switch(i.tag){case 26:et||Qt(i,t),fi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:et||Qt(i,t);var s=Fe,r=pt;Ui(i.type)&&(Fe=i.stateNode,pt=!1),fi(e,t,i),zr(i.stateNode),Fe=s,pt=r;break;case 5:et||Qt(i,t);case 6:if(s=Fe,r=pt,Fe=null,fi(e,t,i),Fe=s,pt=r,Fe!==null)if(pt)try{(Fe.nodeType===9?Fe.body:Fe.nodeName==="HTML"?Fe.ownerDocument.body:Fe).removeChild(i.stateNode)}catch(a){He(i,t,a)}else try{Fe.removeChild(i.stateNode)}catch(a){He(i,t,a)}break;case 18:Fe!==null&&(pt?(e=Fe,bf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Js(e)):bf(Fe,i.stateNode));break;case 4:s=Fe,r=pt,Fe=i.stateNode.containerInfo,pt=!0,fi(e,t,i),Fe=s,pt=r;break;case 0:case 11:case 14:case 15:Mi(2,i,t),et||Mi(4,i,t),fi(e,t,i);break;case 1:et||(Qt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&bh(i,t,s)),fi(e,t,i);break;case 21:fi(e,t,i);break;case 22:et=(s=et)||i.memoizedState!==null,fi(e,t,i),et=s;break;default:fi(e,t,i)}}function Th(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Js(e)}catch(i){He(t,t.return,i)}}}function kh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Js(e)}catch(i){He(t,t.return,i)}}function F_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xh),t;default:throw Error(M(435,e.tag))}}function zn(e,t){var i=F_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=J_.bind(null,e,s);s.then(r,r)}})}function mt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s],a=e,y=t,L=y;e:for(;L!==null;){switch(L.tag){case 27:if(Ui(L.type)){Fe=L.stateNode,pt=!1;break e}break;case 5:Fe=L.stateNode,pt=!1;break e;case 3:case 4:Fe=L.stateNode.containerInfo,pt=!0;break e}L=L.return}if(Fe===null)throw Error(M(160));Rh(a,y,r),Fe=null,pt=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Lh(t,e),t=t.sibling}var Gt=null;function Lh(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mt(t,e),gt(e),s&4&&(Mi(3,e,e.return),Rr(3,e),Mi(5,e,e.return));break;case 1:mt(t,e),gt(e),s&512&&(et||i===null||Qt(i,i.return)),s&64&&hi&&(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 r=Gt;if(mt(t,e),gt(e),s&512&&(et||i===null||Qt(i,i.return)),s&4){var a=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,r=r.ownerDocument||r;t:switch(s){case"title":a=r.getElementsByTagName("title")[0],(!a||a[ir]||a[nt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(s),r.head.insertBefore(a,r.querySelector("head > title"))),ct(a,s,i),a[nt]=e,st(a),s=a;break e;case"link":var y=Mf("link","href",r).get(s+(i.href||""));if(y){for(var L=0;L<y.length;L++)if(a=y[L],a.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&a.getAttribute("rel")===(i.rel==null?null:i.rel)&&a.getAttribute("title")===(i.title==null?null:i.title)&&a.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){y.splice(L,1);break t}}a=r.createElement(s),ct(a,s,i),r.head.appendChild(a);break;case"meta":if(y=Mf("meta","content",r).get(s+(i.content||""))){for(L=0;L<y.length;L++)if(a=y[L],a.getAttribute("content")===(i.content==null?null:""+i.content)&&a.getAttribute("name")===(i.name==null?null:i.name)&&a.getAttribute("property")===(i.property==null?null:i.property)&&a.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&a.getAttribute("charset")===(i.charSet==null?null:i.charSet)){y.splice(L,1);break t}}a=r.createElement(s),ct(a,s,i),r.head.appendChild(a);break;default:throw Error(M(468,s))}a[nt]=e,st(a),s=a}e.stateNode=s}else Of(r,e.type,e.stateNode);else e.stateNode=Lf(r,s,e.memoizedProps);else a!==s?(a===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):a.count--,s===null?Of(r,e.type,e.stateNode):Lf(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Ul(e,e.memoizedProps,i.memoizedProps)}break;case 27:mt(t,e),gt(e),s&512&&(et||i===null||Qt(i,i.return)),i!==null&&s&4&&Ul(e,e.memoizedProps,i.memoizedProps);break;case 5:if(mt(t,e),gt(e),s&512&&(et||i===null||Qt(i,i.return)),e.flags&32){r=e.stateNode;try{Cs(r,"")}catch(pe){He(e,e.return,pe)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,Ul(e,r,i!==null?i.memoizedProps:r)),s&1024&&(Pl=!0);break;case 6:if(mt(t,e),gt(e),s&4){if(e.stateNode===null)throw Error(M(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(pe){He(e,e.return,pe)}}break;case 3:if(ea=null,r=Gt,Gt=Qn(t.containerInfo),mt(t,e),Gt=r,gt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(pe){He(e,e.return,pe)}Pl&&(Pl=!1,Mh(e));break;case 4:s=Gt,Gt=Qn(e.stateNode.containerInfo),mt(t,e),gt(e),Gt=s;break;case 12:mt(t,e),gt(e);break;case 31:mt(t,e),gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 13:mt(t,e),gt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(qn=tt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 22:r=e.memoizedState!==null;var q=i!==null&&i.memoizedState!==null,se=hi,ue=et;if(hi=se||r,et=ue||q,mt(t,e),et=ue,hi=se,gt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(i===null||q||hi||et||us(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){q=i=t;try{if(a=q.stateNode,r)y=a.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{L=q.stateNode;var fe=q.memoizedProps.style,ne=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;L.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(pe){He(q,q.return,pe)}}}else if(t.tag===6){if(i===null){q=t;try{q.stateNode.nodeValue=r?"":q.memoizedProps}catch(pe){He(q,q.return,pe)}}}else if(t.tag===18){if(i===null){q=t;try{var oe=q.stateNode;r?Cf(oe,!0):Cf(q.stateNode,!1)}catch(pe){He(q,q.return,pe)}}}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,zn(e,i))));break;case 19:mt(t,e),gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 30:break;case 21:break;default:mt(t,e),gt(e)}}function gt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(wh(s)){i=s;break}s=s.return}if(i==null)throw Error(M(160));switch(i.tag){case 27:var r=i.stateNode,a=ql(e);jn(e,a,r);break;case 5:var y=i.stateNode;i.flags&32&&(Cs(y,""),i.flags&=-33);var L=ql(e);jn(e,L,y);break;case 3:case 4:var q=i.stateNode.containerInfo,se=ql(e);Il(e,se,q);break;default:throw Error(M(161))}}catch(ue){He(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function di(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ah(e,t.alternate,t),t=t.sibling}function us(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Mi(4,t,t.return),us(t);break;case 1:Qt(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&bh(t,t.return,i),us(t);break;case 27:zr(t.stateNode);case 26:case 5:Qt(t,t.return),us(t);break;case 22:t.memoizedState===null&&us(t);break;case 30:us(t);break;default:us(t)}e=e.sibling}}function _i(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,a=t,y=a.flags;switch(a.tag){case 0:case 11:case 15:_i(r,a,i),Rr(4,a);break;case 1:if(_i(r,a,i),s=a,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(se){He(s,s.return,se)}if(s=a,r=s.updateQueue,r!==null){var L=s.stateNode;try{var q=r.shared.hiddenCallbacks;if(q!==null)for(r.shared.hiddenCallbacks=null,r=0;r<q.length;r++)cu(q[r],L)}catch(se){He(s,s.return,se)}}i&&y&64&&yh(a),Tr(a,a.return);break;case 27:Eh(a);case 26:case 5:_i(r,a,i),i&&s===null&&y&4&&Ch(a),Tr(a,a.return);break;case 12:_i(r,a,i);break;case 31:_i(r,a,i),i&&y&4&&Th(r,a);break;case 13:_i(r,a,i),i&&y&4&&kh(r,a);break;case 22:a.memoizedState===null&&_i(r,a,i),Tr(a,a.return);break;case 30:break;default:_i(r,a,i)}t=t.sibling}}function Wl(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&&vr(i))}function Fl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vr(e))}function Xt(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Oh(e,t,i,s),t=t.sibling}function Oh(e,t,i,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Xt(e,t,i,s),r&2048&&Rr(9,t);break;case 1:Xt(e,t,i,s);break;case 3:Xt(e,t,i,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vr(e)));break;case 12:if(r&2048){Xt(e,t,i,s),e=t.stateNode;try{var a=t.memoizedProps,y=a.id,L=a.onPostCommit;typeof L=="function"&&L(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(q){He(t,t.return,q)}}else Xt(e,t,i,s);break;case 31:Xt(e,t,i,s);break;case 13:Xt(e,t,i,s);break;case 23:break;case 22:a=t.stateNode,y=t.alternate,t.memoizedState!==null?a._visibility&2?Xt(e,t,i,s):kr(e,t):a._visibility&2?Xt(e,t,i,s):(a._visibility|=2,Ps(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Wl(y,t);break;case 24:Xt(e,t,i,s),r&2048&&Fl(t.alternate,t);break;default:Xt(e,t,i,s)}}function Ps(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,y=t,L=i,q=s,se=y.flags;switch(y.tag){case 0:case 11:case 15:Ps(a,y,L,q,r),Rr(8,y);break;case 23:break;case 22:var ue=y.stateNode;y.memoizedState!==null?ue._visibility&2?Ps(a,y,L,q,r):kr(a,y):(ue._visibility|=2,Ps(a,y,L,q,r)),r&&se&2048&&Wl(y.alternate,y);break;case 24:Ps(a,y,L,q,r),r&&se&2048&&Fl(y.alternate,y);break;default:Ps(a,y,L,q,r)}t=t.sibling}}function kr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:kr(i,s),r&2048&&Wl(s.alternate,s);break;case 24:kr(i,s),r&2048&&Fl(s.alternate,s);break;default:kr(i,s)}t=t.sibling}}var Lr=8192;function Ws(e,t,i){if(e.subtreeFlags&Lr)for(e=e.child;e!==null;)Bh(e,t,i),e=e.sibling}function Bh(e,t,i){switch(e.tag){case 26:Ws(e,t,i),e.flags&Lr&&e.memoizedState!==null&&kv(i,Gt,e.memoizedState,e.memoizedProps);break;case 5:Ws(e,t,i);break;case 3:case 4:var s=Gt;Gt=Qn(e.stateNode.containerInfo),Ws(e,t,i),Gt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Lr,Lr=16777216,Ws(e,t,i),Lr=s):Ws(e,t,i));break;default:Ws(e,t,i)}}function Nh(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 Mr(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];rt=s,jh(s,e)}Nh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hh(e),e=e.sibling}function Hh(e){switch(e.tag){case 0:case 11:case 15:Mr(e),e.flags&2048&&Mi(9,e,e.return);break;case 3:Mr(e);break;case 12:Mr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Un(e)):Mr(e);break;default:Mr(e)}}function Un(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];rt=s,jh(s,e)}Nh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mi(8,t,t.return),Un(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Un(t));break;default:Un(t)}e=e.sibling}}function jh(e,t){for(;rt!==null;){var i=rt;switch(i.tag){case 0:case 11:case 15:Mi(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:vr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,rt=s;else e:for(i=e;rt!==null;){s=rt;var r=s.sibling,a=s.return;if(Dh(s),s===i){rt=null;break e}if(r!==null){r.return=a,rt=r;break e}rt=a}}}var K_={getCacheForType:function(e){var t=lt(Ze),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return lt(Ze).controller.signal}},Y_=typeof WeakMap=="function"?WeakMap:Map,Be=0,qe=null,xe=null,Re=0,Ne=0,Rt=null,Oi=!1,Fs=!1,Kl=!1,vi=0,Ge=0,Bi=0,hs=0,Yl=0,Tt=0,Ks=0,Or=null,St=null,Gl=!1,qn=0,zh=0,In=1/0,Pn=null,Ni=null,it=0,Hi=null,Ys=null,pi=0,Xl=0,$l=null,Uh=null,Br=0,Vl=null;function kt(){return(Be&2)!==0&&Re!==0?Re&-Re:F.T!==null?io():tc()}function qh(){if(Tt===0)if((Re&536870912)===0||ke){var e=$r;$r<<=1,($r&3932160)===0&&($r=262144),Tt=e}else Tt=536870912;return e=At.current,e!==null&&(e.flags|=32),Tt}function yt(e,t,i){(e===qe&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)&&(Gs(e,0),ji(e,Re,Tt,!1)),tr(e,i),((Be&2)===0||e!==qe)&&(e===qe&&((Be&2)===0&&(hs|=i),Ge===4&&ji(e,Re,Tt,!1)),Jt(e))}function Ih(e,t,i){if((Be&6)!==0)throw Error(M(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||er(e,t),r=s?$_(e,t):Ql(e,t,!0),a=s;do{if(r===0){Fs&&!s&&ji(e,t,0,!1);break}else{if(i=e.current.alternate,a&&!G_(i)){r=Ql(e,t,!1),a=!1;continue}if(r===2){if(a=t,e.errorRecoveryDisabledLanes&a)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var L=e;r=Or;var q=L.current.memoizedState.isDehydrated;if(q&&(Gs(L,y).flags|=256),y=Ql(L,y,!1),y!==2){if(Kl&&!q){L.errorRecoveryDisabledLanes|=a,hs|=a,r=4;break e}a=St,St=r,a!==null&&(St===null?St=a:St.push.apply(St,a))}r=y}if(a=!1,r!==2)continue}}if(r===1){Gs(e,0),ji(e,t,0,!0);break}e:{switch(s=e,a=r,a){case 0:case 1:throw Error(M(345));case 4:if((t&4194048)!==t)break;case 6:ji(s,t,Tt,!Oi);break e;case 2:St=null;break;case 3:case 5:break;default:throw Error(M(329))}if((t&62914560)===t&&(r=qn+300-tt(),10<r)){if(ji(s,t,Tt,!Oi),Zr(s,0,!0)!==0)break e;pi=t,s.timeoutHandle=Sf(Ph.bind(null,s,i,St,Pn,Gl,t,Tt,hs,Ks,Oi,a,"Throttled",-0,0),r);break e}Ph(s,i,St,Pn,Gl,t,Tt,hs,Ks,Oi,a,null,-0,0)}}break}while(!0);Jt(e)}function Ph(e,t,i,s,r,a,y,L,q,se,ue,fe,ne,oe){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ti},Bh(t,a,fe);var pe=(a&62914560)===a?qn-tt():(a&4194048)===a?zh-tt():0;if(pe=Lv(fe,pe),pe!==null){pi=a,e.cancelPendingCommit=pe(Vh.bind(null,e,t,a,i,s,r,y,L,q,ue,fe,null,ne,oe)),ji(e,a,y,!se);return}}Vh(e,t,a,i,s,r,y,L,q)}function G_(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],a=r.getSnapshot;r=r.value;try{if(!Et(a(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ji(e,t,i,s){t&=~Yl,t&=~hs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var a=31-wt(r),y=1<<a;s[a]=-1,r&=~y}i!==0&&Qo(e,i,t)}function Wn(){return(Be&6)===0?(Nr(0),!1):!0}function Zl(){if(xe!==null){if(Ne===0)var e=xe.return;else e=xe,ni=is=null,dl(e),js=null,mr=0,e=xe;for(;e!==null;)Sh(e.alternate,e),e=e.return;xe=null}}function Gs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,dv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),pi=0,Zl(),qe=e,xe=i=si(e.current,null),Re=t,Ne=0,Rt=null,Oi=!1,Fs=er(e,t),Kl=!1,Ks=Tt=Yl=hs=Bi=Ge=0,St=Or=null,Gl=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-wt(s),a=1<<r;t|=e[r],s&=~a}return vi=t,un(),i}function Wh(e,t){Ce=null,F.H=xr,t===Hs||t===gn?(t=nu(),Ne=3):t===tl?(t=nu(),Ne=4):Ne=t===Tl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Rt=t,xe===null&&(Ge=1,Mn(e,Nt(t,e.current)))}function Fh(){var e=At.current;return e===null?!0:(Re&4194048)===Re?Ut===null:(Re&62914560)===Re||(Re&536870912)!==0?e===Ut:!1}function Kh(){var e=F.H;return F.H=xr,e===null?xr:e}function Yh(){var e=F.A;return F.A=K_,e}function Fn(){Ge=4,Oi||(Re&4194048)!==Re&&At.current!==null||(Fs=!0),(Bi&134217727)===0&&(hs&134217727)===0||qe===null||ji(qe,Re,Tt,!1)}function Ql(e,t,i){var s=Be;Be|=2;var r=Kh(),a=Yh();(qe!==e||Re!==t)&&(Pn=null,Gs(e,t)),t=!1;var y=Ge;e:do try{if(Ne!==0&&xe!==null){var L=xe,q=Rt;switch(Ne){case 8:Zl(),y=6;break e;case 3:case 2:case 9:case 6:At.current===null&&(t=!0);var se=Ne;if(Ne=0,Rt=null,Xs(e,L,q,se),i&&Fs){y=0;break e}break;default:se=Ne,Ne=0,Rt=null,Xs(e,L,q,se)}}X_(),y=Ge;break}catch(ue){Wh(e,ue)}while(!0);return t&&e.shellSuspendCounter++,ni=is=null,Be=s,F.H=r,F.A=a,xe===null&&(qe=null,Re=0,un()),y}function X_(){for(;xe!==null;)Gh(xe)}function $_(e,t){var i=Be;Be|=2;var s=Kh(),r=Yh();qe!==e||Re!==t?(Pn=null,In=tt()+500,Gs(e,t)):Fs=er(e,t);e:do try{if(Ne!==0&&xe!==null){t=xe;var a=Rt;t:switch(Ne){case 1:Ne=0,Rt=null,Xs(e,t,a,1);break;case 2:case 9:if(su(a)){Ne=0,Rt=null,Xh(t);break}t=function(){Ne!==2&&Ne!==9||qe!==e||(Ne=7),Jt(e)},a.then(t,t);break e;case 3:Ne=7;break e;case 4:Ne=5;break e;case 7:su(a)?(Ne=0,Rt=null,Xh(t)):(Ne=0,Rt=null,Xs(e,t,a,7));break;case 5:var y=null;switch(xe.tag){case 26:y=xe.memoizedState;case 5:case 27:var L=xe;if(y?Bf(y):L.stateNode.complete){Ne=0,Rt=null;var q=L.sibling;if(q!==null)xe=q;else{var se=L.return;se!==null?(xe=se,Kn(se)):xe=null}break t}}Ne=0,Rt=null,Xs(e,t,a,5);break;case 6:Ne=0,Rt=null,Xs(e,t,a,6);break;case 8:Zl(),Ge=6;break e;default:throw Error(M(462))}}V_();break}catch(ue){Wh(e,ue)}while(!0);return ni=is=null,F.H=s,F.A=r,Be=i,xe!==null?0:(qe=null,Re=0,un(),Ge)}function V_(){for(;xe!==null&&!gi();)Gh(xe)}function Gh(e){var t=mh(e.alternate,e,vi);e.memoizedProps=e.pendingProps,t===null?Kn(e):xe=t}function Xh(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=hh(i,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=hh(i,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:dl(t);default:Sh(i,t),t=xe=Yc(t,vi),t=mh(i,t,vi)}e.memoizedProps=e.pendingProps,t===null?Kn(e):xe=t}function Xs(e,t,i,s){ni=is=null,dl(t),js=null,mr=0;var r=t.return;try{if(z_(e,r,t,i,Re)){Ge=1,Mn(e,Nt(i,e.current)),xe=null;return}}catch(a){if(r!==null)throw xe=r,a;Ge=1,Mn(e,Nt(i,e.current)),xe=null;return}t.flags&32768?(ke||s===1?e=!0:Fs||(Re&536870912)!==0?e=!1:(Oi=e=!0,(s===2||s===9||s===3||s===6)&&(s=At.current,s!==null&&s.tag===13&&(s.flags|=16384))),$h(t,e)):Kn(t)}function Kn(e){var t=e;do{if((t.flags&32768)!==0){$h(t,Oi);return}e=t.return;var i=I_(t.alternate,t,vi);if(i!==null){xe=i;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);Ge===0&&(Ge=5)}function $h(e,t){do{var i=P_(e.alternate,e);if(i!==null){i.flags&=32767,xe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){xe=e;return}xe=e=i}while(e!==null);Ge=6,xe=null}function Vh(e,t,i,s,r,a,y,L,q){e.cancelPendingCommit=null;do Yn();while(it!==0);if((Be&6)!==0)throw Error(M(327));if(t!==null){if(t===e.current)throw Error(M(177));if(a=t.lanes|t.childLanes,a|=qa,Td(e,i,a,y,L,q),e===qe&&(xe=qe=null,Re=0),Ys=t,Hi=e,pi=i,Xl=a,$l=r,Uh=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ev(bt,function(){return tf(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=F.T,F.T=null,r=K.p,K.p=2,y=Be,Be|=4;try{W_(e,t,i)}finally{Be=y,K.p=r,F.T=s}}it=1,Zh(),Qh(),Jh()}}function Zh(){if(it===1){it=0;var e=Hi,t=Ys,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=F.T,F.T=null;var s=K.p;K.p=2;var r=Be;Be|=4;try{Lh(t,e);var a=uo,y=jc(e.containerInfo),L=a.focusedElem,q=a.selectionRange;if(y!==L&&L&&L.ownerDocument&&Hc(L.ownerDocument.documentElement,L)){if(q!==null&&Na(L)){var se=q.start,ue=q.end;if(ue===void 0&&(ue=se),"selectionStart"in L)L.selectionStart=se,L.selectionEnd=Math.min(ue,L.value.length);else{var fe=L.ownerDocument||document,ne=fe&&fe.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),pe=L.textContent.length,Se=Math.min(q.start,pe),Ue=q.end===void 0?Se:Math.min(q.end,pe);!oe.extend&&Se>Ue&&(y=Ue,Ue=Se,Se=y);var X=Nc(L,Se),Y=Nc(L,Ue);if(X&&Y&&(oe.rangeCount!==1||oe.anchorNode!==X.node||oe.anchorOffset!==X.offset||oe.focusNode!==Y.node||oe.focusOffset!==Y.offset)){var ie=fe.createRange();ie.setStart(X.node,X.offset),oe.removeAllRanges(),Se>Ue?(oe.addRange(ie),oe.extend(Y.node,Y.offset)):(ie.setEnd(Y.node,Y.offset),oe.addRange(ie))}}}}for(fe=[],oe=L;oe=oe.parentNode;)oe.nodeType===1&&fe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<fe.length;L++){var he=fe[L];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}ra=!!co,uo=co=null}finally{Be=r,K.p=s,F.T=i}}e.current=t,it=2}}function Qh(){if(it===2){it=0;var e=Hi,t=Ys,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=F.T,F.T=null;var s=K.p;K.p=2;var r=Be;Be|=4;try{Ah(e,t.alternate,t)}finally{Be=r,K.p=s,F.T=i}}it=3}}function Jh(){if(it===4||it===3){it=0,dt();var e=Hi,t=Ys,i=pi,s=Uh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?it=5:(it=0,Ys=Hi=null,ef(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Ni=null),pa(i),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Gi,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=F.T,r=K.p,K.p=2,F.T=null;try{for(var a=e.onRecoverableError,y=0;y<s.length;y++){var L=s[y];a(L.value,{componentStack:L.stack})}}finally{F.T=t,K.p=r}}(pi&3)!==0&&Yn(),Jt(e),r=e.pendingLanes,(i&261930)!==0&&(r&42)!==0?e===Vl?Br++:(Br=0,Vl=e):Br=0,Nr(0)}}function ef(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vr(t)))}function Yn(){return Zh(),Qh(),Jh(),tf()}function tf(){if(it!==5)return!1;var e=Hi,t=Xl;Xl=0;var i=pa(pi),s=F.T,r=K.p;try{K.p=32>i?32:i,F.T=null,i=$l,$l=null;var a=Hi,y=pi;if(it=0,Ys=Hi=null,pi=0,(Be&6)!==0)throw Error(M(331));var L=Be;if(Be|=4,Hh(a.current),Oh(a,a.current,y,i),Be=L,Nr(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Gi,a)}catch{}return!0}finally{K.p=r,F.T=s,ef(e,t)}}function sf(e,t,i){t=Nt(i,t),t=Rl(e.stateNode,t,2),e=Ti(e,t,2),e!==null&&(tr(e,2),Jt(e))}function He(e,t,i){if(e.tag===3)sf(e,e,i);else for(;t!==null;){if(t.tag===3){sf(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ni===null||!Ni.has(s))){e=Nt(i,e),i=sh(2),s=Ti(t,i,2),s!==null&&(rh(i,s,t,e),tr(s,2),Jt(s));break}}t=t.return}}function Jl(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Y_;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(Kl=!0,r.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,qe===e&&(Re&i)===i&&(Ge===4||Ge===3&&(Re&62914560)===Re&&300>tt()-qn?(Be&2)===0&&Gs(e,0):Yl|=i,Ks===Re&&(Ks=0)),Jt(e)}function rf(e,t){t===0&&(t=Zo()),e=Ji(e,t),e!==null&&(tr(e,t),Jt(e))}function Q_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),rf(e,i)}function J_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(M(314))}s!==null&&s.delete(t),rf(e,i)}function ev(e,t){return $t(e,t)}var Gn=null,$s=null,eo=!1,Xn=!1,to=!1,zi=0;function Jt(e){e!==$s&&e.next===null&&($s===null?Gn=$s=e:$s=$s.next=e),Xn=!0,eo||(eo=!0,iv())}function Nr(e,t){if(!to&&Xn){to=!0;do for(var i=!1,s=Gn;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var a=0;else{var y=s.suspendedLanes,L=s.pingedLanes;a=(1<<31-wt(42|e)+1)-1,a&=r&~(y&~L),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(i=!0,of(s,a))}else a=Re,a=Zr(s,s===qe?a:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(a&3)===0||er(s,a)||(i=!0,of(s,a));s=s.next}while(i);to=!1}}function tv(){nf()}function nf(){Xn=eo=!1;var e=0;zi!==0&&fv()&&(e=zi);for(var t=tt(),i=null,s=Gn;s!==null;){var r=s.next,a=af(s,t);a===0?(s.next=null,i===null?Gn=r:i.next=r,r===null&&($s=i)):(i=s,(e!==0||(a&3)!==0)&&(Xn=!0)),s=r}it!==0&&it!==5||Nr(e),zi!==0&&(zi=0)}function af(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var y=31-wt(a),L=1<<y,q=r[y];q===-1?((L&i)===0||(L&s)!==0)&&(r[y]=Rd(L,t)):q<=t&&(e.expiredLanes|=L),a&=~L}if(t=qe,i=Re,i=Zr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ft(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||er(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Ft(s),pa(i)){case 2:case 8:i=_s;break;case 32:i=bt;break;case 268435456:i=Kt;break;default:i=bt}return s=lf.bind(null,e),i=$t(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Ft(s),e.callbackPriority=2,e.callbackNode=null,2}function lf(e,t){if(it!==0&&it!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Yn()&&e.callbackNode!==i)return null;var s=Re;return s=Zr(e,e===qe?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ih(e,s,t),af(e,tt()),e.callbackNode!=null&&e.callbackNode===i?lf.bind(null,e):null)}function of(e,t){if(Yn())return null;Ih(e,t,!0)}function iv(){_v(function(){(Be&6)!==0?$t(Si,tv):nf()})}function io(){if(zi===0){var e=Bs;e===0&&(e=Xr,Xr<<=1,(Xr&261888)===0&&(Xr=256)),zi=e}return zi}function cf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:tn(""+e)}function uf(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 sv(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var a=cf((r[_t]||null).action),y=s.submitter;y&&(t=(t=y[_t]||null)?cf(t.formAction):y.getAttribute("formAction"),t!==null&&(a=t,y=null));var L=new an("action","action",null,s,r);e.push({event:L,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(zi!==0){var q=y?uf(r,y):new FormData(r);Cl(i,{pending:!0,data:q,method:r.method,action:a},null,q)}}else typeof a=="function"&&(L.preventDefault(),q=y?uf(r,y):new FormData(r),Cl(i,{pending:!0,data:q,method:r.method,action:a},a,q))},currentTarget:r}]})}}for(var so=0;so<Ua.length;so++){var ro=Ua[so],rv=ro.toLowerCase(),nv=ro[0].toUpperCase()+ro.slice(1);Yt(rv,"on"+nv)}Yt(qc,"onAnimationEnd"),Yt(Ic,"onAnimationIteration"),Yt(Pc,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(b_,"onTransitionRun"),Yt(C_,"onTransitionStart"),Yt(w_,"onTransitionCancel"),Yt(Wc,"onTransitionEnd"),ys("onMouseEnter",["mouseout","mouseover"]),ys("onMouseLeave",["mouseout","mouseover"]),ys("onPointerEnter",["pointerout","pointerover"]),ys("onPointerLeave",["pointerout","pointerover"]),$i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$i("onBeforeInput",["compositionend","keypress","textInput","paste"]),$i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hr="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(" "),av=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hr));function hf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var y=s.length-1;0<=y;y--){var L=s[y],q=L.instance,se=L.currentTarget;if(L=L.listener,q!==a&&r.isPropagationStopped())break e;a=L,r.currentTarget=se;try{a(r)}catch(ue){cn(ue)}r.currentTarget=null,a=q}else for(y=0;y<s.length;y++){if(L=s[y],q=L.instance,se=L.currentTarget,L=L.listener,q!==a&&r.isPropagationStopped())break e;a=L,r.currentTarget=se;try{a(r)}catch(ue){cn(ue)}r.currentTarget=null,a=q}}}}function Ae(e,t){var i=t[ma];i===void 0&&(i=t[ma]=new Set);var s=e+"__bubble";i.has(s)||(ff(t,e,2,!1),i.add(s))}function no(e,t,i){var s=0;t&&(s|=4),ff(i,e,s,t)}var $n="_reactListening"+Math.random().toString(36).slice(2);function ao(e){if(!e[$n]){e[$n]=!0,rc.forEach(function(i){i!=="selectionchange"&&(av.has(i)||no(i,!1,e),no(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$n]||(t[$n]=!0,no("selectionchange",!1,t))}}function ff(e,t,i,s){switch(If(t)){case 2:var r=Bv;break;case 8:r=Nv;break;default:r=Co}i=r.bind(null,t,i,e),r=void 0,!Aa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function lo(e,t,i,s,r){var a=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var y=s.tag;if(y===3||y===4){var L=s.stateNode.containerInfo;if(L===r)break;if(y===4)for(y=s.return;y!==null;){var q=y.tag;if((q===3||q===4)&&y.stateNode.containerInfo===r)return;y=y.return}for(;L!==null;){if(y=ms(L),y===null)return;if(q=y.tag,q===5||q===6||q===26||q===27){s=a=y;continue e}L=L.parentNode}}s=s.return}pc(function(){var se=a,ue=Ea(i),fe=[];e:{var ne=Fc.get(e);if(ne!==void 0){var oe=an,pe=e;switch(e){case"keypress":if(rn(i)===0)break e;case"keydown":case"keyup":oe=Jd;break;case"focusin":pe="focus",oe=ka;break;case"focusout":pe="blur",oe=ka;break;case"beforeblur":case"afterblur":oe=ka;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":oe=Sc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Id;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=i_;break;case qc:case Ic:case Pc:oe=Fd;break;case Wc:oe=r_;break;case"scroll":case"scrollend":oe=Ud;break;case"wheel":oe=a_;break;case"copy":case"cut":case"paste":oe=Yd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=bc;break;case"toggle":case"beforetoggle":oe=o_}var Se=(t&4)!==0,Ue=!Se&&(e==="scroll"||e==="scrollend"),X=Se?ne!==null?ne+"Capture":null:ne;Se=[];for(var Y=se,ie;Y!==null;){var he=Y;if(ie=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ie===null||X===null||(he=rr(Y,X),he!=null&&Se.push(jr(Y,he,ie))),Ue)break;Y=Y.return}0<Se.length&&(ne=new oe(ne,pe,null,i,ue),fe.push({event:ne,listeners:Se}))}}if((t&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",ne&&i!==wa&&(pe=i.relatedTarget||i.fromElement)&&(ms(pe)||pe[ps]))break e;if((oe||ne)&&(ne=ue.window===ue?ue:(ne=ue.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(pe=i.relatedTarget||i.toElement,oe=se,pe=pe?ms(pe):null,pe!==null&&(Ue=Q(pe),Se=pe.tag,pe!==Ue||Se!==5&&Se!==27&&Se!==6)&&(pe=null)):(oe=null,pe=se),oe!==pe)){if(Se=Sc,he="onMouseLeave",X="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(Se=bc,he="onPointerLeave",X="onPointerEnter",Y="pointer"),Ue=oe==null?ne:sr(oe),ie=pe==null?ne:sr(pe),ne=new Se(he,Y+"leave",oe,i,ue),ne.target=Ue,ne.relatedTarget=ie,he=null,ms(ue)===se&&(Se=new Se(X,Y+"enter",pe,i,ue),Se.target=ie,Se.relatedTarget=Ue,he=Se),Ue=he,oe&&pe)t:{for(Se=lv,X=oe,Y=pe,ie=0,he=X;he;he=Se(he))ie++;he=0;for(var ge=Y;ge;ge=Se(ge))he++;for(;0<ie-he;)X=Se(X),ie--;for(;0<he-ie;)Y=Se(Y),he--;for(;ie--;){if(X===Y||Y!==null&&X===Y.alternate){Se=X;break t}X=Se(X),Y=Se(Y)}Se=null}else Se=null;oe!==null&&df(fe,ne,oe,Se,!1),pe!==null&&Ue!==null&&df(fe,Ue,pe,Se,!0)}}e:{if(ne=se?sr(se):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var Me=Tc;else if(Dc(ne))if(kc)Me=g_;else{Me=p_;var me=v_}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?se&&Ca(se.elementType)&&(Me=Tc):Me=m_;if(Me&&(Me=Me(e,se))){Rc(fe,Me,i,ue);break e}me&&me(e,ne,se),e==="focusout"&&se&&ne.type==="number"&&se.memoizedProps.value!=null&&ba(ne,"number",ne.value)}switch(me=se?sr(se):window,e){case"focusin":(Dc(me)||me.contentEditable==="true")&&(As=me,Ha=se,fr=null);break;case"focusout":fr=Ha=As=null;break;case"mousedown":ja=!0;break;case"contextmenu":case"mouseup":case"dragend":ja=!1,zc(fe,i,ue);break;case"selectionchange":if(y_)break;case"keydown":case"keyup":zc(fe,i,ue)}var we;if(Ma)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else xs?xc(e,i)&&(Te="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Te="onCompositionStart");Te&&(Cc&&i.locale!=="ko"&&(xs||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&xs&&(we=mc()):(Ci=ue,Da="value"in Ci?Ci.value:Ci.textContent,xs=!0)),me=Vn(se,Te),0<me.length&&(Te=new yc(Te,e,null,i,ue),fe.push({event:Te,listeners:me}),we?Te.data=we:(we=Ac(i),we!==null&&(Te.data=we)))),(we=u_?h_(e,i):f_(e,i))&&(Te=Vn(se,"onBeforeInput"),0<Te.length&&(me=new yc("onBeforeInput","beforeinput",null,i,ue),fe.push({event:me,listeners:Te}),me.data=we)),sv(fe,e,se,i,ue)}hf(fe,t)})}function jr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Vn(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=rr(e,i),r!=null&&s.unshift(jr(e,r,a)),r=rr(e,t),r!=null&&s.push(jr(e,r,a))),e.tag===3)return s;e=e.return}return[]}function lv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function df(e,t,i,s,r){for(var a=t._reactName,y=[];i!==null&&i!==s;){var L=i,q=L.alternate,se=L.stateNode;if(L=L.tag,q!==null&&q===s)break;L!==5&&L!==26&&L!==27||se===null||(q=se,r?(se=rr(i,a),se!=null&&y.unshift(jr(i,se,q))):r||(se=rr(i,a),se!=null&&y.push(jr(i,se,q)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var ov=/\r\n?/g,cv=/\u0000|\uFFFD/g;function _f(e){return(typeof e=="string"?e:""+e).replace(ov,`
49
- `).replace(cv,"")}function vf(e,t){return t=_f(t),_f(e)===t}function ze(e,t,i,s,r,a){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Cs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Cs(e,""+s);break;case"className":Jr(e,"class",s);break;case"tabIndex":Jr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Jr(e,i,s);break;case"style":_c(e,s,a);break;case"data":if(t!=="object"){Jr(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=tn(""+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 a=="function"&&(i==="formAction"?(t!=="input"&&ze(e,t,"name",r.name,r,null),ze(e,t,"formEncType",r.formEncType,r,null),ze(e,t,"formMethod",r.formMethod,r,null),ze(e,t,"formTarget",r.formTarget,r,null)):(ze(e,t,"encType",r.encType,r,null),ze(e,t,"method",r.method,r,null),ze(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=tn(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=ti);break;case"onScroll":s!=null&&Ae("scroll",e);break;case"onScrollEnd":s!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(M(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=tn(""+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":Ae("beforetoggle",e),Ae("toggle",e),Qr(e,"popover",s);break;case"xlinkActuate":ei(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ei(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ei(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ei(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ei(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ei(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ei(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ei(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ei(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Qr(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=jd.get(i)||i,Qr(e,i,s))}}function oo(e,t,i,s,r,a){switch(i){case"style":_c(e,s,a);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(M(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Cs(e,s):(typeof s=="number"||typeof s=="bigint")&&Cs(e,""+s);break;case"onScroll":s!=null&&Ae("scroll",e);break;case"onScrollEnd":s!=null&&Ae("scrollend",e);break;case"onClick":s!=null&&(e.onclick=ti);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nc.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),t=i.slice(2,r?i.length-7:void 0),a=e[_t]||null,a=a!=null?a[i]:null,typeof a=="function"&&e.removeEventListener(t,a,r),typeof s=="function")){typeof a!="function"&&a!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,r);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Qr(e,i,s)}}}function ct(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var s=!1,r=!1,a;for(a in i)if(i.hasOwnProperty(a)){var y=i[a];if(y!=null)switch(a){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:ze(e,t,a,y,i,null)}}r&&ze(e,t,"srcSet",i.srcSet,i,null),s&&ze(e,t,"src",i.src,i,null);return;case"input":Ae("invalid",e);var L=a=y=r=null,q=null,se=null;for(s in i)if(i.hasOwnProperty(s)){var ue=i[s];if(ue!=null)switch(s){case"name":r=ue;break;case"type":y=ue;break;case"checked":q=ue;break;case"defaultChecked":se=ue;break;case"value":a=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(M(137,t));break;default:ze(e,t,s,ue,i,null)}}uc(e,a,L,q,se,y,r,!1);return;case"select":Ae("invalid",e),s=y=a=null;for(r in i)if(i.hasOwnProperty(r)&&(L=i[r],L!=null))switch(r){case"value":a=L;break;case"defaultValue":y=L;break;case"multiple":s=L;default:ze(e,t,r,L,i,null)}t=a,i=y,e.multiple=!!s,t!=null?bs(e,!!s,t,!1):i!=null&&bs(e,!!s,i,!0);return;case"textarea":Ae("invalid",e),a=r=s=null;for(y in i)if(i.hasOwnProperty(y)&&(L=i[y],L!=null))switch(y){case"value":s=L;break;case"defaultValue":r=L;break;case"children":a=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(M(91));break;default:ze(e,t,y,L,i,null)}fc(e,s,r,a);return;case"option":for(q in i)if(i.hasOwnProperty(q)&&(s=i[q],s!=null))switch(q){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ze(e,t,q,s,i,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(s=0;s<Hr.length;s++)Ae(Hr[s],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("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(se in i)if(i.hasOwnProperty(se)&&(s=i[se],s!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:ze(e,t,se,s,i,null)}return;default:if(Ca(t)){for(ue in i)i.hasOwnProperty(ue)&&(s=i[ue],s!==void 0&&oo(e,t,ue,s,i,void 0));return}}for(L in i)i.hasOwnProperty(L)&&(s=i[L],s!=null&&ze(e,t,L,s,i,null))}function uv(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,y=null,L=null,q=null,se=null,ue=null;for(oe in i){var fe=i[oe];if(i.hasOwnProperty(oe)&&fe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":q=fe;default:s.hasOwnProperty(oe)||ze(e,t,oe,null,s,fe)}}for(var ne in s){var oe=s[ne];if(fe=i[ne],s.hasOwnProperty(ne)&&(oe!=null||fe!=null))switch(ne){case"type":a=oe;break;case"name":r=oe;break;case"checked":se=oe;break;case"defaultChecked":ue=oe;break;case"value":y=oe;break;case"defaultValue":L=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(M(137,t));break;default:oe!==fe&&ze(e,t,ne,oe,s,fe)}}ya(e,y,L,q,se,ue,a,r);return;case"select":oe=y=L=ne=null;for(a in i)if(q=i[a],i.hasOwnProperty(a)&&q!=null)switch(a){case"value":break;case"multiple":oe=q;default:s.hasOwnProperty(a)||ze(e,t,a,null,s,q)}for(r in s)if(a=s[r],q=i[r],s.hasOwnProperty(r)&&(a!=null||q!=null))switch(r){case"value":ne=a;break;case"defaultValue":L=a;break;case"multiple":y=a;default:a!==q&&ze(e,t,r,a,s,q)}t=L,i=y,s=oe,ne!=null?bs(e,!!i,ne,!1):!!s!=!!i&&(t!=null?bs(e,!!i,t,!0):bs(e,!!i,i?[]:"",!1));return;case"textarea":oe=ne=null;for(L in i)if(r=i[L],i.hasOwnProperty(L)&&r!=null&&!s.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:ze(e,t,L,null,s,r)}for(y in s)if(r=s[y],a=i[y],s.hasOwnProperty(y)&&(r!=null||a!=null))switch(y){case"value":ne=r;break;case"defaultValue":oe=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(M(91));break;default:r!==a&&ze(e,t,y,r,s,a)}hc(e,ne,oe);return;case"option":for(var pe in i)if(ne=i[pe],i.hasOwnProperty(pe)&&ne!=null&&!s.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:ze(e,t,pe,null,s,ne)}for(q in s)if(ne=s[q],oe=i[q],s.hasOwnProperty(q)&&ne!==oe&&(ne!=null||oe!=null))switch(q){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:ze(e,t,q,ne,s,oe)}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 Se in i)ne=i[Se],i.hasOwnProperty(Se)&&ne!=null&&!s.hasOwnProperty(Se)&&ze(e,t,Se,null,s,ne);for(se in s)if(ne=s[se],oe=i[se],s.hasOwnProperty(se)&&ne!==oe&&(ne!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(M(137,t));break;default:ze(e,t,se,ne,s,oe)}return;default:if(Ca(t)){for(var Ue in i)ne=i[Ue],i.hasOwnProperty(Ue)&&ne!==void 0&&!s.hasOwnProperty(Ue)&&oo(e,t,Ue,void 0,s,ne);for(ue in s)ne=s[ue],oe=i[ue],!s.hasOwnProperty(ue)||ne===oe||ne===void 0&&oe===void 0||oo(e,t,ue,ne,s,oe);return}}for(var X in i)ne=i[X],i.hasOwnProperty(X)&&ne!=null&&!s.hasOwnProperty(X)&&ze(e,t,X,null,s,ne);for(fe in s)ne=s[fe],oe=i[fe],!s.hasOwnProperty(fe)||ne===oe||ne==null&&oe==null||ze(e,t,fe,ne,s,oe)}function pf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],a=r.transferSize,y=r.initiatorType,L=r.duration;if(a&&L&&pf(y)){for(y=0,L=r.responseEnd,s+=1;s<i.length;s++){var q=i[s],se=q.startTime;if(se>L)break;var ue=q.transferSize,fe=q.initiatorType;ue&&pf(fe)&&(q=q.responseEnd,y+=ue*(q<L?1:(L-se)/(q-se)))}if(--s,t+=8*(a+y)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var co=null,uo=null;function Zn(e){return e.nodeType===9?e:e.ownerDocument}function mf(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 gf(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 ho(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 fo=null;function fv(){var e=window.event;return e&&e.type==="popstate"?e===fo?!1:(fo=e,!0):(fo=null,!1)}var Sf=typeof setTimeout=="function"?setTimeout:void 0,dv=typeof clearTimeout=="function"?clearTimeout:void 0,yf=typeof Promise=="function"?Promise:void 0,_v=typeof queueMicrotask=="function"?queueMicrotask:typeof yf<"u"?function(e){return yf.resolve(null).then(e).catch(vv)}:Sf;function vv(e){setTimeout(function(){throw e})}function Ui(e){return e==="head"}function bf(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),Js(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")zr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,zr(i);for(var a=i.firstChild;a;){var y=a.nextSibling,L=a.nodeName;a[ir]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&a.rel.toLowerCase()==="stylesheet"||i.removeChild(a),a=y}}else i==="body"&&zr(e.ownerDocument.body);i=r}while(i);Js(t)}function Cf(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 _o(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":_o(i),ga(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function pv(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ir])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=qt(e.nextSibling),e===null)break}return null}function mv(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 wf(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 vo(e){return e.data==="$?"||e.data==="$~"}function po(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gv(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 mo=null;function Ef(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 xf(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 Af(e,t,i){switch(t=Zn(i),e){case"html":if(e=t.documentElement,!e)throw Error(M(452));return e;case"head":if(e=t.head,!e)throw Error(M(453));return e;case"body":if(e=t.body,!e)throw Error(M(454));return e;default:throw Error(M(451))}}function zr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ga(e)}var It=new Map,Df=new Set;function Qn(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mi=K.d;K.d={f:Sv,r:yv,D:bv,C:Cv,L:wv,m:Ev,X:Av,S:xv,M:Dv};function Sv(){var e=mi.f(),t=Wn();return e||t}function yv(e){var t=gs(e);t!==null&&t.tag===5&&t.type==="form"?Wu(t):mi.r(e)}var Vs=typeof document>"u"?null:document;function Rf(e,t,i){var s=Vs;if(s&&typeof t=="string"&&t){var r=Ot(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),Df.has(r)||(Df.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),ct(t,"link",e),st(t),s.head.appendChild(t)))}}function bv(e){mi.D(e),Rf("dns-prefetch",e,null)}function Cv(e,t){mi.C(e,t),Rf("preconnect",e,t)}function wv(e,t,i){mi.L(e,t,i);var s=Vs;if(s&&e&&t){var r='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Ot(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Ot(i.imageSizes)+'"]')):r+='[href="'+Ot(e)+'"]';var a=r;switch(t){case"style":a=Zs(e);break;case"script":a=Qs(e)}It.has(a)||(e=h({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),It.set(a,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Ur(a))||t==="script"&&s.querySelector(qr(a))||(t=s.createElement("link"),ct(t,"link",e),st(t),s.head.appendChild(t)))}}function Ev(e,t){mi.m(e,t);var i=Vs;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ot(s)+'"][href="'+Ot(e)+'"]',a=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Qs(e)}if(!It.has(a)&&(e=h({rel:"modulepreload",href:e},t),It.set(a,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(qr(a)))return}s=i.createElement("link"),ct(s,"link",e),st(s),i.head.appendChild(s)}}}function xv(e,t,i){mi.S(e,t,i);var s=Vs;if(s&&e){var r=Ss(s).hoistableStyles,a=Zs(e);t=t||"default";var y=r.get(a);if(!y){var L={loading:0,preload:null};if(y=s.querySelector(Ur(a)))L.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":t},i),(i=It.get(a))&&go(e,i);var q=y=s.createElement("link");st(q),ct(q,"link",e),q._p=new Promise(function(se,ue){q.onload=se,q.onerror=ue}),q.addEventListener("load",function(){L.loading|=1}),q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Jn(y,t,s)}y={type:"stylesheet",instance:y,count:1,state:L},r.set(a,y)}}}function Av(e,t){mi.X(e,t);var i=Vs;if(i&&e){var s=Ss(i).hoistableScripts,r=Qs(e),a=s.get(r);a||(a=i.querySelector(qr(r)),a||(e=h({src:e,async:!0},t),(t=It.get(r))&&So(e,t),a=i.createElement("script"),st(a),ct(a,"link",e),i.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},s.set(r,a))}}function Dv(e,t){mi.M(e,t);var i=Vs;if(i&&e){var s=Ss(i).hoistableScripts,r=Qs(e),a=s.get(r);a||(a=i.querySelector(qr(r)),a||(e=h({src:e,async:!0,type:"module"},t),(t=It.get(r))&&So(e,t),a=i.createElement("script"),st(a),ct(a,"link",e),i.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},s.set(r,a))}}function Tf(e,t,i,s){var r=(r=V.current)?Qn(r):null;if(!r)throw Error(M(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Zs(i.href),i=Ss(r).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=Zs(i.href);var a=Ss(r).hoistableStyles,y=a.get(e);if(y||(r=r.ownerDocument||r,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,y),(a=r.querySelector(Ur(e)))&&!a._p&&(y.instance=a,y.state.loading=5),It.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},It.set(e,i),a||Rv(r,e,i,y.state))),t&&s===null)throw Error(M(528,""));return y}if(t&&s!==null)throw Error(M(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qs(i),i=Ss(r).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(M(444,e))}}function Zs(e){return'href="'+Ot(e)+'"'}function Ur(e){return'link[rel="stylesheet"]['+e+"]"}function kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Rv(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}),ct(t,"link",i),st(t),e.head.appendChild(t))}function Qs(e){return'[src="'+Ot(e)+'"]'}function qr(e){return"script[async]"+e}function Lf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ot(i.href)+'"]');if(s)return t.instance=s,st(s),s;var r=h({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),st(s),ct(s,"style",r),Jn(s,i.precedence,e),t.instance=s;case"stylesheet":r=Zs(i.href);var a=e.querySelector(Ur(r));if(a)return t.state.loading|=4,t.instance=a,st(a),a;s=kf(i),(r=It.get(r))&&go(s,r),a=(e.ownerDocument||e).createElement("link"),st(a);var y=a;return y._p=new Promise(function(L,q){y.onload=L,y.onerror=q}),ct(a,"link",s),t.state.loading|=4,Jn(a,i.precedence,e),t.instance=a;case"script":return a=Qs(i.src),(r=e.querySelector(qr(a)))?(t.instance=r,st(r),r):(s=i,(r=It.get(a))&&(s=h({},i),So(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),st(r),ct(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(M(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Jn(s,i.precedence,e));return t.instance}function Jn(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,a=r,y=0;y<s.length;y++){var L=s[y];if(L.dataset.precedence===t)a=L;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function go(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function So(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ea=null;function Mf(e,t,i){if(ea===null){var s=new Map,r=ea=new Map;r.set(i,s)}else r=ea,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var a=i[r];if(!(a[ir]||a[nt]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var y=a.getAttribute(t)||"";y=e+y;var L=s.get(y);L?L.push(a):s.set(y,[a])}}return s}function Of(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Tv(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 Bf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kv(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=Zs(s.href),a=t.querySelector(Ur(r));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ta.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=a,st(a);return}a=t.ownerDocument||t,s=kf(s),(r=It.get(r))&&go(s,r),a=a.createElement("link"),st(a);var y=a;y._p=new Promise(function(L,q){y.onload=L,y.onerror=q}),ct(a,"link",s),i.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ta.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var yo=0;function Lv(e,t){return e.stylesheets&&e.count===0&&sa(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&sa(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&yo===0&&(yo=62500*hv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sa(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>yo?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function ta(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sa(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ia=null;function sa(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ia=new Map,t.forEach(Mv,e),ia=null,ta.call(e))}function Mv(e,t){if(!(t.state.loading&4)){var i=ia.get(e);if(i)var s=i.get(null);else{i=new Map,ia.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var y=r[a];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(i.set(y.dataset.precedence,y),s=y)}s&&i.set(null,s)}r=t.instance,y=r.getAttribute("data-precedence"),a=i.get(y)||s,a===s&&i.set(null,r),i.set(y,r),this.count++,s=ta.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),a?a.parentNode.insertBefore(r,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Ir={$$typeof:o,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function Ov(e,t,i,s,r,a,y,L,q){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=_a(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_a(0),this.hiddenUpdates=_a(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function Nf(e,t,i,s,r,a,y,L,q,se,ue,fe){return e=new Ov(e,t,i,y,q,se,ue,fe,L),t=1,a===!0&&(t|=24),a=xt(3,null,null,t),e.current=a,a.stateNode=e,t=Qa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:s,isDehydrated:i,cache:t},il(a),e}function Hf(e){return e?(e=Ts,e):Ts}function jf(e,t,i,s,r,a){r=Hf(r),s.context===null?s.context=r:s.pendingContext=r,s=Ri(t),s.payload={element:i},a=a===void 0?null:a,a!==null&&(s.callback=a),i=Ti(e,s,t),i!==null&&(yt(i,e,t),Sr(i,e,t))}function zf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function bo(e,t){zf(e,t),(e=e.alternate)&&zf(e,t)}function Uf(e){if(e.tag===13||e.tag===31){var t=Ji(e,67108864);t!==null&&yt(t,e,67108864),bo(e,67108864)}}function qf(e){if(e.tag===13||e.tag===31){var t=kt();t=va(t);var i=Ji(e,t);i!==null&&yt(i,e,t),bo(e,t)}}var ra=!0;function Bv(e,t,i,s){var r=F.T;F.T=null;var a=K.p;try{K.p=2,Co(e,t,i,s)}finally{K.p=a,F.T=r}}function Nv(e,t,i,s){var r=F.T;F.T=null;var a=K.p;try{K.p=8,Co(e,t,i,s)}finally{K.p=a,F.T=r}}function Co(e,t,i,s){if(ra){var r=wo(s);if(r===null)lo(e,t,s,na,i),Pf(e,s);else if(jv(r,e,t,i,s))s.stopPropagation();else if(Pf(e,s),t&4&&-1<Hv.indexOf(e)){for(;r!==null;){var a=gs(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var y=Xi(a.pendingLanes);if(y!==0){var L=a;for(L.pendingLanes|=2,L.entangledLanes|=2;y;){var q=1<<31-wt(y);L.entanglements[1]|=q,y&=~q}Jt(a),(Be&6)===0&&(In=tt()+500,Nr(0))}}break;case 31:case 13:L=Ji(a,2),L!==null&&yt(L,a,2),Wn(),bo(a,2)}if(a=wo(s),a===null&&lo(e,t,s,na,i),a===r)break;r=a}r!==null&&s.stopPropagation()}else lo(e,t,s,null,i)}}function wo(e){return e=Ea(e),Eo(e)}var na=null;function Eo(e){if(na=null,e=ms(e),e!==null){var t=Q(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=P(t),e!==null)return e;e=null}else if(i===31){if(e=u(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 na=e,null}function If(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(Lt()){case Si:return 2;case _s:return 8;case bt:case vs:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var xo=!1,qi=null,Ii=null,Pi=null,Pr=new Map,Wr=new Map,Wi=[],Hv="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 Pf(e,t){switch(e){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Ii=null;break;case"mouseover":case"mouseout":Pi=null;break;case"pointerover":case"pointerout":Pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wr.delete(t.pointerId)}}function Fr(e,t,i,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=gs(t),t!==null&&Uf(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function jv(e,t,i,s,r){switch(t){case"focusin":return qi=Fr(qi,e,t,i,s,r),!0;case"dragenter":return Ii=Fr(Ii,e,t,i,s,r),!0;case"mouseover":return Pi=Fr(Pi,e,t,i,s,r),!0;case"pointerover":var a=r.pointerId;return Pr.set(a,Fr(Pr.get(a)||null,e,t,i,s,r)),!0;case"gotpointercapture":return a=r.pointerId,Wr.set(a,Fr(Wr.get(a)||null,e,t,i,s,r)),!0}return!1}function Wf(e){var t=ms(e.target);if(t!==null){var i=Q(t);if(i!==null){if(t=i.tag,t===13){if(t=P(i),t!==null){e.blockedOn=t,ic(e.priority,function(){qf(i)});return}}else if(t===31){if(t=u(i),t!==null){e.blockedOn=t,ic(e.priority,function(){qf(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 aa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wo(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);wa=s,i.target.dispatchEvent(s),wa=null}else return t=gs(i),t!==null&&Uf(t),e.blockedOn=i,!1;t.shift()}return!0}function Ff(e,t,i){aa(e)&&i.delete(t)}function zv(){xo=!1,qi!==null&&aa(qi)&&(qi=null),Ii!==null&&aa(Ii)&&(Ii=null),Pi!==null&&aa(Pi)&&(Pi=null),Pr.forEach(Ff),Wr.forEach(Ff)}function la(e,t){e.blockedOn===t&&(e.blockedOn=null,xo||(xo=!0,x.unstable_scheduleCallback(x.unstable_NormalPriority,zv)))}var oa=null;function Kf(e){oa!==e&&(oa=e,x.unstable_scheduleCallback(x.unstable_NormalPriority,function(){oa===e&&(oa=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Eo(s||i)===null)continue;break}var a=gs(i);a!==null&&(e.splice(t,3),t-=3,Cl(a,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function Js(e){function t(q){return la(q,e)}qi!==null&&la(qi,e),Ii!==null&&la(Ii,e),Pi!==null&&la(Pi,e),Pr.forEach(t),Wr.forEach(t);for(var i=0;i<Wi.length;i++){var s=Wi[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Wi.length&&(i=Wi[0],i.blockedOn===null);)Wf(i),i.blockedOn===null&&Wi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],a=i[s+1],y=r[_t]||null;if(typeof a=="function")y||Kf(i);else if(y){var L=null;if(a&&a.hasAttribute("formAction")){if(r=a,y=a[_t]||null)L=y.formAction;else if(Eo(r)!==null)continue}else L=y.action;typeof L=="function"?i[s+1]=L:(i.splice(s,3),s-=3),Kf(i)}}}function Yf(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(y){return r=y})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Ao(e){this._internalRoot=e}ca.prototype.render=Ao.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));var i=t.current,s=kt();jf(i,s,e,t,null,null)},ca.prototype.unmount=Ao.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jf(e.current,2,null,e,null,null),Wn(),t[ps]=null}};function ca(e){this._internalRoot=e}ca.prototype.unstable_scheduleHydration=function(e){if(e){var t=tc();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Wi.length&&t!==0&&t<Wi[i].priority;i++);Wi.splice(i,0,e),i===0&&Wf(e)}};var Gf=H.version;if(Gf!=="19.2.7")throw Error(M(527,Gf,"19.2.7"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=d(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Uv={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ua=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ua.isDisabled&&ua.supportsFiber)try{Gi=ua.inject(Uv),Ct=ua}catch{}}return Yr.createRoot=function(e,t){if(!$(e))throw Error(M(299));var i=!1,s="",r=Ju,a=eh,y=th;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=Nf(e,1,!1,null,null,i,s,null,r,a,y,Yf),e[ps]=t.current,ao(e),new Ao(t)},Yr.hydrateRoot=function(e,t,i){if(!$(e))throw Error(M(299));var s=!1,r="",a=Ju,y=eh,L=th,q=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(a=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(L=i.onRecoverableError),i.formState!==void 0&&(q=i.formState)),t=Nf(e,1,!0,t,i??null,s,r,q,a,y,L,Yf),t.context=Hf(null),i=t.current,s=kt(),s=va(s),r=Ri(s),r.callback=null,Ti(i,r,s),i=s,t.current.lanes=i,tr(t,i),Jt(t),e[ps]=t.current,ao(e),new ca(t)},Yr.version="19.2.7",Yr}var sd;function Zv(){if(sd)return ko.exports;sd=1;function x(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x)}catch(H){console.error(H)}}return x(),ko.exports=Vv(),ko.exports}var Qv=Zv();const Jv="data:image/svg+xml,%3csvg%20width='115'%20height='122'%20viewBox='0%200%20115%20122'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M105.267%2060.7219L98.8902%2071.7648L92.1353%2083.4669L83.3114%2098.7521L70.18%20121.491H0L13.1249%2098.7521H57.042L72.6274%2071.7648L79.0038%2060.7219L72.2619%2049.0459H98.5247L105.267%2060.7219Z'%20fill='%236BE195'/%3e%3cpath%20d='M114.072%200L100.954%2022.7189H57.0694L57.0498%2022.6928L57.0368%2022.7189L41.8365%2049.047L35.0945%2060.723L41.471%2071.7659H15.2016L8.8252%2060.723L15.5671%2049.047L21.9631%2037.978L30.774%2022.7189L43.8923%200H114.072Z'%20fill='%236BE195'/%3e%3c/svg%3e",_d="sapiom-harness-theme",qo=new Set;function ep(){var x;return typeof window<"u"&&((x=window.matchMedia)==null?void 0:x.call(window,"(prefers-color-scheme: dark)").matches)===!0}function tp(){const x=typeof window<"u"?window.localStorage.getItem(_d):null;return x==="light"||x==="dark"?x:ep()?"dark":"light"}let Yo=tp();function ha(){return Yo}function ip(x){Yo=x,document.documentElement.dataset.theme=x,window.localStorage.setItem(_d,x),qo.forEach(H=>H(x))}function sp(){ip(Yo==="dark"?"light":"dark")}function Go(x){return qo.add(x),()=>qo.delete(x)}/**
50
- * @license lucide-react v1.23.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const vd=(...x)=>x.filter((H,I,M)=>!!H&&H.trim()!==""&&M.indexOf(H)===I).join(" ").trim();/**
55
- * @license lucide-react v1.23.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */const rp=x=>x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
60
- * @license lucide-react v1.23.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const np=x=>x.replace(/^([A-Z])|[\s-_]+(\w)/g,(H,I,M)=>M?M.toUpperCase():I.toLowerCase());/**
65
- * @license lucide-react v1.23.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const rd=x=>{const H=np(x);return H.charAt(0).toUpperCase()+H.slice(1)};/**
70
- * @license lucide-react v1.23.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */var Bo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
75
- * @license lucide-react v1.23.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const ap=x=>{for(const H in x)if(H.startsWith("aria-")||H==="role"||H==="title")return!0;return!1},lp=ee.createContext({}),op=()=>ee.useContext(lp),cp=ee.forwardRef(({color:x,size:H,strokeWidth:I,absoluteStrokeWidth:M,className:$="",children:Q,iconNode:P,...u},f)=>{const{size:d=24,strokeWidth:g=2,absoluteStrokeWidth:h=!1,color:p="currentColor",className:S=""}=op()??{},E=M??h?Number(I??g)*24/Number(H??d):I??g;return ee.createElement("svg",{ref:f,...Bo,width:H??d??Bo.width,height:H??d??Bo.height,stroke:x??p,strokeWidth:E,className:vd("lucide",S,$),...!Q&&!ap(u)&&{"aria-hidden":"true"},...u},[...P.map(([v,l])=>ee.createElement(v,l)),...Array.isArray(Q)?Q:[Q]])});/**
80
- * @license lucide-react v1.23.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */const Ke=(x,H)=>{const I=ee.forwardRef(({className:M,...$},Q)=>ee.createElement(cp,{ref:Q,iconNode:H,className:vd(`lucide-${rp(rd(x))}`,`lucide-${x}`,M),...$}));return I.displayName=rd(x),I};/**
85
- * @license lucide-react v1.23.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */const up=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],hp=Ke("arrow-left",up);/**
90
- * @license lucide-react v1.23.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const fp=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dp=Ke("chevron-down",fp);/**
95
- * @license lucide-react v1.23.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */const _p=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vp=Ke("circle-question-mark",_p);/**
100
- * @license lucide-react v1.23.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const pp=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],mp=Ke("cloud",pp);/**
105
- * @license lucide-react v1.23.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const gp=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],Sp=Ke("corner-left-up",gp);/**
110
- * @license lucide-react v1.23.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const yp=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],bp=Ke("external-link",yp);/**
115
- * @license lucide-react v1.23.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const Cp=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],wp=Ke("folder",Cp);/**
120
- * @license lucide-react v1.23.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const Ep=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],xp=Ke("history",Ep);/**
125
- * @license lucide-react v1.23.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const Ap=[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Dp=Ke("image-up",Ap);/**
130
- * @license lucide-react v1.23.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const Rp=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Tp=Ke("moon",Rp);/**
135
- * @license lucide-react v1.23.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const kp=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Lp=Ke("paperclip",kp);/**
140
- * @license lucide-react v1.23.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const Mp=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Op=Ke("play",Mp);/**
145
- * @license lucide-react v1.23.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const Bp=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Np=Ke("plug",Bp);/**
150
- * @license lucide-react v1.23.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const Hp=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jp=Ke("plus",Hp);/**
155
- * @license lucide-react v1.23.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const zp=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Up=Ke("radio",zp);/**
160
- * @license lucide-react v1.23.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const qp=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ip=Ke("refresh-cw",qp);/**
165
- * @license lucide-react v1.23.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const Pp=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wp=Ke("search",Pp);/**
170
- * @license lucide-react v1.23.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const Fp=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Kp=Ke("settings",Fp);/**
175
- * @license lucide-react v1.23.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const Yp=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Gp=Ke("sparkles",Yp);/**
180
- * @license lucide-react v1.23.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const Xp=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],$p=Ke("sun",Xp);/**
185
- * @license lucide-react v1.23.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const Vp=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Zp=Ke("triangle-alert",Vp);/**
190
- * @license lucide-react v1.23.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const Qp=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Jp=Ke("wand-sparkles",Qp);/**
195
- * @license lucide-react v1.23.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const em=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tm=Ke("x",em);/**
200
- * @license lucide-react v1.23.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const im=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sm=Ke("zap",im),rm={ArrowLeft:hp,ChevronDown:dp,Cloud:mp,CornerLeftUp:Sp,ExternalLink:bp,Folder:wp,History:xp,ImageUp:Dp,Moon:Tp,Paperclip:Lp,Play:Op,Plug:Np,Plus:jp,Radio:Up,RefreshCw:Ip,Search:Wp,Settings:Kp,Sparkles:Gp,Sun:$p,TriangleAlert:Zp,Wand2:Jp,X:tm,Zap:sm};function Ve({name:x,size:H=16}){const I=rm[x]??vp;return k.jsx(I,{size:H,strokeWidth:1.75,"aria-hidden":"true"})}const nm=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),am=nm?"⌘K":"Ctrl+K";function lm(x,H){return H==="env-forced-off"?"analytics off (env)":x?"analytics on":"analytics off"}function om(x,H,I){return H==="env-forced-off"?`Remote analytics disabled by ${I?`$${I}`:"environment variable"}. Click to open settings.`:x?"Remote analytics enabled. Click to open settings.":"Remote analytics disabled. Click to open settings."}function cm(x,H){return H==="env-forced-off"?"env":x?"on":"off"}function um({authenticated:x,organizationName:H,onOpenPalette:I,telemetryOptIn:M,consentSource:$,consentEnvReason:Q,onOpenSettings:P}){const[u,f]=ee.useState(ha());ee.useEffect(()=>Go(f),[]);const d=cm(M,$),g=lm(M,$),h=om(M,$,Q);return k.jsxs("header",{className:"brand-header",children:[k.jsxs("div",{className:"brand-lockup",children:[k.jsx("img",{src:Jv,alt:"",className:"brand-mark"}),k.jsx("span",{className:"brand-name",children:"Sapiom"}),k.jsx("span",{className:"brand-divider"}),k.jsx("span",{className:"brand-product",children:"Harness"})]}),k.jsxs("div",{className:"brand-header-right",children:[k.jsxs("button",{className:"palette-trigger","data-testid":"palette-trigger","aria-label":"Jump to session, workflow, or path",onClick:I,children:[k.jsx(Ve,{name:"Search",size:13}),"Jump",k.jsx("span",{className:"palette-trigger-hint",children:am})]}),k.jsxs("button",{className:"telemetry-chip","data-testid":"telemetry-chip","data-state":d,"aria-label":h,title:h,onClick:P,children:[k.jsx("span",{className:"telemetry-chip-dot","aria-hidden":"true"}),k.jsx("span",{className:"telemetry-chip-label",children:g})]}),k.jsx("button",{className:"theme-toggle","data-testid":"theme-toggle","aria-label":u==="dark"?"Switch to light mode":"Switch to dark mode",title:u==="dark"?"Switch to light mode":"Switch to dark mode",onClick:sp,children:k.jsx(Ve,{name:u==="dark"?"Sun":"Moon",size:15})}),k.jsxs("div",{className:"brand-identity","data-testid":"brand-identity",children:[k.jsx("span",{className:"identity-dot","data-authenticated":x}),x?H??"Signed in":"Not signed in"]})]})]})}const pd=Date.now(),fs=x=>new Date(pd-x*6e4).toISOString(),fa=x=>new Date(pd-x*24*60*6e4).toISOString(),hm="/Users/demo/acme-app";fs(1),fs(1),fs(42),fs(20),fa(2),fa(1),fs(0),fs(0);fs(1),fa(1),fa(1);function fm(){return!1}function md(x){return(x==null?void 0:x.boundWorkflowPath)??null}class ds extends Error{constructor(I,M,$){super(M);Do(this,"status");Do(this,"reason");this.name="ApiError",this.status=I,this.reason=$}}function da(){const x=window.__HARNESS__;return x!=null&&x.token?x.token:new URLSearchParams(window.location.search).get("token")??""}class dm{async request(H,I){const M=await fetch(H,{...I,headers:{"Content-Type":"application/json","X-Harness-Token":da(),...I==null?void 0:I.headers}});if(!M.ok){const $=await M.text().catch(()=>"");let Q;try{const P=$?JSON.parse($):void 0;P&&typeof P=="object"&&typeof P.error=="string"&&(Q=P.error)}catch{}throw new ds(M.status,`${(I==null?void 0:I.method)??"GET"} ${H} → ${M.status}${$?`: ${$}`:""}`,Q)}if(M.status!==204)return await M.json()}getState(){return this.request("/api/state")}createSession(H){return this.request("/api/sessions",{method:"POST",body:JSON.stringify(H)})}listSessions(){return this.request("/api/sessions")}sessionHistory(H){return this.request(`/api/sessions/history?cwd=${encodeURIComponent(H)}`)}resumeSession(H){return this.request(`/api/sessions/${encodeURIComponent(H)}/resume`,{method:"POST"})}async killSession(H){await this.request(`/api/sessions/${encodeURIComponent(H)}`,{method:"DELETE"})}async injectInput(H,I){await this.request(`/api/sessions/${encodeURIComponent(H)}/input`,{method:"POST",body:JSON.stringify(I)})}attachImage(H,I){return this.request(`/api/sessions/${encodeURIComponent(H)}/image`,{method:"POST",body:JSON.stringify(I)})}listHarnesses(){return this.request("/api/harnesses")}listWorkflows(){return this.request("/api/workflows")}connectWorkflow(H){return this.request("/api/workflows/connect",{method:"POST",body:JSON.stringify({path:H})})}scanWorkflows(H){return this.request("/api/workflows/scan",{method:"POST",body:JSON.stringify({root:H})})}listMacros(){return this.request("/api/macros")}async runMacro(H,I){await this.request(`/api/macros/${encodeURIComponent(H)}/run`,{method:"POST",body:JSON.stringify(I)})}getSettings(){return this.request("/api/settings")}updateSettings(H){return this.request("/api/settings",{method:"PATCH",body:JSON.stringify(H)})}listDir(H){const I=H?`?path=${encodeURIComponent(H)}`:"";return this.request(`/api/fs/list${I}`)}bindWorkflow(H,I){const M={workflowPath:I};return this.request(`/api/sessions/${encodeURIComponent(H)}/workflow`,{method:"PATCH",body:JSON.stringify(M)})}seedSampleProject(){return this.request("/api/sample-project",{method:"POST"})}listSkills(){return this.request("/api/skills")}getSkill(H){return this.request(`/api/skills/${encodeURIComponent(H)}`)}getRunState(H,I){return this.request(`/api/runs/${encodeURIComponent(H)}/state`,{signal:I})}getRunSpend(H,I){return this.request(`/api/runs/${encodeURIComponent(H)}/spend`,{signal:I})}getRunTransactions(H,I){return this.request(`/api/runs/${encodeURIComponent(H)}/transactions`,{signal:I})}}function Xo(){return new dm}function Gr(x){const H=typeof x=="number"?x:parseFloat(x);if(isNaN(H)||H===0)return"$0.00";if(H>=1)return`$${H.toFixed(2)}`;const M=parseFloat(H.toPrecision(4)).toFixed(4).replace(/\.?0+$/,""),$=M.indexOf(".");if($===-1)return`$${M}.00`;const Q=M.length-$-1;return Q<2?`$${M}${"0".repeat(2-Q)}`:`$${M}`}function _m(x){return x.find(H=>H.id==="visualize")}function gd(x,H,I){if(x.requiresWorkflow){if(!H)return"Select a workflow first";if(x.action.kind==="open-url"&&x.action.url.includes("{{workflow.definitionId}}")&&H.definitionId==null)return"Not deployed yet"}return x.action.kind!=="open-url"&&!I?"Start a session first":null}function vm(x,H){return x.replace("{{workflow.definitionId}}",String((H==null?void 0:H.definitionId)??""))}function Ki(x,H,I){const M={event:x,...H?{data:H}:{},...I?{harnessSessionId:I}:{}};fetch("/api/track",{method:"POST",headers:{"Content-Type":"application/json","X-Harness-Token":da()},body:JSON.stringify(M),keepalive:!0}).catch(()=>{})}const nd=3e3;function Sd(x){return x<1e3?`${x}ms`:`${(x/1e3).toFixed(1)}s`}function pm(x,H,I){const M=[];if(M.push(`Step: ${x.name}`),M.push(`Status: ${x.status}`),x.latencyMs!=null&&M.push(`Latency: ${Sd(x.latencyMs)}`),H!=null&&M.push(`Cost: ${Gr(H.totalUsd)} across ${H.entryCount} billable call(s)`),I!=null&&I.length>0){M.push("Cost breakdown (per call):");for(const $ of I)M.push(` - ${$.capability} (${$.op}): ${Gr($.usd)}`)}if(x.status==="failed"&&x.error&&M.push(`Error: ${x.error}`),x.logSlice){const $=x.logSlice.trimEnd(),Q=$.length>nd?$.slice($.length-nd):$;M.push(`
205
- Logs:
206
- ${Q}`)}return M.join(`
207
- `)}function mm(x){const H=(x.logSlice??"").match(/https?:\/\/[^\s"'<>)\]}]+/g)??[],I=new Set,M=[];for(const $ of H){const Q=$.replace(/[.,;:!?]+$/,"");Q&&!I.has(Q)&&(I.add(Q),M.push(Q))}return M}function gm(x){switch(x){case"running":return{label:"running",modifier:"step-detail-chip--running"};case"passed":return{label:"passed",modifier:"step-detail-chip--passed"};case"failed":return{label:"failed",modifier:"step-detail-chip--failed"};default:return{label:"pending",modifier:"step-detail-chip--pending"}}}function Sm({step:x,spend:H,calls:I,onClose:M,onInject:$}){const[Q,P]=ee.useState(""),u=ee.useRef(null),f=gm(x.status),d=mm(x);ee.useEffect(()=>{function p(S){S.key==="Escape"&&M()}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[M]);function g(p){const S=pm(x,H,I);$(`${S}
208
-
209
- ${p}`,!0)}function h(){Q.trim()&&(g(Q.trim()),P(""))}return k.jsxs("div",{className:"step-detail-overlay",role:"dialog","aria-modal":"true","aria-label":`Step detail: ${x.name}`,"data-testid":"step-detail-panel",ref:u,children:[k.jsxs("div",{className:"step-detail-header",children:[k.jsx("span",{className:"step-detail-name",children:x.name}),k.jsx("span",{className:`step-detail-chip ${f.modifier}`,children:f.label}),x.latencyMs!=null&&k.jsx("span",{className:"step-detail-latency",children:Sd(x.latencyMs)}),k.jsx("button",{className:"step-detail-close btn-ghost","data-testid":"step-detail-close","aria-label":"Close step detail",onClick:M,children:"×"})]}),H!=null?k.jsxs("div",{className:"step-detail-cost","data-testid":"step-detail-cost",children:["Cost: ",Gr(H.totalUsd)," · ",H.entryCount," ",H.entryCount===1?"call":"calls"]}):null,I!=null&&I.length>0&&k.jsxs("div",{className:"step-detail-breakdown","data-testid":"step-detail-breakdown",children:[k.jsx("div",{className:"step-detail-breakdown-title",children:"Cost breakdown"}),k.jsx("ul",{className:"step-detail-breakdown-list",children:I.map((p,S)=>k.jsxs("li",{className:"step-detail-breakdown-row",children:[k.jsx("span",{className:"step-detail-breakdown-cap",children:p.capability}),k.jsx("span",{className:"step-detail-breakdown-op",children:p.op}),k.jsx("span",{className:"step-detail-breakdown-usd",children:Gr(p.usd)})]},`${p.capability}-${p.op}-${S}`))})]}),x.status==="failed"&&x.error&&k.jsx("div",{className:"step-detail-error",children:x.error}),d.length>0&&k.jsx("div",{className:"step-detail-links","data-testid":"step-detail-links",children:d.map(p=>k.jsx("a",{className:"step-detail-link","data-testid":"step-detail-link",href:p,target:"_blank",rel:"noreferrer",children:p},p))}),k.jsx("div",{className:"step-detail-logs-wrap",children:x.logSlice?k.jsx("pre",{className:"step-detail-logs",children:x.logSlice}):k.jsx("p",{className:"step-detail-no-logs",children:"No logs for this step."})}),k.jsxs("div",{className:"step-detail-macros",children:[k.jsx("button",{className:"step-detail-macro-btn btn-ghost","data-testid":"step-macro-slow",onClick:()=>g("Why is this step slow / stuck?"),children:"Why is this step slow / stuck?"}),k.jsx("button",{className:`step-detail-macro-btn ${x.status==="failed"?"btn-primary":"btn-ghost"}`,"data-testid":"step-macro-debug",onClick:()=>g("Debug this step"),children:"Debug this step"}),k.jsx("button",{className:"step-detail-macro-btn btn-ghost","data-testid":"step-macro-explain",onClick:()=>g("Explain this step"),children:"Explain this step"})]}),k.jsxs("div",{className:"step-detail-freeform",children:[k.jsx("textarea",{className:"step-detail-freeform-input","data-testid":"step-freeform-input",placeholder:"Ask about this step's logs…",rows:3,value:Q,onChange:p=>P(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),h())}}),k.jsx("button",{className:"btn-primary step-detail-freeform-ask","data-testid":"step-freeform-ask",disabled:!Q.trim(),onClick:h,children:"Ask"})]})]})}function ym({workflow:x,onReVisualize:H,reVisualizeDisabledReason:I}){return k.jsxs("div",{className:"workflow-actions-header","data-testid":"workflow-actions-header",children:[k.jsx("span",{className:"workflow-actions-name",children:x.name}),x.definitionId!=null&&k.jsx("span",{className:"workflow-dot workflow-dot-pinned","data-tooltip":"Deployed to production"}),k.jsx("button",{className:"macro-icon-btn canvas-refresh-btn","aria-label":"Re-visualize","data-testid":"canvas-revisualize","data-tooltip":I??"Re-visualize",disabled:!!I,onClick:H,children:k.jsx(Ve,{name:"RefreshCw",size:14})})]})}const ad=Xo();function bm({sessionId:x,lastMessage:H,boundWorkflow:I,activeSessionId:M,macros:$,tasks:Q,onRunMacro:P,runView:u,runSpend:f,target:d}){const[g,h]=ee.useState(!1),[p,S]=ee.useState(0),[E,v]=ee.useState(ha()),[l,c]=ee.useState(null),[n,o]=ee.useState([]),[_,b]=ee.useState(null),w=ee.useRef(null),C=ee.useRef(u),m=ee.useRef(d??"prod"),[A,j]=ee.useState(!1),[U,W]=ee.useState(!0),[z,re]=ee.useState(new Set);C.current=u,m.current=d??"prod";function ce(){var Z,le;const R=C.current;R&&((le=(Z=w.current)==null?void 0:Z.contentWindow)==null||le.postMessage({type:"sapiom:run-state",steps:R.steps.map(de=>({name:de.name,id:de.id,status:de.status,latencyMs:de.latencyMs})),status:R.status,target:m.current},"*"))}ee.useEffect(()=>{ce()},[u]),ee.useEffect(()=>Go(v),[]),ee.useEffect(()=>{function R(Z){const le=Z.data;!le||le.type!=="sapiom:node-click"||typeof le.stepName=="string"&&c(le.stepName)}return window.addEventListener("message",R),()=>window.removeEventListener("message",R)},[]),ee.useEffect(()=>{c(null)},[x,I]);const F=u==null?void 0:u.executionId;ee.useEffect(()=>{if(!l||!F||_===F)return;let R=!1;const Z=new AbortController;return ad.getRunTransactions(F,Z.signal).then(le=>{R||(o(le),b(F))}).catch(()=>{R||b(F)}),()=>{R=!0,Z.abort()}},[l,F,_]),ee.useEffect(()=>{if(h(!1),W(!0),!x||fm())return;let R=!1;return j(!0),fetch(`/canvas/${x}/`,{method:"HEAD"}).then(Z=>!R&&h(Z.ok)).catch(()=>{}).finally(()=>!R&&j(!1)),()=>{R=!0}},[x]),ee.useEffect(()=>{!H||!x||H.type==="canvas.reload"&&H.harnessSessionId===x&&(h(!0),W(!0),S(R=>R+1))},[H,x]);const K=(I==null?void 0:I.path)??null;ee.useEffect(()=>{W(!0),S(R=>R+1)},[K]);const te=_m($),T=te?gd(te,I,M):null,B=Q.filter(R=>R.harnessSessionId===x&&(R.workflowPath==null||R.workflowPath===K)),D=B.find(R=>R.status==="running")??null,O=B.filter(R=>R.status!=="running").sort((R,Z)=>(Z.endedAt??"").localeCompare(R.endedAt??""))[0],G=!D&&(O==null?void 0:O.status)==="failed"&&!z.has(O.id)?O:null,ae=G?$.find(R=>R.id===G.macroId)??null:null,J=()=>{te&&(P(te),Ki("visualize.triggered"))},V=l!=null?(u==null?void 0:u.steps.find(R=>R.name===l))??null:null,N=V&&_===F?n.filter(R=>R.stepName===V.name):[];return k.jsxs("aside",{className:"canvas-pane",children:[I&&k.jsx(ym,{workflow:I,onReVisualize:J,reVisualizeDisabledReason:T}),f&&k.jsxs("div",{className:"run-cost-total","data-testid":"run-cost-total",children:[k.jsx("span",{className:"run-cost-total-label",children:"Run cost:"}),k.jsx("span",{className:"run-cost-total-value",children:Gr(f.totalUsd)}),f.settleState!=="final"&&k.jsx("span",{className:"run-cost-total-settling",children:"· settling"})]}),x?G?k.jsxs("div",{className:"canvas-task-failed","data-testid":"canvas-task-failed",children:[k.jsxs("p",{className:"canvas-task-title",children:[k.jsx(Ve,{name:"TriangleAlert",size:14})," ",G.label," failed."]}),G.errorTail&&k.jsx("pre",{className:"canvas-task-error",children:G.errorTail}),k.jsxs("div",{className:"canvas-task-actions",children:[ae&&k.jsx("button",{className:"btn-primary","data-testid":"canvas-task-retry",onClick:()=>P(ae),children:"Retry"}),k.jsx("button",{className:"btn-ghost","data-testid":"canvas-task-dismiss",onClick:()=>re(R=>{const Z=new Set(R);return Z.add(G.id),Z}),children:"Dismiss"})]})]}):D&&!g?k.jsxs("div",{className:"canvas-task-activity","data-testid":"canvas-task-activity",children:[k.jsxs("div",{className:"canvas-task-title",children:[k.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),k.jsxs("span",{children:[D.label," is running…"]})]}),D.statusLines.length>0&&k.jsx("ul",{className:"canvas-task-lines","data-testid":"canvas-task-lines",children:D.statusLines.slice(-8).map((R,Z)=>k.jsx("li",{children:R},`${Z}-${R}`))}),k.jsx("p",{className:"canvas-empty-hint",children:"Running as a background task — your session stays free. The canvas reloads here when it finishes."})]}):A?k.jsxs("div",{className:"canvas-loading","data-testid":"canvas-loading",children:[k.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),k.jsx("p",{className:"canvas-empty-hint",children:"Loading canvas…"})]}):g?k.jsxs("div",{className:"canvas-frame-wrap",children:[U&&k.jsxs("div",{className:"canvas-loading canvas-loading--overlay","data-testid":"canvas-loading",children:[k.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),k.jsx("p",{className:"canvas-empty-hint",children:"Rendering diagram…"})]}),D&&k.jsxs("div",{className:"canvas-task-activity canvas-task-activity--overlay","data-testid":"canvas-task-activity",children:[k.jsxs("div",{className:"canvas-task-title",children:[k.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),k.jsxs("span",{children:[D.label," is running…"]})]}),D.statusLines.length>0&&k.jsx("ul",{className:"canvas-task-lines","data-testid":"canvas-task-lines",children:D.statusLines.slice(-8).map((R,Z)=>k.jsx("li",{children:R},`${Z}-${R}`))}),k.jsx("p",{className:"canvas-empty-hint",children:"Running as a background task — your session stays free. The canvas reloads here when it finishes."})]}),k.jsx("iframe",{ref:w,className:"canvas-iframe",src:`/canvas/${x}/?theme=${E}`,sandbox:"allow-scripts",onLoad:()=>{W(!1),ce()}},`${x}:${p}`),V&&x&&k.jsx(Sm,{step:V,spend:f==null?void 0:f.byStep.find(R=>R.name===V.name),calls:N,onClose:()=>c(null),onInject:(R,Z)=>ad.injectInput(x,{text:R,submit:Z})})]}):k.jsxs("div",{className:"canvas-empty",children:[k.jsx("p",{children:"Nothing generated yet."}),te&&k.jsxs("button",{className:"btn-primary canvas-visualize-cta","data-testid":"canvas-visualize-cta","data-tooltip":T??te.label,disabled:!!T,onClick:()=>{P(te),Ki("visualize.triggered")},children:[k.jsx(Ve,{name:"Sparkles",size:14})," Visualize"]}),k.jsxs("p",{className:"canvas-empty-hint",children:["Ask your agent to visualize, or write HTML directly to"," ",k.jsx("code",{children:".sapiom/canvas/index.html"})," — this pane hot-reloads whenever it changes."]})]}):k.jsx("div",{className:"canvas-empty",children:"Start a session to see its canvas here."})]})}function Cm(x,H){if(!x)return 0;const I=x.toLowerCase(),M=H.toLowerCase();let $=0,Q=0,P=0;for(let u=0;u<I.length;u++){const f=I[u],d=M.indexOf(f,Q);if(d===-1)return null;P=d===Q?P+1:0,$+=10-Math.min(d-Q,8),$+=P*3,d===0&&($+=5),Q=d+1}return $}const wm={session:"Radio",workflow:"Folder",recent:"Folder",path:"Folder"};function Em({sessions:x,workflows:H,recentDirs:I,listDir:M,onSelectSession:$,onOpenPath:Q,onClose:P}){const[u,f]=ee.useState(""),[d,g]=ee.useState([]),[h,p]=ee.useState(!1),[S,E]=ee.useState(0),v=ee.useRef(null);ee.useEffect(()=>{var _;(_=v.current)==null||_.focus()},[]);const l=u.startsWith("/")||u.startsWith("~");ee.useEffect(()=>{if(!l){g([]);return}let _=!1;p(!0);const b=setTimeout(()=>{M(u).then(w=>{_||g(w.dirs)}).catch(()=>{}).finally(()=>!_&&p(!1))},150);return()=>{_=!0,clearTimeout(b)}},[u,l,M]);const c=ee.useMemo(()=>{if(l){const A=u.trim(),j=A?[{id:`confirm:${A}`,kind:"path",label:A,meta:"Open this path",path:A}]:[],U=d.map(W=>({id:`dir:${W.path}`,kind:"path",label:W.name,meta:W.path,path:W.path}));return[...j,...U]}const _=x.filter(A=>A.status!=="exited").map(A=>({id:`session:${A.id}`,kind:"session",label:A.title,meta:A.cwd,sessionId:A.id})),b=H.map(A=>({id:`workflow:${A.path}`,kind:"workflow",label:A.name,meta:A.path,path:A.path})),w=new Set(H.map(A=>A.path)),C=I.filter(A=>!w.has(A)).map(A=>({id:`recent:${A}`,kind:"recent",label:A.split("/").filter(Boolean).pop()??A,meta:A,path:A})),m=[..._,...b,...C];return u?m.map(A=>({item:A,score:Cm(u,`${A.label} ${A.meta}`)})).filter(A=>A.score!==null).sort((A,j)=>j.score-A.score).map(A=>A.item).slice(0,20):m.slice(0,20)},[u,l,d,x,H,I]);ee.useEffect(()=>E(0),[c.length,u]);const n=_=>{_.kind==="session"&&_.sessionId?$(_.sessionId):_.path&&Q(_.path),P()},o=_=>{if(_.key==="ArrowDown")_.preventDefault(),E(b=>Math.min(b+1,c.length-1));else if(_.key==="ArrowUp")_.preventDefault(),E(b=>Math.max(b-1,0));else if(_.key==="Enter"){_.preventDefault();const b=c[S];b&&n(b)}else _.key==="Escape"&&P()};return k.jsx("div",{className:"modal-backdrop",onClick:P,children:k.jsxs("div",{className:"modal command-palette",onClick:_=>_.stopPropagation(),children:[k.jsx("input",{ref:v,className:"command-palette-input","data-testid":"command-palette-input",placeholder:"Jump to a session, workflow, or path…",value:u,onChange:_=>f(_.target.value),onKeyDown:o}),k.jsxs("div",{className:"command-palette-list","data-testid":"command-palette-list",children:[l&&h&&k.jsx("div",{className:"command-palette-empty",children:"Loading…"}),c.length===0&&!h&&k.jsx("div",{className:"command-palette-empty",children:"No matches"}),c.map((_,b)=>k.jsxs("button",{type:"button",className:"command-palette-item"+(b===S?" is-selected":""),"data-testid":`command-palette-item-${b}`,onMouseEnter:()=>E(b),onClick:()=>n(_),children:[k.jsx(Ve,{name:wm[_.kind],size:14}),k.jsx("span",{className:"command-palette-item-label",children:_.label}),k.jsx("span",{className:"command-palette-item-meta",children:_.meta})]},_.id))]})]})})}function xm({session:x,onResume:H,onClose:I}){const M=x.agentSessionId!=null;return k.jsxs("div",{className:"dead-session-pane","data-testid":"dead-session-pane",children:[k.jsx("div",{className:"dead-session-title",children:"Session exited"}),k.jsxs("div",{className:"dead-session-meta",children:[x.cwd,x.exitCode!=null&&` · exit code ${x.exitCode}`]}),k.jsxs("div",{className:"dead-session-actions",children:[k.jsx("button",{className:"btn-primary","data-testid":"dead-session-resume",onClick:H,disabled:!M,title:M?void 0:"This session can't be resumed — it exited before establishing a session id",children:"Resume"}),k.jsx("button",{className:"btn-ghost","data-testid":"dead-session-close",onClick:I,children:"Close"})]}),!M&&k.jsx("div",{className:"dead-session-resume-reason","data-testid":"dead-session-resume-reason",children:"This session can't be resumed — it exited before establishing a session id."})]})}const Am="~/.sapiom/harness",Dm={events:`${Am}/events.ndjson`},Rm=["image/png","image/jpeg","image/gif","image/webp"],ld=10*1024*1024,No=x=>x<1024?`${x} B`:x<1024*1024?`${Math.round(x/1024)} KB`:`${(x/(1024*1024)).toFixed(1)} MB`,Tm=x=>new Promise((H,I)=>{const M=new FileReader;M.onload=()=>H(String(M.result)),M.onerror=()=>I(M.error??new Error("could not read file")),M.readAsDataURL(x)}),km=({sessionId:x,harness:H,api:I,showToast:M,children:$})=>{const[Q,P]=ee.useState(null),[u,f]=ee.useState([]),[d,g]=ee.useState(!1),[h,p]=ee.useState(!1),S=ee.useRef(null),E=ee.useRef(0);ee.useEffect(()=>{let C=!1;return I.listHarnesses().then(m=>{C||P(m)}).catch(()=>{}),()=>{C=!0}},[I]);const v=ee.useMemo(()=>{var C;return Q?((C=Q.find(m=>m.id===H))==null?void 0:C.imageInput)??!1:!0},[Q,H]);ee.useEffect(()=>{f([]),E.current=0,g(!1)},[x]);const l=ee.useCallback(async C=>{const m=C.filter(j=>j.type.startsWith("image/"));if(m.length===0)return;const A=[];for(const j of m){if(!Rm.includes(j.type)){M(`${j.name||"image"}: ${j.type} isn't a supported image type.`);continue}if(j.size>ld){M(`${j.name||"image"} is ${No(j.size)} — over the ${No(ld)} limit.`);continue}try{const U=await Tm(j);A.push({id:crypto.randomUUID(),dataUrl:U,filename:j.name||"pasted-image",mediaType:j.type,bytes:j.size})}catch{M(`Could not read ${j.name||"image"}.`)}}A.length>0&&f(j=>[...j,...A])},[M]);ee.useEffect(()=>{if(!v)return;const C=m=>{var U;const A=(U=m.clipboardData)==null?void 0:U.items;if(!A)return;const j=[];for(let W=0;W<A.length;W+=1){const z=A[W];if(z.kind==="file"&&z.type.startsWith("image/")){const re=z.getAsFile();re&&j.push(re)}}j.length!==0&&(m.preventDefault(),l(j))};return window.addEventListener("paste",C),()=>window.removeEventListener("paste",C)},[v,l]);const c=ee.useCallback(C=>{f(m=>m.filter(A=>A.id!==C))},[]),n=ee.useCallback(async()=>{if(u.length===0||h)return;p(!0);let C=null;for(const m of u)try{await I.attachImage(x,{dataUrl:m.dataUrl,filename:m.filename}),f(A=>A.filter(j=>j.id!==m.id))}catch(A){C=A instanceof ds&&A.reason?A.reason:A.message;break}p(!1),C&&M(C)},[u,h,I,x,M]),o=ee.useCallback(C=>{Array.from(C.dataTransfer.types).includes("Files")&&(E.current+=1,g(!0))},[]),_=ee.useCallback(C=>{Array.from(C.dataTransfer.types).includes("Files")&&C.preventDefault()},[]),b=ee.useCallback(()=>{E.current=Math.max(0,E.current-1),E.current===0&&g(!1)},[]),w=ee.useCallback(C=>{Array.from(C.dataTransfer.types).includes("Files")&&(C.preventDefault(),E.current=0,g(!1),l(Array.from(C.dataTransfer.files)))},[l]);return v?k.jsxs("div",{className:"image-composer","data-testid":"image-composer",onDragEnter:o,onDragOver:_,onDragLeave:b,onDrop:w,children:[k.jsx("div",{className:"image-composer-pane",children:$}),d&&k.jsxs("div",{className:"image-composer-dropzone","data-testid":"image-composer-dropzone",children:[k.jsx(Ve,{name:"ImageUp",size:28}),k.jsx("span",{children:"Drop an image to attach it"})]}),k.jsxs("div",{className:"image-composer-bar",children:[k.jsxs("button",{type:"button",className:"image-composer-attach btn-ghost",onClick:()=>{var C;return(C=S.current)==null?void 0:C.click()},disabled:h,"data-testid":"image-composer-attach","aria-label":"Attach an image",title:"Attach an image (or paste / drag-drop onto the terminal)",children:[k.jsx(Ve,{name:"Paperclip",size:14}),k.jsx("span",{children:"Attach image"})]}),u.length>0&&k.jsxs(k.Fragment,{children:[k.jsx("ul",{className:"image-composer-thumbs","data-testid":"image-composer-thumbs",children:u.map(C=>k.jsxs("li",{className:"image-composer-thumb",title:`${C.filename} · ${No(C.bytes)}`,children:[k.jsx("img",{src:C.dataUrl,alt:C.filename}),k.jsx("button",{type:"button",className:"image-composer-thumb-remove",onClick:()=>c(C.id),disabled:h,"aria-label":`Remove ${C.filename}`,"data-testid":"image-composer-thumb-remove",children:k.jsx(Ve,{name:"X",size:11})})]},C.id))}),k.jsx("button",{type:"button",className:"image-composer-send btn-primary",onClick:()=>void n(),disabled:h,"data-testid":"image-composer-send",children:h?"Sending…":`Send ${u.length} to agent`})]})]}),k.jsx("input",{ref:S,type:"file",accept:"image/*",multiple:!0,hidden:!0,"data-testid":"image-composer-file-input",onChange:C=>{const m=C.target.files?Array.from(C.target.files):[];l(m),C.target.value=""}})]}):k.jsx(k.Fragment,{children:$})};function Io(x,{onDismiss:H,containerRef:I,triggerRef:M}){ee.useEffect(()=>{if(!x)return;const $=P=>{const u=I.current;u&&P.target instanceof Node&&!u.contains(P.target)&&H()},Q=P=>{var u;P.key==="Escape"&&(H(),(u=M==null?void 0:M.current)==null||u.focus())};return document.addEventListener("mousedown",$),document.addEventListener("keydown",Q),()=>{document.removeEventListener("mousedown",$),document.removeEventListener("keydown",Q)}},[x,H,I,M])}function Lm({value:x,onChange:H,onSubmit:I,recentDirs:M,listDir:$}){const[Q,P]=ee.useState(x),[u,f]=ee.useState([]),[d,g]=ee.useState(x),[h,p]=ee.useState(!1);ee.useEffect(()=>{let c=!1;p(!0);const n=setTimeout(()=>{$(x||void 0).then(o=>{c||(P(o.path),f(o.dirs),g(o.parent))}).catch(()=>{}).finally(()=>!c&&p(!1))},150);return()=>{c=!0,clearTimeout(n)}},[x]);const S=x.startsWith(Q)?x.slice(Q.length).replace(/^\//,""):"",E=S?u.filter(c=>c.name.toLowerCase().startsWith(S.toLowerCase())):u,v=c=>H(c),l=c=>{c.key==="Enter"&&(E.length>0?v(E[0].path):I())};return k.jsxs("div",{className:"dir-picker",children:[k.jsxs("div",{className:"dir-picker-inputrow",children:[k.jsx("button",{type:"button",className:"dir-picker-up","data-testid":"dir-picker-up",disabled:d===Q,onClick:()=>v(d),title:"Up to parent directory",children:k.jsx(Ve,{name:"CornerLeftUp",size:14})}),k.jsx("input",{id:"new-session-cwd",autoFocus:!0,className:"modal-input dir-picker-input","data-testid":"dir-picker-input",value:x,placeholder:"/path/to/project",onChange:c=>H(c.target.value),onKeyDown:l})]}),M.length>0&&k.jsx("div",{className:"recent-dirs",children:M.map(c=>k.jsx("button",{type:"button",className:"recent-dir-chip",onClick:()=>v(c),children:c},c))}),k.jsxs("div",{className:"dir-picker-listing","data-testid":"dir-picker-listing",children:[k.jsx("div",{className:"dir-picker-path",children:Q}),h&&k.jsx("div",{className:"dir-picker-empty",children:"Loading…"}),!h&&E.length===0&&k.jsx("div",{className:"dir-picker-empty",children:"No subdirectories"}),!h&&E.map(c=>k.jsxs("button",{type:"button",className:"dir-picker-item","data-testid":`dir-picker-item-${c.name}`,onClick:()=>v(c.path),children:[k.jsx(Ve,{name:"Folder",size:13}),c.name]},c.path))]})]})}const Mm=[{id:"claude-code",label:"Claude Code"},{id:"codex",label:"Codex"}];function yd({recentDirs:x,launchDir:H,listDir:I,onClose:M,onCreate:$,triggerRef:Q}){const[P,u]=ee.useState(H??x[0]??""),[f,d]=ee.useState("claude-code"),[g,h]=ee.useState(!1),[p,S]=ee.useState(null),E=ee.useRef(null);Io(!0,{onDismiss:M,containerRef:E,triggerRef:Q});const v=async()=>{const l=P.trim();if(l){h(!0),S(null);try{await $(l,f),Ki("session.created"),M()}catch(c){S(c.message)}finally{h(!1)}}};return k.jsx("div",{className:"modal-backdrop",children:k.jsxs("div",{className:"modal modal-new-session",ref:E,children:[k.jsx("div",{className:"modal-header",children:"New session"}),k.jsx("label",{className:"modal-label",htmlFor:"new-session-cwd",children:"Directory"}),k.jsx(Lm,{value:P,onChange:u,onSubmit:()=>void v(),recentDirs:x,listDir:I}),k.jsx("div",{className:"modal-label",children:"Harness"}),k.jsx("div",{className:"harness-picker",children:Mm.map(l=>k.jsx("button",{type:"button",className:"harness-option"+(f===l.id?" is-selected":""),onClick:()=>d(l.id),children:l.label},l.id))}),p&&k.jsx("div",{className:"modal-error",children:p}),k.jsxs("div",{className:"modal-actions",children:[k.jsx("button",{className:"btn-ghost",onClick:M,disabled:g,children:"Cancel"}),k.jsx("button",{className:"btn-primary",onClick:()=>void v(),disabled:g||!P.trim(),children:g?"Starting…":"Start session"})]})]})})}function Om({authenticated:x,organizationName:H,telemetryOptIn:I,onToggleTelemetry:M,onClose:$}){const[Q,P]=ee.useState(!1),u=async()=>{const f=!I;P(!0);try{await M(f),Ki("consent.changed",{optIn:f})}finally{P(!1)}};return k.jsxs("div",{className:"settings-popover","data-testid":"settings-popover",children:[k.jsx("div",{className:"settings-identity",children:x?H??"Signed in":"Not signed in"}),k.jsxs("label",{className:"settings-toggle-row",children:[k.jsx("span",{children:"Send usage analytics to Sapiom"}),k.jsx("button",{type:"button",role:"switch","aria-checked":I,"data-testid":"telemetry-toggle",className:"toggle-switch"+(I?" is-on":""),disabled:Q,onClick:()=>void u(),children:k.jsx("span",{className:"toggle-knob"})})]}),k.jsxs("p",{className:"settings-note",children:["Prompts, tool calls, and session lifecycle events are always written locally to"," ",k.jsx("code",{children:Dm.events}),". With your consent, they’re also sent to Sapiom."]}),k.jsx("button",{className:"btn-ghost settings-close",onClick:$,children:"Close"})]})}function Bm({sessions:x,activeSessionId:H,onSelectSession:I,onResumeHistory:M,history:$,historyLoading:Q,onOpenHistory:P,recentDirs:u,launchDir:f,listDir:d,onCreateSession:g,boundWorkflowName:h,authenticated:p,organizationName:S,telemetryOptIn:E,onToggleTelemetry:v,busySessionIds:l,settingsOpen:c,onSetSettingsOpen:n}){const[o,_]=ee.useState(!1),[b,w]=ee.useState(!1),C=ee.useRef(null),m=ee.useRef(null),A=ee.useRef(null),j=ee.useRef(null),U=ee.useRef(null),W=ee.useCallback(()=>_(!1),[]),z=ee.useCallback(()=>n(!1),[n]);Io(o,{onDismiss:W,containerRef:C,triggerRef:m}),Io(c,{onDismiss:z,containerRef:A,triggerRef:j});const re=ee.useMemo(()=>x.filter(K=>K.status!=="exited").sort((K,te)=>K.createdAt.localeCompare(te.createdAt)),[x]),ce=x.filter(K=>K.status==="exited"),F=()=>{const K=!o;if(_(K),K){const te=x.find(B=>B.id===H)??null,T=(te==null?void 0:te.cwd)??u[0];T&&P(T)}};return k.jsxs("div",{className:"session-bar",children:[k.jsxs("div",{className:"session-tabs",role:"tablist","data-testid":"session-tabs",children:[re.map(K=>{const te=K.id===H;return k.jsxs("button",{role:"tab","aria-selected":te,className:"session-tab"+(te?" is-active":""),"data-testid":`session-tab-${K.id}`,onClick:()=>{I(K.id),Ki("session.switched",{},K.id)},children:[k.jsx("span",{className:"session-dot","data-status":K.status}),k.jsx("span",{className:"session-tab-title",children:K.title}),l.has(K.id)&&k.jsx("span",{className:"session-tab-busy","data-testid":`session-tab-busy-${K.id}`,"aria-hidden":"true"}),te&&h&&k.jsxs("span",{className:"session-workflow-chip","data-testid":"session-workflow-chip",children:["▸ working on ",h]})]},K.id)}),k.jsx("button",{ref:U,className:"session-tab-add","data-testid":"new-session-btn",onClick:()=>w(!0),"aria-label":"New session",title:"New session",children:k.jsx(Ve,{name:"Plus",size:14})})]}),k.jsxs("div",{className:"session-history-wrap",ref:C,children:[k.jsxs("button",{ref:m,className:"session-history-trigger","data-testid":"history-trigger",onClick:F,"aria-label":"Session history",title:"Session history",children:[k.jsx(Ve,{name:"History",size:14}),ce.length>0&&k.jsx("span",{className:"session-history-badge","data-testid":"session-history-badge",children:ce.length})]}),o&&k.jsxs("div",{className:"session-dropdown-menu","data-testid":"history-menu",children:[k.jsx("div",{className:"session-dropdown-section",children:"Exited"}),ce.length===0&&k.jsx("div",{className:"session-dropdown-empty",children:"No exited sessions"}),ce.map(K=>k.jsxs("button",{"data-testid":`exited-session-${K.id}`,className:"session-dropdown-item"+(K.id===H?" is-selected":""),onClick:()=>{I(K.id),_(!1)},children:[k.jsx("span",{className:"session-dot","data-status":K.status}),k.jsx("span",{className:"session-item-title",children:K.title}),k.jsx("span",{className:"session-item-cwd",children:K.cwd})]},K.id)),k.jsx("div",{className:"session-dropdown-section",children:"History"}),Q&&k.jsx("div",{className:"session-dropdown-empty",children:"Loading…"}),!Q&&$.length===0&&k.jsx("div",{className:"session-dropdown-empty",children:"No past sessions for this directory"}),!Q&&$.map(K=>k.jsxs("button",{className:"session-dropdown-item","data-testid":`history-${K.agentSessionId}`,onClick:()=>{M(K),_(!1)},children:[k.jsx("span",{className:"session-item-title",children:K.title}),k.jsx("span",{className:"session-item-meta","data-testid":`history-meta-${K.agentSessionId}`,children:Nm(K)})]},K.agentSessionId))]})]}),k.jsxs("div",{className:"settings-wrap",ref:A,children:[k.jsx("button",{ref:j,className:"gear-btn","aria-label":"Settings","data-testid":"settings-trigger",onClick:()=>n(!c),children:k.jsx(Ve,{name:"Settings",size:16})}),c&&k.jsx(Om,{authenticated:p,organizationName:S,telemetryOptIn:E,onToggleTelemetry:v,onClose:()=>n(!1)})]}),b&&k.jsx(yd,{recentDirs:u,launchDir:f,listDir:d,onClose:()=>w(!1),onCreate:g,triggerRef:U})]})}function Nm(x){const H=[];return x.gitBranch&&H.push(x.gitBranch),typeof x.messageCount=="number"&&H.push(`${x.messageCount} ${x.messageCount===1?"turn":"turns"}`),H.push(Hm(x.lastActiveAt)),H.length===1&&H.unshift(x.harness),H.join(" · ")}function Hm(x){const H=new Date(x).getTime();if(Number.isNaN(H))return x;const I=Math.round((Date.now()-H)/1e3);if(I<45)return"just now";if(I<90)return"1 min ago";const M=Math.round(I/60);if(M<60)return`${M} min ago`;const $=Math.round(M/60);return $<24?`${$}h ago`:new Date(x).toLocaleDateString()}function jm({text:x}){const H=x.split(`
210
- `),I=[];let M=0,$=0;function Q(){return $++}function P(u){const f=[],d=/(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*)/g;let g=0,h;for(;(h=d.exec(u))!==null;){h.index>g&&f.push(u.slice(g,h.index));const p=h[0];p.startsWith("`")&&p.endsWith("`")?f.push(k.jsx("code",{className:"chat-inline-code",children:p.slice(1,-1)},Q())):p.startsWith("**")&&p.endsWith("**")?f.push(k.jsx("strong",{children:p.slice(2,-2)},Q())):p.startsWith("*")&&p.endsWith("*")?f.push(k.jsx("em",{children:p.slice(1,-1)},Q())):f.push(p),g=h.index+p.length}return g<u.length&&f.push(u.slice(g)),f}for(;M<H.length;){const u=H[M];if(u.startsWith("```")){const d=u.slice(3).trim(),g=[];for(M++;M<H.length&&!H[M].startsWith("```");)g.push(H[M]),M++;M++,I.push(k.jsx("pre",{className:"chat-code-block","data-lang":d||void 0,children:k.jsx("code",{className:d?`language-${d}`:void 0,children:g.join(`
211
- `)})},Q()));continue}const f=u.match(/^(#{1,3})\s+(.+)/);if(f){const g=`h${f[1].length}`;I.push(k.jsx(g,{className:"chat-heading",children:P(f[2])},Q())),M++;continue}if(u.startsWith("> ")){I.push(k.jsx("blockquote",{className:"chat-blockquote",children:P(u.slice(2))},Q())),M++;continue}if(/^- \[[ x]\]/.test(u)){const d=[];for(;M<H.length&&/^- \[[ x]\]/.test(H[M]);){const g=H[M][3]==="x";d.push({text:H[M].replace(/^- \[[ x]\]\s?/,""),checked:g}),M++}I.push(k.jsx("ul",{className:"chat-list chat-checklist",children:d.map((g,h)=>k.jsx("li",{children:P(g.text)},h))},Q()));continue}if(/^[-*+]\s+/.test(u)){const d=[];for(;M<H.length&&/^[-*+]\s+/.test(H[M]);){const g=H[M].replace(/^[-*+]\s+/,"");d.push(k.jsx("li",{children:P(g)},Q())),M++}I.push(k.jsx("ul",{className:"chat-list",children:d},Q()));continue}if(!u.trim()){M++;continue}I.push(k.jsx("p",{className:"chat-paragraph",children:P(u)},Q())),M++}return k.jsx(k.Fragment,{children:I})}function zm(x){return x.source==="package"?`/${x.id} `:`Use the "${x.name}" skill: ${x.description}`}function Um({skill:x,onBack:H,activeSession:I,onUseSkill:M}){const $=(I==null?void 0:I.ready)===!0&&I.status!=="exited",Q=I?I.status==="exited"?"Session has exited":I.ready?null:"Session is starting":"No active session",P=()=>{$&&(Ki("skill.used",{skillId:x.id,source:x.source}),M(zm(x)))};return k.jsxs("div",{className:"skill-detail","data-testid":"skill-detail",children:[k.jsxs("div",{className:"skill-detail-header",children:[k.jsx("button",{className:"skill-back btn-ghost",onClick:H,"data-testid":"skill-back","aria-label":"Back to skills list",children:k.jsx(Ve,{name:"ArrowLeft",size:13})}),k.jsx("span",{className:"skill-detail-name",children:x.name}),k.jsx("span",{className:"skill-source-badge skill-source-"+x.source,children:x.source==="user"?"user":"pkg"})]}),k.jsxs("div",{className:"skill-detail-actions",children:[k.jsx("button",{className:"skill-use-btn","data-testid":"skill-use-btn",disabled:!$,title:Q??"Populate the terminal with this skill",onClick:P,"aria-label":Q?`Use skill — ${Q}`:"Use skill",children:"Use skill"}),Q&&k.jsx("span",{className:"skill-use-disabled-reason","data-testid":"skill-use-disabled-reason",children:Q})]}),k.jsx("div",{className:"skill-detail-body",children:k.jsx(jm,{text:x.body})})]})}function qm({skills:x,loading:H,error:I,onSelectSkill:M}){if(H)return k.jsx("div",{className:"skills-loading",children:"Loading skills…"});if(I)return k.jsx("div",{className:"skills-error",children:I});if(x.length===0)return k.jsxs("div",{className:"skills-empty",children:[k.jsx("p",{children:"No skills found yet."}),k.jsxs("p",{children:["Browse Sapiom's skills and your own here. Create your own under"," ",k.jsx("code",{children:"~/.claude/skills/<id>/SKILL.md"})," in the terminal (claude-code or codex) and they appear here. Tell your agent to use a skill when you want it."]})]});const $=x.filter(u=>u.source==="user"),Q=x.filter(u=>u.source==="package"),P=(u,f)=>u.length===0?null:k.jsxs("div",{className:"skills-group",children:[k.jsx("div",{className:"skills-group-header",children:f}),u.map(d=>k.jsxs("button",{className:"skill-card","data-testid":`skill-card-${d.id}`,onClick:()=>M(d.id),children:[k.jsx("span",{className:"skill-card-name",children:d.name}),k.jsx("span",{className:"skill-card-desc",children:d.description})]},d.id))]},f);return k.jsxs("div",{className:"skills-list","data-testid":"skills-list",children:[P($,"Your skills"),P(Q,"Sapiom")]})}function Im({listSkills:x,getSkill:H,isActive:I,activeSession:M,onUseSkill:$}){const[Q,P]=ee.useState([]),[u,f]=ee.useState(!0),[d,g]=ee.useState(null),[h,p]=ee.useState(null),[S,E]=ee.useState(!1);ee.useEffect(()=>{if(!I)return;let l=!1;return f(!0),g(null),x().then(c=>{l||P(c)}).catch(c=>{l||g(c.message)}).finally(()=>{l||f(!1)}),()=>{l=!0}},[I,x]);const v=ee.useCallback(async l=>{E(!0),Ki("skill.viewed",{skillId:l});try{const c=await H(l);p(c)}catch(c){const n=c instanceof ds?c.reason??c.message:c.message;g(n)}finally{E(!1)}},[H]);return k.jsxs("aside",{className:"rail rail-skills","data-testid":"skills-panel",children:[k.jsx("div",{className:"rail-header",children:"Skills"}),k.jsx("div",{className:"rail-body",children:S?k.jsx("div",{className:"skills-loading",children:"Loading…"}):h?k.jsx(Um,{skill:h,onBack:()=>p(null),activeSession:M,onUseSkill:l=>{M&&$(M.id,l)}}):k.jsx(qm,{skills:Q,loading:u,error:d,onSelectSkill:l=>void v(l)})})]})}const Pm="https://tools.sapiom.ai",Wm="x-sapiom-api-key",Fm="YOUR_SAPIOM_API_KEY";function Km(x){return x==null?"{ /* your input */ }":JSON.stringify(x,null,2).replace(/\n/g,`
212
- `)}function Ym(x){return x==null?"{}":JSON.stringify(x)}function Gm(x){return x.replace(/'/g,"'\\''")}function Xm(x,H){return`import { agents } from "@sapiom/tools";
213
-
214
- const result = await agents.run({
215
- definition: ${JSON.stringify(x)},
216
- input: ${Km(H)},
217
- });
218
-
219
- if (result.status === "completed") {
220
- console.log(result.output);
221
- }
222
- `}function $m(x,H,I){const M=Gm(`{ "input": ${Ym(H)} }`);return`curl -X POST ${I}/agents/v1/definitions/${x}/executions \\
223
- -H "${Wm}: ${Fm}" \\
224
- -H "Content-Type: application/json" \\
225
- -d '${M}'
226
- `}function Vm(x){const{definition:H,inputSample:I,baseUrl:M=Pm}=x;return{typescript:Xm(H,I),curl:$m(H,I,M)}}const Zm="https://app.sapiom.ai/settings?tab=api-keys";function Qm({boundWorkflow:x,agentsBaseUrl:H}){return x.definitionId==null?null:k.jsx(Jm,{boundWorkflow:x,agentsBaseUrl:H})}function Jm({boundWorkflow:x,agentsBaseUrl:H}){const[I,M]=ee.useState("typescript"),[$,Q]=ee.useState(!1),P=x.definitionSlug==null,u=x.definitionSlug??x.name,{typescript:f,curl:d}=Vm({definition:u,baseUrl:H}),g=I==="typescript"?f:d,h=()=>{navigator.clipboard.writeText(g).then(()=>{Q(!0),window.setTimeout(()=>Q(!1),2e3)}).catch(()=>{})};return k.jsxs("div",{className:"snippet-panel","data-testid":"snippet-panel",children:[k.jsx("div",{className:"snippet-panel-header",children:k.jsx("span",{className:"snippet-panel-title",children:"Trigger from your code"})}),k.jsxs("div",{className:"snippet-slug-row",children:[k.jsx("span",{className:"snippet-slug-label",children:"Agent"}),k.jsx("code",{className:"snippet-slug","data-testid":"snippet-slug",children:u})]}),P&&k.jsx("p",{className:"snippet-slug-inferred","data-testid":"snippet-slug-inferred",children:"Inferred from the project name — confirm it matches your deployed agent."}),k.jsxs("div",{className:"snippet-tabs",role:"tablist","aria-label":"Snippet language",children:[k.jsx("button",{role:"tab","aria-selected":I==="typescript","aria-controls":"snippet-code-panel",className:"snippet-tab"+(I==="typescript"?" is-active":""),"data-testid":"snippet-tab-ts",onClick:()=>M("typescript"),children:"TypeScript (SDK)"}),k.jsx("button",{role:"tab","aria-selected":I==="curl","aria-controls":"snippet-code-panel",className:"snippet-tab"+(I==="curl"?" is-active":""),"data-testid":"snippet-tab-curl",onClick:()=>M("curl"),children:"cURL (HTTP)"})]}),k.jsxs("div",{className:"snippet-code-wrap",role:"tabpanel",id:"snippet-code-panel",children:[k.jsx("pre",{className:"snippet-code","data-testid":"snippet-code",children:k.jsx("code",{children:g})}),k.jsx("button",{className:"snippet-copy"+($?" is-copied":""),"data-testid":"snippet-copy","aria-label":$?"Copied":"Copy snippet",onClick:h,children:$?"Copied":"Copy"})]}),k.jsxs("p",{className:"snippet-hint",children:["Replace ",k.jsx("code",{children:"YOUR_SAPIOM_API_KEY"})," with a key from your"," ",k.jsx("a",{className:"snippet-link","data-testid":"snippet-api-key-link",href:Zm,target:"_blank",rel:"noreferrer",children:"Sapiom dashboard →"})]}),k.jsxs("p",{className:"snippet-hint",children:["Optionally add ",k.jsx("code",{children:"idempotencyKey"})," to the body to deduplicate retries."]})]})}function eg({onDismiss:x,onOpenSettings:H}){return k.jsxs("div",{className:"telemetry-notice",role:"status","data-testid":"telemetry-notice",children:[k.jsx("div",{className:"telemetry-notice-body",children:k.jsxs("p",{className:"telemetry-notice-text",children:["Analytics are ",k.jsx("strong",{children:"on by default"})," — usage events (including prompts and tool calls) are collected locally and sent to Sapiom to help improve the product. Change this any time in"," ",k.jsx("button",{className:"telemetry-notice-settings-link",onClick:()=>{H(),x()},children:"Settings"}),", or use the indicator in the top bar."]})}),k.jsx("button",{className:"telemetry-notice-dismiss","aria-label":"Dismiss analytics notice","data-testid":"telemetry-notice-dismiss",onClick:x,children:"×"})]})}var Ho={exports:{}},od;function tg(){return od||(od=1,(function(x,H){(function(I,M){x.exports=M()})(globalThis,(()=>(()=>{var I={4567:function(P,u,f){var d=this&&this.__decorate||function(n,o,_,b){var w,C=arguments.length,m=C<3?o:b===null?b=Object.getOwnPropertyDescriptor(o,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,o,_,b);else for(var A=n.length-1;A>=0;A--)(w=n[A])&&(m=(C<3?w(m):C>3?w(o,_,m):w(o,_))||m);return C>3&&m&&Object.defineProperty(o,_,m),m},g=this&&this.__param||function(n,o){return function(_,b){o(_,b,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.AccessibilityManager=void 0;const h=f(9042),p=f(9924),S=f(844),E=f(4725),v=f(2585),l=f(3656);let c=u.AccessibilityManager=class extends S.Disposable{constructor(n,o,_,b){super(),this._terminal=n,this._coreBrowserService=_,this._renderService=b,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,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 p.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((w=>this._handleResize(w.rows)))),this.register(this._terminal.onRender((w=>this._refreshRows(w.start,w.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((w=>this._handleChar(w)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
227
- `)))),this.register(this._terminal.onA11yTab((w=>this._handleTab(w)))),this.register(this._terminal.onKey((w=>this._handleKey(w.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,l.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(n){for(let o=0;o<n;o++)this._handleChar(" ")}_handleChar(n){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==n&&(this._charsToAnnounce+=n):this._charsToAnnounce+=n,n===`
228
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(n){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(n)||this._charsToConsume.push(n)}_refreshRows(n,o){this._liveRegionDebouncer.refresh(n,o,this._terminal.rows)}_renderRows(n,o){const _=this._terminal.buffer,b=_.lines.length.toString();for(let w=n;w<=o;w++){const C=_.lines.get(_.ydisp+w),m=[],A=(C==null?void 0:C.translateToString(!0,void 0,void 0,m))||"",j=(_.ydisp+w+1).toString(),U=this._rowElements[w];U&&(A.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=A,this._rowColumns.set(U,m)),U.setAttribute("aria-posinset",j),U.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(n,o){const _=n.target,b=this._rowElements[o===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||n.relatedTarget!==b)return;let w,C;if(o===0?(w=_,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(w=this._rowElements.shift(),C=_,this._rowContainer.removeChild(w)),w.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),n.preventDefault(),n.stopImmediatePropagation()}_handleSelectionChange(){var A;if(this._rowElements.length===0)return;const n=document.getSelection();if(!n)return;if(n.isCollapsed)return void(this._rowContainer.contains(n.anchorNode)&&this._terminal.clearSelection());if(!n.anchorNode||!n.focusNode)return void console.error("anchorNode and/or focusNode are null");let o={node:n.anchorNode,offset:n.anchorOffset},_={node:n.focusNode,offset:n.focusOffset};if((o.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||o.node===_.node&&o.offset>_.offset)&&([o,_]=[_,o]),o.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(o={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(o.node))return;const b=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(b)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:b,offset:((A=b.textContent)==null?void 0:A.length)??0}),!this._rowContainer.contains(_.node))return;const w=({node:j,offset:U})=>{const W=j instanceof Text?j.parentNode:j;let z=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(z))return console.warn("row is invalid. Race condition?"),null;const re=this._rowColumns.get(W);if(!re)return console.warn("columns is null. Race condition?"),null;let ce=U<re.length?re[U]:re.slice(-1)[0]+1;return ce>=this._terminal.cols&&(++z,ce=0),{row:z,column:ce}},C=w(o),m=w(_);if(C&&m){if(C.row>m.row||C.row===m.row&&C.column>=m.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(m.row-C.row)*this._terminal.cols-C.column+m.column)}}_handleResize(n){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>n;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const n=this._coreBrowserService.mainDocument.createElement("div");return n.setAttribute("role","listitem"),n.tabIndex=-1,this._refreshRowDimensions(n),n}_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 n=0;n<this._terminal.rows;n++)this._refreshRowDimensions(this._rowElements[n])}}_refreshRowDimensions(n){n.style.height=`${this._renderService.dimensions.css.cell.height}px`}};u.AccessibilityManager=c=d([g(1,v.IInstantiationService),g(2,E.ICoreBrowserService),g(3,E.IRenderService)],c)},3614:(P,u)=>{function f(p){return p.replace(/\r?\n/g,"\r")}function d(p,S){return S?"\x1B[200~"+p+"\x1B[201~":p}function g(p,S,E,v){p=d(p=f(p),E.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(p,!0),S.value=""}function h(p,S,E){const v=E.getBoundingClientRect(),l=p.clientX-v.left-10,c=p.clientY-v.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${l}px`,S.style.top=`${c}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(u,"__esModule",{value:!0}),u.rightClickHandler=u.moveTextAreaUnderMouseCursor=u.paste=u.handlePasteEvent=u.copyHandler=u.bracketTextForPaste=u.prepareTextForTerminal=void 0,u.prepareTextForTerminal=f,u.bracketTextForPaste=d,u.copyHandler=function(p,S){p.clipboardData&&p.clipboardData.setData("text/plain",S.selectionText),p.preventDefault()},u.handlePasteEvent=function(p,S,E,v){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),S,E,v)},u.paste=g,u.moveTextAreaUnderMouseCursor=h,u.rightClickHandler=function(p,S,E,v,l){h(p,S,E),l&&v.rightClickSelect(p),S.value=v.selectionText,S.select()}},7239:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorContrastCache=void 0;const d=f(1505);u.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,h,p){this._css.set(g,h,p)}getCss(g,h){return this._css.get(g,h)}setColor(g,h,p){this._color.set(g,h,p)}getColor(g,h){return this._color.get(g,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.addDisposableDomListener=void 0,u.addDisposableDomListener=function(f,d,g,h){f.addEventListener(d,g,h);let p=!1;return{dispose:()=>{p||(p=!0,f.removeEventListener(d,g,h))}}}},3551:function(P,u,f){var d=this&&this.__decorate||function(c,n,o,_){var b,w=arguments.length,C=w<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,o):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(c,n,o,_);else for(var m=c.length-1;m>=0;m--)(b=c[m])&&(C=(w<3?b(C):w>3?b(n,o,C):b(n,o))||C);return w>3&&C&&Object.defineProperty(n,o,C),C},g=this&&this.__param||function(c,n){return function(o,_){n(o,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Linkifier=void 0;const h=f(3656),p=f(8460),S=f(844),E=f(2585),v=f(4725);let l=u.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(c,n,o,_,b){super(),this._element=c,this._mouseService=n,this._renderService=o,this._bufferService=_,this._linkProviderService=b,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var w;this._lastMouseEvent=void 0,(w=this._activeProviderReplies)==null||w.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const n=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!n)return;this._isMouseOut=!1;const o=c.composedPath();for(let _=0;_<o.length;_++){const b=o[_];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&n.x===this._lastBufferCell.x&&n.y===this._lastBufferCell.y||(this._handleHover(n),this._lastBufferCell=n)}_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,n){var _,b;this._activeProviderReplies&&n||((_=this._activeProviderReplies)==null||_.forEach((w=>{w==null||w.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let o=!1;for(const[w,C]of this._linkProviderService.linkProviders.entries())n?(b=this._activeProviderReplies)!=null&&b.get(w)&&(o=this._checkLinkProviderResult(w,c,o)):C.provideLinks(c.y,(m=>{var j,U;if(this._isMouseOut)return;const A=m==null?void 0:m.map((W=>({link:W})));(j=this._activeProviderReplies)==null||j.set(w,A),o=this._checkLinkProviderResult(w,c,o),((U=this._activeProviderReplies)==null?void 0:U.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,n){const o=new Set;for(let _=0;_<n.size;_++){const b=n.get(_);if(b)for(let w=0;w<b.length;w++){const C=b[w],m=C.link.range.start.y<c?0:C.link.range.start.x,A=C.link.range.end.y>c?this._bufferService.cols:C.link.range.end.x;for(let j=m;j<=A;j++){if(o.has(j)){b.splice(w--,1);break}o.add(j)}}}}_checkLinkProviderResult(c,n,o){var w;if(!this._activeProviderReplies)return o;const _=this._activeProviderReplies.get(c);let b=!1;for(let C=0;C<c;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(b=!0);if(!b&&_){const C=_.find((m=>this._linkAtPosition(m.link,n)));C&&(o=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!o)for(let C=0;C<this._activeProviderReplies.size;C++){const m=(w=this._activeProviderReplies.get(C))==null?void 0:w.find((A=>this._linkAtPosition(A.link,n)));if(m){o=!0,this._handleNewLink(m);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const n=this._positionFromMouseEvent(c,this._element,this._mouseService);n&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,n){this._currentLink&&this._lastMouseEvent&&(!c||!n||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(c.link,n)&&(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 o,_;return(_=(o=this._currentLink)==null?void 0:o.state)==null?void 0:_.decorations.pointerCursor},set:o=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",o))}},underline:{get:()=>{var o,_;return(_=(o=this._currentLink)==null?void 0:o.state)==null?void 0:_.decorations.underline},set:o=>{var _,b,w;(_=this._currentLink)!=null&&_.state&&((w=(b=this._currentLink)==null?void 0:b.state)==null?void 0:w.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,o))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((o=>{if(!this._currentLink)return;const _=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(_,b),this._lastMouseEvent)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}}))))}_linkHover(c,n,o){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(o,n.text)}_fireUnderlineEvent(c,n){const o=c.range,_=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-_-1,o.end.x,o.end.y-_-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(c,n,o){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(o,n.text)}_linkAtPosition(c,n){const o=c.range.start.y*this._bufferService.cols+c.range.start.x,_=c.range.end.y*this._bufferService.cols+c.range.end.x,b=n.y*this._bufferService.cols+n.x;return o<=b&&b<=_}_positionFromMouseEvent(c,n,o){const _=o.getCoords(c,n,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,n,o,_,b){return{x1:c,y1:n,x2:o,y2:_,cols:this._bufferService.cols,fg:b}}};u.Linkifier=l=d([g(1,v.IMouseService),g(2,v.IRenderService),g(3,E.IBufferService),g(4,v.ILinkProviderService)],l)},9042:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.tooMuchOutput=u.promptLabel=void 0,u.promptLabel="Terminal input",u.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,u,f){var d=this&&this.__decorate||function(v,l,c,n){var o,_=arguments.length,b=_<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,l,c,n);else for(var w=v.length-1;w>=0;w--)(o=v[w])&&(b=(_<3?o(b):_>3?o(l,c,b):o(l,c))||b);return _>3&&b&&Object.defineProperty(l,c,b),b},g=this&&this.__param||function(v,l){return function(c,n){l(c,n,v)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkProvider=void 0;const h=f(511),p=f(2585);let S=u.OscLinkProvider=class{constructor(v,l,c){this._bufferService=v,this._optionsService=l,this._oscLinkService=c}provideLinks(v,l){var A;const c=this._bufferService.buffer.lines.get(v-1);if(!c)return void l(void 0);const n=[],o=this._optionsService.rawOptions.linkHandler,_=new h.CellData,b=c.getTrimmedLength();let w=-1,C=-1,m=!1;for(let j=0;j<b;j++)if(C!==-1||c.hasContent(j)){if(c.loadCell(j,_),_.hasExtendedAttrs()&&_.extended.urlId){if(C===-1){C=j,w=_.extended.urlId;continue}m=_.extended.urlId!==w}else C!==-1&&(m=!0);if(m||C!==-1&&j===b-1){const U=(A=this._oscLinkService.getLinkData(w))==null?void 0:A.uri;if(U){const W={start:{x:C+1,y:v},end:{x:j+(m||j!==b-1?0:1),y:v}};let z=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const re=new URL(U);["http:","https:"].includes(re.protocol)||(z=!0)}catch{z=!0}z||n.push({text:U,range:W,activate:(re,ce)=>o?o.activate(re,ce,W):E(0,ce),hover:(re,ce)=>{var F;return(F=o==null?void 0:o.hover)==null?void 0:F.call(o,re,ce,W)},leave:(re,ce)=>{var F;return(F=o==null?void 0:o.leave)==null?void 0:F.call(o,re,ce,W)}})}m=!1,_.hasExtendedAttrs()&&_.extended.urlId?(C=j,w=_.extended.urlId):(C=-1,w=-1)}}l(n)}};function E(v,l){if(confirm(`Do you want to navigate to ${l}?
229
-
230
- WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}u.OscLinkProvider=S=d([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],S)},6193:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.RenderDebouncer=void 0,u.RenderDebouncer=class{constructor(f,d){this._renderCallback=f,this._coreBrowserService=d,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,d,g){this._rowCount=g,f=f!==void 0?f:0,d=d!==void 0?d: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,d):d,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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const f of this._refreshCallbacks)f(0);this._refreshCallbacks=[]}}},3236:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const d=f(3614),g=f(3656),h=f(3551),p=f(9042),S=f(3730),E=f(1680),v=f(3107),l=f(5744),c=f(2950),n=f(1296),o=f(428),_=f(4269),b=f(5114),w=f(8934),C=f(3230),m=f(9312),A=f(4725),j=f(6731),U=f(8055),W=f(8969),z=f(8460),re=f(844),ce=f(6114),F=f(8437),K=f(2584),te=f(7399),T=f(5941),B=f(9074),D=f(2585),O=f(5435),G=f(4567),ae=f(779);class J extends W.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(N={}){super(N),this.browser=ce,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new re.MutableDisposable),this._onCursorMove=this.register(new z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new z.EventEmitter),this._onBlur=this.register(new z.EventEmitter),this._onA11yCharEmitter=this.register(new z.EventEmitter),this._onA11yTabEmitter=this.register(new z.EventEmitter),this._onWillOpen=this.register(new z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(A.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((R,Z)=>this.refresh(R,Z)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((R=>this._reportWindowsOptions(R)))),this.register(this._inputHandler.onColor((R=>this._handleColorEvent(R)))),this.register((0,z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((R=>this._afterResize(R.cols,R.rows)))),this.register((0,re.toDisposable)((()=>{var R,Z;this._customKeyEventHandler=void 0,(Z=(R=this.element)==null?void 0:R.parentNode)==null||Z.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(const R of N){let Z,le="";switch(R.index){case 256:Z="foreground",le="10";break;case 257:Z="background",le="11";break;case 258:Z="cursor",le="12";break;default:Z="ansi",le="4;"+R.index}switch(R.type){case 0:const de=U.color.toColorRGB(Z==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[Z]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${le};${(0,T.toRgbString)(de)}${K.C1_ESCAPED.ST}`);break;case 1:if(Z==="ansi")this._themeService.modifyColors((_e=>_e.ansi[R.index]=U.channels.toColor(...R.color)));else{const _e=Z;this._themeService.modifyColors((Ee=>Ee[_e]=U.channels.toColor(...R.color)))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var N;return(N=this.textarea)==null?void 0:N.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 N=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(N);if(!R)return;const Z=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,de=R.getWidth(Z),_e=this._renderService.dimensions.css.cell.width*de,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=Z*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=_e+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(R=>{this.hasSelection()&&(0,d.copyHandler)(R,this._selectionService)})));const N=R=>(0,d.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,g.addDisposableDomListener)(this.element,"paste",N)),ce.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(R=>{R.button===2&&(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(R=>{(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ce.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(R=>{R.button===1&&(0,d.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){var Z;if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((Z=this.element)==null?void 0:Z.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.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"),N.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),ce.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(b.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(A.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(o.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(A.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(j.ThemeService),this._instantiationService.setService(A.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(A.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(A.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.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(w.MouseService),this._instantiationService.setService(A.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.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(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(A.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(n.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const N=this,R=this.element;function Z(_e){const Ee=N._mouseService.getMouseReportCoords(_e,N.screenElement);if(!Ee)return!1;let Le,ve;switch(_e.overrideType||_e.type){case"mousemove":ve=32,_e.buttons===void 0?(Le=3,_e.button!==void 0&&(Le=_e.button<3?_e.button:3)):Le=1&_e.buttons?0:4&_e.buttons?1:2&_e.buttons?2:3;break;case"mouseup":ve=0,Le=_e.button<3?_e.button:3;break;case"mousedown":ve=1,Le=_e.button<3?_e.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler(_e)===!1||N.viewport.getLinesScrolled(_e)===0)return!1;ve=_e.deltaY<0?0:1,Le=4;break;default:return!1}return!(ve===void 0||Le===void 0||Le>4)&&N.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Le,action:ve,ctrl:_e.ctrlKey,alt:_e.altKey,shift:_e.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:_e=>(Z(_e),_e.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(_e)),wheel:_e=>(Z(_e),this.cancel(_e,!0)),mousedrag:_e=>{_e.buttons&&Z(_e)},mousemove:_e=>{_e.buttons||Z(_e)}};this.register(this.coreMouseService.onProtocolChange((_e=>{_e?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(_e)),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&_e?le.mousemove||(R.addEventListener("mousemove",de.mousemove),le.mousemove=de.mousemove):(R.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&_e?le.wheel||(R.addEventListener("wheel",de.wheel,{passive:!1}),le.wheel=de.wheel):(R.removeEventListener("wheel",le.wheel),le.wheel=null),2&_e?le.mouseup||(le.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&_e?le.mousedrag||(le.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(R,"mousedown",(_e=>{if(_e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(_e))return Z(_e),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(_e)}))),this.register((0,g.addDisposableDomListener)(R,"wheel",(_e=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(_e)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(_e);if(Ee===0)return;const Le=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(_e.deltaY<0?"A":"B");let ve="";for(let De=0;De<Math.abs(Ee);De++)ve+=Le;return this.coreService.triggerDataEvent(ve,!0),this.cancel(_e,!0)}return this.viewport.handleWheel(_e)?this.cancel(_e):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(R,"touchstart",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(_e),this.cancel(_e)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(R,"touchmove",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(_e)?void 0:this.cancel(_e)}),{passive:!1}))}refresh(N,R){var Z;(Z=this._renderService)==null||Z.refreshRows(N,R)}updateCursorStyle(N){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(N)?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(N,R,Z=0){var le;Z===1?(super.scrollLines(N,R,Z),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(N)}paste(N){(0,d.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,R,Z){this._selectionService.setSelection(N,R,Z)}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 N;(N=this._selectionService)==null||N.clearSelection()}selectAll(){var N;(N=this._selectionService)==null||N.selectAll()}selectLines(N,R){var Z;(Z=this._selectionService)==null||Z.selectLines(N,R)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!R&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Z=(0,te.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),Z.type===3||Z.type===2){const le=this.rows-1;return this.scrollLines(Z.type===2?-le:le),this.cancel(N,!0)}return Z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||(Z.cancel&&this.cancel(N,!0),!Z.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Z.key!==K.C0.ETX&&Z.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Z.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(Z.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,R){const Z=N.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||N.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||N.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?Z:Z&&(!R.keyCode||R.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)R=N.charCode;else if(N.which===null||N.which===void 0)R=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;R=N.which}return!(!R||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=N.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(N),!0}return!1}resize(N,R){N!==this.cols||R!==this.rows?super.resize(N,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,R){var Z,le;(Z=this._charSizeService)==null||Z.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var N;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(N=this.viewport)==null||N.reset(),this.refresh(0,this.rows-1)}}reset(){var R,Z;this.options.rows=this.rows,this.options.cols=this.cols;const N=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),(Z=this.viewport)==null||Z.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){var N;(N=this._renderService)==null||N.clearTextureAtlas()}_reportFocus(){var N;(N=this.element)!=null&&N.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),Z=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${Z};${R}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${de};${le}t`)}}cancel(N,R){if(this.options.cancelEvents||R)return N.preventDefault(),N.stopPropagation(),!1}}u.Terminal=J},9924:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TimeBasedDebouncer=void 0,u.TimeBasedDebouncer=class{constructor(f,d=1e3){this._renderCallback=f,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(f,d,g){this._rowCount=g,f=f!==void 0?f:0,d=d!==void 0?d: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,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=h-this._lastRefreshMs,S=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d)}}},1680:function(P,u,f){var d=this&&this.__decorate||function(c,n,o,_){var b,w=arguments.length,C=w<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,o):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(c,n,o,_);else for(var m=c.length-1;m>=0;m--)(b=c[m])&&(C=(w<3?b(C):w>3?b(n,o,C):b(n,o))||C);return w>3&&C&&Object.defineProperty(n,o,C),C},g=this&&this.__param||function(c,n){return function(o,_){n(o,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Viewport=void 0;const h=f(3656),p=f(4725),S=f(8460),E=f(844),v=f(2585);let l=u.Viewport=class extends E.Disposable{constructor(c,n,o,_,b,w,C,m){super(),this._viewportElement=c,this._scrollArea=n,this._bufferService=o,this._optionsService=_,this._charSizeService=b,this._renderService=w,this._coreBrowserService=C,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((A=>this._renderDimensions=A))),this._handleThemeChange(m.colors),this.register(m.onChangeColors((A=>this._handleThemeChange(A)))),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 n=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==n&&(this._lastRecordedBufferHeight=n,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 n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:n,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,n){const o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&o<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const n=this._getPixelsScrolled(c);return n!==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+n:this._smoothScrollState.target+=n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=n,this._bubbleScroll(c,n))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const n=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+n,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 n=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._currentRowHeight*this._bufferService.rows),n}getBufferElements(c,n){var m;let o,_="";const b=[],w=n??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let A=c;A<w;A++){const j=C.get(A);if(!j)continue;const U=(m=C.get(A+1))==null?void 0:m.isWrapped;if(_+=j.translateToString(!U),!U||A===C.length-1){const W=document.createElement("div");W.textContent=_,b.push(W),_.length>0&&(o=W),_=""}}return{bufferElements:b,cursorElement:o}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let n=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=this._currentRowHeight+0,this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(c,n){const o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&n.altKey||o==="ctrl"&&n.ctrlKey||o==="shift"&&n.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 n=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(c,n))}};u.Viewport=l=d([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],l)},3107:function(P,u,f){var d=this&&this.__decorate||function(v,l,c,n){var o,_=arguments.length,b=_<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,l,c,n);else for(var w=v.length-1;w>=0;w--)(o=v[w])&&(b=(_<3?o(b):_>3?o(l,c,b):o(l,c))||b);return _>3&&b&&Object.defineProperty(l,c,b),b},g=this&&this.__param||function(v,l){return function(c,n){l(c,n,v)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferDecorationRenderer=void 0;const h=f(4725),p=f(844),S=f(2585);let E=u.BufferDecorationRenderer=class extends p.Disposable{constructor(v,l,c,n,o){super(),this._screenElement=v,this._bufferService=l,this._coreBrowserService=c,this._decorationService=n,this._renderService=o,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((_=>this._removeDecoration(_)))),this.register((0,p.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var n;const l=this._coreBrowserService.mainDocument.createElement("div");l.classList.add("xterm-decoration"),l.classList.toggle("xterm-decoration-top-layer",((n=v==null?void 0:v.options)==null?void 0:n.layer)==="top"),l.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,l.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",l.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",l.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=v.options.x??0;return c&&c>this._bufferService.cols&&(l.style.display="none"),this._refreshXPosition(v,l),l}_refreshStyle(v){const l=v.marker.line-this._bufferService.buffers.active.ydisp;if(l<0||l>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let c=this._decorationElements.get(v);c||(c=this._createElement(v),v.element=c,this._decorationElements.set(v,c),this._container.appendChild(c),v.onDispose((()=>{this._decorationElements.delete(v),c.remove()}))),c.style.top=l*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(c)}}_refreshXPosition(v,l=v.element){if(!l)return;const c=v.options.x??0;(v.options.anchor||"left")==="right"?l.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":l.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var l;(l=this._decorationElements.get(v))==null||l.remove(),this._decorationElements.delete(v),v.dispose()}};u.BufferDecorationRenderer=E=d([g(1,S.IBufferService),g(2,h.ICoreBrowserService),g(3,S.IDecorationService),g(4,h.IRenderService)],E)},5871:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorZoneStore=void 0,u.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 d of this._zones)if(d.color===f.options.overviewRulerOptions.color&&d.position===f.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,f.marker.line))return;if(this._lineAdjacentToZone(d,f.marker.line,f.options.overviewRulerOptions.position))return void this._addLineToZone(d,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,d){return d>=f.startBufferLine&&d<=f.endBufferLine}_lineAdjacentToZone(f,d,g){return d>=f.startBufferLine-this._linePadding[g||"full"]&&d<=f.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(f,d){f.startBufferLine=Math.min(f.startBufferLine,d),f.endBufferLine=Math.max(f.endBufferLine,d)}}},5744:function(P,u,f){var d=this&&this.__decorate||function(o,_,b,w){var C,m=arguments.length,A=m<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(o,_,b,w);else for(var j=o.length-1;j>=0;j--)(C=o[j])&&(A=(m<3?C(A):m>3?C(_,b,A):C(_,b))||A);return m>3&&A&&Object.defineProperty(_,b,A),A},g=this&&this.__param||function(o,_){return function(b,w){_(b,w,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OverviewRulerRenderer=void 0;const h=f(5871),p=f(4725),S=f(844),E=f(2585),v={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let n=u.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,_,b,w,C,m,A){var U;super(),this._viewportElement=o,this._screenElement=_,this._bufferService=b,this._decorationService=w,this._renderService=C,this._optionsService=m,this._coreBrowserService=A,this._colorZoneStore=new h.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(),(U=this._viewportElement.parentElement)==null||U.insertBefore(this._canvas,this._viewportElement);const j=this._canvas.getContext("2d");if(!j)throw new Error("Ctx cannot be null");this._ctx=j,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var W;(W=this._canvas)==null||W.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 o=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=o,l.center=_,l.right=o,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=l.left,c.right=l.left+l.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowserService.dpr);v.left=_,v.center=_,v.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const _ of o)_.position!=="full"&&this._renderColorZone(_);for(const _ of o)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(c[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-v[o.position||"full"]/2),l[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[o.position||"full"]))}_queueRefresh(o,_){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u.OverviewRulerRenderer=n=d([g(2,E.IBufferService),g(3,E.IDecorationService),g(4,p.IRenderService),g(5,E.IOptionsService),g(6,p.ICoreBrowserService)],n)},2950:function(P,u,f){var d=this&&this.__decorate||function(v,l,c,n){var o,_=arguments.length,b=_<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,l,c,n);else for(var w=v.length-1;w>=0;w--)(o=v[w])&&(b=(_<3?o(b):_>3?o(l,c,b):o(l,c))||b);return _>3&&b&&Object.defineProperty(l,c,b),b},g=this&&this.__param||function(v,l){return function(c,n){l(c,n,v)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CompositionHelper=void 0;const h=f(4725),p=f(2585),S=f(2584);let E=u.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,l,c,n,o,_){this._textarea=v,this._compositionView=l,this._bufferService=c,this._optionsService=n,this._coreService=o,this._renderService=_,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const l=this._textarea.value,c=l.replace(v,"");this._dataAlreadySent=c,l.length>v.length?this._coreService.triggerDataEvent(c,!0):l.length<v.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):l.length===v.length&&l!==v&&this._coreService.triggerDataEvent(l,!0)}}),0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=l*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=n+"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 _=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}v||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};u.CompositionHelper=E=d([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,h.IRenderService)],E)},9806:(P,u)=>{function f(d,g,h){const p=h.getBoundingClientRect(),S=d.getComputedStyle(h),E=parseInt(S.getPropertyValue("padding-left")),v=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-p.left-E,g.clientY-p.top-v]}Object.defineProperty(u,"__esModule",{value:!0}),u.getCoords=u.getCoordsRelativeToElement=void 0,u.getCoordsRelativeToElement=f,u.getCoords=function(d,g,h,p,S,E,v,l,c){if(!E)return;const n=f(d,g,h);return n?(n[0]=Math.ceil((n[0]+(c?v/2:0))/v),n[1]=Math.ceil(n[1]/l),n[0]=Math.min(Math.max(n[0],1),p+(c?1:0)),n[1]=Math.min(Math.max(n[1],1),S),n):void 0}},9504:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.moveToCellSequence=void 0;const d=f(2584);function g(l,c,n,o){const _=l-h(l,n),b=c-h(c,n),w=Math.abs(_-b)-(function(C,m,A){let j=0;const U=C-h(C,A),W=m-h(m,A);for(let z=0;z<Math.abs(U-W);z++){const re=p(C,m)==="A"?-1:1,ce=A.buffer.lines.get(U+re*z);ce!=null&&ce.isWrapped&&j++}return j})(l,c,n);return v(w,E(p(l,c),o))}function h(l,c){let n=0,o=c.buffer.lines.get(l),_=o==null?void 0:o.isWrapped;for(;_&&l>=0&&l<c.rows;)n++,o=c.buffer.lines.get(--l),_=o==null?void 0:o.isWrapped;return n}function p(l,c){return l>c?"A":"B"}function S(l,c,n,o,_,b){let w=l,C=c,m="";for(;w!==n||C!==o;)w+=_?1:-1,_&&w>b.cols-1?(m+=b.buffer.translateBufferLineToString(C,!1,l,w),w=0,l=0,C++):!_&&w<0&&(m+=b.buffer.translateBufferLineToString(C,!1,0,l+1),w=b.cols-1,l=w,C--);return m+b.buffer.translateBufferLineToString(C,!1,l,w)}function E(l,c){const n=c?"O":"[";return d.C0.ESC+n+l}function v(l,c){l=Math.floor(l);let n="";for(let o=0;o<l;o++)n+=c;return n}u.moveToCellSequence=function(l,c,n,o){const _=n.buffer.x,b=n.buffer.y;if(!n.buffer.hasScrollback)return(function(m,A,j,U,W,z){return g(A,U,W,z).length===0?"":v(S(m,A,m,A-h(A,W),!1,W).length,E("D",z))})(_,b,0,c,n,o)+g(b,c,n,o)+(function(m,A,j,U,W,z){let re;re=g(A,U,W,z).length>0?U-h(U,W):A;const ce=U,F=(function(K,te,T,B,D,O){let G;return G=g(T,B,D,O).length>0?B-h(B,D):te,K<T&&G<=B||K>=T&&G<B?"C":"D"})(m,A,j,U,W,z);return v(S(m,re,j,ce,F==="C",W).length,E(F,z))})(_,b,l,c,n,o);let w;if(b===c)return w=_>l?"D":"C",v(Math.abs(_-l),E(w,o));w=b>c?"D":"C";const C=Math.abs(b-c);return v((function(m,A){return A.cols-m})(b>c?l:_,n)+(C-1)*n.cols+1+((b>c?_:l)-1),E(w,o))}},1296:function(P,u,f){var d=this&&this.__decorate||function(z,re,ce,F){var K,te=arguments.length,T=te<3?re:F===null?F=Object.getOwnPropertyDescriptor(re,ce):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(z,re,ce,F);else for(var B=z.length-1;B>=0;B--)(K=z[B])&&(T=(te<3?K(T):te>3?K(re,ce,T):K(re,ce))||T);return te>3&&T&&Object.defineProperty(re,ce,T),T},g=this&&this.__param||function(z,re){return function(ce,F){re(ce,F,z)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRenderer=void 0;const h=f(3787),p=f(2550),S=f(2223),E=f(6171),v=f(6052),l=f(4725),c=f(8055),n=f(8460),o=f(844),_=f(2585),b="xterm-dom-renderer-owner-",w="xterm-rows",C="xterm-fg-",m="xterm-bg-",A="xterm-focus",j="xterm-selection";let U=1,W=u.DomRenderer=class extends o.Disposable{constructor(z,re,ce,F,K,te,T,B,D,O,G,ae,J){super(),this._terminal=z,this._document=re,this._element=ce,this._screenElement=F,this._viewportElement=K,this._helperContainer=te,this._linkifier2=T,this._charSizeService=D,this._optionsService=O,this._bufferService=G,this._coreBrowserService=ae,this._themeService=J,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new n.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(w),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(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((V=>this._injectCss(V)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((V=>this._handleLinkHover(V)))),this.register(this._linkifier2.onHideLinkUnderline((V=>this._handleLinkLeave(V)))),this.register((0,o.toDisposable)((()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.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 z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*z),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/z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/z),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 ce of this._rowElements)ce.style.width=`${this.dimensions.css.canvas.width}px`,ce.style.height=`${this.dimensions.css.cell.height}px`,ce.style.lineHeight=`${this.dimensions.css.cell.height}px`,ce.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const re=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=re,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(z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let re=`${this._terminalSelector} .${w} { color: ${z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;re+=`${this._terminalSelector} .${w} .xterm-dim { color: ${c.color.multiplyOpacity(z.foreground,.5).css};}`,re+=`${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 ce=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;re+=`@keyframes ${ce} { 50% { border-bottom-style: hidden; }}`,re+=`@keyframes ${F} { 50% { box-shadow: none; }}`,re+=`@keyframes ${K} { 0% { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css}; } 50% { background-color: inherit; color: ${z.cursor.css}; }}`,re+=`${this._terminalSelector} .${w}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ce} 1s step-end infinite;}${this._terminalSelector} .${w}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${w}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${z.cursor.css} !important; color: ${z.cursorAccent.css} !important;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${z.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,re+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${z.selectionInactiveBackgroundOpaque.css};}`;for(const[te,T]of z.ansi.entries())re+=`${this._terminalSelector} .${C}${te} { color: ${T.css}; }${this._terminalSelector} .${C}${te}.xterm-dim { color: ${c.color.multiplyOpacity(T,.5).css}; }${this._terminalSelector} .${m}${te} { background-color: ${T.css}; }`;re+=`${this._terminalSelector} .${C}${S.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(z.background).css}; }${this._terminalSelector} .${C}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(z.background),.5).css}; }${this._terminalSelector} .${m}${S.INVERTED_DEFAULT_COLOR} { background-color: ${z.foreground.css}; }`,this._themeStyleElement.textContent=re}_setDefaultSpacing(){const z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${z}px`,this._rowFactory.defaultSpacing=z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(z,re){for(let ce=this._rowElements.length;ce<=re;ce++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>re;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(z,re){this._refreshRowElements(z,re),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(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(z,re,ce){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(z,re,ce),this.renderRows(0,this._bufferService.rows-1),!z||!re)return;this._selectionRenderModel.update(this._terminal,z,re,ce);const F=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,T=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||T<0)return;const B=this._document.createDocumentFragment();if(ce){const D=z[0]>re[0];B.appendChild(this._createSelectionElement(te,D?re[0]:z[0],D?z[0]:re[0],T-te+1))}else{const D=F===te?z[0]:0,O=te===K?re[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(te,D,O));const G=T-te-1;if(B.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,G)),te!==T){const ae=K===T?re[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(T,0,ae))}}this._selectionContainer.appendChild(B)}_createSelectionElement(z,re,ce,F=1){const K=this._document.createElement("div"),te=re*this.dimensions.css.cell.width;let T=this.dimensions.css.cell.width*(ce-re);return te+T>this.dimensions.css.canvas.width&&(T=this.dimensions.css.canvas.width-te),K.style.height=F*this.dimensions.css.cell.height+"px",K.style.top=z*this.dimensions.css.cell.height+"px",K.style.left=`${te}px`,K.style.width=`${T}px`,K}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 z of this._rowElements)z.replaceChildren()}renderRows(z,re){const ce=this._bufferService.buffer,F=ce.ybase+ce.y,K=Math.min(ce.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,T=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=z;D<=re;D++){const O=D+ce.ydisp,G=this._rowElements[D],ae=ce.lines.get(O);if(!G||!ae)break;G.replaceChildren(...this._rowFactory.createRow(ae,O,O===F,T,B,K,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${this._terminalClass}`}_handleLinkHover(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!0)}_handleLinkLeave(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!1)}_setCellUnderline(z,re,ce,F,K,te){ce<0&&(z=0),F<0&&(re=0);const T=this._bufferService.rows-1;ce=Math.max(Math.min(ce,T),0),F=Math.max(Math.min(F,T),0),K=Math.min(K,this._bufferService.cols);const B=this._bufferService.buffer,D=B.ybase+B.y,O=Math.min(B.x,K-1),G=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let V=ce;V<=F;++V){const N=V+B.ydisp,R=this._rowElements[V],Z=B.lines.get(N);if(!R||!Z)break;R.replaceChildren(...this._rowFactory.createRow(Z,N,N===D,ae,J,O,G,this.dimensions.css.cell.width,this._widthCache,te?V===ce?z:0:-1,te?(V===F?re:K)-1:-1))}}};u.DomRenderer=W=d([g(7,_.IInstantiationService),g(8,l.ICharSizeService),g(9,_.IOptionsService),g(10,_.IBufferService),g(11,l.ICoreBrowserService),g(12,l.IThemeService)],W)},3787:function(P,u,f){var d=this&&this.__decorate||function(w,C,m,A){var j,U=arguments.length,W=U<3?C:A===null?A=Object.getOwnPropertyDescriptor(C,m):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(w,C,m,A);else for(var z=w.length-1;z>=0;z--)(j=w[z])&&(W=(U<3?j(W):U>3?j(C,m,W):j(C,m))||W);return U>3&&W&&Object.defineProperty(C,m,W),W},g=this&&this.__param||function(w,C){return function(m,A){C(m,A,w)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRendererRowFactory=void 0;const h=f(2223),p=f(643),S=f(511),E=f(2585),v=f(8055),l=f(4725),c=f(4269),n=f(6171),o=f(3734);let _=u.DomRendererRowFactory=class{constructor(w,C,m,A,j,U,W){this._document=w,this._characterJoinerService=C,this._optionsService=m,this._coreBrowserService=A,this._coreService=j,this._decorationService=U,this._themeService=W,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,C,m){this._selectionStart=w,this._selectionEnd=C,this._columnSelectMode=m}createRow(w,C,m,A,j,U,W,z,re,ce,F){const K=[],te=this._characterJoinerService.getJoinedCharacters(C),T=this._themeService.colors;let B,D=w.getNoBgTrimmedLength();m&&D<U+1&&(D=U+1);let O=0,G="",ae=0,J=0,V=0,N=!1,R=0,Z=!1,le=0;const de=[],_e=ce!==-1&&F!==-1;for(let Ee=0;Ee<D;Ee++){w.loadCell(Ee,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let ve=!1,De=Ee,ye=this._workCell;if(te.length>0&&Ee===te[0][0]){ve=!0;const Ie=te.shift();ye=new c.JoinedCellData(this._workCell,w.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),De=Ie[1]-1,Le=ye.getWidth()}const Pt=this._isCellInSelection(Ee,C),Wt=m&&Ee===U,$t=_e&&Ee>=ce&&Ee<=F;let Ft=!1;this._decorationService.forEachDecorationAtCell(Ee,C,void 0,(Ie=>{Ft=!0}));let gi=ye.getChars()||p.WHITESPACE_CELL_CHAR;if(gi===" "&&(ye.isUnderline()||ye.isOverline())&&(gi=" "),le=Le*z-re.get(gi,ye.isBold(),ye.isItalic()),B){if(O&&(Pt&&Z||!Pt&&!Z&&ye.bg===ae)&&(Pt&&Z&&T.selectionForeground||ye.fg===J)&&ye.extended.ext===V&&$t===N&&le===R&&!Wt&&!ve&&!Ft){ye.isInvisible()?G+=p.WHITESPACE_CELL_CHAR:G+=gi,O++;continue}O&&(B.textContent=G),B=this._document.createElement("span"),O=0,G=""}else B=this._document.createElement("span");if(ae=ye.bg,J=ye.fg,V=ye.extended.ext,N=$t,R=le,Z=Pt,ve&&U>=Ee&&U<=De&&(U=Ee),!this._coreService.isCursorHidden&&Wt&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&de.push("xterm-cursor-blink"),de.push(A==="bar"?"xterm-cursor-bar":A==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(j)switch(j){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(ye.isBold()&&de.push("xterm-bold"),ye.isItalic()&&de.push("xterm-italic"),ye.isDim()&&de.push("xterm-dim"),G=ye.isInvisible()?p.WHITESPACE_CELL_CHAR:ye.getChars()||p.WHITESPACE_CELL_CHAR,ye.isUnderline()&&(de.push(`xterm-underline-${ye.extended.underlineStyle}`),G===" "&&(G=" "),!ye.isUnderlineColorDefault()))if(ye.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${o.AttributeData.toColorRGB(ye.getUnderlineColor()).join(",")})`;else{let Ie=ye.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ye.isBold()&&Ie<8&&(Ie+=8),B.style.textDecorationColor=T.ansi[Ie].css}ye.isOverline()&&(de.push("xterm-overline"),G===" "&&(G=" ")),ye.isStrikethrough()&&de.push("xterm-strikethrough"),$t&&(B.style.textDecoration="underline");let dt=ye.getFgColor(),tt=ye.getFgColorMode(),Lt=ye.getBgColor(),Si=ye.getBgColorMode();const _s=!!ye.isInverse();if(_s){const Ie=dt;dt=Lt,Lt=Ie;const Gi=tt;tt=Si,Si=Gi}let bt,vs,Kt,Yi=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,C,void 0,(Ie=>{Ie.options.layer!=="top"&&Yi||(Ie.backgroundColorRGB&&(Si=50331648,Lt=Ie.backgroundColorRGB.rgba>>8&16777215,bt=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(tt=50331648,dt=Ie.foregroundColorRGB.rgba>>8&16777215,vs=Ie.foregroundColorRGB),Yi=Ie.options.layer==="top")})),!Yi&&Pt&&(bt=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,Lt=bt.rgba>>8&16777215,Si=50331648,Yi=!0,T.selectionForeground&&(tt=50331648,dt=T.selectionForeground.rgba>>8&16777215,vs=T.selectionForeground)),Yi&&de.push("xterm-decoration-top"),Si){case 16777216:case 33554432:Kt=T.ansi[Lt],de.push(`xterm-bg-${Lt}`);break;case 50331648:Kt=v.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(B,`background-color:#${b((Lt>>>0).toString(16),"0",6)}`);break;default:_s?(Kt=T.foreground,de.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Kt=T.background}switch(bt||ye.isDim()&&(bt=v.color.multiplyOpacity(Kt,.5)),tt){case 16777216:case 33554432:ye.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(B,Kt,T.ansi[dt],ye,bt,void 0)||de.push(`xterm-fg-${dt}`);break;case 50331648:const Ie=v.channels.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(B,Kt,Ie,ye,bt,vs)||this._addStyle(B,`color:#${b(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Kt,T.foreground,ye,bt,vs)||_s&&de.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}de.length&&(B.className=de.join(" "),de.length=0),Wt||ve||Ft?B.textContent=G:O++,le!==this.defaultSpacing&&(B.style.letterSpacing=`${le}px`),K.push(B),Ee=De}return B&&O&&(B.textContent=G),K}_applyMinimumContrast(w,C,m,A,j,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,n.treatGlyphAsBackgroundColor)(A.getCode()))return!1;const W=this._getContrastCache(A);let z;if(j||U||(z=W.getColor(C.rgba,m.rgba)),z===void 0){const re=this._optionsService.rawOptions.minimumContrastRatio/(A.isDim()?2:1);z=v.color.ensureContrastRatio(j||C,U||m,re),W.setColor((j||C).rgba,(U||m).rgba,z??null)}return!!z&&(this._addStyle(w,`color:${z.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,C){w.setAttribute("style",`${w.getAttribute("style")||""}${C};`)}_isCellInSelection(w,C){const m=this._selectionStart,A=this._selectionEnd;return!(!m||!A)&&(this._columnSelectMode?m[0]<=A[0]?w>=m[0]&&C>=m[1]&&w<A[0]&&C<=A[1]:w<m[0]&&C>=m[1]&&w>=A[0]&&C<=A[1]:C>m[1]&&C<A[1]||m[1]===A[1]&&C===m[1]&&w>=m[0]&&w<A[0]||m[1]<A[1]&&C===A[1]&&w<A[0]||m[1]<A[1]&&C===m[1]&&w>=m[0])}};function b(w,C,m){for(;w.length<m;)w=C+w;return w}u.DomRendererRowFactory=_=d([g(1,l.ICharacterJoinerService),g(2,E.IOptionsService),g(3,l.ICoreBrowserService),g(4,E.ICoreService),g(5,E.IDecorationService),g(6,l.IThemeService)],_)},2550:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WidthCache=void 0,u.WidthCache=class{constructor(f,d){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 g=f.createElement("span");g.classList.add("xterm-char-measure-element");const h=f.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const p=f.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const S=f.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,h,p,S],this._container.appendChild(g),this._container.appendChild(h),this._container.appendChild(p),this._container.appendChild(S),d.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,d,g,h){f===this._font&&d===this._fontSize&&g===this._weight&&h===this._weightBold||(this._font=f,this._fontSize=d,this._weight=g,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(f,d,g){let h=0;if(!d&&!g&&f.length===1&&(h=f.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const E=this._measure(f,0);return E>0&&(this._flat[h]=E),E}let p=f;d&&(p+="B"),g&&(p+="I");let S=this._holey.get(p);if(S===void 0){let E=0;d&&(E|=1),g&&(E|=2),S=this._measure(f,E),S>0&&this._holey.set(p,S)}return S}_measure(f,d){const g=this._measureElements[d];return g.textContent=f.repeat(32),g.offsetWidth/32}}},2223:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TEXT_BASELINE=u.DIM_OPACITY=u.INVERTED_DEFAULT_COLOR=void 0;const d=f(6114);u.INVERTED_DEFAULT_COLOR=257,u.DIM_OPACITY=.5,u.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(P,u)=>{function f(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(u,"__esModule",{value:!0}),u.computeNextVariantOffset=u.createRenderDimensions=u.treatGlyphAsBackgroundColor=u.allowRescaling=u.isEmoji=u.isRestrictedPowerlineGlyph=u.isPowerlineGlyph=u.throwIfFalsy=void 0,u.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},u.isPowerlineGlyph=f,u.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},u.isEmoji=d,u.allowRescaling=function(g,h,p,S){return h===1&&p>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!d(g)&&!f(g)&&!(function(E){return 57344<=E&&E<=63743})(g)},u.treatGlyphAsBackgroundColor=function(g){return f(g)||(function(h){return 9472<=h&&h<=9631})(g)},u.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}}}},u.computeNextVariantOffset=function(g,h,p=0){return(g-(2*Math.round(h)-p))%(2*Math.round(h))}},6052:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.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(g,h,p,S=!1){if(this.selectionStart=h,this.selectionEnd=p,!h||!p||h[0]===p[0]&&h[1]===p[1])return void this.clear();const E=g.buffers.active.ydisp,v=h[1]-E,l=p[1]-E,c=Math.max(v,0),n=Math.min(l,g.rows-1);c>=g.rows||n<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=v,this.viewportEndRow=l,this.viewportCappedStartRow=c,this.viewportCappedEndRow=n,this.startCol=h[0],this.endCol=p[0])}isCellSelected(g,h,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&p>=this.viewportCappedStartRow&&h<this.endCol&&p<=this.viewportCappedEndRow:h<this.startCol&&p>=this.viewportCappedStartRow&&h>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol)}}u.createSelectionRenderModel=function(){return new f}},456:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionModel=void 0,u.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,d=this.selectionEnd;return!(!f||!d)&&(f[1]>d[1]||f[1]===d[1]&&f[0]>d[0])}handleTrim(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(P,u,f){var d=this&&this.__decorate||function(n,o,_,b){var w,C=arguments.length,m=C<3?o:b===null?b=Object.getOwnPropertyDescriptor(o,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,o,_,b);else for(var A=n.length-1;A>=0;A--)(w=n[A])&&(m=(C<3?w(m):C>3?w(o,_,m):w(o,_))||m);return C>3&&m&&Object.defineProperty(o,_,m),m},g=this&&this.__param||function(n,o){return function(_,b){o(_,b,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharSizeService=void 0;const h=f(2585),p=f(8460),S=f(844);let E=u.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,o,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new l(n,o,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};u.CharSizeService=E=d([g(2,h.IOptionsService)],E);class v extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(o,_){o!==void 0&&o>0&&_!==void 0&&_>0&&(this._result.width=o,this._result.height=_)}}class l extends v{constructor(o,_,b){super(),this._document=o,this._parentElement=_,this._optionsService=b,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 v{constructor(o){super(),this._optionsService=o,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const o=this._ctx.measureText("W");return this._validateAndSet(o.width,o.fontBoundingBoxAscent+o.fontBoundingBoxDescent),this._result}}},4269:function(P,u,f){var d=this&&this.__decorate||function(c,n,o,_){var b,w=arguments.length,C=w<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,o):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(c,n,o,_);else for(var m=c.length-1;m>=0;m--)(b=c[m])&&(C=(w<3?b(C):w>3?b(n,o,C):b(n,o))||C);return w>3&&C&&Object.defineProperty(n,o,C),C},g=this&&this.__param||function(c,n){return function(o,_){n(o,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharacterJoinerService=u.JoinedCellData=void 0;const h=f(3734),p=f(643),S=f(511),E=f(2585);class v extends h.AttributeData{constructor(n,o,_){super(),this.content=0,this.combinedData="",this.fg=n.fg,this.bg=n.bg,this.combinedData=o,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(n){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.JoinedCellData=v;let l=u.CharacterJoinerService=class bd{constructor(n){this._bufferService=n,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(n){const o={id:this._nextCharacterJoinerId++,handler:n};return this._characterJoiners.push(o),o.id}deregister(n){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===n)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(n){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(n);if(!o||o.length===0)return[];const _=[],b=o.translateToString(!0);let w=0,C=0,m=0,A=o.getFg(0),j=o.getBg(0);for(let U=0;U<o.getTrimmedLength();U++)if(o.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==A||this._workCell.bg!==j){if(U-w>1){const W=this._getJoinedRanges(b,m,C,o,w);for(let z=0;z<W.length;z++)_.push(W[z])}w=U,m=C,A=this._workCell.fg,j=this._workCell.bg}C+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const U=this._getJoinedRanges(b,m,C,o,w);for(let W=0;W<U.length;W++)_.push(U[W])}return _}_getJoinedRanges(n,o,_,b,w){const C=n.substring(o,_);let m=[];try{m=this._characterJoiners[0].handler(C)}catch(A){console.error(A)}for(let A=1;A<this._characterJoiners.length;A++)try{const j=this._characterJoiners[A].handler(C);for(let U=0;U<j.length;U++)bd._mergeRanges(m,j[U])}catch(j){console.error(j)}return this._stringRangesToCellRanges(m,b,w),m}_stringRangesToCellRanges(n,o,_){let b=0,w=!1,C=0,m=n[b];if(m){for(let A=_;A<this._bufferService.cols;A++){const j=o.getWidth(A),U=o.getString(A).length||p.WHITESPACE_CELL_CHAR.length;if(j!==0){if(!w&&m[0]<=C&&(m[0]=A,w=!0),m[1]<=C){if(m[1]=A,m=n[++b],!m)break;m[0]<=C?(m[0]=A,w=!0):w=!1}C+=U}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(n,o){let _=!1;for(let b=0;b<n.length;b++){const w=n[b];if(_){if(o[1]<=w[0])return n[b-1][1]=o[1],n;if(o[1]<=w[1])return n[b-1][1]=Math.max(o[1],w[1]),n.splice(b,1),n;n.splice(b,1),b--}else{if(o[1]<=w[0])return n.splice(b,0,o),n;if(o[1]<=w[1])return w[0]=Math.min(o[0],w[0]),n;o[0]<w[1]&&(w[0]=Math.min(o[0],w[0]),_=!0)}}return _?n[n.length-1][1]=o[1]:n.push(o),n}};u.CharacterJoinerService=l=d([g(0,E.IBufferService)],l)},5114:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreBrowserService=void 0;const d=f(844),g=f(8460),h=f(3656);class p extends d.Disposable{constructor(v,l,c){super(),this._textarea=v,this._window=l,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((n=>this._screenDprMonitor.setWindow(n)))),this.register((0,g.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(v){this._window!==v&&(this._window=v,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}}u.CoreBrowserService=p;class S extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.LinkProviderService=void 0;const d=f(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const S=this.linkProviders.indexOf(p);S!==-1&&this.linkProviders.splice(S,1)}}}}u.LinkProviderService=g},8934:function(P,u,f){var d=this&&this.__decorate||function(E,v,l,c){var n,o=arguments.length,_=o<3?v:c===null?c=Object.getOwnPropertyDescriptor(v,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(E,v,l,c);else for(var b=E.length-1;b>=0;b--)(n=E[b])&&(_=(o<3?n(_):o>3?n(v,l,_):n(v,l))||_);return o>3&&_&&Object.defineProperty(v,l,_),_},g=this&&this.__param||function(E,v){return function(l,c){v(l,c,E)}};Object.defineProperty(u,"__esModule",{value:!0}),u.MouseService=void 0;const h=f(4725),p=f(9806);let S=u.MouseService=class{constructor(E,v){this._renderService=E,this._charSizeService=v}getCoords(E,v,l,c,n){return(0,p.getCoords)(window,E,v,l,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(E,v){const l=(0,p.getCoordsRelativeToElement)(window,E,v);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};u.MouseService=S=d([g(0,h.IRenderService),g(1,h.ICharSizeService)],S)},3230:function(P,u,f){var d=this&&this.__decorate||function(n,o,_,b){var w,C=arguments.length,m=C<3?o:b===null?b=Object.getOwnPropertyDescriptor(o,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,o,_,b);else for(var A=n.length-1;A>=0;A--)(w=n[A])&&(m=(C<3?w(m):C>3?w(o,_,m):w(o,_))||m);return C>3&&m&&Object.defineProperty(o,_,m),m},g=this&&this.__param||function(n,o){return function(_,b){o(_,b,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.RenderService=void 0;const h=f(6193),p=f(4725),S=f(8460),E=f(844),v=f(7226),l=f(2585);let c=u.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(n,o,_,b,w,C,m,A){super(),this._rowCount=n,this._charSizeService=b,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((j,U)=>this._renderRows(j,U)),m),this.register(this._renderDebouncer),this.register(m.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var j;return(j=this._renderer.value)==null?void 0:j.clear()}))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(w.onDecorationRegistered((()=>this._fullRefresh()))),this.register(w.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(A.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(m.window,o),this.register(m.onWindowChange((j=>this._registerIntersectionObserver(j,o))))}_registerIntersectionObserver(n,o){if("IntersectionObserver"in n){const _=new n.IntersectionObserver((b=>this._handleIntersectionChange(b[b.length-1])),{threshold:0});_.observe(o),this._observerDisposable.value=(0,E.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,o,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,o,this._rowCount))}_renderRows(n,o){this._renderer.value&&(n=Math.min(n,this._rowCount-1),o=Math.min(o,this._rowCount-1),this._renderer.value.renderRows(n,o),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:o}),this._onRender.fire({start:n,end:o}),this._isNextRenderRedrawOnly=!0)}resize(n,o){this._rowCount=o,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(n){this._renderer.value=n,this._renderer.value&&(this._renderer.value.onRequestRedraw((o=>this.refreshRows(o.start,o.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,o;this._renderer.value&&((o=(n=this._renderer.value).clearTextureAtlas)==null||o.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,o){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(n,o)})):this._renderer.value.handleResize(n,o),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer.value)==null||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer.value)==null||n.handleBlur()}handleFocus(){var n;(n=this._renderer.value)==null||n.handleFocus()}handleSelectionChanged(n,o,_){var b;this._selectionState.start=n,this._selectionState.end=o,this._selectionState.columnSelectMode=_,(b=this._renderer.value)==null||b.handleSelectionChanged(n,o,_)}handleCursorMove(){var n;(n=this._renderer.value)==null||n.handleCursorMove()}clear(){var n;(n=this._renderer.value)==null||n.clear()}};u.RenderService=c=d([g(2,l.IOptionsService),g(3,p.ICharSizeService),g(4,l.IDecorationService),g(5,l.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],c)},9312:function(P,u,f){var d=this&&this.__decorate||function(m,A,j,U){var W,z=arguments.length,re=z<3?A:U===null?U=Object.getOwnPropertyDescriptor(A,j):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(m,A,j,U);else for(var ce=m.length-1;ce>=0;ce--)(W=m[ce])&&(re=(z<3?W(re):z>3?W(A,j,re):W(A,j))||re);return z>3&&re&&Object.defineProperty(A,j,re),re},g=this&&this.__param||function(m,A){return function(j,U){A(j,U,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionService=void 0;const h=f(9806),p=f(9504),S=f(456),E=f(4725),v=f(8460),l=f(844),c=f(6114),n=f(4841),o=f(511),_=f(2585),b=" ",w=new RegExp(b,"g");let C=u.SelectionService=class extends l.Disposable{constructor(m,A,j,U,W,z,re,ce,F){super(),this._element=m,this._screenElement=A,this._linkifier=j,this._bufferService=U,this._coreService=W,this._mouseService=z,this._optionsService=re,this._renderService=ce,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new o.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.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 m=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!m||!A||m[0]===A[0]&&m[1]===A[1])}get selectionText(){const m=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;if(!m||!A)return"";const j=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(m[0]===A[0])return"";const W=m[0]<A[0]?m[0]:A[0],z=m[0]<A[0]?A[0]:m[0];for(let re=m[1];re<=A[1];re++){const ce=j.translateBufferLineToString(re,!0,W,z);U.push(ce)}}else{const W=m[1]===A[1]?A[0]:void 0;U.push(j.translateBufferLineToString(m[1],!0,m[0],W));for(let z=m[1]+1;z<=A[1]-1;z++){const re=j.lines.get(z),ce=j.translateBufferLineToString(z,!0);re!=null&&re.isWrapped?U[U.length-1]+=ce:U.push(ce)}if(m[1]!==A[1]){const z=j.lines.get(A[1]),re=j.translateBufferLineToString(A[1],!0,0,A[0]);z&&z.isWrapped?U[U.length-1]+=re:U.push(re)}}return U.map((W=>W.replace(w," "))).join(c.isWindows?`\r
231
- `:`
232
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&m&&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(m){const A=this._getMouseBufferCoords(m),j=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(j&&U&&A)&&this._areCoordsInSelection(A,j,U)}isCellInSelection(m,A){const j=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!j||!U)&&this._areCoordsInSelection([m,A],j,U)}_areCoordsInSelection(m,A,j){return m[1]>A[1]&&m[1]<j[1]||A[1]===j[1]&&m[1]===A[1]&&m[0]>=A[0]&&m[0]<j[0]||A[1]<j[1]&&m[1]===j[1]&&m[0]<j[0]||A[1]<j[1]&&m[1]===A[1]&&m[0]>=A[0]}_selectWordAtCursor(m,A){var W,z;const j=(z=(W=this._linkifier.currentLink)==null?void 0:W.link)==null?void 0:z.range;if(j)return this._model.selectionStart=[j.start.x-1,j.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(j,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(m);return!!U&&(this._selectWordAt(U,A),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,A){this._model.clearSelection(),m=Math.max(m,0),A=Math.min(A,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,A],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const A=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(A)return A[0]--,A[1]--,A[1]+=this._bufferService.buffer.ydisp,A}_getMouseEventScrollAmount(m){let A=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const j=this._renderService.dimensions.css.canvas.height;return A>=0&&A<=j?0:(A>j&&(A-=j),A=Math.min(Math.max(A,-50),50),A/=50,A/Math.abs(A)+Math.round(14*A))}shouldForceSelection(m){return c.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const A=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);A&&A.length!==this._model.selectionStart[0]&&A.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const A=this._getMouseBufferCoords(m);A&&(this._activeSelectionMode=2,this._selectLineAt(A[1]))}shouldColumnSelect(m){return m.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const A=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const j=this._bufferService.buffer;if(this._model.selectionEnd[1]<j.lines.length){const U=j.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}A&&A[0]===this._model.selectionEnd[0]&&A[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 m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const A=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&A<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const j=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(j&&j[0]!==void 0&&j[1]!==void 0){const U=(0,p.moveToCellSequence)(j[0]-1,j[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,A=this._model.finalSelectionEnd,j=!(!m||!A||m[0]===A[0]&&m[1]===A[1]);j?m&&A&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&A[0]===this._oldSelectionEnd[0]&&A[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,A,j)):this._oldHasSelection&&this._fireOnSelectionChange(m,A,j)}_fireOnSelectionChange(m,A,j){this._oldSelectionStart=m,this._oldSelectionEnd=A,this._oldHasSelection=j,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim((A=>this._handleTrim(A)))}_convertViewportColToCharacterIndex(m,A){let j=A;for(let U=0;A>=U;U++){const W=m.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?j--:W>1&&A!==U&&(j+=W-1)}return j}setSelection(m,A,j){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,A],this._model.selectionStartLength=j,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,A,j=!0,U=!0){if(m[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,z=W.lines.get(m[1]);if(!z)return;const re=W.translateBufferLineToString(m[1],!1);let ce=this._convertViewportColToCharacterIndex(z,m[0]),F=ce;const K=m[0]-ce;let te=0,T=0,B=0,D=0;if(re.charAt(ce)===" "){for(;ce>0&&re.charAt(ce-1)===" ";)ce--;for(;F<re.length&&re.charAt(F+1)===" ";)F++}else{let ae=m[0],J=m[0];z.getWidth(ae)===0&&(te++,ae--),z.getWidth(J)===2&&(T++,J++);const V=z.getString(J).length;for(V>1&&(D+=V-1,F+=V-1);ae>0&&ce>0&&!this._isCharWordSeparator(z.loadCell(ae-1,this._workCell));){z.loadCell(ae-1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,ae--):N>1&&(B+=N-1,ce-=N-1),ce--,ae--}for(;J<z.length&&F+1<re.length&&!this._isCharWordSeparator(z.loadCell(J+1,this._workCell));){z.loadCell(J+1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,J++):N>1&&(D+=N-1,F+=N-1),F++,J++}}F++;let O=ce+K-te+B,G=Math.min(this._bufferService.cols,F-ce+te+T-B-D);if(A||re.slice(ce,F).trim()!==""){if(j&&O===0&&z.getCodePoint(0)!==32){const ae=W.lines.get(m[1]-1);if(ae&&z.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(J){const V=this._bufferService.cols-J.start;O-=V,G+=V}}}if(U&&O+G===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){const ae=W.lines.get(m[1]+1);if(ae!=null&&ae.isWrapped&&ae.getCodePoint(0)!==32){const J=this._getWordAt([0,m[1]+1],!1,!1,!0);J&&(G+=J.length)}}return{start:O,length:G}}}_selectWordAt(m,A){const j=this._getWordAt(m,A);if(j){for(;j.start<0;)j.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[j.start,m[1]],this._model.selectionStartLength=j.length}}_selectToWordAt(m){const A=this._getWordAt(m,!0);if(A){let j=m[1];for(;A.start<0;)A.start+=this._bufferService.cols,j--;if(!this._model.areSelectionValuesReversed())for(;A.start+A.length>this._bufferService.cols;)A.length-=this._bufferService.cols,j++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?A.start:A.start+A.length,j]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const A=this._bufferService.buffer.getWrappedRangeForLine(m),j={start:{x:0,y:A.first},end:{x:this._bufferService.cols-1,y:A.last}};this._model.selectionStart=[0,A.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(j,this._bufferService.cols)}};u.SelectionService=C=d([g(3,_.IBufferService),g(4,_.ICoreService),g(5,E.IMouseService),g(6,_.IOptionsService),g(7,E.IRenderService),g(8,E.ICoreBrowserService)],C)},4725:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ILinkProviderService=u.IThemeService=u.ICharacterJoinerService=u.ISelectionService=u.IRenderService=u.IMouseService=u.ICoreBrowserService=u.ICharSizeService=void 0;const d=f(8343);u.ICharSizeService=(0,d.createDecorator)("CharSizeService"),u.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),u.IMouseService=(0,d.createDecorator)("MouseService"),u.IRenderService=(0,d.createDecorator)("RenderService"),u.ISelectionService=(0,d.createDecorator)("SelectionService"),u.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),u.IThemeService=(0,d.createDecorator)("ThemeService"),u.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(P,u,f){var d=this&&this.__decorate||function(C,m,A,j){var U,W=arguments.length,z=W<3?m:j===null?j=Object.getOwnPropertyDescriptor(m,A):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(C,m,A,j);else for(var re=C.length-1;re>=0;re--)(U=C[re])&&(z=(W<3?U(z):W>3?U(m,A,z):U(m,A))||z);return W>3&&z&&Object.defineProperty(m,A,z),z},g=this&&this.__param||function(C,m){return function(A,j){m(A,j,C)}};Object.defineProperty(u,"__esModule",{value:!0}),u.ThemeService=u.DEFAULT_ANSI_COLORS=void 0;const h=f(7239),p=f(8055),S=f(8460),E=f(844),v=f(2585),l=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),n=p.css.toColor("#ffffff"),o=p.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};u.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],m=[0,95,135,175,215,255];for(let A=0;A<216;A++){const j=m[A/36%6|0],U=m[A/6%6|0],W=m[A%6];C.push({css:p.channels.toCss(j,U,W),rgba:p.channels.toRgba(j,U,W)})}for(let A=0;A<24;A++){const j=8+10*A;C.push({css:p.channels.toCss(j,j,j),rgba:p.channels.toRgba(j,j,j)})}return C})());let b=u.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:c,cursor:n,cursorAccent:o,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:p.color.blend(c,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:p.color.blend(c,_),ansi:u.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(C={}){const m=this._colors;if(m.foreground=w(C.foreground,l),m.background=w(C.background,c),m.cursor=w(C.cursor,n),m.cursorAccent=w(C.cursorAccent,o),m.selectionBackgroundTransparent=w(C.selectionBackground,_),m.selectionBackgroundOpaque=p.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=w(C.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=p.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=C.selectionForeground?w(C.selectionForeground,p.NULL_COLOR):void 0,m.selectionForeground===p.NULL_COLOR&&(m.selectionForeground=void 0),p.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=p.color.opacity(m.selectionBackgroundTransparent,.3)),p.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=p.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=u.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=w(C.black,u.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=w(C.red,u.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=w(C.green,u.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=w(C.yellow,u.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=w(C.blue,u.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=w(C.magenta,u.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=w(C.cyan,u.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=w(C.white,u.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=w(C.brightBlack,u.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=w(C.brightRed,u.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=w(C.brightGreen,u.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=w(C.brightYellow,u.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=w(C.brightBlue,u.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=w(C.brightMagenta,u.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=w(C.brightCyan,u.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=w(C.brightWhite,u.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const A=Math.min(m.ansi.length-16,C.extendedAnsi.length);for(let j=0;j<A;j++)m.ansi[j+16]=w(C.extendedAnsi[j],u.DEFAULT_ANSI_COLORS[j+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(C){C(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 w(C,m){if(C!==void 0)try{return p.css.toColor(C)}catch{}return m}u.ThemeService=b=d([g(0,v.IOptionsService)],b)},6349:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CircularList=void 0;const d=f(8460),g=f(844);class h extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(S){if(this._maxLength===S)return;const E=new Array(S);for(let v=0;v<Math.min(S,this.length);v++)E[v]=this._array[this._getCyclicIndex(v)];this._array=E,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let E=this._length;E<S;E++)this._array[E]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,E){this._array[this._getCyclicIndex(S)]=E}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,E,...v){if(E){for(let l=S;l<this._length-E;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+E)];this._length-=E,this.onDeleteEmitter.fire({index:S,amount:E})}for(let l=this._length-1;l>=S;l--)this._array[this._getCyclicIndex(l+v.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<v.length;l++)this._array[this._getCyclicIndex(S+l)]=v[l];if(v.length&&this.onInsertEmitter.fire({index:S,amount:v.length}),this._length+v.length>this._maxLength){const l=this._length+v.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=v.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,E,v){if(!(E<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let c=E-1;c>=0;c--)this.set(S+c+v,this.get(S+c));const l=S+E+v-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<E;l++)this.set(S+l+v,this.get(S+l))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}u.CircularList=h},1439:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.clone=void 0,u.clone=function f(d,g=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const p in d)h[p]=g<=1?d[p]:d[p]&&f(d[p],g-1);return h}},8055:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.contrastRatio=u.toPaddedHex=u.rgba=u.rgb=u.css=u.color=u.channels=u.NULL_COLOR=void 0;let f=0,d=0,g=0,h=0;var p,S,E,v,l;function c(o){const _=o.toString(16);return _.length<2?"0"+_:_}function n(o,_){return o<_?(_+.05)/(o+.05):(o+.05)/(_+.05)}u.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(_,b,w,C){return C!==void 0?`#${c(_)}${c(b)}${c(w)}${c(C)}`:`#${c(_)}${c(b)}${c(w)}`},o.toRgba=function(_,b,w,C=255){return(_<<24|b<<16|w<<8|C)>>>0},o.toColor=function(_,b,w,C){return{css:o.toCss(_,b,w,C),rgba:o.toRgba(_,b,w,C)}}})(p||(u.channels=p={})),(function(o){function _(b,w){return h=Math.round(255*w),[f,d,g]=l.toChannels(b.rgba),{css:p.toCss(f,d,g,h),rgba:p.toRgba(f,d,g,h)}}o.blend=function(b,w){if(h=(255&w.rgba)/255,h===1)return{css:w.css,rgba:w.rgba};const C=w.rgba>>24&255,m=w.rgba>>16&255,A=w.rgba>>8&255,j=b.rgba>>24&255,U=b.rgba>>16&255,W=b.rgba>>8&255;return f=j+Math.round((C-j)*h),d=U+Math.round((m-U)*h),g=W+Math.round((A-W)*h),{css:p.toCss(f,d,g),rgba:p.toRgba(f,d,g)}},o.isOpaque=function(b){return(255&b.rgba)==255},o.ensureContrastRatio=function(b,w,C){const m=l.ensureContrastRatio(b.rgba,w.rgba,C);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},o.opaque=function(b){const w=(255|b.rgba)>>>0;return[f,d,g]=l.toChannels(w),{css:p.toCss(f,d,g),rgba:w}},o.opacity=_,o.multiplyOpacity=function(b,w){return h=255&b.rgba,_(b,h*w/255)},o.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}})(S||(u.color=S={})),(function(o){let _,b;try{const w=document.createElement("canvas");w.width=1,w.height=1;const C=w.getContext("2d",{willReadFrequently:!0});C&&(_=C,_.globalCompositeOperation="copy",b=_.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return f=parseInt(w.slice(1,2).repeat(2),16),d=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),p.toColor(f,d,g);case 5:return f=parseInt(w.slice(1,2).repeat(2),16),d=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),h=parseInt(w.slice(4,5).repeat(2),16),p.toColor(f,d,g,h);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const C=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return f=parseInt(C[1]),d=parseInt(C[2]),g=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),p.toColor(f,d,g,h);if(!_||!b)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=b,_.fillStyle=w,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[f,d,g,h]=_.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(f,d,g,h),css:w}}})(E||(u.css=E={})),(function(o){function _(b,w,C){const m=b/255,A=w/255,j=C/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}o.relativeLuminance=function(b){return _(b>>16&255,b>>8&255,255&b)},o.relativeLuminance2=_})(v||(u.rgb=v={})),(function(o){function _(w,C,m){const A=w>>24&255,j=w>>16&255,U=w>>8&255;let W=C>>24&255,z=C>>16&255,re=C>>8&255,ce=n(v.relativeLuminance2(W,z,re),v.relativeLuminance2(A,j,U));for(;ce<m&&(W>0||z>0||re>0);)W-=Math.max(0,Math.ceil(.1*W)),z-=Math.max(0,Math.ceil(.1*z)),re-=Math.max(0,Math.ceil(.1*re)),ce=n(v.relativeLuminance2(W,z,re),v.relativeLuminance2(A,j,U));return(W<<24|z<<16|re<<8|255)>>>0}function b(w,C,m){const A=w>>24&255,j=w>>16&255,U=w>>8&255;let W=C>>24&255,z=C>>16&255,re=C>>8&255,ce=n(v.relativeLuminance2(W,z,re),v.relativeLuminance2(A,j,U));for(;ce<m&&(W<255||z<255||re<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),z=Math.min(255,z+Math.ceil(.1*(255-z))),re=Math.min(255,re+Math.ceil(.1*(255-re))),ce=n(v.relativeLuminance2(W,z,re),v.relativeLuminance2(A,j,U));return(W<<24|z<<16|re<<8|255)>>>0}o.blend=function(w,C){if(h=(255&C)/255,h===1)return C;const m=C>>24&255,A=C>>16&255,j=C>>8&255,U=w>>24&255,W=w>>16&255,z=w>>8&255;return f=U+Math.round((m-U)*h),d=W+Math.round((A-W)*h),g=z+Math.round((j-z)*h),p.toRgba(f,d,g)},o.ensureContrastRatio=function(w,C,m){const A=v.relativeLuminance(w>>8),j=v.relativeLuminance(C>>8);if(n(A,j)<m){if(j<A){const z=_(w,C,m),re=n(A,v.relativeLuminance(z>>8));if(re<m){const ce=b(w,C,m);return re>n(A,v.relativeLuminance(ce>>8))?z:ce}return z}const U=b(w,C,m),W=n(A,v.relativeLuminance(U>>8));if(W<m){const z=_(w,C,m);return W>n(A,v.relativeLuminance(z>>8))?U:z}return U}},o.reduceLuminance=_,o.increaseLuminance=b,o.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(l||(u.rgba=l={})),u.toPaddedHex=c,u.contrastRatio=n},8969:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreTerminal=void 0;const d=f(844),g=f(2585),h=f(4348),p=f(7866),S=f(744),E=f(7302),v=f(6975),l=f(8460),c=f(1753),n=f(1480),o=f(7994),_=f(9282),b=f(5435),w=f(5981),C=f(2660);let m=!1;class A extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((U=>{var W;(W=this._onScrollApi)==null||W.fire(U.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(U){for(const W in U)this.optionsService.options[W]=U[W]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new E.OptionsService(U)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(n.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(o.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.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((W=>{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((W=>{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 w.WriteBuffer(((W,z)=>this._inputHandler.parse(W,z)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,W){this._writeBuffer.write(U,W)}writeSync(U,W){this._logService.logLevel<=g.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(U,W)}input(U,W=!0){this.coreService.triggerDataEvent(U,W)}resize(U,W){isNaN(U)||isNaN(W)||(U=Math.max(U,S.MINIMUM_COLS),W=Math.max(W,S.MINIMUM_ROWS),this._bufferService.resize(U,W))}scroll(U,W=!1){this._bufferService.scroll(U,W)}scrollLines(U,W,z){this._bufferService.scrollLines(U,W,z)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const W=U-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(U,W){return this._inputHandler.registerEscHandler(U,W)}registerDcsHandler(U,W){return this._inputHandler.registerDcsHandler(U,W)}registerCsiHandler(U,W){return this._inputHandler.registerCsiHandler(U,W)}registerOscHandler(U,W){return this._inputHandler.registerOscHandler(U,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?U=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of U)W.dispose()}))}}}u.CoreTerminal=A},8460:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.runAndSubscribe=u.forwardEvent=u.EventEmitter=void 0,u.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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===f)return void this._listeners.splice(d,1)}}})),this._event}fire(f,d){const g=[];for(let h=0;h<this._listeners.length;h++)g.push(this._listeners[h]);for(let h=0;h<g.length;h++)g[h].call(void 0,f,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},u.forwardEvent=function(f,d){return f((g=>d.fire(g)))},u.runAndSubscribe=function(f,d){return d(void 0),f((g=>d(g)))}},5435:function(P,u,f){var d=this&&this.__decorate||function(te,T,B,D){var O,G=arguments.length,ae=G<3?T:D===null?D=Object.getOwnPropertyDescriptor(T,B):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(te,T,B,D);else for(var J=te.length-1;J>=0;J--)(O=te[J])&&(ae=(G<3?O(ae):G>3?O(T,B,ae):O(T,B))||ae);return G>3&&ae&&Object.defineProperty(T,B,ae),ae},g=this&&this.__param||function(te,T){return function(B,D){T(B,D,te)}};Object.defineProperty(u,"__esModule",{value:!0}),u.InputHandler=u.WindowsOptionsReportType=void 0;const h=f(2584),p=f(7116),S=f(2015),E=f(844),v=f(482),l=f(8437),c=f(8460),n=f(643),o=f(511),_=f(3734),b=f(2585),w=f(1480),C=f(6242),m=f(6351),A=f(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function W(te,T){if(te>24)return T.setWinLines||!1;switch(te){case 1:return!!T.restoreWin;case 2:return!!T.minimizeWin;case 3:return!!T.setWinPosition;case 4:return!!T.setWinSizePixels;case 5:return!!T.raiseWin;case 6:return!!T.lowerWin;case 7:return!!T.refreshWin;case 8:return!!T.setWinSizeChars;case 9:return!!T.maximizeWin;case 10:return!!T.fullscreenWin;case 11:return!!T.getWinState;case 13:return!!T.getWinPosition;case 14:return!!T.getWinSizePixels;case 15:return!!T.getScreenSizePixels;case 16:return!!T.getCellSizePixels;case 18:return!!T.getWinSizeChars;case 19:return!!T.getScreenSizeChars;case 20:return!!T.getIconTitle;case 21:return!!T.getWinTitle;case 22:return!!T.pushTitle;case 23:return!!T.popTitle;case 24:return!!T.setWinLines}return!1}var z;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(z||(u.WindowsOptionsReportType=z={}));let re=0;class ce extends E.Disposable{getAttrData(){return this._curAttrData}constructor(T,B,D,O,G,ae,J,V,N=new S.EscapeSequenceParser){super(),this._bufferService=T,this._charsetService=B,this._coreService=D,this._logService=O,this._optionsService=G,this._oscLinkService=ae,this._coreMouseService=J,this._unicodeService=V,this._parser=N,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new o.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._parser.setCsiHandlerFallback(((R,Z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:Z.toArray()})})),this._parser.setEscHandlerFallback((R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})})),this._parser.setExecuteHandlerFallback((R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})})),this._parser.setOscHandlerFallback(((R,Z,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:Z,data:le})})),this._parser.setDcsHandlerFallback(((R,Z,le)=>{Z==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:Z,payload:le})})),this._parser.setPrintHandler(((R,Z,le)=>this.print(R,Z,le))),this._parser.registerCsiHandler({final:"@"},(R=>this.insertChars(R))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(R=>this.scrollLeft(R))),this._parser.registerCsiHandler({final:"A"},(R=>this.cursorUp(R))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(R=>this.scrollRight(R))),this._parser.registerCsiHandler({final:"B"},(R=>this.cursorDown(R))),this._parser.registerCsiHandler({final:"C"},(R=>this.cursorForward(R))),this._parser.registerCsiHandler({final:"D"},(R=>this.cursorBackward(R))),this._parser.registerCsiHandler({final:"E"},(R=>this.cursorNextLine(R))),this._parser.registerCsiHandler({final:"F"},(R=>this.cursorPrecedingLine(R))),this._parser.registerCsiHandler({final:"G"},(R=>this.cursorCharAbsolute(R))),this._parser.registerCsiHandler({final:"H"},(R=>this.cursorPosition(R))),this._parser.registerCsiHandler({final:"I"},(R=>this.cursorForwardTab(R))),this._parser.registerCsiHandler({final:"J"},(R=>this.eraseInDisplay(R,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(R=>this.eraseInDisplay(R,!0))),this._parser.registerCsiHandler({final:"K"},(R=>this.eraseInLine(R,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(R=>this.eraseInLine(R,!0))),this._parser.registerCsiHandler({final:"L"},(R=>this.insertLines(R))),this._parser.registerCsiHandler({final:"M"},(R=>this.deleteLines(R))),this._parser.registerCsiHandler({final:"P"},(R=>this.deleteChars(R))),this._parser.registerCsiHandler({final:"S"},(R=>this.scrollUp(R))),this._parser.registerCsiHandler({final:"T"},(R=>this.scrollDown(R))),this._parser.registerCsiHandler({final:"X"},(R=>this.eraseChars(R))),this._parser.registerCsiHandler({final:"Z"},(R=>this.cursorBackwardTab(R))),this._parser.registerCsiHandler({final:"`"},(R=>this.charPosAbsolute(R))),this._parser.registerCsiHandler({final:"a"},(R=>this.hPositionRelative(R))),this._parser.registerCsiHandler({final:"b"},(R=>this.repeatPrecedingCharacter(R))),this._parser.registerCsiHandler({final:"c"},(R=>this.sendDeviceAttributesPrimary(R))),this._parser.registerCsiHandler({prefix:">",final:"c"},(R=>this.sendDeviceAttributesSecondary(R))),this._parser.registerCsiHandler({final:"d"},(R=>this.linePosAbsolute(R))),this._parser.registerCsiHandler({final:"e"},(R=>this.vPositionRelative(R))),this._parser.registerCsiHandler({final:"f"},(R=>this.hVPosition(R))),this._parser.registerCsiHandler({final:"g"},(R=>this.tabClear(R))),this._parser.registerCsiHandler({final:"h"},(R=>this.setMode(R))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(R=>this.setModePrivate(R))),this._parser.registerCsiHandler({final:"l"},(R=>this.resetMode(R))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(R=>this.resetModePrivate(R))),this._parser.registerCsiHandler({final:"m"},(R=>this.charAttributes(R))),this._parser.registerCsiHandler({final:"n"},(R=>this.deviceStatus(R))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(R=>this.deviceStatusPrivate(R))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(R=>this.softReset(R))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(R=>this.setCursorStyle(R))),this._parser.registerCsiHandler({final:"r"},(R=>this.setScrollRegion(R))),this._parser.registerCsiHandler({final:"s"},(R=>this.saveCursor(R))),this._parser.registerCsiHandler({final:"t"},(R=>this.windowOptions(R))),this._parser.registerCsiHandler({final:"u"},(R=>this.restoreCursor(R))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(R=>this.insertColumns(R))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(R=>this.deleteColumns(R))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(R=>this.selectProtected(R))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(R=>this.requestMode(R,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(R=>this.requestMode(R,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((R=>(this.setTitle(R),this.setIconName(R),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((R=>this.setIconName(R)))),this._parser.registerOscHandler(2,new C.OscHandler((R=>this.setTitle(R)))),this._parser.registerOscHandler(4,new C.OscHandler((R=>this.setOrReportIndexedColor(R)))),this._parser.registerOscHandler(8,new C.OscHandler((R=>this.setHyperlink(R)))),this._parser.registerOscHandler(10,new C.OscHandler((R=>this.setOrReportFgColor(R)))),this._parser.registerOscHandler(11,new C.OscHandler((R=>this.setOrReportBgColor(R)))),this._parser.registerOscHandler(12,new C.OscHandler((R=>this.setOrReportCursorColor(R)))),this._parser.registerOscHandler(104,new C.OscHandler((R=>this.restoreIndexedColor(R)))),this._parser.registerOscHandler(110,new C.OscHandler((R=>this.restoreFgColor(R)))),this._parser.registerOscHandler(111,new C.OscHandler((R=>this.restoreBgColor(R)))),this._parser.registerOscHandler(112,new C.OscHandler((R=>this.restoreCursorColor(R)))),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 R in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},(()=>this.selectCharset("("+R))),this._parser.registerEscHandler({intermediates:")",final:R},(()=>this.selectCharset(")"+R))),this._parser.registerEscHandler({intermediates:"*",final:R},(()=>this.selectCharset("*"+R))),this._parser.registerEscHandler({intermediates:"+",final:R},(()=>this.selectCharset("+"+R))),this._parser.registerEscHandler({intermediates:"-",final:R},(()=>this.selectCharset("-"+R))),this._parser.registerEscHandler({intermediates:".",final:R},(()=>this.selectCharset("."+R))),this._parser.registerEscHandler({intermediates:"/",final:R},(()=>this.selectCharset("/"+R)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((R=>(this._logService.error("Parsing error: ",R),R))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((R,Z)=>this.requestStatusString(R,Z))))}_preserveStack(T,B,D,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=T,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=D,this._parseStack.position=O}_logSlowResolvingAsync(T){this._logService.logLevel<=b.LogLevelEnum.WARN&&Promise.race([T,new Promise(((B,D)=>setTimeout((()=>D("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(T,B){let D,O=this._activeBuffer.x,G=this._activeBuffer.y,ae=0;const J=this._parseStack.paused;if(J){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(D),D;O=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,T.length>U&&(ae=this._parseStack.position+U)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof T=="string"?` "${T}"`:` "${Array.prototype.map.call(T,(R=>String.fromCharCode(R))).join("")}"`),typeof T=="string"?T.split("").map((R=>R.charCodeAt(0))):T),this._parseBuffer.length<T.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(T.length,U))),J||this._dirtyRowTracker.clearRange(),T.length>U)for(let R=ae;R<T.length;R+=U){const Z=R+U<T.length?R+U:T.length,le=typeof T=="string"?this._stringDecoder.decode(T.substring(R,Z),this._parseBuffer):this._utf8Decoder.decode(T.subarray(R,Z),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,le))return this._preserveStack(O,G,le,R),this._logSlowResolvingAsync(D),D}else if(!J){const R=typeof T=="string"?this._stringDecoder.decode(T,this._parseBuffer):this._utf8Decoder.decode(T,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,R))return this._preserveStack(O,G,R,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===O&&this._activeBuffer.y===G||this._onCursorMove.fire();const V=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),N=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);N<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(N,this._bufferService.rows-1),Math.min(V,this._bufferService.rows-1))}print(T,B,D){let O,G;const ae=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,V=this._bufferService.cols,N=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,Z=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-B>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Z);let de=this._parser.precedingJoinState;for(let _e=B;_e<D;++_e){if(O=T[_e],O<127&&ae){const De=ae[String.fromCharCode(O)];De&&(O=De.charCodeAt(0))}const Ee=this._unicodeService.charProperties(O,de);G=w.UnicodeService.extractWidth(Ee);const Le=w.UnicodeService.extractShouldJoin(Ee),ve=Le?w.UnicodeService.extractWidth(de):0;if(de=Ee,J&&this._onA11yChar.fire((0,v.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+G-ve>V){if(N){const De=le;let ye=this._activeBuffer.x-ve;for(this._activeBuffer.x=ve,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),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ve>0&&le instanceof l.BufferLine&&le.copyCellsFrom(De,ye,0,ve,!1);ye<V;)De.setCellFromCodepoint(ye++,0,1,Z)}else if(this._activeBuffer.x=V-1,G===2)continue}if(Le&&this._activeBuffer.x){const De=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-De,O,G);for(let ye=G-ve;--ye>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}else if(R&&(le.insertCells(this._activeBuffer.x,G-ve,this._activeBuffer.getNullCell(Z)),le.getWidth(V-1)===2&&le.setCellFromCodepoint(V-1,n.NULL_CELL_CODE,n.NULL_CELL_WIDTH,Z)),le.setCellFromCodepoint(this._activeBuffer.x++,O,G,Z),G>0)for(;--G;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}this._parser.precedingJoinState=de,this._activeBuffer.x<V&&D-B>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,Z),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(T,B){return T.final!=="t"||T.prefix||T.intermediates?this._parser.registerCsiHandler(T,B):this._parser.registerCsiHandler(T,(D=>!W(D.params[0],this._optionsService.rawOptions.windowOptions)||B(D)))}registerDcsHandler(T,B){return this._parser.registerDcsHandler(T,new m.DcsHandler(B))}registerEscHandler(T,B){return this._parser.registerEscHandler(T,B)}registerOscHandler(T,B){return this._parser.registerOscHandler(T,new C.OscHandler(B))}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 T;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&&((T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&T.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const T=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-T),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(T=this._bufferService.cols-1){this._activeBuffer.x=Math.min(T,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(T,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=T,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=T,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(T,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+T,this._activeBuffer.y+B)}cursorUp(T){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,T.params[0]||1)):this._moveCursor(0,-(T.params[0]||1)),!0}cursorDown(T){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,T.params[0]||1)):this._moveCursor(0,T.params[0]||1),!0}cursorForward(T){return this._moveCursor(T.params[0]||1,0),!0}cursorBackward(T){return this._moveCursor(-(T.params[0]||1),0),!0}cursorNextLine(T){return this.cursorDown(T),this._activeBuffer.x=0,!0}cursorPrecedingLine(T){return this.cursorUp(T),this._activeBuffer.x=0,!0}cursorCharAbsolute(T){return this._setCursor((T.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(T){return this._setCursor(T.length>=2?(T.params[1]||1)-1:0,(T.params[0]||1)-1),!0}charPosAbsolute(T){return this._setCursor((T.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(T){return this._moveCursor(T.params[0]||1,0),!0}linePosAbsolute(T){return this._setCursor(this._activeBuffer.x,(T.params[0]||1)-1),!0}vPositionRelative(T){return this._moveCursor(0,T.params[0]||1),!0}hVPosition(T){return this.cursorPosition(T),!0}tabClear(T){const B=T.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(T){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=T.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(T){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=T.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(T){const B=T.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(T,B,D,O=!1,G=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);ae.replaceCells(B,D,this._activeBuffer.getNullCell(this._eraseAttrData()),G),O&&(ae.isWrapped=!1)}_resetBufferLine(T,B=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+T),D.isWrapped=!1)}eraseInDisplay(T,B=!1){let D;switch(this._restrictCursor(this._bufferService.cols),T.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);D<this._bufferService.rows;D++)this._resetBufferLine(D,B);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,B);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(T,B=!1){switch(this._restrictCursor(this._bufferService.cols),T.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(T){this._restrictCursor();let B=T.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;B--;)this._activeBuffer.lines.splice(G-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(T){this._restrictCursor();let B=T.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=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;B--;)this._activeBuffer.lines.splice(D,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(T){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,T.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(T){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,T.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(T){let B=T.params[0]||1;for(;B--;)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(T){let B=T.params[0]||1;for(;B--;)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(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=T.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=T.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=T.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=T.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(T){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(T.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(T){const B=this._parser.precedingJoinState;if(!B)return!0;const D=T.params[0]||1,O=w.UnicodeService.extractWidth(B),G=this._activeBuffer.x-O,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(G),J=new Uint32Array(ae.length*D);let V=0;for(let R=0;R<ae.length;){const Z=ae.codePointAt(R)||0;J[V++]=Z,R+=Z>65535?2:1}let N=V;for(let R=1;R<D;++R)J.copyWithin(N,0,V),N+=V;return this.print(J,0,N),!0}sendDeviceAttributesPrimary(T){return T.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(T){return T.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(T.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(T){return(this._optionsService.rawOptions.termName+"").indexOf(T)===0}setMode(T){for(let B=0;B<T.length;B++)switch(T.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(T){for(let B=0;B<T.length;B++)switch(T.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(T){for(let B=0;B<T.length;B++)switch(T.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(T){for(let B=0;B<T.length;B++)switch(T.params[B]){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(),T.params[B]===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(T,B){const D=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:G}=this._coreMouseService,ae=this._coreService,{buffers:J,cols:V}=this._bufferService,{active:N,alt:R}=J,Z=this._optionsService.rawOptions,le=Le=>Le?1:2,de=T.params[0];return _e=de,Ee=B?de===2?4:de===4?le(ae.modes.insertMode):de===12?3:de===20?le(Z.convertEol):0:de===1?le(D.applicationCursorKeys):de===3?Z.windowOptions.setWinLines?V===80?2:V===132?1:0:0:de===6?le(D.origin):de===7?le(D.wraparound):de===8?3:de===9?le(O==="X10"):de===12?le(Z.cursorBlink):de===25?le(!ae.isCursorHidden):de===45?le(D.reverseWraparound):de===66?le(D.applicationKeypad):de===67?4:de===1e3?le(O==="VT200"):de===1002?le(O==="DRAG"):de===1003?le(O==="ANY"):de===1004?le(D.sendFocus):de===1005?4:de===1006?le(G==="SGR"):de===1015?4:de===1016?le(G==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?le(N===R):de===2004?le(D.bracketedPasteMode):0,ae.triggerDataEvent(`${h.C0.ESC}[${B?"":"?"}${_e};${Ee}$y`),!0;var _e,Ee}_updateAttrColor(T,B,D,O,G){return B===2?(T|=50331648,T&=-16777216,T|=_.AttributeData.fromColorRGB([D,O,G])):B===5&&(T&=-50331904,T|=33554432|255&D),T}_extractColor(T,B,D){const O=[0,0,-1,0,0,0];let G=0,ae=0;do{if(O[ae+G]=T.params[B+ae],T.hasSubParams(B+ae)){const J=T.getSubParams(B+ae);let V=0;do O[1]===5&&(G=1),O[ae+V+1+G]=J[V];while(++V<J.length&&V+ae+1+G<O.length);break}if(O[1]===5&&ae+G>=2||O[1]===2&&ae+G>=5)break;O[1]&&(G=1)}while(++ae+B<T.length&&ae+G<O.length);for(let J=2;J<O.length;++J)O[J]===-1&&(O[J]=0);switch(O[0]){case 38:D.fg=this._updateAttrColor(D.fg,O[1],O[3],O[4],O[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,O[1],O[3],O[4],O[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,O[1],O[3],O[4],O[5])}return ae}_processUnderline(T,B){B.extended=B.extended.clone(),(!~T||T>5)&&(T=1),B.extended.underlineStyle=T,B.fg|=268435456,T===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(T){T.fg=l.DEFAULT_ATTR_DATA.fg,T.bg=l.DEFAULT_ATTR_DATA.bg,T.extended=T.extended.clone(),T.extended.underlineStyle=0,T.extended.underlineColor&=-67108864,T.updateExtended()}charAttributes(T){if(T.length===1&&T.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=T.length;let D;const O=this._curAttrData;for(let G=0;G<B;G++)D=T.params[G],D>=30&&D<=37?(O.fg&=-50331904,O.fg|=16777216|D-30):D>=40&&D<=47?(O.bg&=-50331904,O.bg|=16777216|D-40):D>=90&&D<=97?(O.fg&=-50331904,O.fg|=16777224|D-90):D>=100&&D<=107?(O.bg&=-50331904,O.bg|=16777224|D-100):D===0?this._processSGR0(O):D===1?O.fg|=134217728:D===3?O.bg|=67108864:D===4?(O.fg|=268435456,this._processUnderline(T.hasSubParams(G)?T.getSubParams(G)[0]:1,O)):D===5?O.fg|=536870912:D===7?O.fg|=67108864:D===8?O.fg|=1073741824:D===9?O.fg|=2147483648:D===2?O.bg|=134217728:D===21?this._processUnderline(2,O):D===22?(O.fg&=-134217729,O.bg&=-134217729):D===23?O.bg&=-67108865:D===24?(O.fg&=-268435457,this._processUnderline(0,O)):D===25?O.fg&=-536870913:D===27?O.fg&=-67108865:D===28?O.fg&=-1073741825:D===29?O.fg&=2147483647:D===39?(O.fg&=-67108864,O.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):D===49?(O.bg&=-67108864,O.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?G+=this._extractColor(T,G,O):D===53?O.bg|=1073741824:D===55?O.bg&=-1073741825:D===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):D===100?(O.fg&=-67108864,O.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(T){switch(T.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${B};${D}R`)}return!0}deviceStatusPrivate(T){if(T.params[0]===6){const B=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${B};${D}R`)}return!0}softReset(T){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(T){const B=T.params[0]||1;switch(B){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 D=B%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(T){const B=T.params[0]||1;let D;return(T.length<2||(D=T.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(T){if(!W(T.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=T.length>1?T.params[1]:0;switch(T.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(T){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(T){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(T){return this._windowTitle=T,this._onTitleChange.fire(T),!0}setIconName(T){return this._iconName=T,!0}setOrReportIndexedColor(T){const B=[],D=T.split(";");for(;D.length>1;){const O=D.shift(),G=D.shift();if(/^\d+$/.exec(O)){const ae=parseInt(O);if(K(ae))if(G==="?")B.push({type:0,index:ae});else{const J=(0,A.parseColor)(G);J&&B.push({type:1,index:ae,color:J})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(T){const B=T.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(T,B){this._getCurrentLinkId()&&this._finishHyperlink();const D=T.split(":");let O;const G=D.findIndex((ae=>ae.startsWith("id=")));return G!==-1&&(O=D[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(T,B){const D=T.split(";");for(let O=0;O<D.length&&!(B>=this._specialColors.length);++O,++B)if(D[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const G=(0,A.parseColor)(D[O]);G&&this._onColor.fire([{type:1,index:this._specialColors[B],color:G}])}return!0}setOrReportFgColor(T){return this._setOrReportSpecialColor(T,0)}setOrReportBgColor(T){return this._setOrReportSpecialColor(T,1)}setOrReportCursorColor(T){return this._setOrReportSpecialColor(T,2)}restoreIndexedColor(T){if(!T)return this._onColor.fire([{type:2}]),!0;const B=[],D=T.split(";");for(let O=0;O<D.length;++O)if(/^\d+$/.exec(D[O])){const G=parseInt(D[O]);K(G)&&B.push({type:2,index:G})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(T){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(T){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(T){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,p.DEFAULT_CHARSET),!0}selectCharset(T){return T.length!==2?(this.selectDefaultCharset(),!0):(T[0]==="/"||this._charsetService.setgCharset(j[T[0]],p.CHARSETS[T[1]]||p.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 T=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,T,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(T){return this._charsetService.setgLevel(T),!0}screenAlignmentPattern(){const T=new o.CellData;T.content=4194373,T.fg=this._curAttrData.fg,T.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const D=this._activeBuffer.ybase+this._activeBuffer.y+B,O=this._activeBuffer.lines.get(D);O&&(O.fill(T),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(T,B){const D=this._bufferService.buffer,O=this._optionsService.rawOptions;return(G=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${G}${h.C0.ESC}\\`),!0))(T==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:T==='"p'?'P1$r61;1"p':T==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:T==="m"?"P1$r0m":T===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(T,B){this._dirtyRowTracker.markRangeDirty(T,B)}}u.InputHandler=ce;let F=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){te<this.start?this.start=te:te>this.end&&(this.end=te)}markRangeDirty(te,T){te>T&&(re=te,te=T,T=re),te<this.start&&(this.start=te),T>this.end&&(this.end=T)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(te){return 0<=te&&te<256}F=d([g(0,b.IBufferService)],F)},844:(P,u)=>{function f(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(u,"__esModule",{value:!0}),u.getDisposeArrayDisposable=u.disposeArray=u.toDisposable=u.MutableDisposable=u.Disposable=void 0,u.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},u.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},u.toDisposable=function(d){return{dispose:d}},u.disposeArray=f,u.getDisposeArrayDisposable=function(d){return{dispose:()=>f(d)}}},1505:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.FourKeyMap=u.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(g,h,p){this._data[g]||(this._data[g]={}),this._data[g][h]=p}get(g,h){return this._data[g]?this._data[g][h]:void 0}clear(){this._data={}}}u.TwoKeyMap=f,u.FourKeyMap=class{constructor(){this._data=new f}set(d,g,h,p,S){this._data.get(d,g)||this._data.set(d,g,new f),this._data.get(d,g).set(h,p,S)}get(d,g,h,p){var S;return(S=this._data.get(d,g))==null?void 0:S.get(h,p)}clear(){this._data.clear()}}},6114:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.isChromeOS=u.isLinux=u.isWindows=u.isIphone=u.isIpad=u.isMac=u.getSafariVersion=u.isSafari=u.isLegacyEdge=u.isFirefox=u.isNode=void 0,u.isNode=typeof process<"u"&&"title"in process;const f=u.isNode?"node":navigator.userAgent,d=u.isNode?"node":navigator.platform;u.isFirefox=f.includes("Firefox"),u.isLegacyEdge=f.includes("Edge"),u.isSafari=/^((?!chrome|android).)*safari/i.test(f),u.getSafariVersion=function(){if(!u.isSafari)return 0;const g=f.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},u.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),u.isIpad=d==="iPad",u.isIphone=d==="iPhone",u.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),u.isLinux=d.indexOf("Linux")>=0,u.isChromeOS=/\bCrOS\b/.test(f)},6106:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SortedList=void 0;let f=0;u.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(f=this._search(this._getKey(d)),this._array.splice(f,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(f=this._search(g),f===-1)||this._getKey(this._array[f])!==g)return!1;do if(this._array[f]===d)return this._array.splice(f,1),!0;while(++f<this._array.length&&this._getKey(this._array[f])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do yield this._array[f];while(++f<this._array.length&&this._getKey(this._array[f])===d)}forEachByKey(d,g){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do g(this._array[f]);while(++f<this._array.length&&this._getKey(this._array[f])===d)}values(){return[...this._array].values()}_search(d){let g=0,h=this._array.length-1;for(;h>=g;){let p=g+h>>1;const S=this._getKey(this._array[p]);if(S>d)h=p-1;else{if(!(S<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}g=p+1}}return g}}},7226:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DebouncedIdleTask=u.IdleTaskQueue=u.PriorityTaskQueue=void 0;const d=f(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let E=0,v=0,l=S.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),v=Math.max(E,v),c=S.timeRemaining(),1.5*v>c)return l-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-E))}ms`),void this._start();l=c}this.clear()}}class h extends g{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const E=Date.now()+S;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}u.PriorityTaskQueue=h,u.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:h,u.DebouncedIdleTask=class{constructor(){this._queue=new u.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.updateWindowsModeWrappedState=void 0;const d=f(643);u.updateWindowsModeWrappedState=function(g){const h=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=h==null?void 0:h.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&p&&(S.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ExtendedAttrs=u.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new f;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}u.AttributeData=f;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,p=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}u.ExtendedAttrs=d},9092:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Buffer=u.MAX_BUFFER_SIZE=void 0;const d=f(6349),g=f(7226),h=f(3734),p=f(8437),S=f(4634),E=f(511),v=f(643),l=f(4863),c=f(7116);u.MAX_BUFFER_SIZE=4294967295,u.Buffer=class{constructor(n,o,_){this._hasScrollback=n,this._optionsService=o,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(n){return n?(this._nullCell.fg=n.fg,this._nullCell.bg=n.bg,this._nullCell.extended=n.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(n){return n?(this._whitespaceCell.fg=n.fg,this._whitespaceCell.bg=n.bg,this._whitespaceCell.extended=n.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(n,o){return new p.BufferLine(this._bufferService.cols,this.getNullCell(n),o)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const n=this.ybase+this.y-this.ydisp;return n>=0&&n<this._rows}_getCorrectBufferLength(n){if(!this._hasScrollback)return n;const o=n+this._optionsService.rawOptions.scrollback;return o>u.MAX_BUFFER_SIZE?u.MAX_BUFFER_SIZE:o}fillViewportRows(n){if(this.lines.length===0){n===void 0&&(n=p.DEFAULT_ATTR_DATA);let o=this._rows;for(;o--;)this.lines.push(this.getBlankLine(n))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(n,o){const _=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=0;const w=this._getCorrectBufferLength(o);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<n)for(let m=0;m<this.lines.length;m++)b+=+this.lines.get(m).resize(n,_);let C=0;if(this._rows<o)for(let m=this._rows;m<o;m++)this.lines.length<o+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(n,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(n,_)));else for(let m=this._rows;m>o;m--)this.lines.length>o+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(w<this.lines.maxLength){const m=this.lines.length-w;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=w}this.x=Math.min(this.x,n-1),this.y=Math.min(this.y,o-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,n-1),this.scrollTop=0}if(this.scrollBottom=o-1,this._isReflowEnabled&&(this._reflow(n,o),this._cols>n))for(let C=0;C<this.lines.length;C++)b+=+this.lines.get(C).resize(n,_);this._cols=n,this._rows=o,this._memoryCleanupQueue.clear(),b>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let n=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,n=!1);let o=0;for(;this._memoryCleanupPosition<this.lines.length;)if(o+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),o>100)return!0;return n}get _isReflowEnabled(){const n=this._optionsService.rawOptions.windowsPty;return n&&n.buildNumber?this._hasScrollback&&n.backend==="conpty"&&n.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(n,o){this._cols!==n&&(n>this._cols?this._reflowLarger(n,o):this._reflowSmaller(n,o))}_reflowLarger(n,o){const _=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,n,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(_.length>0){const b=(0,S.reflowLargerCreateNewLayout)(this.lines,_);(0,S.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(n,o,b.countRemoved)}}_reflowLargerAdjustViewport(n,o,_){const b=this.getNullCell(p.DEFAULT_ATTR_DATA);let w=_;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<o&&this.lines.push(new p.BufferLine(n,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(n,o){const _=this.getNullCell(p.DEFAULT_ATTR_DATA),b=[];let w=0;for(let C=this.lines.length-1;C>=0;C--){let m=this.lines.get(C);if(!m||!m.isWrapped&&m.getTrimmedLength()<=n)continue;const A=[m];for(;m.isWrapped&&C>0;)m=this.lines.get(--C),A.unshift(m);const j=this.ybase+this.y;if(j>=C&&j<C+A.length)continue;const U=A[A.length-1].getTrimmedLength(),W=(0,S.reflowSmallerGetNewLineLengths)(A,this._cols,n),z=W.length-A.length;let re;re=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+z):Math.max(0,this.lines.length-this.lines.maxLength+z);const ce=[];for(let D=0;D<z;D++){const O=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);ce.push(O)}ce.length>0&&(b.push({start:C+A.length+w,newLines:ce}),w+=ce.length),A.push(...ce);let F=W.length-1,K=W[F];K===0&&(F--,K=W[F]);let te=A.length-z-1,T=U;for(;te>=0;){const D=Math.min(T,K);if(A[F]===void 0)break;if(A[F].copyCellsFrom(A[te],T-D,K-D,D,!0),K-=D,K===0&&(F--,K=W[F]),T-=D,T===0){te--;const O=Math.max(te,0);T=(0,S.getWrappedLineTrimmedLength)(A,O,this._cols)}}for(let D=0;D<A.length;D++)W[D]<n&&A[D].setCell(W[D],_);let B=z-re;for(;B-- >0;)this.ybase===0?this.y<o-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+w)-o&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+z,this.ybase+o-1)}if(b.length>0){const C=[],m=[];for(let F=0;F<this.lines.length;F++)m.push(this.lines.get(F));const A=this.lines.length;let j=A-1,U=0,W=b[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let z=0;for(let F=Math.min(this.lines.maxLength-1,A+w-1);F>=0;F--)if(W&&W.start>j+z){for(let K=W.newLines.length-1;K>=0;K--)this.lines.set(F--,W.newLines[K]);F++,C.push({index:j+1,amount:W.newLines.length}),z+=W.newLines.length,W=b[++U]}else this.lines.set(F,m[j--]);let re=0;for(let F=C.length-1;F>=0;F--)C[F].index+=re,this.lines.onInsertEmitter.fire(C[F]),re+=C[F].amount;const ce=Math.max(0,A+w-this.lines.maxLength);ce>0&&this.lines.onTrimEmitter.fire(ce)}}translateBufferLineToString(n,o,_=0,b){const w=this.lines.get(n);return w?w.translateToString(o,_,b):""}getWrappedRangeForLine(n){let o=n,_=n;for(;o>0&&this.lines.get(o).isWrapped;)o--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:o,last:_}}setupTabStops(n){for(n!=null?this.tabs[n]||(n=this.prevStop(n)):(this.tabs={},n=0);n<this._cols;n+=this._optionsService.rawOptions.tabStopWidth)this.tabs[n]=!0}prevStop(n){for(n==null&&(n=this.x);!this.tabs[--n]&&n>0;);return n>=this._cols?this._cols-1:n<0?0:n}nextStop(n){for(n==null&&(n=this.x);!this.tabs[++n]&&n<this._cols;);return n>=this._cols?this._cols-1:n<0?0:n}clearMarkers(n){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].line===n&&(this.markers[o].dispose(),this.markers.splice(o--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].dispose(),this.markers.splice(n--,1);this._isClearing=!1}addMarker(n){const o=new l.Marker(n);return this.markers.push(o),o.register(this.lines.onTrim((_=>{o.line-=_,o.line<0&&o.dispose()}))),o.register(this.lines.onInsert((_=>{o.line>=_.index&&(o.line+=_.amount)}))),o.register(this.lines.onDelete((_=>{o.line>=_.index&&o.line<_.index+_.amount&&o.dispose(),o.line>_.index&&(o.line-=_.amount)}))),o.register(o.onDispose((()=>this._removeMarker(o)))),o}_removeMarker(n){this._isClearing||this.markers.splice(this.markers.indexOf(n),1)}}},8437:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLine=u.DEFAULT_ATTR_DATA=void 0;const d=f(3734),g=f(511),h=f(643),p=f(482);u.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class E{constructor(l,c,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const o=c||g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let _=0;_<l;++_)this.setCell(_,o);this.length=l}get(l){const c=this._data[3*l+0],n=2097151&c;return[this._data[3*l+1],2097152&c?this._combined[l]:n?(0,p.stringFromCodePoint)(n):"",c>>22,2097152&c?this._combined[l].charCodeAt(this._combined[l].length-1):n]}set(l,c){this._data[3*l+1]=c[h.CHAR_DATA_ATTR_INDEX],c[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=c[1],this._data[3*l+0]=2097152|l|c[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=c[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const c=this._data[3*l+0];return 2097152&c?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&c}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const c=this._data[3*l+0];return 2097152&c?this._combined[l]:2097151&c?(0,p.stringFromCodePoint)(2097151&c):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,c){return S=3*l,c.content=this._data[S+0],c.fg=this._data[S+1],c.bg=this._data[S+2],2097152&c.content&&(c.combinedData=this._combined[l]),268435456&c.bg&&(c.extended=this._extendedAttrs[l]),c}setCell(l,c){2097152&c.content&&(this._combined[l]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[l]=c.extended),this._data[3*l+0]=c.content,this._data[3*l+1]=c.fg,this._data[3*l+2]=c.bg}setCellFromCodepoint(l,c,n,o){268435456&o.bg&&(this._extendedAttrs[l]=o.extended),this._data[3*l+0]=c|n<<22,this._data[3*l+1]=o.fg,this._data[3*l+2]=o.bg}addCodepointToCell(l,c,n){let o=this._data[3*l+0];2097152&o?this._combined[l]+=(0,p.stringFromCodePoint)(c):2097151&o?(this._combined[l]=(0,p.stringFromCodePoint)(2097151&o)+(0,p.stringFromCodePoint)(c),o&=-2097152,o|=2097152):o=c|4194304,n&&(o&=-12582913,o|=n<<22),this._data[3*l+0]=o}insertCells(l,c,n){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l-1,0,1,n),c<this.length-l){const o=new g.CellData;for(let _=this.length-l-c-1;_>=0;--_)this.setCell(l+c+_,this.loadCell(l+_,o));for(let _=0;_<c;++_)this.setCell(l+_,n)}else for(let o=l;o<this.length;++o)this.setCell(o,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(l,c,n){if(l%=this.length,c<this.length-l){const o=new g.CellData;for(let _=0;_<this.length-l-c;++_)this.setCell(l+_,this.loadCell(l+c+_,o));for(let _=this.length-c;_<this.length;++_)this.setCell(_,n)}else for(let o=l;o<this.length;++o)this.setCell(o,n);l&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l-1,0,1,n),this.getWidth(l)!==0||this.hasContent(l)||this.setCellFromCodepoint(l,0,1,n)}replaceCells(l,c,n,o=!1){if(o)for(l&&this.getWidth(l-1)===2&&!this.isProtected(l-1)&&this.setCellFromCodepoint(l-1,0,1,n),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,n);l<c&&l<this.length;)this.isProtected(l)||this.setCell(l,n),l++;else for(l&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l-1,0,1,n),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,n);l<c&&l<this.length;)this.setCell(l++,n)}resize(l,c){if(l===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const n=3*l;if(l>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{const o=new Uint32Array(n);o.set(this._data),this._data=o}for(let o=this.length;o<l;++o)this.setCell(o,c)}else{this._data=this._data.subarray(0,n);const o=Object.keys(this._combined);for(let b=0;b<o.length;b++){const w=parseInt(o[b],10);w>=l&&delete this._combined[w]}const _=Object.keys(this._extendedAttrs);for(let b=0;b<_.length;b++){const w=parseInt(_[b],10);w>=l&&delete this._extendedAttrs[w]}}return this.length=l,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const l=new Uint32Array(this._data.length);return l.set(this._data),this._data=l,1}return 0}fill(l,c=!1){if(c)for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,l);else{this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,l)}}copyFrom(l){this.length!==l.length?this._data=new Uint32Array(l._data):this._data.set(l._data),this.length=l.length,this._combined={};for(const c in l._combined)this._combined[c]=l._combined[c];this._extendedAttrs={};for(const c in l._extendedAttrs)this._extendedAttrs[c]=l._extendedAttrs[c];this.isWrapped=l.isWrapped}clone(){const l=new E(0);l._data=new Uint32Array(this._data),l.length=this.length;for(const c in this._combined)l._combined[c]=this._combined[c];for(const c in this._extendedAttrs)l._extendedAttrs[c]=this._extendedAttrs[c];return l.isWrapped=this.isWrapped,l}getTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,c,n,o,_){const b=l._data;if(_)for(let C=o-1;C>=0;C--){for(let m=0;m<3;m++)this._data[3*(n+C)+m]=b[3*(c+C)+m];268435456&b[3*(c+C)+2]&&(this._extendedAttrs[n+C]=l._extendedAttrs[c+C])}else for(let C=0;C<o;C++){for(let m=0;m<3;m++)this._data[3*(n+C)+m]=b[3*(c+C)+m];268435456&b[3*(c+C)+2]&&(this._extendedAttrs[n+C]=l._extendedAttrs[c+C])}const w=Object.keys(l._combined);for(let C=0;C<w.length;C++){const m=parseInt(w[C],10);m>=c&&(this._combined[m-c+n]=l._combined[m])}}translateToString(l,c,n,o){c=c??0,n=n??this.length,l&&(n=Math.min(n,this.getTrimmedLength())),o&&(o.length=0);let _="";for(;c<n;){const b=this._data[3*c+0],w=2097151&b,C=2097152&b?this._combined[c]:w?(0,p.stringFromCodePoint)(w):h.WHITESPACE_CELL_CHAR;if(_+=C,o)for(let m=0;m<C.length;++m)o.push(c);c+=b>>22||1}return o&&o.push(c),_}}u.BufferLine=E},4841:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getRangeLength=void 0,u.getRangeLength=function(f,d){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 d*(f.end.y-f.start.y)+(f.end.x-f.start.x+1)}},4634:(P,u)=>{function f(d,g,h){if(g===d.length-1)return d[g].getTrimmedLength();const p=!d[g].hasContent(h-1)&&d[g].getWidth(h-1)===1,S=d[g+1].getWidth(0)===2;return p&&S?h-1:h}Object.defineProperty(u,"__esModule",{value:!0}),u.getWrappedLineTrimmedLength=u.reflowSmallerGetNewLineLengths=u.reflowLargerApplyNewLayout=u.reflowLargerCreateNewLayout=u.reflowLargerGetLinesToRemove=void 0,u.reflowLargerGetLinesToRemove=function(d,g,h,p,S){const E=[];for(let v=0;v<d.length-1;v++){let l=v,c=d.get(++l);if(!c.isWrapped)continue;const n=[d.get(v)];for(;l<d.length&&c.isWrapped;)n.push(c),c=d.get(++l);if(p>=v&&p<l){v+=n.length-1;continue}let o=0,_=f(n,o,g),b=1,w=0;for(;b<n.length;){const m=f(n,b,g),A=m-w,j=h-_,U=Math.min(A,j);n[o].copyCellsFrom(n[b],w,_,U,!1),_+=U,_===h&&(o++,_=0),w+=U,w===m&&(b++,w=0),_===0&&o!==0&&n[o-1].getWidth(h-1)===2&&(n[o].copyCellsFrom(n[o-1],h-1,_++,1,!1),n[o-1].setCell(h-1,S))}n[o].replaceCells(_,h,S);let C=0;for(let m=n.length-1;m>0&&(m>o||n[m].getTrimmedLength()===0);m--)C++;C>0&&(E.push(v+n.length-C),E.push(C)),v+=n.length-1}return E},u.reflowLargerCreateNewLayout=function(d,g){const h=[];let p=0,S=g[p],E=0;for(let v=0;v<d.length;v++)if(S===v){const l=g[++p];d.onDeleteEmitter.fire({index:v-E,amount:l}),v+=l-1,E+=l,S=g[++p]}else h.push(v);return{layout:h,countRemoved:E}},u.reflowLargerApplyNewLayout=function(d,g){const h=[];for(let p=0;p<g.length;p++)h.push(d.get(g[p]));for(let p=0;p<h.length;p++)d.set(p,h[p]);d.length=g.length},u.reflowSmallerGetNewLineLengths=function(d,g,h){const p=[],S=d.map(((c,n)=>f(d,n,g))).reduce(((c,n)=>c+n));let E=0,v=0,l=0;for(;l<S;){if(S-l<h){p.push(S-l);break}E+=h;const c=f(d,v,g);E>c&&(E-=c,v++);const n=d[v].getWidth(E-1)===2;n&&E--;const o=n?h-1:h;p.push(o),l+=o}return p},u.getWrappedLineTrimmedLength=f},5295:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferSet=void 0;const d=f(8460),g=f(844),h=f(9092);class p extends g.Disposable{constructor(E,v){super(),this._optionsService=E,this._bufferService=v,this._onBufferActivate=this.register(new d.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,v){this._normal.resize(E,v),this._alt.resize(E,v),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}u.BufferSet=p},511:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CellData=void 0;const d=f(482),g=f(643),h=f(3734);class p extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const v=new p;return v.setFromCharData(E),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(E[g.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(E[g.CHAR_DATA_CHAR_INDEX].length===2){const l=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const c=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(l-55296)+c-56320+65536|E[g.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[g.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=E[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.CellData=p},643:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WHITESPACE_CELL_CODE=u.WHITESPACE_CELL_WIDTH=u.WHITESPACE_CELL_CHAR=u.NULL_CELL_CODE=u.NULL_CELL_WIDTH=u.NULL_CELL_CHAR=u.CHAR_DATA_CODE_INDEX=u.CHAR_DATA_WIDTH_INDEX=u.CHAR_DATA_CHAR_INDEX=u.CHAR_DATA_ATTR_INDEX=u.DEFAULT_EXT=u.DEFAULT_ATTR=u.DEFAULT_COLOR=void 0,u.DEFAULT_COLOR=0,u.DEFAULT_ATTR=256|u.DEFAULT_COLOR<<9,u.DEFAULT_EXT=0,u.CHAR_DATA_ATTR_INDEX=0,u.CHAR_DATA_CHAR_INDEX=1,u.CHAR_DATA_WIDTH_INDEX=2,u.CHAR_DATA_CODE_INDEX=3,u.NULL_CELL_CHAR="",u.NULL_CELL_WIDTH=1,u.NULL_CELL_CODE=0,u.WHITESPACE_CELL_CHAR=" ",u.WHITESPACE_CELL_WIDTH=1,u.WHITESPACE_CELL_CODE=32},4863:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Marker=void 0;const d=f(8460),g=f(844);class h{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}u.Marker=h,h._nextId=1},7116:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DEFAULT_CHARSET=u.CHARSETS=void 0,u.CHARSETS={},u.DEFAULT_CHARSET=u.CHARSETS.B,u.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:"≥","{":"π","|":"≠","}":"£","~":"·"},u.CHARSETS.A={"#":"£"},u.CHARSETS.B=void 0,u.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},u.CHARSETS.C=u.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},u.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},u.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},u.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},u.CHARSETS.E=u.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},u.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},u.CHARSETS.H=u.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(P,u)=>{var f,d,g;Object.defineProperty(u,"__esModule",{value:!0}),u.C1_ESCAPED=u.C1=u.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
233
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(f||(u.C0=f={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(d||(u.C1=d={})),(function(h){h.ST=`${f.ESC}\\`})(g||(u.C1_ESCAPED=g={}))},7399:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.evaluateKeyboardEvent=void 0;const d=f(2584),g={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:["'",'"']};u.evaluateKeyboardEvent=function(h,p,S,E){const v={type:0,cancel:!1,key:void 0},l=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(v.key=d.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=d.C0.ESC+"[Z";break}v.key=d.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,v.cancel=!0;break;case 27:v.key=d.C0.ESC,h.altKey&&(v.key=d.C0.ESC+d.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;l?(v.key=d.C0.ESC+"[1;"+(l+1)+"D",v.key===d.C0.ESC+"[1;3D"&&(v.key=d.C0.ESC+(S?"b":"[1;5D"))):v.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;l?(v.key=d.C0.ESC+"[1;"+(l+1)+"C",v.key===d.C0.ESC+"[1;3C"&&(v.key=d.C0.ESC+(S?"f":"[1;5C"))):v.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;l?(v.key=d.C0.ESC+"[1;"+(l+1)+"A",S||v.key!==d.C0.ESC+"[1;3A"||(v.key=d.C0.ESC+"[1;5A")):v.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;l?(v.key=d.C0.ESC+"[1;"+(l+1)+"B",S||v.key!==d.C0.ESC+"[1;3B"||(v.key=d.C0.ESC+"[1;5B")):v.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=d.C0.ESC+"[2~");break;case 46:v.key=l?d.C0.ESC+"[3;"+(l+1)+"~":d.C0.ESC+"[3~";break;case 36:v.key=l?d.C0.ESC+"[1;"+(l+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:v.key=l?d.C0.ESC+"[1;"+(l+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=d.C0.ESC+"[5;"+(l+1)+"~":v.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=d.C0.ESC+"[6;"+(l+1)+"~":v.key=d.C0.ESC+"[6~";break;case 112:v.key=l?d.C0.ESC+"[1;"+(l+1)+"P":d.C0.ESC+"OP";break;case 113:v.key=l?d.C0.ESC+"[1;"+(l+1)+"Q":d.C0.ESC+"OQ";break;case 114:v.key=l?d.C0.ESC+"[1;"+(l+1)+"R":d.C0.ESC+"OR";break;case 115:v.key=l?d.C0.ESC+"[1;"+(l+1)+"S":d.C0.ESC+"OS";break;case 116:v.key=l?d.C0.ESC+"[15;"+(l+1)+"~":d.C0.ESC+"[15~";break;case 117:v.key=l?d.C0.ESC+"[17;"+(l+1)+"~":d.C0.ESC+"[17~";break;case 118:v.key=l?d.C0.ESC+"[18;"+(l+1)+"~":d.C0.ESC+"[18~";break;case 119:v.key=l?d.C0.ESC+"[19;"+(l+1)+"~":d.C0.ESC+"[19~";break;case 120:v.key=l?d.C0.ESC+"[20;"+(l+1)+"~":d.C0.ESC+"[20~";break;case 121:v.key=l?d.C0.ESC+"[21;"+(l+1)+"~":d.C0.ESC+"[21~";break;case 122:v.key=l?d.C0.ESC+"[23;"+(l+1)+"~":d.C0.ESC+"[23~";break;case 123:v.key=l?d.C0.ESC+"[24;"+(l+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!E||!h.altKey||h.metaKey)!S||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=d.C0.US),h.key==="@"&&(v.key=d.C0.NUL)):h.keyCode===65&&(v.type=1);else{const c=g[h.keyCode],n=c==null?void 0:c[h.shiftKey?1:0];if(n)v.key=d.C0.ESC+n;else if(h.keyCode>=65&&h.keyCode<=90){const o=h.ctrlKey?h.keyCode-64:h.keyCode+32;let _=String.fromCharCode(o);h.shiftKey&&(_=_.toUpperCase()),v.key=d.C0.ESC+_}else if(h.keyCode===32)v.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let o=h.code.slice(3,4);h.shiftKey||(o=o.toLowerCase()),v.key=d.C0.ESC+o,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=d.C0.DEL:h.keyCode===219?v.key=d.C0.ESC:h.keyCode===220?v.key=d.C0.FS:h.keyCode===221&&(v.key=d.C0.GS)}return v}},482:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Utf8ToUtf32=u.StringToUtf32=u.utf32ToString=u.stringFromCodePoint=void 0,u.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},u.utf32ToString=function(f,d=0,g=f.length){let h="";for(let p=d;p<g;++p){let S=f[p];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},u.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,d){const g=f.length;if(!g)return 0;let h=0,p=0;if(this._interim){const S=f.charCodeAt(p++);56320<=S&&S<=57343?d[h++]=1024*(this._interim-55296)+S-56320+65536:(d[h++]=this._interim,d[h++]=S),this._interim=0}for(let S=p;S<g;++S){const E=f.charCodeAt(S);if(55296<=E&&E<=56319){if(++S>=g)return this._interim=E,h;const v=f.charCodeAt(S);56320<=v&&v<=57343?d[h++]=1024*(E-55296)+v-56320+65536:(d[h++]=E,d[h++]=v)}else E!==65279&&(d[h++]=E)}return h}},u.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,d){const g=f.length;if(!g)return 0;let h,p,S,E,v=0,l=0,c=0;if(this.interim[0]){let _=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let w,C=0;for(;(w=63&this.interim[++C])&&C<4;)b<<=6,b|=w;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=m-C;for(;c<A;){if(c>=g)return 0;if(w=f[c++],(192&w)!=128){c--,_=!0;break}this.interim[C++]=w,b<<=6,b|=63&w}_||(m===2?b<128?c--:d[v++]=b:m===3?b<2048||b>=55296&&b<=57343||b===65279||(d[v++]=b):b<65536||b>1114111||(d[v++]=b)),this.interim.fill(0)}const n=g-4;let o=c;for(;o<g;){for(;!(!(o<n)||128&(h=f[o])||128&(p=f[o+1])||128&(S=f[o+2])||128&(E=f[o+3]));)d[v++]=h,d[v++]=p,d[v++]=S,d[v++]=E,o+=4;if(h=f[o++],h<128)d[v++]=h;else if((224&h)==192){if(o>=g)return this.interim[0]=h,v;if(p=f[o++],(192&p)!=128){o--;continue}if(l=(31&h)<<6|63&p,l<128){o--;continue}d[v++]=l}else if((240&h)==224){if(o>=g)return this.interim[0]=h,v;if(p=f[o++],(192&p)!=128){o--;continue}if(o>=g)return this.interim[0]=h,this.interim[1]=p,v;if(S=f[o++],(192&S)!=128){o--;continue}if(l=(15&h)<<12|(63&p)<<6|63&S,l<2048||l>=55296&&l<=57343||l===65279)continue;d[v++]=l}else if((248&h)==240){if(o>=g)return this.interim[0]=h,v;if(p=f[o++],(192&p)!=128){o--;continue}if(o>=g)return this.interim[0]=h,this.interim[1]=p,v;if(S=f[o++],(192&S)!=128){o--;continue}if(o>=g)return this.interim[0]=h,this.interim[1]=p,this.interim[2]=S,v;if(E=f[o++],(192&E)!=128){o--;continue}if(l=(7&h)<<18|(63&p)<<12|(63&S)<<6|63&E,l<65536||l>1114111)continue;d[v++]=l}}return v}}},225:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeV6=void 0;const d=f(1480),g=[[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]],h=[[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 p;u.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<g.length;++S)p.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:(function(E,v){let l,c=0,n=v.length-1;if(E<v[0][0]||E>v[n][1])return!1;for(;n>=c;)if(l=c+n>>1,E>v[l][1])c=l+1;else{if(!(E<v[l][0]))return!0;n=l-1}return!1})(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,E){let v=this.wcwidth(S),l=v===0&&E!==0;if(l){const c=d.UnicodeService.extractWidth(E);c===0?l=!1:c>v&&(v=c)}return d.UnicodeService.createPropertyValue(0,v,l)}}},5981:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WriteBuffer=void 0;const d=f(8460),g=f(844);class h extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,E){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E)}_innerWrite(S=0,E=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],c=this._action(l,E);if(c){const o=_=>Date.now()-v>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(v,_);return void c.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(o)}const n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-v>=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()}}u.WriteBuffer=h},5941:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.toRgbString=u.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})$/,d=/^[\da-f]+$/;function g(h,p){const S=h.toString(16),E=S.length<2?"0"+S:S;switch(p){case 4:return S[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}u.parseColor=function(h){if(!h)return;let p=h.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const S=f.exec(p);if(S){const E=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/E*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/E*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/E*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const S=p.length/3,E=[0,0,0];for(let v=0;v<3;++v){const l=parseInt(p.slice(S*v,S*v+S),16);E[v]=S===1?l<<4:S===2?l:S===3?l>>4:l>>8}return E}},u.toRgbString=function(h,p=16){const[S,E,v]=h;return`rgb:${g(S,p)}/${g(E,p)}/${g(v,p)}`}},5770:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.PAYLOAD_LIMIT=void 0,u.PAYLOAD_LIMIT=1e7},6351:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DcsHandler=u.DcsParser=void 0;const d=f(482),g=f(8742),h=f(5770),p=[];u.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(E,v){this._handlers[E]===void 0&&(this._handlers[E]=[]);const l=this._handlers[E];return l.push(v),{dispose:()=>{const c=l.indexOf(v);c!==-1&&l.splice(c,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(E,v){if(this.reset(),this._ident=E,this._active=this._handlers[E]||p,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(E,v,l){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(E,v,l);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(E,v,l))}unhook(E,v=!0){if(this._active.length){let l=!1,c=this._active.length-1,n=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,l=v,n=this._stack.fallThrough,this._stack.paused=!1),!n&&l===!1){for(;c>=0&&(l=this._active[c].unhook(E),l!==!0);c--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,l;c--}for(;c>=0;c--)if(l=this._active[c].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",E);this._active=p,this._ident=0}};const S=new g.Params;S.addParam(0),u.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=S,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():S,this._data="",this._hitLimit=!1}put(E,v,l){this._hitLimit||(this._data+=(0,d.utf32ToString)(E,v,l),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let v=!1;if(this._hitLimit)v=!1;else if(E&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then((l=>(this._params=S,this._data="",this._hitLimit=!1,l)));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.EscapeSequenceParser=u.VT500_TRANSITION_TABLE=u.TransitionTable=void 0;const d=f(844),g=f(8742),h=f(6242),p=f(6351);class S{constructor(c){this.table=new Uint8Array(c)}setDefault(c,n){this.table.fill(c<<4|n)}add(c,n,o,_){this.table[n<<8|c]=o<<4|_}addMany(c,n,o,_){for(let b=0;b<c.length;b++)this.table[n<<8|c[b]]=o<<4|_}}u.TransitionTable=S;const E=160;u.VT500_TRANSITION_TABLE=(function(){const l=new S(4095),c=Array.apply(null,Array(256)).map(((C,m)=>m)),n=(C,m)=>c.slice(C,m),o=n(32,127),_=n(0,24);_.push(25),_.push.apply(_,n(28,32));const b=n(0,14);let w;for(w in l.setDefault(1,0),l.addMany(o,0,2,0),b)l.addMany([24,26,153,154],w,3,0),l.addMany(n(128,144),w,3,0),l.addMany(n(144,152),w,3,0),l.add(156,w,0,0),l.add(27,w,11,1),l.add(157,w,4,8),l.addMany([152,158,159],w,0,7),l.add(155,w,11,3),l.add(144,w,11,9);return l.addMany(_,0,3,0),l.addMany(_,1,3,1),l.add(127,1,0,1),l.addMany(_,8,0,8),l.addMany(_,3,3,3),l.add(127,3,0,3),l.addMany(_,4,3,4),l.add(127,4,0,4),l.addMany(_,6,3,6),l.addMany(_,5,3,5),l.add(127,5,0,5),l.addMany(_,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(o,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(n(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(o,7,0,7),l.addMany(_,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(n(64,127),3,7,0),l.addMany(n(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(n(48,60),4,8,4),l.addMany(n(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(n(32,64),6,0,6),l.add(127,6,0,6),l.addMany(n(64,127),6,0,0),l.addMany(n(32,48),3,9,5),l.addMany(n(32,48),5,9,5),l.addMany(n(48,64),5,0,6),l.addMany(n(64,127),5,7,0),l.addMany(n(32,48),4,9,5),l.addMany(n(32,48),1,9,2),l.addMany(n(32,48),2,9,2),l.addMany(n(48,127),2,10,0),l.addMany(n(48,80),1,10,0),l.addMany(n(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(n(96,127),1,10,0),l.add(80,1,11,9),l.addMany(_,9,0,9),l.add(127,9,0,9),l.addMany(n(28,32),9,0,9),l.addMany(n(32,48),9,9,12),l.addMany(n(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(_,11,0,11),l.addMany(n(32,128),11,0,11),l.addMany(n(28,32),11,0,11),l.addMany(_,10,0,10),l.add(127,10,0,10),l.addMany(n(28,32),10,0,10),l.addMany(n(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(n(32,48),10,9,12),l.addMany(_,12,0,12),l.add(127,12,0,12),l.addMany(n(28,32),12,0,12),l.addMany(n(32,48),12,9,12),l.addMany(n(48,64),12,0,11),l.addMany(n(64,127),12,12,13),l.addMany(n(64,127),10,12,13),l.addMany(n(64,127),9,12,13),l.addMany(_,13,13,13),l.addMany(o,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(E,0,2,0),l.add(E,8,5,8),l.add(E,6,0,6),l.add(E,11,0,11),l.add(E,13,13,13),l})();class v extends d.Disposable{constructor(c=u.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 g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(n,o,_)=>{},this._executeHandlerFb=n=>{},this._csiHandlerFb=(n,o)=>{},this._escHandlerFb=n=>{},this._errorHandlerFb=n=>n,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,n=[64,126]){let o=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(o=c.prefix.charCodeAt(0),o&&60>o||o>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 b=0;b<c.intermediates.length;++b){const w=c.intermediates.charCodeAt(b);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");o<<=8,o|=w}}if(c.final.length!==1)throw new Error("final must be a single byte");const _=c.final.charCodeAt(0);if(n[0]>_||_>n[1])throw new Error(`final must be in range ${n[0]} .. ${n[1]}`);return o<<=8,o|=_,o}identToString(c){const n=[];for(;c;)n.push(String.fromCharCode(255&c)),c>>=8;return n.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,n){const o=this._identifier(c,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);const _=this._escHandlers[o];return _.push(n),{dispose:()=>{const b=_.indexOf(n);b!==-1&&_.splice(b,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,n){this._executeHandlers[c.charCodeAt(0)]=n}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,n){const o=this._identifier(c);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);const _=this._csiHandlers[o];return _.push(n),{dispose:()=>{const b=_.indexOf(n);b!==-1&&_.splice(b,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,n){return this._dcsParser.registerHandler(this._identifier(c),n)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,n){return this._oscParser.registerHandler(c,n)}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,n,o,_,b){this._parseStack.state=c,this._parseStack.handlers=n,this._parseStack.handlerPos=o,this._parseStack.transition=_,this._parseStack.chunkPos=b}parse(c,n,o){let _,b=0,w=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(o===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let A=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(o===!1&&A>-1){for(;A>=0&&(_=m[A](this._params),_!==!0);A--)if(_ instanceof Promise)return this._parseStack.handlerPos=A,_}this._parseStack.handlers=[];break;case 4:if(o===!1&&A>-1){for(;A>=0&&(_=m[A](),_!==!0);A--)if(_ instanceof Promise)return this._parseStack.handlerPos=A,_}this._parseStack.handlers=[];break;case 6:if(b=c[this._parseStack.chunkPos],_=this._dcsParser.unhook(b!==24&&b!==26,o),_)return _;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(b=c[this._parseStack.chunkPos],_=this._oscParser.end(b!==24&&b!==26,o),_)return _;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let m=C;m<n;++m){switch(b=c[m],w=this._transitions.table[this.currentState<<8|(b<160?b:E)],w>>4){case 2:for(let z=m+1;;++z){if(z>=n||(b=c[z])<32||b>126&&b<E){this._printHandler(c,m,z),m=z-1;break}if(++z>=n||(b=c[z])<32||b>126&&b<E){this._printHandler(c,m,z),m=z-1;break}if(++z>=n||(b=c[z])<32||b>126&&b<E){this._printHandler(c,m,z),m=z-1;break}if(++z>=n||(b=c[z])<32||b>126&&b<E){this._printHandler(c,m,z),m=z-1;break}}break;case 3:this._executeHandlers[b]?this._executeHandlers[b]():this._executeHandlerFb(b),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:b,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const A=this._csiHandlers[this._collect<<8|b];let j=A?A.length-1:-1;for(;j>=0&&(_=A[j](this._params),_!==!0);j--)if(_ instanceof Promise)return this._preserveStack(3,A,j,w,m),_;j<0&&this._csiHandlerFb(this._collect<<8|b,this._params),this.precedingJoinState=0;break;case 8:do switch(b){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(b-48)}while(++m<n&&(b=c[m])>47&&b<60);m--;break;case 9:this._collect<<=8,this._collect|=b;break;case 10:const U=this._escHandlers[this._collect<<8|b];let W=U?U.length-1:-1;for(;W>=0&&(_=U[W](),_!==!0);W--)if(_ instanceof Promise)return this._preserveStack(4,U,W,w,m),_;W<0&&this._escHandlerFb(this._collect<<8|b),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|b,this._params);break;case 13:for(let z=m+1;;++z)if(z>=n||(b=c[z])===24||b===26||b===27||b>127&&b<E){this._dcsParser.put(c,m,z),m=z-1;break}break;case 14:if(_=this._dcsParser.unhook(b!==24&&b!==26),_)return this._preserveStack(6,[],0,w,m),_;b===27&&(w|=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 z=m+1;;z++)if(z>=n||(b=c[z])<32||b>127&&b<E){this._oscParser.put(c,m,z),m=z-1;break}break;case 6:if(_=this._oscParser.end(b!==24&&b!==26),_)return this._preserveStack(5,[],0,w,m),_;b===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}u.EscapeSequenceParser=v},6242:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OscHandler=u.OscParser=void 0;const d=f(5770),g=f(482),h=[];u.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,S){this._handlers[p]===void 0&&(this._handlers[p]=[]);const E=this._handlers[p];return E.push(S),{dispose:()=>{const v=E.indexOf(S);v!==-1&&E.splice(v,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,S,E){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(p,S,E);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,S,E))}start(){this.reset(),this._state=1}put(p,S,E){if(this._state!==3){if(this._state===1)for(;S<E;){const v=p[S++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&E-S>0&&this._put(p,S,E)}}end(p,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,v=this._active.length-1,l=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,E=S,l=this._stack.fallThrough,this._stack.paused=!1),!l&&E===!1){for(;v>=0&&(E=this._active[v].end(p),E!==!0);v--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,E;v--}for(;v>=0;v--)if(E=this._active[v].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",p);this._active=h,this._id=-1,this._state=0}}},u.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,S,E){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,S,E),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let S=!1;if(this._hitLimit)S=!1;else if(p&&(S=this._handler(this._data),S instanceof Promise))return S.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,S}}},8742:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Params=void 0;const f=2147483647;class d{static fromArray(h){const p=new d;if(!h.length)return p;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const E=h[S];if(Array.isArray(E))for(let v=0;v<E.length;++v)p.addSubParam(E[v]);else p.addParam(E)}return p}constructor(h=32,p=32){if(this.maxLength=h,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let p=0;p<this.length;++p){h.push(this.params[p]);const S=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];E-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,E))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>f?f:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>f?f:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const p=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];return S-p>0?this._subParams.subarray(p,S):null}getSubParamsAll(){const h={};for(let p=0;p<this.length;++p){const S=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];E-S>0&&(h[p]=this._subParams.slice(S,E))}return h}addDigit(h){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,E=S[p-1];S[p-1]=~E?Math.min(10*E+h,f):h}}u.Params=d},5741:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.AddonManager=void 0,u.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()}loadAddon(f,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(f)}_wrappedAddonDispose(f){if(f.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===f){d=g;break}if(d===-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(d,1)}}},8771:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferApiView=void 0;const d=f(3785),g=f(511);u.BufferApiView=class{constructor(h,p){this._buffer=h,this.type=p}init(h){return this._buffer=h,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(h){const p=this._buffer.lines.get(h);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLineApiView=void 0;const d=f(511);u.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,h){if(!(g<0||g>=this._line.length))return h?(this._line.loadCell(g,h),h):this._line.loadCell(g,new d.CellData)}translateToString(g,h,p){return this._line.translateToString(g,h,p)}}},8285:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferNamespaceApi=void 0;const d=f(8771),g=f(8460),h=f(844);class p extends h.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}u.BufferNamespaceApi=p},7975:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ParserApi=void 0,u.ParserApi=class{constructor(f){this._core=f}registerCsiHandler(f,d){return this._core.registerCsiHandler(f,(g=>d(g.toArray())))}addCsiHandler(f,d){return this.registerCsiHandler(f,d)}registerDcsHandler(f,d){return this._core.registerDcsHandler(f,((g,h)=>d(g,h.toArray())))}addDcsHandler(f,d){return this.registerDcsHandler(f,d)}registerEscHandler(f,d){return this._core.registerEscHandler(f,d)}addEscHandler(f,d){return this.registerEscHandler(f,d)}registerOscHandler(f,d){return this._core.registerOscHandler(f,d)}addOscHandler(f,d){return this.registerOscHandler(f,d)}}},7090:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeApi=void 0,u.UnicodeApi=class{constructor(f){this._core=f}register(f){this._core.unicodeService.register(f)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(f){this._core.unicodeService.activeVersion=f}}},744:function(P,u,f){var d=this&&this.__decorate||function(l,c,n,o){var _,b=arguments.length,w=b<3?c:o===null?o=Object.getOwnPropertyDescriptor(c,n):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,c,n,o);else for(var C=l.length-1;C>=0;C--)(_=l[C])&&(w=(b<3?_(w):b>3?_(c,n,w):_(c,n))||w);return b>3&&w&&Object.defineProperty(c,n,w),w},g=this&&this.__param||function(l,c){return function(n,o){c(n,o,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferService=u.MINIMUM_ROWS=u.MINIMUM_COLS=void 0;const h=f(8460),p=f(844),S=f(5295),E=f(2585);u.MINIMUM_COLS=2,u.MINIMUM_ROWS=1;let v=u.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,u.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,u.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(l,this))}resize(l,c){this.cols=l,this.rows=c,this.buffers.resize(l,c),this._onResize.fire({cols:l,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,c=!1){const n=this.buffer;let o;o=this._cachedBlankLine,o&&o.length===this.cols&&o.getFg(0)===l.fg&&o.getBg(0)===l.bg||(o=n.getBlankLine(l,c),this._cachedBlankLine=o),o.isWrapped=c;const _=n.ybase+n.scrollTop,b=n.ybase+n.scrollBottom;if(n.scrollTop===0){const w=n.lines.isFull;b===n.lines.length-1?w?n.lines.recycle().copyFrom(o):n.lines.push(o.clone()):n.lines.splice(b+1,0,o.clone()),w?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{const w=b-_+1;n.lines.shiftElements(_+1,w-1,-1),n.lines.set(b,o.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(l,c,n){const o=this.buffer;if(l<0){if(o.ydisp===0)return;this.isUserScrolling=!0}else l+o.ydisp>=o.ybase&&(this.isUserScrolling=!1);const _=o.ydisp;o.ydisp=Math.max(Math.min(o.ydisp+l,o.ybase),0),_!==o.ydisp&&(c||this._onScroll.fire(o.ydisp))}};u.BufferService=v=d([g(0,E.IOptionsService)],v)},7994:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CharsetService=void 0,u.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,d){this._charsets[f]=d,this.glevel===f&&(this.charset=d)}}},1753:function(P,u,f){var d=this&&this.__decorate||function(o,_,b,w){var C,m=arguments.length,A=m<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(o,_,b,w);else for(var j=o.length-1;j>=0;j--)(C=o[j])&&(A=(m<3?C(A):m>3?C(_,b,A):C(_,b))||A);return m>3&&A&&Object.defineProperty(_,b,A),A},g=this&&this.__param||function(o,_){return function(b,w){_(b,w,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreMouseService=void 0;const h=f(2585),p=f(8460),S=f(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:o=>o.button!==4&&o.action===1&&(o.ctrl=!1,o.alt=!1,o.shift=!1,!0)},VT200:{events:19,restrict:o=>o.action!==32},DRAG:{events:23,restrict:o=>o.action!==32||o.button!==3},ANY:{events:31,restrict:o=>!0}};function v(o,_){let b=(o.ctrl?16:0)|(o.shift?4:0)|(o.alt?8:0);return o.button===4?(b|=64,b|=o.action):(b|=3&o.button,4&o.button&&(b|=64),8&o.button&&(b|=128),o.action===32?b|=32:o.action!==0||_||(b|=3)),b}const l=String.fromCharCode,c={DEFAULT:o=>{const _=[v(o,!1)+32,o.col+32,o.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${l(_[0])}${l(_[1])}${l(_[2])}`},SGR:o=>{const _=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${v(o,!0)};${o.col};${o.row}${_}`},SGR_PIXELS:o=>{const _=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${v(o,!0)};${o.x};${o.y}${_}`}};let n=u.CoreMouseService=class extends S.Disposable{constructor(o,_){super(),this._bufferService=o,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const b of Object.keys(E))this.addProtocol(b,E[b]);for(const b of Object.keys(c))this.addEncoding(b,c[b]);this.reset()}addProtocol(o,_){this._protocols[o]=_}addEncoding(o,_){this._encodings[o]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(o){if(!this._protocols[o])throw new Error(`unknown protocol "${o}"`);this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(o){if(!this._encodings[o])throw new Error(`unknown encoding "${o}"`);this._activeEncoding=o}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,o,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(o))return!1;const _=this._encodings[this._activeEncoding](o);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=o,!0}explainEvents(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}}_equalEvents(o,_,b){if(b){if(o.x!==_.x||o.y!==_.y)return!1}else if(o.col!==_.col||o.row!==_.row)return!1;return o.button===_.button&&o.action===_.action&&o.ctrl===_.ctrl&&o.alt===_.alt&&o.shift===_.shift}};u.CoreMouseService=n=d([g(0,h.IBufferService),g(1,h.ICoreService)],n)},6975:function(P,u,f){var d=this&&this.__decorate||function(n,o,_,b){var w,C=arguments.length,m=C<3?o:b===null?b=Object.getOwnPropertyDescriptor(o,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,o,_,b);else for(var A=n.length-1;A>=0;A--)(w=n[A])&&(m=(C<3?w(m):C>3?w(o,_,m):w(o,_))||m);return C>3&&m&&Object.defineProperty(o,_,m),m},g=this&&this.__param||function(n,o){return function(_,b){o(_,b,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreService=void 0;const h=f(1439),p=f(8460),S=f(844),E=f(2585),v=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=u.CoreService=class extends S.Disposable{constructor(n,o,_){super(),this._bufferService=n,this._logService=o,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(l)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(l)}triggerDataEvent(n,o=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;o&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),o&&this._onUserInput.fire(),this._logService.debug(`sending data "${n}"`,(()=>n.split("").map((b=>b.charCodeAt(0))))),this._onData.fire(n)}triggerBinaryEvent(n){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${n}"`,(()=>n.split("").map((o=>o.charCodeAt(0))))),this._onBinary.fire(n))}};u.CoreService=c=d([g(0,E.IBufferService),g(1,E.ILogService),g(2,E.IOptionsService)],c)},9074:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DecorationService=void 0;const d=f(8055),g=f(8460),h=f(844),p=f(6106);let S=0,E=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((n=>n==null?void 0:n.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(n){if(n.marker.isDisposed)return;const o=new l(n);if(o){const _=o.marker.onDispose((()=>o.dispose()));o.onDispose((()=>{o&&(this._decorations.delete(o)&&this._onDecorationRemoved.fire(o),_.dispose())})),this._decorations.insert(o),this._onDecorationRegistered.fire(o)}return o}reset(){for(const n of this._decorations.values())n.dispose();this._decorations.clear()}*getDecorationsAtCell(n,o,_){let b=0,w=0;for(const C of this._decorations.getKeyIterator(o))b=C.options.x??0,w=b+(C.options.width??1),n>=b&&n<w&&(!_||(C.options.layer??"bottom")===_)&&(yield C)}forEachDecorationAtCell(n,o,_,b){this._decorations.forEachByKey(o,(w=>{S=w.options.x??0,E=S+(w.options.width??1),n>=S&&n<E&&(!_||(w.options.layer??"bottom")===_)&&b(w)}))}}u.DecorationService=v;class l extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(n){super(),this.options=n,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=n.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.InstantiationService=u.ServiceCollection=void 0;const d=f(2585),g=f(8343);class h{constructor(...S){this._entries=new Map;for(const[E,v]of S)this.set(E,v)}set(S,E){const v=this._entries.get(S);return this._entries.set(S,E),v}forEach(S){for(const[E,v]of this._entries.entries())S(E,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}u.ServiceCollection=h,u.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(p,S){this._services.set(p,S)}getService(p){return this._services.get(p)}createInstance(p,...S){const E=(0,g.getServiceDependencies)(p).sort(((c,n)=>c.index-n.index)),v=[];for(const c of E){const n=this._services.get(c.id);if(!n)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${c.id}.`);v.push(n)}const l=E.length>0?E[0].index:S.length;if(S.length!==l)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${l+1} conflicts with ${S.length} static arguments`);return new p(...S,...v)}}},7866:function(P,u,f){var d=this&&this.__decorate||function(l,c,n,o){var _,b=arguments.length,w=b<3?c:o===null?o=Object.getOwnPropertyDescriptor(c,n):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,c,n,o);else for(var C=l.length-1;C>=0;C--)(_=l[C])&&(w=(b<3?_(w):b>3?_(c,n,w):_(c,n))||w);return b>3&&w&&Object.defineProperty(c,n,w),w},g=this&&this.__param||function(l,c){return function(n,o){c(n,o,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.traceCall=u.setTraceLogger=u.LogService=void 0;const h=f(844),p=f(2585),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let E,v=u.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let c=0;c<l.length;c++)typeof l[c]=="function"&&(l[c]=l[c]())}_log(l,c,n){this._evalLazyOptionalParams(n),l.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...n)}trace(l,...c){var n;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,l,c)}debug(l,...c){var n;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,l,c)}info(l,...c){var n;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,l,c)}warn(l,...c){var n;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,l,c)}error(l,...c){var n;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,l,c)}};u.LogService=v=d([g(0,p.IOptionsService)],v),u.setTraceLogger=function(l){E=l},u.traceCall=function(l,c,n){if(typeof n.value!="function")throw new Error("not supported");const o=n.value;n.value=function(..._){if(E.logLevel!==p.LogLevelEnum.TRACE)return o.apply(this,_);E.trace(`GlyphRenderer#${o.name}(${_.map((w=>JSON.stringify(w))).join(", ")})`);const b=o.apply(this,_);return E.trace(`GlyphRenderer#${o.name} return`,b),b}}},7302:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OptionsService=u.DEFAULT_OPTIONS=void 0;const d=f(8460),g=f(844),h=f(6114);u.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(v){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l={...u.DEFAULT_OPTIONS};for(const c in v)if(c in l)try{const n=v[c];l[c]=this._sanitizeAndValidateOption(c,n)}catch(n){console.error(n)}this.rawOptions=l,this.options={...l},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(v,l){return this.onOptionChange((c=>{c===v&&l(this.rawOptions[v])}))}onMultipleOptionChange(v,l){return this.onOptionChange((c=>{v.indexOf(c)!==-1&&l()}))}_setupOptions(){const v=c=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},l=(c,n)=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);n=this._sanitizeAndValidateOption(c,n),this.rawOptions[c]!==n&&(this.rawOptions[c]=n,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const n={get:v.bind(this,c),set:l.bind(this,c)};Object.defineProperty(this.options,c,n)}}_sanitizeAndValidateOption(v,l){switch(v){case"cursorStyle":if(l||(l=u.DEFAULT_OPTIONS[v]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(l))throw new Error(`"${l}" is not a valid value for ${v}`);break;case"wordSeparator":l||(l=u.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=p.includes(l)?l:u.DEFAULT_OPTIONS[v];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${v} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${v} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}u.OptionsService=S},2660:function(P,u,f){var d=this&&this.__decorate||function(S,E,v,l){var c,n=arguments.length,o=n<3?E:l===null?l=Object.getOwnPropertyDescriptor(E,v):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(S,E,v,l);else for(var _=S.length-1;_>=0;_--)(c=S[_])&&(o=(n<3?c(o):n>3?c(E,v,o):c(E,v))||o);return n>3&&o&&Object.defineProperty(E,v,o),o},g=this&&this.__param||function(S,E){return function(v,l){E(v,l,S)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkService=void 0;const h=f(2585);let p=u.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const E=this._bufferService.buffer;if(S.id===void 0){const _=E.addMarker(E.ybase+E.y),b={data:S,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(b,_))),this._dataByLinkId.set(b.id,b),b.id}const v=S,l=this._getEntryIdKey(v),c=this._entriesWithId.get(l);if(c)return this.addLineToLink(c.id,E.ybase+E.y),c.id;const n=E.addMarker(E.ybase+E.y),o={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(o,n))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(S,E){const v=this._dataByLinkId.get(S);if(v&&v.lines.every((l=>l.line!==E))){const l=this._bufferService.buffer.addMarker(E);v.lines.push(l),l.onDispose((()=>this._removeMarkerFromLink(v,l)))}}getLinkData(S){var E;return(E=this._dataByLinkId.get(S))==null?void 0:E.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,E){const v=S.lines.indexOf(E);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};u.OscLinkService=p=d([g(0,h.IBufferService)],p)},8343:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createDecorator=u.getServiceDependencies=u.serviceRegistry=void 0;const f="di$target",d="di$dependencies";u.serviceRegistry=new Map,u.getServiceDependencies=function(g){return g[d]||[]},u.createDecorator=function(g){if(u.serviceRegistry.has(g))return u.serviceRegistry.get(g);const h=function(p,S,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,c){l[f]===l?l[d].push({id:v,index:c}):(l[d]=[{id:v,index:c}],l[f]=l)})(h,p,E)};return h.toString=()=>g,u.serviceRegistry.set(g,h),h}},2585:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.IDecorationService=u.IUnicodeService=u.IOscLinkService=u.IOptionsService=u.ILogService=u.LogLevelEnum=u.IInstantiationService=u.ICharsetService=u.ICoreService=u.ICoreMouseService=u.IBufferService=void 0;const d=f(8343);var g;u.IBufferService=(0,d.createDecorator)("BufferService"),u.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),u.ICoreService=(0,d.createDecorator)("CoreService"),u.ICharsetService=(0,d.createDecorator)("CharsetService"),u.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(g||(u.LogLevelEnum=g={})),u.ILogService=(0,d.createDecorator)("LogService"),u.IOptionsService=(0,d.createDecorator)("OptionsService"),u.IOscLinkService=(0,d.createDecorator)("OscLinkService"),u.IUnicodeService=(0,d.createDecorator)("UnicodeService"),u.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeService=void 0;const d=f(8460),g=f(225);class h{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,E,v=!1){return(16777215&S)<<3|(3&E)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let E=0,v=0;const l=S.length;for(let c=0;c<l;++c){let n=S.charCodeAt(c);if(55296<=n&&n<=56319){if(++c>=l)return E+this.wcwidth(n);const b=S.charCodeAt(c);56320<=b&&b<=57343?n=1024*(n-55296)+b-56320+65536:E+=this.wcwidth(b)}const o=this.charProperties(n,v);let _=h.extractWidth(o);h.extractShouldJoin(o)&&(_-=h.extractWidth(v)),E+=_,v=o}return E}charProperties(S,E){return this._activeProvider.charProperties(S,E)}}u.UnicodeService=h}},M={};function $(P){var u=M[P];if(u!==void 0)return u.exports;var f=M[P]={exports:{}};return I[P].call(f.exports,f,f.exports,$),f.exports}var Q={};return(()=>{var P=Q;Object.defineProperty(P,"__esModule",{value:!0}),P.Terminal=void 0;const u=$(9042),f=$(3236),d=$(844),g=$(5741),h=$(8285),p=$(7975),S=$(7090),E=["cols","rows"];class v extends d.Disposable{constructor(c){super(),this._core=this.register(new f.Terminal(c)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const n=_=>this._core.options[_],o=(_,b)=>{this._checkReadonlyOptions(_),this._core.options[_]=b};for(const _ in this._core.options){const b={get:n.bind(this,_),set:o.bind(this,_)};Object.defineProperty(this._publicOptions,_,b)}}_checkReadonlyOptions(c){if(E.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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let n="none";switch(this._core.coreMouseService.activeProtocol){case"X10":n="x10";break;case"VT200":n="vt200";break;case"DRAG":n="drag";break;case"ANY":n="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:n,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const n in c)this._publicOptions[n]=c[n]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,n=!0){this._core.input(c,n)}resize(c,n){this._verifyIntegers(c,n),this._core.resize(c,n)}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,n,o){this._verifyIntegers(c,n,o),this._core.select(c,n,o)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,n){this._verifyIntegers(c,n),this._core.selectLines(c,n)}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,n){this._core.write(c,n)}writeln(c,n){this._core.write(c),this._core.write(`\r
234
- `,n)}paste(c){this._core.paste(c)}refresh(c,n){this._verifyIntegers(c,n),this._core.refresh(c,n)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return u}_verifyIntegers(...c){for(const n of c)if(n===1/0||isNaN(n)||n%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const n of c)if(n&&(n===1/0||isNaN(n)||n%1!=0||n<0))throw new Error("This API only accepts positive integers")}}P.Terminal=v})(),Q})()))})(Ho)),Ho.exports}var ig=tg(),jo={exports:{}},cd;function sg(){return cd||(cd=1,(function(x,H){(function(I,M){x.exports=M()})(self,(()=>(()=>{var I={};return(()=>{var M=I;Object.defineProperty(M,"__esModule",{value:!0}),M.FitAddon=void 0,M.FitAddon=class{activate($){this._terminal=$}dispose(){}fit(){const $=this.proposeDimensions();if(!$||!this._terminal||isNaN($.cols)||isNaN($.rows))return;const Q=this._terminal._core;this._terminal.rows===$.rows&&this._terminal.cols===$.cols||(Q._renderService.clear(),this._terminal.resize($.cols,$.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const $=this._terminal._core,Q=$._renderService.dimensions;if(Q.css.cell.width===0||Q.css.cell.height===0)return;const P=this._terminal.options.scrollback===0?0:$.viewport.scrollBarWidth,u=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(u.getPropertyValue("height")),d=Math.max(0,parseInt(u.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),h=f-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-P;return{cols:Math.max(2,Math.floor(p/Q.css.cell.width)),rows:Math.max(1,Math.floor(h/Q.css.cell.height))}}}})(),I})()))})(jo)),jo.exports}var rg=sg(),zo={exports:{}},ud;function ng(){return ud||(ud=1,(function(x,H){(function(I,M){x.exports=M()})(self,(()=>(()=>{var I={6:(P,u)=>{function f(g){try{const h=new URL(g),p=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(u,"__esModule",{value:!0}),u.LinkComputer=u.WebLinkProvider=void 0,u.WebLinkProvider=class{constructor(g,h,p,S={}){this._terminal=g,this._regex=h,this._handler=p,this._options=S}provideLinks(g,h){const p=d.computeLink(g,this._regex,this._terminal,this._handler);h(this._addCallbacks(p))}_addCallbacks(g){return g.map((h=>(h.leave=this._options.leave,h.hover=(p,S)=>{if(this._options.hover){const{range:E}=h;this._options.hover(p,S,E)}},h)))}};class d{static computeLink(h,p,S,E){const v=new RegExp(p.source,(p.flags||"")+"g"),[l,c]=d._getWindowedLineStrings(h-1,S),n=l.join("");let o;const _=[];for(;o=v.exec(n);){const b=o[0];if(!f(b))continue;const[w,C]=d._mapStrIdx(S,c,0,o.index),[m,A]=d._mapStrIdx(S,w,C,b.length);if(w===-1||C===-1||m===-1||A===-1)continue;const j={start:{x:C+1,y:w+1},end:{x:A,y:m+1}};_.push({range:j,text:b,activate:E})}return _}static _getWindowedLineStrings(h,p){let S,E=h,v=h,l=0,c="";const n=[];if(S=p.buffer.active.getLine(h)){const o=S.translateToString(!0);if(S.isWrapped&&o[0]!==" "){for(l=0;(S=p.buffer.active.getLine(--E))&&l<2048&&(c=S.translateToString(!0),l+=c.length,n.push(c),S.isWrapped&&c.indexOf(" ")===-1););n.reverse()}for(n.push(o),l=0;(S=p.buffer.active.getLine(++v))&&S.isWrapped&&l<2048&&(c=S.translateToString(!0),l+=c.length,n.push(c),c.indexOf(" ")===-1););}return[n,E]}static _mapStrIdx(h,p,S,E){const v=h.buffer.active,l=v.getNullCell();let c=S;for(;E;){const n=v.getLine(p);if(!n)return[-1,-1];for(let o=c;o<n.length;++o){n.getCell(o,l);const _=l.getChars();if(l.getWidth()&&(E-=_.length||1,o===n.length-1&&_==="")){const b=v.getLine(p+1);b&&b.isWrapped&&(b.getCell(0,l),l.getWidth()===2&&(E+=1))}if(E<0)return[p,o]}p++,c=0}return[p,c]}}u.LinkComputer=d}},M={};function $(P){var u=M[P];if(u!==void 0)return u.exports;var f=M[P]={exports:{}};return I[P](f,f.exports,$),f.exports}var Q={};return(()=>{var P=Q;Object.defineProperty(P,"__esModule",{value:!0}),P.WebLinksAddon=void 0;const u=$(6),f=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,h){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}P.WebLinksAddon=class{constructor(g=d,h={}){this._handler=g,this._options=h}activate(g){this._terminal=g;const h=this._options,p=h.urlRegex||f;this._linkProvider=this._terminal.registerLinkProvider(new u.WebLinkProvider(this._terminal,p,this._handler,h))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),Q})()))})(zo)),zo.exports}var ag=ng();function lg(x,H){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal?session=${encodeURIComponent(x)}&token=${encodeURIComponent(H)}`}const og=15e3,cg=new Set([4001,4004]),ug="#10B981",hg="#F59E0B",fg="#EF4444",hd='"SF Mono", Menlo, Monaco, Inconsolata, "Source Code Pro", Consolas, "Liberation Mono", "Ubuntu Mono", "Courier Prime", "JetBrains Mono", "Courier New", monospace',dg={panelBackground:"#0E0E0E",textMuted:"#A1A1AA",borderSubtle:"#2E2E2E",xterm:{background:"#0E0E0E",foreground:"#FAFAFA",cursor:"#6BE195",cursorAccent:"#0E0E0E",selectionBackground:"rgba(107, 225, 149, 0.25)",black:"#1A1A1A",red:"#f87171",green:"#6BE195",yellow:"#f59e0b",blue:"#3b82f6",magenta:"#a78bfa",cyan:"#22d3ee",white:"#FAFAFA",brightBlack:"#404040",brightRed:"#ff9b96",brightGreen:"#8bd4a6",brightYellow:"#ffd966",brightBlue:"#60a5fa",brightMagenta:"#c4b5fd",brightCyan:"#67e8f9",brightWhite:"#ffffff"}},_g={panelBackground:"#FFFFFF",textMuted:"#737373",borderSubtle:"#E5E5E5",xterm:{background:"#FFFFFF",foreground:"#1A1A1A",cursor:"#05A9BC",cursorAccent:"#FFFFFF",selectionBackground:"rgba(5, 169, 188, 0.18)",black:"#3A3A3A",red:"#dc2626",green:"#05A9BC",yellow:"#b45309",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#d4d4d8",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#06b6d4",brightYellow:"#f59e0b",brightBlue:"#3b82f6",brightMagenta:"#a78bfa",brightCyan:"#22d3ee",brightWhite:"#ffffff"}},Uo=x=>x==="dark"?dg:_g,vg=({sessionId:x,token:H})=>{const I=ee.useRef(null),M=ee.useRef(null),[$,Q]=ee.useState("connecting"),[P,u]=ee.useState(null),[f,d]=ee.useState(ha());ee.useEffect(()=>Go(d),[]),ee.useEffect(()=>{M.current&&(M.current.options.theme=Uo(f).xterm)},[f]),ee.useEffect(()=>{const S=I.current;if(!S)return;let E=!1,v=0,l=null,c=null;const n=new ig.Terminal({cursorBlink:!0,fontSize:13,fontFamily:hd,theme:Uo(ha()).xterm,scrollback:1e4,allowProposedApi:!0});M.current=n;const o=new rg.FitAddon;n.loadAddon(o),n.loadAddon(new ag.WebLinksAddon),n.parser.registerCsiHandler({prefix:">",final:"q"},()=>(n.write("\x1BP>|XTerm(370)\x1B\\"),!0)),n.parser.registerOscHandler(52,m=>{var U;const A=m.split(";");if(A.length<2)return!1;const j=A[A.length-1];try{const W=atob(j),z=Uint8Array.from(W,ce=>ce.charCodeAt(0)),re=new TextDecoder().decode(z);(U=navigator.clipboard)==null||U.writeText(re).catch(()=>{})}catch{}return!0}),n.open(S),o.fit();const _=n.onData(m=>{(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(m)}),b=()=>{(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"resize",cols:n.cols,rows:n.rows}))},w=new ResizeObserver(()=>{o.fit(),b()});w.observe(S);function C(){if(E)return;const m=new WebSocket(lg(x,H));c=m,m.onopen=()=>{v=0,Q("connected"),u(null),o.fit(),b()},m.onmessage=A=>{const j=typeof A.data=="string"?A.data:new TextDecoder().decode(A.data);n.write(j)},m.onclose=A=>{if(E)return;if(cg.has(A.code)){Q("error"),u(A.reason||`Connection refused (${A.code})`);return}const j=Math.min(1e3*2**v,og);v+=1,Q("connecting"),l=setTimeout(C,j)}}return C(),()=>{E=!0,l&&clearTimeout(l),w.disconnect(),_.dispose(),c==null||c.close(),n.dispose(),M.current=null}},[x,H]);const g=$==="connected"?ug:$==="error"?fg:hg,h=$==="connected"?"Connected":$==="error"?P??"Error":"Connecting…",p=Uo(f);return k.jsxs("div",{className:"harness-terminal",style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",background:p.panelBackground,borderRadius:8,border:`1px solid ${p.borderSubtle}`,overflow:"hidden"},children:[k.jsxs("div",{"data-status":$,style:{display:"flex",alignItems:"center",gap:6,flexShrink:0,padding:"6px 10px",borderBottom:`1px solid ${p.borderSubtle}`,fontFamily:hd,fontSize:11},children:[k.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:g,boxShadow:$==="connecting"?`0 0 0 3px ${g}33`:"none",flexShrink:0}}),k.jsx("span",{style:{color:p.textMuted},children:h})]}),k.jsx("div",{ref:I,style:{flex:1,minHeight:0,padding:8,overflow:"hidden"}})]})},pg=8e3;function mg({message:x,onDismiss:H}){return ee.useEffect(()=>{const I=window.setTimeout(H,pg);return()=>window.clearTimeout(I)},[x,H]),k.jsxs("div",{className:"toast",role:"alert","data-testid":"toast",children:[k.jsx("span",{className:"toast-message",children:x}),k.jsx("button",{className:"toast-dismiss","aria-label":"Dismiss",onClick:H,children:"×"})]})}function gg({recentDirs:x,launchDir:H,listDir:I,onCreateSession:M,onRunSample:$,onDismiss:Q}){const[P,u]=ee.useState(!1),[f,d]=ee.useState(!1),[g,h]=ee.useState(null),p=ee.useRef(null),S=async()=>{d(!0),h(null);try{await $()}catch(E){h(E.message),d(!1)}};return k.jsxs("div",{className:"welcome-panel","data-testid":"welcome-panel",children:[k.jsxs("div",{className:"welcome-card",children:[k.jsx("div",{className:"welcome-eyebrow",children:"Welcome"}),k.jsx("h1",{className:"welcome-title",children:"Your coding agent, wired into Sapiom"}),k.jsx("p",{className:"welcome-intro",children:"This is your own coding agent — Claude Code or Codex — running in a Sapiom-configured workspace. Agent workflows you build here show up in the rail, get visualized live on the canvas, and can be run locally or deployed with one click."}),k.jsxs("div",{className:"welcome-actions",children:[k.jsx("button",{ref:p,className:"btn-primary welcome-action","data-testid":"welcome-start-project",onClick:()=>u(!0),children:"Start a new project"}),k.jsx("button",{className:"btn-ghost welcome-action","data-testid":"welcome-run-sample",onClick:()=>void S(),disabled:f,children:f?"Setting up the sample…":"Run the sample project"})]}),k.jsxs("p",{className:"welcome-sample-note",children:["The sample is ",k.jsx("code",{children:"order-triage"}),", a small support-ticket triage agent — ready to visualize, run, and deploy."]}),g&&k.jsx("div",{className:"welcome-error",children:g}),k.jsxs("div",{className:"welcome-hints","data-testid":"welcome-hints",children:[k.jsx("span",{className:"welcome-hints-label",children:"In a project you can"}),k.jsxs("span",{className:"welcome-hint-chip",children:[k.jsx(Ve,{name:"Sparkles",size:11})," Visualize"]}),k.jsxs("span",{className:"welcome-hint-chip",children:[k.jsx(Ve,{name:"Play",size:11})," Run local"]}),k.jsxs("span",{className:"welcome-hint-chip",children:[k.jsx(Ve,{name:"Cloud",size:11})," Deploy"]}),k.jsxs("span",{className:"welcome-hints-kbd",children:["— or press ",k.jsx("kbd",{children:"⌘K"})]})]}),k.jsx("button",{className:"welcome-dismiss","data-testid":"welcome-dismiss",onClick:Q,children:"Skip for now"})]}),P&&k.jsx(yd,{recentDirs:x,launchDir:H,listDir:I,onClose:()=>u(!1),onCreate:M,triggerRef:p})]})}function Sg({workflow:x,top:H,height:I,activeSessionId:M,boundWorkflowPath:$,macros:Q,onBind:P,onRunMacro:u}){const f={top:H,height:I},d={top:H},g=x.path===$,h=M?g?"You're working on this":null:"Start a session first",p=g?"Working on this":"Work on this";return k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"workflow-action-strip-notch",style:f,"data-testid":"workflow-action-strip-notch"}),k.jsxs("div",{className:"workflow-action-strip",style:d,"data-testid":"workflow-action-strip",children:[k.jsxs("button",{className:"strip-item strip-item-bind"+(g?" is-bound":""),"data-testid":"workflow-bind","aria-label":h?`${p}: ${h}`:p,"aria-pressed":g,disabled:!!h,onClick:P,children:[k.jsx("span",{className:"strip-item-icon",children:k.jsx(Ve,{name:g?"Radio":"Plug",size:15})}),k.jsxs("span",{className:"strip-item-text",children:[k.jsx("span",{className:"strip-item-label",children:p}),h&&!M&&k.jsx("span",{className:"strip-item-reason",children:h})]})]}),Q.map(S=>{const E=gd(S,x,M);return k.jsxs("button",{className:"strip-item","data-testid":`macro-${S.id}`,"aria-label":E?`${S.label}: ${E}`:S.label,disabled:!!E,onClick:()=>{u(S),Ki("macro.invoked",{macroId:S.id})},children:[k.jsx("span",{className:"strip-item-icon",children:k.jsx(Ve,{name:S.icon,size:15})}),k.jsxs("span",{className:"strip-item-text",children:[k.jsx("span",{className:"strip-item-label",children:S.label}),E&&k.jsx("span",{className:"strip-item-reason",children:E})]})]},S.id)})]})]})}const yg=x=>x.split("/").filter(Boolean).pop()??x,bg=(x,H)=>x===H||x.startsWith(`${H}/`);function Cg(x,H,I){const M=H.find(f=>f.id===I)??null,$=new Set(x),Q=[],P=new Set,u=[...M?[M.cwd]:[],...H.map(f=>f.cwd).filter(f=>f!==(M==null?void 0:M.cwd))].filter(f=>P.has(f)?!1:(P.add(f),!0));for(const f of u){const d=x.filter(h=>$.has(h)&&bg(h.path,f)),g=f===(M==null?void 0:M.cwd);d.length===0&&!g||(d.forEach(h=>$.delete(h)),Q.push({cwd:f,label:yg(f),isActive:g,workflows:d}))}return{groups:Q,ungrouped:Array.from($)}}function wg({workflow:x,isSelected:H,onSelect:I,onSelectedRowElement:M}){return k.jsx("div",{ref:H?M:void 0,className:"workflow-item"+(H?" is-selected":""),"data-testid":`workflow-${x.name}`,children:k.jsxs("button",{className:"workflow-item-trigger",onClick:()=>I(x.path),title:x.path,children:[k.jsx("span",{className:"workflow-caret",children:"▸"}),k.jsx("span",{className:"workflow-name",children:x.name}),x.definitionId!=null&&k.jsx("span",{className:"workflow-dot",title:"Deployed"})]})})}function Eg({workflows:x,sessions:H,activeSessionId:I,selectedPath:M,onSelect:$,onSelectedRowElement:Q,onConnect:P}){const[u,f]=ee.useState(!1),[d,g]=ee.useState(""),[h,p]=ee.useState(!1),[S,E]=ee.useState(null),v=async()=>{const o=d.trim();if(o){p(!0),E(null);try{await P(o),g(""),f(!1)}catch(_){E(_.message)}finally{p(!1)}}},{groups:l,ungrouped:c}=Cg(x,H,I),n=o=>k.jsx(wg,{workflow:o,isSelected:o.path===M,onSelect:$,onSelectedRowElement:Q},o.path);return k.jsxs("aside",{className:"rail rail-workflows",children:[k.jsx("div",{className:"rail-header",children:"Workspace"}),k.jsxs("div",{className:"rail-list",children:[l.length===0&&c.length===0&&k.jsx("div",{className:"rail-empty",children:"No workflows yet"}),l.map(o=>k.jsxs("div",{className:"workspace-group"+(o.isActive?" is-active":""),children:[k.jsxs("div",{className:"workspace-group-header","data-testid":`workspace-group-${o.label}`,children:[k.jsx(Ve,{name:o.isActive?"Radio":"Folder",size:11}),o.label]}),o.workflows.length===0&&k.jsx("div",{className:"workspace-group-empty",children:"No workflows here yet"}),o.workflows.map(n)]},o.cwd)),c.length>0&&k.jsxs("div",{className:"workspace-group",children:[k.jsx("div",{className:"workspace-group-header",children:"Other"}),c.map(n)]})]}),u?k.jsxs("div",{className:"connect-form",children:[k.jsx("input",{autoFocus:!0,className:"connect-input",placeholder:"/path/to/project",value:d,onChange:o=>g(o.target.value),onKeyDown:o=>{o.key==="Enter"&&v(),o.key==="Escape"&&f(!1)}}),S&&k.jsx("div",{className:"connect-error",children:S}),k.jsxs("div",{className:"connect-actions",children:[k.jsx("button",{className:"btn-ghost",onClick:()=>f(!1),disabled:h,children:"Cancel"}),k.jsx("button",{className:"btn-primary",onClick:()=>void v(),disabled:h||!d.trim(),children:h?"Connecting…":"Connect"})]})]}):k.jsx("button",{className:"connect-trigger",onClick:()=>f(!0),children:"+ Connect"})]})}function xg(x,H){const[I,M]=ee.useState(null);return ee.useLayoutEffect(()=>{if(!x||!H){M(null);return}const $=()=>{const u=x.getBoundingClientRect(),f=H.getBoundingClientRect();M({top:u.top-f.top,height:u.height})};$();const Q=x.closest(".rail-list");Q==null||Q.addEventListener("scroll",$),window.addEventListener("resize",$);const P=new ResizeObserver($);return P.observe(x),P.observe(H),()=>{Q==null||Q.removeEventListener("scroll",$),window.removeEventListener("resize",$),P.disconnect()}},[x,H]),I}const Cd="sapiom-harness-pane-widths",$o=180,wd=480,Po=220,Vo=280,Ed=720,Wo=420;function Fo(x,H,I){return Math.min(Math.max(x,H),I)}function Ag(){const x={rail:Po,canvas:Wo};if(typeof window>"u")return x;try{const H=window.localStorage.getItem(Cd);if(!H)return x;const I=JSON.parse(H);return{rail:Fo(typeof I.rail=="number"?I.rail:Po,$o,wd),canvas:Fo(typeof I.canvas=="number"?I.canvas:Wo,Vo,Ed)}}catch{return x}}function fd(x){window.localStorage.setItem(Cd,JSON.stringify(x))}function Dg(){const[x,H]=ee.useState(Ag),I=($,Q,P,u)=>f=>{const d=f.currentTarget;d.setPointerCapture(f.pointerId);const g=f.clientX,h=x[$],p=E=>{const v=Fo(h+(E.clientX-g)*Q,P,u);H(l=>l[$]===v?l:{...l,[$]:v})},S=()=>{d.removeEventListener("pointermove",p),d.removeEventListener("pointerup",S),H(E=>(fd(E),E))};d.addEventListener("pointermove",p),d.addEventListener("pointerup",S)},M=($,Q)=>{H(P=>{const u={...P,[$]:Q};return fd(u),u})};return{widths:x,startRailDrag:I("rail",1,$o,wd),startCanvasDrag:I("canvas",-1,Vo,Ed),resetRail:()=>M("rail",Po),resetCanvas:()=>M("canvas",Wo)}}const Rg=2e3;function Tg(x){const H=new URL("/ws/events",window.location.href);H.protocol=H.protocol==="https:"?"wss:":"ws:",H.searchParams.set("token",da());let I=null,M=null,$=!1;const Q=()=>{I=new WebSocket(H),I.addEventListener("message",P=>{try{x(JSON.parse(P.data))}catch{}}),I.addEventListener("close",()=>{$||(M=setTimeout(Q,Rg))})};return Q(),()=>{$=!0,M&&clearTimeout(M),I==null||I.close()}}const ut=Xo(),kg=3e3;function Lg(){const[x,H]=ee.useState(null),[I,M]=ee.useState(null),[$,Q]=ee.useState(!0),[P,u]=ee.useState(null),[f,d]=ee.useState(null),[g,h]=ee.useState(null),[p,S]=ee.useState([]),[E,v]=ee.useState(null),[l,c]=ee.useState(!1),[n,o]=ee.useState(null),[_,b]=ee.useState(new Set),[w,C]=ee.useState([]),m=ee.useRef(new Map);ee.useEffect(()=>{const J=m.current;return()=>{J.forEach(V=>clearTimeout(V)),J.clear()}},[]),ee.useEffect(()=>{let J=!1;return Promise.all([ut.getState(),ut.getSettings()]).then(([V,N])=>{if(J)return;H(V),M(N),V.tasks&&C(V.tasks);const R=V.sessions.find(Z=>Z.status!=="exited");R&&h(R.id),V.workflows[0]&&d(V.workflows[0].path)}).catch(V=>!J&&u(V.message)).finally(()=>!J&&Q(!1)),()=>{J=!0}},[]),ee.useEffect(()=>{if(!g)return;const J=x==null?void 0:x.sessions.find(V=>V.id===g);d(md(J))},[g]);const A=ee.useCallback(async()=>{const J=await ut.listWorkflows();H(V=>V&&{...V,workflows:J})},[]);ee.useEffect(()=>Tg(J=>{if(o(J),J.type==="session.status"){if(H(V=>{if(!V)return V;const R=V.sessions.some(Z=>Z.id===J.session.id)?V.sessions.map(Z=>Z.id===J.session.id?J.session:Z):[...V.sessions,J.session];return{...V,sessions:R}}),J.session.status==="exited"){const V=J.session.id,N=m.current.get(V);N&&(clearTimeout(N),m.current.delete(V)),b(R=>{if(!R.has(V))return R;const Z=new Set(R);return Z.delete(V),Z})}}else if(J.type==="workflows.changed")A();else if(J.type==="task.status")C(V=>V.some(R=>R.id===J.task.id)?V.map(R=>R.id===J.task.id?J.task:R):[...V,J.task]);else if(J.type==="session.activity"){const V=J.harnessSessionId;b(R=>R.has(V)?R:new Set(R).add(V));const N=m.current.get(V);N&&clearTimeout(N),m.current.set(V,setTimeout(()=>{m.current.delete(V),b(R=>{if(!R.has(V))return R;const Z=new Set(R);return Z.delete(V),Z})},kg))}}),[A]);const j=ee.useCallback(async J=>{c(!0);try{S(await ut.sessionHistory(J))}finally{c(!1)}},[]),U=ee.useCallback(async J=>{const V=await ut.createSession(J);H(R=>R&&!R.sessions.some(Z=>Z.id===V.id)?{...R,sessions:[...R.sessions,V]}:R),h(V.id);let N=[];M(R=>(N=[J.cwd,...((R==null?void 0:R.recentDirs)??[]).filter(Z=>Z!==J.cwd)].slice(0,8),R&&{...R,recentDirs:N}));try{const R=await ut.updateSettings({recentDirs:N});M(Z=>Z&&{...Z,recentDirs:R.recentDirs})}catch{}return V},[]),W=ee.useCallback(async()=>{var N;const J=await ut.seedSampleProject(),V=((N=x==null?void 0:x.availableHarnesses)==null?void 0:N[0])??"claude-code";return U({cwd:J.root,harness:V})},[x==null?void 0:x.availableHarnesses,U]),z=ee.useCallback(async J=>{try{const V=await ut.resumeSession(J);return H(N=>N&&{...N,sessions:N.sessions.map(R=>R.id===V.id?V:R)}),h(V.id),V}catch(V){throw v(V instanceof ds&&V.reason?V.reason:V.message),V}},[]),re=ee.useCallback(async J=>{var N;const V=J.harnessSessionId??((N=x==null?void 0:x.sessions.find(R=>R.agentSessionId===J.agentSessionId))==null?void 0:N.id);return V?z(V):U({cwd:J.cwd,harness:J.harness})},[x,z,U]),ce=ee.useCallback(async J=>{try{await ut.killSession(J)}catch(N){throw v(N instanceof ds&&N.reason?N.reason:N.message),N}const V=((x==null?void 0:x.sessions)??[]).filter(N=>N.id!==J);if(H(N=>N&&{...N,sessions:V}),g===J){const N=V.find(R=>R.status!=="exited");h(N?N.id:null)}},[x,g]),F=ee.useCallback(async J=>{const V=await ut.connectWorkflow(J);return H(N=>N&&{...N,workflows:[...N.workflows.filter(R=>R.path!==V.path),V]}),V},[]),K=ee.useCallback(async(J,V)=>{const N=await ut.bindWorkflow(J,V);H(R=>R&&{...R,sessions:R.sessions.map(Z=>Z.id===N.id?N:Z)})},[]),te=ee.useCallback(async J=>{const V=await ut.updateSettings(J);return M(V),J.telemetryOptIn!==void 0&&H(N=>N&&{...N,telemetryOptIn:V.telemetryOptIn}),V},[]),T=ee.useCallback(async(J,V)=>{try{await ut.runMacro(J,V)}catch(N){v(N instanceof ds&&N.reason?N.reason:N.message)}},[]),B=ee.useCallback(()=>v(null),[]),D=ee.useCallback(async(J,V)=>{await ut.injectInput(J,{text:V,submit:!0})},[]),O=ee.useCallback(async(J,V)=>{try{await ut.injectInput(J,{text:V,submit:!1}),v("Typed into the terminal — edit and press Enter.")}catch(N){v(N instanceof ds&&N.reason?N.reason:N.message)}},[]),G=ee.useCallback(J=>{v(J)},[]),ae=ee.useCallback(J=>ut.listDir(J),[]);return{state:x,loading:$,error:P,settings:I,bootToken:da(),selectedWorkflowPath:f,setSelectedWorkflowPath:d,activeSessionId:g,setActiveSessionId:h,history:p,historyLoading:l,loadHistory:j,createSession:U,createSampleSession:W,resumeSession:z,resumeFromHistory:re,closeSession:ce,connectWorkflow:F,bindWorkflow:K,updateSettings:te,runMacro:T,injectInput:D,useSkill:O,showToast:G,listDir:ae,lastMessage:n,toast:E,dismissToast:B,busySessionIds:_,tasks:w,api:ut}}const Mg=5,Og=150;function Bg(x){const{fetchRunState:H,onUpdate:I,pollMs:M=2e3,fetchSpend:$,onSpend:Q,maxSettleCycles:P=Og}=x,u=new Map;let f=!1;async function d(v,l){if(!$||!Q||l.spendInFlight!==null)return;const c=new AbortController;l.spendInFlight=c;try{const n=await $(v,c.signal),o=u.get(v);o&&(Q(v,n),n.settleState==="final"&&(o.spendSettled=!0))}catch{}finally{const n=u.get(v);n&&n.spendInFlight===c&&(n.spendInFlight=null)}}async function g(v){if(f)return;const l=u.get(v);if(!l)return;if(l.terminal){if(l.spendSettled||l.settleRemaining<=0){p(v);return}l.settleRemaining-=1,d(v,l);return}if(l.inFlight!==null)return;const c=new AbortController;l.inFlight=c,d(v,l);try{const n=await H(v,c.signal),o=u.get(v);if(o&&(o.inFlight=null,o.failures=0),I(v,n),n.status!=="running"){const _=u.get(v);_&&($&&Q?(_.terminal=!0,_.settleRemaining=P):p(v))}}catch{const n=u.get(v);n&&(n.inFlight=null,n.failures+=1,n.failures>=Mg&&p(v))}}function h(v){if(u.has(v))return;const l={intervalId:setInterval(()=>{g(v)},M),inFlight:null,failures:0,terminal:!1,settleRemaining:0,spendSettled:!1,spendInFlight:null};u.set(v,l),g(v)}function p(v){var c,n;const l=u.get(v);l&&(clearInterval(l.intervalId),(c=l.inFlight)==null||c.abort(),(n=l.spendInFlight)==null||n.abort(),u.delete(v))}function S(){for(const v of[...u.keys()])p(v)}function E(v){f=v}return{start:h,stop:p,stopAll:S,setPaused:E}}const dd=Xo();function Ng(x){const[H,I]=ee.useState(new Map),[M,$]=ee.useState(new Map),Q=ee.useRef(null);return Q.current===null&&(Q.current=Bg({fetchRunState:(P,u)=>dd.getRunState(P,u),onUpdate:(P,u)=>I(f=>{const d=new Map(f);return d.set(P,u),d}),fetchSpend:(P,u)=>dd.getRunSpend(P,u),onSpend:(P,u)=>$(f=>new Map(f).set(P,u))})),ee.useEffect(()=>{(x==null?void 0:x.type)==="execution.started"&&x.target==="prod"&&Q.current.start(x.executionId)},[x]),ee.useEffect(()=>{const P=Q.current,u=()=>{P.setPaused(document.hidden)};return P.setPaused(document.hidden),document.addEventListener("visibilitychange",u),()=>{document.removeEventListener("visibilitychange",u)}},[]),ee.useEffect(()=>{const P=Q.current;return()=>{P.stopAll()}},[]),{runViews:H,runSpends:M}}const Hg=()=>{var R,Z,le,de,_e,Ee,Le;const x=Lg(),[H,I]=ee.useState(!1),[M,$]=ee.useState(!1),[Q,P]=ee.useState(!1),[u,f]=ee.useState(null),[d,g]=ee.useState(null),[h,p]=ee.useState("canvas"),[S,E]=ee.useState(!1),[v,l]=ee.useState(!1),c=xg(u,d),n=ee.useMemo(()=>x.api.listSkills.bind(x.api),[x.api]),o=ee.useMemo(()=>x.api.getSkill.bind(x.api),[x.api]),{widths:_,startRailDrag:b,startCanvasDrag:w,resetRail:C,resetCanvas:m}=Dg(),{runViews:A,runSpends:j}=Ng(x.lastMessage),U=ee.useRef(new Map),W=ee.useRef(new Map);ee.useEffect(()=>{const ve=x.lastMessage;(ve==null?void 0:ve.type)==="execution.started"&&(ve.target==="prod"&&U.current.set(ve.harnessSessionId,ve.executionId),W.current.set(ve.harnessSessionId,ve.target))},[x.lastMessage]);const z=x.activeSessionId?U.current.get(x.activeSessionId):void 0,re=z?A.get(z):void 0,ce=z?j.get(z):void 0,F=x.activeSessionId?W.current.get(x.activeSessionId):void 0;if(ee.useEffect(()=>{const ve=De=>{var Pt;const ye=De.key.toLowerCase();if((De.metaKey||De.ctrlKey)&&(ye==="k"||ye==="p")){De.preventDefault(),I(!0);return}if((De.metaKey||De.ctrlKey)&&/^[1-9]$/.test(De.key)){const Wt=(Pt=x.state)==null?void 0:Pt.sessions.filter(Ft=>Ft.status!=="exited").sort((Ft,gi)=>Ft.createdAt.localeCompare(gi.createdAt)),$t=Wt==null?void 0:Wt[Number(De.key)-1];$t&&(De.preventDefault(),x.setActiveSessionId($t.id))}};return window.addEventListener("keydown",ve),()=>window.removeEventListener("keydown",ve)},[(R=x.state)==null?void 0:R.sessions]),x.loading)return k.jsx("div",{className:"app-status",children:"Loading Sapiom Harness…"});if(x.error||!x.state)return k.jsxs("div",{className:"app-status app-status-error",children:["Failed to load: ",x.error]});const{state:K}=x,te=K.sessions.find(ve=>ve.id===x.activeSessionId)??null,T=md(te),B=K.workflows.find(ve=>ve.path===T)??null,D=K.workflows.find(ve=>ve.path===x.selectedWorkflowPath)??null,O=K.sessions.some(ve=>ve.status!=="exited"),G=K.firstRun===!0&&!O&&!M,ae=async(ve,De)=>{await x.createSession({cwd:ve,harness:De})},J=ve=>{x.setSelectedWorkflowPath(ve)},V=ve=>{x.setSelectedWorkflowPath(ve),x.activeSessionId&&x.bindWorkflow(x.activeSessionId,ve)},N=(ve,De)=>{if(ve&&V(ve.path),De.action.kind==="open-url"){window.open(vm(De.action.url,ve),"_blank","noopener,noreferrer");return}x.activeSessionId&&x.runMacro(De.id,{harnessSessionId:x.activeSessionId,workflowPath:ve==null?void 0:ve.path})};return k.jsxs("div",{className:"app-shell",children:[k.jsx(um,{authenticated:K.authenticated,organizationName:K.organizationName,onOpenPalette:()=>I(!0),telemetryOptIn:((Z=x.settings)==null?void 0:Z.telemetryOptIn)??K.telemetryOptIn,consentSource:K.consentSource,consentEnvReason:K.consentEnvReason,onOpenSettings:()=>P(!0)}),K.consentSource==="default-silent"&&!((le=x.settings)!=null&&le.telemetryNoticeDismissed)&&k.jsx(eg,{onDismiss:()=>{x.updateSettings({telemetryNoticeDismissed:!0})},onOpenSettings:()=>P(!0)}),k.jsxs("div",{className:"app",style:{gridTemplateColumns:`minmax(${$o}px, ${_.rail}px) 32px minmax(360px, 1fr) minmax(${Vo}px, ${_.canvas}px)`},children:[k.jsx(Eg,{workflows:K.workflows,sessions:K.sessions,activeSessionId:x.activeSessionId,selectedPath:x.selectedWorkflowPath,onSelect:J,onSelectedRowElement:f,onConnect:async ve=>{await x.connectWorkflow(ve)}}),k.jsx("div",{className:"workflow-action-strip-col",ref:g,children:D&&c&&k.jsx(Sg,{workflow:D,top:c.top,height:c.height,activeSessionId:x.activeSessionId,boundWorkflowPath:T,macros:K.macros,onBind:()=>V(D.path),onRunMacro:ve=>N(D,ve)})}),k.jsx("div",{className:"pane-resize-handle pane-resize-handle-rail",style:{left:_.rail+32},onPointerDown:b,onDoubleClick:C,role:"separator","aria-orientation":"vertical","aria-label":"Resize workspace rail","data-testid":"resize-handle-rail"}),k.jsxs("div",{className:"center-pane",children:[k.jsx(Bm,{sessions:K.sessions,activeSessionId:x.activeSessionId,onSelectSession:x.setActiveSessionId,onResumeHistory:ve=>void x.resumeFromHistory(ve),history:x.history,historyLoading:x.historyLoading,onOpenHistory:ve=>void x.loadHistory(ve),recentDirs:((de=x.settings)==null?void 0:de.recentDirs)??[],launchDir:K.launchDir??null,listDir:x.listDir,onCreateSession:ae,boundWorkflowName:(B==null?void 0:B.name)??null,authenticated:K.authenticated,organizationName:K.organizationName,telemetryOptIn:((_e=x.settings)==null?void 0:_e.telemetryOptIn)??K.telemetryOptIn,onToggleTelemetry:async ve=>{await x.updateSettings({telemetryOptIn:ve})},busySessionIds:x.busySessionIds,settingsOpen:Q,onSetSettingsOpen:P}),k.jsx("div",{className:"terminal-slot",children:(te==null?void 0:te.status)==="exited"?k.jsx(xm,{session:te,onResume:()=>void x.resumeSession(te.id),onClose:()=>void x.closeSession(te.id)}):x.activeSessionId?k.jsx(km,{sessionId:x.activeSessionId,harness:(te==null?void 0:te.harness)??"claude-code",api:x.api,showToast:x.showToast,children:k.jsx(vg,{sessionId:x.activeSessionId,token:x.bootToken})}):G?k.jsx(gg,{recentDirs:((Ee=x.settings)==null?void 0:Ee.recentDirs)??[],launchDir:K.launchDir??null,listDir:x.listDir,onCreateSession:ae,onRunSample:async()=>{await x.createSampleSession()},onDismiss:()=>$(!0)}):k.jsx("div",{className:"terminal-empty",children:'No active session — click "+ new" to start one.'})})]}),k.jsx("div",{className:"pane-resize-handle pane-resize-handle-canvas",style:{right:_.canvas},onPointerDown:w,onDoubleClick:m,role:"separator","aria-orientation":"vertical","aria-label":"Resize canvas pane","data-testid":"resize-handle-canvas"}),k.jsxs("div",{className:"right-pane",children:[k.jsxs("div",{className:"right-pane-tabs",role:"tablist","aria-label":"Right pane",children:[k.jsx("button",{role:"tab","aria-selected":h==="canvas",className:"right-pane-tab"+(h==="canvas"?" is-active":""),onClick:()=>p("canvas"),"data-testid":"right-tab-canvas",children:"Canvas"}),k.jsx("button",{role:"tab","aria-selected":h==="skills",className:"right-pane-tab"+(h==="skills"?" is-active":""),onClick:()=>{p("skills"),E(!0)},"data-testid":"right-tab-skills",children:"Skills"}),k.jsx("button",{role:"tab","aria-selected":h==="snippet",className:"right-pane-tab"+(h==="snippet"?" is-active":""),onClick:()=>{p("snippet"),l(!0)},"data-testid":"right-tab-snippet",children:"Snippet"})]}),k.jsx("div",{className:"right-pane-panel"+(h==="canvas"?"":" is-hidden"),"data-testid":"right-panel-canvas",children:k.jsx(bm,{sessionId:x.activeSessionId,lastMessage:x.lastMessage,boundWorkflow:B,activeSessionId:x.activeSessionId,macros:K.macros,tasks:x.tasks,onRunMacro:ve=>N(B,ve),runView:re,runSpend:ce,target:F})}),(h==="skills"||S)&&k.jsx("div",{className:"right-pane-panel"+(h==="skills"?"":" is-hidden"),"data-testid":"right-panel-skills",children:k.jsx(Im,{listSkills:n,getSkill:o,isActive:h==="skills",activeSession:te,onUseSkill:(ve,De)=>void x.useSkill(ve,De)})}),(h==="snippet"||v)&&k.jsx("div",{className:"right-pane-panel"+(h==="snippet"?"":" is-hidden"),"data-testid":"right-panel-snippet",children:B&&B.definitionId!=null?k.jsx(Qm,{boundWorkflow:B,agentsBaseUrl:K.agentsBaseUrl}):k.jsxs("div",{className:"canvas-empty",children:[k.jsx("p",{children:"No snippet yet."}),k.jsx("p",{className:"canvas-empty-hint",children:"Deploy a workflow and bind it to this session to get a copy-paste snippet that triggers your agent from code."})]})})]})]}),H&&k.jsx(Em,{sessions:K.sessions,workflows:K.workflows,recentDirs:((Le=x.settings)==null?void 0:Le.recentDirs)??[],listDir:x.listDir,onSelectSession:x.setActiveSessionId,onOpenPath:ve=>void ae(ve,"claude-code"),onClose:()=>I(!1)}),x.toast&&k.jsx(mg,{message:x.toast,onDismiss:x.dismissToast})]})};window.addEventListener("scroll",()=>{(window.scrollX!==0||window.scrollY!==0)&&window.scrollTo(0,0)},{passive:!0});Qv.createRoot(document.getElementById("root")).render(k.jsx(ee.StrictMode,{children:k.jsx(Hg,{})}));