handmux 0.5.2

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 (58) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +303 -0
  3. package/README.zh-CN.md +285 -0
  4. package/bin/handmux.js +417 -0
  5. package/hooks/handmux-notify.sh +20 -0
  6. package/hooks/handmux-write.cjs +92 -0
  7. package/package.json +52 -0
  8. package/public/assets/index-CNEiBm9y.js +157 -0
  9. package/public/assets/index-CSX2d9C7.css +32 -0
  10. package/public/fonts/JetBrainsMonoNerdFontMono-Regular.woff2 +0 -0
  11. package/public/fonts/TWUnifont.woff2 +0 -0
  12. package/public/icons/apple-touch-icon.png +0 -0
  13. package/public/icons/badge-96.png +0 -0
  14. package/public/icons/icon-192.png +0 -0
  15. package/public/icons/icon-512.png +0 -0
  16. package/public/icons/logo.svg +32 -0
  17. package/public/index.html +105 -0
  18. package/public/manifest.webmanifest +37 -0
  19. package/public/offline.html +50 -0
  20. package/public/sw.js +117 -0
  21. package/src/.gitkeep +0 -0
  22. package/src/appName.js +23 -0
  23. package/src/asr/iflyConfig.js +10 -0
  24. package/src/asr/iflySign.js +16 -0
  25. package/src/auth.js +30 -0
  26. package/src/claudeEvents.js +212 -0
  27. package/src/cli/cfNamed.js +5 -0
  28. package/src/cli/claudeHooks.js +116 -0
  29. package/src/cli/cloudflareUrl.js +9 -0
  30. package/src/cli/cloudflared.js +53 -0
  31. package/src/cli/drivers.js +59 -0
  32. package/src/cli/options.js +169 -0
  33. package/src/cli/probe.js +16 -0
  34. package/src/cli/qr.js +34 -0
  35. package/src/cli/service.js +98 -0
  36. package/src/cli/setupWizard.js +248 -0
  37. package/src/cli/sshTunnel.js +12 -0
  38. package/src/cli/state.js +42 -0
  39. package/src/cli/supervisor.js +172 -0
  40. package/src/cli/tmuxConf.js +90 -0
  41. package/src/cli/tmuxVersion.js +49 -0
  42. package/src/cli/tunlite.js +22 -0
  43. package/src/config.js +6 -0
  44. package/src/docPath.js +46 -0
  45. package/src/docs.js +222 -0
  46. package/src/git.js +185 -0
  47. package/src/httpApi.js +548 -0
  48. package/src/previewServer.js +182 -0
  49. package/src/previews.js +118 -0
  50. package/src/push.js +121 -0
  51. package/src/server.js +97 -0
  52. package/src/staticCache.js +8 -0
  53. package/src/tmux/commands.js +237 -0
  54. package/src/trimCapture.js +28 -0
  55. package/src/uploadTypes.js +28 -0
  56. package/tmux/README.md +77 -0
  57. package/tmux/claude-tab-seed.py +67 -0
  58. package/tmux/claude-tab-seen.sh +14 -0
@@ -0,0 +1,157 @@
1
+ var vm=Object.defineProperty;var zu=e=>{throw TypeError(e)};var wm=(e,t,i)=>t in e?vm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Qe=(e,t,i)=>wm(e,typeof t!="symbol"?t+"":t,i),ym=(e,t,i)=>t.has(e)||zu("Cannot "+i);var $u=(e,t,i)=>t.has(e)?zu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i);var Vn=(e,t,i)=>(ym(e,t,"access private method"),i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const d of n)if(d.type==="childList")for(const _ of d.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function i(n){const d={};return n.integrity&&(d.integrity=n.integrity),n.referrerPolicy&&(d.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?d.credentials="include":n.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(n){if(n.ep)return;n.ep=!0;const d=i(n);fetch(n.href,d)}})();var tf={exports:{}},fa={},rf={exports:{}},Fe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Pn=Symbol.for("react.element"),Sm=Symbol.for("react.portal"),bm=Symbol.for("react.fragment"),Cm=Symbol.for("react.strict_mode"),xm=Symbol.for("react.profiler"),km=Symbol.for("react.provider"),Em=Symbol.for("react.context"),Lm=Symbol.for("react.forward_ref"),Rm=Symbol.for("react.suspense"),Tm=Symbol.for("react.memo"),Dm=Symbol.for("react.lazy"),Uu=Symbol.iterator;function Am(e){return e===null||typeof e!="object"?null:(e=Uu&&e[Uu]||e["@@iterator"],typeof e=="function"?e:null)}var sf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nf=Object.assign,of={};function Ms(e,t,i){this.props=e,this.context=t,this.refs=of,this.updater=i||sf}Ms.prototype.isReactComponent={};Ms.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ms.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function af(){}af.prototype=Ms.prototype;function Sc(e,t,i){this.props=e,this.context=t,this.refs=of,this.updater=i||sf}var bc=Sc.prototype=new af;bc.constructor=Sc;nf(bc,Ms.prototype);bc.isPureReactComponent=!0;var Wu=Array.isArray,lf=Object.prototype.hasOwnProperty,Cc={current:null},cf={key:!0,ref:!0,__self:!0,__source:!0};function uf(e,t,i){var r,n={},d=null,_=null;if(t!=null)for(r in t.ref!==void 0&&(_=t.ref),t.key!==void 0&&(d=""+t.key),t)lf.call(t,r)&&!cf.hasOwnProperty(r)&&(n[r]=t[r]);var s=arguments.length-2;if(s===1)n.children=i;else if(1<s){for(var o=Array(s),f=0;f<s;f++)o[f]=arguments[f+2];n.children=o}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)n[r]===void 0&&(n[r]=s[r]);return{$$typeof:Pn,type:e,key:d,ref:_,props:n,_owner:Cc.current}}function Mm(e,t){return{$$typeof:Pn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pn}function Im(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var Vu=/\/+/g;function Oa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Im(""+e.key):t.toString(36)}function So(e,t,i,r,n){var d=typeof e;(d==="undefined"||d==="boolean")&&(e=null);var _=!1;if(e===null)_=!0;else switch(d){case"string":case"number":_=!0;break;case"object":switch(e.$$typeof){case Pn:case Sm:_=!0}}if(_)return _=e,n=n(_),e=r===""?"."+Oa(_,0):r,Wu(n)?(i="",e!=null&&(i=e.replace(Vu,"$&/")+"/"),So(n,t,i,"",function(f){return f})):n!=null&&(xc(n)&&(n=Mm(n,i+(!n.key||_&&_.key===n.key?"":(""+n.key).replace(Vu,"$&/")+"/")+e)),t.push(n)),1;if(_=0,r=r===""?".":r+":",Wu(e))for(var s=0;s<e.length;s++){d=e[s];var o=r+Oa(d,s);_+=So(d,t,i,o,n)}else if(o=Am(e),typeof o=="function")for(e=o.call(e),s=0;!(d=e.next()).done;)d=d.value,o=r+Oa(d,s++),_+=So(d,t,i,o,n);else if(d==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return _}function Gn(e,t,i){if(e==null)return e;var r=[],n=0;return So(e,r,"","",function(d){return t.call(i,d,n++)}),r}function Pm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(i){(e._status===0||e._status===-1)&&(e._status=1,e._result=i)},function(i){(e._status===0||e._status===-1)&&(e._status=2,e._result=i)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ht={current:null},bo={transition:null},Om={ReactCurrentDispatcher:Ht,ReactCurrentBatchConfig:bo,ReactCurrentOwner:Cc};function hf(){throw Error("act(...) is not supported in production builds of React.")}Fe.Children={map:Gn,forEach:function(e,t,i){Gn(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return Gn(e,function(){t++}),t},toArray:function(e){return Gn(e,function(t){return t})||[]},only:function(e){if(!xc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Fe.Component=Ms;Fe.Fragment=bm;Fe.Profiler=xm;Fe.PureComponent=Sc;Fe.StrictMode=Cm;Fe.Suspense=Rm;Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Om;Fe.act=hf;Fe.cloneElement=function(e,t,i){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=nf({},e.props),n=e.key,d=e.ref,_=e._owner;if(t!=null){if(t.ref!==void 0&&(d=t.ref,_=Cc.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(o in t)lf.call(t,o)&&!cf.hasOwnProperty(o)&&(r[o]=t[o]===void 0&&s!==void 0?s[o]:t[o])}var o=arguments.length-2;if(o===1)r.children=i;else if(1<o){s=Array(o);for(var f=0;f<o;f++)s[f]=arguments[f+2];r.children=s}return{$$typeof:Pn,type:e.type,key:n,ref:d,props:r,_owner:_}};Fe.createContext=function(e){return e={$$typeof:Em,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:km,_context:e},e.Consumer=e};Fe.createElement=uf;Fe.createFactory=function(e){var t=uf.bind(null,e);return t.type=e,t};Fe.createRef=function(){return{current:null}};Fe.forwardRef=function(e){return{$$typeof:Lm,render:e}};Fe.isValidElement=xc;Fe.lazy=function(e){return{$$typeof:Dm,_payload:{_status:-1,_result:e},_init:Pm}};Fe.memo=function(e,t){return{$$typeof:Tm,type:e,compare:t===void 0?null:t}};Fe.startTransition=function(e){var t=bo.transition;bo.transition={};try{e()}finally{bo.transition=t}};Fe.unstable_act=hf;Fe.useCallback=function(e,t){return Ht.current.useCallback(e,t)};Fe.useContext=function(e){return Ht.current.useContext(e)};Fe.useDebugValue=function(){};Fe.useDeferredValue=function(e){return Ht.current.useDeferredValue(e)};Fe.useEffect=function(e,t){return Ht.current.useEffect(e,t)};Fe.useId=function(){return Ht.current.useId()};Fe.useImperativeHandle=function(e,t,i){return Ht.current.useImperativeHandle(e,t,i)};Fe.useInsertionEffect=function(e,t){return Ht.current.useInsertionEffect(e,t)};Fe.useLayoutEffect=function(e,t){return Ht.current.useLayoutEffect(e,t)};Fe.useMemo=function(e,t){return Ht.current.useMemo(e,t)};Fe.useReducer=function(e,t,i){return Ht.current.useReducer(e,t,i)};Fe.useRef=function(e){return Ht.current.useRef(e)};Fe.useState=function(e){return Ht.current.useState(e)};Fe.useSyncExternalStore=function(e,t,i){return Ht.current.useSyncExternalStore(e,t,i)};Fe.useTransition=function(){return Ht.current.useTransition()};Fe.version="18.3.1";rf.exports=Fe;var B=rf.exports;/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 Nm=B,Bm=Symbol.for("react.element"),jm=Symbol.for("react.fragment"),Fm=Object.prototype.hasOwnProperty,Hm=Nm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zm={key:!0,ref:!0,__self:!0,__source:!0};function df(e,t,i){var r,n={},d=null,_=null;i!==void 0&&(d=""+i),t.key!==void 0&&(d=""+t.key),t.ref!==void 0&&(_=t.ref);for(r in t)Fm.call(t,r)&&!zm.hasOwnProperty(r)&&(n[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)n[r]===void 0&&(n[r]=t[r]);return{$$typeof:Bm,type:e,key:d,ref:_,props:n,_owner:Hm.current}}fa.Fragment=jm;fa.jsx=df;fa.jsxs=df;tf.exports=fa;var C=tf.exports,ff={exports:{}},oi={},pf={exports:{}},_f={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(H,L){var A=H.length;H.push(L);e:for(;0<A;){var j=A-1>>>1,z=H[j];if(0<n(z,L))H[j]=L,H[A]=z,A=j;else break e}}function i(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var L=H[0],A=H.pop();if(A!==L){H[0]=A;e:for(var j=0,z=H.length,K=z>>>1;j<K;){var Y=2*(j+1)-1,te=H[Y],Q=Y+1,W=H[Q];if(0>n(te,A))Q<z&&0>n(W,te)?(H[j]=W,H[Q]=A,j=Q):(H[j]=te,H[Y]=A,j=Y);else if(Q<z&&0>n(W,A))H[j]=W,H[Q]=A,j=Q;else break e}}return L}function n(H,L){var A=H.sortIndex-L.sortIndex;return A!==0?A:H.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var _=Date,s=_.now();e.unstable_now=function(){return _.now()-s}}var o=[],f=[],g=1,l=null,m=3,y=!1,b=!1,p=!1,a=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function u(H){for(var L=i(f);L!==null;){if(L.callback===null)r(f);else if(L.startTime<=H)r(f),L.sortIndex=L.expirationTime,t(o,L);else break;L=i(f)}}function v(H){if(p=!1,u(H),!b)if(i(o)!==null)b=!0,U(x);else{var L=i(f);L!==null&&P(v,L.startTime-H)}}function x(H,L){b=!1,p&&(p=!1,h(w),w=-1),y=!0;var A=m;try{for(u(L),l=i(o);l!==null&&(!(l.expirationTime>L)||H&&!I());){var j=l.callback;if(typeof j=="function"){l.callback=null,m=l.priorityLevel;var z=j(l.expirationTime<=L);L=e.unstable_now(),typeof z=="function"?l.callback=z:l===i(o)&&r(o),u(L)}else r(o);l=i(o)}if(l!==null)var K=!0;else{var Y=i(f);Y!==null&&P(v,Y.startTime-L),K=!1}return K}finally{l=null,m=A,y=!1}}var S=!1,k=null,w=-1,E=5,R=-1;function I(){return!(e.unstable_now()-R<E)}function T(){if(k!==null){var H=e.unstable_now();R=H;var L=!0;try{L=k(!0,H)}finally{L?D():(S=!1,k=null)}}else S=!1}var D;if(typeof c=="function")D=function(){c(T)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,$=N.port2;N.port1.onmessage=T,D=function(){$.postMessage(null)}}else D=function(){a(T,0)};function U(H){k=H,S||(S=!0,D())}function P(H,L){w=a(function(){H(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_continueExecution=function(){b||y||(b=!0,U(x))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return i(o)},e.unstable_next=function(H){switch(m){case 1:case 2:case 3:var L=3;break;default:L=m}var A=m;m=L;try{return H()}finally{m=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,L){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var A=m;m=H;try{return L()}finally{m=A}},e.unstable_scheduleCallback=function(H,L,A){var j=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?j+A:j):A=j,H){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=A+z,H={id:g++,callback:L,priorityLevel:H,startTime:A,expirationTime:z,sortIndex:-1},A>j?(H.sortIndex=A,t(f,H),i(o)===null&&H===i(f)&&(p?(h(w),w=-1):p=!0,P(v,A-j))):(H.sortIndex=z,t(o,H),b||y||(b=!0,U(x))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var L=m;return function(){var A=m;m=L;try{return H.apply(this,arguments)}finally{m=A}}}})(_f);pf.exports=_f;var $m=pf.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its 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 Um=B,ni=$m;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;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."}var mf=new Set,pn={};function qr(e,t){ks(e,t),ks(e+"Capture",t)}function ks(e,t){for(pn[e]=t,e=0;e<t.length;e++)mf.add(t[e])}var Yi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wl=Object.prototype.hasOwnProperty,Wm=/^[: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]*$/,Gu={},Ku={};function Vm(e){return wl.call(Ku,e)?!0:wl.call(Gu,e)?!1:Wm.test(e)?Ku[e]=!0:(Gu[e]=!0,!1)}function Gm(e,t,i,r){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Km(e,t,i,r){if(t===null||typeof t>"u"||Gm(e,t,i,r))return!0;if(r)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function zt(e,t,i,r,n,d,_){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=n,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=_}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new zt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new zt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new zt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new zt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){kt[e]=new zt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new zt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new zt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new zt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new zt(e,5,!1,e.toLowerCase(),null,!1,!1)});var kc=/[\-:]([a-z])/g;function Ec(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(kc,Ec);kt[t]=new zt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(kc,Ec);kt[t]=new zt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(kc,Ec);kt[t]=new zt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new zt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new zt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lc(e,t,i,r){var n=kt.hasOwnProperty(t)?kt[t]:null;(n!==null?n.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Km(t,i,n,r)&&(i=null),r||n===null?Vm(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):n.mustUseProperty?e[n.propertyName]=i===null?n.type===3?!1:"":i:(t=n.attributeName,r=n.attributeNamespace,i===null?e.removeAttribute(t):(n=n.type,i=n===3||n===4&&i===!0?"":""+i,r?e.setAttributeNS(r,t,i):e.setAttribute(t,i))))}var er=Um.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Kn=Symbol.for("react.element"),as=Symbol.for("react.portal"),ls=Symbol.for("react.fragment"),Rc=Symbol.for("react.strict_mode"),yl=Symbol.for("react.profiler"),gf=Symbol.for("react.provider"),vf=Symbol.for("react.context"),Tc=Symbol.for("react.forward_ref"),Sl=Symbol.for("react.suspense"),bl=Symbol.for("react.suspense_list"),Dc=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),wf=Symbol.for("react.offscreen"),qu=Symbol.iterator;function Bs(e){return e===null||typeof e!="object"?null:(e=qu&&e[qu]||e["@@iterator"],typeof e=="function"?e:null)}var at=Object.assign,Na;function Xs(e){if(Na===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Na=t&&t[1]||""}return`
34
+ `+Na+e}var Ba=!1;function ja(e,t){if(!e||Ba)return"";Ba=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var r=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){r=f}e.call(t.prototype)}else{try{throw Error()}catch(f){r=f}e()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var n=f.stack.split(`
35
+ `),d=r.stack.split(`
36
+ `),_=n.length-1,s=d.length-1;1<=_&&0<=s&&n[_]!==d[s];)s--;for(;1<=_&&0<=s;_--,s--)if(n[_]!==d[s]){if(_!==1||s!==1)do if(_--,s--,0>s||n[_]!==d[s]){var o=`
37
+ `+n[_].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=_&&0<=s);break}}}finally{Ba=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?Xs(e):""}function qm(e){switch(e.tag){case 5:return Xs(e.type);case 16:return Xs("Lazy");case 13:return Xs("Suspense");case 19:return Xs("SuspenseList");case 0:case 2:case 15:return e=ja(e.type,!1),e;case 11:return e=ja(e.type.render,!1),e;case 1:return e=ja(e.type,!0),e;default:return""}}function Cl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ls:return"Fragment";case as:return"Portal";case yl:return"Profiler";case Rc:return"StrictMode";case Sl:return"Suspense";case bl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case vf:return(e.displayName||"Context")+".Consumer";case gf:return(e._context.displayName||"Context")+".Provider";case Tc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dc:return t=e.displayName||null,t!==null?t:Cl(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return Cl(e(t))}catch{}}return null}function Ym(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Cl(t);case 8:return t===Rc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function wr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xm(e){var t=yf(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var n=i.get,d=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(_){r=""+_,d.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(_){r=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qn(e){e._valueTracker||(e._valueTracker=Xm(e))}function Sf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=yf(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function Oo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function xl(e,t){var i=t.checked;return at({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Yu(e,t){var i=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;i=wr(t.value!=null?t.value:i),e._wrapperState={initialChecked:r,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function bf(e,t){t=t.checked,t!=null&&Lc(e,"checked",t,!1)}function kl(e,t){bf(e,t);var i=wr(t.value),r=t.type;if(i!=null)r==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?El(e,t.type,i):t.hasOwnProperty("defaultValue")&&El(e,t.type,wr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xu(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function El(e,t,i){(t!=="number"||Oo(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Js=Array.isArray;function ws(e,t,i,r){if(e=e.options,t){t={};for(var n=0;n<i.length;n++)t["$"+i[n]]=!0;for(i=0;i<e.length;i++)n=t.hasOwnProperty("$"+e[i].value),e[i].selected!==n&&(e[i].selected=n),n&&r&&(e[i].defaultSelected=!0)}else{for(i=""+wr(i),t=null,n=0;n<e.length;n++){if(e[n].value===i){e[n].selected=!0,r&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Ll(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return at({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ju(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(oe(92));if(Js(i)){if(1<i.length)throw Error(oe(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:wr(i)}}function Cf(e,t){var i=wr(t.value),r=wr(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),r!=null&&(e.defaultValue=""+r)}function Zu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yn,kf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,r,n){MSApp.execUnsafeLocalFunction(function(){return e(t,i,r,n)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Yn=Yn||document.createElement("div"),Yn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _n(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jm=["Webkit","ms","Moz","O"];Object.keys(rn).forEach(function(e){Jm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rn[t]=rn[e]})});function Ef(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||rn.hasOwnProperty(e)&&rn[e]?(""+t).trim():t+"px"}function Lf(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var r=i.indexOf("--")===0,n=Ef(i,t[i],r);i==="float"&&(i="cssFloat"),r?e.setProperty(i,n):e[i]=n}}var Zm=at({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tl(e,t){if(t){if(Zm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Dl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Al=null;function Ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ml=null,ys=null,Ss=null;function Qu(e){if(e=Bn(e)){if(typeof Ml!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=va(t),Ml(e.stateNode,e.type,t))}}function Rf(e){ys?Ss?Ss.push(e):Ss=[e]:ys=e}function Tf(){if(ys){var e=ys,t=Ss;if(Ss=ys=null,Qu(e),t)for(e=0;e<t.length;e++)Qu(t[e])}}function Df(e,t){return e(t)}function Af(){}var Fa=!1;function Mf(e,t,i){if(Fa)return e(t,i);Fa=!0;try{return Df(e,t,i)}finally{Fa=!1,(ys!==null||Ss!==null)&&(Af(),Tf())}}function mn(e,t){var i=e.stateNode;if(i===null)return null;var r=va(i);if(r===null)return null;i=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(oe(231,t,typeof i));return i}var Il=!1;if(Yi)try{var js={};Object.defineProperty(js,"passive",{get:function(){Il=!0}}),window.addEventListener("test",js,js),window.removeEventListener("test",js,js)}catch{Il=!1}function Qm(e,t,i,r,n,d,_,s,o){var f=Array.prototype.slice.call(arguments,3);try{t.apply(i,f)}catch(g){this.onError(g)}}var sn=!1,No=null,Bo=!1,Pl=null,eg={onError:function(e){sn=!0,No=e}};function tg(e,t,i,r,n,d,_,s,o){sn=!1,No=null,Qm.apply(eg,arguments)}function ig(e,t,i,r,n,d,_,s,o){if(tg.apply(this,arguments),sn){if(sn){var f=No;sn=!1,No=null}else throw Error(oe(198));Bo||(Bo=!0,Pl=f)}}function Yr(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function If(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 eh(e){if(Yr(e)!==e)throw Error(oe(188))}function rg(e){var t=e.alternate;if(!t){if(t=Yr(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var i=e,r=t;;){var n=i.return;if(n===null)break;var d=n.alternate;if(d===null){if(r=n.return,r!==null){i=r;continue}break}if(n.child===d.child){for(d=n.child;d;){if(d===i)return eh(n),e;if(d===r)return eh(n),t;d=d.sibling}throw Error(oe(188))}if(i.return!==r.return)i=n,r=d;else{for(var _=!1,s=n.child;s;){if(s===i){_=!0,i=n,r=d;break}if(s===r){_=!0,r=n,i=d;break}s=s.sibling}if(!_){for(s=d.child;s;){if(s===i){_=!0,i=d,r=n;break}if(s===r){_=!0,r=d,i=n;break}s=s.sibling}if(!_)throw Error(oe(189))}}if(i.alternate!==r)throw Error(oe(190))}if(i.tag!==3)throw Error(oe(188));return i.stateNode.current===i?e:t}function Pf(e){return e=rg(e),e!==null?Of(e):null}function Of(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Of(e);if(t!==null)return t;e=e.sibling}return null}var Nf=ni.unstable_scheduleCallback,th=ni.unstable_cancelCallback,sg=ni.unstable_shouldYield,ng=ni.unstable_requestPaint,dt=ni.unstable_now,og=ni.unstable_getCurrentPriorityLevel,Mc=ni.unstable_ImmediatePriority,Bf=ni.unstable_UserBlockingPriority,jo=ni.unstable_NormalPriority,ag=ni.unstable_LowPriority,jf=ni.unstable_IdlePriority,pa=null,ji=null;function lg(e){if(ji&&typeof ji.onCommitFiberRoot=="function")try{ji.onCommitFiberRoot(pa,e,void 0,(e.current.flags&128)===128)}catch{}}var Ei=Math.clz32?Math.clz32:hg,cg=Math.log,ug=Math.LN2;function hg(e){return e>>>=0,e===0?32:31-(cg(e)/ug|0)|0}var Xn=64,Jn=4194304;function Zs(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fo(e,t){var i=e.pendingLanes;if(i===0)return 0;var r=0,n=e.suspendedLanes,d=e.pingedLanes,_=i&268435455;if(_!==0){var s=_&~n;s!==0?r=Zs(s):(d&=_,d!==0&&(r=Zs(d)))}else _=i&~n,_!==0?r=Zs(_):d!==0&&(r=Zs(d));if(r===0)return 0;if(t!==0&&t!==r&&!(t&n)&&(n=r&-r,d=t&-t,n>=d||n===16&&(d&4194240)!==0))return t;if(r&4&&(r|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)i=31-Ei(t),n=1<<i,r|=e[i],t&=~n;return r}function dg(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fg(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,n=e.expirationTimes,d=e.pendingLanes;0<d;){var _=31-Ei(d),s=1<<_,o=n[_];o===-1?(!(s&i)||s&r)&&(n[_]=dg(s,t)):o<=t&&(e.expiredLanes|=s),d&=~s}}function Ol(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ff(){var e=Xn;return Xn<<=1,!(Xn&4194240)&&(Xn=64),e}function Ha(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function On(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ei(t),e[t]=i}function pg(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<i;){var n=31-Ei(i),d=1<<n;t[n]=0,r[n]=-1,e[n]=-1,i&=~d}}function Ic(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-Ei(i),n=1<<r;n&t|e[r]&t&&(e[r]|=t),i&=~n}}var Ke=0;function Hf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zf,Pc,$f,Uf,Wf,Nl=!1,Zn=[],hr=null,dr=null,fr=null,gn=new Map,vn=new Map,ar=[],_g="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 submit".split(" ");function ih(e,t){switch(e){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":fr=null;break;case"pointerover":case"pointerout":gn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vn.delete(t.pointerId)}}function Fs(e,t,i,r,n,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:d,targetContainers:[n]},t!==null&&(t=Bn(t),t!==null&&Pc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function mg(e,t,i,r,n){switch(t){case"focusin":return hr=Fs(hr,e,t,i,r,n),!0;case"dragenter":return dr=Fs(dr,e,t,i,r,n),!0;case"mouseover":return fr=Fs(fr,e,t,i,r,n),!0;case"pointerover":var d=n.pointerId;return gn.set(d,Fs(gn.get(d)||null,e,t,i,r,n)),!0;case"gotpointercapture":return d=n.pointerId,vn.set(d,Fs(vn.get(d)||null,e,t,i,r,n)),!0}return!1}function Vf(e){var t=Ir(e.target);if(t!==null){var i=Yr(t);if(i!==null){if(t=i.tag,t===13){if(t=If(i),t!==null){e.blockedOn=t,Wf(e.priority,function(){$f(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 Co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Bl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Al=r,i.target.dispatchEvent(r),Al=null}else return t=Bn(i),t!==null&&Pc(t),e.blockedOn=i,!1;t.shift()}return!0}function rh(e,t,i){Co(e)&&i.delete(t)}function gg(){Nl=!1,hr!==null&&Co(hr)&&(hr=null),dr!==null&&Co(dr)&&(dr=null),fr!==null&&Co(fr)&&(fr=null),gn.forEach(rh),vn.forEach(rh)}function Hs(e,t){e.blockedOn===t&&(e.blockedOn=null,Nl||(Nl=!0,ni.unstable_scheduleCallback(ni.unstable_NormalPriority,gg)))}function wn(e){function t(n){return Hs(n,e)}if(0<Zn.length){Hs(Zn[0],e);for(var i=1;i<Zn.length;i++){var r=Zn[i];r.blockedOn===e&&(r.blockedOn=null)}}for(hr!==null&&Hs(hr,e),dr!==null&&Hs(dr,e),fr!==null&&Hs(fr,e),gn.forEach(t),vn.forEach(t),i=0;i<ar.length;i++)r=ar[i],r.blockedOn===e&&(r.blockedOn=null);for(;0<ar.length&&(i=ar[0],i.blockedOn===null);)Vf(i),i.blockedOn===null&&ar.shift()}var bs=er.ReactCurrentBatchConfig,Ho=!0;function vg(e,t,i,r){var n=Ke,d=bs.transition;bs.transition=null;try{Ke=1,Oc(e,t,i,r)}finally{Ke=n,bs.transition=d}}function wg(e,t,i,r){var n=Ke,d=bs.transition;bs.transition=null;try{Ke=4,Oc(e,t,i,r)}finally{Ke=n,bs.transition=d}}function Oc(e,t,i,r){if(Ho){var n=Bl(e,t,i,r);if(n===null)Xa(e,t,r,zo,i),ih(e,r);else if(mg(n,e,t,i,r))r.stopPropagation();else if(ih(e,r),t&4&&-1<_g.indexOf(e)){for(;n!==null;){var d=Bn(n);if(d!==null&&zf(d),d=Bl(e,t,i,r),d===null&&Xa(e,t,r,zo,i),d===n)break;n=d}n!==null&&r.stopPropagation()}else Xa(e,t,r,null,i)}}var zo=null;function Bl(e,t,i,r){if(zo=null,e=Ac(r),e=Ir(e),e!==null)if(t=Yr(e),t===null)e=null;else if(i=t.tag,i===13){if(e=If(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 zo=e,null}function Gf(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(og()){case Mc:return 1;case Bf:return 4;case jo:case ag:return 16;case jf:return 536870912;default:return 16}default:return 16}}var cr=null,Nc=null,xo=null;function Kf(){if(xo)return xo;var e,t=Nc,i=t.length,r,n="value"in cr?cr.value:cr.textContent,d=n.length;for(e=0;e<i&&t[e]===n[e];e++);var _=i-e;for(r=1;r<=_&&t[i-r]===n[d-r];r++);return xo=n.slice(e,1<r?1-r:void 0)}function ko(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 Qn(){return!0}function sh(){return!1}function ai(e){function t(i,r,n,d,_){this._reactName=i,this._targetInst=n,this.type=r,this.nativeEvent=d,this.target=_,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(i=e[s],this[s]=i?i(d):d[s]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Qn:sh,this.isPropagationStopped=sh,this}return at(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=Qn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Qn)},persist:function(){},isPersistent:Qn}),t}var Is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bc=ai(Is),Nn=at({},Is,{view:0,detail:0}),yg=ai(Nn),za,$a,zs,_a=at({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jc,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!==zs&&(zs&&e.type==="mousemove"?(za=e.screenX-zs.screenX,$a=e.screenY-zs.screenY):$a=za=0,zs=e),za)},movementY:function(e){return"movementY"in e?e.movementY:$a}}),nh=ai(_a),Sg=at({},_a,{dataTransfer:0}),bg=ai(Sg),Cg=at({},Nn,{relatedTarget:0}),Ua=ai(Cg),xg=at({},Is,{animationName:0,elapsedTime:0,pseudoElement:0}),kg=ai(xg),Eg=at({},Is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lg=ai(Eg),Rg=at({},Is,{data:0}),oh=ai(Rg),Tg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dg={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"},Ag={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ag[e])?!!t[e]:!1}function jc(){return Mg}var Ig=at({},Nn,{key:function(e){if(e.key){var t=Tg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ko(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jc,charCode:function(e){return e.type==="keypress"?ko(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ko(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pg=ai(Ig),Og=at({},_a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ah=ai(Og),Ng=at({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jc}),Bg=ai(Ng),jg=at({},Is,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fg=ai(jg),Hg=at({},_a,{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}),zg=ai(Hg),$g=[9,13,27,32],Fc=Yi&&"CompositionEvent"in window,nn=null;Yi&&"documentMode"in document&&(nn=document.documentMode);var Ug=Yi&&"TextEvent"in window&&!nn,qf=Yi&&(!Fc||nn&&8<nn&&11>=nn),lh=" ",ch=!1;function Yf(e,t){switch(e){case"keyup":return $g.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cs=!1;function Wg(e,t){switch(e){case"compositionend":return Xf(t);case"keypress":return t.which!==32?null:(ch=!0,lh);case"textInput":return e=t.data,e===lh&&ch?null:e;default:return null}}function Vg(e,t){if(cs)return e==="compositionend"||!Fc&&Yf(e,t)?(e=Kf(),xo=Nc=cr=null,cs=!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 qf&&t.locale!=="ko"?null:t.data;default:return null}}var Gg={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 uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gg[e.type]:t==="textarea"}function Jf(e,t,i,r){Rf(r),t=$o(t,"onChange"),0<t.length&&(i=new Bc("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var on=null,yn=null;function Kg(e){lp(e,0)}function ma(e){var t=ds(e);if(Sf(t))return e}function qg(e,t){if(e==="change")return t}var Zf=!1;if(Yi){var Wa;if(Yi){var Va="oninput"in document;if(!Va){var hh=document.createElement("div");hh.setAttribute("oninput","return;"),Va=typeof hh.oninput=="function"}Wa=Va}else Wa=!1;Zf=Wa&&(!document.documentMode||9<document.documentMode)}function dh(){on&&(on.detachEvent("onpropertychange",Qf),yn=on=null)}function Qf(e){if(e.propertyName==="value"&&ma(yn)){var t=[];Jf(t,yn,e,Ac(e)),Mf(Kg,t)}}function Yg(e,t,i){e==="focusin"?(dh(),on=t,yn=i,on.attachEvent("onpropertychange",Qf)):e==="focusout"&&dh()}function Xg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ma(yn)}function Jg(e,t){if(e==="click")return ma(t)}function Zg(e,t){if(e==="input"||e==="change")return ma(t)}function Qg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ri=typeof Object.is=="function"?Object.is:Qg;function Sn(e,t){if(Ri(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var n=i[r];if(!wl.call(t,n)||!Ri(e[n],t[n]))return!1}return!0}function fh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ph(e,t){var i=fh(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=fh(i)}}function ep(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ep(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tp(){for(var e=window,t=Oo();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Oo(e.document)}return t}function Hc(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")}function ev(e){var t=tp(),i=e.focusedElem,r=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&ep(i.ownerDocument.documentElement,i)){if(r!==null&&Hc(i)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=i.textContent.length,d=Math.min(r.start,n);r=r.end===void 0?d:Math.min(r.end,n),!e.extend&&d>r&&(n=r,r=d,d=n),n=ph(i,d);var _=ph(i,r);n&&_&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==_.node||e.focusOffset!==_.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),d>r?(e.addRange(t),e.extend(_.node,_.offset)):(t.setEnd(_.node,_.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tv=Yi&&"documentMode"in document&&11>=document.documentMode,us=null,jl=null,an=null,Fl=!1;function _h(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Fl||us==null||us!==Oo(r)||(r=us,"selectionStart"in r&&Hc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),an&&Sn(an,r)||(an=r,r=$o(jl,"onSelect"),0<r.length&&(t=new Bc("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=us)))}function eo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var hs={animationend:eo("Animation","AnimationEnd"),animationiteration:eo("Animation","AnimationIteration"),animationstart:eo("Animation","AnimationStart"),transitionend:eo("Transition","TransitionEnd")},Ga={},ip={};Yi&&(ip=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function ga(e){if(Ga[e])return Ga[e];if(!hs[e])return e;var t=hs[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in ip)return Ga[e]=t[i];return e}var rp=ga("animationend"),sp=ga("animationiteration"),np=ga("animationstart"),op=ga("transitionend"),ap=new Map,mh="abort auxClick 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(" ");function Sr(e,t){ap.set(e,t),qr(t,[e])}for(var Ka=0;Ka<mh.length;Ka++){var qa=mh[Ka],iv=qa.toLowerCase(),rv=qa[0].toUpperCase()+qa.slice(1);Sr(iv,"on"+rv)}Sr(rp,"onAnimationEnd");Sr(sp,"onAnimationIteration");Sr(np,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(op,"onTransitionEnd");ks("onMouseEnter",["mouseout","mouseover"]);ks("onMouseLeave",["mouseout","mouseover"]);ks("onPointerEnter",["pointerout","pointerover"]);ks("onPointerLeave",["pointerout","pointerover"]);qr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qr("onBeforeInput",["compositionend","keypress","textInput","paste"]);qr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qs="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(" "),sv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qs));function gh(e,t,i){var r=e.type||"unknown-event";e.currentTarget=i,ig(r,t,void 0,e),e.currentTarget=null}function lp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],n=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var _=r.length-1;0<=_;_--){var s=r[_],o=s.instance,f=s.currentTarget;if(s=s.listener,o!==d&&n.isPropagationStopped())break e;gh(n,s,f),d=o}else for(_=0;_<r.length;_++){if(s=r[_],o=s.instance,f=s.currentTarget,s=s.listener,o!==d&&n.isPropagationStopped())break e;gh(n,s,f),d=o}}}if(Bo)throw e=Pl,Bo=!1,Pl=null,e}function et(e,t){var i=t[Wl];i===void 0&&(i=t[Wl]=new Set);var r=e+"__bubble";i.has(r)||(cp(t,e,2,!1),i.add(r))}function Ya(e,t,i){var r=0;t&&(r|=4),cp(i,e,r,t)}var to="_reactListening"+Math.random().toString(36).slice(2);function bn(e){if(!e[to]){e[to]=!0,mf.forEach(function(i){i!=="selectionchange"&&(sv.has(i)||Ya(i,!1,e),Ya(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[to]||(t[to]=!0,Ya("selectionchange",!1,t))}}function cp(e,t,i,r){switch(Gf(t)){case 1:var n=vg;break;case 4:n=wg;break;default:n=Oc}i=n.bind(null,t,i,e),n=void 0,!Il||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),r?n!==void 0?e.addEventListener(t,i,{capture:!0,passive:n}):e.addEventListener(t,i,!0):n!==void 0?e.addEventListener(t,i,{passive:n}):e.addEventListener(t,i,!1)}function Xa(e,t,i,r,n){var d=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var _=r.tag;if(_===3||_===4){var s=r.stateNode.containerInfo;if(s===n||s.nodeType===8&&s.parentNode===n)break;if(_===4)for(_=r.return;_!==null;){var o=_.tag;if((o===3||o===4)&&(o=_.stateNode.containerInfo,o===n||o.nodeType===8&&o.parentNode===n))return;_=_.return}for(;s!==null;){if(_=Ir(s),_===null)return;if(o=_.tag,o===5||o===6){r=d=_;continue e}s=s.parentNode}}r=r.return}Mf(function(){var f=d,g=Ac(i),l=[];e:{var m=ap.get(e);if(m!==void 0){var y=Bc,b=e;switch(e){case"keypress":if(ko(i)===0)break e;case"keydown":case"keyup":y=Pg;break;case"focusin":b="focus",y=Ua;break;case"focusout":b="blur",y=Ua;break;case"beforeblur":case"afterblur":y=Ua;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":y=nh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=bg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Bg;break;case rp:case sp:case np:y=kg;break;case op:y=Fg;break;case"scroll":y=yg;break;case"wheel":y=zg;break;case"copy":case"cut":case"paste":y=Lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=ah}var p=(t&4)!==0,a=!p&&e==="scroll",h=p?m!==null?m+"Capture":null:m;p=[];for(var c=f,u;c!==null;){u=c;var v=u.stateNode;if(u.tag===5&&v!==null&&(u=v,h!==null&&(v=mn(c,h),v!=null&&p.push(Cn(c,v,u)))),a)break;c=c.return}0<p.length&&(m=new y(m,b,null,i,g),l.push({event:m,listeners:p}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",m&&i!==Al&&(b=i.relatedTarget||i.fromElement)&&(Ir(b)||b[Xi]))break e;if((y||m)&&(m=g.window===g?g:(m=g.ownerDocument)?m.defaultView||m.parentWindow:window,y?(b=i.relatedTarget||i.toElement,y=f,b=b?Ir(b):null,b!==null&&(a=Yr(b),b!==a||b.tag!==5&&b.tag!==6)&&(b=null)):(y=null,b=f),y!==b)){if(p=nh,v="onMouseLeave",h="onMouseEnter",c="mouse",(e==="pointerout"||e==="pointerover")&&(p=ah,v="onPointerLeave",h="onPointerEnter",c="pointer"),a=y==null?m:ds(y),u=b==null?m:ds(b),m=new p(v,c+"leave",y,i,g),m.target=a,m.relatedTarget=u,v=null,Ir(g)===f&&(p=new p(h,c+"enter",b,i,g),p.target=u,p.relatedTarget=a,v=p),a=v,y&&b)t:{for(p=y,h=b,c=0,u=p;u;u=is(u))c++;for(u=0,v=h;v;v=is(v))u++;for(;0<c-u;)p=is(p),c--;for(;0<u-c;)h=is(h),u--;for(;c--;){if(p===h||h!==null&&p===h.alternate)break t;p=is(p),h=is(h)}p=null}else p=null;y!==null&&vh(l,m,y,p,!1),b!==null&&a!==null&&vh(l,a,b,p,!0)}}e:{if(m=f?ds(f):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var x=qg;else if(uh(m))if(Zf)x=Zg;else{x=Xg;var S=Yg}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(x=Jg);if(x&&(x=x(e,f))){Jf(l,x,i,g);break e}S&&S(e,m,f),e==="focusout"&&(S=m._wrapperState)&&S.controlled&&m.type==="number"&&El(m,"number",m.value)}switch(S=f?ds(f):window,e){case"focusin":(uh(S)||S.contentEditable==="true")&&(us=S,jl=f,an=null);break;case"focusout":an=jl=us=null;break;case"mousedown":Fl=!0;break;case"contextmenu":case"mouseup":case"dragend":Fl=!1,_h(l,i,g);break;case"selectionchange":if(tv)break;case"keydown":case"keyup":_h(l,i,g)}var k;if(Fc)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else cs?Yf(e,i)&&(w="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(w="onCompositionStart");w&&(qf&&i.locale!=="ko"&&(cs||w!=="onCompositionStart"?w==="onCompositionEnd"&&cs&&(k=Kf()):(cr=g,Nc="value"in cr?cr.value:cr.textContent,cs=!0)),S=$o(f,w),0<S.length&&(w=new oh(w,e,null,i,g),l.push({event:w,listeners:S}),k?w.data=k:(k=Xf(i),k!==null&&(w.data=k)))),(k=Ug?Wg(e,i):Vg(e,i))&&(f=$o(f,"onBeforeInput"),0<f.length&&(g=new oh("onBeforeInput","beforeinput",null,i,g),l.push({event:g,listeners:f}),g.data=k))}lp(l,t)})}function Cn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function $o(e,t){for(var i=t+"Capture",r=[];e!==null;){var n=e,d=n.stateNode;n.tag===5&&d!==null&&(n=d,d=mn(e,i),d!=null&&r.unshift(Cn(e,d,n)),d=mn(e,t),d!=null&&r.push(Cn(e,d,n))),e=e.return}return r}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function vh(e,t,i,r,n){for(var d=t._reactName,_=[];i!==null&&i!==r;){var s=i,o=s.alternate,f=s.stateNode;if(o!==null&&o===r)break;s.tag===5&&f!==null&&(s=f,n?(o=mn(i,d),o!=null&&_.unshift(Cn(i,o,s))):n||(o=mn(i,d),o!=null&&_.push(Cn(i,o,s)))),i=i.return}_.length!==0&&e.push({event:t,listeners:_})}var nv=/\r\n?/g,ov=/\u0000|\uFFFD/g;function wh(e){return(typeof e=="string"?e:""+e).replace(nv,`
38
+ `).replace(ov,"")}function io(e,t,i){if(t=wh(t),wh(e)!==t&&i)throw Error(oe(425))}function Uo(){}var Hl=null,zl=null;function $l(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ul=typeof setTimeout=="function"?setTimeout:void 0,av=typeof clearTimeout=="function"?clearTimeout:void 0,yh=typeof Promise=="function"?Promise:void 0,lv=typeof queueMicrotask=="function"?queueMicrotask:typeof yh<"u"?function(e){return yh.resolve(null).then(e).catch(cv)}:Ul;function cv(e){setTimeout(function(){throw e})}function Ja(e,t){var i=t,r=0;do{var n=i.nextSibling;if(e.removeChild(i),n&&n.nodeType===8)if(i=n.data,i==="/$"){if(r===0){e.removeChild(n),wn(t);return}r--}else i!=="$"&&i!=="$?"&&i!=="$!"||r++;i=n}while(i);wn(t)}function pr(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==="$?")break;if(t==="/$")return null}}return e}function Sh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var Ps=Math.random().toString(36).slice(2),Oi="__reactFiber$"+Ps,xn="__reactProps$"+Ps,Xi="__reactContainer$"+Ps,Wl="__reactEvents$"+Ps,uv="__reactListeners$"+Ps,hv="__reactHandles$"+Ps;function Ir(e){var t=e[Oi];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Xi]||i[Oi]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Sh(e);e!==null;){if(i=e[Oi])return i;e=Sh(e)}return t}e=i,i=e.parentNode}return null}function Bn(e){return e=e[Oi]||e[Xi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ds(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function va(e){return e[xn]||null}var Vl=[],fs=-1;function br(e){return{current:e}}function tt(e){0>fs||(e.current=Vl[fs],Vl[fs]=null,fs--)}function Je(e,t){fs++,Vl[fs]=e.current,e.current=t}var yr={},It=br(yr),Gt=br(!1),jr=yr;function Es(e,t){var i=e.type.contextTypes;if(!i)return yr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var n={},d;for(d in i)n[d]=t[d];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function Kt(e){return e=e.childContextTypes,e!=null}function Wo(){tt(Gt),tt(It)}function bh(e,t,i){if(It.current!==yr)throw Error(oe(168));Je(It,t),Je(Gt,i)}function up(e,t,i){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return i;r=r.getChildContext();for(var n in r)if(!(n in t))throw Error(oe(108,Ym(e)||"Unknown",n));return at({},i,r)}function Vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yr,jr=It.current,Je(It,e),Je(Gt,Gt.current),!0}function Ch(e,t,i){var r=e.stateNode;if(!r)throw Error(oe(169));i?(e=up(e,t,jr),r.__reactInternalMemoizedMergedChildContext=e,tt(Gt),tt(It),Je(It,e)):tt(Gt),Je(Gt,i)}var Vi=null,wa=!1,Za=!1;function hp(e){Vi===null?Vi=[e]:Vi.push(e)}function dv(e){wa=!0,hp(e)}function Cr(){if(!Za&&Vi!==null){Za=!0;var e=0,t=Ke;try{var i=Vi;for(Ke=1;e<i.length;e++){var r=i[e];do r=r(!0);while(r!==null)}Vi=null,wa=!1}catch(n){throw Vi!==null&&(Vi=Vi.slice(e+1)),Nf(Mc,Cr),n}finally{Ke=t,Za=!1}}return null}var ps=[],_s=0,Go=null,Ko=0,ui=[],hi=0,Fr=null,Gi=1,Ki="";function Dr(e,t){ps[_s++]=Ko,ps[_s++]=Go,Go=e,Ko=t}function dp(e,t,i){ui[hi++]=Gi,ui[hi++]=Ki,ui[hi++]=Fr,Fr=e;var r=Gi;e=Ki;var n=32-Ei(r)-1;r&=~(1<<n),i+=1;var d=32-Ei(t)+n;if(30<d){var _=n-n%5;d=(r&(1<<_)-1).toString(32),r>>=_,n-=_,Gi=1<<32-Ei(t)+n|i<<n|r,Ki=d+e}else Gi=1<<d|i<<n|r,Ki=e}function zc(e){e.return!==null&&(Dr(e,1),dp(e,1,0))}function $c(e){for(;e===Go;)Go=ps[--_s],ps[_s]=null,Ko=ps[--_s],ps[_s]=null;for(;e===Fr;)Fr=ui[--hi],ui[hi]=null,Ki=ui[--hi],ui[hi]=null,Gi=ui[--hi],ui[hi]=null}var si=null,ri=null,rt=!1,ki=null;function fp(e,t){var i=di(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function xh(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,si=e,ri=pr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,si=e,ri=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=Fr!==null?{id:Gi,overflow:Ki}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=di(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,si=e,ri=null,!0):!1;default:return!1}}function Gl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Kl(e){if(rt){var t=ri;if(t){var i=t;if(!xh(e,t)){if(Gl(e))throw Error(oe(418));t=pr(i.nextSibling);var r=si;t&&xh(e,t)?fp(r,i):(e.flags=e.flags&-4097|2,rt=!1,si=e)}}else{if(Gl(e))throw Error(oe(418));e.flags=e.flags&-4097|2,rt=!1,si=e}}}function kh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;si=e}function ro(e){if(e!==si)return!1;if(!rt)return kh(e),rt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$l(e.type,e.memoizedProps)),t&&(t=ri)){if(Gl(e))throw pp(),Error(oe(418));for(;t;)fp(e,t),t=pr(t.nextSibling)}if(kh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){ri=pr(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}ri=null}}else ri=si?pr(e.stateNode.nextSibling):null;return!0}function pp(){for(var e=ri;e;)e=pr(e.nextSibling)}function Ls(){ri=si=null,rt=!1}function Uc(e){ki===null?ki=[e]:ki.push(e)}var fv=er.ReactCurrentBatchConfig;function $s(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(oe(309));var r=i.stateNode}if(!r)throw Error(oe(147,e));var n=r,d=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(_){var s=n.refs;_===null?delete s[d]:s[d]=_},t._stringRef=d,t)}if(typeof e!="string")throw Error(oe(284));if(!i._owner)throw Error(oe(290,e))}return e}function so(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Eh(e){var t=e._init;return t(e._payload)}function _p(e){function t(h,c){if(e){var u=h.deletions;u===null?(h.deletions=[c],h.flags|=16):u.push(c)}}function i(h,c){if(!e)return null;for(;c!==null;)t(h,c),c=c.sibling;return null}function r(h,c){for(h=new Map;c!==null;)c.key!==null?h.set(c.key,c):h.set(c.index,c),c=c.sibling;return h}function n(h,c){return h=vr(h,c),h.index=0,h.sibling=null,h}function d(h,c,u){return h.index=u,e?(u=h.alternate,u!==null?(u=u.index,u<c?(h.flags|=2,c):u):(h.flags|=2,c)):(h.flags|=1048576,c)}function _(h){return e&&h.alternate===null&&(h.flags|=2),h}function s(h,c,u,v){return c===null||c.tag!==6?(c=nl(u,h.mode,v),c.return=h,c):(c=n(c,u),c.return=h,c)}function o(h,c,u,v){var x=u.type;return x===ls?g(h,c,u.props.children,v,u.key):c!==null&&(c.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===nr&&Eh(x)===c.type)?(v=n(c,u.props),v.ref=$s(h,c,u),v.return=h,v):(v=Mo(u.type,u.key,u.props,null,h.mode,v),v.ref=$s(h,c,u),v.return=h,v)}function f(h,c,u,v){return c===null||c.tag!==4||c.stateNode.containerInfo!==u.containerInfo||c.stateNode.implementation!==u.implementation?(c=ol(u,h.mode,v),c.return=h,c):(c=n(c,u.children||[]),c.return=h,c)}function g(h,c,u,v,x){return c===null||c.tag!==7?(c=Br(u,h.mode,v,x),c.return=h,c):(c=n(c,u),c.return=h,c)}function l(h,c,u){if(typeof c=="string"&&c!==""||typeof c=="number")return c=nl(""+c,h.mode,u),c.return=h,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Kn:return u=Mo(c.type,c.key,c.props,null,h.mode,u),u.ref=$s(h,null,c),u.return=h,u;case as:return c=ol(c,h.mode,u),c.return=h,c;case nr:var v=c._init;return l(h,v(c._payload),u)}if(Js(c)||Bs(c))return c=Br(c,h.mode,u,null),c.return=h,c;so(h,c)}return null}function m(h,c,u,v){var x=c!==null?c.key:null;if(typeof u=="string"&&u!==""||typeof u=="number")return x!==null?null:s(h,c,""+u,v);if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Kn:return u.key===x?o(h,c,u,v):null;case as:return u.key===x?f(h,c,u,v):null;case nr:return x=u._init,m(h,c,x(u._payload),v)}if(Js(u)||Bs(u))return x!==null?null:g(h,c,u,v,null);so(h,u)}return null}function y(h,c,u,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return h=h.get(u)||null,s(c,h,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Kn:return h=h.get(v.key===null?u:v.key)||null,o(c,h,v,x);case as:return h=h.get(v.key===null?u:v.key)||null,f(c,h,v,x);case nr:var S=v._init;return y(h,c,u,S(v._payload),x)}if(Js(v)||Bs(v))return h=h.get(u)||null,g(c,h,v,x,null);so(c,v)}return null}function b(h,c,u,v){for(var x=null,S=null,k=c,w=c=0,E=null;k!==null&&w<u.length;w++){k.index>w?(E=k,k=null):E=k.sibling;var R=m(h,k,u[w],v);if(R===null){k===null&&(k=E);break}e&&k&&R.alternate===null&&t(h,k),c=d(R,c,w),S===null?x=R:S.sibling=R,S=R,k=E}if(w===u.length)return i(h,k),rt&&Dr(h,w),x;if(k===null){for(;w<u.length;w++)k=l(h,u[w],v),k!==null&&(c=d(k,c,w),S===null?x=k:S.sibling=k,S=k);return rt&&Dr(h,w),x}for(k=r(h,k);w<u.length;w++)E=y(k,h,w,u[w],v),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?w:E.key),c=d(E,c,w),S===null?x=E:S.sibling=E,S=E);return e&&k.forEach(function(I){return t(h,I)}),rt&&Dr(h,w),x}function p(h,c,u,v){var x=Bs(u);if(typeof x!="function")throw Error(oe(150));if(u=x.call(u),u==null)throw Error(oe(151));for(var S=x=null,k=c,w=c=0,E=null,R=u.next();k!==null&&!R.done;w++,R=u.next()){k.index>w?(E=k,k=null):E=k.sibling;var I=m(h,k,R.value,v);if(I===null){k===null&&(k=E);break}e&&k&&I.alternate===null&&t(h,k),c=d(I,c,w),S===null?x=I:S.sibling=I,S=I,k=E}if(R.done)return i(h,k),rt&&Dr(h,w),x;if(k===null){for(;!R.done;w++,R=u.next())R=l(h,R.value,v),R!==null&&(c=d(R,c,w),S===null?x=R:S.sibling=R,S=R);return rt&&Dr(h,w),x}for(k=r(h,k);!R.done;w++,R=u.next())R=y(k,h,w,R.value,v),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?w:R.key),c=d(R,c,w),S===null?x=R:S.sibling=R,S=R);return e&&k.forEach(function(T){return t(h,T)}),rt&&Dr(h,w),x}function a(h,c,u,v){if(typeof u=="object"&&u!==null&&u.type===ls&&u.key===null&&(u=u.props.children),typeof u=="object"&&u!==null){switch(u.$$typeof){case Kn:e:{for(var x=u.key,S=c;S!==null;){if(S.key===x){if(x=u.type,x===ls){if(S.tag===7){i(h,S.sibling),c=n(S,u.props.children),c.return=h,h=c;break e}}else if(S.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===nr&&Eh(x)===S.type){i(h,S.sibling),c=n(S,u.props),c.ref=$s(h,S,u),c.return=h,h=c;break e}i(h,S);break}else t(h,S);S=S.sibling}u.type===ls?(c=Br(u.props.children,h.mode,v,u.key),c.return=h,h=c):(v=Mo(u.type,u.key,u.props,null,h.mode,v),v.ref=$s(h,c,u),v.return=h,h=v)}return _(h);case as:e:{for(S=u.key;c!==null;){if(c.key===S)if(c.tag===4&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){i(h,c.sibling),c=n(c,u.children||[]),c.return=h,h=c;break e}else{i(h,c);break}else t(h,c);c=c.sibling}c=ol(u,h.mode,v),c.return=h,h=c}return _(h);case nr:return S=u._init,a(h,c,S(u._payload),v)}if(Js(u))return b(h,c,u,v);if(Bs(u))return p(h,c,u,v);so(h,u)}return typeof u=="string"&&u!==""||typeof u=="number"?(u=""+u,c!==null&&c.tag===6?(i(h,c.sibling),c=n(c,u),c.return=h,h=c):(i(h,c),c=nl(u,h.mode,v),c.return=h,h=c),_(h)):i(h,c)}return a}var Rs=_p(!0),mp=_p(!1),qo=br(null),Yo=null,ms=null,Wc=null;function Vc(){Wc=ms=Yo=null}function Gc(e){var t=qo.current;tt(qo),e._currentValue=t}function ql(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function Cs(e,t){Yo=e,Wc=ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Vt=!0),e.firstContext=null)}function pi(e){var t=e._currentValue;if(Wc!==e)if(e={context:e,memoizedValue:t,next:null},ms===null){if(Yo===null)throw Error(oe(308));ms=e,Yo.dependencies={lanes:0,firstContext:e}}else ms=ms.next=e;return t}var Pr=null;function Kc(e){Pr===null?Pr=[e]:Pr.push(e)}function gp(e,t,i,r){var n=t.interleaved;return n===null?(i.next=i,Kc(t)):(i.next=n.next,n.next=i),t.interleaved=i,Ji(e,r)}function Ji(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var or=!1;function qc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _r(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$e&2){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,Ji(e,i)}return n=r.interleaved,n===null?(t.next=t,Kc(r)):(t.next=n.next,n.next=t),r.interleaved=t,Ji(e,i)}function Eo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Ic(e,i)}}function Lh(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var n=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var _={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};d===null?n=d=_:d=d.next=_,i=i.next}while(i!==null);d===null?n=d=t:d=d.next=t}else n=d=t;i={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:d,shared:r.shared,effects:r.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function Xo(e,t,i,r){var n=e.updateQueue;or=!1;var d=n.firstBaseUpdate,_=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var o=s,f=o.next;o.next=null,_===null?d=f:_.next=f,_=o;var g=e.alternate;g!==null&&(g=g.updateQueue,s=g.lastBaseUpdate,s!==_&&(s===null?g.firstBaseUpdate=f:s.next=f,g.lastBaseUpdate=o))}if(d!==null){var l=n.baseState;_=0,g=f=o=null,s=d;do{var m=s.lane,y=s.eventTime;if((r&m)===m){g!==null&&(g=g.next={eventTime:y,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var b=e,p=s;switch(m=t,y=i,p.tag){case 1:if(b=p.payload,typeof b=="function"){l=b.call(y,l,m);break e}l=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=p.payload,m=typeof b=="function"?b.call(y,l,m):b,m==null)break e;l=at({},l,m);break e;case 2:or=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,m=n.effects,m===null?n.effects=[s]:m.push(s))}else y={eventTime:y,lane:m,tag:s.tag,payload:s.payload,callback:s.callback,next:null},g===null?(f=g=y,o=l):g=g.next=y,_|=m;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;m=s,s=m.next,m.next=null,n.lastBaseUpdate=m,n.shared.pending=null}}while(!0);if(g===null&&(o=l),n.baseState=o,n.firstBaseUpdate=f,n.lastBaseUpdate=g,t=n.shared.interleaved,t!==null){n=t;do _|=n.lane,n=n.next;while(n!==t)}else d===null&&(n.shared.lanes=0);zr|=_,e.lanes=_,e.memoizedState=l}}function Rh(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],n=r.callback;if(n!==null){if(r.callback=null,r=i,typeof n!="function")throw Error(oe(191,n));n.call(r)}}}var jn={},Fi=br(jn),kn=br(jn),En=br(jn);function Or(e){if(e===jn)throw Error(oe(174));return e}function Yc(e,t){switch(Je(En,t),Je(kn,e),Je(Fi,jn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rl(t,e)}tt(Fi),Je(Fi,t)}function Ts(){tt(Fi),tt(kn),tt(En)}function wp(e){Or(En.current);var t=Or(Fi.current),i=Rl(t,e.type);t!==i&&(Je(kn,e),Je(Fi,i))}function Xc(e){kn.current===e&&(tt(Fi),tt(kn))}var nt=br(0);function Jo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Qa=[];function Jc(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var Lo=er.ReactCurrentDispatcher,el=er.ReactCurrentBatchConfig,Hr=0,ot=null,mt=null,vt=null,Zo=!1,ln=!1,Ln=0,pv=0;function Tt(){throw Error(oe(321))}function Zc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Ri(e[i],t[i]))return!1;return!0}function Qc(e,t,i,r,n,d){if(Hr=d,ot=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Lo.current=e===null||e.memoizedState===null?vv:wv,e=i(r,n),ln){d=0;do{if(ln=!1,Ln=0,25<=d)throw Error(oe(301));d+=1,vt=mt=null,t.updateQueue=null,Lo.current=yv,e=i(r,n)}while(ln)}if(Lo.current=Qo,t=mt!==null&&mt.next!==null,Hr=0,vt=mt=ot=null,Zo=!1,t)throw Error(oe(300));return e}function eu(){var e=Ln!==0;return Ln=0,e}function Pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?ot.memoizedState=vt=e:vt=vt.next=e,vt}function _i(){if(mt===null){var e=ot.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=vt===null?ot.memoizedState:vt.next;if(t!==null)vt=t,mt=e;else{if(e===null)throw Error(oe(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},vt===null?ot.memoizedState=vt=e:vt=vt.next=e}return vt}function Rn(e,t){return typeof t=="function"?t(e):t}function tl(e){var t=_i(),i=t.queue;if(i===null)throw Error(oe(311));i.lastRenderedReducer=e;var r=mt,n=r.baseQueue,d=i.pending;if(d!==null){if(n!==null){var _=n.next;n.next=d.next,d.next=_}r.baseQueue=n=d,i.pending=null}if(n!==null){d=n.next,r=r.baseState;var s=_=null,o=null,f=d;do{var g=f.lane;if((Hr&g)===g)o!==null&&(o=o.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:e(r,f.action);else{var l={lane:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};o===null?(s=o=l,_=r):o=o.next=l,ot.lanes|=g,zr|=g}f=f.next}while(f!==null&&f!==d);o===null?_=r:o.next=s,Ri(r,t.memoizedState)||(Vt=!0),t.memoizedState=r,t.baseState=_,t.baseQueue=o,i.lastRenderedState=r}if(e=i.interleaved,e!==null){n=e;do d=n.lane,ot.lanes|=d,zr|=d,n=n.next;while(n!==e)}else n===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function il(e){var t=_i(),i=t.queue;if(i===null)throw Error(oe(311));i.lastRenderedReducer=e;var r=i.dispatch,n=i.pending,d=t.memoizedState;if(n!==null){i.pending=null;var _=n=n.next;do d=e(d,_.action),_=_.next;while(_!==n);Ri(d,t.memoizedState)||(Vt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,r]}function yp(){}function Sp(e,t){var i=ot,r=_i(),n=t(),d=!Ri(r.memoizedState,n);if(d&&(r.memoizedState=n,Vt=!0),r=r.queue,tu(xp.bind(null,i,r,e),[e]),r.getSnapshot!==t||d||vt!==null&&vt.memoizedState.tag&1){if(i.flags|=2048,Tn(9,Cp.bind(null,i,r,n,t),void 0,null),wt===null)throw Error(oe(349));Hr&30||bp(i,t,n)}return n}function bp(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=ot.updateQueue,t===null?(t={lastEffect:null,stores:null},ot.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Cp(e,t,i,r){t.value=i,t.getSnapshot=r,kp(t)&&Ep(e)}function xp(e,t,i){return i(function(){kp(t)&&Ep(e)})}function kp(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Ri(e,i)}catch{return!0}}function Ep(e){var t=Ji(e,1);t!==null&&Li(t,e,1,-1)}function Th(e){var t=Pi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:e},t.queue=e,e=e.dispatch=gv.bind(null,ot,e),[t.memoizedState,e]}function Tn(e,t,i,r){return e={tag:e,create:t,destroy:i,deps:r,next:null},t=ot.updateQueue,t===null?(t={lastEffect:null,stores:null},ot.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e)),e}function Lp(){return _i().memoizedState}function Ro(e,t,i,r){var n=Pi();ot.flags|=e,n.memoizedState=Tn(1|t,i,void 0,r===void 0?null:r)}function ya(e,t,i,r){var n=_i();r=r===void 0?null:r;var d=void 0;if(mt!==null){var _=mt.memoizedState;if(d=_.destroy,r!==null&&Zc(r,_.deps)){n.memoizedState=Tn(t,i,d,r);return}}ot.flags|=e,n.memoizedState=Tn(1|t,i,d,r)}function Dh(e,t){return Ro(8390656,8,e,t)}function tu(e,t){return ya(2048,8,e,t)}function Rp(e,t){return ya(4,2,e,t)}function Tp(e,t){return ya(4,4,e,t)}function Dp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ap(e,t,i){return i=i!=null?i.concat([e]):null,ya(4,4,Dp.bind(null,t,e),i)}function iu(){}function Mp(e,t){var i=_i();t=t===void 0?null:t;var r=i.memoizedState;return r!==null&&t!==null&&Zc(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Ip(e,t){var i=_i();t=t===void 0?null:t;var r=i.memoizedState;return r!==null&&t!==null&&Zc(t,r[1])?r[0]:(e=e(),i.memoizedState=[e,t],e)}function Pp(e,t,i){return Hr&21?(Ri(i,t)||(i=Ff(),ot.lanes|=i,zr|=i,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Vt=!0),e.memoizedState=i)}function _v(e,t){var i=Ke;Ke=i!==0&&4>i?i:4,e(!0);var r=el.transition;el.transition={};try{e(!1),t()}finally{Ke=i,el.transition=r}}function Op(){return _i().memoizedState}function mv(e,t,i){var r=gr(e);if(i={lane:r,action:i,hasEagerState:!1,eagerState:null,next:null},Np(e))Bp(t,i);else if(i=gp(e,t,i,r),i!==null){var n=Bt();Li(i,e,r,n),jp(i,t,r)}}function gv(e,t,i){var r=gr(e),n={lane:r,action:i,hasEagerState:!1,eagerState:null,next:null};if(Np(e))Bp(t,n);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var _=t.lastRenderedState,s=d(_,i);if(n.hasEagerState=!0,n.eagerState=s,Ri(s,_)){var o=t.interleaved;o===null?(n.next=n,Kc(t)):(n.next=o.next,o.next=n),t.interleaved=n;return}}catch{}finally{}i=gp(e,t,n,r),i!==null&&(n=Bt(),Li(i,e,r,n),jp(i,t,r))}}function Np(e){var t=e.alternate;return e===ot||t!==null&&t===ot}function Bp(e,t){ln=Zo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function jp(e,t,i){if(i&4194240){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Ic(e,i)}}var Qo={readContext:pi,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},vv={readContext:pi,useCallback:function(e,t){return Pi().memoizedState=[e,t===void 0?null:t],e},useContext:pi,useEffect:Dh,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Ro(4194308,4,Dp.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ro(4,2,e,t)},useMemo:function(e,t){var i=Pi();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var r=Pi();return t=i!==void 0?i(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mv.bind(null,ot,e),[r.memoizedState,e]},useRef:function(e){var t=Pi();return e={current:e},t.memoizedState=e},useState:Th,useDebugValue:iu,useDeferredValue:function(e){return Pi().memoizedState=e},useTransition:function(){var e=Th(!1),t=e[0];return e=_v.bind(null,e[1]),Pi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var r=ot,n=Pi();if(rt){if(i===void 0)throw Error(oe(407));i=i()}else{if(i=t(),wt===null)throw Error(oe(349));Hr&30||bp(r,t,i)}n.memoizedState=i;var d={value:i,getSnapshot:t};return n.queue=d,Dh(xp.bind(null,r,d,e),[e]),r.flags|=2048,Tn(9,Cp.bind(null,r,d,i,t),void 0,null),i},useId:function(){var e=Pi(),t=wt.identifierPrefix;if(rt){var i=Ki,r=Gi;i=(r&~(1<<32-Ei(r)-1)).toString(32)+i,t=":"+t+"R"+i,i=Ln++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=pv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wv={readContext:pi,useCallback:Mp,useContext:pi,useEffect:tu,useImperativeHandle:Ap,useInsertionEffect:Rp,useLayoutEffect:Tp,useMemo:Ip,useReducer:tl,useRef:Lp,useState:function(){return tl(Rn)},useDebugValue:iu,useDeferredValue:function(e){var t=_i();return Pp(t,mt.memoizedState,e)},useTransition:function(){var e=tl(Rn)[0],t=_i().memoizedState;return[e,t]},useMutableSource:yp,useSyncExternalStore:Sp,useId:Op,unstable_isNewReconciler:!1},yv={readContext:pi,useCallback:Mp,useContext:pi,useEffect:tu,useImperativeHandle:Ap,useInsertionEffect:Rp,useLayoutEffect:Tp,useMemo:Ip,useReducer:il,useRef:Lp,useState:function(){return il(Rn)},useDebugValue:iu,useDeferredValue:function(e){var t=_i();return mt===null?t.memoizedState=e:Pp(t,mt.memoizedState,e)},useTransition:function(){var e=il(Rn)[0],t=_i().memoizedState;return[e,t]},useMutableSource:yp,useSyncExternalStore:Sp,useId:Op,unstable_isNewReconciler:!1};function Ci(e,t){if(e&&e.defaultProps){t=at({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function Yl(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:at({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Sa={isMounted:function(e){return(e=e._reactInternals)?Yr(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var r=Bt(),n=gr(e),d=qi(r,n);d.payload=t,i!=null&&(d.callback=i),t=_r(e,d,n),t!==null&&(Li(t,e,n,r),Eo(t,e,n))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=Bt(),n=gr(e),d=qi(r,n);d.tag=1,d.payload=t,i!=null&&(d.callback=i),t=_r(e,d,n),t!==null&&(Li(t,e,n,r),Eo(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Bt(),r=gr(e),n=qi(i,r);n.tag=2,t!=null&&(n.callback=t),t=_r(e,n,r),t!==null&&(Li(t,e,r,i),Eo(t,e,r))}};function Ah(e,t,i,r,n,d,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,_):t.prototype&&t.prototype.isPureReactComponent?!Sn(i,r)||!Sn(n,d):!0}function Fp(e,t,i){var r=!1,n=yr,d=t.contextType;return typeof d=="object"&&d!==null?d=pi(d):(n=Kt(t)?jr:It.current,r=t.contextTypes,d=(r=r!=null)?Es(e,n):yr),t=new t(i,d),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Sa,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),t}function Mh(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&Sa.enqueueReplaceState(t,t.state,null)}function Xl(e,t,i,r){var n=e.stateNode;n.props=i,n.state=e.memoizedState,n.refs={},qc(e);var d=t.contextType;typeof d=="object"&&d!==null?n.context=pi(d):(d=Kt(t)?jr:It.current,n.context=Es(e,d)),n.state=e.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(Yl(e,t,d,i),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&Sa.enqueueReplaceState(n,n.state,null),Xo(e,i,n,r),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Ds(e,t){try{var i="",r=t;do i+=qm(r),r=r.return;while(r);var n=i}catch(d){n=`
39
+ Error generating stack: `+d.message+`
40
+ `+d.stack}return{value:e,source:t,stack:n,digest:null}}function rl(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function Jl(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Sv=typeof WeakMap=="function"?WeakMap:Map;function Hp(e,t,i){i=qi(-1,i),i.tag=3,i.payload={element:null};var r=t.value;return i.callback=function(){ta||(ta=!0,ac=r),Jl(e,t)},i}function zp(e,t,i){i=qi(-1,i),i.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var n=t.value;i.payload=function(){return r(n)},i.callback=function(){Jl(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(i.callback=function(){Jl(e,t),typeof r!="function"&&(mr===null?mr=new Set([this]):mr.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),i}function Ih(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new Sv;var n=new Set;r.set(t,n)}else n=r.get(t),n===void 0&&(n=new Set,r.set(t,n));n.has(i)||(n.add(i),e=Ov.bind(null,e,t,i),t.then(e,e))}function Ph(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Oh(e,t,i,r,n){return e.mode&1?(e.flags|=65536,e.lanes=n,e):(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=qi(-1,1),t.tag=2,_r(i,t,1))),i.lanes|=1),e)}var bv=er.ReactCurrentOwner,Vt=!1;function Nt(e,t,i,r){t.child=e===null?mp(t,null,i,r):Rs(t,e.child,i,r)}function Nh(e,t,i,r,n){i=i.render;var d=t.ref;return Cs(t,n),r=Qc(e,t,i,r,d,n),i=eu(),e!==null&&!Vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Zi(e,t,n)):(rt&&i&&zc(t),t.flags|=1,Nt(e,t,r,n),t.child)}function Bh(e,t,i,r,n){if(e===null){var d=i.type;return typeof d=="function"&&!uu(d)&&d.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=d,$p(e,t,d,r,n)):(e=Mo(i.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!(e.lanes&n)){var _=d.memoizedProps;if(i=i.compare,i=i!==null?i:Sn,i(_,r)&&e.ref===t.ref)return Zi(e,t,n)}return t.flags|=1,e=vr(d,r),e.ref=t.ref,e.return=t,t.child=e}function $p(e,t,i,r,n){if(e!==null){var d=e.memoizedProps;if(Sn(d,r)&&e.ref===t.ref)if(Vt=!1,t.pendingProps=r=d,(e.lanes&n)!==0)e.flags&131072&&(Vt=!0);else return t.lanes=e.lanes,Zi(e,t,n)}return Zl(e,t,i,r,n)}function Up(e,t,i){var r=t.pendingProps,n=r.children,d=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(vs,ti),ti|=i;else{if(!(i&1073741824))return e=d!==null?d.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Je(vs,ti),ti|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=d!==null?d.baseLanes:i,Je(vs,ti),ti|=r}else d!==null?(r=d.baseLanes|i,t.memoizedState=null):r=i,Je(vs,ti),ti|=r;return Nt(e,t,n,i),t.child}function Wp(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Zl(e,t,i,r,n){var d=Kt(i)?jr:It.current;return d=Es(t,d),Cs(t,n),i=Qc(e,t,i,r,d,n),r=eu(),e!==null&&!Vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Zi(e,t,n)):(rt&&r&&zc(t),t.flags|=1,Nt(e,t,i,n),t.child)}function jh(e,t,i,r,n){if(Kt(i)){var d=!0;Vo(t)}else d=!1;if(Cs(t,n),t.stateNode===null)To(e,t),Fp(t,i,r),Xl(t,i,r,n),r=!0;else if(e===null){var _=t.stateNode,s=t.memoizedProps;_.props=s;var o=_.context,f=i.contextType;typeof f=="object"&&f!==null?f=pi(f):(f=Kt(i)?jr:It.current,f=Es(t,f));var g=i.getDerivedStateFromProps,l=typeof g=="function"||typeof _.getSnapshotBeforeUpdate=="function";l||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(s!==r||o!==f)&&Mh(t,_,r,f),or=!1;var m=t.memoizedState;_.state=m,Xo(t,r,_,n),o=t.memoizedState,s!==r||m!==o||Gt.current||or?(typeof g=="function"&&(Yl(t,i,g,r),o=t.memoizedState),(s=or||Ah(t,i,s,r,m,o,f))?(l||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=o),_.props=r,_.state=o,_.context=f,r=s):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{_=t.stateNode,vp(e,t),s=t.memoizedProps,f=t.type===t.elementType?s:Ci(t.type,s),_.props=f,l=t.pendingProps,m=_.context,o=i.contextType,typeof o=="object"&&o!==null?o=pi(o):(o=Kt(i)?jr:It.current,o=Es(t,o));var y=i.getDerivedStateFromProps;(g=typeof y=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(s!==l||m!==o)&&Mh(t,_,r,o),or=!1,m=t.memoizedState,_.state=m,Xo(t,r,_,n);var b=t.memoizedState;s!==l||m!==b||Gt.current||or?(typeof y=="function"&&(Yl(t,i,y,r),b=t.memoizedState),(f=or||Ah(t,i,f,r,m,b,o)||!1)?(g||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(r,b,o),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(r,b,o)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),_.props=r,_.state=b,_.context=o,r=f):(typeof _.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Ql(e,t,i,r,d,n)}function Ql(e,t,i,r,n,d){Wp(e,t);var _=(t.flags&128)!==0;if(!r&&!_)return n&&Ch(t,i,!1),Zi(e,t,d);r=t.stateNode,bv.current=t;var s=_&&typeof i.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&_?(t.child=Rs(t,e.child,null,d),t.child=Rs(t,null,s,d)):Nt(e,t,s,d),t.memoizedState=r.state,n&&Ch(t,i,!0),t.child}function Vp(e){var t=e.stateNode;t.pendingContext?bh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bh(e,t.context,!1),Yc(e,t.containerInfo)}function Fh(e,t,i,r,n){return Ls(),Uc(n),t.flags|=256,Nt(e,t,i,r),t.child}var ec={dehydrated:null,treeContext:null,retryLane:0};function tc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gp(e,t,i){var r=t.pendingProps,n=nt.current,d=!1,_=(t.flags&128)!==0,s;if((s=_)||(s=e!==null&&e.memoizedState===null?!1:(n&2)!==0),s?(d=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),Je(nt,n&1),e===null)return Kl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(_=r.children,e=r.fallback,d?(r=t.mode,d=t.child,_={mode:"hidden",children:_},!(r&1)&&d!==null?(d.childLanes=0,d.pendingProps=_):d=xa(_,r,0,null),e=Br(e,r,i,null),d.return=t,e.return=t,d.sibling=e,t.child=d,t.child.memoizedState=tc(i),t.memoizedState=ec,e):ru(t,_));if(n=e.memoizedState,n!==null&&(s=n.dehydrated,s!==null))return Cv(e,t,_,r,s,n,i);if(d){d=r.fallback,_=t.mode,n=e.child,s=n.sibling;var o={mode:"hidden",children:r.children};return!(_&1)&&t.child!==n?(r=t.child,r.childLanes=0,r.pendingProps=o,t.deletions=null):(r=vr(n,o),r.subtreeFlags=n.subtreeFlags&14680064),s!==null?d=vr(s,d):(d=Br(d,_,i,null),d.flags|=2),d.return=t,r.return=t,r.sibling=d,t.child=r,r=d,d=t.child,_=e.child.memoizedState,_=_===null?tc(i):{baseLanes:_.baseLanes|i,cachePool:null,transitions:_.transitions},d.memoizedState=_,d.childLanes=e.childLanes&~i,t.memoizedState=ec,r}return d=e.child,e=d.sibling,r=vr(d,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=i),r.return=t,r.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=r,t.memoizedState=null,r}function ru(e,t){return t=xa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function no(e,t,i,r){return r!==null&&Uc(r),Rs(t,e.child,null,i),e=ru(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cv(e,t,i,r,n,d,_){if(i)return t.flags&256?(t.flags&=-257,r=rl(Error(oe(422))),no(e,t,_,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(d=r.fallback,n=t.mode,r=xa({mode:"visible",children:r.children},n,0,null),d=Br(d,n,_,null),d.flags|=2,r.return=t,d.return=t,r.sibling=d,t.child=r,t.mode&1&&Rs(t,e.child,null,_),t.child.memoizedState=tc(_),t.memoizedState=ec,d);if(!(t.mode&1))return no(e,t,_,null);if(n.data==="$!"){if(r=n.nextSibling&&n.nextSibling.dataset,r)var s=r.dgst;return r=s,d=Error(oe(419)),r=rl(d,r,void 0),no(e,t,_,r)}if(s=(_&e.childLanes)!==0,Vt||s){if(r=wt,r!==null){switch(_&-_){case 4:n=2;break;case 16:n=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(r.suspendedLanes|_)?0:n,n!==0&&n!==d.retryLane&&(d.retryLane=n,Ji(e,n),Li(r,e,n,-1))}return cu(),r=rl(Error(oe(421))),no(e,t,_,r)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=Nv.bind(null,e),n._reactRetry=t,null):(e=d.treeContext,ri=pr(n.nextSibling),si=t,rt=!0,ki=null,e!==null&&(ui[hi++]=Gi,ui[hi++]=Ki,ui[hi++]=Fr,Gi=e.id,Ki=e.overflow,Fr=t),t=ru(t,r.children),t.flags|=4096,t)}function Hh(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ql(e.return,t,i)}function sl(e,t,i,r,n){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:n}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=r,d.tail=i,d.tailMode=n)}function Kp(e,t,i){var r=t.pendingProps,n=r.revealOrder,d=r.tail;if(Nt(e,t,r.children,i),r=nt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hh(e,i,t);else if(e.tag===19)Hh(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}r&=1}if(Je(nt,r),!(t.mode&1))t.memoizedState=null;else switch(n){case"forwards":for(i=t.child,n=null;i!==null;)e=i.alternate,e!==null&&Jo(e)===null&&(n=i),i=i.sibling;i=n,i===null?(n=t.child,t.child=null):(n=i.sibling,i.sibling=null),sl(t,!1,n,i,d);break;case"backwards":for(i=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Jo(e)===null){t.child=n;break}e=n.sibling,n.sibling=i,i=n,n=e}sl(t,!0,i,null,d);break;case"together":sl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function To(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),zr|=t.lanes,!(i&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,i=vr(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=vr(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function xv(e,t,i){switch(t.tag){case 3:Vp(t),Ls();break;case 5:wp(t);break;case 1:Kt(t.type)&&Vo(t);break;case 4:Yc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,n=t.memoizedProps.value;Je(qo,r._currentValue),r._currentValue=n;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Je(nt,nt.current&1),t.flags|=128,null):i&t.child.childLanes?Gp(e,t,i):(Je(nt,nt.current&1),e=Zi(e,t,i),e!==null?e.sibling:null);Je(nt,nt.current&1);break;case 19:if(r=(i&t.childLanes)!==0,e.flags&128){if(r)return Kp(e,t,i);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Je(nt,nt.current),r)break;return null;case 22:case 23:return t.lanes=0,Up(e,t,i)}return Zi(e,t,i)}var qp,ic,Yp,Xp;qp=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};ic=function(){};Yp=function(e,t,i,r){var n=e.memoizedProps;if(n!==r){e=t.stateNode,Or(Fi.current);var d=null;switch(i){case"input":n=xl(e,n),r=xl(e,r),d=[];break;case"select":n=at({},n,{value:void 0}),r=at({},r,{value:void 0}),d=[];break;case"textarea":n=Ll(e,n),r=Ll(e,r),d=[];break;default:typeof n.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Uo)}Tl(i,r);var _;i=null;for(f in n)if(!r.hasOwnProperty(f)&&n.hasOwnProperty(f)&&n[f]!=null)if(f==="style"){var s=n[f];for(_ in s)s.hasOwnProperty(_)&&(i||(i={}),i[_]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(pn.hasOwnProperty(f)?d||(d=[]):(d=d||[]).push(f,null));for(f in r){var o=r[f];if(s=n!=null?n[f]:void 0,r.hasOwnProperty(f)&&o!==s&&(o!=null||s!=null))if(f==="style")if(s){for(_ in s)!s.hasOwnProperty(_)||o&&o.hasOwnProperty(_)||(i||(i={}),i[_]="");for(_ in o)o.hasOwnProperty(_)&&s[_]!==o[_]&&(i||(i={}),i[_]=o[_])}else i||(d||(d=[]),d.push(f,i)),i=o;else f==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,s=s?s.__html:void 0,o!=null&&s!==o&&(d=d||[]).push(f,o)):f==="children"?typeof o!="string"&&typeof o!="number"||(d=d||[]).push(f,""+o):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(pn.hasOwnProperty(f)?(o!=null&&f==="onScroll"&&et("scroll",e),d||s===o||(d=[])):(d=d||[]).push(f,o))}i&&(d=d||[]).push("style",i);var f=d;(t.updateQueue=f)&&(t.flags|=4)}};Xp=function(e,t,i,r){i!==r&&(t.flags|=4)};function Us(e,t){if(!rt)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 r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var n=e.child;n!==null;)i|=n.lanes|n.childLanes,r|=n.subtreeFlags&14680064,r|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)i|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function kv(e,t,i){var r=t.pendingProps;switch($c(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(t),null;case 1:return Kt(t.type)&&Wo(),Dt(t),null;case 3:return r=t.stateNode,Ts(),tt(Gt),tt(It),Jc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ro(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ki!==null&&(uc(ki),ki=null))),ic(e,t),Dt(t),null;case 5:Xc(t);var n=Or(En.current);if(i=t.type,e!==null&&t.stateNode!=null)Yp(e,t,i,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return Dt(t),null}if(e=Or(Fi.current),ro(t)){r=t.stateNode,i=t.type;var d=t.memoizedProps;switch(r[Oi]=t,r[xn]=d,e=(t.mode&1)!==0,i){case"dialog":et("cancel",r),et("close",r);break;case"iframe":case"object":case"embed":et("load",r);break;case"video":case"audio":for(n=0;n<Qs.length;n++)et(Qs[n],r);break;case"source":et("error",r);break;case"img":case"image":case"link":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"input":Yu(r,d),et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!d.multiple},et("invalid",r);break;case"textarea":Ju(r,d),et("invalid",r)}Tl(i,d),n=null;for(var _ in d)if(d.hasOwnProperty(_)){var s=d[_];_==="children"?typeof s=="string"?r.textContent!==s&&(d.suppressHydrationWarning!==!0&&io(r.textContent,s,e),n=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(d.suppressHydrationWarning!==!0&&io(r.textContent,s,e),n=["children",""+s]):pn.hasOwnProperty(_)&&s!=null&&_==="onScroll"&&et("scroll",r)}switch(i){case"input":qn(r),Xu(r,d,!0);break;case"textarea":qn(r),Zu(r);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(r.onclick=Uo)}r=n,t.updateQueue=r,r!==null&&(t.flags|=4)}else{_=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=xf(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=_.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=_.createElement(i,{is:r.is}):(e=_.createElement(i),i==="select"&&(_=e,r.multiple?_.multiple=!0:r.size&&(_.size=r.size))):e=_.createElementNS(e,i),e[Oi]=t,e[xn]=r,qp(e,t,!1,!1),t.stateNode=e;e:{switch(_=Dl(i,r),i){case"dialog":et("cancel",e),et("close",e),n=r;break;case"iframe":case"object":case"embed":et("load",e),n=r;break;case"video":case"audio":for(n=0;n<Qs.length;n++)et(Qs[n],e);n=r;break;case"source":et("error",e),n=r;break;case"img":case"image":case"link":et("error",e),et("load",e),n=r;break;case"details":et("toggle",e),n=r;break;case"input":Yu(e,r),n=xl(e,r),et("invalid",e);break;case"option":n=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},n=at({},r,{value:void 0}),et("invalid",e);break;case"textarea":Ju(e,r),n=Ll(e,r),et("invalid",e);break;default:n=r}Tl(i,n),s=n;for(d in s)if(s.hasOwnProperty(d)){var o=s[d];d==="style"?Lf(e,o):d==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&kf(e,o)):d==="children"?typeof o=="string"?(i!=="textarea"||o!=="")&&_n(e,o):typeof o=="number"&&_n(e,""+o):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(pn.hasOwnProperty(d)?o!=null&&d==="onScroll"&&et("scroll",e):o!=null&&Lc(e,d,o,_))}switch(i){case"input":qn(e),Xu(e,r,!1);break;case"textarea":qn(e),Zu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wr(r.value));break;case"select":e.multiple=!!r.multiple,d=r.value,d!=null?ws(e,!!r.multiple,d,!1):r.defaultValue!=null&&ws(e,!!r.multiple,r.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Uo)}switch(i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Dt(t),null;case 6:if(e&&t.stateNode!=null)Xp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(i=Or(En.current),Or(Fi.current),ro(t)){if(r=t.stateNode,i=t.memoizedProps,r[Oi]=t,(d=r.nodeValue!==i)&&(e=si,e!==null))switch(e.tag){case 3:io(r.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&io(r.nodeValue,i,(e.mode&1)!==0)}d&&(t.flags|=4)}else r=(i.nodeType===9?i:i.ownerDocument).createTextNode(r),r[Oi]=t,t.stateNode=r}return Dt(t),null;case 13:if(tt(nt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(rt&&ri!==null&&t.mode&1&&!(t.flags&128))pp(),Ls(),t.flags|=98560,d=!1;else if(d=ro(t),r!==null&&r.dehydrated!==null){if(e===null){if(!d)throw Error(oe(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(oe(317));d[Oi]=t}else Ls(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dt(t),d=!1}else ki!==null&&(uc(ki),ki=null),d=!0;if(!d)return t.flags&65536?t:null}return t.flags&128?(t.lanes=i,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||nt.current&1?gt===0&&(gt=3):cu())),t.updateQueue!==null&&(t.flags|=4),Dt(t),null);case 4:return Ts(),ic(e,t),e===null&&bn(t.stateNode.containerInfo),Dt(t),null;case 10:return Gc(t.type._context),Dt(t),null;case 17:return Kt(t.type)&&Wo(),Dt(t),null;case 19:if(tt(nt),d=t.memoizedState,d===null)return Dt(t),null;if(r=(t.flags&128)!==0,_=d.rendering,_===null)if(r)Us(d,!1);else{if(gt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(_=Jo(e),_!==null){for(t.flags|=128,Us(d,!1),r=_.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=i,i=t.child;i!==null;)d=i,e=r,d.flags&=14680066,_=d.alternate,_===null?(d.childLanes=0,d.lanes=e,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=_.childLanes,d.lanes=_.lanes,d.child=_.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=_.memoizedProps,d.memoizedState=_.memoizedState,d.updateQueue=_.updateQueue,d.type=_.type,e=_.dependencies,d.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return Je(nt,nt.current&1|2),t.child}e=e.sibling}d.tail!==null&&dt()>As&&(t.flags|=128,r=!0,Us(d,!1),t.lanes=4194304)}else{if(!r)if(e=Jo(_),e!==null){if(t.flags|=128,r=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Us(d,!0),d.tail===null&&d.tailMode==="hidden"&&!_.alternate&&!rt)return Dt(t),null}else 2*dt()-d.renderingStartTime>As&&i!==1073741824&&(t.flags|=128,r=!0,Us(d,!1),t.lanes=4194304);d.isBackwards?(_.sibling=t.child,t.child=_):(i=d.last,i!==null?i.sibling=_:t.child=_,d.last=_)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=dt(),t.sibling=null,i=nt.current,Je(nt,r?i&1|2:i&1),t):(Dt(t),null);case 22:case 23:return lu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ti&1073741824&&(Dt(t),t.subtreeFlags&6&&(t.flags|=8192)):Dt(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function Ev(e,t){switch($c(t),t.tag){case 1:return Kt(t.type)&&Wo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ts(),tt(Gt),tt(It),Jc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xc(t),null;case 13:if(tt(nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(nt),null;case 4:return Ts(),null;case 10:return Gc(t.type._context),null;case 22:case 23:return lu(),null;case 24:return null;default:return null}}var oo=!1,Mt=!1,Lv=typeof WeakSet=="function"?WeakSet:Set,we=null;function gs(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(r){ut(e,t,r)}else i.current=null}function rc(e,t,i){try{i()}catch(r){ut(e,t,r)}}var zh=!1;function Rv(e,t){if(Hl=Ho,e=tp(),Hc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var n=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var _=0,s=-1,o=-1,f=0,g=0,l=e,m=null;t:for(;;){for(var y;l!==i||n!==0&&l.nodeType!==3||(s=_+n),l!==d||r!==0&&l.nodeType!==3||(o=_+r),l.nodeType===3&&(_+=l.nodeValue.length),(y=l.firstChild)!==null;)m=l,l=y;for(;;){if(l===e)break t;if(m===i&&++f===n&&(s=_),m===d&&++g===r&&(o=_),(y=l.nextSibling)!==null)break;l=m,m=l.parentNode}l=y}i=s===-1||o===-1?null:{start:s,end:o}}else i=null}i=i||{start:0,end:0}}else i=null;for(zl={focusedElem:e,selectionRange:i},Ho=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var p=b.memoizedProps,a=b.memoizedState,h=t.stateNode,c=h.getSnapshotBeforeUpdate(t.elementType===t.type?p:Ci(t.type,p),a);h.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var u=t.stateNode.containerInfo;u.nodeType===1?u.textContent="":u.nodeType===9&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(v){ut(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return b=zh,zh=!1,b}function cn(e,t,i){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do{if((n.tag&e)===e){var d=n.destroy;n.destroy=void 0,d!==void 0&&rc(t,i,d)}n=n.next}while(n!==r)}}function ba(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var r=i.create;i.destroy=r()}i=i.next}while(i!==t)}}function sc(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function Jp(e){var t=e.alternate;t!==null&&(e.alternate=null,Jp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Oi],delete t[xn],delete t[Wl],delete t[uv],delete t[hv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Zp(e){return e.tag===5||e.tag===3||e.tag===4}function $h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Zp(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.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 nc(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Uo));else if(r!==4&&(e=e.child,e!==null))for(nc(e,t,i),e=e.sibling;e!==null;)nc(e,t,i),e=e.sibling}function oc(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(oc(e,t,i),e=e.sibling;e!==null;)oc(e,t,i),e=e.sibling}var Ct=null,xi=!1;function sr(e,t,i){for(i=i.child;i!==null;)Qp(e,t,i),i=i.sibling}function Qp(e,t,i){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(pa,i)}catch{}switch(i.tag){case 5:Mt||gs(i,t);case 6:var r=Ct,n=xi;Ct=null,sr(e,t,i),Ct=r,xi=n,Ct!==null&&(xi?(e=Ct,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Ct.removeChild(i.stateNode));break;case 18:Ct!==null&&(xi?(e=Ct,i=i.stateNode,e.nodeType===8?Ja(e.parentNode,i):e.nodeType===1&&Ja(e,i),wn(e)):Ja(Ct,i.stateNode));break;case 4:r=Ct,n=xi,Ct=i.stateNode.containerInfo,xi=!0,sr(e,t,i),Ct=r,xi=n;break;case 0:case 11:case 14:case 15:if(!Mt&&(r=i.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){n=r=r.next;do{var d=n,_=d.destroy;d=d.tag,_!==void 0&&(d&2||d&4)&&rc(i,t,_),n=n.next}while(n!==r)}sr(e,t,i);break;case 1:if(!Mt&&(gs(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=i.memoizedProps,r.state=i.memoizedState,r.componentWillUnmount()}catch(s){ut(i,t,s)}sr(e,t,i);break;case 21:sr(e,t,i);break;case 22:i.mode&1?(Mt=(r=Mt)||i.memoizedState!==null,sr(e,t,i),Mt=r):sr(e,t,i);break;default:sr(e,t,i)}}function Uh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Lv),t.forEach(function(r){var n=Bv.bind(null,e,r);i.has(r)||(i.add(r),r.then(n,n))})}}function bi(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var n=i[r];try{var d=e,_=t,s=_;e:for(;s!==null;){switch(s.tag){case 5:Ct=s.stateNode,xi=!1;break e;case 3:Ct=s.stateNode.containerInfo,xi=!0;break e;case 4:Ct=s.stateNode.containerInfo,xi=!0;break e}s=s.return}if(Ct===null)throw Error(oe(160));Qp(d,_,n),Ct=null,xi=!1;var o=n.alternate;o!==null&&(o.return=null),n.return=null}catch(f){ut(n,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)e_(t,e),t=t.sibling}function e_(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(bi(t,e),Di(e),r&4){try{cn(3,e,e.return),ba(3,e)}catch(p){ut(e,e.return,p)}try{cn(5,e,e.return)}catch(p){ut(e,e.return,p)}}break;case 1:bi(t,e),Di(e),r&512&&i!==null&&gs(i,i.return);break;case 5:if(bi(t,e),Di(e),r&512&&i!==null&&gs(i,i.return),e.flags&32){var n=e.stateNode;try{_n(n,"")}catch(p){ut(e,e.return,p)}}if(r&4&&(n=e.stateNode,n!=null)){var d=e.memoizedProps,_=i!==null?i.memoizedProps:d,s=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{s==="input"&&d.type==="radio"&&d.name!=null&&bf(n,d),Dl(s,_);var f=Dl(s,d);for(_=0;_<o.length;_+=2){var g=o[_],l=o[_+1];g==="style"?Lf(n,l):g==="dangerouslySetInnerHTML"?kf(n,l):g==="children"?_n(n,l):Lc(n,g,l,f)}switch(s){case"input":kl(n,d);break;case"textarea":Cf(n,d);break;case"select":var m=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!d.multiple;var y=d.value;y!=null?ws(n,!!d.multiple,y,!1):m!==!!d.multiple&&(d.defaultValue!=null?ws(n,!!d.multiple,d.defaultValue,!0):ws(n,!!d.multiple,d.multiple?[]:"",!1))}n[xn]=d}catch(p){ut(e,e.return,p)}}break;case 6:if(bi(t,e),Di(e),r&4){if(e.stateNode===null)throw Error(oe(162));n=e.stateNode,d=e.memoizedProps;try{n.nodeValue=d}catch(p){ut(e,e.return,p)}}break;case 3:if(bi(t,e),Di(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{wn(t.containerInfo)}catch(p){ut(e,e.return,p)}break;case 4:bi(t,e),Di(e);break;case 13:bi(t,e),Di(e),n=e.child,n.flags&8192&&(d=n.memoizedState!==null,n.stateNode.isHidden=d,!d||n.alternate!==null&&n.alternate.memoizedState!==null||(ou=dt())),r&4&&Uh(e);break;case 22:if(g=i!==null&&i.memoizedState!==null,e.mode&1?(Mt=(f=Mt)||g,bi(t,e),Mt=f):bi(t,e),Di(e),r&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!g&&e.mode&1)for(we=e,g=e.child;g!==null;){for(l=we=g;we!==null;){switch(m=we,y=m.child,m.tag){case 0:case 11:case 14:case 15:cn(4,m,m.return);break;case 1:gs(m,m.return);var b=m.stateNode;if(typeof b.componentWillUnmount=="function"){r=m,i=m.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(p){ut(r,i,p)}}break;case 5:gs(m,m.return);break;case 22:if(m.memoizedState!==null){Vh(l);continue}}y!==null?(y.return=m,we=y):Vh(l)}g=g.sibling}e:for(g=null,l=e;;){if(l.tag===5){if(g===null){g=l;try{n=l.stateNode,f?(d=n.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(s=l.stateNode,o=l.memoizedProps.style,_=o!=null&&o.hasOwnProperty("display")?o.display:null,s.style.display=Ef("display",_))}catch(p){ut(e,e.return,p)}}}else if(l.tag===6){if(g===null)try{l.stateNode.nodeValue=f?"":l.memoizedProps}catch(p){ut(e,e.return,p)}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===e)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===e)break e;for(;l.sibling===null;){if(l.return===null||l.return===e)break e;g===l&&(g=null),l=l.return}g===l&&(g=null),l.sibling.return=l.return,l=l.sibling}}break;case 19:bi(t,e),Di(e),r&4&&Uh(e);break;case 21:break;default:bi(t,e),Di(e)}}function Di(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(Zp(i)){var r=i;break e}i=i.return}throw Error(oe(160))}switch(r.tag){case 5:var n=r.stateNode;r.flags&32&&(_n(n,""),r.flags&=-33);var d=$h(e);oc(e,d,n);break;case 3:case 4:var _=r.stateNode.containerInfo,s=$h(e);nc(e,s,_);break;default:throw Error(oe(161))}}catch(o){ut(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tv(e,t,i){we=e,t_(e)}function t_(e,t,i){for(var r=(e.mode&1)!==0;we!==null;){var n=we,d=n.child;if(n.tag===22&&r){var _=n.memoizedState!==null||oo;if(!_){var s=n.alternate,o=s!==null&&s.memoizedState!==null||Mt;s=oo;var f=Mt;if(oo=_,(Mt=o)&&!f)for(we=n;we!==null;)_=we,o=_.child,_.tag===22&&_.memoizedState!==null?Gh(n):o!==null?(o.return=_,we=o):Gh(n);for(;d!==null;)we=d,t_(d),d=d.sibling;we=n,oo=s,Mt=f}Wh(e)}else n.subtreeFlags&8772&&d!==null?(d.return=n,we=d):Wh(e)}}function Wh(e){for(;we!==null;){var t=we;if(t.flags&8772){var i=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mt||ba(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mt)if(i===null)r.componentDidMount();else{var n=t.elementType===t.type?i.memoizedProps:Ci(t.type,i.memoizedProps);r.componentDidUpdate(n,i.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&Rh(t,d,r);break;case 3:var _=t.updateQueue;if(_!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Rh(t,_,i)}break;case 5:var s=t.stateNode;if(i===null&&t.flags&4){i=s;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&i.focus();break;case"img":o.src&&(i.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var g=f.memoizedState;if(g!==null){var l=g.dehydrated;l!==null&&wn(l)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}Mt||t.flags&512&&sc(t)}catch(m){ut(t,t.return,m)}}if(t===e){we=null;break}if(i=t.sibling,i!==null){i.return=t.return,we=i;break}we=t.return}}function Vh(e){for(;we!==null;){var t=we;if(t===e){we=null;break}var i=t.sibling;if(i!==null){i.return=t.return,we=i;break}we=t.return}}function Gh(e){for(;we!==null;){var t=we;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{ba(4,t)}catch(o){ut(t,i,o)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var n=t.return;try{r.componentDidMount()}catch(o){ut(t,n,o)}}var d=t.return;try{sc(t)}catch(o){ut(t,d,o)}break;case 5:var _=t.return;try{sc(t)}catch(o){ut(t,_,o)}}}catch(o){ut(t,t.return,o)}if(t===e){we=null;break}var s=t.sibling;if(s!==null){s.return=t.return,we=s;break}we=t.return}}var Dv=Math.ceil,ea=er.ReactCurrentDispatcher,su=er.ReactCurrentOwner,fi=er.ReactCurrentBatchConfig,$e=0,wt=null,pt=null,xt=0,ti=0,vs=br(0),gt=0,Dn=null,zr=0,Ca=0,nu=0,un=null,Wt=null,ou=0,As=1/0,Wi=null,ta=!1,ac=null,mr=null,ao=!1,ur=null,ia=0,hn=0,lc=null,Do=-1,Ao=0;function Bt(){return $e&6?dt():Do!==-1?Do:Do=dt()}function gr(e){return e.mode&1?$e&2&&xt!==0?xt&-xt:fv.transition!==null?(Ao===0&&(Ao=Ff()),Ao):(e=Ke,e!==0||(e=window.event,e=e===void 0?16:Gf(e.type)),e):1}function Li(e,t,i,r){if(50<hn)throw hn=0,lc=null,Error(oe(185));On(e,i,r),(!($e&2)||e!==wt)&&(e===wt&&(!($e&2)&&(Ca|=i),gt===4&&lr(e,xt)),qt(e,r),i===1&&$e===0&&!(t.mode&1)&&(As=dt()+500,wa&&Cr()))}function qt(e,t){var i=e.callbackNode;fg(e,t);var r=Fo(e,e===wt?xt:0);if(r===0)i!==null&&th(i),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(i!=null&&th(i),t===1)e.tag===0?dv(Kh.bind(null,e)):hp(Kh.bind(null,e)),lv(function(){!($e&6)&&Cr()}),i=null;else{switch(Hf(r)){case 1:i=Mc;break;case 4:i=Bf;break;case 16:i=jo;break;case 536870912:i=jf;break;default:i=jo}i=c_(i,i_.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function i_(e,t){if(Do=-1,Ao=0,$e&6)throw Error(oe(327));var i=e.callbackNode;if(xs()&&e.callbackNode!==i)return null;var r=Fo(e,e===wt?xt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ra(e,r);else{t=r;var n=$e;$e|=2;var d=s_();(wt!==e||xt!==t)&&(Wi=null,As=dt()+500,Nr(e,t));do try{Iv();break}catch(s){r_(e,s)}while(!0);Vc(),ea.current=d,$e=n,pt!==null?t=0:(wt=null,xt=0,t=gt)}if(t!==0){if(t===2&&(n=Ol(e),n!==0&&(r=n,t=cc(e,n))),t===1)throw i=Dn,Nr(e,0),lr(e,r),qt(e,dt()),i;if(t===6)lr(e,r);else{if(n=e.current.alternate,!(r&30)&&!Av(n)&&(t=ra(e,r),t===2&&(d=Ol(e),d!==0&&(r=d,t=cc(e,d))),t===1))throw i=Dn,Nr(e,0),lr(e,r),qt(e,dt()),i;switch(e.finishedWork=n,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:Ar(e,Wt,Wi);break;case 3:if(lr(e,r),(r&130023424)===r&&(t=ou+500-dt(),10<t)){if(Fo(e,0)!==0)break;if(n=e.suspendedLanes,(n&r)!==r){Bt(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=Ul(Ar.bind(null,e,Wt,Wi),t);break}Ar(e,Wt,Wi);break;case 4:if(lr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,n=-1;0<r;){var _=31-Ei(r);d=1<<_,_=t[_],_>n&&(n=_),r&=~d}if(r=n,r=dt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Dv(r/1960))-r,10<r){e.timeoutHandle=Ul(Ar.bind(null,e,Wt,Wi),r);break}Ar(e,Wt,Wi);break;case 5:Ar(e,Wt,Wi);break;default:throw Error(oe(329))}}}return qt(e,dt()),e.callbackNode===i?i_.bind(null,e):null}function cc(e,t){var i=un;return e.current.memoizedState.isDehydrated&&(Nr(e,t).flags|=256),e=ra(e,t),e!==2&&(t=Wt,Wt=i,t!==null&&uc(t)),e}function uc(e){Wt===null?Wt=e:Wt.push.apply(Wt,e)}function Av(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var r=0;r<i.length;r++){var n=i[r],d=n.getSnapshot;n=n.value;try{if(!Ri(d(),n))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 lr(e,t){for(t&=~nu,t&=~Ca,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-Ei(t),r=1<<i;e[i]=-1,t&=~r}}function Kh(e){if($e&6)throw Error(oe(327));xs();var t=Fo(e,0);if(!(t&1))return qt(e,dt()),null;var i=ra(e,t);if(e.tag!==0&&i===2){var r=Ol(e);r!==0&&(t=r,i=cc(e,r))}if(i===1)throw i=Dn,Nr(e,0),lr(e,t),qt(e,dt()),i;if(i===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ar(e,Wt,Wi),qt(e,dt()),null}function au(e,t){var i=$e;$e|=1;try{return e(t)}finally{$e=i,$e===0&&(As=dt()+500,wa&&Cr())}}function $r(e){ur!==null&&ur.tag===0&&!($e&6)&&xs();var t=$e;$e|=1;var i=fi.transition,r=Ke;try{if(fi.transition=null,Ke=1,e)return e()}finally{Ke=r,fi.transition=i,$e=t,!($e&6)&&Cr()}}function lu(){ti=vs.current,tt(vs)}function Nr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,av(i)),pt!==null)for(i=pt.return;i!==null;){var r=i;switch($c(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Wo();break;case 3:Ts(),tt(Gt),tt(It),Jc();break;case 5:Xc(r);break;case 4:Ts();break;case 13:tt(nt);break;case 19:tt(nt);break;case 10:Gc(r.type._context);break;case 22:case 23:lu()}i=i.return}if(wt=e,pt=e=vr(e.current,null),xt=ti=t,gt=0,Dn=null,nu=Ca=zr=0,Wt=un=null,Pr!==null){for(t=0;t<Pr.length;t++)if(i=Pr[t],r=i.interleaved,r!==null){i.interleaved=null;var n=r.next,d=i.pending;if(d!==null){var _=d.next;d.next=n,r.next=_}i.pending=r}Pr=null}return e}function r_(e,t){do{var i=pt;try{if(Vc(),Lo.current=Qo,Zo){for(var r=ot.memoizedState;r!==null;){var n=r.queue;n!==null&&(n.pending=null),r=r.next}Zo=!1}if(Hr=0,vt=mt=ot=null,ln=!1,Ln=0,su.current=null,i===null||i.return===null){gt=1,Dn=t,pt=null;break}e:{var d=e,_=i.return,s=i,o=t;if(t=xt,s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var f=o,g=s,l=g.tag;if(!(g.mode&1)&&(l===0||l===11||l===15)){var m=g.alternate;m?(g.updateQueue=m.updateQueue,g.memoizedState=m.memoizedState,g.lanes=m.lanes):(g.updateQueue=null,g.memoizedState=null)}var y=Ph(_);if(y!==null){y.flags&=-257,Oh(y,_,s,d,t),y.mode&1&&Ih(d,f,t),t=y,o=f;var b=t.updateQueue;if(b===null){var p=new Set;p.add(o),t.updateQueue=p}else b.add(o);break e}else{if(!(t&1)){Ih(d,f,t),cu();break e}o=Error(oe(426))}}else if(rt&&s.mode&1){var a=Ph(_);if(a!==null){!(a.flags&65536)&&(a.flags|=256),Oh(a,_,s,d,t),Uc(Ds(o,s));break e}}d=o=Ds(o,s),gt!==4&&(gt=2),un===null?un=[d]:un.push(d),d=_;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var h=Hp(d,o,t);Lh(d,h);break e;case 1:s=o;var c=d.type,u=d.stateNode;if(!(d.flags&128)&&(typeof c.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(mr===null||!mr.has(u)))){d.flags|=65536,t&=-t,d.lanes|=t;var v=zp(d,s,t);Lh(d,v);break e}}d=d.return}while(d!==null)}o_(i)}catch(x){t=x,pt===i&&i!==null&&(pt=i=i.return);continue}break}while(!0)}function s_(){var e=ea.current;return ea.current=Qo,e===null?Qo:e}function cu(){(gt===0||gt===3||gt===2)&&(gt=4),wt===null||!(zr&268435455)&&!(Ca&268435455)||lr(wt,xt)}function ra(e,t){var i=$e;$e|=2;var r=s_();(wt!==e||xt!==t)&&(Wi=null,Nr(e,t));do try{Mv();break}catch(n){r_(e,n)}while(!0);if(Vc(),$e=i,ea.current=r,pt!==null)throw Error(oe(261));return wt=null,xt=0,gt}function Mv(){for(;pt!==null;)n_(pt)}function Iv(){for(;pt!==null&&!sg();)n_(pt)}function n_(e){var t=l_(e.alternate,e,ti);e.memoizedProps=e.pendingProps,t===null?o_(e):pt=t,su.current=null}function o_(e){var t=e;do{var i=t.alternate;if(e=t.return,t.flags&32768){if(i=Ev(i,t),i!==null){i.flags&=32767,pt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{gt=6,pt=null;return}}else if(i=kv(i,t,ti),i!==null){pt=i;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);gt===0&&(gt=5)}function Ar(e,t,i){var r=Ke,n=fi.transition;try{fi.transition=null,Ke=1,Pv(e,t,i,r)}finally{fi.transition=n,Ke=r}return null}function Pv(e,t,i,r){do xs();while(ur!==null);if($e&6)throw Error(oe(327));i=e.finishedWork;var n=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(oe(177));e.callbackNode=null,e.callbackPriority=0;var d=i.lanes|i.childLanes;if(pg(e,d),e===wt&&(pt=wt=null,xt=0),!(i.subtreeFlags&2064)&&!(i.flags&2064)||ao||(ao=!0,c_(jo,function(){return xs(),null})),d=(i.flags&15990)!==0,i.subtreeFlags&15990||d){d=fi.transition,fi.transition=null;var _=Ke;Ke=1;var s=$e;$e|=4,su.current=null,Rv(e,i),e_(i,e),ev(zl),Ho=!!Hl,zl=Hl=null,e.current=i,Tv(i),ng(),$e=s,Ke=_,fi.transition=d}else e.current=i;if(ao&&(ao=!1,ur=e,ia=n),d=e.pendingLanes,d===0&&(mr=null),lg(i.stateNode),qt(e,dt()),t!==null)for(r=e.onRecoverableError,i=0;i<t.length;i++)n=t[i],r(n.value,{componentStack:n.stack,digest:n.digest});if(ta)throw ta=!1,e=ac,ac=null,e;return ia&1&&e.tag!==0&&xs(),d=e.pendingLanes,d&1?e===lc?hn++:(hn=0,lc=e):hn=0,Cr(),null}function xs(){if(ur!==null){var e=Hf(ia),t=fi.transition,i=Ke;try{if(fi.transition=null,Ke=16>e?16:e,ur===null)var r=!1;else{if(e=ur,ur=null,ia=0,$e&6)throw Error(oe(331));var n=$e;for($e|=4,we=e.current;we!==null;){var d=we,_=d.child;if(we.flags&16){var s=d.deletions;if(s!==null){for(var o=0;o<s.length;o++){var f=s[o];for(we=f;we!==null;){var g=we;switch(g.tag){case 0:case 11:case 15:cn(8,g,d)}var l=g.child;if(l!==null)l.return=g,we=l;else for(;we!==null;){g=we;var m=g.sibling,y=g.return;if(Jp(g),g===f){we=null;break}if(m!==null){m.return=y,we=m;break}we=y}}}var b=d.alternate;if(b!==null){var p=b.child;if(p!==null){b.child=null;do{var a=p.sibling;p.sibling=null,p=a}while(p!==null)}}we=d}}if(d.subtreeFlags&2064&&_!==null)_.return=d,we=_;else e:for(;we!==null;){if(d=we,d.flags&2048)switch(d.tag){case 0:case 11:case 15:cn(9,d,d.return)}var h=d.sibling;if(h!==null){h.return=d.return,we=h;break e}we=d.return}}var c=e.current;for(we=c;we!==null;){_=we;var u=_.child;if(_.subtreeFlags&2064&&u!==null)u.return=_,we=u;else e:for(_=c;we!==null;){if(s=we,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:ba(9,s)}}catch(x){ut(s,s.return,x)}if(s===_){we=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,we=v;break e}we=s.return}}if($e=n,Cr(),ji&&typeof ji.onPostCommitFiberRoot=="function")try{ji.onPostCommitFiberRoot(pa,e)}catch{}r=!0}return r}finally{Ke=i,fi.transition=t}}return!1}function qh(e,t,i){t=Ds(i,t),t=Hp(e,t,1),e=_r(e,t,1),t=Bt(),e!==null&&(On(e,1,t),qt(e,t))}function ut(e,t,i){if(e.tag===3)qh(e,e,i);else for(;t!==null;){if(t.tag===3){qh(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(mr===null||!mr.has(r))){e=Ds(i,e),e=zp(t,e,1),t=_r(t,e,1),e=Bt(),t!==null&&(On(t,1,e),qt(t,e));break}}t=t.return}}function Ov(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),t=Bt(),e.pingedLanes|=e.suspendedLanes&i,wt===e&&(xt&i)===i&&(gt===4||gt===3&&(xt&130023424)===xt&&500>dt()-ou?Nr(e,0):nu|=i),qt(e,t)}function a_(e,t){t===0&&(e.mode&1?(t=Jn,Jn<<=1,!(Jn&130023424)&&(Jn=4194304)):t=1);var i=Bt();e=Ji(e,t),e!==null&&(On(e,t,i),qt(e,i))}function Nv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),a_(e,i)}function Bv(e,t){var i=0;switch(e.tag){case 13:var r=e.stateNode,n=e.memoizedState;n!==null&&(i=n.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),a_(e,i)}var l_;l_=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)Vt=!0;else{if(!(e.lanes&i)&&!(t.flags&128))return Vt=!1,xv(e,t,i);Vt=!!(e.flags&131072)}else Vt=!1,rt&&t.flags&1048576&&dp(t,Ko,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;To(e,t),e=t.pendingProps;var n=Es(t,It.current);Cs(t,i),n=Qc(null,t,r,e,n,i);var d=eu();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Kt(r)?(d=!0,Vo(t)):d=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,qc(t),n.updater=Sa,t.stateNode=n,n._reactInternals=t,Xl(t,r,e,i),t=Ql(null,t,r,!0,d,i)):(t.tag=0,rt&&d&&zc(t),Nt(null,t,n,i),t=t.child),t;case 16:r=t.elementType;e:{switch(To(e,t),e=t.pendingProps,n=r._init,r=n(r._payload),t.type=r,n=t.tag=Fv(r),e=Ci(r,e),n){case 0:t=Zl(null,t,r,e,i);break e;case 1:t=jh(null,t,r,e,i);break e;case 11:t=Nh(null,t,r,e,i);break e;case 14:t=Bh(null,t,r,Ci(r.type,e),i);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,n=t.pendingProps,n=t.elementType===r?n:Ci(r,n),Zl(e,t,r,n,i);case 1:return r=t.type,n=t.pendingProps,n=t.elementType===r?n:Ci(r,n),jh(e,t,r,n,i);case 3:e:{if(Vp(t),e===null)throw Error(oe(387));r=t.pendingProps,d=t.memoizedState,n=d.element,vp(e,t),Xo(t,r,null,i);var _=t.memoizedState;if(r=_.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){n=Ds(Error(oe(423)),t),t=Fh(e,t,r,i,n);break e}else if(r!==n){n=Ds(Error(oe(424)),t),t=Fh(e,t,r,i,n);break e}else for(ri=pr(t.stateNode.containerInfo.firstChild),si=t,rt=!0,ki=null,i=mp(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ls(),r===n){t=Zi(e,t,i);break e}Nt(e,t,r,i)}t=t.child}return t;case 5:return wp(t),e===null&&Kl(t),r=t.type,n=t.pendingProps,d=e!==null?e.memoizedProps:null,_=n.children,$l(r,n)?_=null:d!==null&&$l(r,d)&&(t.flags|=32),Wp(e,t),Nt(e,t,_,i),t.child;case 6:return e===null&&Kl(t),null;case 13:return Gp(e,t,i);case 4:return Yc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rs(t,null,r,i):Nt(e,t,r,i),t.child;case 11:return r=t.type,n=t.pendingProps,n=t.elementType===r?n:Ci(r,n),Nh(e,t,r,n,i);case 7:return Nt(e,t,t.pendingProps,i),t.child;case 8:return Nt(e,t,t.pendingProps.children,i),t.child;case 12:return Nt(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(r=t.type._context,n=t.pendingProps,d=t.memoizedProps,_=n.value,Je(qo,r._currentValue),r._currentValue=_,d!==null)if(Ri(d.value,_)){if(d.children===n.children&&!Gt.current){t=Zi(e,t,i);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var s=d.dependencies;if(s!==null){_=d.child;for(var o=s.firstContext;o!==null;){if(o.context===r){if(d.tag===1){o=qi(-1,i&-i),o.tag=2;var f=d.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o}}d.lanes|=i,o=d.alternate,o!==null&&(o.lanes|=i),ql(d.return,i,t),s.lanes|=i;break}o=o.next}}else if(d.tag===10)_=d.type===t.type?null:d.child;else if(d.tag===18){if(_=d.return,_===null)throw Error(oe(341));_.lanes|=i,s=_.alternate,s!==null&&(s.lanes|=i),ql(_,i,t),_=d.sibling}else _=d.child;if(_!==null)_.return=d;else for(_=d;_!==null;){if(_===t){_=null;break}if(d=_.sibling,d!==null){d.return=_.return,_=d;break}_=_.return}d=_}Nt(e,t,n.children,i),t=t.child}return t;case 9:return n=t.type,r=t.pendingProps.children,Cs(t,i),n=pi(n),r=r(n),t.flags|=1,Nt(e,t,r,i),t.child;case 14:return r=t.type,n=Ci(r,t.pendingProps),n=Ci(r.type,n),Bh(e,t,r,n,i);case 15:return $p(e,t,t.type,t.pendingProps,i);case 17:return r=t.type,n=t.pendingProps,n=t.elementType===r?n:Ci(r,n),To(e,t),t.tag=1,Kt(r)?(e=!0,Vo(t)):e=!1,Cs(t,i),Fp(t,r,n),Xl(t,r,n,i),Ql(null,t,r,!0,e,i);case 19:return Kp(e,t,i);case 22:return Up(e,t,i)}throw Error(oe(156,t.tag))};function c_(e,t){return Nf(e,t)}function jv(e,t,i,r){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(e,t,i,r){return new jv(e,t,i,r)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fv(e){if(typeof e=="function")return uu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tc)return 11;if(e===Dc)return 14}return 2}function vr(e,t){var i=e.alternate;return i===null?(i=di(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&14680064,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}function Mo(e,t,i,r,n,d){var _=2;if(r=e,typeof e=="function")uu(e)&&(_=1);else if(typeof e=="string")_=5;else e:switch(e){case ls:return Br(i.children,n,d,t);case Rc:_=8,n|=8;break;case yl:return e=di(12,i,t,n|2),e.elementType=yl,e.lanes=d,e;case Sl:return e=di(13,i,t,n),e.elementType=Sl,e.lanes=d,e;case bl:return e=di(19,i,t,n),e.elementType=bl,e.lanes=d,e;case wf:return xa(i,n,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gf:_=10;break e;case vf:_=9;break e;case Tc:_=11;break e;case Dc:_=14;break e;case nr:_=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=di(_,i,t,n),t.elementType=e,t.type=r,t.lanes=d,t}function Br(e,t,i,r){return e=di(7,e,r,t),e.lanes=i,e}function xa(e,t,i,r){return e=di(22,e,r,t),e.elementType=wf,e.lanes=i,e.stateNode={isHidden:!1},e}function nl(e,t,i){return e=di(6,e,null,t),e.lanes=i,e}function ol(e,t,i){return t=di(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hv(e,t,i,r,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ha(0),this.expirationTimes=Ha(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ha(0),this.identifierPrefix=r,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function hu(e,t,i,r,n,d,_,s,o){return e=new Hv(e,t,i,s,o),t===1?(t=1,d===!0&&(t|=8)):t=0,d=di(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:r,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},qc(d),e}function zv(e,t,i){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:as,key:r==null?null:""+r,children:e,containerInfo:t,implementation:i}}function u_(e){if(!e)return yr;e=e._reactInternals;e:{if(Yr(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var i=e.type;if(Kt(i))return up(e,i,t)}return t}function h_(e,t,i,r,n,d,_,s,o){return e=hu(i,r,!0,e,n,d,_,s,o),e.context=u_(null),i=e.current,r=Bt(),n=gr(i),d=qi(r,n),d.callback=t??null,_r(i,d,n),e.current.lanes=n,On(e,n,r),qt(e,r),e}function ka(e,t,i,r){var n=t.current,d=Bt(),_=gr(n);return i=u_(i),t.context===null?t.context=i:t.pendingContext=i,t=qi(d,_),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=_r(n,t,_),e!==null&&(Li(e,n,_,d),Eo(e,n,_)),_}function sa(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function du(e,t){Yh(e,t),(e=e.alternate)&&Yh(e,t)}function $v(){return null}var d_=typeof reportError=="function"?reportError:function(e){console.error(e)};function fu(e){this._internalRoot=e}Ea.prototype.render=fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));ka(e,t,null,null)};Ea.prototype.unmount=fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$r(function(){ka(null,e,null,null)}),t[Xi]=null}};function Ea(e){this._internalRoot=e}Ea.prototype.unstable_scheduleHydration=function(e){if(e){var t=Uf();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ar.length&&t!==0&&t<ar[i].priority;i++);ar.splice(i,0,e),i===0&&Vf(e)}};function pu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function La(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xh(){}function Uv(e,t,i,r,n){if(n){if(typeof r=="function"){var d=r;r=function(){var f=sa(_);d.call(f)}}var _=h_(t,r,e,0,null,!1,!1,"",Xh);return e._reactRootContainer=_,e[Xi]=_.current,bn(e.nodeType===8?e.parentNode:e),$r(),_}for(;n=e.lastChild;)e.removeChild(n);if(typeof r=="function"){var s=r;r=function(){var f=sa(o);s.call(f)}}var o=hu(e,0,!1,null,null,!1,!1,"",Xh);return e._reactRootContainer=o,e[Xi]=o.current,bn(e.nodeType===8?e.parentNode:e),$r(function(){ka(t,o,i,r)}),o}function Ra(e,t,i,r,n){var d=i._reactRootContainer;if(d){var _=d;if(typeof n=="function"){var s=n;n=function(){var o=sa(_);s.call(o)}}ka(t,_,e,n)}else _=Uv(i,t,e,n,r);return sa(_)}zf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=Zs(t.pendingLanes);i!==0&&(Ic(t,i|1),qt(t,dt()),!($e&6)&&(As=dt()+500,Cr()))}break;case 13:$r(function(){var r=Ji(e,1);if(r!==null){var n=Bt();Li(r,e,1,n)}}),du(e,1)}};Pc=function(e){if(e.tag===13){var t=Ji(e,134217728);if(t!==null){var i=Bt();Li(t,e,134217728,i)}du(e,134217728)}};$f=function(e){if(e.tag===13){var t=gr(e),i=Ji(e,t);if(i!==null){var r=Bt();Li(i,e,t,r)}du(e,t)}};Uf=function(){return Ke};Wf=function(e,t){var i=Ke;try{return Ke=e,t()}finally{Ke=i}};Ml=function(e,t,i){switch(t){case"input":if(kl(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var n=va(r);if(!n)throw Error(oe(90));Sf(r),kl(r,n)}}}break;case"textarea":Cf(e,i);break;case"select":t=i.value,t!=null&&ws(e,!!i.multiple,t,!1)}};Df=au;Af=$r;var Wv={usingClientEntryPoint:!1,Events:[Bn,ds,va,Rf,Tf,au]},Ws={findFiberByHostInstance:Ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Vv={bundleType:Ws.bundleType,version:Ws.version,rendererPackageName:Ws.rendererPackageName,rendererConfig:Ws.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:er.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ws.findFiberByHostInstance||$v,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lo.isDisabled&&lo.supportsFiber)try{pa=lo.inject(Vv),ji=lo}catch{}}oi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wv;oi.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pu(t))throw Error(oe(200));return zv(e,t,null,i)};oi.createRoot=function(e,t){if(!pu(e))throw Error(oe(299));var i=!1,r="",n=d_;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=hu(e,1,!1,null,null,i,!1,r,n),e[Xi]=t.current,bn(e.nodeType===8?e.parentNode:e),new fu(t)};oi.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=Pf(t),e=e===null?null:e.stateNode,e};oi.flushSync=function(e){return $r(e)};oi.hydrate=function(e,t,i){if(!La(t))throw Error(oe(200));return Ra(null,e,t,!0,i)};oi.hydrateRoot=function(e,t,i){if(!pu(e))throw Error(oe(405));var r=i!=null&&i.hydratedSources||null,n=!1,d="",_=d_;if(i!=null&&(i.unstable_strictMode===!0&&(n=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(_=i.onRecoverableError)),t=h_(t,null,e,1,i??null,n,!1,d,_),e[Xi]=t.current,bn(e),r)for(e=0;e<r.length;e++)i=r[e],n=i._getVersion,n=n(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,n]:t.mutableSourceEagerHydrationData.push(i,n);return new Ea(t)};oi.render=function(e,t,i){if(!La(t))throw Error(oe(200));return Ra(null,e,t,!1,i)};oi.unmountComponentAtNode=function(e){if(!La(e))throw Error(oe(40));return e._reactRootContainer?($r(function(){Ra(null,null,e,!1,function(){e._reactRootContainer=null,e[Xi]=null})}),!0):!1};oi.unstable_batchedUpdates=au;oi.unstable_renderSubtreeIntoContainer=function(e,t,i,r){if(!La(i))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return Ra(e,t,i,!1,r)};oi.version="18.3.1-next-f1338f8080-20240426";function f_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f_)}catch(e){console.error(e)}}f_(),ff.exports=oi;var Ta=ff.exports,p_,Jh=Ta;p_=Jh.createRoot,Jh.hydrateRoot;const __={"common.save":"Save","common.cancel":"Cancel","common.confirm":"Confirm","common.ok":"OK","common.close":"Close","common.delete":"Delete","common.rename":"Rename","common.create":"Create","common.back":"Back","common.open":"Open","common.loading":"Loading…","common.done":"Done","token.title":"Access token required","token.placeholder":"Paste HANDMUX_TOKEN","settings.language":"Language","home.empty":"No files opened yet","home.emptyHint":'Switch to "New" to pick one',"home.remove":"Remove","drawer.empty":"No sessions bound yet","drawer.unbind":"Unbind","drawer.bind":"Bind session","drawer.logout":"Log out","windowbar.newWindow":"New window","rename.new_name":"New name","rename.name_placeholder":"Short name","rename.name_rule":"Letters, digits, hyphens only (≤16)","rename.failed":"Rename failed, please retry","rename.saving":"Saving…","newwindow.title":"New window","newwindow.window_name":"Window name (optional)","newwindow.name_placeholder":"Leave blank to auto-name","newwindow.name_rule":"Letters, digits, hyphens only (≤16)","newwindow.start_dir":"Start directory","newwindow.session_dir_named":"{dir} (session dir)","newwindow.session_dir_default":"Session dir (default)","newwindow.choose":"Choose","newwindow.reset_to_session_dir":"Reset to session dir","newwindow.creating":"Creating…","startup.label":"Startup command (optional)","startup.aria":"Startup command","startup.preset_shell":"Plain shell (default)","startup.preset_claude":"claude (launch Claude Code)","startup.preset_claude_continue":"claude -c (resume last session)","startup.custom":"Custom…","startup.custom_placeholder":'e.g. claude "fix login bug"',"bind.title":"Bind session","bind.sessionName":"Session name","bind.namePlaceholder":"Short name","bind.bind":"Bind","bind.checking":"Checking…","bind.createAndOpen":"Create & open","bind.creating":"Creating…","bind.createHint":`Session "{name}" doesn't exist — tap "Create & open" to create it`,"bind.alreadyBound":"Session already bound","bind.createFailed":"Create failed, please retry","bind.invalidName":"Only letters, digits, hyphens (≤16)","bind.checkFailed":"Check failed, please retry","bind.startDir":"Start directory","bind.homeDirDefault":"Home directory (default)","bind.choose":"Choose","bind.reset":"Reset","actionsheet.confirmAgain":"Confirm? Tap again","dirpicker.title":"Choose directory","inbox.title":"Inbox","inbox.working":"Working","inbox.done":"Done","inbox.needs":"Needs you","inbox.clearDone":"Clear done","inbox.empty":"No pane status yet","inbox.enableTitle":"Turn on Claude Code notifications","inbox.enableHint":"Tag every Claude pane working / waiting on you / done, and get pinged when one needs you.","inbox.enableBtn":"Enable","inbox.enabling":"Enabling…","inbox.enableFailed":"Could not enable — check the server logs.","idea.title":"Ideas","idea.editPlaceholder":"Edit idea…","idea.addPlaceholder":"Jot an idea…","idea.add":"Add","idea.empty":"No ideas yet — jot one down","idea.dragSort":"Drag to reorder","idea.fillInput":"Fill into input","idea.send":"Send","doclink.title":"Open file","changelog.title":"What's new","preview.dynamic":"Dynamic preview","preview.static":"Static preview","preview.remainTitle":"Time left — tap to renew / stop","preview.toPcView":"Switch to desktop view","preview.toMobileView":"Switch to mobile view","preview.pcView":"Desktop view","preview.mobileView":"Mobile view","preview.refresh":"Refresh","preview.minimize":"Minimize","preview.ttlDialog":"Preview lifetime","preview.renew":"Renew (reset to 1 hour)","preview.stop":"Stop preview","preview.iframeTitle":"Preview","preview.zoomOut":"Zoom out","preview.zoomIn":"Zoom in","imageviewer.loadFailed":"Failed to load image","imageviewer.saved":"Saved — find it in your album/gallery or Downloads","imageviewer.shareUnsupported":"Image sharing requires Chrome or Safari","imageviewer.zoomOut":"Zoom out","imageviewer.zoomIn":"Zoom in","imageviewer.imageTitle":"Image","imageviewer.saveImage":"Save image","imageviewer.shareImage":"Share image","mic.stop":"Stop voice input","mic.start":"Voice input","dock.send":"Send","dock.send.hint":"Tap to send · hold to insert","dock.phrases":"Phrases","dock.input.placeholder":"Say something…","dock.upload.aria":"Upload file","dock.upload.title":"Upload file (saved to home upload area, not the project)","dock.upload.progress":"Uploading {name}{tag}","dock.upload.failed":"Upload failed: {names}","app.nameExists":"That name already exists","app.renameFailed":"Rename failed, please retry","app.deleteFailed":"Delete failed, please retry","app.moveFailed":"Move failed, please retry","app.sessionGone":'Session "{name}" not found, it may have closed',"app.docNotFound":"File not found","app.docTooLarge":"File too large (over 2MB)","app.docUnsupported":"Unsupported file or path","app.docOpenFailed":"Open failed, please retry","app.preview":"Preview","app.openPreview":"Open preview","app.ideas":"Ideas","app.files":"Files","app.settings":"Settings","app.renameSession":"Rename session","app.renameWindow":"Rename window","app.moveLeft":"◀ Move left","app.moveRight":"Move right ▶","app.deleteWindow":"Delete window","app.deleteLastWindowConfirm":"This is the last window; deleting it closes the whole session! Tap again","app.deleteConfirm":"Delete? Tap again","app.cannotLocate":"Cannot locate","app.pickItsDir":", pick the directory it lives in:","app.noBoundSession":"No bound session yet","app.tapToBind":"Tap here to bind one","app.selectSessionHint":"Tap ☰ at the top-left to pick a session","settings.title":"Settings","settings.group_global":"Global settings","settings.font_size":"Font size","settings.font_decrease":"Decrease font size","settings.font_increase":"Increase font size","settings.font_auto":"Auto","settings.font_auto_title":"Auto-fit to height","settings.whats_new":"What's new","settings.view_changelog":"View changelog","settings.has_update":"Has update","settings.push_notifications":"Push notifications","settings.notify_on":"Enabled ✓","settings.notify_enable":"Enable device notifications","settings.notify_enabled":"Enabled, you should receive a welcome notification","settings.notify_disabled":"Disabled","settings.notify_failed":"Operation failed","settings.processing":"Processing","settings.push_hint":'Listens for "Needs you" and "Done": when a watched session needs your authorization/answer, or a turn just finished, a push is sent to this device.',"settings.push_unsupported":"Push requires Chrome or Safari","settings.group_session":"Current session settings","settings.screen_cols":"Screen columns","settings.cols_dec":"Fewer","settings.cols_dec_title":"Fewer columns","settings.cols_inc":"More","settings.cols_inc_title":"More columns","settings.cols_restore":"Default","settings.cols_restore_title":"Restore default window size","settings.preview_site":"Preview site","settings.preview_static_site":"Preview static site","settings.preview_running_dynamic":"Dynamic preview running","settings.preview_running_static":"Static preview running","settings.preview_remain_title":"Time remaining","settings.preview_remain":"{time} left","settings.preview_renew":"Renew","settings.preview_confirm_stop":"Confirm stop","settings.preview_stop":"Stop","settings.preview_name":"Name: {name}","settings.preview_port":"(port :{port})","settings.preview_type":"Preview type","settings.preview_off":"Off","settings.preview_static":"Static","settings.preview_dynamic":"Dynamic","settings.preview_off_hint":'Preview is off. Choose "Static" to start.',"settings.preview_off_hint_both":'Preview is off. Choose "Static" or "Dynamic" to start.',"settings.preview_dynamic_disabled":"Dynamic port preview is off. To turn it on, point a wildcard preview domain (previewDomain, e.g. *.example.com) at the gateway with a matching TLS cert. See the README for the Cloudflare vs self-hosted specifics.","settings.preview_pick_dir":"Pick directory & start","settings.preview_static_hint":"Pick a directory containing index.html to preview on your phone.","settings.preview_port_placeholder":"Port, e.g. 3000","settings.preview_port_label":"Port","settings.preview_starting":"Starting…","settings.preview_start":"Start","settings.preview_dynamic_hint":"Enter a port running on this machine (dev server / backend); your phone accesses it directly via a subdomain.","settings.dir_picker_hint":"Pick the static site directory to preview (containing index.html)","settings.err_port_not_listening":"That port is not listening; make sure the service is running","settings.err_bad_port":"Invalid port (1–65535)","settings.err_dynamic_disabled":"Dynamic preview is not enabled","settings.err_start_failed":"Failed to start","filebrowser.openDirFailed":"Cannot open this directory","filebrowser.copiedPath":"Path copied: {abs}","filebrowser.mkdirFailed":"Failed to create folder (invalid name or already exists)","filebrowser.downloading":"Downloading {name}","filebrowser.downloadFailed":"Download failed","filebrowser.uploading":"Uploading {name}{tag}","filebrowser.uploadFailed":"Upload failed","filebrowser.uploadPartialFailed":"These files failed to upload: {names}","filebrowser.sessionDir":"Session directory","filebrowser.jumpToSessionDir":"Jump to current session directory","filebrowser.parentDir":"Parent directory","filebrowser.rootSelect":"Switch root (home / temp dirs)","filebrowser.pathPlaceholder":"Enter path (live filter / jump)","filebrowser.newFolder":"New folder","filebrowser.createBtn":"Create","filebrowser.uploadFile":"Upload file","filebrowser.uploadToCurrentDir":"Upload to current directory","filebrowser.enterSubdirToUpload":"Enter a subdirectory to upload","filebrowser.folderNamePlaceholder":"Folder name","filebrowser.uploadPendingTo":"Upload “{name}” to the current directory","filebrowser.enterSubdirFirst":"(enter a subdirectory first)","filebrowser.upload":"Upload","filebrowser.savedToDownloads":"Saved “{name}” to the Downloads folder; view it in the system file manager","filebrowser.noMatches":"No matching files or directories","filebrowser.tooMany":"Showing the first {shown} of {total} — type in the path box to filter","filebrowser.previewUnsupported":"Preview not supported for this file type; tap the button on the right to download","filebrowser.copyAbsPath":"Copy absolute path","filebrowser.download":"Download","filebrowser.pickThisDir":"Select this directory {path}","filebrowser.downloadConfirm":"Download {name}?","filemanager.files":"Files","filemanager.closeTab":"Close tab","filemanager.minimize":"Minimize","filemanager.recent":"Recent","filemanager.directory":"Directory","git.errReadRepo":"Cannot read repository","git.errLoad":"Load failed","git.errNoRepoInDir":"No git repository in this directory","git.errReadDir":"Cannot read this directory","git.commitDetail":"Commit details","git.diff":"Diff","git.bindRepo":"Bind repository","git.collapse":"Collapse","git.currentBranch":"Current branch","git.switchViewedBranch":"Switch viewed branch","git.switchBranch":"Switch branch","git.noBranches":"No branches","git.noRepoBound":'No repository bound — tap "+" at the top left to choose a directory.',"git.changes":"Changes","git.commits":"Commits","git.pullToLoadMore":"Pull to load more","git.pickerHint":"Choose a directory to auto-discover git repositories inside it","git.cleanTree":"Working tree clean","git.noCommits":"No commits","git.noDiff":"No diff","git.fontSmaller":"Decrease font size","git.fontLarger":"Increase font size","git.diffTruncated":"Diff too large, truncated","cmd.panel":"Command panel","cmd.title":"Commands","cmd.empty":"No commands yet — send one or save a favorite","cmd.favorites":"Favorites","cmd.scopeGlobal":"Global · all sessions","cmd.recent":"Recent","cmd.scopeSession":"This session only","cmd.favorite":"Favorite","cmd.unfavorite":"Unfavorite","doc.home":"Recent","doc.read":"Read aloud","doc.pauseRead":"Pause reading","doc.resumeRead":"Resume reading","doc.stopRead":"Stop reading","doc.rate":"Speed","doc.fontSmaller":"Smaller font","doc.fontLarger":"Larger font","inbox.view.working":"Running","inbox.view.done":"Completed","inbox.view.needs":"Needs you","push.unsupported":"Push notifications require Chrome or Safari","push.iosAddToHome":'On iOS, first "Add to Home Screen", then open from the home-screen icon to enable',"push.permissionDenied":"Notification permission denied","push.noVapid":"Push is not configured on the server (VAPID)","push.subscribeFailed":"Failed to report subscription","push.sendFailed":"Send failed","api.loadFailed":"Load failed","api.uploadFailed":"Upload failed","api.uploadBadDir":"Cannot upload to this directory","api.uploadDuplicate":"A file with this name already exists","api.uploadTooLarge":"File too large (50MB limit)","api.uploadBadType":"Unsupported file type","time.secAgo":"{n}s ago","time.minAgo":"{n}m ago","time.hourAgo":"{n}h ago","time.dayAgo":"{n}d ago","time.expired":"Expired","time.minutes":"{n} min"},Gv={"common.save":"保存","common.cancel":"取消","common.confirm":"确认","common.ok":"确定","common.close":"关闭","common.delete":"删除","common.rename":"重命名","common.create":"新建","common.back":"返回","common.open":"打开","common.loading":"加载中…","common.done":"完成","token.title":"需要访问 token","token.placeholder":"粘贴 HANDMUX_TOKEN","settings.language":"语言","home.empty":"还没有打开过文件","home.emptyHint":"切到「新增」去挑一个","home.remove":"移除","drawer.empty":"还没有绑定会话","drawer.unbind":"解绑","drawer.bind":"绑定会话","drawer.logout":"退出登录","windowbar.newWindow":"新建窗口","rename.new_name":"新名称","rename.name_placeholder":"名字缩写","rename.name_rule":"只能用字母、数字、横线(≤16)","rename.failed":"重命名失败,请重试","rename.saving":"保存中…","newwindow.title":"新建窗口","newwindow.window_name":"窗口名称(可选)","newwindow.name_placeholder":"留空自动命名","newwindow.name_rule":"只能用字母、数字、横线(≤16)","newwindow.start_dir":"起始目录","newwindow.session_dir_named":"{dir}(会话目录)","newwindow.session_dir_default":"会话目录(默认)","newwindow.choose":"选择","newwindow.reset_to_session_dir":"重置为会话目录","newwindow.creating":"新建中…","startup.label":"启动命令(可选)","startup.aria":"启动命令","startup.preset_shell":"空 shell(默认)","startup.preset_claude":"claude(启动 Claude Code)","startup.preset_claude_continue":"claude -c(接着上次会话)","startup.custom":"自定义…","startup.custom_placeholder":'例如 claude "修复登录bug"',"bind.title":"绑定会话","bind.sessionName":"会话名称","bind.namePlaceholder":"名字缩写","bind.bind":"绑定","bind.checking":"校验中…","bind.createAndOpen":"新建并打开","bind.creating":"新建中…","bind.createHint":"会话「{name}」不存在,点「新建并打开」创建","bind.alreadyBound":"已绑定该会话","bind.createFailed":"新建失败,请重试","bind.invalidName":"只能用字母、数字、横线(≤16)","bind.checkFailed":"校验失败,请重试","bind.startDir":"起始目录","bind.homeDirDefault":"主目录(默认)","bind.choose":"选择","bind.reset":"重置","actionsheet.confirmAgain":"确认?再点一次","dirpicker.title":"选择目录","inbox.title":"收件箱","inbox.working":"进行中","inbox.done":"已完成","inbox.needs":"需要你","inbox.clearDone":"清除已完成","inbox.empty":"暂无面板状态","inbox.enableTitle":"开启 Claude Code 通知","inbox.enableHint":"把每个 Claude 面板标记为进行中 / 需要你 / 已完成,需要你时还会推送提醒。","inbox.enableBtn":"开启","inbox.enabling":"开启中…","inbox.enableFailed":"开启失败 —— 看看服务端日志。","idea.title":"想法","idea.editPlaceholder":"编辑想法…","idea.addPlaceholder":"记一条想法…","idea.add":"添加","idea.empty":"还没有想法,记一条吧","idea.dragSort":"拖动排序","idea.fillInput":"填入输入框","idea.send":"发送","doclink.title":"打开文件","changelog.title":"新功能","preview.dynamic":"动态预览","preview.static":"静态预览","preview.remainTitle":"剩余有效期 — 点击续期 / 停止","preview.toPcView":"切换到电脑视图","preview.toMobileView":"切换到手机视图","preview.pcView":"电脑视图","preview.mobileView":"手机视图","preview.refresh":"刷新","preview.minimize":"收起","preview.ttlDialog":"预览有效期","preview.renew":"续期(重置为 1 小时)","preview.stop":"停止预览","preview.iframeTitle":"预览","preview.zoomOut":"缩小","preview.zoomIn":"放大","imageviewer.loadFailed":"图片加载失败","imageviewer.saved":"已保存,可在相册/图库或「下载」中查看","imageviewer.shareUnsupported":"图片分享需要 Chrome 或 Safari 浏览器","imageviewer.zoomOut":"缩小","imageviewer.zoomIn":"放大","imageviewer.imageTitle":"图片","imageviewer.saveImage":"保存图片","imageviewer.shareImage":"分享图片","mic.stop":"停止语音输入","mic.start":"语音输入","dock.send":"发送","dock.send.hint":"点发送 · 长按填入","dock.phrases":"常用语","dock.input.placeholder":"说点什么…","dock.upload.aria":"上传文件","dock.upload.title":"上传文件(存到家目录上传区,不进项目)","dock.upload.progress":"上传 {name}{tag}","dock.upload.failed":"上传失败:{names}","app.nameExists":"该名已存在","app.renameFailed":"重命名失败,请重试","app.deleteFailed":"删除失败,请重试","app.moveFailed":"移动失败,请重试","app.sessionGone":"会话「{name}」不存在,可能已关闭","app.docNotFound":"文件不存在","app.docTooLarge":"文件过大(超过 2MB)","app.docUnsupported":"不支持的文件或路径","app.docOpenFailed":"打开失败,请重试","app.preview":"预览","app.openPreview":"打开预览","app.ideas":"想法","app.files":"文件","app.settings":"设置","app.renameSession":"重命名会话","app.renameWindow":"重命名窗口","app.moveLeft":"◀ 左移","app.moveRight":"右移 ▶","app.deleteWindow":"删除窗口","app.deleteLastWindowConfirm":"这是最后一个窗口,删除将关闭整个会话!再点一次","app.deleteConfirm":"确认删除?再点一次","app.cannotLocate":"无法定位","app.pickItsDir":",请选它所在的目录:","app.noBoundSession":"还没有绑定会话","app.tapToBind":"点此绑定一个","app.selectSessionHint":"点击左上角 ☰ 选择会话","settings.title":"设置","settings.group_global":"全局设置","settings.font_size":"字体大小","settings.font_decrease":"减小字体","settings.font_increase":"增大字体","settings.font_auto":"自适应","settings.font_auto_title":"按高度自动适配","settings.whats_new":"新功能","settings.view_changelog":"查看更新日志","settings.has_update":"有更新","settings.push_notifications":"推送通知","settings.notify_on":"已开启 ✓","settings.notify_enable":"开启设备通知","settings.notify_enabled":"已开启,应会收到一条欢迎通知","settings.notify_disabled":"已关闭","settings.notify_failed":"操作失败","settings.processing":"处理中","settings.push_hint":"监听「需要你」和「已完成」:所关注会话需要你授权/回答,或一个回合刚做完时,推送到此设备。","settings.push_unsupported":"推送需要 Chrome 或 Safari 浏览器","settings.group_session":"当前会话设置","settings.screen_cols":"屏幕列数","settings.cols_dec":"减少","settings.cols_dec_title":"减少列数","settings.cols_inc":"增加","settings.cols_inc_title":"增加列数","settings.cols_restore":"默认","settings.cols_restore_title":"恢复窗口默认尺寸","settings.preview_site":"预览站点","settings.preview_static_site":"预览静态站点","settings.preview_running_dynamic":"动态预览 运行中","settings.preview_running_static":"静态预览 运行中","settings.preview_remain_title":"剩余有效期","settings.preview_remain":"剩 {time}","settings.preview_renew":"续期","settings.preview_confirm_stop":"确认停止","settings.preview_stop":"停止","settings.preview_name":"名称:{name}","settings.preview_port":"(端口 :{port})","settings.preview_type":"预览类型","settings.preview_off":"不开启","settings.preview_static":"静态","settings.preview_dynamic":"动态","settings.preview_off_hint":"未开启预览。选择「静态」开始。","settings.preview_off_hint_both":"未开启预览。选择「静态」或「动态」开始。","settings.preview_dynamic_disabled":"动态端口预览未启用。要开启:把一个通配预览域名(previewDomain,如 *.example.com)指向网关,并配上对应的 TLS 证书。Cloudflare / 自建的证书差异见 README。","settings.preview_pick_dir":"选择目录启动","settings.preview_static_hint":"选一个含 index.html 的目录,在手机上预览。","settings.preview_port_placeholder":"端口,如 3000","settings.preview_port_label":"端口","settings.preview_starting":"启动中…","settings.preview_start":"启动","settings.preview_dynamic_hint":"填本机正在运行的端口(dev server / 后端),手机经子域名直接访问。","settings.dir_picker_hint":"选择要预览的静态站点目录(含 index.html)","settings.err_port_not_listening":"该端口未在监听,请确认服务已启动","settings.err_bad_port":"端口不合法(1–65535)","settings.err_dynamic_disabled":"动态预览未开启","settings.err_start_failed":"启动失败","filebrowser.openDirFailed":"无法打开该目录","filebrowser.copiedPath":"已复制路径:{abs}","filebrowser.mkdirFailed":"新建目录失败(名称非法或已存在)","filebrowser.downloading":"下载 {name}","filebrowser.downloadFailed":"下载失败","filebrowser.uploading":"上传 {name}{tag}","filebrowser.uploadFailed":"上传失败","filebrowser.uploadPartialFailed":"以下文件上传失败:{names}","filebrowser.sessionDir":"会话目录","filebrowser.jumpToSessionDir":"跳到当前会话目录","filebrowser.parentDir":"上级目录","filebrowser.rootSelect":"切换根目录(家目录 / 临时目录)","filebrowser.pathPlaceholder":"输入路径(实时筛选/跳转)","filebrowser.newFolder":"新建文件夹","filebrowser.createBtn":"创建","filebrowser.uploadFile":"上传文件","filebrowser.uploadToCurrentDir":"上传到当前目录","filebrowser.enterSubdirToUpload":"请进入一个子目录上传","filebrowser.folderNamePlaceholder":"文件夹名称","filebrowser.uploadPendingTo":"把「{name}」上传到当前目录","filebrowser.enterSubdirFirst":"(请先进入一个子目录)","filebrowser.upload":"上传","filebrowser.savedToDownloads":"已保存「{name}」到「下载」文件夹,可在系统文件管理器查看","filebrowser.noMatches":"没有匹配的文件或目录","filebrowser.tooMany":"共 {total} 项,只显示前 {shown} 项——在路径框输入关键词可筛选","filebrowser.previewUnsupported":"暂不支持该类型文件的预览,点右侧按钮可下载","filebrowser.copyAbsPath":"复制绝对路径","filebrowser.download":"下载","filebrowser.pickThisDir":"选定此目录 {path}","filebrowser.downloadConfirm":"下载 {name}?","filemanager.files":"文件","filemanager.closeTab":"关闭标签","filemanager.minimize":"最小化","filemanager.recent":"最近","filemanager.directory":"目录","git.errReadRepo":"无法读取仓库","git.errLoad":"加载失败","git.errNoRepoInDir":"该目录下没有 git 仓库","git.errReadDir":"无法读取该目录","git.commitDetail":"提交详情","git.diff":"差异","git.bindRepo":"绑定仓库","git.collapse":"收起","git.currentBranch":"当前分支","git.switchViewedBranch":"切换查看的分支","git.switchBranch":"切换分支","git.noBranches":"暂无分支","git.noRepoBound":"未绑定仓库,点左上角「+」选择一个目录。","git.changes":"变更","git.commits":"提交","git.pullToLoadMore":"下拉加载更多","git.pickerHint":"选择一个目录,自动查找其中的 git 仓库","git.cleanTree":"工作区干净","git.noCommits":"暂无提交","git.noDiff":"无差异","git.fontSmaller":"缩小字体","git.fontLarger":"放大字体","git.diffTruncated":"diff 过大,已截断","cmd.panel":"命令面板","cmd.title":"命令","cmd.empty":"还没有命令,发送一条或保存常用","cmd.favorites":"常用","cmd.scopeGlobal":"全局 · 所有会话","cmd.recent":"最近","cmd.scopeSession":"仅本会话","cmd.favorite":"收藏","cmd.unfavorite":"取消收藏","doc.home":"最近","doc.read":"朗读","doc.pauseRead":"暂停朗读","doc.resumeRead":"继续朗读","doc.stopRead":"停止朗读","doc.rate":"语速","doc.fontSmaller":"缩小字体","doc.fontLarger":"放大字体","inbox.view.working":"进行中","inbox.view.done":"已完成","inbox.view.needs":"需要你","push.unsupported":"推送通知需要 Chrome 或 Safari 浏览器","push.iosAddToHome":'iOS 需先把本站"添加到主屏幕",从主屏图标打开后再开启',"push.permissionDenied":"通知权限被拒绝","push.noVapid":"服务端未配置推送(VAPID)","push.subscribeFailed":"订阅上报失败","push.sendFailed":"发送失败","api.loadFailed":"加载失败","api.uploadFailed":"上传失败","api.uploadBadDir":"无法上传到该目录","api.uploadDuplicate":"已存在同名文件","api.uploadTooLarge":"文件过大(上限 50MB)","api.uploadBadType":"不支持的文件类型","time.secAgo":"{n}秒前","time.minAgo":"{n}分钟前","time.hourAgo":"{n}小时前","time.dayAgo":"{n}天前","time.expired":"已过期","time.minutes":"{n} 分钟"},Kv={"common.save":"儲存","common.cancel":"取消","common.confirm":"確認","common.ok":"確定","common.close":"關閉","common.delete":"刪除","common.rename":"重新命名","common.create":"新增","common.back":"返回","common.open":"開啟","common.loading":"載入中…","common.done":"完成","token.title":"需要存取 Token","token.placeholder":"貼上 HANDMUX_TOKEN","settings.language":"語言","home.empty":"尚未開啟任何檔案","home.emptyHint":"切換到「新增」挑選一個","home.remove":"移除","drawer.empty":"尚未綁定工作階段","drawer.unbind":"解除綁定","drawer.bind":"綁定工作階段","drawer.logout":"登出","windowbar.newWindow":"新增視窗","rename.new_name":"新名稱","rename.name_placeholder":"名稱縮寫","rename.name_rule":"只能使用字母、數字、連字號(≤16)","rename.failed":"重新命名失敗,請重試","rename.saving":"儲存中…","newwindow.title":"新增視窗","newwindow.window_name":"視窗名稱(選填)","newwindow.name_placeholder":"留空自動命名","newwindow.name_rule":"只能使用字母、數字、連字號(≤16)","newwindow.start_dir":"起始目錄","newwindow.session_dir_named":"{dir}(工作階段目錄)","newwindow.session_dir_default":"工作階段目錄(預設)","newwindow.choose":"選擇","newwindow.reset_to_session_dir":"重置為工作階段目錄","newwindow.creating":"建立中…","startup.label":"啟動命令(選填)","startup.aria":"啟動命令","startup.preset_shell":"空白 Shell(預設)","startup.preset_claude":"claude(啟動 Claude Code)","startup.preset_claude_continue":"claude -c(繼續上次工作階段)","startup.custom":"自訂…","startup.custom_placeholder":'例如 claude "修復登入 bug"',"bind.title":"綁定工作階段","bind.sessionName":"工作階段名稱","bind.namePlaceholder":"名稱縮寫","bind.bind":"綁定","bind.checking":"驗證中…","bind.createAndOpen":"新增並開啟","bind.creating":"建立中…","bind.createHint":"工作階段「{name}」不存在,點「新增並開啟」建立","bind.alreadyBound":"已綁定此工作階段","bind.createFailed":"建立失敗,請重試","bind.invalidName":"只能使用字母、數字、連字號(≤16)","bind.checkFailed":"驗證失敗,請重試","bind.startDir":"起始目錄","bind.homeDirDefault":"主目錄(預設)","bind.choose":"選擇","bind.reset":"重置","actionsheet.confirmAgain":"確認?再點一次","dirpicker.title":"選擇目錄","inbox.title":"收件匣","inbox.working":"進行中","inbox.done":"已完成","inbox.needs":"需要你","inbox.clearDone":"清除已完成","inbox.empty":"目前沒有面板狀態","inbox.enableTitle":"開啟 Claude Code 通知","inbox.enableHint":"將每個 Claude 面板標記為進行中 / 需要你 / 已完成,需要時也會推播提醒。","inbox.enableBtn":"開啟","inbox.enabling":"開啟中…","inbox.enableFailed":"開啟失敗——請查看伺服器日誌。","idea.title":"想法","idea.editPlaceholder":"編輯想法…","idea.addPlaceholder":"記錄一條想法…","idea.add":"新增","idea.empty":"還沒有想法,記錄一條吧","idea.dragSort":"拖曳排序","idea.fillInput":"填入輸入框","idea.send":"傳送","doclink.title":"開啟檔案","changelog.title":"新功能","preview.dynamic":"動態預覽","preview.static":"靜態預覽","preview.remainTitle":"剩餘有效期 — 點擊續期 / 停止","preview.toPcView":"切換到電腦檢視","preview.toMobileView":"切換到手機檢視","preview.pcView":"電腦檢視","preview.mobileView":"手機檢視","preview.refresh":"重新整理","preview.minimize":"收起","preview.ttlDialog":"預覽有效期","preview.renew":"續期(重置為 1 小時)","preview.stop":"停止預覽","preview.iframeTitle":"預覽","preview.zoomOut":"縮小","preview.zoomIn":"放大","imageviewer.loadFailed":"圖片載入失敗","imageviewer.saved":"已儲存,可在相簿或「下載」中查看","imageviewer.shareUnsupported":"圖片分享需要 Chrome 或 Safari 瀏覽器","imageviewer.zoomOut":"縮小","imageviewer.zoomIn":"放大","imageviewer.imageTitle":"圖片","imageviewer.saveImage":"儲存圖片","imageviewer.shareImage":"分享圖片","mic.stop":"停止語音輸入","mic.start":"語音輸入","dock.send":"傳送","dock.send.hint":"點傳送 · 長按填入","dock.phrases":"常用語","dock.input.placeholder":"說點什麼…","dock.upload.aria":"上傳檔案","dock.upload.title":"上傳檔案(存到主目錄上傳區,不進專案)","dock.upload.progress":"上傳 {name}{tag}","dock.upload.failed":"上傳失敗:{names}","app.nameExists":"該名稱已存在","app.renameFailed":"重新命名失敗,請重試","app.deleteFailed":"刪除失敗,請重試","app.moveFailed":"移動失敗,請重試","app.sessionGone":"工作階段「{name}」不存在,可能已關閉","app.docNotFound":"檔案不存在","app.docTooLarge":"檔案過大(超過 2MB)","app.docUnsupported":"不支援的檔案或路徑","app.docOpenFailed":"開啟失敗,請重試","app.preview":"預覽","app.openPreview":"開啟預覽","app.ideas":"想法","app.files":"檔案","app.settings":"設定","app.renameSession":"重新命名工作階段","app.renameWindow":"重新命名視窗","app.moveLeft":"◀ 左移","app.moveRight":"右移 ▶","app.deleteWindow":"刪除視窗","app.deleteLastWindowConfirm":"這是最後一個視窗,刪除將關閉整個工作階段!再點一次","app.deleteConfirm":"確認刪除?再點一次","app.cannotLocate":"無法定位","app.pickItsDir":",請選擇所在目錄:","app.noBoundSession":"尚未綁定工作階段","app.tapToBind":"點此綁定一個","app.selectSessionHint":"點擊左上角 ☰ 選擇工作階段","settings.title":"設定","settings.group_global":"全域設定","settings.font_size":"字型大小","settings.font_decrease":"縮小字型","settings.font_increase":"放大字型","settings.font_auto":"自適應","settings.font_auto_title":"依高度自動調整","settings.whats_new":"新功能","settings.view_changelog":"查看更新日誌","settings.has_update":"有更新","settings.push_notifications":"推播通知","settings.notify_on":"已開啟 ✓","settings.notify_enable":"開啟裝置通知","settings.notify_enabled":"已開啟,應會收到一則歡迎通知","settings.notify_disabled":"已關閉","settings.notify_failed":"操作失敗","settings.processing":"處理中","settings.push_hint":"監聽「需要你」和「已完成」:所關注工作階段需要授權/回答,或一輪剛完成時,推播到此裝置。","settings.push_unsupported":"推播需要 Chrome 或 Safari 瀏覽器","settings.group_session":"目前工作階段設定","settings.screen_cols":"螢幕欄數","settings.cols_dec":"減少","settings.cols_dec_title":"減少欄數","settings.cols_inc":"增加","settings.cols_inc_title":"增加欄數","settings.cols_restore":"預設","settings.cols_restore_title":"恢復視窗預設尺寸","settings.preview_site":"預覽站台","settings.preview_static_site":"預覽靜態站台","settings.preview_running_dynamic":"動態預覽 執行中","settings.preview_running_static":"靜態預覽 執行中","settings.preview_remain_title":"剩餘有效期","settings.preview_remain":"剩 {time}","settings.preview_renew":"續期","settings.preview_confirm_stop":"確認停止","settings.preview_stop":"停止","settings.preview_name":"名稱:{name}","settings.preview_port":"(連接埠:{port})","settings.preview_type":"預覽類型","settings.preview_off":"不開啟","settings.preview_static":"靜態","settings.preview_dynamic":"動態","settings.preview_off_hint":"未開啟預覽。選擇「靜態」開始。","settings.preview_off_hint_both":"未開啟預覽。選擇「靜態」或「動態」開始。","settings.preview_dynamic_disabled":"動態連接埠預覽未啟用。要開啟:將一個萬用字元預覽網域(previewDomain,如 *.example.com)指向閘道,並設定對應的 TLS 憑證。Cloudflare / 自建憑證差異請見 README。","settings.preview_pick_dir":"選擇目錄啟動","settings.preview_static_hint":"選一個含 index.html 的目錄,在手機上預覽。","settings.preview_port_placeholder":"連接埠,如 3000","settings.preview_port_label":"連接埠","settings.preview_starting":"啟動中…","settings.preview_start":"啟動","settings.preview_dynamic_hint":"填入本機正在執行的連接埠(dev server / 後端),手機透過子網域直接存取。","settings.dir_picker_hint":"選擇要預覽的靜態站台目錄(含 index.html)","settings.err_port_not_listening":"該連接埠未在監聽,請確認服務已啟動","settings.err_bad_port":"連接埠不合法(1–65535)","settings.err_dynamic_disabled":"動態預覽未開啟","settings.err_start_failed":"啟動失敗","filebrowser.openDirFailed":"無法開啟該目錄","filebrowser.copiedPath":"已複製路徑:{abs}","filebrowser.mkdirFailed":"建立目錄失敗(名稱不合法或已存在)","filebrowser.downloading":"下載 {name}","filebrowser.downloadFailed":"下載失敗","filebrowser.uploading":"上傳 {name}{tag}","filebrowser.uploadFailed":"上傳失敗","filebrowser.uploadPartialFailed":"以下檔案上傳失敗:{names}","filebrowser.sessionDir":"工作階段目錄","filebrowser.jumpToSessionDir":"跳到目前工作階段目錄","filebrowser.parentDir":"上層目錄","filebrowser.rootSelect":"切換根目錄(主目錄 / 暫存目錄)","filebrowser.pathPlaceholder":"輸入路徑(即時篩選/跳轉)","filebrowser.newFolder":"新增資料夾","filebrowser.createBtn":"建立","filebrowser.uploadFile":"上傳檔案","filebrowser.uploadToCurrentDir":"上傳到目前目錄","filebrowser.enterSubdirToUpload":"請進入一個子目錄上傳","filebrowser.folderNamePlaceholder":"資料夾名稱","filebrowser.uploadPendingTo":"將「{name}」上傳到目前目錄","filebrowser.enterSubdirFirst":"(請先進入一個子目錄)","filebrowser.upload":"上傳","filebrowser.savedToDownloads":"已儲存「{name}」到「下載」資料夾,可在系統檔案管理員查看","filebrowser.noMatches":"沒有符合的檔案或目錄","filebrowser.tooMany":"共 {total} 項,僅顯示前 {shown} 項——在路徑框輸入關鍵字可篩選","filebrowser.previewUnsupported":"暫不支援此類型檔案的預覽,點右側按鈕可下載","filebrowser.copyAbsPath":"複製絕對路徑","filebrowser.download":"下載","filebrowser.pickThisDir":"選定此目錄 {path}","filebrowser.downloadConfirm":"下載 {name}?","filemanager.files":"檔案","filemanager.closeTab":"關閉標籤","filemanager.minimize":"最小化","filemanager.recent":"最近","filemanager.directory":"目錄","git.errReadRepo":"無法讀取儲存庫","git.errLoad":"載入失敗","git.errNoRepoInDir":"該目錄下沒有 git 儲存庫","git.errReadDir":"無法讀取該目錄","git.commitDetail":"提交詳情","git.diff":"差異","git.bindRepo":"綁定儲存庫","git.collapse":"收起","git.currentBranch":"目前分支","git.switchViewedBranch":"切換查看的分支","git.switchBranch":"切換分支","git.noBranches":"目前沒有分支","git.noRepoBound":"未綁定儲存庫,點左上角「+」選擇一個目錄。","git.changes":"變更","git.commits":"提交","git.pullToLoadMore":"下拉載入更多","git.pickerHint":"選擇一個目錄,自動尋找其中的 git 儲存庫","git.cleanTree":"工作區乾淨","git.noCommits":"目前沒有提交","git.noDiff":"無差異","git.fontSmaller":"縮小字型","git.fontLarger":"放大字型","git.diffTruncated":"diff 過大,已截斷","cmd.panel":"命令面板","cmd.title":"命令","cmd.empty":"還沒有命令,傳送一條或儲存常用","cmd.favorites":"常用","cmd.scopeGlobal":"全域 · 所有工作階段","cmd.recent":"最近","cmd.scopeSession":"僅本工作階段","cmd.favorite":"收藏","cmd.unfavorite":"取消收藏","doc.home":"最近","doc.read":"朗讀","doc.pauseRead":"暫停朗讀","doc.resumeRead":"繼續朗讀","doc.stopRead":"停止朗讀","doc.rate":"語速","doc.fontSmaller":"縮小字型","doc.fontLarger":"放大字型","inbox.view.working":"進行中","inbox.view.done":"已完成","inbox.view.needs":"需要你","push.unsupported":"推播通知需要 Chrome 或 Safari 瀏覽器","push.iosAddToHome":"iOS 需先將本站「加入主畫面」,從主畫面圖示開啟後再開啟","push.permissionDenied":"通知權限被拒絕","push.noVapid":"伺服器未設定推播(VAPID)","push.subscribeFailed":"訂閱回報失敗","push.sendFailed":"傳送失敗","api.loadFailed":"載入失敗","api.uploadFailed":"上傳失敗","api.uploadBadDir":"無法上傳到該目錄","api.uploadDuplicate":"已存在同名檔案","api.uploadTooLarge":"檔案過大(上限 50MB)","api.uploadBadType":"不支援的檔案類型","time.secAgo":"{n} 秒前","time.minAgo":"{n} 分鐘前","time.hourAgo":"{n} 小時前","time.dayAgo":"{n} 天前","time.expired":"已過期","time.minutes":"{n} 分鐘"},qv={"common.save":"保存","common.cancel":"キャンセル","common.confirm":"確認","common.ok":"OK","common.close":"閉じる","common.delete":"削除","common.rename":"名前を変更","common.create":"新規作成","common.back":"戻る","common.open":"開く","common.loading":"読み込み中…","common.done":"完了","token.title":"アクセストークンが必要です","token.placeholder":"HANDMUX_TOKEN を貼り付け","settings.language":"言語","home.empty":"ファイルが開かれていません","home.emptyHint":"「新規」タブでファイルを選択してください","home.remove":"削除","drawer.empty":"セッションが紐付けられていません","drawer.unbind":"紐付け解除","drawer.bind":"セッションを紐付け","drawer.logout":"ログアウト","windowbar.newWindow":"新規ウィンドウ","rename.new_name":"新しい名前","rename.name_placeholder":"短い名前","rename.name_rule":"英数字とハイフンのみ(≤16文字)","rename.failed":"名前の変更に失敗しました。再試行してください","rename.saving":"保存中…","newwindow.title":"新規ウィンドウ","newwindow.window_name":"ウィンドウ名(任意)","newwindow.name_placeholder":"空白で自動命名","newwindow.name_rule":"英数字とハイフンのみ(≤16文字)","newwindow.start_dir":"開始ディレクトリ","newwindow.session_dir_named":"{dir}(セッションディレクトリ)","newwindow.session_dir_default":"セッションディレクトリ(デフォルト)","newwindow.choose":"選択","newwindow.reset_to_session_dir":"セッションディレクトリにリセット","newwindow.creating":"作成中…","startup.label":"起動コマンド(任意)","startup.aria":"起動コマンド","startup.preset_shell":"空のシェル(デフォルト)","startup.preset_claude":"claude(Claude Code を起動)","startup.preset_claude_continue":"claude -c(前回のセッションを継続)","startup.custom":"カスタム…","startup.custom_placeholder":'例:claude "ログインバグを修正"',"bind.title":"セッションを紐付け","bind.sessionName":"セッション名","bind.namePlaceholder":"短い名前","bind.bind":"紐付け","bind.checking":"確認中…","bind.createAndOpen":"作成して開く","bind.creating":"作成中…","bind.createHint":"セッション「{name}」が存在しません。「作成して開く」をタップして作成してください","bind.alreadyBound":"このセッションはすでに紐付けられています","bind.createFailed":"作成に失敗しました。再試行してください","bind.invalidName":"英数字とハイフンのみ(≤16文字)","bind.checkFailed":"確認に失敗しました。再試行してください","bind.startDir":"開始ディレクトリ","bind.homeDirDefault":"ホームディレクトリ(デフォルト)","bind.choose":"選択","bind.reset":"リセット","actionsheet.confirmAgain":"確認しますか?もう一度タップ","dirpicker.title":"ディレクトリを選択","inbox.title":"受信トレイ","inbox.working":"進行中","inbox.done":"完了","inbox.needs":"要対応","inbox.clearDone":"完了済みをクリア","inbox.empty":"パネルの状態なし","inbox.enableTitle":"Claude Code 通知を有効にする","inbox.enableHint":"各 Claude パネルを「進行中」「要対応」「完了」にマークし、対応が必要なときにプッシュ通知を送信します。","inbox.enableBtn":"有効にする","inbox.enabling":"有効化中…","inbox.enableFailed":"有効化に失敗しました——サーバーログを確認してください。","idea.title":"アイデア","idea.editPlaceholder":"アイデアを編集…","idea.addPlaceholder":"アイデアを記録…","idea.add":"追加","idea.empty":"まだアイデアがありません。記録してみましょう","idea.dragSort":"ドラッグで並べ替え","idea.fillInput":"入力欄に挿入","idea.send":"送信","doclink.title":"ファイルを開く","changelog.title":"新機能","preview.dynamic":"ダイナミックプレビュー","preview.static":"静的プレビュー","preview.remainTitle":"残り有効期限 — タップして更新 / 停止","preview.toPcView":"PCビューに切り替え","preview.toMobileView":"モバイルビューに切り替え","preview.pcView":"PCビュー","preview.mobileView":"モバイルビュー","preview.refresh":"更新","preview.minimize":"最小化","preview.ttlDialog":"プレビュー有効期限","preview.renew":"更新(1時間にリセット)","preview.stop":"プレビューを停止","preview.iframeTitle":"プレビュー","preview.zoomOut":"縮小","preview.zoomIn":"拡大","imageviewer.loadFailed":"画像の読み込みに失敗しました","imageviewer.saved":"保存しました。フォトライブラリまたは「ダウンロード」で確認できます","imageviewer.shareUnsupported":"画像の共有には Chrome または Safari が必要です","imageviewer.zoomOut":"縮小","imageviewer.zoomIn":"拡大","imageviewer.imageTitle":"画像","imageviewer.saveImage":"画像を保存","imageviewer.shareImage":"画像を共有","mic.stop":"音声入力を停止","mic.start":"音声入力","dock.send":"送信","dock.send.hint":"タップで送信 · 長押しで挿入","dock.phrases":"よく使うフレーズ","dock.input.placeholder":"メッセージを入力…","dock.upload.aria":"ファイルをアップロード","dock.upload.title":"ファイルをアップロード(ホームのアップロードフォルダに保存、プロジェクトには含まない)","dock.upload.progress":"{name}{tag} をアップロード中","dock.upload.failed":"アップロード失敗:{names}","app.nameExists":"その名前はすでに使われています","app.renameFailed":"名前の変更に失敗しました。再試行してください","app.deleteFailed":"削除に失敗しました。再試行してください","app.moveFailed":"移動に失敗しました。再試行してください","app.sessionGone":"セッション「{name}」が存在しません。閉じられた可能性があります","app.docNotFound":"ファイルが存在しません","app.docTooLarge":"ファイルが大きすぎます(2MB超)","app.docUnsupported":"サポートされていないファイルまたはパス","app.docOpenFailed":"開くのに失敗しました。再試行してください","app.preview":"プレビュー","app.openPreview":"プレビューを開く","app.ideas":"アイデア","app.files":"ファイル","app.settings":"設定","app.renameSession":"セッション名を変更","app.renameWindow":"ウィンドウ名を変更","app.moveLeft":"◀ 左へ移動","app.moveRight":"右へ移動 ▶","app.deleteWindow":"ウィンドウを削除","app.deleteLastWindowConfirm":"これは最後のウィンドウです。削除するとセッション全体が閉じます!もう一度タップ","app.deleteConfirm":"削除しますか?もう一度タップ","app.cannotLocate":"場所を特定できません","app.pickItsDir":"。ディレクトリを選択してください:","app.noBoundSession":"セッションが紐付けられていません","app.tapToBind":"タップして紐付け","app.selectSessionHint":"左上の ☰ をタップしてセッションを選択","settings.title":"設定","settings.group_global":"グローバル設定","settings.font_size":"フォントサイズ","settings.font_decrease":"フォントを縮小","settings.font_increase":"フォントを拡大","settings.font_auto":"自動調整","settings.font_auto_title":"高さに合わせて自動調整","settings.whats_new":"新機能","settings.view_changelog":"変更履歴を表示","settings.has_update":"更新あり","settings.push_notifications":"プッシュ通知","settings.notify_on":"有効 ✓","settings.notify_enable":"デバイス通知を有効にする","settings.notify_enabled":"有効にしました。ウェルカム通知が届くはずです","settings.notify_disabled":"無効","settings.notify_failed":"操作に失敗しました","settings.processing":"処理中","settings.push_hint":"「要対応」と「完了」を監視:注目しているセッションが承認/回答を必要としているとき、またはラウンドが完了したときにこのデバイスへ通知します。","settings.push_unsupported":"プッシュ通知には Chrome または Safari が必要です","settings.group_session":"現在のセッション設定","settings.screen_cols":"画面の列数","settings.cols_dec":"減らす","settings.cols_dec_title":"列数を減らす","settings.cols_inc":"増やす","settings.cols_inc_title":"列数を増やす","settings.cols_restore":"デフォルト","settings.cols_restore_title":"ウィンドウのデフォルトサイズに戻す","settings.preview_site":"プレビューサイト","settings.preview_static_site":"静的サイトをプレビュー","settings.preview_running_dynamic":"ダイナミックプレビュー 実行中","settings.preview_running_static":"静的プレビュー 実行中","settings.preview_remain_title":"残り有効期限","settings.preview_remain":"残り {time}","settings.preview_renew":"更新","settings.preview_confirm_stop":"停止を確認","settings.preview_stop":"停止","settings.preview_name":"名前:{name}","settings.preview_port":"(ポート:{port})","settings.preview_type":"プレビュータイプ","settings.preview_off":"無効","settings.preview_static":"静的","settings.preview_dynamic":"ダイナミック","settings.preview_off_hint":"プレビューは無効です。「静的」を選択して開始してください。","settings.preview_off_hint_both":"プレビューは無効です。「静的」または「ダイナミック」を選択して開始してください。","settings.preview_dynamic_disabled":"ダイナミックポートプレビューは無効です。有効にするには:ワイルドカードプレビュードメイン(previewDomain、例:*.example.com)をゲートウェイに向け、対応するTLS証明書を設定してください。Cloudflare /自己署名証明書の違いはREADMEを参照。","settings.preview_pick_dir":"ディレクトリを選択して開始","settings.preview_static_hint":"index.html を含むディレクトリを選択して、スマートフォンでプレビュー。","settings.preview_port_placeholder":"ポート番号(例:3000)","settings.preview_port_label":"ポート","settings.preview_starting":"起動中…","settings.preview_start":"起動","settings.preview_dynamic_hint":"ローカルで実行中のポート(devサーバー / バックエンド)を入力すると、スマートフォンからサブドメイン経由でアクセスできます。","settings.dir_picker_hint":"プレビューする静的サイトのディレクトリを選択(index.html を含む)","settings.err_port_not_listening":"そのポートはリッスンしていません。サービスが起動しているか確認してください","settings.err_bad_port":"ポート番号が無効です(1〜65535)","settings.err_dynamic_disabled":"ダイナミックプレビューは無効です","settings.err_start_failed":"起動に失敗しました","filebrowser.openDirFailed":"ディレクトリを開けませんでした","filebrowser.copiedPath":"パスをコピーしました:{abs}","filebrowser.mkdirFailed":"ディレクトリの作成に失敗しました(名前が無効または既に存在します)","filebrowser.downloading":"{name} をダウンロード中","filebrowser.downloadFailed":"ダウンロードに失敗しました","filebrowser.uploading":"{name}{tag} をアップロード中","filebrowser.uploadFailed":"アップロードに失敗しました","filebrowser.uploadPartialFailed":"以下のファイルのアップロードに失敗しました:{names}","filebrowser.sessionDir":"セッションディレクトリ","filebrowser.jumpToSessionDir":"現在のセッションディレクトリへ移動","filebrowser.parentDir":"親ディレクトリ","filebrowser.rootSelect":"ルートディレクトリを切り替え(ホーム / 一時)","filebrowser.pathPlaceholder":"パスを入力(リアルタイムフィルタ / ジャンプ)","filebrowser.newFolder":"新規フォルダ","filebrowser.createBtn":"作成","filebrowser.uploadFile":"ファイルをアップロード","filebrowser.uploadToCurrentDir":"現在のディレクトリにアップロード","filebrowser.enterSubdirToUpload":"サブディレクトリに移動してからアップロードしてください","filebrowser.folderNamePlaceholder":"フォルダ名","filebrowser.uploadPendingTo":"「{name}」を現在のディレクトリにアップロード","filebrowser.enterSubdirFirst":"(先にサブディレクトリに移動してください)","filebrowser.upload":"アップロード","filebrowser.savedToDownloads":"「{name}」を「ダウンロード」フォルダに保存しました。ファイルマネージャーで確認できます","filebrowser.noMatches":"一致するファイルまたはディレクトリがありません","filebrowser.tooMany":"合計 {total} 件、最初の {shown} 件のみ表示——パス欄にキーワードを入力してフィルタできます","filebrowser.previewUnsupported":"このファイルタイプのプレビューはサポートされていません。右のボタンでダウンロードできます","filebrowser.copyAbsPath":"絶対パスをコピー","filebrowser.download":"ダウンロード","filebrowser.pickThisDir":"このディレクトリを選択 {path}","filebrowser.downloadConfirm":"{name} をダウンロードしますか?","filemanager.files":"ファイル","filemanager.closeTab":"タブを閉じる","filemanager.minimize":"最小化","filemanager.recent":"最近","filemanager.directory":"ディレクトリ","git.errReadRepo":"リポジトリを読み込めませんでした","git.errLoad":"読み込みに失敗しました","git.errNoRepoInDir":"このディレクトリに git リポジトリがありません","git.errReadDir":"ディレクトリを読み込めませんでした","git.commitDetail":"コミット詳細","git.diff":"差分","git.bindRepo":"リポジトリを紐付け","git.collapse":"折りたたむ","git.currentBranch":"現在のブランチ","git.switchViewedBranch":"表示するブランチを切り替え","git.switchBranch":"ブランチを切り替え","git.noBranches":"ブランチがありません","git.noRepoBound":"リポジトリが紐付けられていません。左上の「+」をタップしてディレクトリを選択してください。","git.changes":"変更","git.commits":"コミット","git.pullToLoadMore":"引っ張ってさらに読み込む","git.pickerHint":"ディレクトリを選択すると、その中の git リポジトリを自動的に検索します","git.cleanTree":"ワーキングツリーはクリーンです","git.noCommits":"コミットがありません","git.noDiff":"差分なし","git.fontSmaller":"フォントを縮小","git.fontLarger":"フォントを拡大","git.diffTruncated":"差分が大きすぎるため、切り捨てられました","cmd.panel":"コマンドパネル","cmd.title":"コマンド","cmd.empty":"コマンドがありません。送信するか、よく使うものを保存してください","cmd.favorites":"お気に入り","cmd.scopeGlobal":"グローバル · 全セッション","cmd.recent":"最近","cmd.scopeSession":"このセッションのみ","cmd.favorite":"お気に入りに追加","cmd.unfavorite":"お気に入りから削除","doc.home":"最近","doc.read":"読み上げ","doc.pauseRead":"一時停止","doc.resumeRead":"再開","doc.stopRead":"読み上げを停止","doc.rate":"読み上げ速度","doc.fontSmaller":"フォントを縮小","doc.fontLarger":"フォントを拡大","inbox.view.working":"進行中","inbox.view.done":"完了","inbox.view.needs":"要対応","push.unsupported":"プッシュ通知には Chrome または Safari が必要です","push.iosAddToHome":"iOS では先にこのサイトを「ホーム画面に追加」し、ホーム画面のアイコンから開いてください","push.permissionDenied":"通知の権限が拒否されました","push.noVapid":"サーバーにプッシュ通知(VAPID)が設定されていません","push.subscribeFailed":"サブスクリプションの登録に失敗しました","push.sendFailed":"送信に失敗しました","api.loadFailed":"読み込みに失敗しました","api.uploadFailed":"アップロードに失敗しました","api.uploadBadDir":"そのディレクトリへはアップロードできません","api.uploadDuplicate":"同名のファイルが既に存在します","api.uploadTooLarge":"ファイルが大きすぎます(上限 50MB)","api.uploadBadType":"サポートされていないファイルタイプです","time.secAgo":"{n}秒前","time.minAgo":"{n}分前","time.hourAgo":"{n}時間前","time.dayAgo":"{n}日前","time.expired":"期限切れ","time.minutes":"{n} 分"},Yv={"common.save":"저장","common.cancel":"취소","common.confirm":"확인","common.ok":"확인","common.close":"닫기","common.delete":"삭제","common.rename":"이름 변경","common.create":"새로 만들기","common.back":"뒤로","common.open":"열기","common.loading":"로드 중…","common.done":"완료","token.title":"액세스 토큰이 필요합니다","token.placeholder":"HANDMUX_TOKEN 붙여넣기","settings.language":"언어","home.empty":"열린 파일이 없습니다","home.emptyHint":"「새로 만들기」 탭에서 파일을 선택하세요","home.remove":"제거","drawer.empty":"연결된 세션이 없습니다","drawer.unbind":"연결 해제","drawer.bind":"세션 연결","drawer.logout":"로그아웃","windowbar.newWindow":"새 창","rename.new_name":"새 이름","rename.name_placeholder":"짧은 이름","rename.name_rule":"영문자, 숫자, 하이픈만 사용 가능(≤16자)","rename.failed":"이름 변경에 실패했습니다. 다시 시도하세요","rename.saving":"저장 중…","newwindow.title":"새 창","newwindow.window_name":"창 이름(선택 사항)","newwindow.name_placeholder":"비워두면 자동 이름 지정","newwindow.name_rule":"영문자, 숫자, 하이픈만 사용 가능(≤16자)","newwindow.start_dir":"시작 디렉토리","newwindow.session_dir_named":"{dir}(세션 디렉토리)","newwindow.session_dir_default":"세션 디렉토리(기본값)","newwindow.choose":"선택","newwindow.reset_to_session_dir":"세션 디렉토리로 초기화","newwindow.creating":"생성 중…","startup.label":"시작 명령(선택 사항)","startup.aria":"시작 명령","startup.preset_shell":"빈 셸(기본값)","startup.preset_claude":"claude(Claude Code 시작)","startup.preset_claude_continue":"claude -c(이전 세션 이어서)","startup.custom":"사용자 정의…","startup.custom_placeholder":'예:claude "로그인 버그 수정"',"bind.title":"세션 연결","bind.sessionName":"세션 이름","bind.namePlaceholder":"짧은 이름","bind.bind":"연결","bind.checking":"확인 중…","bind.createAndOpen":"생성 후 열기","bind.creating":"생성 중…","bind.createHint":"세션「{name}」이 존재하지 않습니다. 「생성 후 열기」를 탭하여 생성하세요","bind.alreadyBound":"이미 연결된 세션입니다","bind.createFailed":"생성에 실패했습니다. 다시 시도하세요","bind.invalidName":"영문자, 숫자, 하이픈만 사용 가능(≤16자)","bind.checkFailed":"확인에 실패했습니다. 다시 시도하세요","bind.startDir":"시작 디렉토리","bind.homeDirDefault":"홈 디렉토리(기본값)","bind.choose":"선택","bind.reset":"초기화","actionsheet.confirmAgain":"확인하시겠습니까? 한 번 더 탭하세요","dirpicker.title":"디렉토리 선택","inbox.title":"받은 편지함","inbox.working":"진행 중","inbox.done":"완료","inbox.needs":"확인 필요","inbox.clearDone":"완료 항목 지우기","inbox.empty":"패널 상태 없음","inbox.enableTitle":"Claude Code 알림 활성화","inbox.enableHint":"각 Claude 패널을 「진행 중」「확인 필요」「완료」로 표시하고, 확인이 필요할 때 푸시 알림을 보냅니다.","inbox.enableBtn":"활성화","inbox.enabling":"활성화 중…","inbox.enableFailed":"활성화에 실패했습니다——서버 로그를 확인하세요.","idea.title":"아이디어","idea.editPlaceholder":"아이디어 편집…","idea.addPlaceholder":"아이디어를 기록하세요…","idea.add":"추가","idea.empty":"아직 아이디어가 없습니다. 하나 기록해보세요","idea.dragSort":"드래그하여 정렬","idea.fillInput":"입력창에 삽입","idea.send":"보내기","doclink.title":"파일 열기","changelog.title":"새 기능","preview.dynamic":"동적 미리보기","preview.static":"정적 미리보기","preview.remainTitle":"남은 유효 기간 — 탭하여 갱신 / 중지","preview.toPcView":"PC 보기로 전환","preview.toMobileView":"모바일 보기로 전환","preview.pcView":"PC 보기","preview.mobileView":"모바일 보기","preview.refresh":"새로 고침","preview.minimize":"최소화","preview.ttlDialog":"미리보기 유효 기간","preview.renew":"갱신(1시간으로 초기화)","preview.stop":"미리보기 중지","preview.iframeTitle":"미리보기","preview.zoomOut":"축소","preview.zoomIn":"확대","imageviewer.loadFailed":"이미지를 불러오지 못했습니다","imageviewer.saved":"저장되었습니다. 사진 앱 또는 「다운로드」에서 확인할 수 있습니다","imageviewer.shareUnsupported":"이미지 공유는 Chrome 또는 Safari가 필요합니다","imageviewer.zoomOut":"축소","imageviewer.zoomIn":"확대","imageviewer.imageTitle":"이미지","imageviewer.saveImage":"이미지 저장","imageviewer.shareImage":"이미지 공유","mic.stop":"음성 입력 중지","mic.start":"음성 입력","dock.send":"보내기","dock.send.hint":"탭하여 보내기 · 길게 눌러 삽입","dock.phrases":"자주 쓰는 문구","dock.input.placeholder":"메시지를 입력하세요…","dock.upload.aria":"파일 업로드","dock.upload.title":"파일 업로드(홈 업로드 폴더에 저장, 프로젝트에는 포함되지 않음)","dock.upload.progress":"{name}{tag} 업로드 중","dock.upload.failed":"업로드 실패:{names}","app.nameExists":"해당 이름은 이미 사용 중입니다","app.renameFailed":"이름 변경에 실패했습니다. 다시 시도하세요","app.deleteFailed":"삭제에 실패했습니다. 다시 시도하세요","app.moveFailed":"이동에 실패했습니다. 다시 시도하세요","app.sessionGone":"세션「{name}」이 존재하지 않습니다. 이미 닫혔을 수 있습니다","app.docNotFound":"파일이 존재하지 않습니다","app.docTooLarge":"파일이 너무 큽니다(2MB 초과)","app.docUnsupported":"지원되지 않는 파일 또는 경로","app.docOpenFailed":"열기에 실패했습니다. 다시 시도하세요","app.preview":"미리보기","app.openPreview":"미리보기 열기","app.ideas":"아이디어","app.files":"파일","app.settings":"설정","app.renameSession":"세션 이름 변경","app.renameWindow":"창 이름 변경","app.moveLeft":"◀ 왼쪽으로 이동","app.moveRight":"오른쪽으로 이동 ▶","app.deleteWindow":"창 삭제","app.deleteLastWindowConfirm":"마지막 창입니다. 삭제하면 전체 세션이 닫힙니다!한 번 더 탭하세요","app.deleteConfirm":"삭제하시겠습니까? 한 번 더 탭하세요","app.cannotLocate":"위치를 찾을 수 없습니다","app.pickItsDir":",디렉토리를 선택하세요:","app.noBoundSession":"연결된 세션이 없습니다","app.tapToBind":"탭하여 연결","app.selectSessionHint":"왼쪽 상단의 ☰ 를 탭하여 세션 선택","settings.title":"설정","settings.group_global":"전체 설정","settings.font_size":"글꼴 크기","settings.font_decrease":"글꼴 축소","settings.font_increase":"글꼴 확대","settings.font_auto":"자동 조정","settings.font_auto_title":"높이에 맞게 자동 조정","settings.whats_new":"새 기능","settings.view_changelog":"변경 내역 보기","settings.has_update":"업데이트 있음","settings.push_notifications":"푸시 알림","settings.notify_on":"활성화됨 ✓","settings.notify_enable":"기기 알림 활성화","settings.notify_enabled":"활성화되었습니다. 환영 알림이 도착할 것입니다","settings.notify_disabled":"비활성화됨","settings.notify_failed":"작업에 실패했습니다","settings.processing":"처리 중","settings.push_hint":"「확인 필요」및「완료」를 모니터링:관심 세션에서 승인/응답이 필요하거나 한 라운드가 완료되면 이 기기로 알림을 보냅니다.","settings.push_unsupported":"푸시 알림은 Chrome 또는 Safari가 필요합니다","settings.group_session":"현재 세션 설정","settings.screen_cols":"화면 열 수","settings.cols_dec":"감소","settings.cols_dec_title":"열 수 감소","settings.cols_inc":"증가","settings.cols_inc_title":"열 수 증가","settings.cols_restore":"기본값","settings.cols_restore_title":"창 기본 크기로 복원","settings.preview_site":"미리보기 사이트","settings.preview_static_site":"정적 사이트 미리보기","settings.preview_running_dynamic":"동적 미리보기 실행 중","settings.preview_running_static":"정적 미리보기 실행 중","settings.preview_remain_title":"남은 유효 기간","settings.preview_remain":"남은 시간 {time}","settings.preview_renew":"갱신","settings.preview_confirm_stop":"중지 확인","settings.preview_stop":"중지","settings.preview_name":"이름:{name}","settings.preview_port":"(포트:{port})","settings.preview_type":"미리보기 유형","settings.preview_off":"비활성화","settings.preview_static":"정적","settings.preview_dynamic":"동적","settings.preview_off_hint":"미리보기가 비활성화되어 있습니다. 「정적」을 선택하여 시작하세요.","settings.preview_off_hint_both":"미리보기가 비활성화되어 있습니다. 「정적」또는「동적」을 선택하여 시작하세요.","settings.preview_dynamic_disabled":"동적 포트 미리보기가 비활성화되어 있습니다. 활성화하려면:와일드카드 미리보기 도메인(previewDomain, 예:*.example.com)을 게이트웨이로 지정하고 TLS 인증서를 설정하세요. Cloudflare /자체 서명 인증서 차이는 README를 참조하세요.","settings.preview_pick_dir":"디렉토리를 선택하여 시작","settings.preview_static_hint":"index.html이 포함된 디렉토리를 선택하여 스마트폰에서 미리보기.","settings.preview_port_placeholder":"포트 번호(예:3000)","settings.preview_port_label":"포트","settings.preview_starting":"시작 중…","settings.preview_start":"시작","settings.preview_dynamic_hint":"로컬에서 실행 중인 포트(dev 서버 / 백엔드)를 입력하면 스마트폰에서 서브도메인을 통해 직접 접속할 수 있습니다.","settings.dir_picker_hint":"미리볼 정적 사이트 디렉토리 선택(index.html 포함)","settings.err_port_not_listening":"해당 포트가 수신 대기 중이지 않습니다. 서비스가 시작되었는지 확인하세요","settings.err_bad_port":"포트 번호가 유효하지 않습니다(1–65535)","settings.err_dynamic_disabled":"동적 미리보기가 비활성화되어 있습니다","settings.err_start_failed":"시작에 실패했습니다","filebrowser.openDirFailed":"디렉토리를 열 수 없습니다","filebrowser.copiedPath":"경로가 복사되었습니다:{abs}","filebrowser.mkdirFailed":"디렉토리 생성에 실패했습니다(이름이 유효하지 않거나 이미 존재합니다)","filebrowser.downloading":"{name} 다운로드 중","filebrowser.downloadFailed":"다운로드에 실패했습니다","filebrowser.uploading":"{name}{tag} 업로드 중","filebrowser.uploadFailed":"업로드에 실패했습니다","filebrowser.uploadPartialFailed":"다음 파일 업로드에 실패했습니다:{names}","filebrowser.sessionDir":"세션 디렉토리","filebrowser.jumpToSessionDir":"현재 세션 디렉토리로 이동","filebrowser.parentDir":"상위 디렉토리","filebrowser.rootSelect":"루트 디렉토리 전환(홈 / 임시)","filebrowser.pathPlaceholder":"경로 입력(실시간 필터 / 이동)","filebrowser.newFolder":"새 폴더","filebrowser.createBtn":"생성","filebrowser.uploadFile":"파일 업로드","filebrowser.uploadToCurrentDir":"현재 디렉토리에 업로드","filebrowser.enterSubdirToUpload":"하위 디렉토리로 이동한 후 업로드하세요","filebrowser.folderNamePlaceholder":"폴더 이름","filebrowser.uploadPendingTo":"「{name}」을 현재 디렉토리에 업로드","filebrowser.enterSubdirFirst":"(먼저 하위 디렉토리로 이동하세요)","filebrowser.upload":"업로드","filebrowser.savedToDownloads":"「{name}」이 「다운로드」 폴더에 저장되었습니다. 파일 관리자에서 확인할 수 있습니다","filebrowser.noMatches":"일치하는 파일 또는 디렉토리가 없습니다","filebrowser.tooMany":"총 {total}개, 처음 {shown}개만 표시——경로 입력창에 키워드를 입력하여 필터할 수 있습니다","filebrowser.previewUnsupported":"이 파일 유형의 미리보기는 지원되지 않습니다. 오른쪽 버튼으로 다운로드할 수 있습니다","filebrowser.copyAbsPath":"절대 경로 복사","filebrowser.download":"다운로드","filebrowser.pickThisDir":"이 디렉토리 선택 {path}","filebrowser.downloadConfirm":"{name}을 다운로드하시겠습니까?","filemanager.files":"파일","filemanager.closeTab":"탭 닫기","filemanager.minimize":"최소화","filemanager.recent":"최근","filemanager.directory":"디렉토리","git.errReadRepo":"저장소를 읽을 수 없습니다","git.errLoad":"불러오기에 실패했습니다","git.errNoRepoInDir":"이 디렉토리에 git 저장소가 없습니다","git.errReadDir":"디렉토리를 읽을 수 없습니다","git.commitDetail":"커밋 상세","git.diff":"변경 사항","git.bindRepo":"저장소 연결","git.collapse":"접기","git.currentBranch":"현재 브랜치","git.switchViewedBranch":"표시할 브랜치 전환","git.switchBranch":"브랜치 전환","git.noBranches":"브랜치가 없습니다","git.noRepoBound":"저장소가 연결되지 않았습니다. 왼쪽 상단의 「+」를 탭하여 디렉토리를 선택하세요.","git.changes":"변경사항","git.commits":"커밋","git.pullToLoadMore":"당겨서 더 불러오기","git.pickerHint":"디렉토리를 선택하면 그 안의 git 저장소를 자동으로 찾습니다","git.cleanTree":"작업 트리가 깨끗합니다","git.noCommits":"커밋이 없습니다","git.noDiff":"변경 사항 없음","git.fontSmaller":"글꼴 축소","git.fontLarger":"글꼴 확대","git.diffTruncated":"변경 사항이 너무 커서 잘렸습니다","cmd.panel":"명령 패널","cmd.title":"명령","cmd.empty":"명령이 없습니다. 보내거나 자주 쓰는 것을 저장하세요","cmd.favorites":"즐겨찾기","cmd.scopeGlobal":"전체 · 모든 세션","cmd.recent":"최근","cmd.scopeSession":"현재 세션만","cmd.favorite":"즐겨찾기 추가","cmd.unfavorite":"즐겨찾기 해제","doc.home":"최근","doc.read":"읽어주기","doc.pauseRead":"읽기 일시 정지","doc.resumeRead":"읽기 재개","doc.stopRead":"읽기 중지","doc.rate":"읽기 속도","doc.fontSmaller":"글꼴 축소","doc.fontLarger":"글꼴 확대","inbox.view.working":"진행 중","inbox.view.done":"완료","inbox.view.needs":"확인 필요","push.unsupported":"푸시 알림은 Chrome 또는 Safari가 필요합니다","push.iosAddToHome":"iOS에서는 먼저 이 사이트를 「홈 화면에 추가」한 후 홈 화면 아이콘에서 열어주세요","push.permissionDenied":"알림 권한이 거부되었습니다","push.noVapid":"서버에 푸시 알림(VAPID)이 설정되지 않았습니다","push.subscribeFailed":"구독 등록에 실패했습니다","push.sendFailed":"전송에 실패했습니다","api.loadFailed":"불러오기에 실패했습니다","api.uploadFailed":"업로드에 실패했습니다","api.uploadBadDir":"해당 디렉토리에는 업로드할 수 없습니다","api.uploadDuplicate":"같은 이름의 파일이 이미 존재합니다","api.uploadTooLarge":"파일이 너무 큽니다(최대 50MB)","api.uploadBadType":"지원되지 않는 파일 유형입니다","time.secAgo":"{n}초 전","time.minAgo":"{n}분 전","time.hourAgo":"{n}시간 전","time.dayAgo":"{n}일 전","time.expired":"만료됨","time.minutes":"{n}분"},_u={zh:Gv,"zh-TW":Kv,en:__,ja:qv,ko:Yv},Zh=[{code:"zh",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"en",label:"English"},{code:"ja",label:"日本語"},{code:"ko",label:"한국어"}],m_="tw_lang";function Xv(e,t,i=_u){if(e&&i[e])return e;for(const r of t&&t.length?t:["en"]){const n=String(r).toLowerCase();if(i[n])return n;const d=n.split("-")[0];if(i[d])return d}return"en"}function Jv(e,t,i,r){let n=e&&e[i]!=null?e[i]:t&&t[i]!=null?t[i]:i;return r&&(n=n.replace(/\{(\w+)\}/g,(d,_)=>r[_]!=null?r[_]:`{${_}}`)),n}const Zv=()=>typeof navigator<"u"?navigator.languages||[navigator.language]:null,Qv=()=>{try{return localStorage.getItem(m_)}catch{return null}};let na=Xv(Qv(),Zv());function O(e,t){return Jv(_u[na],__,e,t)}function hc(){return na}function e0(e){if(!(!_u[e]||e===na)){try{localStorage.setItem(m_,e)}catch{}na=e,typeof location<"u"&&location.reload()}}const mu="tw_token",gu="tw_font",Da="tw_bound",g_="tw_last_session",v_="tw_win",w_="tw_pane",vu="tw_favs",An="tw_recent",t0=30,dc="tw_inbox_seen",y_="tw_inbox_read_ts",S_="tw_browse_dir",b_="tw_preview_dir",C_="tw_startup_cmd",Ur="tw_ideas",x_="tw_changelog_seen",wu="tw_git_repos",Xr=()=>localStorage.getItem(mu),i0=e=>localStorage.setItem(mu,e),r0=()=>localStorage.removeItem(mu);function Wr(){try{return JSON.parse(localStorage.getItem(Da))||[]}catch{return[]}}function s0(e){const t=Wr();return t.includes(e)||t.push(e),localStorage.setItem(Da,JSON.stringify(t)),t}function Qh(e){const t=Wr().filter(i=>i!==e);return localStorage.setItem(Da,JSON.stringify(t)),t}function n0(e,t){const i=Wr().map(d=>d===e?t:d);localStorage.setItem(Da,JSON.stringify(i));const r=jt(An);r[e]!=null&&(r[t]=r[e],delete r[e],localStorage.setItem(An,JSON.stringify(r)));const n=jt(Ur);return n[e]!=null&&(n[t]=n[e],delete n[e],localStorage.setItem(Ur,JSON.stringify(n))),i}function jt(e){try{return JSON.parse(localStorage.getItem(e))||{}}catch{return{}}}function Hi(e,t,i){const r=jt(e);r[t]=i,localStorage.setItem(e,JSON.stringify(r))}const ed=()=>jt(dc);function td(e,t){return Hi(dc,e,t),jt(dc)}const o0=()=>{const e=localStorage.getItem(y_);return e==null?null:Number(e)},id=e=>localStorage.setItem(y_,String(e)),a0=e=>e?jt(S_)[e]??null:null,al=(e,t)=>{e&&t&&Hi(S_,e,t)},l0=e=>e?jt(b_)[e]??null:null,c0=(e,t)=>{e&&t&&Hi(b_,e,t)},u0=()=>localStorage.getItem(g_),h0=e=>jt(v_)[e]??null,co=e=>jt(w_)[e]??null;function Vs({sessionId:e,windowId:t,paneId:i}={}){e&&localStorage.setItem(g_,e),e&&t&&Hi(v_,e,t),t&&i&&Hi(w_,t,i)}function d0(){const e=Number(localStorage.getItem(gu));return Number.isFinite(e)&&e>0?e:null}const rd=e=>localStorage.setItem(gu,String(e)),f0=()=>localStorage.removeItem(gu);function oa(){try{return JSON.parse(localStorage.getItem(vu))||[]}catch{return[]}}function p0(e){const t=e.trim(),i=oa();return t&&!i.includes(t)&&i.push(t),localStorage.setItem(vu,JSON.stringify(i)),i}function _0(e){const t=oa().filter(i=>i!==e);return localStorage.setItem(vu,JSON.stringify(t)),t}const k_=()=>localStorage.getItem(C_)||"",E_=e=>localStorage.setItem(C_,e||""),yu=e=>jt(An)[e]??[];function m0(e,t){const i=t.trim(),r=yu(e);if(!i)return r;const n=[i,...r.filter(d=>d!==i)].slice(0,t0);return Hi(An,e,n),n}function g0(e,t){const i=yu(e).filter(r=>r!==t);return Hi(An,e,i),i}const Su="tw_recent_docs",L_="tw_pane_base",v0=30;function aa(){try{return JSON.parse(localStorage.getItem(Su))||[]}catch{return[]}}function sd({path:e,name:t,type:i,ts:r=Date.now()}){const n=[{path:e,name:t,type:i,ts:r},...aa().filter(d=>d.path!==e)].slice(0,v0);return localStorage.setItem(Su,JSON.stringify(n)),n}function w0(e){const t=aa().filter(i=>i.path!==e);return localStorage.setItem(Su,JSON.stringify(t)),t}const nd=e=>jt(L_)[e]??null,y0=(e,t)=>Hi(L_,e,t),Qi=[10,11,12,13,14,16,18,20,22],S0=4,R_="tw_doc_font";function b0(){const e=localStorage.getItem(R_),t=Number(e);return e!==null&&Number.isInteger(t)&&t>=0&&t<Qi.length?t:S0}const C0=e=>localStorage.setItem(R_,String(Math.min(Qi.length-1,Math.max(0,e)))),x0=2,T_="tw_diff_font";function k0(){const e=localStorage.getItem(T_),t=Number(e);return e!==null&&Number.isInteger(t)&&t>=0&&t<Qi.length?t:x0}const E0=e=>localStorage.setItem(T_,String(Math.min(Qi.length-1,Math.max(0,e))));function D_(e,t){var i;return!e||!t?[]:((i=jt(Ur)[e])==null?void 0:i[t])??[]}function od(e,t,i){if(!e||!t)return[];const r=jt(Ur),n=r[e]||{};return i&&i.length?n[t]=i:delete n[t],Object.keys(n).length?r[e]=n:delete r[e],localStorage.setItem(Ur,JSON.stringify(r)),i??[]}const L0=()=>localStorage.getItem(x_),R0=e=>{e&&localStorage.setItem(x_,e)};function T0(e,t,i){if(!e||!t||!i||t===i)return;const r=jt(Ur),n=r[e];!n||n[t]==null||(n[i]=n[t],delete n[t],localStorage.setItem(Ur,JSON.stringify(r)))}function bu(e){if(!e)return[];const t=jt(wu)[e];return Array.isArray(t)?t:[]}function ad(e,t){if(!e)return[];const i=[...bu(e)];for(const r of t)r&&!i.includes(r)&&i.push(r);return Hi(wu,e,i),i}function D0(e,t){if(!e)return[];const i=bu(e).filter(r=>r!==t);return Hi(wu,e,i),i}const A_=[{v:"2026-06-28-i18n-ui",date:"2026-06-28",items:{zh:["新增繁体中文、日语、韩语界面(设置 → Language 切换)","想法角标:有未完成想法时,灯泡图标右上角显示数量","设置面板列数调节:实时显示当前列数,新增 ±1 精细调节按钮"],en:["Added Traditional Chinese, Japanese, and Korean UI (Settings → Language to switch)","Idea badge: when there are pending ideas, the lightbulb icon shows a count in the corner","Settings column control: shows the current column count live, with new ±1 fine-adjust buttons"]}},{v:"2026-06-20-claude-hooks",date:"2026-06-20",items:{zh:["收件箱:第一次打开若还没接上 Claude Code 通知,会引导你一键开启——开了之后每个 Claude pane 才会标注「进行中 / 需要你 / 已完成」并在需要你时推送。没装 Claude Code 则不打扰。"],en:["Inbox: the first time you open it without Claude Code notifications wired up, it walks you through turning them on with one tap — only then does each Claude pane get tagged working / needs you / done and push when it needs you. If you don't use Claude Code, it stays out of your way."]}},{v:"2026-06-19-logo",date:"2026-06-19",items:{zh:["全新 App 图标:一部手机正向外发射信号、屏上是跳动的终端光标——「在手中,随处续写」的 handmux。重新添加到主屏即可看到新图标。","文件:除了主目录,现在还能进系统临时目录 /tmp 和 $TMPDIR 查看 / 上传 / 下载文件——路径栏最前面那个固定的 ~ 前缀改成了下拉,点一下即可在 家目录 / tmp / TMPDIR 之间切换。临时文件不用先挪进主目录了。","文件:打开文件特别多的目录更快了(不再逐个等文件信息),且最多只渲染前 300 项、其余在底部提示「在路径框输入关键词筛选」——既不卡也好找。","目录选择器:新建窗口、定位文档基准目录时多了「跳到会话目录」按钮;查看类的选择框(Git 绑定、网站预览)不再显示「新建文件夹」——选目录就只选,不误操作。","文件:返回键改为逐层返回——正在预览文件时,返回先回到该文件所在的目录;在目录里则返回上一级路径;到顶层才退出文件面板,不再一下子整个关掉。","文件:.txt / .log / .sh 现在也能像 Markdown 一样直接在应用内预览(原样等宽显示、可 A−/A+ 调字号),终端里这些路径也可点开。"],en:['New app icon: a phone beaming your live session outward, a blinking terminal cursor on its screen — handmux, "in your hand, anywhere." Re-add to your home screen to see it.',"Files: beyond your home dir, you can now browse / upload / download in the system temp dirs /tmp and $TMPDIR — the fixed ~ prefix at the start of the path bar is now a dropdown to switch between home / tmp / TMPDIR. No need to move transient files into home first.",'Files: very full directories open much faster (no more waiting on each file one by one), and at most the first 300 rows render — the rest are summarized at the bottom with "type in the path box to filter," so it neither lags nor overwhelms.',`Directory pickers: a "jump to session dir" button now shows when creating a new window or locating a document's base dir; view-type pickers (Git bind, website preview) no longer show "new folder" — picking a dir just picks, nothing to misfire.`,"Files: Back now steps back one level — while previewing a file it returns to that file's folder; inside a folder it returns to the previous path; only at the top does it close the file panel, instead of dismissing the whole thing at once.","Files: .txt / .log / .sh files now preview in-app just like Markdown (shown verbatim in monospace, with A−/A+ font sizing), and such paths are tappable in the terminal."]}},{v:"2026-06-18",date:"2026-06-18",items:{zh:["新增「Git」面板(顶栏图标):仿 VS Code,一页同屏——「变更」在上、「提交」占据主区(默认 20 条、滚到底自动续),两区都可折叠;顶部单独一行——左显示当前分支,右侧下拉可切换查看任意分支的提交历史(只读,不会 checkout、不动你的工作树)。点文件或某次提交看全屏彩色 diff(右上角 A−/A+ 可调字体大小,设置会记住)。可绑定多个目录(前后端分仓)用顶部 tab 切换,每个窗口各自一套。只读,不影响仓库。","图片查看:双指捏合缩放、放大后单指拖动、双击放大/复位(也有 +/− 按钮兜底);长按图片可「保存图片 / 分享图片」。","在设置 / 想法 / 收件箱 / 会话抽屉 / 常用命令等各面板里,手机返回键现在是「退回上一层」而不是直接退出应用。"],en:[`New "Git" panel (top-bar icon): VS Code style, all on one screen — "Changes" on top, "Commits" filling the main area (20 by default, auto-loads more on scroll), both sections collapsible; a dedicated top row shows the current branch on the left, with a dropdown on the right to view any branch's commit history (read-only — never checks out or touches your working tree). Tap a file or commit for a full-screen colored diff (A−/A+ in the top-right adjusts font size, remembered in settings). You can bind multiple directories (separate front/back-end repos) and switch via top tabs, each window with its own set. Read-only, never affects the repo.`,'Image viewer: pinch to zoom, one-finger drag when zoomed, double-tap to zoom/reset (with +/− buttons as a fallback); long-press an image to "Save image / Share image".','Across Settings / Ideas / Inbox / session drawer / frequent commands and other panels, the phone Back button now "goes back one level" instead of exiting the app outright.']}},{v:"2026-06-17-image-viewer",date:"2026-06-17",items:{zh:["网站预览:选目录预览静态站点,或填端口预览本机正在跑的服务(动态预览走专属子域名,前端路由/接口/HMR 一致)。预览在应用内弹窗打开,可切手机/电脑视图并整体缩放,链接 1 小时有效、可续期。","图片预览:在「文件」或终端里点图片(含 GIF)直接内嵌打开。","新增「想法」管理器(顶栏灯泡):按窗口记待办,可编辑、拖拽排序、一键填入、语音输入;更新日志有新功能时齿轮亮红点。"],en:["Website preview: pick a directory to preview a static site, or enter a port to preview a service running locally (dynamic preview uses a dedicated subdomain, keeping front-end routing/API/HMR consistent). Preview opens in an in-app popup, can switch between phone/desktop views and zoom the whole page; links are valid for 1 hour and renewable.",'Image preview: tap an image (including GIFs) in "Files" or the terminal to open it inline.','New "Ideas" manager (top-bar lightbulb): keep to-dos per window — edit, drag to reorder, one-tap insert, voice input; the gear lights a red dot when the changelog has new features.']}},{v:"2026-06-16-upload-tts",date:"2026-06-16",items:{zh:["聊天框 + 号上传文件,支持多选,自动填入路径","斜杠命令快捷键:/loop、/skill","文档语音朗读(浏览器 TTS,逐句高亮跟读)"],en:["Upload files via the + button in the chat box — multi-select supported, paths auto-filled in","Slash-command shortcuts: /loop, /skill","Read documents aloud (browser TTS, with sentence-by-sentence highlight follow-along)"]}},{v:"2026-06-15-files",date:"2026-06-15",items:{zh:["文件浏览器每个文件加「复制绝对路径」按钮","终端长按选择加拖动引导,不再只复制到一个词","文档目录改用浏览选择,不用手输路径"],en:['Added a "Copy absolute path" button to each file in the file browser',"Long-press selection in the terminal now has a drag guide — no longer copies just a single word","Pick the docs directory by browsing instead of typing the path by hand"]}},{v:"2026-06-14-input-bar",date:"2026-06-14",items:{zh:["微信式点按语音输入:按一下开始听写、再按停止;录音整框变绿+呼吸动效","输入栏改造:输入框满宽、框内发送 ↑、⌫/⏎ 移到按键区右端","命令面板嵌入输入框左侧,「常用/最近」分区","新建窗口/会话可选启动命令,在指定目录自动跑(如 claude)"],en:["WeChat-style tap-to-talk voice input: tap once to start dictation, tap again to stop; the whole box turns green with a breathing animation while recording","Input bar redesign: full-width input field, in-box send ↑, with ⌫/⏎ moved to the right end of the key bar",'Command panel embedded on the left of the input field, with "Frequent/Recent" sections',"New windows/sessions can take an optional startup command that auto-runs in the chosen directory (e.g. claude)"]}},{v:"2026-06-13-file-transfer",date:"2026-06-13",items:{zh:["文件上传/下载:进度条、下载需确认","系统分享到本应用并选位置上传(Android)","文件浏览器打开即落到当前会话目录"],en:["File upload/download: progress bar, downloads require confirmation","Share into this app from the system and pick an upload location (Android)","The file browser opens straight to the current session directory"]}},{v:"2026-06-12-cursor",date:"2026-06-12",items:{zh:["终端光标精确摆到 Claude 真实位置(reflow 安全)","加回终端滚动惯性(横竖两轴)"],en:["Terminal cursor placed precisely at Claude Code's real position (reflow-safe)","Restored terminal scroll inertia (both horizontal and vertical axes)"]}},{v:"2026-06-11-inbox",date:"2026-06-11",items:{zh:["收件箱:顶栏汇总「进行中/已完成/需要你」各几个","窗口标签加 Claude 状态色点(需要你=红/进行中=蓝/已完成=绿)","推送两态可靠优先:需要你 4h、已完成只在完成那刻推"],en:['Inbox: the top bar summarizes how many are "In progress / Done / Needs you"',"Window tabs get a Claude status color dot (Needs you = red / In progress = blue / Done = green)",'Two-state push, reliability first: "Needs you" for 4h, "Done" pushed only at the moment it completes']}},{v:"2026-06-10-docs",date:"2026-06-10",items:{zh:["文档查看器:Markdown 渲染、点终端里的路径即打开、字号缩放","Web Push:开启设备通知","KeyBar 扩展:/clear、/compact、/model、/btw"],en:["Document viewer: Markdown rendering, tap a path in the terminal to open it, font-size zoom","Web Push: enable device notifications","KeyBar additions: /clear, /compact, /model, /btw"]}},{v:"2026-06-09-reorder",date:"2026-06-09",items:{zh:["从管理菜单拖动重排窗口(◀ 左移 / 右移 ▶)"],en:["Reorder windows by dragging from the manage menu (◀ move left / move right ▶)"]}},{v:"2026-06-06-manage",date:"2026-06-06",items:{zh:["长按窗口标签管理:重命名 / 删除","重命名会话/窗口(本地名与历史一并迁移)"],en:["Long-press a window tab to manage it: rename / delete","Rename sessions/windows (local name and history migrated along with it)"]}},{v:"2026-06-05-sessions",date:"2026-06-05",items:{zh:["从绑定弹窗新建会话","+ 新建窗口(可命名)","离线兜底页:断网冷启动也有可重试页面"],en:["Create a new session from the binding popup","+ to create a new window (nameable)","Offline fallback page: a retryable page even on a cold start with no network"]}},{v:"2026-06-03-reliability",date:"2026-06-03",items:{zh:["断线重连:退避 + 每请求超时 + 断线横幅,后台自动暂停轮询","命令面板:常用 + 每会话最近命令"],en:["Reconnect on disconnect: backoff + per-request timeout + a connection-lost banner, polling auto-paused in the background","Command panel: frequent commands + recent commands per session"]}},{v:"2026-06-02-pwa",date:"2026-06-02",items:{zh:["可添加到主屏(PWA 安装)","长按选择并复制终端文本","设置面板(列数/字体/退出)与本地会话列表"],en:["Add to home screen (PWA install)","Long-press to select and copy terminal text","Settings panel (columns/font/exit) and a local session list"]}},{v:"2026-06-01-first",date:"2026-06-01",items:{zh:["首版:手机浏览器驱动真实 tmux 面板","xterm 终端 + 会话/窗口/pane 导航 + 深链","移动按键区(方向键长按连发)、键盘自动抬升、历史浏览、列宽/字号调节"],en:["First release: a phone browser drives real tmux panes","xterm terminal + session/window/pane navigation + deep links","Mobile key bar (arrows auto-repeat on long-press), keyboard auto-lift, scrollback browsing, column-width/font-size adjustment"]}}];var ef;const uo=((ef=A_[0])==null?void 0:ef.v)??null,A0={jpg:"image/jpeg",jpeg:"image/jpeg",jfif:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",heic:"image/heic",heif:"image/heif",avif:"image/avif",tif:"image/tiff",tiff:"image/tiff",pdf:"application/pdf",txt:"text/plain",log:"text/plain",md:"text/markdown",markdown:"text/markdown",csv:"text/csv",json:"application/json",xml:"application/xml",html:"text/html",htm:"text/html",zip:"application/zip",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};function Aa(e){const t=(e||"").lastIndexOf(".");return t<0?"":A0[e.slice(t+1).toLowerCase()]||""}function M0(e){return Aa(e).startsWith("image/")}class it extends Error{}async function Ue(e,t={}){const i=Xr(),{timeoutMs:r,...n}=t,d={Authorization:`Bearer ${i??""}`,...n.headers||{}};n.body&&(d["Content-Type"]="application/json");let _=null,s=null;r&&(_=new AbortController,s=setTimeout(()=>_.abort(),r));try{const o=await fetch(e,{cache:"no-store",...n,headers:d,signal:_==null?void 0:_.signal});if(o.status===401)throw new it;if(!o.ok){let f=`${e} -> ${o.status}`;try{const g=await o.json();g!=null&&g.error&&(f=g.error)}catch{}throw new Error(f)}return o.status===204?{unchanged:!0}:await o.json()}catch(o){throw _!=null&&_.signal.aborted?new Error(`${e} -> timeout`):o}finally{s&&clearTimeout(s)}}const en=()=>Ue("/api/sessions"),Gs=e=>Ue(`/api/windows?session=${encodeURIComponent(e)}`),ho=e=>Ue(`/api/panes?window=${encodeURIComponent(e)}`),I0=(e,t=1500,i)=>Ue(`/api/history?pane=${encodeURIComponent(e)}&lines=${t}${i?`&since=${i}`:""}`,{timeoutMs:8e3}),fc=(e,t,i=!0)=>Ue("/api/send",{method:"POST",body:JSON.stringify({pane:e,text:t,enter:i})}),P0=(e,t)=>Ue("/api/keys",{method:"POST",body:JSON.stringify({pane:e,keys:t})}),O0=(e,t,i)=>Ue("/api/resize",{method:"POST",body:JSON.stringify({window:e,cols:t,rows:i})}),N0=(e,t)=>Ue("/api/resize",{method:"POST",body:JSON.stringify({pane:e,cols:t})}),B0=e=>Ue(`/api/layout?window=${encodeURIComponent(e)}`),j0=(e,t)=>Ue("/api/resize",{method:"POST",body:JSON.stringify({window:e,auto:!0,layout:t})}),F0=(e,t,i)=>Ue("/api/sessions",{method:"POST",body:JSON.stringify({name:e,cwd:t,cmd:i})}),H0=(e,t,i,r,n)=>Ue("/api/windows",{method:"POST",body:JSON.stringify({session:e,pane:t,name:i,cwd:r,cmd:n})}),z0=(e,t)=>Ue("/api/sessions",{method:"PATCH",body:JSON.stringify({id:e,name:t})}),$0=(e,t)=>Ue("/api/windows",{method:"PATCH",body:JSON.stringify({id:e,name:t})}),U0=e=>Ue(`/api/windows?window=${encodeURIComponent(e)}`,{method:"DELETE"}),W0=(e,t)=>Ue("/api/windows/swap",{method:"POST",body:JSON.stringify({a:e,b:t})}),V0=(e,t)=>Ue("/api/dir",{method:"POST",body:JSON.stringify({dir:e,name:t})}),G0=e=>Ue(`/api/file?path=${encodeURIComponent(e)}`,{timeoutMs:8e3}),M_=e=>Ue(`/api/dir${e?`?path=${encodeURIComponent(e)}`:""}`,{timeoutMs:8e3}),Vr=e=>Ue(`/api/pane-cwd?pane=${encodeURIComponent(e)}`,{timeoutMs:8e3}),K0=()=>Ue("/api/asr/sign",{timeoutMs:8e3}),I_=()=>Ue("/api/config",{timeoutMs:8e3}),q0=()=>Ue("/api/hooks/install",{method:"POST",timeoutMs:15e3}),Y0=(e=[])=>Ue(`/api/states?sessions=${encodeURIComponent(e.join(","))}`,{timeoutMs:4e3}),ld=e=>Ue(`/api/git/repos?dir=${encodeURIComponent(e)}`,{timeoutMs:8e3}),X0=e=>Ue(`/api/git/status?repo=${encodeURIComponent(e)}`,{timeoutMs:8e3}),J0=(e,{limit:t=50,ref:i}={})=>{let r=`/api/git/log?repo=${encodeURIComponent(e)}&limit=${t}`;return i&&(r+=`&ref=${encodeURIComponent(i)}`),Ue(r,{timeoutMs:8e3})},Z0=e=>Ue(`/api/git/branches?repo=${encodeURIComponent(e)}`,{timeoutMs:8e3}),Q0=(e,{path:t,commit:i,staged:r}={})=>{let n=`/api/git/diff?repo=${encodeURIComponent(e)}&path=${encodeURIComponent(t??"")}`;return i&&(n+=`&commit=${encodeURIComponent(i)}`),r&&(n+="&staged=1"),Ue(n,{timeoutMs:8e3})},ew=(e,t)=>Ue(`/api/git/commit?repo=${encodeURIComponent(e)}&hash=${encodeURIComponent(t)}`,{timeoutMs:8e3});function tw(e,t){return new Promise((i,r)=>{const n=Xr(),d=new XMLHttpRequest;d.open("GET",`/api/download?path=${encodeURIComponent(e)}`),d.setRequestHeader("Authorization",`Bearer ${n??""}`),d.responseType="blob",d.onprogress=_=>{t&&_.lengthComputable&&t(_.loaded/_.total)},d.onerror=()=>r(new Error("download failed")),d.onload=()=>{if(d.status===401)return r(new it);if(d.status<200||d.status>=300)return r(new Error(`download -> ${d.status}`));const _=e.split("/").pop()||"download";let s=d.response;const o=Aa(_);o&&s&&s.type!==o&&(s=s.slice(0,s.size,o));const f=URL.createObjectURL(s),g=document.createElement("a");g.href=f,g.download=_,document.body.appendChild(g),g.click(),g.remove(),setTimeout(()=>URL.revokeObjectURL(f),1e3),i()},d.send()})}function iw(e){return new Promise((t,i)=>{const r=Xr(),n=new XMLHttpRequest;n.open("GET",`/api/download?path=${encodeURIComponent(e)}`),n.setRequestHeader("Authorization",`Bearer ${r??""}`),n.responseType="blob",n.onerror=()=>i(new Error(O("api.loadFailed"))),n.onload=()=>{if(n.status===401)return i(new it);if(n.status<200||n.status>=300)return i(new Error(`image -> ${n.status}`));let d=n.response;const _=Aa(e.split("/").pop()||"");_&&d&&d.type!==_&&(d=d.slice(0,d.size,_)),t(URL.createObjectURL(d))},n.send()})}const cd=(e,t)=>{const i=encodeURIComponent(Xr()??"");return(e==null?void 0:e.kind)==="dynamic"?`https://${encodeURIComponent(e.name)}.${t}/?token=${i}`:`/preview/${encodeURIComponent(e==null?void 0:e.name)}/?token=${i}`},ll=(e,t={})=>Ue("/api/previews",{method:"POST",body:JSON.stringify(t.port!=null?{name:e,port:t.port}:{name:e,dir:t.dir})}),rw=()=>Ue("/api/previews"),sw=e=>Ue(`/api/previews/${encodeURIComponent(e)}`,{method:"DELETE"});function P_(e,t,i,r=!1){return new Promise((n,d)=>{const _=Xr(),s=new FormData;s.append("dir",e),r&&s.append("stash","1"),s.append("file",t,t.name);const o=new XMLHttpRequest;o.open("POST","/api/upload"),o.setRequestHeader("Authorization",`Bearer ${_??""}`),o.upload.onprogress=f=>{i&&f.lengthComputable&&i(f.loaded/f.total)},o.onerror=()=>d(new Error(O("api.uploadFailed"))),o.onload=()=>{if(o.status===401)return d(new it);if(o.status>=200&&o.status<300)try{return n(JSON.parse(o.responseText))}catch{return n({})}const f={400:O("api.uploadBadDir"),409:O("api.uploadDuplicate"),413:O("api.uploadTooLarge"),415:O("api.uploadBadType")}[o.status]||O("api.uploadFailed");d(new Error(f))},o.send(s)})}function ud(e){return String(e||"").replace(/[^A-Za-z0-9._-]+/g,"-").replace(/-{2,}/g,"-").replace(/^[-.]+|-+$/g,"").toLowerCase()}function nw({session:e,windowName:t,windowId:i}){const r=[e,t].map(ud).filter(Boolean);return r.push(ud(i)||"w"),r.join("-")}const Ye={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function Mn(){return C.jsx("svg",{...Ye,children:C.jsx("path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"})})}function ow(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"}),C.jsx("path",{d:"M12 10v6M9 13h6"})]})}function aw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z"}),C.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function lw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),C.jsx("path",{d:"M14 3v5h5"})]})}function cw(){return C.jsxs("svg",{...Ye,children:[C.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),C.jsx("circle",{cx:"9",cy:"9",r:"2"}),C.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}function O_(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M12 19V5"}),C.jsx("path",{d:"m5 12 7-7 7 7"})]})}function uw(){return C.jsxs("svg",{...Ye,children:[C.jsx("line",{x1:"2",x2:"5",y1:"12",y2:"12"}),C.jsx("line",{x1:"19",x2:"22",y1:"12",y2:"12"}),C.jsx("line",{x1:"12",x2:"12",y1:"2",y2:"5"}),C.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"}),C.jsx("circle",{cx:"12",cy:"12",r:"7"})]})}function In(){return C.jsx("svg",{...Ye,children:C.jsx("path",{d:"m6 9 6 6 6-6"})})}function N_(){return C.jsx("svg",{...Ye,children:C.jsx("path",{d:"M12 5v14M5 12h14"})})}function hw(){return C.jsx("svg",{...Ye,children:C.jsx("path",{d:"M20 6 9 17l-5-5"})})}function dw(){return C.jsxs("svg",{...Ye,children:[C.jsx("circle",{cx:"12",cy:"12",r:"9"}),C.jsx("path",{d:"M12 7v5l3 2"})]})}function fw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M9 18h6"}),C.jsx("path",{d:"M10 22h4"}),C.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"})]})}function pw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M22 12h-6l-2 3h-4l-2-3H2"}),C.jsx("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z"})]})}function _w(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M12 3v12"}),C.jsx("path",{d:"m7 10 5 5 5-5"}),C.jsx("path",{d:"M5 21h14"})]})}function mw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),C.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),C.jsx("path",{d:"M12 18v-6"}),C.jsx("path",{d:"m9 15 3-3 3 3"})]})}function gw(){return C.jsxs("svg",{...Ye,children:[C.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),C.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function vw(){return C.jsx("svg",{...Ye,children:C.jsx("path",{d:"M7 5l12 7-12 7z"})})}function ww(){return C.jsxs("svg",{...Ye,children:[C.jsx("line",{x1:"9",y1:"5",x2:"9",y2:"19"}),C.jsx("line",{x1:"15",y1:"5",x2:"15",y2:"19"})]})}function yw(){return C.jsx("svg",{...Ye,children:C.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Sw(){return C.jsxs("svg",{...Ye,children:[C.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),C.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),C.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"21"})]})}function pc(){return C.jsxs("svg",{...Ye,children:[C.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),C.jsx("path",{d:"M8 21h8M12 17v4"})]})}function bw(){return C.jsxs("svg",{...Ye,children:[C.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2"}),C.jsx("path",{d:"M12 18h.01"})]})}function Cw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),C.jsx("path",{d:"M21 3v5h-5"}),C.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),C.jsx("path",{d:"M3 21v-5h5"})]})}function B_(){return C.jsxs("svg",{...Ye,children:[C.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),C.jsx("circle",{cx:"18",cy:"6",r:"3"}),C.jsx("circle",{cx:"6",cy:"18",r:"3"}),C.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]})}function hd(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"M18 6 6 18"}),C.jsx("path",{d:"m6 6 12 12"})]})}function dd(){return C.jsx("svg",{...Ye,children:C.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}function xw(){return C.jsxs("svg",{...Ye,children:[C.jsx("path",{d:"m7 11 2-2-2-2"}),C.jsx("path",{d:"M11 13h4"}),C.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"})]})}const j_=e=>{if(e<=0)return O("time.expired");const t=Math.max(1,Math.round(e/6e4));return O("time.minutes",{n:t})};function F_(e,t=!0){const[i,r]=B.useState(()=>Date.now());return B.useEffect(()=>{if(!t||e==null)return;r(Date.now());const n=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(n)},[t,e]),e!=null?Math.max(0,e-i):0}const cl=1280,fd=6;function kw({open:e,name:t,kind:i="static",domain:r=null,port:n,dir:d,expiresAt:_,onRenew:s,onStop:o,onMinimize:f}){const[g,l]=B.useState(!1),[m,y]=B.useState("mobile"),[b,p]=B.useState(1),[a,h]=B.useState({w:0,h:0}),c=B.useRef(null),u=B.useRef(null);B.useEffect(()=>{e||l(!1)},[e]),B.useEffect(()=>{m==="mobile"&&p(1)},[m]),B.useEffect(()=>{const N=u.current;if(!e||!N)return;const $=()=>h({w:N.clientWidth,h:N.clientHeight});if($(),typeof ResizeObserver>"u")return;const U=new ResizeObserver($);return U.observe(N),()=>U.disconnect()},[e]);const v=F_(_,e),x=i==="dynamic"?n!=null?`:${n}`:"":d||"",S=m==="pc"&&a.w>0,k=a.w>0?a.w/cl:1,w=a.h>0?a.h/k:0,E=k*b,R=S?{width:`${cl*E}px`,height:`${w*E}px`}:void 0,I=S?{width:`${cl}px`,height:`${w}px`,transform:`scale(${E})`,transformOrigin:"0 0"}:void 0,T=N=>p($=>Math.min(fd,Math.max(1,+($+N).toFixed(2)))),D=()=>{const N=c.current;if(N)try{N.contentWindow.location.reload()}catch{N.src=N.src}};return Ta.createPortal(C.jsxs("div",{className:`file-sheet ${e?"open":""}`,"aria-hidden":!e,children:[C.jsxs("div",{className:"file-tabs preview-head",children:[C.jsxs("span",{className:"preview-status",children:[C.jsx(pc,{}),C.jsx("span",{className:"preview-state",children:O(i==="dynamic"?"preview.dynamic":"preview.static")}),t&&C.jsxs("span",{className:"preview-name",title:`${t}${x?" "+x:""}`,children:[t,x&&C.jsx("span",{className:"preview-detail",children:x})]})]}),C.jsx("button",{className:"preview-remain",title:O("preview.remainTitle"),"aria-haspopup":"dialog","aria-expanded":g,onClick:()=>l(N=>!N),children:j_(v)}),C.jsx("button",{className:"preview-iconbtn",onClick:()=>y(N=>N==="mobile"?"pc":"mobile"),"aria-label":O(m==="mobile"?"preview.toPcView":"preview.toMobileView"),title:O(m==="mobile"?"preview.pcView":"preview.mobileView"),"aria-pressed":m==="pc",children:m==="mobile"?C.jsx(pc,{}):C.jsx(bw,{})}),C.jsx("button",{className:"preview-iconbtn",onClick:D,"aria-label":O("preview.refresh"),title:O("preview.refresh"),children:C.jsx(Cw,{})}),C.jsx("button",{className:"file-min","aria-label":O("preview.minimize"),title:O("preview.minimize"),onClick:f,children:C.jsx(In,{})}),g&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"preview-pop-backdrop",onClick:()=>l(!1)}),C.jsxs("div",{className:"preview-pop",role:"dialog","aria-label":O("preview.ttlDialog"),children:[C.jsx("button",{className:"preview-pop-item",onClick:()=>{l(!1),s==null||s()},children:O("preview.renew")}),C.jsx("button",{className:"preview-pop-item preview-pop-danger",onClick:()=>{l(!1),o==null||o()},children:O("preview.stop")})]})]})]}),C.jsx("div",{className:`file-body preview-body ${S?"pc":""}`,ref:u,children:t&&S?C.jsx("div",{className:"preview-scaler",style:R,children:C.jsx("iframe",{ref:c,className:"preview-frame",title:O("preview.iframeTitle"),style:I,src:cd({name:t,kind:i},r)})}):t?C.jsx("iframe",{ref:c,className:"preview-frame",title:O("preview.iframeTitle"),src:cd({name:t,kind:i},r)}):null}),S&&C.jsxs("div",{className:"preview-zoom",children:[C.jsx("button",{className:"preview-zoom-btn",onClick:()=>T(-.5),disabled:b<=1,"aria-label":O("preview.zoomOut"),children:"−"}),C.jsxs("span",{className:"preview-zoom-val","aria-hidden":"true",children:[Math.round(b*100),"%"]}),C.jsx("button",{className:"preview-zoom-btn",onClick:()=>T(.5),disabled:b>=fd,"aria-label":O("preview.zoomIn"),children:"+"})]})]}),document.body)}const Ew={working:"working",done:"done",idle:"done",permission:"needs"},_c={needs:3,done:2,working:1},Lw={working:O("inbox.view.working"),done:O("inbox.view.done"),needs:O("inbox.view.needs")};function Rw(e,t={},i=0){const r=[];for(const[n,d]of Object.entries(e)){const _=Ew[d.kind];if(!_)continue;const s=d.ts||0;_==="done"&&!(s>Math.max(i||0,t[n]||0))||r.push({pane:n,session:d.session,window:d.window,windowName:d.windowName,view:_,msg:d.msg||"",ts:s})}return r.sort((n,d)=>n.session<d.session?-1:n.session>d.session?1:_c[d.view]-_c[n.view]||d.ts-n.ts),r}function Tw(e){const t={working:0,done:0,needs:0};for(const i of e)t[i.view]!=null&&(t[i.view]+=1);return t}function Dw(e){let t=null,i=0;for(const r of e){const n=_c[r.view]||0;n>i&&(i=n,t=r.view)}return t}function pd(e){let t=0;for(const i of Object.values(e))(i.ts||0)>t&&(t=i.ts);return t}function Aw(e,t){if(!e)return"";const i=Math.max(0,Math.round((t-e)/1e3));if(i<60)return O("time.secAgo",{n:i});const r=Math.round(i/60);if(r<60)return O("time.minAgo",{n:r});const n=Math.round(r/60);return n<24?O("time.hourAgo",{n}):O("time.dayAgo",{n:Math.round(n/24)})}function ul(e,t,i){const r=e.findIndex(n=>n.id===t);return r<0?null:e[i==="left"?r-1:r+1]??null}const H_="tw_notify",z_=()=>localStorage.getItem(H_)==="1",$_=e=>localStorage.setItem(H_,e?"1":"0");function Ma(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window&&"Notification"in window}function Mw(){var e;return typeof window<"u"&&(((e=window.matchMedia)==null?void 0:e.call(window,"(display-mode: standalone)").matches)||window.navigator.standalone===!0)||!1}const Iw=()=>/iP(hone|ad|od)/.test(navigator.userAgent||"");function la(e={}){return{Authorization:`Bearer ${Xr()??""}`,...e}}function Pw(e){const t="=".repeat((4-e.length%4)%4),i=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=atob(i),n=new Uint8Array(r.length);for(let d=0;d<r.length;d+=1)n[d]=r.charCodeAt(d);return n}async function Ow(){if(!Ma())throw new Error(O("push.unsupported"));if(Iw()&&!Mw())throw new Error(O("push.iosAddToHome"));if(await Notification.requestPermission()!=="granted")throw new Error(O("push.permissionDenied"));const t=await navigator.serviceWorker.ready,i=await fetch("/api/push/vapid",{headers:la(),cache:"no-store"});if(!i.ok)throw new Error(O("push.noVapid"));const{key:r}=await i.json();let n=await t.pushManager.getSubscription();if(n||(n=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Pw(r)})),!(await fetch("/api/push/subscribe",{method:"POST",headers:la({"Content-Type":"application/json"}),body:JSON.stringify({subscription:n,boundSessions:Wr()})})).ok)throw new Error(O("push.subscribeFailed"));return $_(!0),!0}async function Nw(){try{const t=await(await navigator.serviceWorker.ready).pushManager.getSubscription();t&&(await fetch("/api/push/unsubscribe",{method:"POST",headers:la({"Content-Type":"application/json"}),body:JSON.stringify({endpoint:t.endpoint})}),await t.unsubscribe())}catch{}$_(!1)}async function fo(){if(!(!z_()||!Ma()))try{const t=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!t)return;await fetch("/api/push/bound",{method:"POST",headers:la({"Content-Type":"application/json"}),body:JSON.stringify({endpoint:t.endpoint,boundSessions:Wr()})})}catch{}}async function Bw(e){if(Ma())try{(await(await navigator.serviceWorker.ready).getNotifications({tag:`pane-${e}`})).forEach(r=>r.close())}catch{}}const _d="\\s'\"`()\\[\\]<>,;,。、;:!?()【】《》「」“”‘’",jw="md|markdown|html|htm|txt|log|sh|png|jpg|jpeg|jfif|gif|webp|svg|bmp|ico|avif|apng",md=new RegExp(`[^${_d}]+\\.(?:${jw})(?=$|[${_d}:.])`,"gi");function U_(e){const t=[];if(!e)return t;md.lastIndex=0;let i;for(;(i=md.exec(e))!==null;)t.push({start:i.index,end:i.index+i[0].length,path:i[0]});return t}const W_=e=>typeof e=="string"&&e.startsWith("/");function Mr(e,t){const i=W_(t)?t:`${e.replace(/\/+$/,"")}/${t}`,r=i.startsWith("/"),n=[];for(const d of i.split("/"))if(!(!d||d===".")){if(d===".."){n.pop();continue}n.push(d)}return(r?"/":"")+n.join("/")}const Fw={key:"home",type:"home",name:O("doc.home")};function Hw(e,t,i){if(e.tabs.some(n=>n.key===t))return{...e,active:t};const r={key:t,type:i.type,name:i.name,content:i.content,path:t};return{tabs:[...e.tabs,r],active:t}}function zw(e,t){const i=e.tabs.findIndex(d=>d.key===t);if(i<=0)return e;const r=e.tabs.filter(d=>d.key!==t),n=e.active===t?e.tabs[i-1].key:e.active;return{tabs:r,active:n}}function $w(){const[e,t]=B.useState({tabs:[Fw],active:"home"}),i=B.useCallback((d,_)=>t(s=>Hw(s,d,_)),[]),r=B.useCallback(d=>t(_=>zw(_,d)),[]),n=B.useCallback(d=>t(_=>({..._,active:d})),[]);return{tabs:e.tabs,active:e.active,openDoc:i,closeTab:r,activate:n}}function Uw({open:e,currentSessionName:t,bound:i,onSelectSession:r,onUnbind:n,onBind:d,onClose:_,onLogout:s}){return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:`drawer ${e?"open":""}`,children:[C.jsxs("div",{className:"drawer-list",children:[C.jsx("div",{className:"drawer-title",children:"SESSIONS"}),i.length===0&&C.jsx("div",{className:"drawer-empty",children:O("drawer.empty")}),i.map(o=>C.jsxs("div",{className:`drawer-row drawer-session ${o===t?"active":""}`,children:[C.jsx("span",{className:"drawer-name",onClick:()=>r(o),children:o}),C.jsx("button",{className:"drawer-unbind",onClick:f=>{f.stopPropagation(),n(o)},"aria-label":O("drawer.unbind"),title:O("drawer.unbind"),children:"✕"})]},o)),C.jsxs("button",{className:"drawer-bind",onClick:d,children:["+ ",O("drawer.bind")]})]}),C.jsx("button",{className:"drawer-logout",onClick:s,children:O("drawer.logout")})]}),e&&C.jsx("div",{className:"drawer-backdrop",onClick:_})]})}const Ww=500,gd=10;function Cu(e,{onClick:t}={}){const i=B.useRef(null),r=B.useRef(null),n=B.useRef(!1),d=()=>{i.current&&(clearTimeout(i.current),i.current=null)};return{onPointerDown:_=>{n.current=!1,r.current={x:_.clientX,y:_.clientY},d(),i.current=setTimeout(()=>{i.current=null,n.current=!0,e==null||e()},Ww)},onPointerMove:_=>{!i.current||!r.current||(Math.abs(_.clientX-r.current.x)>gd||Math.abs(_.clientY-r.current.y)>gd)&&d()},onPointerUp:d,onPointerLeave:d,onPointerCancel:d,onClick:_=>{var s,o;if(n.current){n.current=!1,(s=_.preventDefault)==null||s.call(_),(o=_.stopPropagation)==null||o.call(_);return}t==null||t(_)}}}const vd="①②③④⑤⑥⑦⑧⑨",Vw=e=>e<vd.length?vd[e]:String(e+1),wd=(e,t)=>`${Vw(t)} ${e.command||e.id}`;function Gw({window:e,active:t,onSelect:i,onManage:r}){const n=Cu(()=>r(e),{onClick:()=>i(e)});return C.jsxs("button",{"data-win":e.id,className:`win-tab ${t?"active":""}`,...n,children:[e.name||e.id,e.panes>1&&C.jsx("span",{className:"win-panes",children:e.panes})]})}function Kw({window:e,panes:t,currentPaneId:i,onManage:r,onSelectPane:n}){const[d,_]=B.useState(!1),[s,o]=B.useState(null),f=B.useRef(null),g=()=>{var p;const b=(p=f.current)==null?void 0:p.getBoundingClientRect();b&&o({top:b.bottom+6,left:b.left})},l=Cu(()=>r(e),{onClick:()=>{d||g(),_(b=>!b)}});B.useEffect(()=>{if(!d)return;const b=a=>{var h;(h=f.current)!=null&&h.contains(a.target)||_(!1)},p=()=>g();return document.addEventListener("pointerdown",b,!0),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{document.removeEventListener("pointerdown",b,!0),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[d]);const m=Math.max(0,t.findIndex(b=>b.id===i)),y=t[m];return C.jsxs("div",{className:"wt-dd active","data-win":e.id,ref:f,children:[C.jsxs("button",{className:"win-tab active wt-trigger","aria-haspopup":"listbox","aria-expanded":d,...l,children:[C.jsx("span",{className:"wt-name",children:e.name||e.id}),C.jsx("span",{className:"wt-sep","aria-hidden":"true",children:"│"}),C.jsx("span",{className:"wt-pane",children:wd(y,m)}),C.jsx("span",{className:`wt-caret${d?" open":""}`,"aria-hidden":"true",children:"▾"})]}),d&&s&&C.jsx("div",{className:"dd-menu wt-menu",role:"listbox",style:{top:s.top,left:s.left},children:t.map((b,p)=>C.jsxs("button",{type:"button",role:"option","aria-selected":b.id===i,className:`dd-option${b.id===i?" is-selected":""}`,onClick:()=>{n(b.id),_(!1)},children:[C.jsx("span",{className:"dd-option-label",children:wd(b,p)}),b.id===i&&C.jsx("span",{className:"dd-check","aria-hidden":"true",children:"✓"})]},b.id))})]})}function qw({windows:e,currentWindowId:t,panes:i,currentPaneId:r,onSelectWindow:n,onSelectPane:d,onNewWindow:_,onManageWindow:s,trackWindowId:o}){const f=B.useRef(null);return B.useLayoutEffect(()=>{var g,l;o&&((l=(g=f.current)==null?void 0:g.querySelector(`[data-win="${o}"]`))==null||l.scrollIntoView({block:"nearest",inline:"nearest"}))},[e,o]),C.jsx("div",{className:"windowbar",children:C.jsxs("div",{className:"windowbar-scroll",ref:f,children:[e.map(g=>{const l=g.id===t;return l&&i.length>1?C.jsx(Kw,{window:g,panes:i,currentPaneId:r,onManage:s,onSelectPane:d},g.id):C.jsx(Gw,{window:g,active:l,onSelect:n,onManage:s},g.id)}),C.jsx("button",{className:"win-tab win-new",onClick:_,"aria-label":O("windowbar.newWindow"),title:O("windowbar.newWindow"),children:"+"})]})})}var V_={exports:{}};(function(e,t){(function(i,r){e.exports=r()})(globalThis,()=>(()=>{var i={4567:function(_,s,o){var f=this&&this.__decorate||function(c,u,v,x){var S,k=arguments.length,w=k<3?u:x===null?x=Object.getOwnPropertyDescriptor(u,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,u,v,x);else for(var E=c.length-1;E>=0;E--)(S=c[E])&&(w=(k<3?S(w):k>3?S(u,v,w):S(u,v))||w);return k>3&&w&&Object.defineProperty(u,v,w),w},g=this&&this.__param||function(c,u){return function(v,x){u(v,x,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const l=o(9042),m=o(9924),y=o(844),b=o(4725),p=o(2585),a=o(3656);let h=s.AccessibilityManager=class extends y.Disposable{constructor(c,u,v,x){super(),this._terminal=c,this._coreBrowserService=v,this._renderService=x,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(S=>this._handleResize(S.rows))),this.register(this._terminal.onRender(S=>this._refreshRows(S.start,S.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(S=>this._handleChar(S))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
41
+ `))),this.register(this._terminal.onA11yTab(S=>this._handleTab(S))),this.register(this._terminal.onKey(S=>this._handleKey(S.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,a.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(c){for(let u=0;u<c;u++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,u){this._liveRegionDebouncer.refresh(c,u,this._terminal.rows)}_renderRows(c,u){const v=this._terminal.buffer,x=v.lines.length.toString();for(let S=c;S<=u;S++){const k=v.lines.get(v.ydisp+S),w=[],E=(k==null?void 0:k.translateToString(!0,void 0,void 0,w))||"",R=(v.ydisp+S+1).toString(),I=this._rowElements[S];I&&(E.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=E,this._rowColumns.set(I,w)),I.setAttribute("aria-posinset",R),I.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,u){const v=c.target,x=this._rowElements[u===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(u===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==x)return;let S,k;if(u===0?(S=v,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(S=this._rowElements.shift(),k=v,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),u===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(u===0?-1:1),this._rowElements[u===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const c=document.getSelection();if(!c)return;if(c.isCollapsed)return void(this._rowContainer.contains(c.anchorNode)&&this._terminal.clearSelection());if(!c.anchorNode||!c.focusNode)return void console.error("anchorNode and/or focusNode are null");let u={node:c.anchorNode,offset:c.anchorOffset},v={node:c.focusNode,offset:c.focusOffset};if((u.node.compareDocumentPosition(v.node)&Node.DOCUMENT_POSITION_PRECEDING||u.node===v.node&&u.offset>v.offset)&&([u,v]=[v,u]),u.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(u={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(u.node))return;const x=this._rowElements.slice(-1)[0];if(v.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(v={node:x,offset:((E=x.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(v.node))return;const S=({node:R,offset:I})=>{const T=R instanceof Text?R.parentNode:R;let D=parseInt(T==null?void 0:T.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(T);if(!N)return console.warn("columns is null. Race condition?"),null;let $=I<N.length?N[I]:N.slice(-1)[0]+1;return $>=this._terminal.cols&&(++D,$=0),{row:D,column:$}},k=S(u),w=S(v);if(k&&w){if(k.row>w.row||k.row===w.row&&k.column>=w.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(w.row-k.row)*this._terminal.cols-k.column+w.column)}}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let u=this._rowContainer.children.length;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=this._coreBrowserService.mainDocument.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=h=f([g(1,p.IInstantiationService),g(2,b.ICoreBrowserService),g(3,b.IRenderService)],h)},3614:(_,s)=>{function o(m){return m.replace(/\r?\n/g,"\r")}function f(m,y){return y?"\x1B[200~"+m+"\x1B[201~":m}function g(m,y,b,p){m=f(m=o(m),b.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(m,!0),y.value=""}function l(m,y,b){const p=b.getBoundingClientRect(),a=m.clientX-p.left-10,h=m.clientY-p.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${a}px`,y.style.top=`${h}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=f,s.copyHandler=function(m,y){m.clipboardData&&m.clipboardData.setData("text/plain",y.selectionText),m.preventDefault()},s.handlePasteEvent=function(m,y,b,p){m.stopPropagation(),m.clipboardData&&g(m.clipboardData.getData("text/plain"),y,b,p)},s.paste=g,s.moveTextAreaUnderMouseCursor=l,s.rightClickHandler=function(m,y,b,p,a){l(m,y,b),a&&p.rightClickSelect(m),y.value=p.selectionText,y.select()}},7239:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const f=o(1505);s.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(g,l,m){this._css.set(g,l,m)}getCss(g,l){return this._css.get(g,l)}setColor(g,l,m){this._color.set(g,l,m)}getColor(g,l){return this._color.get(g,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,f,g,l){o.addEventListener(f,g,l);let m=!1;return{dispose:()=>{m||(m=!0,o.removeEventListener(f,g,l))}}}},3551:function(_,s,o){var f=this&&this.__decorate||function(h,c,u,v){var x,S=arguments.length,k=S<3?c:v===null?v=Object.getOwnPropertyDescriptor(c,u):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,c,u,v);else for(var w=h.length-1;w>=0;w--)(x=h[w])&&(k=(S<3?x(k):S>3?x(c,u,k):x(c,u))||k);return S>3&&k&&Object.defineProperty(c,u,k),k},g=this&&this.__param||function(h,c){return function(u,v){c(u,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const l=o(3656),m=o(8460),y=o(844),b=o(2585),p=o(4725);let a=s.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(h,c,u,v,x){super(),this._element=h,this._mouseService=c,this._renderService=u,this._bufferService=v,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)(()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const c=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!c)return;this._isMouseOut=!1;const u=h.composedPath();for(let v=0;v<u.length;v++){const x=u[v];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&c.x===this._lastBufferCell.x&&c.y===this._lastBufferCell.y||(this._handleHover(c),this._lastBufferCell=c)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,c){var v,x;this._activeProviderReplies&&c||((v=this._activeProviderReplies)==null||v.forEach(S=>{S==null||S.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let u=!1;for(const[S,k]of this._linkProviderService.linkProviders.entries())c?(x=this._activeProviderReplies)!=null&&x.get(S)&&(u=this._checkLinkProviderResult(S,h,u)):k.provideLinks(h.y,w=>{var R,I;if(this._isMouseOut)return;const E=w==null?void 0:w.map(T=>({link:T}));(R=this._activeProviderReplies)==null||R.set(S,E),u=this._checkLinkProviderResult(S,h,u),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,c){const u=new Set;for(let v=0;v<c.size;v++){const x=c.get(v);if(x)for(let S=0;S<x.length;S++){const k=x[S],w=k.link.range.start.y<h?0:k.link.range.start.x,E=k.link.range.end.y>h?this._bufferService.cols:k.link.range.end.x;for(let R=w;R<=E;R++){if(u.has(R)){x.splice(S--,1);break}u.add(R)}}}}_checkLinkProviderResult(h,c,u){var S;if(!this._activeProviderReplies)return u;const v=this._activeProviderReplies.get(h);let x=!1;for(let k=0;k<h;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(x=!0);if(!x&&v){const k=v.find(w=>this._linkAtPosition(w.link,c));k&&(u=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!u)for(let k=0;k<this._activeProviderReplies.size;k++){const w=(S=this._activeProviderReplies.get(k))==null?void 0:S.find(E=>this._linkAtPosition(E.link,c));if(w){u=!0,this._handleNewLink(w);break}}return u}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const c=this._positionFromMouseEvent(h,this._element,this._mouseService);c&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,c)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,c){this._currentLink&&this._lastMouseEvent&&(!h||!c||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=c)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._linkAtPosition(h.link,c)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var u,v;return(v=(u=this._currentLink)==null?void 0:u.state)==null?void 0:v.decorations.pointerCursor},set:u=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==u&&(this._currentLink.state.decorations.pointerCursor=u,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",u))}},underline:{get:()=>{var u,v;return(v=(u=this._currentLink)==null?void 0:u.state)==null?void 0:v.decorations.underline},set:u=>{var v,x,S;(v=this._currentLink)!=null&&v.state&&((S=(x=this._currentLink)==null?void 0:x.state)==null?void 0:S.decorations.underline)!==u&&(this._currentLink.state.decorations.underline=u,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,u))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(u=>{if(!this._currentLink)return;const v=u.start===0?0:u.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+u.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(v,x),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}})))}_linkHover(h,c,u){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),c.hover&&c.hover(u,c.text)}_fireUnderlineEvent(h,c){const u=h.range,v=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(u.start.x-1,u.start.y-v-1,u.end.x,u.end.y-v-1,void 0);(c?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(h,c,u){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),c.leave&&c.leave(u,c.text)}_linkAtPosition(h,c){const u=h.range.start.y*this._bufferService.cols+h.range.start.x,v=h.range.end.y*this._bufferService.cols+h.range.end.x,x=c.y*this._bufferService.cols+c.x;return u<=x&&x<=v}_positionFromMouseEvent(h,c,u){const v=u.getCoords(h,c,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,c,u,v,x){return{x1:h,y1:c,x2:u,y2:v,cols:this._bufferService.cols,fg:x}}};s.Linkifier=a=f([g(1,p.IMouseService),g(2,p.IRenderService),g(3,b.IBufferService),g(4,p.ILinkProviderService)],a)},9042:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(_,s,o){var f=this&&this.__decorate||function(p,a,h,c){var u,v=arguments.length,x=v<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(p,a,h,c);else for(var S=p.length-1;S>=0;S--)(u=p[S])&&(x=(v<3?u(x):v>3?u(a,h,x):u(a,h))||x);return v>3&&x&&Object.defineProperty(a,h,x),x},g=this&&this.__param||function(p,a){return function(h,c){a(h,c,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const l=o(511),m=o(2585);let y=s.OscLinkProvider=class{constructor(p,a,h){this._bufferService=p,this._optionsService=a,this._oscLinkService=h}provideLinks(p,a){var E;const h=this._bufferService.buffer.lines.get(p-1);if(!h)return void a(void 0);const c=[],u=this._optionsService.rawOptions.linkHandler,v=new l.CellData,x=h.getTrimmedLength();let S=-1,k=-1,w=!1;for(let R=0;R<x;R++)if(k!==-1||h.hasContent(R)){if(h.loadCell(R,v),v.hasExtendedAttrs()&&v.extended.urlId){if(k===-1){k=R,S=v.extended.urlId;continue}w=v.extended.urlId!==S}else k!==-1&&(w=!0);if(w||k!==-1&&R===x-1){const I=(E=this._oscLinkService.getLinkData(S))==null?void 0:E.uri;if(I){const T={start:{x:k+1,y:p},end:{x:R+(w||R!==x-1?0:1),y:p}};let D=!1;if(!(u!=null&&u.allowNonHttpProtocols))try{const N=new URL(I);["http:","https:"].includes(N.protocol)||(D=!0)}catch{D=!0}D||c.push({text:I,range:T,activate:(N,$)=>u?u.activate(N,$,T):b(0,$),hover:(N,$)=>{var U;return(U=u==null?void 0:u.hover)==null?void 0:U.call(u,N,$,T)},leave:(N,$)=>{var U;return(U=u==null?void 0:u.leave)==null?void 0:U.call(u,N,$,T)}})}w=!1,v.hasExtendedAttrs()&&v.extended.urlId?(k=R,S=v.extended.urlId):(k=-1,S=-1)}}a(c)}};function b(p,a){if(confirm(`Do you want to navigate to ${a}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=y=f([g(0,m.IBufferService),g(1,m.IOptionsService),g(2,m.IOscLinkService)],y)},6193:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,f){this._renderCallback=o,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,f,g){this._rowCount=g,o=o!==void 0?o:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,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 o=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const f=o(3614),g=o(3656),l=o(3551),m=o(9042),y=o(3730),b=o(1680),p=o(3107),a=o(5744),h=o(2950),c=o(1296),u=o(428),v=o(4269),x=o(5114),S=o(8934),k=o(3230),w=o(9312),E=o(4725),R=o(6731),I=o(8055),T=o(8969),D=o(8460),N=o(844),$=o(6114),U=o(8437),P=o(2584),H=o(7399),L=o(5941),A=o(9074),j=o(2585),z=o(5435),K=o(4567),Y=o(779);class te extends T.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(W={}){super(W),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((M,G)=>this.refresh(M,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(M=>this._reportWindowsOptions(M))),this.register(this._inputHandler.onColor(M=>this._handleColorEvent(M))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(M=>this._afterResize(M.cols,M.rows))),this.register((0,N.toDisposable)(()=>{var M,G;this._customKeyEventHandler=void 0,(G=(M=this.element)==null?void 0:M.parentNode)==null||G.removeChild(this.element)}))}_handleColorEvent(W){if(this._themeService)for(const M of W){let G,V="";switch(M.index){case 256:G="foreground",V="10";break;case 257:G="background",V="11";break;case 258:G="cursor",V="12";break;default:G="ansi",V="4;"+M.index}switch(M.type){case 0:const re=I.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[M.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${P.C0.ESC}]${V};${(0,L.toRgbString)(re)}${P.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(ie=>ie.ansi[M.index]=I.channels.toColor(...M.color));else{const ie=G;this._themeService.modifyColors(me=>me[ie]=I.channels.toColor(...M.color))}break;case 2:this._themeService.restoreColor(M.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const W=this.buffer.ybase+this.buffer.y,M=this.buffer.lines.get(W);if(!M)return;const G=Math.min(this.buffer.x,this.cols-1),V=this._renderService.dimensions.css.cell.height,re=M.getWidth(G),ie=this._renderService.dimensions.css.cell.width*re,me=this.buffer.y*this._renderService.dimensions.css.cell.height,ue=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ue+"px",this.textarea.style.top=me+"px",this.textarea.style.width=ie+"px",this.textarea.style.height=V+"px",this.textarea.style.lineHeight=V+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",M=>{this.hasSelection()&&(0,f.copyHandler)(M,this._selectionService)}));const W=M=>(0,f.handlePasteEvent)(M,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,g.addDisposableDomListener)(this.element,"paste",W)),$.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",M=>{M.button===2&&(0,f.rightClickHandler)(M,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",M=>{(0,f.rightClickHandler)(M,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),$.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",M=>{M.button===1&&(0,f.moveTextAreaUnderMouseCursor)(M,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",W=>this._keyUp(W),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",W=>this._keyDown(W),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",W=>this._keyPress(W),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",W=>this._compositionHelper.compositionupdate(W))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",W=>this._inputEvent(W),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(W){var G;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((G=this.element)==null?void 0:G.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const M=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),M.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",V=>this.updateCursorStyle(V))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),M.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),$.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(x.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",V=>this._handleTextAreaFocus(V))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(V=>this._onRender.fire(V))),this.onResize(V=>this._renderService.resize(V.cols,V.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(M);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(V=>this.scrollLines(V.amount,V.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(w.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(V=>this.scrollLines(V.amount,V.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(V=>this._renderService.handleSelectionChanged(V.start,V.end,V.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(V=>{this.textarea.value=V,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(V=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",V=>this._selectionService.handleMouseDown(V))),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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",V=>this._handleScreenReaderModeOptionChange(V))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",V=>{!this._overviewRulerRenderer&&V&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(c.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,M=this.element;function G(ie){const me=W._mouseService.getMouseReportCoords(ie,W.screenElement);if(!me)return!1;let ue,Re;switch(ie.overrideType||ie.type){case"mousemove":Re=32,ie.buttons===void 0?(ue=3,ie.button!==void 0&&(ue=ie.button<3?ie.button:3)):ue=1&ie.buttons?0:4&ie.buttons?1:2&ie.buttons?2:3;break;case"mouseup":Re=0,ue=ie.button<3?ie.button:3;break;case"mousedown":Re=1,ue=ie.button<3?ie.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ie)===!1||W.viewport.getLinesScrolled(ie)===0)return!1;Re=ie.deltaY<0?0:1,ue=4;break;default:return!1}return!(Re===void 0||ue===void 0||ue>4)&&W.coreMouseService.triggerMouseEvent({col:me.col,row:me.row,x:me.x,y:me.y,button:ue,action:Re,ctrl:ie.ctrlKey,alt:ie.altKey,shift:ie.shiftKey})}const V={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:ie=>(G(ie),ie.buttons||(this._document.removeEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.removeEventListener("mousemove",V.mousedrag)),this.cancel(ie)),wheel:ie=>(G(ie),this.cancel(ie,!0)),mousedrag:ie=>{ie.buttons&&G(ie)},mousemove:ie=>{ie.buttons||G(ie)}};this.register(this.coreMouseService.onProtocolChange(ie=>{ie?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ie)),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&ie?V.mousemove||(M.addEventListener("mousemove",re.mousemove),V.mousemove=re.mousemove):(M.removeEventListener("mousemove",V.mousemove),V.mousemove=null),16&ie?V.wheel||(M.addEventListener("wheel",re.wheel,{passive:!1}),V.wheel=re.wheel):(M.removeEventListener("wheel",V.wheel),V.wheel=null),2&ie?V.mouseup||(V.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",V.mouseup),V.mouseup=null),4&ie?V.mousedrag||(V.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",V.mousedrag),V.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(M,"mousedown",ie=>{if(ie.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ie))return G(ie),V.mouseup&&this._document.addEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.addEventListener("mousemove",V.mousedrag),this.cancel(ie)})),this.register((0,g.addDisposableDomListener)(M,"wheel",ie=>{if(!V.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ie)===!1)return!1;if(!this.buffer.hasScrollback){const me=this.viewport.getLinesScrolled(ie);if(me===0)return;const ue=P.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ie.deltaY<0?"A":"B");let Re="";for(let xe=0;xe<Math.abs(me);xe++)Re+=ue;return this.coreService.triggerDataEvent(Re,!0),this.cancel(ie,!0)}return this.viewport.handleWheel(ie)?this.cancel(ie):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(M,"touchstart",ie=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ie),this.cancel(ie)},{passive:!0})),this.register((0,g.addDisposableDomListener)(M,"touchmove",ie=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ie)?void 0:this.cancel(ie)},{passive:!1}))}refresh(W,M){var G;(G=this._renderService)==null||G.refreshRows(W,M)}updateCursorStyle(W){var M;(M=this._selectionService)!=null&&M.shouldColumnSelect(W)?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(W,M,G=0){var V;G===1?(super.scrollLines(W,M,G),this.refresh(0,this.rows-1)):(V=this.viewport)==null||V.scrollLines(W)}paste(W){(0,f.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const M=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),M}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,M,G){this._selectionService.setSelection(W,M,G)}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 W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,M){var G;(G=this._selectionService)==null||G.selectLines(W,M)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const M=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!M&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;M||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,H.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),G.type===3||G.type===2){const V=this.rows-1;return this.scrollLines(G.type===2?-V:V),this.cancel(W,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(G.cancel&&this.cancel(W,!0),!G.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==P.C0.ETX&&G.key!==P.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,M){const G=W.isMac&&!this.options.macOptionIsMeta&&M.altKey&&!M.ctrlKey&&!M.metaKey||W.isWindows&&M.altKey&&M.ctrlKey&&!M.metaKey||W.isWindows&&M.getModifierState("AltGraph");return M.type==="keypress"?G:G&&(!M.keyCode||M.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function(M){return M.keyCode===16||M.keyCode===17||M.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let M;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)M=W.charCode;else if(W.which===null||W.which===void 0)M=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;M=W.which}return!(!M||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(M=String.fromCharCode(M),this._onKey.fire({key:M,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(M,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const M=W.data;return this.coreService.triggerDataEvent(M,!0),this.cancel(W),!0}return!1}resize(W,M){W!==this.cols||M!==this.rows?super.resize(W,M):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,M){var G,V;(G=this._charSizeService)==null||G.measure(),(V=this.viewport)==null||V.syncScrollArea(!0)}clear(){var W;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 M=1;M<this.rows;M++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var M,G;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(M=this._selectionService)==null||M.reset(),this._decorationService.reset(),(G=this.viewport)==null||G.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(P.C0.ESC+"[I"):this.coreService.triggerDataEvent(P.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const M=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[4;${G};${M}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const V=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[6;${re};${V}t`)}}cancel(W,M){if(this.options.cancelEvents||M)return W.preventDefault(),W.stopPropagation(),!1}}s.Terminal=te},9924:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,f=1e3){this._renderCallback=o,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,f,g){this._rowCount=g,o=o!==void 0?o:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=l-this._lastRefreshMs,y=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,f)}}},1680:function(_,s,o){var f=this&&this.__decorate||function(h,c,u,v){var x,S=arguments.length,k=S<3?c:v===null?v=Object.getOwnPropertyDescriptor(c,u):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,c,u,v);else for(var w=h.length-1;w>=0;w--)(x=h[w])&&(k=(S<3?x(k):S>3?x(c,u,k):x(c,u))||k);return S>3&&k&&Object.defineProperty(c,u,k),k},g=this&&this.__param||function(h,c){return function(u,v){c(u,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const l=o(3656),m=o(4725),y=o(8460),b=o(844),p=o(2585);let a=s.Viewport=class extends b.Disposable{constructor(h,c,u,v,x,S,k,w){super(),this._viewportElement=h,this._scrollArea=c,this._bufferService=u,this._optionsService=v,this._charSizeService=x,this._renderService=S,this._coreBrowserService=k,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 y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 c=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==c&&(this._lastRecordedBufferHeight=c,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 c=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,c){const u=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(c<0&&this._viewportElement.scrollTop!==0||c>0&&u<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const c=this._getPixelsScrolled(h);return c!==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+c:this._smoothScrollState.target+=c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=c,this._bubbleScroll(h,c))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const c=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let c=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?c*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._currentRowHeight*this._bufferService.rows),c}getBufferElements(h,c){var w;let u,v="";const x=[],S=c??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let E=h;E<S;E++){const R=k.get(E);if(!R)continue;const I=(w=k.get(E+1))==null?void 0:w.isWrapped;if(v+=R.translateToString(!I),!I||E===k.length-1){const T=document.createElement("div");T.textContent=v,x.push(T),v.length>0&&(u=T),v=""}}return{bufferElements:x,cursorElement:u}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let c=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(c/=this._currentRowHeight+0,this._wheelPartialScroll+=c,c=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._bufferService.rows),c}_applyScrollModifier(h,c){const u=this._optionsService.rawOptions.fastScrollModifier;return u==="alt"&&c.altKey||u==="ctrl"&&c.ctrlKey||u==="shift"&&c.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const c=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,c!==0&&(this._viewportElement.scrollTop+=c,this._bubbleScroll(h,c))}};s.Viewport=a=f([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,m.ICharSizeService),g(5,m.IRenderService),g(6,m.ICoreBrowserService),g(7,m.IThemeService)],a)},3107:function(_,s,o){var f=this&&this.__decorate||function(p,a,h,c){var u,v=arguments.length,x=v<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(p,a,h,c);else for(var S=p.length-1;S>=0;S--)(u=p[S])&&(x=(v<3?u(x):v>3?u(a,h,x):u(a,h))||x);return v>3&&x&&Object.defineProperty(a,h,x),x},g=this&&this.__param||function(p,a){return function(h,c){a(h,c,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const l=o(4725),m=o(844),y=o(2585);let b=s.BufferDecorationRenderer=class extends m.Disposable{constructor(p,a,h,c,u){super(),this._screenElement=p,this._bufferService=a,this._coreBrowserService=h,this._decorationService=c,this._renderService=u,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(v=>this._removeDecoration(v))),this.register((0,m.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 p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){var c;const a=this._coreBrowserService.mainDocument.createElement("div");a.classList.add("xterm-decoration"),a.classList.toggle("xterm-decoration-top-layer",((c=p==null?void 0:p.options)==null?void 0:c.layer)==="top"),a.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",a.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",a.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=p.options.x??0;return h&&h>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(p,a),a}_refreshStyle(p){const a=p.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let h=this._decorationElements.get(p);h||(h=this._createElement(p),p.element=h,this._decorationElements.set(p,h),this._container.appendChild(h),p.onDispose(()=>{this._decorationElements.delete(p),h.remove()})),h.style.top=a*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(h)}}_refreshXPosition(p,a=p.element){if(!a)return;const h=p.options.x??0;(p.options.anchor||"left")==="right"?a.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":a.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){var a;(a=this._decorationElements.get(p))==null||a.remove(),this._decorationElements.delete(p),p.dispose()}};s.BufferDecorationRenderer=b=f([g(1,y.IBufferService),g(2,l.ICoreBrowserService),g(3,y.IDecorationService),g(4,l.IRenderService)],b)},5871:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.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(o){if(o.options.overviewRulerOptions){for(const f of this._zones)if(f.color===o.options.overviewRulerOptions.color&&f.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,o.marker.line))return;if(this._lineAdjacentToZone(f,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(f,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,f){return f>=o.startBufferLine&&f<=o.endBufferLine}_lineAdjacentToZone(o,f,g){return f>=o.startBufferLine-this._linePadding[g||"full"]&&f<=o.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(o,f){o.startBufferLine=Math.min(o.startBufferLine,f),o.endBufferLine=Math.max(o.endBufferLine,f)}}},5744:function(_,s,o){var f=this&&this.__decorate||function(u,v,x,S){var k,w=arguments.length,E=w<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(u,v,x,S);else for(var R=u.length-1;R>=0;R--)(k=u[R])&&(E=(w<3?k(E):w>3?k(v,x,E):k(v,x))||E);return w>3&&E&&Object.defineProperty(v,x,E),E},g=this&&this.__param||function(u,v){return function(x,S){v(x,S,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const l=o(5871),m=o(4725),y=o(844),b=o(2585),p={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let c=s.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(u,v,x,S,k,w,E){var I;super(),this._viewportElement=u,this._screenElement=v,this._bufferService=x,this._decorationService=S,this._renderService=k,this._optionsService=w,this._coreBrowserService=E,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)(()=>{var T;(T=this._canvas)==null||T.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 u=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);a.full=this._canvas.width,a.left=u,a.center=v,a.right=u,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=a.left,h.right=a.left+a.center}_refreshDrawHeightConstants(){p.full=Math.round(2*this._coreBrowserService.dpr);const u=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(u,12),6)*this._coreBrowserService.dpr);p.left=v,p.center=v,p.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.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 v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const u=this._colorZoneStore.zones;for(const v of u)v.position!=="full"&&this._renderColorZone(v);for(const v of u)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(u){this._ctx.fillStyle=u.color,this._ctx.fillRect(h[u.position||"full"],Math.round((this._canvas.height-1)*(u.startBufferLine/this._bufferService.buffers.active.lines.length)-p[u.position||"full"]/2),a[u.position||"full"],Math.round((this._canvas.height-1)*((u.endBufferLine-u.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[u.position||"full"]))}_queueRefresh(u,v){this._shouldUpdateDimensions=u||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=c=f([g(2,b.IBufferService),g(3,b.IDecorationService),g(4,m.IRenderService),g(5,b.IOptionsService),g(6,m.ICoreBrowserService)],c)},2950:function(_,s,o){var f=this&&this.__decorate||function(p,a,h,c){var u,v=arguments.length,x=v<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(p,a,h,c);else for(var S=p.length-1;S>=0;S--)(u=p[S])&&(x=(v<3?u(x):v>3?u(a,h,x):u(a,h))||x);return v>3&&x&&Object.defineProperty(a,h,x),x},g=this&&this.__param||function(p,a){return function(h,c){a(h,c,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const l=o(4725),m=o(2585),y=o(2584);let b=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,a,h,c,u,v){this._textarea=p,this._compositionView=a,this._bufferService=h,this._optionsService=c,this._coreService=u,this._renderService=v,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(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}},0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const a=this._textarea.value,h=a.replace(p,"");this._dataAlreadySent=h,a.length>p.length?this._coreService.triggerDataEvent(h,!0):a.length<p.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):a.length===p.length&&a!==p&&this._coreService.triggerDataEvent(a,!0)}},0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,c=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,u=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=u+"px",this._compositionView.style.top=c+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=u+"px",this._textarea.style.top=c+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}p||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=b=f([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,m.ICoreService),g(5,l.IRenderService)],b)},9806:(_,s)=>{function o(f,g,l){const m=l.getBoundingClientRect(),y=f.getComputedStyle(l),b=parseInt(y.getPropertyValue("padding-left")),p=parseInt(y.getPropertyValue("padding-top"));return[g.clientX-m.left-b,g.clientY-m.top-p]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(f,g,l,m,y,b,p,a,h){if(!b)return;const c=o(f,g,l);return c?(c[0]=Math.ceil((c[0]+(h?p/2:0))/p),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),m+(h?1:0)),c[1]=Math.min(Math.max(c[1],1),y),c):void 0}},9504:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const f=o(2584);function g(a,h,c,u){const v=a-l(a,c),x=h-l(h,c),S=Math.abs(v-x)-function(k,w,E){let R=0;const I=k-l(k,E),T=w-l(w,E);for(let D=0;D<Math.abs(I-T);D++){const N=m(k,w)==="A"?-1:1,$=E.buffer.lines.get(I+N*D);$!=null&&$.isWrapped&&R++}return R}(a,h,c);return p(S,b(m(a,h),u))}function l(a,h){let c=0,u=h.buffer.lines.get(a),v=u==null?void 0:u.isWrapped;for(;v&&a>=0&&a<h.rows;)c++,u=h.buffer.lines.get(--a),v=u==null?void 0:u.isWrapped;return c}function m(a,h){return a>h?"A":"B"}function y(a,h,c,u,v,x){let S=a,k=h,w="";for(;S!==c||k!==u;)S+=v?1:-1,v&&S>x.cols-1?(w+=x.buffer.translateBufferLineToString(k,!1,a,S),S=0,a=0,k++):!v&&S<0&&(w+=x.buffer.translateBufferLineToString(k,!1,0,a+1),S=x.cols-1,a=S,k--);return w+x.buffer.translateBufferLineToString(k,!1,a,S)}function b(a,h){const c=h?"O":"[";return f.C0.ESC+c+a}function p(a,h){a=Math.floor(a);let c="";for(let u=0;u<a;u++)c+=h;return c}s.moveToCellSequence=function(a,h,c,u){const v=c.buffer.x,x=c.buffer.y;if(!c.buffer.hasScrollback)return function(w,E,R,I,T,D){return g(E,I,T,D).length===0?"":p(y(w,E,w,E-l(E,T),!1,T).length,b("D",D))}(v,x,0,h,c,u)+g(x,h,c,u)+function(w,E,R,I,T,D){let N;N=g(E,I,T,D).length>0?I-l(I,T):E;const $=I,U=function(P,H,L,A,j,z){let K;return K=g(L,A,j,z).length>0?A-l(A,j):H,P<L&&K<=A||P>=L&&K<A?"C":"D"}(w,E,R,I,T,D);return p(y(w,N,R,$,U==="C",T).length,b(U,D))}(v,x,a,h,c,u);let S;if(x===h)return S=v>a?"D":"C",p(Math.abs(v-a),b(S,u));S=x>h?"D":"C";const k=Math.abs(x-h);return p(function(w,E){return E.cols-w}(x>h?a:v,c)+(k-1)*c.cols+1+((x>h?v:a)-1),b(S,u))}},1296:function(_,s,o){var f=this&&this.__decorate||function(D,N,$,U){var P,H=arguments.length,L=H<3?N:U===null?U=Object.getOwnPropertyDescriptor(N,$):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(D,N,$,U);else for(var A=D.length-1;A>=0;A--)(P=D[A])&&(L=(H<3?P(L):H>3?P(N,$,L):P(N,$))||L);return H>3&&L&&Object.defineProperty(N,$,L),L},g=this&&this.__param||function(D,N){return function($,U){N($,U,D)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const l=o(3787),m=o(2550),y=o(2223),b=o(6171),p=o(6052),a=o(4725),h=o(8055),c=o(8460),u=o(844),v=o(2585),x="xterm-dom-renderer-owner-",S="xterm-rows",k="xterm-fg-",w="xterm-bg-",E="xterm-focus",R="xterm-selection";let I=1,T=s.DomRenderer=class extends u.Disposable{constructor(D,N,$,U,P,H,L,A,j,z,K,Y,te){super(),this._terminal=D,this._document=N,this._element=$,this._screenElement=U,this._viewportElement=P,this._helperContainer=H,this._linkifier2=L,this._charSizeService=j,this._optionsService=z,this._bufferService=K,this._coreBrowserService=Y,this._themeService=te,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new c.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Q=>this._injectCss(Q))),this._injectCss(this._themeService.colors),this._rowFactory=A.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Q=>this._handleLinkHover(Q))),this.register(this._linkifier2.onHideLinkUnderline(Q=>this._handleLinkLeave(Q))),this.register((0,u.toDisposable)(()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${S} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${S} .xterm-dim { color: ${h.color.multiplyOpacity(D.foreground,.5).css};}`,N+=`${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 $=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,P=`blink_block_${this._terminalClass}`;N+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${U} { 50% { box-shadow: none; }}`,N+=`@keyframes ${P} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,N+=`${this._terminalSelector} .${S}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${S}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${S}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[H,L]of D.ansi.entries())N+=`${this._terminalSelector} .${k}${H} { color: ${L.css}; }${this._terminalSelector} .${k}${H}.xterm-dim { color: ${h.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${w}${H} { background-color: ${L.css}; }`;N+=`${this._terminalSelector} .${k}${y.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(D.background).css}; }${this._terminalSelector} .${k}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,N){for(let $=this._rowElements.length;$<=N;$++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,N){this._refreshRowElements(D,N),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,N,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,N,$),this.renderRows(0,this._bufferService.rows-1),!D||!N)return;this._selectionRenderModel.update(this._terminal,D,N,$);const U=this._selectionRenderModel.viewportStartRow,P=this._selectionRenderModel.viewportEndRow,H=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(H>=this._bufferService.rows||L<0)return;const A=this._document.createDocumentFragment();if($){const j=D[0]>N[0];A.appendChild(this._createSelectionElement(H,j?N[0]:D[0],j?D[0]:N[0],L-H+1))}else{const j=U===H?D[0]:0,z=H===P?N[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(H,j,z));const K=L-H-1;if(A.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,K)),H!==L){const Y=P===L?N[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(L,0,Y))}}this._selectionContainer.appendChild(A)}_createSelectionElement(D,N,$,U=1){const P=this._document.createElement("div"),H=N*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*($-N);return H+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-H),P.style.height=U*this.dimensions.css.cell.height+"px",P.style.top=D*this.dimensions.css.cell.height+"px",P.style.left=`${H}px`,P.style.width=`${L}px`,P}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const D of this._rowElements)D.replaceChildren()}renderRows(D,N){const $=this._bufferService.buffer,U=$.ybase+$.y,P=Math.min($.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=D;j<=N;j++){const z=j+$.ydisp,K=this._rowElements[j],Y=$.lines.get(z);if(!K||!Y)break;K.replaceChildren(...this._rowFactory.createRow(Y,z,z===U,L,A,P,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,N,$,U,P,H){$<0&&(D=0),U<0&&(N=0);const L=this._bufferService.rows-1;$=Math.max(Math.min($,L),0),U=Math.max(Math.min(U,L),0),P=Math.min(P,this._bufferService.cols);const A=this._bufferService.buffer,j=A.ybase+A.y,z=Math.min(A.x,P-1),K=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,te=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=$;Q<=U;++Q){const W=Q+A.ydisp,M=this._rowElements[Q],G=A.lines.get(W);if(!M||!G)break;M.replaceChildren(...this._rowFactory.createRow(G,W,W===j,Y,te,z,K,this.dimensions.css.cell.width,this._widthCache,H?Q===$?D:0:-1,H?(Q===U?N:P)-1:-1))}}};s.DomRenderer=T=f([g(7,v.IInstantiationService),g(8,a.ICharSizeService),g(9,v.IOptionsService),g(10,v.IBufferService),g(11,a.ICoreBrowserService),g(12,a.IThemeService)],T)},3787:function(_,s,o){var f=this&&this.__decorate||function(S,k,w,E){var R,I=arguments.length,T=I<3?k:E===null?E=Object.getOwnPropertyDescriptor(k,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,k,w,E);else for(var D=S.length-1;D>=0;D--)(R=S[D])&&(T=(I<3?R(T):I>3?R(k,w,T):R(k,w))||T);return I>3&&T&&Object.defineProperty(k,w,T),T},g=this&&this.__param||function(S,k){return function(w,E){k(w,E,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const l=o(2223),m=o(643),y=o(511),b=o(2585),p=o(8055),a=o(4725),h=o(4269),c=o(6171),u=o(3734);let v=s.DomRendererRowFactory=class{constructor(S,k,w,E,R,I,T){this._document=S,this._characterJoinerService=k,this._optionsService=w,this._coreBrowserService=E,this._coreService=R,this._decorationService=I,this._themeService=T,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,k,w){this._selectionStart=S,this._selectionEnd=k,this._columnSelectMode=w}createRow(S,k,w,E,R,I,T,D,N,$,U){const P=[],H=this._characterJoinerService.getJoinedCharacters(k),L=this._themeService.colors;let A,j=S.getNoBgTrimmedLength();w&&j<I+1&&(j=I+1);let z=0,K="",Y=0,te=0,Q=0,W=!1,M=0,G=!1,V=0;const re=[],ie=$!==-1&&U!==-1;for(let me=0;me<j;me++){S.loadCell(me,this._workCell);let ue=this._workCell.getWidth();if(ue===0)continue;let Re=!1,xe=me,pe=this._workCell;if(H.length>0&&me===H[0][0]){Re=!0;const ye=H.shift();pe=new h.JoinedCellData(this._workCell,S.translateToString(!0,ye[0],ye[1]),ye[1]-ye[0]),xe=ye[1]-1,ue=pe.getWidth()}const ze=this._isCellInSelection(me,k),ge=w&&me===I,_e=ie&&me>=$&&me<=U;let fe=!1;this._decorationService.forEachDecorationAtCell(me,k,void 0,ye=>{fe=!0});let be=pe.getChars()||m.WHITESPACE_CELL_CHAR;if(be===" "&&(pe.isUnderline()||pe.isOverline())&&(be=" "),V=ue*D-N.get(be,pe.isBold(),pe.isItalic()),A){if(z&&(ze&&G||!ze&&!G&&pe.bg===Y)&&(ze&&G&&L.selectionForeground||pe.fg===te)&&pe.extended.ext===Q&&_e===W&&V===M&&!ge&&!Re&&!fe){pe.isInvisible()?K+=m.WHITESPACE_CELL_CHAR:K+=be,z++;continue}z&&(A.textContent=K),A=this._document.createElement("span"),z=0,K=""}else A=this._document.createElement("span");if(Y=pe.bg,te=pe.fg,Q=pe.extended.ext,W=_e,M=V,G=ze,Re&&I>=me&&I<=xe&&(I=me),!this._coreService.isCursorHidden&&ge&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&re.push("xterm-cursor-blink"),re.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(pe.isBold()&&re.push("xterm-bold"),pe.isItalic()&&re.push("xterm-italic"),pe.isDim()&&re.push("xterm-dim"),K=pe.isInvisible()?m.WHITESPACE_CELL_CHAR:pe.getChars()||m.WHITESPACE_CELL_CHAR,pe.isUnderline()&&(re.push(`xterm-underline-${pe.extended.underlineStyle}`),K===" "&&(K=" "),!pe.isUnderlineColorDefault()))if(pe.isUnderlineColorRGB())A.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(pe.getUnderlineColor()).join(",")})`;else{let ye=pe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&pe.isBold()&&ye<8&&(ye+=8),A.style.textDecorationColor=L.ansi[ye].css}pe.isOverline()&&(re.push("xterm-overline"),K===" "&&(K=" ")),pe.isStrikethrough()&&re.push("xterm-strikethrough"),_e&&(A.style.textDecoration="underline");let le=pe.getFgColor(),X=pe.getFgColorMode(),J=pe.getBgColor(),se=pe.getBgColorMode();const ve=!!pe.isInverse();if(ve){const ye=le;le=J,J=ye;const Xe=X;X=se,se=Xe}let Ee,Le,Me,de=!1;switch(this._decorationService.forEachDecorationAtCell(me,k,void 0,ye=>{ye.options.layer!=="top"&&de||(ye.backgroundColorRGB&&(se=50331648,J=ye.backgroundColorRGB.rgba>>8&16777215,Ee=ye.backgroundColorRGB),ye.foregroundColorRGB&&(X=50331648,le=ye.foregroundColorRGB.rgba>>8&16777215,Le=ye.foregroundColorRGB),de=ye.options.layer==="top")}),!de&&ze&&(Ee=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,J=Ee.rgba>>8&16777215,se=50331648,de=!0,L.selectionForeground&&(X=50331648,le=L.selectionForeground.rgba>>8&16777215,Le=L.selectionForeground)),de&&re.push("xterm-decoration-top"),se){case 16777216:case 33554432:Me=L.ansi[J],re.push(`xterm-bg-${J}`);break;case 50331648:Me=p.channels.toColor(J>>16,J>>8&255,255&J),this._addStyle(A,`background-color:#${x((J>>>0).toString(16),"0",6)}`);break;default:ve?(Me=L.foreground,re.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):Me=L.background}switch(Ee||pe.isDim()&&(Ee=p.color.multiplyOpacity(Me,.5)),X){case 16777216:case 33554432:pe.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(A,Me,L.ansi[le],pe,Ee,void 0)||re.push(`xterm-fg-${le}`);break;case 50331648:const ye=p.channels.toColor(le>>16&255,le>>8&255,255&le);this._applyMinimumContrast(A,Me,ye,pe,Ee,Le)||this._addStyle(A,`color:#${x(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(A,Me,L.foreground,pe,Ee,Le)||ve&&re.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}re.length&&(A.className=re.join(" "),re.length=0),ge||Re||fe?A.textContent=K:z++,V!==this.defaultSpacing&&(A.style.letterSpacing=`${V}px`),P.push(A),me=xe}return A&&z&&(A.textContent=K),P}_applyMinimumContrast(S,k,w,E,R,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,c.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const T=this._getContrastCache(E);let D;if(R||I||(D=T.getColor(k.rgba,w.rgba)),D===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);D=p.color.ensureContrastRatio(R||k,I||w,N),T.setColor((R||k).rgba,(I||w).rgba,D??null)}return!!D&&(this._addStyle(S,`color:${D.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,k){S.setAttribute("style",`${S.getAttribute("style")||""}${k};`)}_isCellInSelection(S,k){const w=this._selectionStart,E=this._selectionEnd;return!(!w||!E)&&(this._columnSelectMode?w[0]<=E[0]?S>=w[0]&&k>=w[1]&&S<E[0]&&k<=E[1]:S<w[0]&&k>=w[1]&&S>=E[0]&&k<=E[1]:k>w[1]&&k<E[1]||w[1]===E[1]&&k===w[1]&&S>=w[0]&&S<E[0]||w[1]<E[1]&&k===E[1]&&S<E[0]||w[1]<E[1]&&k===w[1]&&S>=w[0])}};function x(S,k,w){for(;S.length<w;)S=k+S;return S}s.DomRendererRowFactory=v=f([g(1,a.ICharacterJoinerService),g(2,b.IOptionsService),g(3,a.ICoreBrowserService),g(4,b.ICoreService),g(5,b.IDecorationService),g(6,a.IThemeService)],v)},2550:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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=o.createElement("span");g.classList.add("xterm-char-measure-element");const l=o.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const m=o.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const y=o.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[g,l,m,y],this._container.appendChild(g),this._container.appendChild(l),this._container.appendChild(m),this._container.appendChild(y),f.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(o,f,g,l){o===this._font&&f===this._fontSize&&g===this._weight&&l===this._weightBold||(this._font=o,this._fontSize=f,this._weight=g,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(o,f,g){let l=0;if(!f&&!g&&o.length===1&&(l=o.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const b=this._measure(o,0);return b>0&&(this._flat[l]=b),b}let m=o;f&&(m+="B"),g&&(m+="I");let y=this._holey.get(m);if(y===void 0){let b=0;f&&(b|=1),g&&(b|=2),y=this._measure(o,b),y>0&&this._holey.set(m,y)}return y}_measure(o,f){const g=this._measureElements[f];return g.textContent=o.repeat(32),g.offsetWidth/32}}},2223:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const f=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(_,s)=>{function o(g){return 57508<=g&&g<=57558}function f(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(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=f,s.allowRescaling=function(g,l,m,y){return l===1&&m>Math.ceil(1.5*y)&&g!==void 0&&g>255&&!f(g)&&!o(g)&&!function(b){return 57344<=b&&b<=63743}(g)},s.treatGlyphAsBackgroundColor=function(g){return o(g)||function(l){return 9472<=l&&l<=9631}(g)},s.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}}}},s.computeNextVariantOffset=function(g,l,m=0){return(g-(2*Math.round(l)-m))%(2*Math.round(l))}},6052:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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,l,m,y=!1){if(this.selectionStart=l,this.selectionEnd=m,!l||!m||l[0]===m[0]&&l[1]===m[1])return void this.clear();const b=g.buffers.active.ydisp,p=l[1]-b,a=m[1]-b,h=Math.max(p,0),c=Math.min(a,g.rows-1);h>=g.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=p,this.viewportEndRow=a,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=l[0],this.endCol=m[0])}isCellSelected(g,l,m){return!!this.hasSelection&&(m-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&m>=this.viewportCappedStartRow&&l<this.endCol&&m<=this.viewportCappedEndRow:l<this.startCol&&m>=this.viewportCappedStartRow&&l>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,f=this.selectionEnd;return!(!o||!f)&&(o[1]>f[1]||o[1]===f[1]&&o[0]>f[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,s,o){var f=this&&this.__decorate||function(c,u,v,x){var S,k=arguments.length,w=k<3?u:x===null?x=Object.getOwnPropertyDescriptor(u,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,u,v,x);else for(var E=c.length-1;E>=0;E--)(S=c[E])&&(w=(k<3?S(w):k>3?S(u,v,w):S(u,v))||w);return k>3&&w&&Object.defineProperty(u,v,w),w},g=this&&this.__param||function(c,u){return function(v,x){u(v,x,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const l=o(2585),m=o(8460),y=o(844);let b=s.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(c,u,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new a(c,u,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const c=this._measureStrategy.measure();c.width===this.width&&c.height===this.height||(this.width=c.width,this.height=c.height,this._onCharSizeChange.fire())}};s.CharSizeService=b=f([g(2,l.IOptionsService)],b);class p extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(u,v){u!==void 0&&u>0&&v!==void 0&&v>0&&(this._result.width=u,this._result.height=v)}}class a extends p{constructor(u,v,x){super(),this._document=u,this._parentElement=v,this._optionsService=x,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 h extends p{constructor(u){super(),this._optionsService=u,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const v=this._ctx.measureText("W");if(!("width"in v&&"fontBoundingBoxAscent"in v&&"fontBoundingBoxDescent"in v))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const u=this._ctx.measureText("W");return this._validateAndSet(u.width,u.fontBoundingBoxAscent+u.fontBoundingBoxDescent),this._result}}},4269:function(_,s,o){var f=this&&this.__decorate||function(h,c,u,v){var x,S=arguments.length,k=S<3?c:v===null?v=Object.getOwnPropertyDescriptor(c,u):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,c,u,v);else for(var w=h.length-1;w>=0;w--)(x=h[w])&&(k=(S<3?x(k):S>3?x(c,u,k):x(c,u))||k);return S>3&&k&&Object.defineProperty(c,u,k),k},g=this&&this.__param||function(h,c){return function(u,v){c(u,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const l=o(3734),m=o(643),y=o(511),b=o(2585);class p extends l.AttributeData{constructor(c,u,v){super(),this.content=0,this.combinedData="",this.fg=c.fg,this.bg=c.bg,this.combinedData=u,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(c){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=p;let a=s.CharacterJoinerService=class G_{constructor(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(c){const u={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(u),u.id}deregister(c){for(let u=0;u<this._characterJoiners.length;u++)if(this._characterJoiners[u].id===c)return this._characterJoiners.splice(u,1),!0;return!1}getJoinedCharacters(c){if(this._characterJoiners.length===0)return[];const u=this._bufferService.buffer.lines.get(c);if(!u||u.length===0)return[];const v=[],x=u.translateToString(!0);let S=0,k=0,w=0,E=u.getFg(0),R=u.getBg(0);for(let I=0;I<u.getTrimmedLength();I++)if(u.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==R){if(I-S>1){const T=this._getJoinedRanges(x,w,k,u,S);for(let D=0;D<T.length;D++)v.push(T[D])}S=I,w=k,E=this._workCell.fg,R=this._workCell.bg}k+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const I=this._getJoinedRanges(x,w,k,u,S);for(let T=0;T<I.length;T++)v.push(I[T])}return v}_getJoinedRanges(c,u,v,x,S){const k=c.substring(u,v);let w=[];try{w=this._characterJoiners[0].handler(k)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const R=this._characterJoiners[E].handler(k);for(let I=0;I<R.length;I++)G_._mergeRanges(w,R[I])}catch(R){console.error(R)}return this._stringRangesToCellRanges(w,x,S),w}_stringRangesToCellRanges(c,u,v){let x=0,S=!1,k=0,w=c[x];if(w){for(let E=v;E<this._bufferService.cols;E++){const R=u.getWidth(E),I=u.getString(E).length||m.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!S&&w[0]<=k&&(w[0]=E,S=!0),w[1]<=k){if(w[1]=E,w=c[++x],!w)break;w[0]<=k?(w[0]=E,S=!0):S=!1}k+=I}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(c,u){let v=!1;for(let x=0;x<c.length;x++){const S=c[x];if(v){if(u[1]<=S[0])return c[x-1][1]=u[1],c;if(u[1]<=S[1])return c[x-1][1]=Math.max(u[1],S[1]),c.splice(x,1),c;c.splice(x,1),x--}else{if(u[1]<=S[0])return c.splice(x,0,u),c;if(u[1]<=S[1])return S[0]=Math.min(u[0],S[0]),c;u[0]<S[1]&&(S[0]=Math.min(u[0],S[0]),v=!0)}}return v?c[c.length-1][1]=u[1]:c.push(u),c}};s.CharacterJoinerService=a=f([g(0,b.IBufferService)],a)},5114:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const f=o(844),g=o(8460),l=o(3656);class m extends f.Disposable{constructor(p,a,h){super(),this._textarea=p,this._window=a,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(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(c=>this._screenDprMonitor.setWindow(c))),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(p){this._window!==p&&(this._window=p,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}}s.CoreBrowserService=m;class y extends f.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new f.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,f.toDisposable)(()=>this.clearListener()))}setWindow(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)==null||p.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:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const f=o(844);class g extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const y=this.linkProviders.indexOf(m);y!==-1&&this.linkProviders.splice(y,1)}}}}s.LinkProviderService=g},8934:function(_,s,o){var f=this&&this.__decorate||function(b,p,a,h){var c,u=arguments.length,v=u<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,a):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(b,p,a,h);else for(var x=b.length-1;x>=0;x--)(c=b[x])&&(v=(u<3?c(v):u>3?c(p,a,v):c(p,a))||v);return u>3&&v&&Object.defineProperty(p,a,v),v},g=this&&this.__param||function(b,p){return function(a,h){p(a,h,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const l=o(4725),m=o(9806);let y=s.MouseService=class{constructor(b,p){this._renderService=b,this._charSizeService=p}getCoords(b,p,a,h,c){return(0,m.getCoords)(window,b,p,a,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,c)}getMouseReportCoords(b,p){const a=(0,m.getCoordsRelativeToElement)(window,b,p);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};s.MouseService=y=f([g(0,l.IRenderService),g(1,l.ICharSizeService)],y)},3230:function(_,s,o){var f=this&&this.__decorate||function(c,u,v,x){var S,k=arguments.length,w=k<3?u:x===null?x=Object.getOwnPropertyDescriptor(u,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,u,v,x);else for(var E=c.length-1;E>=0;E--)(S=c[E])&&(w=(k<3?S(w):k>3?S(u,v,w):S(u,v))||w);return k>3&&w&&Object.defineProperty(u,v,w),w},g=this&&this.__param||function(c,u){return function(v,x){u(v,x,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const l=o(6193),m=o(4725),y=o(8460),b=o(844),p=o(7226),a=o(2585);let h=s.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(c,u,v,x,S,k,w,E){super(),this._rowCount=c,this._charSizeService=x,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new b.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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer((R,I)=>this._renderRows(R,I),w),this.register(this._renderDebouncer),this.register(w.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()})),this.register(v.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(w.window,u),this.register(w.onWindowChange(R=>this._registerIntersectionObserver(R,u)))}_registerIntersectionObserver(c,u){if("IntersectionObserver"in c){const v=new c.IntersectionObserver(x=>this._handleIntersectionChange(x[x.length-1]),{threshold:0});v.observe(u),this._observerDisposable.value=(0,b.toDisposable)(()=>v.disconnect())}}_handleIntersectionChange(c){this._isPaused=c.isIntersecting===void 0?c.intersectionRatio===0:!c.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(c,u,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(c,u,this._rowCount))}_renderRows(c,u){this._renderer.value&&(c=Math.min(c,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(c,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:c,end:u}),this._onRender.fire({start:c,end:u}),this._isNextRenderRedrawOnly=!0)}resize(c,u){this._rowCount=u,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(c){this._renderer.value=c,this._renderer.value&&(this._renderer.value.onRequestRedraw(u=>this.refreshRows(u.start,u.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(c){return this._renderDebouncer.addRefreshCallback(c)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var c,u;this._renderer.value&&((u=(c=this._renderer.value).clearTextureAtlas)==null||u.call(c),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(c,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(c,u)}):this._renderer.value.handleResize(c,u),this._fullRefresh())}handleCharSizeChanged(){var c;(c=this._renderer.value)==null||c.handleCharSizeChanged()}handleBlur(){var c;(c=this._renderer.value)==null||c.handleBlur()}handleFocus(){var c;(c=this._renderer.value)==null||c.handleFocus()}handleSelectionChanged(c,u,v){var x;this._selectionState.start=c,this._selectionState.end=u,this._selectionState.columnSelectMode=v,(x=this._renderer.value)==null||x.handleSelectionChanged(c,u,v)}handleCursorMove(){var c;(c=this._renderer.value)==null||c.handleCursorMove()}clear(){var c;(c=this._renderer.value)==null||c.clear()}};s.RenderService=h=f([g(2,a.IOptionsService),g(3,m.ICharSizeService),g(4,a.IDecorationService),g(5,a.IBufferService),g(6,m.ICoreBrowserService),g(7,m.IThemeService)],h)},9312:function(_,s,o){var f=this&&this.__decorate||function(w,E,R,I){var T,D=arguments.length,N=D<3?E:I===null?I=Object.getOwnPropertyDescriptor(E,R):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,E,R,I);else for(var $=w.length-1;$>=0;$--)(T=w[$])&&(N=(D<3?T(N):D>3?T(E,R,N):T(E,R))||N);return D>3&&N&&Object.defineProperty(E,R,N),N},g=this&&this.__param||function(w,E){return function(R,I){E(R,I,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const l=o(9806),m=o(9504),y=o(456),b=o(4725),p=o(8460),a=o(844),h=o(6114),c=o(4841),u=o(511),v=o(2585),x=" ",S=new RegExp(x,"g");let k=s.SelectionService=class extends a.Disposable{constructor(w,E,R,I,T,D,N,$,U){super(),this._element=w,this._screenElement=E,this._linkifier=R,this._bufferService=I,this._coreService=T,this._mouseService=D,this._optionsService=N,this._renderService=$,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=P=>this._handleMouseMove(P),this._mouseUpListener=P=>this._handleMouseUp(P),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(P=>this._handleTrim(P)),this.register(this._bufferService.buffers.onBufferActivate(P=>this._handleBufferActivate(P))),this.enable(),this._model=new y.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.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 w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!w||!E||w[0]===E[0]&&w[1]===E[1])}get selectionText(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!w||!E)return"";const R=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(w[0]===E[0])return"";const T=w[0]<E[0]?w[0]:E[0],D=w[0]<E[0]?E[0]:w[0];for(let N=w[1];N<=E[1];N++){const $=R.translateBufferLineToString(N,!0,T,D);I.push($)}}else{const T=w[1]===E[1]?E[0]:void 0;I.push(R.translateBufferLineToString(w[1],!0,w[0],T));for(let D=w[1]+1;D<=E[1]-1;D++){const N=R.lines.get(D),$=R.translateBufferLineToString(D,!0);N!=null&&N.isWrapped?I[I.length-1]+=$:I.push($)}if(w[1]!==E[1]){const D=R.lines.get(E[1]),N=R.translateBufferLineToString(E[1],!0,0,E[0]);D&&D.isWrapped?I[I.length-1]+=N:I.push(N)}}return I.map(T=>T.replace(S," ")).join(h.isWindows?`\r
45
+ `:`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&w&&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(w){const E=this._getMouseBufferCoords(w),R=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(R&&I&&E)&&this._areCoordsInSelection(E,R,I)}isCellInSelection(w,E){const R=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!R||!I)&&this._areCoordsInSelection([w,E],R,I)}_areCoordsInSelection(w,E,R){return w[1]>E[1]&&w[1]<R[1]||E[1]===R[1]&&w[1]===E[1]&&w[0]>=E[0]&&w[0]<R[0]||E[1]<R[1]&&w[1]===R[1]&&w[0]<R[0]||E[1]<R[1]&&w[1]===E[1]&&w[0]>=E[0]}_selectWordAtCursor(w,E){var T,D;const R=(D=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:D.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,c.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(w);return!!I&&(this._selectWordAt(I,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,E){this._model.clearSelection(),w=Math.max(w,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const E=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(w){let E=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=R?0:(E>R&&(E-=R),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(w){return h.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const E=this._getMouseBufferCoords(w);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(w){return w.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!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(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const I=R.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const E=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const I=(0,m.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,R=!(!w||!E||w[0]===E[0]&&w[1]===E[1]);R?w&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,E,R)):this._oldHasSelection&&this._fireOnSelectionChange(w,E,R)}_fireOnSelectionChange(w,E,R){this._oldSelectionStart=w,this._oldSelectionEnd=E,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(w,E){let R=E;for(let I=0;E>=I;I++){const T=w.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&E!==I&&(R+=T-1)}return R}setSelection(w,E,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,E],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,E,R=!0,I=!0){if(w[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,D=T.lines.get(w[1]);if(!D)return;const N=T.translateBufferLineToString(w[1],!1);let $=this._convertViewportColToCharacterIndex(D,w[0]),U=$;const P=w[0]-$;let H=0,L=0,A=0,j=0;if(N.charAt($)===" "){for(;$>0&&N.charAt($-1)===" ";)$--;for(;U<N.length&&N.charAt(U+1)===" ";)U++}else{let Y=w[0],te=w[0];D.getWidth(Y)===0&&(H++,Y--),D.getWidth(te)===2&&(L++,te++);const Q=D.getString(te).length;for(Q>1&&(j+=Q-1,U+=Q-1);Y>0&&$>0&&!this._isCharWordSeparator(D.loadCell(Y-1,this._workCell));){D.loadCell(Y-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,Y--):W>1&&(A+=W-1,$-=W-1),$--,Y--}for(;te<D.length&&U+1<N.length&&!this._isCharWordSeparator(D.loadCell(te+1,this._workCell));){D.loadCell(te+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,te++):W>1&&(j+=W-1,U+=W-1),U++,te++}}U++;let z=$+P-H+A,K=Math.min(this._bufferService.cols,U-$+H+L-A-j);if(E||N.slice($,U).trim()!==""){if(R&&z===0&&D.getCodePoint(0)!==32){const Y=T.lines.get(w[1]-1);if(Y&&D.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const te=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(te){const Q=this._bufferService.cols-te.start;z-=Q,K+=Q}}}if(I&&z+K===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const Y=T.lines.get(w[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const te=this._getWordAt([0,w[1]+1],!1,!1,!0);te&&(K+=te.length)}}return{start:z,length:K}}}_selectWordAt(w,E){const R=this._getWordAt(w,E);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[R.start,w[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(w){const E=this._getWordAt(w,!0);if(E){let R=w[1];for(;E.start<0;)E.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,R]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const E=this._bufferService.buffer.getWrappedRangeForLine(w),R={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,c.getRangeLength)(R,this._bufferService.cols)}};s.SelectionService=k=f([g(3,v.IBufferService),g(4,v.ICoreService),g(5,b.IMouseService),g(6,v.IOptionsService),g(7,b.IRenderService),g(8,b.ICoreBrowserService)],k)},4725:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const f=o(8343);s.ICharSizeService=(0,f.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),s.IMouseService=(0,f.createDecorator)("MouseService"),s.IRenderService=(0,f.createDecorator)("RenderService"),s.ISelectionService=(0,f.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,f.createDecorator)("ThemeService"),s.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(_,s,o){var f=this&&this.__decorate||function(k,w,E,R){var I,T=arguments.length,D=T<3?w:R===null?R=Object.getOwnPropertyDescriptor(w,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(k,w,E,R);else for(var N=k.length-1;N>=0;N--)(I=k[N])&&(D=(T<3?I(D):T>3?I(w,E,D):I(w,E))||D);return T>3&&D&&Object.defineProperty(w,E,D),D},g=this&&this.__param||function(k,w){return function(E,R){w(E,R,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const l=o(7239),m=o(8055),y=o(8460),b=o(844),p=o(2585),a=m.css.toColor("#ffffff"),h=m.css.toColor("#000000"),c=m.css.toColor("#ffffff"),u=m.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let E=0;E<216;E++){const R=w[E/36%6|0],I=w[E/6%6|0],T=w[E%6];k.push({css:m.channels.toCss(R,I,T),rgba:m.channels.toRgba(R,I,T)})}for(let E=0;E<24;E++){const R=8+10*E;k.push({css:m.channels.toCss(R,R,R),rgba:m.channels.toRgba(R,R,R)})}return k})());let x=s.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:h,cursor:c,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:m.color.blend(h,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:m.color.blend(h,v),ansi:s.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(k={}){const w=this._colors;if(w.foreground=S(k.foreground,a),w.background=S(k.background,h),w.cursor=S(k.cursor,c),w.cursorAccent=S(k.cursorAccent,u),w.selectionBackgroundTransparent=S(k.selectionBackground,v),w.selectionBackgroundOpaque=m.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=S(k.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=m.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=k.selectionForeground?S(k.selectionForeground,m.NULL_COLOR):void 0,w.selectionForeground===m.NULL_COLOR&&(w.selectionForeground=void 0),m.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=m.color.opacity(w.selectionBackgroundTransparent,.3)),m.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=m.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=s.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=S(k.black,s.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=S(k.red,s.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=S(k.green,s.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=S(k.yellow,s.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=S(k.blue,s.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=S(k.magenta,s.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=S(k.cyan,s.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=S(k.white,s.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=S(k.brightBlack,s.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=S(k.brightRed,s.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=S(k.brightGreen,s.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=S(k.brightYellow,s.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=S(k.brightBlue,s.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=S(k.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=S(k.brightCyan,s.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=S(k.brightWhite,s.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const E=Math.min(w.ansi.length-16,k.extendedAnsi.length);for(let R=0;R<E;R++)w.ansi[R+16]=S(k.extendedAnsi[R],s.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(k){k(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function S(k,w){if(k!==void 0)try{return m.css.toColor(k)}catch{}return w}s.ThemeService=x=f([g(0,p.IOptionsService)],x)},6349:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const f=o(8460),g=o(844);class l extends g.Disposable{constructor(y){super(),this._maxLength=y,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(y){if(this._maxLength===y)return;const b=new Array(y);for(let p=0;p<Math.min(y,this.length);p++)b[p]=this._array[this._getCyclicIndex(p)];this._array=b,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let b=this._length;b<y;b++)this._array[b]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,b){this._array[this._getCyclicIndex(y)]=b}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,b,...p){if(b){for(let a=y;a<this._length-b;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+b)];this._length-=b,this.onDeleteEmitter.fire({index:y,amount:b})}for(let a=this._length-1;a>=y;a--)this._array[this._getCyclicIndex(a+p.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<p.length;a++)this._array[this._getCyclicIndex(y+a)]=p[a];if(p.length&&this.onInsertEmitter.fire({index:y,amount:p.length}),this._length+p.length>this._maxLength){const a=this._length+p.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=p.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,b,p){if(!(b<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let h=b-1;h>=0;h--)this.set(y+h+p,this.get(y+h));const a=y+b+p-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<b;a++)this.set(y+a+p,this.get(y+a))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}s.CircularList=l},1439:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(f,g=5){if(typeof f!="object")return f;const l=Array.isArray(f)?[]:{};for(const m in f)l[m]=g<=1?f[m]:f[m]&&o(f[m],g-1);return l}},8055:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,f=0,g=0,l=0;var m,y,b,p,a;function h(u){const v=u.toString(16);return v.length<2?"0"+v:v}function c(u,v){return u<v?(v+.05)/(u+.05):(u+.05)/(v+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(v,x,S,k){return k!==void 0?`#${h(v)}${h(x)}${h(S)}${h(k)}`:`#${h(v)}${h(x)}${h(S)}`},u.toRgba=function(v,x,S,k=255){return(v<<24|x<<16|S<<8|k)>>>0},u.toColor=function(v,x,S,k){return{css:u.toCss(v,x,S,k),rgba:u.toRgba(v,x,S,k)}}}(m||(s.channels=m={})),function(u){function v(x,S){return l=Math.round(255*S),[o,f,g]=a.toChannels(x.rgba),{css:m.toCss(o,f,g,l),rgba:m.toRgba(o,f,g,l)}}u.blend=function(x,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const k=S.rgba>>24&255,w=S.rgba>>16&255,E=S.rgba>>8&255,R=x.rgba>>24&255,I=x.rgba>>16&255,T=x.rgba>>8&255;return o=R+Math.round((k-R)*l),f=I+Math.round((w-I)*l),g=T+Math.round((E-T)*l),{css:m.toCss(o,f,g),rgba:m.toRgba(o,f,g)}},u.isOpaque=function(x){return(255&x.rgba)==255},u.ensureContrastRatio=function(x,S,k){const w=a.ensureContrastRatio(x.rgba,S.rgba,k);if(w)return m.toColor(w>>24&255,w>>16&255,w>>8&255)},u.opaque=function(x){const S=(255|x.rgba)>>>0;return[o,f,g]=a.toChannels(S),{css:m.toCss(o,f,g),rgba:S}},u.opacity=v,u.multiplyOpacity=function(x,S){return l=255&x.rgba,v(x,l*S/255)},u.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}}(y||(s.color=y={})),function(u){let v,x;try{const S=document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d",{willReadFrequently:!0});k&&(v=k,v.globalCompositeOperation="copy",x=v.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return o=parseInt(S.slice(1,2).repeat(2),16),f=parseInt(S.slice(2,3).repeat(2),16),g=parseInt(S.slice(3,4).repeat(2),16),m.toColor(o,f,g);case 5:return o=parseInt(S.slice(1,2).repeat(2),16),f=parseInt(S.slice(2,3).repeat(2),16),g=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),m.toColor(o,f,g,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const k=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return o=parseInt(k[1]),f=parseInt(k[2]),g=parseInt(k[3]),l=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),m.toColor(o,f,g,l);if(!v||!x)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=x,v.fillStyle=S,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[o,f,g,l]=v.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(o,f,g,l),css:S}}}(b||(s.css=b={})),function(u){function v(x,S,k){const w=x/255,E=S/255,R=k/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}u.relativeLuminance=function(x){return v(x>>16&255,x>>8&255,255&x)},u.relativeLuminance2=v}(p||(s.rgb=p={})),function(u){function v(S,k,w){const E=S>>24&255,R=S>>16&255,I=S>>8&255;let T=k>>24&255,D=k>>16&255,N=k>>8&255,$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));for(;$<w&&(T>0||D>0||N>0);)T-=Math.max(0,Math.ceil(.1*T)),D-=Math.max(0,Math.ceil(.1*D)),N-=Math.max(0,Math.ceil(.1*N)),$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));return(T<<24|D<<16|N<<8|255)>>>0}function x(S,k,w){const E=S>>24&255,R=S>>16&255,I=S>>8&255;let T=k>>24&255,D=k>>16&255,N=k>>8&255,$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));for(;$<w&&(T<255||D<255||N<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),D=Math.min(255,D+Math.ceil(.1*(255-D))),N=Math.min(255,N+Math.ceil(.1*(255-N))),$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));return(T<<24|D<<16|N<<8|255)>>>0}u.blend=function(S,k){if(l=(255&k)/255,l===1)return k;const w=k>>24&255,E=k>>16&255,R=k>>8&255,I=S>>24&255,T=S>>16&255,D=S>>8&255;return o=I+Math.round((w-I)*l),f=T+Math.round((E-T)*l),g=D+Math.round((R-D)*l),m.toRgba(o,f,g)},u.ensureContrastRatio=function(S,k,w){const E=p.relativeLuminance(S>>8),R=p.relativeLuminance(k>>8);if(c(E,R)<w){if(R<E){const D=v(S,k,w),N=c(E,p.relativeLuminance(D>>8));if(N<w){const $=x(S,k,w);return N>c(E,p.relativeLuminance($>>8))?D:$}return D}const I=x(S,k,w),T=c(E,p.relativeLuminance(I>>8));if(T<w){const D=v(S,k,w);return T>c(E,p.relativeLuminance(D>>8))?I:D}return I}},u.reduceLuminance=v,u.increaseLuminance=x,u.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(a||(s.rgba=a={})),s.toPaddedHex=h,s.contrastRatio=c},8969:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const f=o(844),g=o(2585),l=o(4348),m=o(7866),y=o(744),b=o(7302),p=o(6975),a=o(8460),h=o(1753),c=o(1480),u=o(7994),v=o(9282),x=o(5435),S=o(5981),k=o(2660);let w=!1;class E extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event(I=>{var T;(T=this._onScrollApi)==null||T.fire(I.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(I){for(const T in I)this.optionsService.options[T]=I[T]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new b.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(c.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.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(T=>{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(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new S.WriteBuffer((T,D)=>this._inputHandler.parse(T,D))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,T){this._writeBuffer.write(I,T)}writeSync(I,T){this._logService.logLevel<=g.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(I,T)}input(I,T=!0){this.coreService.triggerDataEvent(I,T)}resize(I,T){isNaN(I)||isNaN(T)||(I=Math.max(I,y.MINIMUM_COLS),T=Math.max(T,y.MINIMUM_ROWS),this._bufferService.resize(I,T))}scroll(I,T=!1){this._bufferService.scroll(I,T)}scrollLines(I,T,D){this._bufferService.scrollLines(I,T,D)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const T=I-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(I,T){return this._inputHandler.registerEscHandler(I,T)}registerDcsHandler(I,T){return this._inputHandler.registerDcsHandler(I,T)}registerCsiHandler(I,T){return this._inputHandler.registerCsiHandler(I,T)}registerOscHandler(I,T){return this._inputHandler.registerOscHandler(I,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?I=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const T of I)T.dispose()})}}}s.CoreTerminal=E},8460:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===o)return void this._listeners.splice(f,1)}}})),this._event}fire(o,f){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,o,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,f){return o(g=>f.fire(g))},s.runAndSubscribe=function(o,f){return f(void 0),o(g=>f(g))}},5435:function(_,s,o){var f=this&&this.__decorate||function(H,L,A,j){var z,K=arguments.length,Y=K<3?L:j===null?j=Object.getOwnPropertyDescriptor(L,A):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(H,L,A,j);else for(var te=H.length-1;te>=0;te--)(z=H[te])&&(Y=(K<3?z(Y):K>3?z(L,A,Y):z(L,A))||Y);return K>3&&Y&&Object.defineProperty(L,A,Y),Y},g=this&&this.__param||function(H,L){return function(A,j){L(A,j,H)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const l=o(2584),m=o(7116),y=o(2015),b=o(844),p=o(482),a=o(8437),h=o(8460),c=o(643),u=o(511),v=o(3734),x=o(2585),S=o(1480),k=o(6242),w=o(6351),E=o(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function T(H,L){if(H>24)return L.setWinLines||!1;switch(H){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var D;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(s.WindowsOptionsReportType=D={}));let N=0;class $ extends b.Disposable{getAttrData(){return this._curAttrData}constructor(L,A,j,z,K,Y,te,Q,W=new y.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=A,this._coreService=j,this._logService=z,this._optionsService=K,this._oscLinkService=Y,this._coreMouseService=te,this._unicodeService=Q,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(M=>this._activeBuffer=M.activeBuffer)),this._parser.setCsiHandlerFallback((M,G)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(M),params:G.toArray()})}),this._parser.setEscHandlerFallback(M=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(M)})}),this._parser.setExecuteHandlerFallback(M=>{this._logService.debug("Unknown EXECUTE code: ",{code:M})}),this._parser.setOscHandlerFallback((M,G,V)=>{this._logService.debug("Unknown OSC code: ",{identifier:M,action:G,data:V})}),this._parser.setDcsHandlerFallback((M,G,V)=>{G==="HOOK"&&(V=V.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(M),action:G,payload:V})}),this._parser.setPrintHandler((M,G,V)=>this.print(M,G,V)),this._parser.registerCsiHandler({final:"@"},M=>this.insertChars(M)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},M=>this.scrollLeft(M)),this._parser.registerCsiHandler({final:"A"},M=>this.cursorUp(M)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},M=>this.scrollRight(M)),this._parser.registerCsiHandler({final:"B"},M=>this.cursorDown(M)),this._parser.registerCsiHandler({final:"C"},M=>this.cursorForward(M)),this._parser.registerCsiHandler({final:"D"},M=>this.cursorBackward(M)),this._parser.registerCsiHandler({final:"E"},M=>this.cursorNextLine(M)),this._parser.registerCsiHandler({final:"F"},M=>this.cursorPrecedingLine(M)),this._parser.registerCsiHandler({final:"G"},M=>this.cursorCharAbsolute(M)),this._parser.registerCsiHandler({final:"H"},M=>this.cursorPosition(M)),this._parser.registerCsiHandler({final:"I"},M=>this.cursorForwardTab(M)),this._parser.registerCsiHandler({final:"J"},M=>this.eraseInDisplay(M,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},M=>this.eraseInDisplay(M,!0)),this._parser.registerCsiHandler({final:"K"},M=>this.eraseInLine(M,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},M=>this.eraseInLine(M,!0)),this._parser.registerCsiHandler({final:"L"},M=>this.insertLines(M)),this._parser.registerCsiHandler({final:"M"},M=>this.deleteLines(M)),this._parser.registerCsiHandler({final:"P"},M=>this.deleteChars(M)),this._parser.registerCsiHandler({final:"S"},M=>this.scrollUp(M)),this._parser.registerCsiHandler({final:"T"},M=>this.scrollDown(M)),this._parser.registerCsiHandler({final:"X"},M=>this.eraseChars(M)),this._parser.registerCsiHandler({final:"Z"},M=>this.cursorBackwardTab(M)),this._parser.registerCsiHandler({final:"`"},M=>this.charPosAbsolute(M)),this._parser.registerCsiHandler({final:"a"},M=>this.hPositionRelative(M)),this._parser.registerCsiHandler({final:"b"},M=>this.repeatPrecedingCharacter(M)),this._parser.registerCsiHandler({final:"c"},M=>this.sendDeviceAttributesPrimary(M)),this._parser.registerCsiHandler({prefix:">",final:"c"},M=>this.sendDeviceAttributesSecondary(M)),this._parser.registerCsiHandler({final:"d"},M=>this.linePosAbsolute(M)),this._parser.registerCsiHandler({final:"e"},M=>this.vPositionRelative(M)),this._parser.registerCsiHandler({final:"f"},M=>this.hVPosition(M)),this._parser.registerCsiHandler({final:"g"},M=>this.tabClear(M)),this._parser.registerCsiHandler({final:"h"},M=>this.setMode(M)),this._parser.registerCsiHandler({prefix:"?",final:"h"},M=>this.setModePrivate(M)),this._parser.registerCsiHandler({final:"l"},M=>this.resetMode(M)),this._parser.registerCsiHandler({prefix:"?",final:"l"},M=>this.resetModePrivate(M)),this._parser.registerCsiHandler({final:"m"},M=>this.charAttributes(M)),this._parser.registerCsiHandler({final:"n"},M=>this.deviceStatus(M)),this._parser.registerCsiHandler({prefix:"?",final:"n"},M=>this.deviceStatusPrivate(M)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},M=>this.softReset(M)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},M=>this.setCursorStyle(M)),this._parser.registerCsiHandler({final:"r"},M=>this.setScrollRegion(M)),this._parser.registerCsiHandler({final:"s"},M=>this.saveCursor(M)),this._parser.registerCsiHandler({final:"t"},M=>this.windowOptions(M)),this._parser.registerCsiHandler({final:"u"},M=>this.restoreCursor(M)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},M=>this.insertColumns(M)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},M=>this.deleteColumns(M)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},M=>this.selectProtected(M)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},M=>this.requestMode(M,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},M=>this.requestMode(M,!1)),this._parser.setExecuteHandler(l.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(l.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(l.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(l.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(l.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(l.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(l.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(l.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(l.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(l.C1.IND,()=>this.index()),this._parser.setExecuteHandler(l.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(l.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(M=>(this.setTitle(M),this.setIconName(M),!0))),this._parser.registerOscHandler(1,new k.OscHandler(M=>this.setIconName(M))),this._parser.registerOscHandler(2,new k.OscHandler(M=>this.setTitle(M))),this._parser.registerOscHandler(4,new k.OscHandler(M=>this.setOrReportIndexedColor(M))),this._parser.registerOscHandler(8,new k.OscHandler(M=>this.setHyperlink(M))),this._parser.registerOscHandler(10,new k.OscHandler(M=>this.setOrReportFgColor(M))),this._parser.registerOscHandler(11,new k.OscHandler(M=>this.setOrReportBgColor(M))),this._parser.registerOscHandler(12,new k.OscHandler(M=>this.setOrReportCursorColor(M))),this._parser.registerOscHandler(104,new k.OscHandler(M=>this.restoreIndexedColor(M))),this._parser.registerOscHandler(110,new k.OscHandler(M=>this.restoreFgColor(M))),this._parser.registerOscHandler(111,new k.OscHandler(M=>this.restoreBgColor(M))),this._parser.registerOscHandler(112,new k.OscHandler(M=>this.restoreCursorColor(M))),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 M in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:M},()=>this.selectCharset("("+M)),this._parser.registerEscHandler({intermediates:")",final:M},()=>this.selectCharset(")"+M)),this._parser.registerEscHandler({intermediates:"*",final:M},()=>this.selectCharset("*"+M)),this._parser.registerEscHandler({intermediates:"+",final:M},()=>this.selectCharset("+"+M)),this._parser.registerEscHandler({intermediates:"-",final:M},()=>this.selectCharset("-"+M)),this._parser.registerEscHandler({intermediates:".",final:M},()=>this.selectCharset("."+M)),this._parser.registerEscHandler({intermediates:"/",final:M},()=>this.selectCharset("/"+M));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(M=>(this._logService.error("Parsing error: ",M),M)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler((M,G)=>this.requestStatusString(M,G)))}_preserveStack(L,A,j,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=j,this._parseStack.position=z}_logSlowResolvingAsync(L){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([L,new Promise((A,j)=>setTimeout(()=>j("#SLOW_TIMEOUT"),5e3))]).catch(A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,A){let j,z=this._activeBuffer.x,K=this._activeBuffer.y,Y=0;const te=this._parseStack.paused;if(te){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(j),j;z=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>I&&(Y=this._parseStack.position+I)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,M=>String.fromCharCode(M)).join("")}"`),typeof L=="string"?L.split("").map(M=>M.charCodeAt(0)):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(L.length,I))),te||this._dirtyRowTracker.clearRange(),L.length>I)for(let M=Y;M<L.length;M+=I){const G=M+I<L.length?M+I:L.length,V=typeof L=="string"?this._stringDecoder.decode(L.substring(M,G),this._parseBuffer):this._utf8Decoder.decode(L.subarray(M,G),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,V))return this._preserveStack(z,K,V,M),this._logSlowResolvingAsync(j),j}else if(!te){const M=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,M))return this._preserveStack(z,K,M,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===z&&this._activeBuffer.y===K||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(L,A,j){let z,K;const Y=this._charsetService.charset,te=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,M=this._coreService.modes.insertMode,G=this._curAttrData;let V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-A>0&&V.getWidth(this._activeBuffer.x-1)===2&&V.setCellFromCodepoint(this._activeBuffer.x-1,0,1,G);let re=this._parser.precedingJoinState;for(let ie=A;ie<j;++ie){if(z=L[ie],z<127&&Y){const xe=Y[String.fromCharCode(z)];xe&&(z=xe.charCodeAt(0))}const me=this._unicodeService.charProperties(z,re);K=S.UnicodeService.extractWidth(me);const ue=S.UnicodeService.extractShouldJoin(me),Re=ue?S.UnicodeService.extractWidth(re):0;if(re=me,te&&this._onA11yChar.fire((0,p.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-Re>Q){if(W){const xe=V;let pe=this._activeBuffer.x-Re;for(this._activeBuffer.x=Re,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),V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Re>0&&V instanceof a.BufferLine&&V.copyCellsFrom(xe,pe,0,Re,!1);pe<Q;)xe.setCellFromCodepoint(pe++,0,1,G)}else if(this._activeBuffer.x=Q-1,K===2)continue}if(ue&&this._activeBuffer.x){const xe=V.getWidth(this._activeBuffer.x-1)?1:2;V.addCodepointToCell(this._activeBuffer.x-xe,z,K);for(let pe=K-Re;--pe>=0;)V.setCellFromCodepoint(this._activeBuffer.x++,0,0,G)}else if(M&&(V.insertCells(this._activeBuffer.x,K-Re,this._activeBuffer.getNullCell(G)),V.getWidth(Q-1)===2&&V.setCellFromCodepoint(Q-1,c.NULL_CELL_CODE,c.NULL_CELL_WIDTH,G)),V.setCellFromCodepoint(this._activeBuffer.x++,z,K,G),K>0)for(;--K;)V.setCellFromCodepoint(this._activeBuffer.x++,0,0,G)}this._parser.precedingJoinState=re,this._activeBuffer.x<Q&&j-A>0&&V.getWidth(this._activeBuffer.x)===0&&!V.hasContent(this._activeBuffer.x)&&V.setCellFromCodepoint(this._activeBuffer.x,0,1,G),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,A){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,A):this._parser.registerCsiHandler(L,j=>!T(j.params[0],this._optionsService.rawOptions.windowOptions)||A(j))}registerDcsHandler(L,A){return this._parser.registerDcsHandler(L,new w.DcsHandler(A))}registerEscHandler(L,A){return this._parser.registerEscHandler(L,A)}registerOscHandler(L,A){return this._parser.registerOscHandler(L,new k.OscHandler(A))}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 L;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&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=L,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+A)}cursorUp(L){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const A=L.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=L.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=L.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const A=L.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,A,j,z=!1,K=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Y.replaceCells(A,j,this._activeBuffer.getNullCell(this._eraseAttrData()),K),z&&(Y.isWrapped=!1)}_resetBufferLine(L,A=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),j.isWrapped=!1)}eraseInDisplay(L,A=!1){let j;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);j<this._bufferService.rows;j++)this._resetBufferLine(j,A);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,A);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(L,A=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let A=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;A--;)this._activeBuffer.lines.splice(K-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let A=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;A--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let A=L.params[0]||1;for(;A--;)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(L){let A=L.params[0]||1;for(;A--;)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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const A=this._parser.precedingJoinState;if(!A)return!0;const j=L.params[0]||1,z=S.UnicodeService.extractWidth(A),K=this._activeBuffer.x-z,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),te=new Uint32Array(Y.length*j);let Q=0;for(let M=0;M<Y.length;){const G=Y.codePointAt(M)||0;te[Q++]=G,M+=G>65535?2:1}let W=Q;for(let M=1;M<j;++M)te.copyWithin(W,0,Q),W+=Q;return this.print(te,0,W),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let A=0;A<L.length;A++)switch(L.params[A]){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(),L.params[A]===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(L,A){const j=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:K}=this._coreMouseService,Y=this._coreService,{buffers:te,cols:Q}=this._bufferService,{active:W,alt:M}=te,G=this._optionsService.rawOptions,V=ue=>ue?1:2,re=L.params[0];return ie=re,me=A?re===2?4:re===4?V(Y.modes.insertMode):re===12?3:re===20?V(G.convertEol):0:re===1?V(j.applicationCursorKeys):re===3?G.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:re===6?V(j.origin):re===7?V(j.wraparound):re===8?3:re===9?V(z==="X10"):re===12?V(G.cursorBlink):re===25?V(!Y.isCursorHidden):re===45?V(j.reverseWraparound):re===66?V(j.applicationKeypad):re===67?4:re===1e3?V(z==="VT200"):re===1002?V(z==="DRAG"):re===1003?V(z==="ANY"):re===1004?V(j.sendFocus):re===1005?4:re===1006?V(K==="SGR"):re===1015?4:re===1016?V(K==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?V(W===M):re===2004?V(j.bracketedPasteMode):0,Y.triggerDataEvent(`${l.C0.ESC}[${A?"":"?"}${ie};${me}$y`),!0;var ie,me}_updateAttrColor(L,A,j,z,K){return A===2?(L|=50331648,L&=-16777216,L|=v.AttributeData.fromColorRGB([j,z,K])):A===5&&(L&=-50331904,L|=33554432|255&j),L}_extractColor(L,A,j){const z=[0,0,-1,0,0,0];let K=0,Y=0;do{if(z[Y+K]=L.params[A+Y],L.hasSubParams(A+Y)){const te=L.getSubParams(A+Y);let Q=0;do z[1]===5&&(K=1),z[Y+Q+1+K]=te[Q];while(++Q<te.length&&Q+Y+1+K<z.length);break}if(z[1]===5&&Y+K>=2||z[1]===2&&Y+K>=5)break;z[1]&&(K=1)}while(++Y+A<L.length&&Y+K<z.length);for(let te=2;te<z.length;++te)z[te]===-1&&(z[te]=0);switch(z[0]){case 38:j.fg=this._updateAttrColor(j.fg,z[1],z[3],z[4],z[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,z[1],z[3],z[4],z[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,z[1],z[3],z[4],z[5])}return Y}_processUnderline(L,A){A.extended=A.extended.clone(),(!~L||L>5)&&(L=1),A.extended.underlineStyle=L,A.fg|=268435456,L===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(L){L.fg=a.DEFAULT_ATTR_DATA.fg,L.bg=a.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=L.length;let j;const z=this._curAttrData;for(let K=0;K<A;K++)j=L.params[K],j>=30&&j<=37?(z.fg&=-50331904,z.fg|=16777216|j-30):j>=40&&j<=47?(z.bg&=-50331904,z.bg|=16777216|j-40):j>=90&&j<=97?(z.fg&=-50331904,z.fg|=16777224|j-90):j>=100&&j<=107?(z.bg&=-50331904,z.bg|=16777224|j-100):j===0?this._processSGR0(z):j===1?z.fg|=134217728:j===3?z.bg|=67108864:j===4?(z.fg|=268435456,this._processUnderline(L.hasSubParams(K)?L.getSubParams(K)[0]:1,z)):j===5?z.fg|=536870912:j===7?z.fg|=67108864:j===8?z.fg|=1073741824:j===9?z.fg|=2147483648:j===2?z.bg|=134217728:j===21?this._processUnderline(2,z):j===22?(z.fg&=-134217729,z.bg&=-134217729):j===23?z.bg&=-67108865:j===24?(z.fg&=-268435457,this._processUnderline(0,z)):j===25?z.fg&=-536870913:j===27?z.fg&=-67108865:j===28?z.fg&=-1073741825:j===29?z.fg&=2147483647:j===39?(z.fg&=-67108864,z.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):j===49?(z.bg&=-67108864,z.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?K+=this._extractColor(L,K,z):j===53?z.bg|=1073741824:j===55?z.bg&=-1073741825:j===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):j===100?(z.fg&=-67108864,z.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${A};${j}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const A=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${A};${j}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.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(L){const A=L.params[0]||1;switch(A){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 j=A%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(L){const A=L.params[0]||1;let j;return(L.length<2||(j=L.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(L){if(!T(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const A=[],j=L.split(";");for(;j.length>1;){const z=j.shift(),K=j.shift();if(/^\d+$/.exec(z)){const Y=parseInt(z);if(P(Y))if(K==="?")A.push({type:0,index:Y});else{const te=(0,E.parseColor)(K);te&&A.push({type:1,index:Y,color:te})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(L){const A=L.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(L,A){this._getCurrentLinkId()&&this._finishHyperlink();const j=L.split(":");let z;const K=j.findIndex(Y=>Y.startsWith("id="));return K!==-1&&(z=j[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,A){const j=L.split(";");for(let z=0;z<j.length&&!(A>=this._specialColors.length);++z,++A)if(j[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const K=(0,E.parseColor)(j[z]);K&&this._onColor.fire([{type:1,index:this._specialColors[A],color:K}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const A=[],j=L.split(";");for(let z=0;z<j.length;++z)if(/^\d+$/.exec(j[z])){const K=parseInt(j[z]);P(K)&&A.push({type:2,index:K})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,m.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(R[L[0]],m.CHARSETS[L[1]]||m.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 L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new u.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const j=this._activeBuffer.ybase+this._activeBuffer.y+A,z=this._activeBuffer.lines.get(j);z&&(z.fill(L),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,A){const j=this._bufferService.buffer,z=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${K}${l.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,A){this._dirtyRowTracker.markRangeDirty(L,A)}}s.InputHandler=$;let U=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,L){H>L&&(N=H,H=L,L=N),H<this.start&&(this.start=H),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function P(H){return 0<=H&&H<256}U=f([g(0,x.IBufferService)],U)},844:(_,s)=>{function o(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},s.toDisposable=function(f){return{dispose:f}},s.disposeArray=o,s.getDisposeArrayDisposable=function(f){return{dispose:()=>o(f)}}},1505:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,l,m){this._data[g]||(this._data[g]={}),this._data[g][l]=m}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(f,g,l,m,y){this._data.get(f,g)||this._data.set(f,g,new o),this._data.get(f,g).set(l,m,y)}get(f,g,l,m){var y;return(y=this._data.get(f,g))==null?void 0:y.get(l,m)}clear(){this._data.clear()}}},6114:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,f=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=o.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),s.isIpad=f==="iPad",s.isIphone=f==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),s.isLinux=f.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(o=this._search(this._getKey(f)),this._array.splice(o,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(o=this._search(g),o===-1)||this._getKey(this._array[o])!==g)return!1;do if(this._array[o]===f)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(o=this._search(f),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===f))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===f)}forEachByKey(f,g){if(this._array.length!==0&&(o=this._search(f),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===f))do g(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===f)}values(){return[...this._array].values()}_search(f){let g=0,l=this._array.length-1;for(;l>=g;){let m=g+l>>1;const y=this._getKey(this._array[m]);if(y>f)l=m-1;else{if(!(y<f)){for(;m>0&&this._getKey(this._array[m-1])===f;)m--;return m}g=m+1}}return g}}},7226:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const f=o(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let b=0,p=0,a=y.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),p=Math.max(b,p),h=y.timeRemaining(),1.5*p>h)return a-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-b))}ms`),void this._start();a=h}this.clear()}}class l extends g{_requestCallback(y){return setTimeout(()=>y(this._createDeadline(16)))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const b=Date.now()+y;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}s.PriorityTaskQueue=l,s.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:l,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const f=o(643);s.updateWindowsModeWrappedState=function(g){const l=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),m=l==null?void 0:l.get(g.cols-1),y=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);y&&m&&(y.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new o;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,m=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=f},9092:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const f=o(6349),g=o(7226),l=o(3734),m=o(8437),y=o(4634),b=o(511),p=o(643),a=o(4863),h=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(c,u,v){this._hasScrollback=c,this._optionsService=u,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.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 f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(c){return c?(this._nullCell.fg=c.fg,this._nullCell.bg=c.bg,this._nullCell.extended=c.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(c){return c?(this._whitespaceCell.fg=c.fg,this._whitespaceCell.bg=c.bg,this._whitespaceCell.extended=c.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(c,u){return new m.BufferLine(this._bufferService.cols,this.getNullCell(c),u)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const c=this.ybase+this.y-this.ydisp;return c>=0&&c<this._rows}_getCorrectBufferLength(c){if(!this._hasScrollback)return c;const u=c+this._optionsService.rawOptions.scrollback;return u>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:u}fillViewportRows(c){if(this.lines.length===0){c===void 0&&(c=m.DEFAULT_ATTR_DATA);let u=this._rows;for(;u--;)this.lines.push(this.getBlankLine(c))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(c,u){const v=this.getNullCell(m.DEFAULT_ATTR_DATA);let x=0;const S=this._getCorrectBufferLength(u);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<c)for(let w=0;w<this.lines.length;w++)x+=+this.lines.get(w).resize(c,v);let k=0;if(this._rows<u)for(let w=this._rows;w<u;w++)this.lines.length<u+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(c,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(c,v)));else for(let w=this._rows;w>u;w--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const w=this.lines.length-S;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=S}this.x=Math.min(this.x,c-1),this.y=Math.min(this.y,u-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,c-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(c,u),this._cols>c))for(let k=0;k<this.lines.length;k++)x+=+this.lines.get(k).resize(c,v);this._cols=c,this._rows=u,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let c=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,c=!1);let u=0;for(;this._memoryCleanupPosition<this.lines.length;)if(u+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),u>100)return!0;return c}get _isReflowEnabled(){const c=this._optionsService.rawOptions.windowsPty;return c&&c.buildNumber?this._hasScrollback&&c.backend==="conpty"&&c.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(c,u){this._cols!==c&&(c>this._cols?this._reflowLarger(c,u):this._reflowSmaller(c,u))}_reflowLarger(c,u){const v=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,c,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(v.length>0){const x=(0,y.reflowLargerCreateNewLayout)(this.lines,v);(0,y.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(c,u,x.countRemoved)}}_reflowLargerAdjustViewport(c,u,v){const x=this.getNullCell(m.DEFAULT_ATTR_DATA);let S=v;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new m.BufferLine(c,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(c,u){const v=this.getNullCell(m.DEFAULT_ATTR_DATA),x=[];let S=0;for(let k=this.lines.length-1;k>=0;k--){let w=this.lines.get(k);if(!w||!w.isWrapped&&w.getTrimmedLength()<=c)continue;const E=[w];for(;w.isWrapped&&k>0;)w=this.lines.get(--k),E.unshift(w);const R=this.ybase+this.y;if(R>=k&&R<k+E.length)continue;const I=E[E.length-1].getTrimmedLength(),T=(0,y.reflowSmallerGetNewLineLengths)(E,this._cols,c),D=T.length-E.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const $=[];for(let j=0;j<D;j++){const z=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);$.push(z)}$.length>0&&(x.push({start:k+E.length+S,newLines:$}),S+=$.length),E.push(...$);let U=T.length-1,P=T[U];P===0&&(U--,P=T[U]);let H=E.length-D-1,L=I;for(;H>=0;){const j=Math.min(L,P);if(E[U]===void 0)break;if(E[U].copyCellsFrom(E[H],L-j,P-j,j,!0),P-=j,P===0&&(U--,P=T[U]),L-=j,L===0){H--;const z=Math.max(H,0);L=(0,y.getWrappedLineTrimmedLength)(E,z,this._cols)}}for(let j=0;j<E.length;j++)T[j]<c&&E[j].setCell(T[j],v);let A=D-N;for(;A-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+u-1)}if(x.length>0){const k=[],w=[];for(let U=0;U<this.lines.length;U++)w.push(this.lines.get(U));const E=this.lines.length;let R=E-1,I=0,T=x[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let D=0;for(let U=Math.min(this.lines.maxLength-1,E+S-1);U>=0;U--)if(T&&T.start>R+D){for(let P=T.newLines.length-1;P>=0;P--)this.lines.set(U--,T.newLines[P]);U++,k.push({index:R+1,amount:T.newLines.length}),D+=T.newLines.length,T=x[++I]}else this.lines.set(U,w[R--]);let N=0;for(let U=k.length-1;U>=0;U--)k[U].index+=N,this.lines.onInsertEmitter.fire(k[U]),N+=k[U].amount;const $=Math.max(0,E+S-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(c,u,v=0,x){const S=this.lines.get(c);return S?S.translateToString(u,v,x):""}getWrappedRangeForLine(c){let u=c,v=c;for(;u>0&&this.lines.get(u).isWrapped;)u--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:u,last:v}}setupTabStops(c){for(c!=null?this.tabs[c]||(c=this.prevStop(c)):(this.tabs={},c=0);c<this._cols;c+=this._optionsService.rawOptions.tabStopWidth)this.tabs[c]=!0}prevStop(c){for(c==null&&(c=this.x);!this.tabs[--c]&&c>0;);return c>=this._cols?this._cols-1:c<0?0:c}nextStop(c){for(c==null&&(c=this.x);!this.tabs[++c]&&c<this._cols;);return c>=this._cols?this._cols-1:c<0?0:c}clearMarkers(c){this._isClearing=!0;for(let u=0;u<this.markers.length;u++)this.markers[u].line===c&&(this.markers[u].dispose(),this.markers.splice(u--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].dispose(),this.markers.splice(c--,1);this._isClearing=!1}addMarker(c){const u=new a.Marker(c);return this.markers.push(u),u.register(this.lines.onTrim(v=>{u.line-=v,u.line<0&&u.dispose()})),u.register(this.lines.onInsert(v=>{u.line>=v.index&&(u.line+=v.amount)})),u.register(this.lines.onDelete(v=>{u.line>=v.index&&u.line<v.index+v.amount&&u.dispose(),u.line>v.index&&(u.line-=v.amount)})),u.register(u.onDispose(()=>this._removeMarker(u))),u}_removeMarker(c){this._isClearing||this.markers.splice(this.markers.indexOf(c),1)}}},8437:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const f=o(3734),g=o(511),l=o(643),m=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let y=0;class b{constructor(a,h,c=!1){this.isWrapped=c,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const u=h||g.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let v=0;v<a;++v)this.setCell(v,u);this.length=a}get(a){const h=this._data[3*a+0],c=2097151&h;return[this._data[3*a+1],2097152&h?this._combined[a]:c?(0,m.stringFromCodePoint)(c):"",h>>22,2097152&h?this._combined[a].charCodeAt(this._combined[a].length-1):c]}set(a,h){this._data[3*a+1]=h[l.CHAR_DATA_ATTR_INDEX],h[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=h[1],this._data[3*a+0]=2097152|a|h[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=h[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const h=this._data[3*a+0];return 2097152&h?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&h}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const h=this._data[3*a+0];return 2097152&h?this._combined[a]:2097151&h?(0,m.stringFromCodePoint)(2097151&h):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,h){return y=3*a,h.content=this._data[y+0],h.fg=this._data[y+1],h.bg=this._data[y+2],2097152&h.content&&(h.combinedData=this._combined[a]),268435456&h.bg&&(h.extended=this._extendedAttrs[a]),h}setCell(a,h){2097152&h.content&&(this._combined[a]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[a]=h.extended),this._data[3*a+0]=h.content,this._data[3*a+1]=h.fg,this._data[3*a+2]=h.bg}setCellFromCodepoint(a,h,c,u){268435456&u.bg&&(this._extendedAttrs[a]=u.extended),this._data[3*a+0]=h|c<<22,this._data[3*a+1]=u.fg,this._data[3*a+2]=u.bg}addCodepointToCell(a,h,c){let u=this._data[3*a+0];2097152&u?this._combined[a]+=(0,m.stringFromCodePoint)(h):2097151&u?(this._combined[a]=(0,m.stringFromCodePoint)(2097151&u)+(0,m.stringFromCodePoint)(h),u&=-2097152,u|=2097152):u=h|4194304,c&&(u&=-12582913,u|=c<<22),this._data[3*a+0]=u}insertCells(a,h,c){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,c),h<this.length-a){const u=new g.CellData;for(let v=this.length-a-h-1;v>=0;--v)this.setCell(a+h+v,this.loadCell(a+v,u));for(let v=0;v<h;++v)this.setCell(a+v,c)}else for(let u=a;u<this.length;++u)this.setCell(u,c);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,c)}deleteCells(a,h,c){if(a%=this.length,h<this.length-a){const u=new g.CellData;for(let v=0;v<this.length-a-h;++v)this.setCell(a+v,this.loadCell(a+h+v,u));for(let v=this.length-h;v<this.length;++v)this.setCell(v,c)}else for(let u=a;u<this.length;++u)this.setCell(u,c);a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,c),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodepoint(a,0,1,c)}replaceCells(a,h,c,u=!1){if(u)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodepoint(a-1,0,1,c),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,c);a<h&&a<this.length;)this.isProtected(a)||this.setCell(a,c),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,c),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,c);a<h&&a<this.length;)this.setCell(a++,c)}resize(a,h){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const c=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*c)this._data=new Uint32Array(this._data.buffer,0,c);else{const u=new Uint32Array(c);u.set(this._data),this._data=u}for(let u=this.length;u<a;++u)this.setCell(u,h)}else{this._data=this._data.subarray(0,c);const u=Object.keys(this._combined);for(let x=0;x<u.length;x++){const S=parseInt(u[x],10);S>=a&&delete this._combined[S]}const v=Object.keys(this._extendedAttrs);for(let x=0;x<v.length;x++){const S=parseInt(v[x],10);S>=a&&delete this._extendedAttrs[S]}}return this.length=a,4*c*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,h=!1){if(h)for(let c=0;c<this.length;++c)this.isProtected(c)||this.setCell(c,a);else{this._combined={},this._extendedAttrs={};for(let c=0;c<this.length;++c)this.setCell(c,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const h in a._combined)this._combined[h]=a._combined[h];this._extendedAttrs={};for(const h in a._extendedAttrs)this._extendedAttrs[h]=a._extendedAttrs[h];this.isWrapped=a.isWrapped}clone(){const a=new b(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const h in this._combined)a._combined[h]=this._combined[h];for(const h in this._extendedAttrs)a._extendedAttrs[h]=this._extendedAttrs[h];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,h,c,u,v){const x=a._data;if(v)for(let k=u-1;k>=0;k--){for(let w=0;w<3;w++)this._data[3*(c+k)+w]=x[3*(h+k)+w];268435456&x[3*(h+k)+2]&&(this._extendedAttrs[c+k]=a._extendedAttrs[h+k])}else for(let k=0;k<u;k++){for(let w=0;w<3;w++)this._data[3*(c+k)+w]=x[3*(h+k)+w];268435456&x[3*(h+k)+2]&&(this._extendedAttrs[c+k]=a._extendedAttrs[h+k])}const S=Object.keys(a._combined);for(let k=0;k<S.length;k++){const w=parseInt(S[k],10);w>=h&&(this._combined[w-h+c]=a._combined[w])}}translateToString(a,h,c,u){h=h??0,c=c??this.length,a&&(c=Math.min(c,this.getTrimmedLength())),u&&(u.length=0);let v="";for(;h<c;){const x=this._data[3*h+0],S=2097151&x,k=2097152&x?this._combined[h]:S?(0,m.stringFromCodePoint)(S):l.WHITESPACE_CELL_CHAR;if(v+=k,u)for(let w=0;w<k.length;++w)u.push(h);h+=x>>22||1}return u&&u.push(h),v}}s.BufferLine=b},4841:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,f){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return f*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(_,s)=>{function o(f,g,l){if(g===f.length-1)return f[g].getTrimmedLength();const m=!f[g].hasContent(l-1)&&f[g].getWidth(l-1)===1,y=f[g+1].getWidth(0)===2;return m&&y?l-1:l}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(f,g,l,m,y){const b=[];for(let p=0;p<f.length-1;p++){let a=p,h=f.get(++a);if(!h.isWrapped)continue;const c=[f.get(p)];for(;a<f.length&&h.isWrapped;)c.push(h),h=f.get(++a);if(m>=p&&m<a){p+=c.length-1;continue}let u=0,v=o(c,u,g),x=1,S=0;for(;x<c.length;){const w=o(c,x,g),E=w-S,R=l-v,I=Math.min(E,R);c[u].copyCellsFrom(c[x],S,v,I,!1),v+=I,v===l&&(u++,v=0),S+=I,S===w&&(x++,S=0),v===0&&u!==0&&c[u-1].getWidth(l-1)===2&&(c[u].copyCellsFrom(c[u-1],l-1,v++,1,!1),c[u-1].setCell(l-1,y))}c[u].replaceCells(v,l,y);let k=0;for(let w=c.length-1;w>0&&(w>u||c[w].getTrimmedLength()===0);w--)k++;k>0&&(b.push(p+c.length-k),b.push(k)),p+=c.length-1}return b},s.reflowLargerCreateNewLayout=function(f,g){const l=[];let m=0,y=g[m],b=0;for(let p=0;p<f.length;p++)if(y===p){const a=g[++m];f.onDeleteEmitter.fire({index:p-b,amount:a}),p+=a-1,b+=a,y=g[++m]}else l.push(p);return{layout:l,countRemoved:b}},s.reflowLargerApplyNewLayout=function(f,g){const l=[];for(let m=0;m<g.length;m++)l.push(f.get(g[m]));for(let m=0;m<l.length;m++)f.set(m,l[m]);f.length=g.length},s.reflowSmallerGetNewLineLengths=function(f,g,l){const m=[],y=f.map((h,c)=>o(f,c,g)).reduce((h,c)=>h+c);let b=0,p=0,a=0;for(;a<y;){if(y-a<l){m.push(y-a);break}b+=l;const h=o(f,p,g);b>h&&(b-=h,p++);const c=f[p].getWidth(b-1)===2;c&&b--;const u=c?l-1:l;m.push(u),a+=u}return m},s.getWrappedLineTrimmedLength=o},5295:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const f=o(8460),g=o(844),l=o(9092);class m extends g.Disposable{constructor(b,p){super(),this._optionsService=b,this._bufferService=p,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,p){this._normal.resize(b,p),this._alt.resize(b,p),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}s.BufferSet=m},511:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const f=o(482),g=o(643),l=o(3734);class m extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const p=new m;return p.setFromCharData(b),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(b[g.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(b[g.CHAR_DATA_CHAR_INDEX].length===2){const a=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const h=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(a-55296)+h-56320+65536|b[g.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[g.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=b[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=m},643:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const f=o(8460),g=o(844);class l{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new f.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(y){return this._disposables.push(y),y}}s.Marker=l,l._nextId=1},7116:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,s)=>{var o,f,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
47
+ `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""}(o||(s.C0=o={})),function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"}(f||(s.C1=f={})),function(l){l.ST=`${o.ESC}\\`}(g||(s.C1_ESCAPED=g={}))},7399:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const f=o(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:["'",'"']};s.evaluateKeyboardEvent=function(l,m,y,b){const p={type:0,cancel:!1,key:void 0},a=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?p.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?p.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?p.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(p.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:p.key=l.ctrlKey?"\b":f.C0.DEL,l.altKey&&(p.key=f.C0.ESC+p.key);break;case 9:if(l.shiftKey){p.key=f.C0.ESC+"[Z";break}p.key=f.C0.HT,p.cancel=!0;break;case 13:p.key=l.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,p.cancel=!0;break;case 27:p.key=f.C0.ESC,l.altKey&&(p.key=f.C0.ESC+f.C0.ESC),p.cancel=!0;break;case 37:if(l.metaKey)break;a?(p.key=f.C0.ESC+"[1;"+(a+1)+"D",p.key===f.C0.ESC+"[1;3D"&&(p.key=f.C0.ESC+(y?"b":"[1;5D"))):p.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(l.metaKey)break;a?(p.key=f.C0.ESC+"[1;"+(a+1)+"C",p.key===f.C0.ESC+"[1;3C"&&(p.key=f.C0.ESC+(y?"f":"[1;5C"))):p.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(l.metaKey)break;a?(p.key=f.C0.ESC+"[1;"+(a+1)+"A",y||p.key!==f.C0.ESC+"[1;3A"||(p.key=f.C0.ESC+"[1;5A")):p.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(l.metaKey)break;a?(p.key=f.C0.ESC+"[1;"+(a+1)+"B",y||p.key!==f.C0.ESC+"[1;3B"||(p.key=f.C0.ESC+"[1;5B")):p.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(p.key=f.C0.ESC+"[2~");break;case 46:p.key=a?f.C0.ESC+"[3;"+(a+1)+"~":f.C0.ESC+"[3~";break;case 36:p.key=a?f.C0.ESC+"[1;"+(a+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:p.key=a?f.C0.ESC+"[1;"+(a+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:l.shiftKey?p.type=2:l.ctrlKey?p.key=f.C0.ESC+"[5;"+(a+1)+"~":p.key=f.C0.ESC+"[5~";break;case 34:l.shiftKey?p.type=3:l.ctrlKey?p.key=f.C0.ESC+"[6;"+(a+1)+"~":p.key=f.C0.ESC+"[6~";break;case 112:p.key=a?f.C0.ESC+"[1;"+(a+1)+"P":f.C0.ESC+"OP";break;case 113:p.key=a?f.C0.ESC+"[1;"+(a+1)+"Q":f.C0.ESC+"OQ";break;case 114:p.key=a?f.C0.ESC+"[1;"+(a+1)+"R":f.C0.ESC+"OR";break;case 115:p.key=a?f.C0.ESC+"[1;"+(a+1)+"S":f.C0.ESC+"OS";break;case 116:p.key=a?f.C0.ESC+"[15;"+(a+1)+"~":f.C0.ESC+"[15~";break;case 117:p.key=a?f.C0.ESC+"[17;"+(a+1)+"~":f.C0.ESC+"[17~";break;case 118:p.key=a?f.C0.ESC+"[18;"+(a+1)+"~":f.C0.ESC+"[18~";break;case 119:p.key=a?f.C0.ESC+"[19;"+(a+1)+"~":f.C0.ESC+"[19~";break;case 120:p.key=a?f.C0.ESC+"[20;"+(a+1)+"~":f.C0.ESC+"[20~";break;case 121:p.key=a?f.C0.ESC+"[21;"+(a+1)+"~":f.C0.ESC+"[21~";break;case 122:p.key=a?f.C0.ESC+"[23;"+(a+1)+"~":f.C0.ESC+"[23~";break;case 123:p.key=a?f.C0.ESC+"[24;"+(a+1)+"~":f.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(y&&!b||!l.altKey||l.metaKey)!y||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?p.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(p.key=f.C0.US),l.key==="@"&&(p.key=f.C0.NUL)):l.keyCode===65&&(p.type=1);else{const h=g[l.keyCode],c=h==null?void 0:h[l.shiftKey?1:0];if(c)p.key=f.C0.ESC+c;else if(l.keyCode>=65&&l.keyCode<=90){const u=l.ctrlKey?l.keyCode-64:l.keyCode+32;let v=String.fromCharCode(u);l.shiftKey&&(v=v.toUpperCase()),p.key=f.C0.ESC+v}else if(l.keyCode===32)p.key=f.C0.ESC+(l.ctrlKey?f.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let u=l.code.slice(3,4);l.shiftKey||(u=u.toLowerCase()),p.key=f.C0.ESC+u,p.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?p.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?p.key=f.C0.NUL:l.keyCode>=51&&l.keyCode<=55?p.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?p.key=f.C0.DEL:l.keyCode===219?p.key=f.C0.ESC:l.keyCode===220?p.key=f.C0.FS:l.keyCode===221&&(p.key=f.C0.GS)}return p}},482:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,f=0,g=o.length){let l="";for(let m=f;m<g;++m){let y=o[m];y>65535?(y-=65536,l+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):l+=String.fromCharCode(y)}return l},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,f){const g=o.length;if(!g)return 0;let l=0,m=0;if(this._interim){const y=o.charCodeAt(m++);56320<=y&&y<=57343?f[l++]=1024*(this._interim-55296)+y-56320+65536:(f[l++]=this._interim,f[l++]=y),this._interim=0}for(let y=m;y<g;++y){const b=o.charCodeAt(y);if(55296<=b&&b<=56319){if(++y>=g)return this._interim=b,l;const p=o.charCodeAt(y);56320<=p&&p<=57343?f[l++]=1024*(b-55296)+p-56320+65536:(f[l++]=b,f[l++]=p)}else b!==65279&&(f[l++]=b)}return l}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,f){const g=o.length;if(!g)return 0;let l,m,y,b,p=0,a=0,h=0;if(this.interim[0]){let v=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let S,k=0;for(;(S=63&this.interim[++k])&&k<4;)x<<=6,x|=S;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-k;for(;h<E;){if(h>=g)return 0;if(S=o[h++],(192&S)!=128){h--,v=!0;break}this.interim[k++]=S,x<<=6,x|=63&S}v||(w===2?x<128?h--:f[p++]=x:w===3?x<2048||x>=55296&&x<=57343||x===65279||(f[p++]=x):x<65536||x>1114111||(f[p++]=x)),this.interim.fill(0)}const c=g-4;let u=h;for(;u<g;){for(;!(!(u<c)||128&(l=o[u])||128&(m=o[u+1])||128&(y=o[u+2])||128&(b=o[u+3]));)f[p++]=l,f[p++]=m,f[p++]=y,f[p++]=b,u+=4;if(l=o[u++],l<128)f[p++]=l;else if((224&l)==192){if(u>=g)return this.interim[0]=l,p;if(m=o[u++],(192&m)!=128){u--;continue}if(a=(31&l)<<6|63&m,a<128){u--;continue}f[p++]=a}else if((240&l)==224){if(u>=g)return this.interim[0]=l,p;if(m=o[u++],(192&m)!=128){u--;continue}if(u>=g)return this.interim[0]=l,this.interim[1]=m,p;if(y=o[u++],(192&y)!=128){u--;continue}if(a=(15&l)<<12|(63&m)<<6|63&y,a<2048||a>=55296&&a<=57343||a===65279)continue;f[p++]=a}else if((248&l)==240){if(u>=g)return this.interim[0]=l,p;if(m=o[u++],(192&m)!=128){u--;continue}if(u>=g)return this.interim[0]=l,this.interim[1]=m,p;if(y=o[u++],(192&y)!=128){u--;continue}if(u>=g)return this.interim[0]=l,this.interim[1]=m,this.interim[2]=y,p;if(b=o[u++],(192&b)!=128){u--;continue}if(a=(7&l)<<18|(63&m)<<12|(63&y)<<6|63&b,a<65536||a>1114111)continue;f[p++]=a}}return p}}},225:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const f=o(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]],l=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;s.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let y=0;y<g.length;++y)m.fill(0,g[y][0],g[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?m[y]:function(b,p){let a,h=0,c=p.length-1;if(b<p[0][0]||b>p[c][1])return!1;for(;c>=h;)if(a=h+c>>1,b>p[a][1])h=a+1;else{if(!(b<p[a][0]))return!0;c=a-1}return!1}(y,l)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,b){let p=this.wcwidth(y),a=p===0&&b!==0;if(a){const h=f.UnicodeService.extractWidth(b);h===0?a=!1:h>p&&(p=h)}return f.UnicodeService.createPropertyValue(0,p,a)}}},5981:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const f=o(8460),g=o(844);class l extends g.Disposable{constructor(y){super(),this._action=y,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(y,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,b){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+=y.length,this._writeBuffer.push(y),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(b)}_innerWrite(y=0,b=!0){const p=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],h=this._action(a,b);if(h){const u=v=>Date.now()-p>=12?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(p,v);return void h.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(u)}const c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-p>=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()}}s.WriteBuffer=l},5941:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const o=/^([\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})$/,f=/^[\da-f]+$/;function g(l,m){const y=l.toString(16),b=y.length<2?"0"+y:y;switch(m){case 4:return y[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}s.parseColor=function(l){if(!l)return;let m=l.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const y=o.exec(m);if(y){const b=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/b*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/b*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/b*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const y=m.length/3,b=[0,0,0];for(let p=0;p<3;++p){const a=parseInt(m.slice(y*p,y*p+y),16);b[p]=y===1?a<<4:y===2?a:y===3?a>>4:a>>8}return b}},s.toRgbString=function(l,m=16){const[y,b,p]=l;return`rgb:${g(y,m)}/${g(b,m)}/${g(p,m)}`}},5770:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const f=o(482),g=o(8742),l=o(5770),m=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(b,p){this._handlers[b]===void 0&&(this._handlers[b]=[]);const a=this._handlers[b];return a.push(p),{dispose:()=>{const h=a.indexOf(p);h!==-1&&a.splice(h,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(b,p){if(this.reset(),this._ident=b,this._active=this._handlers[b]||m,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(b,p,a){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(b,p,a);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(b,p,a))}unhook(b,p=!0){if(this._active.length){let a=!1,h=this._active.length-1,c=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,a=p,c=this._stack.fallThrough,this._stack.paused=!1),!c&&a===!1){for(;h>=0&&(a=this._active[h].unhook(b),a!==!0);h--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,a;h--}for(;h>=0;h--)if(a=this._active[h].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",b);this._active=m,this._ident=0}};const y=new g.Params;y.addParam(0),s.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=y,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():y,this._data="",this._hitLimit=!1}put(b,p,a){this._hitLimit||(this._data+=(0,f.utf32ToString)(b,p,a),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let p=!1;if(this._hitLimit)p=!1;else if(b&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then(a=>(this._params=y,this._data="",this._hitLimit=!1,a));return this._params=y,this._data="",this._hitLimit=!1,p}}},2015:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const f=o(844),g=o(8742),l=o(6242),m=o(6351);class y{constructor(h){this.table=new Uint8Array(h)}setDefault(h,c){this.table.fill(h<<4|c)}add(h,c,u,v){this.table[c<<8|h]=u<<4|v}addMany(h,c,u,v){for(let x=0;x<h.length;x++)this.table[c<<8|h[x]]=u<<4|v}}s.TransitionTable=y;const b=160;s.VT500_TRANSITION_TABLE=function(){const a=new y(4095),h=Array.apply(null,Array(256)).map((k,w)=>w),c=(k,w)=>h.slice(k,w),u=c(32,127),v=c(0,24);v.push(25),v.push.apply(v,c(28,32));const x=c(0,14);let S;for(S in a.setDefault(1,0),a.addMany(u,0,2,0),x)a.addMany([24,26,153,154],S,3,0),a.addMany(c(128,144),S,3,0),a.addMany(c(144,152),S,3,0),a.add(156,S,0,0),a.add(27,S,11,1),a.add(157,S,4,8),a.addMany([152,158,159],S,0,7),a.add(155,S,11,3),a.add(144,S,11,9);return a.addMany(v,0,3,0),a.addMany(v,1,3,1),a.add(127,1,0,1),a.addMany(v,8,0,8),a.addMany(v,3,3,3),a.add(127,3,0,3),a.addMany(v,4,3,4),a.add(127,4,0,4),a.addMany(v,6,3,6),a.addMany(v,5,3,5),a.add(127,5,0,5),a.addMany(v,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(u,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(c(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(u,7,0,7),a.addMany(v,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(c(64,127),3,7,0),a.addMany(c(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(c(48,60),4,8,4),a.addMany(c(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(c(32,64),6,0,6),a.add(127,6,0,6),a.addMany(c(64,127),6,0,0),a.addMany(c(32,48),3,9,5),a.addMany(c(32,48),5,9,5),a.addMany(c(48,64),5,0,6),a.addMany(c(64,127),5,7,0),a.addMany(c(32,48),4,9,5),a.addMany(c(32,48),1,9,2),a.addMany(c(32,48),2,9,2),a.addMany(c(48,127),2,10,0),a.addMany(c(48,80),1,10,0),a.addMany(c(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(c(96,127),1,10,0),a.add(80,1,11,9),a.addMany(v,9,0,9),a.add(127,9,0,9),a.addMany(c(28,32),9,0,9),a.addMany(c(32,48),9,9,12),a.addMany(c(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(v,11,0,11),a.addMany(c(32,128),11,0,11),a.addMany(c(28,32),11,0,11),a.addMany(v,10,0,10),a.add(127,10,0,10),a.addMany(c(28,32),10,0,10),a.addMany(c(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(c(32,48),10,9,12),a.addMany(v,12,0,12),a.add(127,12,0,12),a.addMany(c(28,32),12,0,12),a.addMany(c(32,48),12,9,12),a.addMany(c(48,64),12,0,11),a.addMany(c(64,127),12,12,13),a.addMany(c(64,127),10,12,13),a.addMany(c(64,127),9,12,13),a.addMany(v,13,13,13),a.addMany(u,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(b,0,2,0),a.add(b,8,5,8),a.add(b,6,0,6),a.add(b,11,0,11),a.add(b,13,13,13),a}();class p extends f.Disposable{constructor(h=s.VT500_TRANSITION_TABLE){super(),this._transitions=h,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=(c,u,v)=>{},this._executeHandlerFb=c=>{},this._csiHandlerFb=(c,u)=>{},this._escHandlerFb=c=>{},this._errorHandlerFb=c=>c,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(h,c=[64,126]){let u=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=h.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<h.intermediates.length;++x){const S=h.intermediates.charCodeAt(x);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=S}}if(h.final.length!==1)throw new Error("final must be a single byte");const v=h.final.charCodeAt(0);if(c[0]>v||v>c[1])throw new Error(`final must be in range ${c[0]} .. ${c[1]}`);return u<<=8,u|=v,u}identToString(h){const c=[];for(;h;)c.push(String.fromCharCode(255&h)),h>>=8;return c.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,c){const u=this._identifier(h,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);const v=this._escHandlers[u];return v.push(c),{dispose:()=>{const x=v.indexOf(c);x!==-1&&v.splice(x,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,c){this._executeHandlers[h.charCodeAt(0)]=c}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,c){const u=this._identifier(h);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);const v=this._csiHandlers[u];return v.push(c),{dispose:()=>{const x=v.indexOf(c);x!==-1&&v.splice(x,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,c){return this._dcsParser.registerHandler(this._identifier(h),c)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,c){return this._oscParser.registerHandler(h,c)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,c,u,v,x){this._parseStack.state=h,this._parseStack.handlers=c,this._parseStack.handlerPos=u,this._parseStack.transition=v,this._parseStack.chunkPos=x}parse(h,c,u){let v,x=0,S=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(u===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&E>-1){for(;E>=0&&(v=w[E](this._params),v!==!0);E--)if(v instanceof Promise)return this._parseStack.handlerPos=E,v}this._parseStack.handlers=[];break;case 4:if(u===!1&&E>-1){for(;E>=0&&(v=w[E](),v!==!0);E--)if(v instanceof Promise)return this._parseStack.handlerPos=E,v}this._parseStack.handlers=[];break;case 6:if(x=h[this._parseStack.chunkPos],v=this._dcsParser.unhook(x!==24&&x!==26,u),v)return v;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=h[this._parseStack.chunkPos],v=this._oscParser.end(x!==24&&x!==26,u),v)return v;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=k;w<c;++w){switch(x=h[w],S=this._transitions.table[this.currentState<<8|(x<160?x:b)],S>>4){case 2:for(let D=w+1;;++D){if(D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,w,D),w=D-1;break}if(++D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,w,D),w=D-1;break}if(++D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,w,D),w=D-1;break}if(++D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,w,D),w=D-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|x];let R=E?E.length-1:-1;for(;R>=0&&(v=E[R](this._params),v!==!0);R--)if(v instanceof Promise)return this._preserveStack(3,E,R,S,w),v;R<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++w<c&&(x=h[w])>47&&x<60);w--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const I=this._escHandlers[this._collect<<8|x];let T=I?I.length-1:-1;for(;T>=0&&(v=I[T](),v!==!0);T--)if(v instanceof Promise)return this._preserveStack(4,I,T,S,w),v;T<0&&this._escHandlerFb(this._collect<<8|x),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|x,this._params);break;case 13:for(let D=w+1;;++D)if(D>=c||(x=h[D])===24||x===26||x===27||x>127&&x<b){this._dcsParser.put(h,w,D),w=D-1;break}break;case 14:if(v=this._dcsParser.unhook(x!==24&&x!==26),v)return this._preserveStack(6,[],0,S,w),v;x===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let D=w+1;;D++)if(D>=c||(x=h[D])<32||x>127&&x<b){this._oscParser.put(h,w,D),w=D-1;break}break;case 6:if(v=this._oscParser.end(x!==24&&x!==26),v)return this._preserveStack(5,[],0,S,w),v;x===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}s.EscapeSequenceParser=p},6242:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const f=o(5770),g=o(482),l=[];s.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,y){this._handlers[m]===void 0&&(this._handlers[m]=[]);const b=this._handlers[m];return b.push(y),{dispose:()=>{const p=b.indexOf(y);p!==-1&&b.splice(p,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,y,b){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(m,y,b);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(m,y,b))}start(){this.reset(),this._state=1}put(m,y,b){if(this._state!==3){if(this._state===1)for(;y<b;){const p=m[y++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&b-y>0&&this._put(m,y,b)}}end(m,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,p=this._active.length-1,a=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,b=y,a=this._stack.fallThrough,this._stack.paused=!1),!a&&b===!1){for(;p>=0&&(b=this._active[p].end(m),b!==!0);p--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,b;p--}for(;p>=0;p--)if(b=this._active[p].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",m);this._active=l,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,y,b){this._hitLimit||(this._data+=(0,g.utf32ToString)(m,y,b),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let y=!1;if(this._hitLimit)y=!1;else if(m&&(y=this._handler(this._data),y instanceof Promise))return y.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,y}}},8742:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const o=2147483647;class f{static fromArray(l){const m=new f;if(!l.length)return m;for(let y=Array.isArray(l[0])?1:0;y<l.length;++y){const b=l[y];if(Array.isArray(b))for(let p=0;p<b.length;++p)m.addSubParam(b[p]);else m.addParam(b)}return m}constructor(l=32,m=32){if(this.maxLength=l,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new f(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let m=0;m<this.length;++m){l.push(this.params[m]);const y=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-y>0&&l.push(Array.prototype.slice.call(this._subParams,y,b))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>o?o:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>o?o:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const m=this._subParamsIdx[l]>>8,y=255&this._subParamsIdx[l];return y-m>0?this._subParams.subarray(m,y):null}getSubParamsAll(){const l={};for(let m=0;m<this.length;++m){const y=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-y>0&&(l[m]=this._subParams.slice(y,b))}return l}addDigit(l){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,b=y[m-1];y[m-1]=~b?Math.min(10*b+l,o):l}}s.Params=f},5741:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===o){f=g;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(f,1)}}},8771:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const f=o(3785),g=o(511);s.BufferApiView=class{constructor(l,m){this._buffer=l,this.type=m}init(l){return this._buffer=l,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(l){const m=this._buffer.lines.get(l);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new g.CellData}}},3785:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const f=o(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,l){if(!(g<0||g>=this._line.length))return l?(this._line.loadCell(g,l),l):this._line.loadCell(g,new f.CellData)}translateToString(g,l,m){return this._line.translateToString(g,l,m)}}},8285:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const f=o(8771),g=o(8460),l=o(844);class m extends l.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}s.BufferNamespaceApi=m},7975:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,f){return this._core.registerCsiHandler(o,g=>f(g.toArray()))}addCsiHandler(o,f){return this.registerCsiHandler(o,f)}registerDcsHandler(o,f){return this._core.registerDcsHandler(o,(g,l)=>f(g,l.toArray()))}addDcsHandler(o,f){return this.registerDcsHandler(o,f)}registerEscHandler(o,f){return this._core.registerEscHandler(o,f)}addEscHandler(o,f){return this.registerEscHandler(o,f)}registerOscHandler(o,f){return this._core.registerOscHandler(o,f)}addOscHandler(o,f){return this.registerOscHandler(o,f)}}},7090:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(_,s,o){var f=this&&this.__decorate||function(a,h,c,u){var v,x=arguments.length,S=x<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,c):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(a,h,c,u);else for(var k=a.length-1;k>=0;k--)(v=a[k])&&(S=(x<3?v(S):x>3?v(h,c,S):v(h,c))||S);return x>3&&S&&Object.defineProperty(h,c,S),S},g=this&&this.__param||function(a,h){return function(c,u){h(c,u,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const l=o(8460),m=o(844),y=o(5295),b=o(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let p=s.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(a,this))}resize(a,h){this.cols=a,this.rows=h,this.buffers.resize(a,h),this._onResize.fire({cols:a,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,h=!1){const c=this.buffer;let u;u=this._cachedBlankLine,u&&u.length===this.cols&&u.getFg(0)===a.fg&&u.getBg(0)===a.bg||(u=c.getBlankLine(a,h),this._cachedBlankLine=u),u.isWrapped=h;const v=c.ybase+c.scrollTop,x=c.ybase+c.scrollBottom;if(c.scrollTop===0){const S=c.lines.isFull;x===c.lines.length-1?S?c.lines.recycle().copyFrom(u):c.lines.push(u.clone()):c.lines.splice(x+1,0,u.clone()),S?this.isUserScrolling&&(c.ydisp=Math.max(c.ydisp-1,0)):(c.ybase++,this.isUserScrolling||c.ydisp++)}else{const S=x-v+1;c.lines.shiftElements(v+1,S-1,-1),c.lines.set(x,u.clone())}this.isUserScrolling||(c.ydisp=c.ybase),this._onScroll.fire(c.ydisp)}scrollLines(a,h,c){const u=this.buffer;if(a<0){if(u.ydisp===0)return;this.isUserScrolling=!0}else a+u.ydisp>=u.ybase&&(this.isUserScrolling=!1);const v=u.ydisp;u.ydisp=Math.max(Math.min(u.ydisp+a,u.ybase),0),v!==u.ydisp&&(h||this._onScroll.fire(u.ydisp))}};s.BufferService=p=f([g(0,b.IOptionsService)],p)},7994:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,f){this._charsets[o]=f,this.glevel===o&&(this.charset=f)}}},1753:function(_,s,o){var f=this&&this.__decorate||function(u,v,x,S){var k,w=arguments.length,E=w<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(u,v,x,S);else for(var R=u.length-1;R>=0;R--)(k=u[R])&&(E=(w<3?k(E):w>3?k(v,x,E):k(v,x))||E);return w>3&&E&&Object.defineProperty(v,x,E),E},g=this&&this.__param||function(u,v){return function(x,S){v(x,S,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const l=o(2585),m=o(8460),y=o(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:u=>u.button!==4&&u.action===1&&(u.ctrl=!1,u.alt=!1,u.shift=!1,!0)},VT200:{events:19,restrict:u=>u.action!==32},DRAG:{events:23,restrict:u=>u.action!==32||u.button!==3},ANY:{events:31,restrict:u=>!0}};function p(u,v){let x=(u.ctrl?16:0)|(u.shift?4:0)|(u.alt?8:0);return u.button===4?(x|=64,x|=u.action):(x|=3&u.button,4&u.button&&(x|=64),8&u.button&&(x|=128),u.action===32?x|=32:u.action!==0||v||(x|=3)),x}const a=String.fromCharCode,h={DEFAULT:u=>{const v=[p(u,!1)+32,u.col+32,u.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${a(v[0])}${a(v[1])}${a(v[2])}`},SGR:u=>{const v=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${p(u,!0)};${u.col};${u.row}${v}`},SGR_PIXELS:u=>{const v=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${p(u,!0)};${u.x};${u.y}${v}`}};let c=s.CoreMouseService=class extends y.Disposable{constructor(u,v){super(),this._bufferService=u,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(b))this.addProtocol(x,b[x]);for(const x of Object.keys(h))this.addEncoding(x,h[x]);this.reset()}addProtocol(u,v){this._protocols[u]=v}addEncoding(u,v){this._encodings[u]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(u){if(!this._protocols[u])throw new Error(`unknown protocol "${u}"`);this._activeProtocol=u,this._onProtocolChange.fire(this._protocols[u].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(u){if(!this._encodings[u])throw new Error(`unknown encoding "${u}"`);this._activeEncoding=u}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(u){if(u.col<0||u.col>=this._bufferService.cols||u.row<0||u.row>=this._bufferService.rows||u.button===4&&u.action===32||u.button===3&&u.action!==32||u.button!==4&&(u.action===2||u.action===3)||(u.col++,u.row++,u.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,u,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(u))return!1;const v=this._encodings[this._activeEncoding](u);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=u,!0}explainEvents(u){return{down:!!(1&u),up:!!(2&u),drag:!!(4&u),move:!!(8&u),wheel:!!(16&u)}}_equalEvents(u,v,x){if(x){if(u.x!==v.x||u.y!==v.y)return!1}else if(u.col!==v.col||u.row!==v.row)return!1;return u.button===v.button&&u.action===v.action&&u.ctrl===v.ctrl&&u.alt===v.alt&&u.shift===v.shift}};s.CoreMouseService=c=f([g(0,l.IBufferService),g(1,l.ICoreService)],c)},6975:function(_,s,o){var f=this&&this.__decorate||function(c,u,v,x){var S,k=arguments.length,w=k<3?u:x===null?x=Object.getOwnPropertyDescriptor(u,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,u,v,x);else for(var E=c.length-1;E>=0;E--)(S=c[E])&&(w=(k<3?S(w):k>3?S(u,v,w):S(u,v))||w);return k>3&&w&&Object.defineProperty(u,v,w),w},g=this&&this.__param||function(c,u){return function(v,x){u(v,x,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const l=o(1439),m=o(8460),y=o(844),b=o(2585),p=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=s.CoreService=class extends y.Disposable{constructor(c,u,v){super(),this._bufferService=c,this._logService=u,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(p),this.decPrivateModes=(0,l.clone)(a)}reset(){this.modes=(0,l.clone)(p),this.decPrivateModes=(0,l.clone)(a)}triggerDataEvent(c,u=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;u&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),u&&this._onUserInput.fire(),this._logService.debug(`sending data "${c}"`,()=>c.split("").map(x=>x.charCodeAt(0))),this._onData.fire(c)}triggerBinaryEvent(c){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${c}"`,()=>c.split("").map(u=>u.charCodeAt(0))),this._onBinary.fire(c))}};s.CoreService=h=f([g(0,b.IBufferService),g(1,b.ILogService),g(2,b.IOptionsService)],h)},9074:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const f=o(8055),g=o(8460),l=o(844),m=o(6106);let y=0,b=0;class p extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(c=>c==null?void 0:c.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,l.toDisposable)(()=>this.reset()))}registerDecoration(c){if(c.marker.isDisposed)return;const u=new a(c);if(u){const v=u.marker.onDispose(()=>u.dispose());u.onDispose(()=>{u&&(this._decorations.delete(u)&&this._onDecorationRemoved.fire(u),v.dispose())}),this._decorations.insert(u),this._onDecorationRegistered.fire(u)}return u}reset(){for(const c of this._decorations.values())c.dispose();this._decorations.clear()}*getDecorationsAtCell(c,u,v){let x=0,S=0;for(const k of this._decorations.getKeyIterator(u))x=k.options.x??0,S=x+(k.options.width??1),c>=x&&c<S&&(!v||(k.options.layer??"bottom")===v)&&(yield k)}forEachDecorationAtCell(c,u,v,x){this._decorations.forEachByKey(u,S=>{y=S.options.x??0,b=y+(S.options.width??1),c>=y&&c<b&&(!v||(S.options.layer??"bottom")===v)&&x(S)})}}s.DecorationService=p;class a extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(c){super(),this.options=c,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=c.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const f=o(2585),g=o(8343);class l{constructor(...y){this._entries=new Map;for(const[b,p]of y)this.set(b,p)}set(y,b){const p=this._entries.get(y);return this._entries.set(y,b),p}forEach(y){for(const[b,p]of this._entries.entries())y(b,p)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}s.ServiceCollection=l,s.InstantiationService=class{constructor(){this._services=new l,this._services.set(f.IInstantiationService,this)}setService(m,y){this._services.set(m,y)}getService(m){return this._services.get(m)}createInstance(m,...y){const b=(0,g.getServiceDependencies)(m).sort((h,c)=>h.index-c.index),p=[];for(const h of b){const c=this._services.get(h.id);if(!c)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${h.id}.`);p.push(c)}const a=b.length>0?b[0].index:y.length;if(y.length!==a)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${a+1} conflicts with ${y.length} static arguments`);return new m(...y,...p)}}},7866:function(_,s,o){var f=this&&this.__decorate||function(a,h,c,u){var v,x=arguments.length,S=x<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,c):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(a,h,c,u);else for(var k=a.length-1;k>=0;k--)(v=a[k])&&(S=(x<3?v(S):x>3?v(h,c,S):v(h,c))||S);return x>3&&S&&Object.defineProperty(h,c,S),S},g=this&&this.__param||function(a,h){return function(c,u){h(c,u,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const l=o(844),m=o(2585),y={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let b,p=s.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let h=0;h<a.length;h++)typeof a[h]=="function"&&(a[h]=a[h]())}_log(a,h,c){this._evalLazyOptionalParams(c),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(a,...h){var c;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,a,h)}debug(a,...h){var c;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,a,h)}info(a,...h){var c;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,a,h)}warn(a,...h){var c;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,a,h)}error(a,...h){var c;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,a,h)}};s.LogService=p=f([g(0,m.IOptionsService)],p),s.setTraceLogger=function(a){b=a},s.traceCall=function(a,h,c){if(typeof c.value!="function")throw new Error("not supported");const u=c.value;c.value=function(...v){if(b.logLevel!==m.LogLevelEnum.TRACE)return u.apply(this,v);b.trace(`GlyphRenderer#${u.name}(${v.map(S=>JSON.stringify(S)).join(", ")})`);const x=u.apply(this,v);return b.trace(`GlyphRenderer#${u.name} return`,x),x}}},7302:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const f=o(8460),g=o(844),l=o(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends g.Disposable{constructor(p){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a={...s.DEFAULT_OPTIONS};for(const h in p)if(h in a)try{const c=p[h];a[h]=this._sanitizeAndValidateOption(h,c)}catch(c){console.error(c)}this.rawOptions=a,this.options={...a},this._setupOptions(),this.register((0,g.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(p,a){return this.onOptionChange(h=>{h===p&&a(this.rawOptions[p])})}onMultipleOptionChange(p,a){return this.onOptionChange(h=>{p.indexOf(h)!==-1&&a()})}_setupOptions(){const p=h=>{if(!(h in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},a=(h,c)=>{if(!(h in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);c=this._sanitizeAndValidateOption(h,c),this.rawOptions[h]!==c&&(this.rawOptions[h]=c,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const c={get:p.bind(this,h),set:a.bind(this,h)};Object.defineProperty(this.options,h,c)}}_sanitizeAndValidateOption(p,a){switch(p){case"cursorStyle":if(a||(a=s.DEFAULT_OPTIONS[p]),!function(h){return h==="block"||h==="underline"||h==="bar"}(a))throw new Error(`"${a}" is not a valid value for ${p}`);break;case"wordSeparator":a||(a=s.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=m.includes(a)?a:s.DEFAULT_OPTIONS[p];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${p} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${p} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}s.OptionsService=y},2660:function(_,s,o){var f=this&&this.__decorate||function(y,b,p,a){var h,c=arguments.length,u=c<3?b:a===null?a=Object.getOwnPropertyDescriptor(b,p):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(y,b,p,a);else for(var v=y.length-1;v>=0;v--)(h=y[v])&&(u=(c<3?h(u):c>3?h(b,p,u):h(b,p))||u);return c>3&&u&&Object.defineProperty(b,p,u),u},g=this&&this.__param||function(y,b){return function(p,a){b(p,a,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const l=o(2585);let m=s.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const b=this._bufferService.buffer;if(y.id===void 0){const v=b.addMarker(b.ybase+b.y),x={data:y,id:this._nextId++,lines:[v]};return v.onDispose(()=>this._removeMarkerFromLink(x,v)),this._dataByLinkId.set(x.id,x),x.id}const p=y,a=this._getEntryIdKey(p),h=this._entriesWithId.get(a);if(h)return this.addLineToLink(h.id,b.ybase+b.y),h.id;const c=b.addMarker(b.ybase+b.y),u={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(y,b){const p=this._dataByLinkId.get(y);if(p&&p.lines.every(a=>a.line!==b)){const a=this._bufferService.buffer.addMarker(b);p.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(p,a))}}getLinkData(y){var b;return(b=this._dataByLinkId.get(y))==null?void 0:b.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,b){const p=y.lines.indexOf(b);p!==-1&&(y.lines.splice(p,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};s.OscLinkService=m=f([g(0,l.IBufferService)],m)},8343:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",f="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[f]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const l=function(m,y,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,a,h){a[o]===a?a[f].push({id:p,index:h}):(a[f]=[{id:p,index:h}],a[o]=a)})(l,m,b)};return l.toString=()=>g,s.serviceRegistry.set(g,l),l}},2585:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const f=o(8343);var g;s.IBufferService=(0,f.createDecorator)("BufferService"),s.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),s.ICoreService=(0,f.createDecorator)("CoreService"),s.ICharsetService=(0,f.createDecorator)("CharsetService"),s.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,f.createDecorator)("LogService"),s.IOptionsService=(0,f.createDecorator)("OptionsService"),s.IOscLinkService=(0,f.createDecorator)("OscLinkService"),s.IUnicodeService=(0,f.createDecorator)("UnicodeService"),s.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const f=o(8460),g=o(225);class l{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,b,p=!1){return(16777215&y)<<3|(3&b)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const y=new g.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let b=0,p=0;const a=y.length;for(let h=0;h<a;++h){let c=y.charCodeAt(h);if(55296<=c&&c<=56319){if(++h>=a)return b+this.wcwidth(c);const x=y.charCodeAt(h);56320<=x&&x<=57343?c=1024*(c-55296)+x-56320+65536:b+=this.wcwidth(x)}const u=this.charProperties(c,p);let v=l.extractWidth(u);l.extractShouldJoin(u)&&(v-=l.extractWidth(p)),b+=v,p=u}return b}charProperties(y,b){return this._activeProvider.charProperties(y,b)}}s.UnicodeService=l}},r={};function n(_){var s=r[_];if(s!==void 0)return s.exports;var o=r[_]={exports:{}};return i[_].call(o.exports,o,o.exports,n),o.exports}var d={};return(()=>{var _=d;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const s=n(9042),o=n(3236),f=n(844),g=n(5741),l=n(8285),m=n(7975),y=n(7090),b=["cols","rows"];class p extends f.Disposable{constructor(h){super(),this._core=this.register(new o.Terminal(h)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const c=v=>this._core.options[v],u=(v,x)=>{this._checkReadonlyOptions(v),this._core.options[v]=x};for(const v in this._core.options){const x={get:c.bind(this,v),set:u.bind(this,v)};Object.defineProperty(this._publicOptions,v,x)}}_checkReadonlyOptions(h){if(b.includes(h))throw new Error(`Option "${h}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let c="none";switch(this._core.coreMouseService.activeProtocol){case"X10":c="x10";break;case"VT200":c="vt200";break;case"DRAG":c="drag";break;case"ANY":c="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:c,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const c in h)this._publicOptions[c]=h[c]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,c=!0){this._core.input(h,c)}resize(h,c){this._verifyIntegers(h,c),this._core.resize(h,c)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,c,u){this._verifyIntegers(h,c,u),this._core.select(h,c,u)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,c){this._verifyIntegers(h,c),this._core.selectLines(h,c)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,c){this._core.write(h,c)}writeln(h,c){this._core.write(h),this._core.write(`\r
48
+ `,c)}paste(h){this._core.paste(h)}refresh(h,c){this._verifyIntegers(h,c),this._core.refresh(h,c)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return s}_verifyIntegers(...h){for(const c of h)if(c===1/0||isNaN(c)||c%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const c of h)if(c&&(c===1/0||isNaN(c)||c%1!=0||c<0))throw new Error("This API only accepts positive integers")}}_.Terminal=p})(),d})())})(V_);var Yw=V_.exports,K_={exports:{}};(function(e,t){(function(i,r){e.exports=r()})(self,()=>(()=>{var i={965:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const f=o(374),g=o(509),l=o(855),m=o(859),y=o(381),b=11,p=b*Float32Array.BYTES_PER_ELEMENT;let a,h=0,c=0,u=0;class v extends m.Disposable{constructor(S,k,w,E){super(),this._terminal=S,this._gl=k,this._dimensions=w,this._optionsService=E,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const R=this._gl;g.TextureAtlas.maxAtlasPages===void 0&&(g.TextureAtlas.maxAtlasPages=Math.min(32,(0,f.throwIfFalsy)(R.getParameter(R.MAX_TEXTURE_IMAGE_UNITS))),g.TextureAtlas.maxTextureSize=(0,f.throwIfFalsy)(R.getParameter(R.MAX_TEXTURE_SIZE))),this._program=(0,f.throwIfFalsy)((0,y.createProgram)(R,`#version 300 es
49
+ layout (location = 0) in vec2 a_unitquad;
50
+ layout (location = 1) in vec2 a_cellpos;
51
+ layout (location = 2) in vec2 a_offset;
52
+ layout (location = 3) in vec2 a_size;
53
+ layout (location = 4) in float a_texpage;
54
+ layout (location = 5) in vec2 a_texcoord;
55
+ layout (location = 6) in vec2 a_texsize;
56
+
57
+ uniform mat4 u_projection;
58
+ uniform vec2 u_resolution;
59
+
60
+ out vec2 v_texcoord;
61
+ flat out int v_texpage;
62
+
63
+ void main() {
64
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
65
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
66
+ v_texpage = int(a_texpage);
67
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
68
+ }`,function(U){let P="";for(let H=1;H<U;H++)P+=` else if (v_texpage == ${H}) { outColor = texture(u_texture[${H}], v_texcoord); }`;return`#version 300 es
69
+ precision lowp float;
70
+
71
+ in vec2 v_texcoord;
72
+ flat in int v_texpage;
73
+
74
+ uniform sampler2D u_texture[${U}];
75
+
76
+ out vec4 outColor;
77
+
78
+ void main() {
79
+ if (v_texpage == 0) {
80
+ outColor = texture(u_texture[0], v_texcoord);
81
+ } ${P}
82
+ }`}(g.TextureAtlas.maxAtlasPages))),this.register((0,m.toDisposable)(()=>R.deleteProgram(this._program))),this._projectionLocation=(0,f.throwIfFalsy)(R.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,f.throwIfFalsy)(R.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,f.throwIfFalsy)(R.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=R.createVertexArray(),R.bindVertexArray(this._vertexArrayObject);const I=new Float32Array([0,0,1,0,0,1,1,1]),T=R.createBuffer();this.register((0,m.toDisposable)(()=>R.deleteBuffer(T))),R.bindBuffer(R.ARRAY_BUFFER,T),R.bufferData(R.ARRAY_BUFFER,I,R.STATIC_DRAW),R.enableVertexAttribArray(0),R.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const D=new Uint8Array([0,1,2,3]),N=R.createBuffer();this.register((0,m.toDisposable)(()=>R.deleteBuffer(N))),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,N),R.bufferData(R.ELEMENT_ARRAY_BUFFER,D,R.STATIC_DRAW),this._attributesBuffer=(0,f.throwIfFalsy)(R.createBuffer()),this.register((0,m.toDisposable)(()=>R.deleteBuffer(this._attributesBuffer))),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.enableVertexAttribArray(2),R.vertexAttribPointer(2,2,R.FLOAT,!1,p,0),R.vertexAttribDivisor(2,1),R.enableVertexAttribArray(3),R.vertexAttribPointer(3,2,R.FLOAT,!1,p,2*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(3,1),R.enableVertexAttribArray(4),R.vertexAttribPointer(4,1,R.FLOAT,!1,p,4*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(4,1),R.enableVertexAttribArray(5),R.vertexAttribPointer(5,2,R.FLOAT,!1,p,5*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(5,1),R.enableVertexAttribArray(6),R.vertexAttribPointer(6,2,R.FLOAT,!1,p,7*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(6,1),R.enableVertexAttribArray(1),R.vertexAttribPointer(1,2,R.FLOAT,!1,p,9*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(1,1),R.useProgram(this._program);const $=new Int32Array(g.TextureAtlas.maxAtlasPages);for(let U=0;U<g.TextureAtlas.maxAtlasPages;U++)$[U]=U;R.uniform1iv(this._textureLocation,$),R.uniformMatrix4fv(this._projectionLocation,!1,y.PROJECTION_MATRIX),this._atlasTextures=[];for(let U=0;U<g.TextureAtlas.maxAtlasPages;U++){const P=new y.GLTexture((0,f.throwIfFalsy)(R.createTexture()));this.register((0,m.toDisposable)(()=>R.deleteTexture(P.texture))),R.activeTexture(R.TEXTURE0+U),R.bindTexture(R.TEXTURE_2D,P.texture),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,1,1,0,R.RGBA,R.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[U]=P}R.enable(R.BLEND),R.blendFunc(R.SRC_ALPHA,R.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(S,k,w,E,R,I,T,D,N){this._updateCell(this._vertices.attributes,S,k,w,E,R,I,T,D,N)}_updateCell(S,k,w,E,R,I,T,D,N,$){h=(w*this._terminal.cols+k)*b,E!==l.NULL_CELL_CODE&&E!==void 0?this._atlas&&(a=D&&D.length>1?this._atlas.getRasterizedGlyphCombinedChar(D,R,I,T,!1):this._atlas.getRasterizedGlyph(E,R,I,T,!1),c=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),R!==$&&a.offset.x>c?(u=a.offset.x-c,S[h]=-(a.offset.x-u)+this._dimensions.device.char.left,S[h+1]=-a.offset.y+this._dimensions.device.char.top,S[h+2]=(a.size.x-u)/this._dimensions.device.canvas.width,S[h+3]=a.size.y/this._dimensions.device.canvas.height,S[h+4]=a.texturePage,S[h+5]=a.texturePositionClipSpace.x+u/this._atlas.pages[a.texturePage].canvas.width,S[h+6]=a.texturePositionClipSpace.y,S[h+7]=a.sizeClipSpace.x-u/this._atlas.pages[a.texturePage].canvas.width,S[h+8]=a.sizeClipSpace.y):(S[h]=-a.offset.x+this._dimensions.device.char.left,S[h+1]=-a.offset.y+this._dimensions.device.char.top,S[h+2]=a.size.x/this._dimensions.device.canvas.width,S[h+3]=a.size.y/this._dimensions.device.canvas.height,S[h+4]=a.texturePage,S[h+5]=a.texturePositionClipSpace.x,S[h+6]=a.texturePositionClipSpace.y,S[h+7]=a.sizeClipSpace.x,S[h+8]=a.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,f.allowRescaling)(E,N,a.size.x,this._dimensions.device.cell.width)&&(S[h+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):S.fill(0,h,h+b-1-2)}clear(){const S=this._terminal,k=S.cols*S.rows*b;this._vertices.count!==k?this._vertices.attributes=new Float32Array(k):this._vertices.attributes.fill(0);let w=0;for(;w<this._vertices.attributesBuffers.length;w++)this._vertices.count!==k?this._vertices.attributesBuffers[w]=new Float32Array(k):this._vertices.attributesBuffers[w].fill(0);this._vertices.count=k,w=0;for(let E=0;E<S.rows;E++)for(let R=0;R<S.cols;R++)this._vertices.attributes[w+9]=R/S.cols,this._vertices.attributes[w+10]=E/S.rows,w+=b}handleResize(){const S=this._gl;S.useProgram(this._program),S.viewport(0,0,S.canvas.width,S.canvas.height),S.uniform2f(this._resolutionLocation,S.canvas.width,S.canvas.height),this.clear()}render(S){if(!this._atlas)return;const k=this._gl;k.useProgram(this._program),k.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const w=this._vertices.attributesBuffers[this._activeBuffer];let E=0;for(let R=0;R<S.lineLengths.length;R++){const I=R*this._terminal.cols*b,T=this._vertices.attributes.subarray(I,I+S.lineLengths[R]*b);w.set(T,E),E+=T.length}k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.bufferData(k.ARRAY_BUFFER,w.subarray(0,E),k.STREAM_DRAW);for(let R=0;R<this._atlas.pages.length;R++)this._atlas.pages[R].version!==this._atlasTextures[R].version&&this._bindAtlasPageTexture(k,this._atlas,R);k.drawElementsInstanced(k.TRIANGLE_STRIP,4,k.UNSIGNED_BYTE,0,E/b)}setAtlas(S){this._atlas=S;for(const k of this._atlasTextures)k.version=-1}_bindAtlasPageTexture(S,k,w){S.activeTexture(S.TEXTURE0+w),S.bindTexture(S.TEXTURE_2D,this._atlasTextures[w].texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,S.RGBA,S.UNSIGNED_BYTE,k.pages[w].canvas),S.generateMipmap(S.TEXTURE_2D),this._atlasTextures[w].version=k.pages[w].version}setDimensions(S){this._dimensions=S}}s.GlyphRenderer=v},742:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const f=o(374),g=o(859),l=o(310),m=o(381),y=8*Float32Array.BYTES_PER_ELEMENT;class b{constructor(){this.attributes=new Float32Array(160),this.count=0}}let p=0,a=0,h=0,c=0,u=0,v=0,x=0;class S extends g.Disposable{constructor(w,E,R,I){super(),this._terminal=w,this._gl=E,this._dimensions=R,this._themeService=I,this._vertices=new b,this._verticesCursor=new b;const T=this._gl;this._program=(0,f.throwIfFalsy)((0,m.createProgram)(T,`#version 300 es
83
+ layout (location = 0) in vec2 a_position;
84
+ layout (location = 1) in vec2 a_size;
85
+ layout (location = 2) in vec4 a_color;
86
+ layout (location = 3) in vec2 a_unitquad;
87
+
88
+ uniform mat4 u_projection;
89
+
90
+ out vec4 v_color;
91
+
92
+ void main() {
93
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
94
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
95
+ v_color = a_color;
96
+ }`,`#version 300 es
97
+ precision lowp float;
98
+
99
+ in vec4 v_color;
100
+
101
+ out vec4 outColor;
102
+
103
+ void main() {
104
+ outColor = v_color;
105
+ }`)),this.register((0,g.toDisposable)(()=>T.deleteProgram(this._program))),this._projectionLocation=(0,f.throwIfFalsy)(T.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),N=T.createBuffer();this.register((0,g.toDisposable)(()=>T.deleteBuffer(N))),T.bindBuffer(T.ARRAY_BUFFER,N),T.bufferData(T.ARRAY_BUFFER,D,T.STATIC_DRAW),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const $=new Uint8Array([0,1,2,3]),U=T.createBuffer();this.register((0,g.toDisposable)(()=>T.deleteBuffer(U))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,U),T.bufferData(T.ELEMENT_ARRAY_BUFFER,$,T.STATIC_DRAW),this._attributesBuffer=(0,f.throwIfFalsy)(T.createBuffer()),this.register((0,g.toDisposable)(()=>T.deleteBuffer(this._attributesBuffer))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,T.FLOAT,!1,y,0),T.vertexAttribDivisor(0,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,y,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,4,T.FLOAT,!1,y,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors(P=>{this._updateCachedColors(P),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(w){const E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),E.uniformMatrix4fv(this._projectionLocation,!1,m.PROJECTION_MATRIX),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,w.attributes,E.DYNAMIC_DRAW),E.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,w.count)}handleResize(){this._updateViewportRectangle()}setDimensions(w){this._dimensions=w}_updateCachedColors(w){this._bgFloat=this._colorToFloat32Array(w.background),this._cursorFloat=this._colorToFloat32Array(w.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(w){const E=this._terminal,R=this._vertices;let I,T,D,N,$,U,P,H,L,A,j,z=1;for(I=0;I<E.rows;I++){for(D=-1,N=0,$=0,U=!1,T=0;T<E.cols;T++)P=(I*E.cols+T)*l.RENDER_MODEL_INDICIES_PER_CELL,H=w.cells[P+l.RENDER_MODEL_BG_OFFSET],L=w.cells[P+l.RENDER_MODEL_FG_OFFSET],A=!!(67108864&L),(H!==N||L!==$&&(U||A))&&((N!==0||U&&$!==0)&&(j=8*z++,this._updateRectangle(R,j,$,N,D,T,I)),D=T,N=H,$=L,U=A);(N!==0||U&&$!==0)&&(j=8*z++,this._updateRectangle(R,j,$,N,D,E.cols,I))}R.count=z}updateCursor(w){const E=this._verticesCursor,R=w.cursor;if(!R||R.style==="block")return void(E.count=0);let I,T=0;R.style!=="bar"&&R.style!=="outline"||(I=8*T++,this._addRectangleFloat(E.attributes,I,R.x*this._dimensions.device.cell.width,R.y*this._dimensions.device.cell.height,R.style==="bar"?R.dpr*R.cursorWidth:R.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.style!=="underline"&&R.style!=="outline"||(I=8*T++,this._addRectangleFloat(E.attributes,I,R.x*this._dimensions.device.cell.width,(R.y+1)*this._dimensions.device.cell.height-R.dpr,R.width*this._dimensions.device.cell.width,R.dpr,this._cursorFloat)),R.style==="outline"&&(I=8*T++,this._addRectangleFloat(E.attributes,I,R.x*this._dimensions.device.cell.width,R.y*this._dimensions.device.cell.height,R.width*this._dimensions.device.cell.width,R.dpr,this._cursorFloat),I=8*T++,this._addRectangleFloat(E.attributes,I,(R.x+R.width)*this._dimensions.device.cell.width-R.dpr,R.y*this._dimensions.device.cell.height,R.dpr,this._dimensions.device.cell.height,this._cursorFloat)),E.count=T}_updateRectangle(w,E,R,I,T,D,N){if(67108864&R)switch(50331648&R){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&R].rgba;break;case 50331648:p=(16777215&R)<<8;break;default:p=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:p=(16777215&I)<<8;break;default:p=this._themeService.colors.background.rgba}w.attributes.length<E+4&&(w.attributes=(0,m.expandFloat32Array)(w.attributes,this._terminal.rows*this._terminal.cols*8)),a=T*this._dimensions.device.cell.width,h=N*this._dimensions.device.cell.height,c=(p>>24&255)/255,u=(p>>16&255)/255,v=(p>>8&255)/255,x=1,this._addRectangle(w.attributes,E,a,h,(D-T)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,c,u,v,x)}_addRectangle(w,E,R,I,T,D,N,$,U,P){w[E]=R/this._dimensions.device.canvas.width,w[E+1]=I/this._dimensions.device.canvas.height,w[E+2]=T/this._dimensions.device.canvas.width,w[E+3]=D/this._dimensions.device.canvas.height,w[E+4]=N,w[E+5]=$,w[E+6]=U,w[E+7]=P}_addRectangleFloat(w,E,R,I,T,D,N){w[E]=R/this._dimensions.device.canvas.width,w[E+1]=I/this._dimensions.device.canvas.height,w[E+2]=T/this._dimensions.device.canvas.width,w[E+3]=D/this._dimensions.device.canvas.height,w[E+4]=N[0],w[E+5]=N[1],w[E+6]=N[2],w[E+7]=N[3]}_colorToFloat32Array(w){return new Float32Array([(w.rgba>>24&255)/255,(w.rgba>>16&255)/255,(w.rgba>>8&255)/255,(255&w.rgba)/255])}}s.RectangleRenderer=S},310:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const f=o(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,f.createSelectionRenderModel)()}resize(g,l){const m=g*l*s.RENDER_MODEL_INDICIES_PER_CELL;m!==this.cells.length&&(this.cells=new Uint32Array(m),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const f=o(820),g=o(274),l=o(627),m=o(457),y=o(56),b=o(374),p=o(345),a=o(859),h=o(147),c=o(782),u=o(855),v=o(965),x=o(742),S=o(310),k=o(733);class w extends a.Disposable{constructor(T,D,N,$,U,P,H,L,A){super(),this._terminal=T,this._characterJoinerService=D,this._charSizeService=N,this._coreBrowserService=$,this._coreService=U,this._decorationService=P,this._optionsService=H,this._themeService=L,this._cursorBlinkStateManager=new a.MutableDisposable,this._charAtlasDisposable=this.register(new a.MutableDisposable),this._observerDisposable=this.register(new a.MutableDisposable),this._model=new S.RenderModel,this._workCell=new c.CellData,this._workCell2=new c.CellData,this._rectangleRenderer=this.register(new a.MutableDisposable),this._glyphRenderer=this.register(new a.MutableDisposable),this._onChangeTextureAtlas=this.register(new p.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new p.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new p.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new g.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new k.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,H,this._themeService)],this.dimensions=(0,b.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(H.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const j={antialias:!1,depth:!1,preserveDrawingBuffer:A};if(this._gl=this._canvas.getContext("webgl2",j),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,f.addDisposableDomListener)(this._canvas,"webglcontextlost",z=>{console.log("webglcontextlost event received"),z.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(z)},3e3)})),this.register((0,f.addDisposableDomListener)(this._canvas,"webglcontextrestored",z=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,y.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(z,K)=>this._setCanvasDevicePixelDimensions(z,K)),this.register(this._coreBrowserService.onWindowChange(z=>{this._observerDisposable.value=(0,y.observeDevicePixelDimensions)(this._canvas,z,(K,Y)=>this._setCanvasDevicePixelDimensions(K,Y))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,a.toDisposable)(()=>{var z;for(const K of this._renderLayers)K.dispose();(z=this._canvas.parentElement)==null||z.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var T;return(T=this._charAtlas)==null?void 0:T.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(T,D){var N,$,U,P;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const H of this._renderLayers)H.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(N=this._rectangleRenderer.value)==null||N.setDimensions(this.dimensions),($=this._rectangleRenderer.value)==null||$.handleResize(),(U=this._glyphRenderer.value)==null||U.setDimensions(this.dimensions),(P=this._glyphRenderer.value)==null||P.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var T;for(const D of this._renderLayers)D.handleBlur(this._terminal);(T=this._cursorBlinkStateManager.value)==null||T.pause(),this._requestRedrawViewport()}handleFocus(){var T;for(const D of this._renderLayers)D.handleFocus(this._terminal);(T=this._cursorBlinkStateManager.value)==null||T.resume(),this._requestRedrawViewport()}handleSelectionChanged(T,D,N){for(const $ of this._renderLayers)$.handleSelectionChanged(this._terminal,T,D,N);this._model.selection.update(this._core,T,D,N),this._requestRedrawViewport()}handleCursorMove(){var T;for(const D of this._renderLayers)D.handleCursorMove(this._terminal);(T=this._cursorBlinkStateManager.value)==null||T.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new v.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var D;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const T=(0,l.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==T&&(this._onChangeTextureAtlas.fire(T.pages[0].canvas),this._charAtlasDisposable.value=(0,a.getDisposeArrayDisposable)([(0,p.forwardEvent)(T.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,p.forwardEvent)(T.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=T,this._charAtlas.warmUp(),(D=this._glyphRenderer.value)==null||D.setAtlas(this._charAtlas)}_clearModel(T){var D;this._model.clear(),T&&((D=this._glyphRenderer.value)==null||D.clear())}clearTextureAtlas(){var T;(T=this._charAtlas)==null||T.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var T;this._clearModel(!0);for(const D of this._renderLayers)D.reset(this._terminal);(T=this._cursorBlinkStateManager.value)==null||T.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(T){return-1}deregisterCharacterJoiner(T){return!1}renderRows(T,D){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const N of this._renderLayers)N.handleGridChanged(this._terminal,T,D);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(T,D),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new m.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(T,D){const N=this._core;let $,U,P,H,L,A,j,z,K,Y,te,Q,W,M,G=this._workCell;T=R(T,N.rows-1,0),D=R(D,N.rows-1,0);const V=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,re=V-N.buffer.ydisp,ie=Math.min(this._terminal.buffer.active.cursorX,N.cols-1);let me=-1;const ue=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Re=!1;for(U=T;U<=D;U++)for(P=U+N.buffer.ydisp,H=N.buffer.lines.get(P),this._model.lineLengths[U]=0,L=this._characterJoinerService.getJoinedCharacters(P),W=0;W<N.cols;W++)if($=this._cellColorResolver.result.bg,H.loadCell(W,G),W===0&&($=this._cellColorResolver.result.bg),A=!1,j=W,L.length>0&&W===L[0][0]&&(A=!0,z=L.shift(),G=new E(G,H.translateToString(!0,z[0],z[1]),z[1]-z[0]),j=z[1]-1),K=G.getChars(),Y=G.getCode(),Q=(U*N.cols+W)*S.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(G,W,P,this.dimensions.device.cell.width),ue&&P===V&&(W===ie&&(this._model.cursor={x:ie,y:re,width:G.getWidth(),style:this._coreBrowserService.isFocused?N.options.cursorStyle||"block":N.options.cursorInactiveStyle,cursorWidth:N.options.cursorWidth,dpr:this._devicePixelRatio},me=ie+G.getWidth()-1),W>=ie&&W<=me&&(this._coreBrowserService.isFocused&&(N.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&N.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),Y!==u.NULL_CELL_CODE&&(this._model.lineLengths[U]=W+1),(this._model.cells[Q]!==Y||this._model.cells[Q+S.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Q+S.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Q+S.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Re=!0,K.length>1&&(Y|=S.COMBINED_CHAR_BIT_MASK),this._model.cells[Q]=Y,this._model.cells[Q+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Q+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Q+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,te=G.getWidth(),this._glyphRenderer.value.updateCell(W,U,Y,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,K,te,$),A))for(G=this._workCell,W++;W<j;W++)M=(U*N.cols+W)*S.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(W,U,u.NULL_CELL_CODE,0,0,0,u.NULL_CELL_CHAR,0,0),this._model.cells[M]=u.NULL_CELL_CODE,this._model.cells[M+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[M+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[M+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Re&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(T,D){this._canvas.width===T&&this._canvas.height===D||(this._canvas.width=T,this._canvas.height=D,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const T=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:T,end:T})}}s.WebglRenderer=w;class E extends h.AttributeData{constructor(T,D,N){super(),this.content=0,this.combinedData="",this.fg=T.fg,this.bg=T.bg,this.combinedData=D,this._width=N}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(T){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function R(I,T,D=0){return Math.max(Math.min(I,T),D)}s.JoinedCellData=E},381:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const f=o(374);function g(l,m,y){const b=(0,f.throwIfFalsy)(l.createShader(m));if(l.shaderSource(b,y),l.compileShader(b),l.getShaderParameter(b,l.COMPILE_STATUS))return b;console.error(l.getShaderInfoLog(b)),l.deleteShader(b)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(l,m,y){const b=(0,f.throwIfFalsy)(l.createProgram());if(l.attachShader(b,(0,f.throwIfFalsy)(g(l,l.VERTEX_SHADER,m))),l.attachShader(b,(0,f.throwIfFalsy)(g(l,l.FRAGMENT_SHADER,y))),l.linkProgram(b),l.getProgramParameter(b,l.LINK_STATUS))return b;console.error(l.getProgramInfoLog(b)),l.deleteProgram(b)},s.createShader=g,s.expandFloat32Array=function(l,m){const y=Math.min(2*l.length,m),b=new Float32Array(y);for(let p=0;p<l.length;p++)b[p]=l[p];return b},s.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const f=o(627),g=o(237),l=o(374),m=o(859);class y extends m.Disposable{constructor(p,a,h,c,u,v,x,S){super(),this._container=a,this._alpha=u,this._coreBrowserService=v,this._optionsService=x,this._themeService=S,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=c.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(k=>{this._refreshCharAtlas(p,k),this.reset(p)})),this.register((0,m.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(p){}handleFocus(p){}handleCursorMove(p){}handleGridChanged(p,a,h){}handleSelectionChanged(p,a,h,c=!1){}_setTransparency(p,a){if(a===this._alpha)return;const h=this._canvas;this._alpha=a,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(p,this._themeService.colors),this.handleGridChanged(p,0,p.rows-1)}_refreshCharAtlas(p,a){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,f.acquireTextureAtlas)(p,this._optionsService.rawOptions,a,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(p,a){this._deviceCellWidth=a.device.cell.width,this._deviceCellHeight=a.device.cell.height,this._deviceCharWidth=a.device.char.width,this._deviceCharHeight=a.device.char.height,this._deviceCharLeft=a.device.char.left,this._deviceCharTop=a.device.char.top,this._canvas.width=a.device.canvas.width,this._canvas.height=a.device.canvas.height,this._canvas.style.width=`${a.css.canvas.width}px`,this._canvas.style.height=`${a.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(p,this._themeService.colors)}_fillBottomLineAtCells(p,a,h=1){this._ctx.fillRect(p*this._deviceCellWidth,(a+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(p,a,h,c){this._alpha?this._ctx.clearRect(p*this._deviceCellWidth,a*this._deviceCellHeight,h*this._deviceCellWidth,c*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(p*this._deviceCellWidth,a*this._deviceCellHeight,h*this._deviceCellWidth,c*this._deviceCellHeight))}_fillCharTrueColor(p,a,h,c){this._ctx.font=this._getFont(p,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(h,c,a.getWidth()),this._ctx.fillText(a.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,c*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(p,a,h){this._ctx.beginPath(),this._ctx.rect(p*this._deviceCellWidth,a*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(p,a,h){return`${h?"italic":""} ${a?p.options.fontWeightBold:p.options.fontWeight} ${p.options.fontSize*this._coreBrowserService.dpr}px ${p.options.fontFamily}`}}s.BaseRenderLayer=y},733:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const f=o(197),g=o(237),l=o(592);class m extends l.BaseRenderLayer{constructor(b,p,a,h,c,u,v){super(a,b,"link",p,!0,c,u,v),this.register(h.onShowLinkUnderline(x=>this._handleShowLinkUnderline(x))),this.register(h.onHideLinkUnderline(x=>this._handleHideLinkUnderline(x)))}resize(b,p){super.resize(b,p),this._state=void 0}reset(b){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg!==void 0&&(0,f.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let p=b.y1+1;p<b.y2;p++)this._fillBottomLineAtCells(0,p,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}s.LinkRenderLayer=m},820:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,f,g,l){o.addEventListener(f,g,l);let m=!1;return{dispose:()=>{m||(m=!0,o.removeEventListener(f,g,l))}}}},274:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const f=o(855),g=o(160),l=o(374);let m,y=0,b=0,p=!1,a=!1,h=!1,c=0;s.CellColorResolver=class{constructor(u,v,x,S,k,w){this._terminal=u,this._optionService=v,this._selectionRenderModel=x,this._decorationService=S,this._coreBrowserService=k,this._themeService=w,this.result={fg:0,bg:0,ext:0}}resolve(u,v,x,S){if(this.result.bg=u.bg,this.result.fg=u.fg,this.result.ext=268435456&u.bg?u.extended.ext:0,b=0,y=0,a=!1,p=!1,h=!1,m=this._themeService.colors,c=0,u.getCode()!==f.NULL_CELL_CODE&&u.extended.underlineStyle===4){const k=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));c=v*S%(2*Math.round(k))}if(this._decorationService.forEachDecorationAtCell(v,x,"bottom",k=>{k.backgroundColorRGB&&(b=k.backgroundColorRGB.rgba>>8&16777215,a=!0),k.foregroundColorRGB&&(y=k.foregroundColorRGB.rgba>>8&16777215,p=!0)}),h=this._selectionRenderModel.isCellSelected(this._terminal,v,x),h){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=g.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(a=!0,m.selectionForeground&&(y=m.selectionForeground.rgba>>8&16777215,p=!0),(0,l.treatGlyphAsBackgroundColor)(u.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))y=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}y=g.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}p=!0}}this._decorationService.forEachDecorationAtCell(v,x,"top",k=>{k.backgroundColorRGB&&(b=k.backgroundColorRGB.rgba>>8&16777215,a=!0),k.foregroundColorRGB&&(y=k.foregroundColorRGB.rgba>>8&16777215,p=!0)}),a&&(b=h?-16777216&u.bg&-134217729|b|50331648:-16777216&u.bg|b|50331648),p&&(y=-16777216&u.fg&-67108865|y|50331648),67108864&this.result.fg&&(a&&!p&&(y=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&m.background.rgba>>8|50331648,p=!0),!a&&p&&(b=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&m.foreground.rgba>>8|50331648,a=!0)),m=void 0,this.result.bg=a?b:this.result.bg,this.result.fg=p?y:this.result.fg,this.result.ext&=536870911,this.result.ext|=c<<29&3758096384}}},627:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const f=o(509),g=o(197),l=[];s.acquireTextureAtlas=function(m,y,b,p,a,h,c,u){const v=(0,g.generateConfig)(p,a,h,c,y,b,u);for(let k=0;k<l.length;k++){const w=l[k],E=w.ownedBy.indexOf(m);if(E>=0){if((0,g.configEquals)(w.config,v))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),l.splice(k,1)):w.ownedBy.splice(E,1);break}}for(let k=0;k<l.length;k++){const w=l[k];if((0,g.configEquals)(w.config,v))return w.ownedBy.push(m),w.atlas}const x=m._core,S={atlas:new f.TextureAtlas(document,v,x.unicodeService),config:v,ownedBy:[m]};return l.push(S),S.atlas},s.removeTerminalFromCache=function(m){for(let y=0;y<l.length;y++){const b=l[y].ownedBy.indexOf(m);if(b!==-1){l[y].ownedBy.length===1?(l[y].atlas.dispose(),l.splice(y,1)):l[y].ownedBy.splice(b,1);break}}}},197:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const f=o(160);s.generateConfig=function(g,l,m,y,b,p,a){const h={foreground:p.foreground,background:p.background,cursor:f.NULL_COLOR,cursorAccent:f.NULL_COLOR,selectionForeground:f.NULL_COLOR,selectionBackgroundTransparent:f.NULL_COLOR,selectionBackgroundOpaque:f.NULL_COLOR,selectionInactiveBackgroundTransparent:f.NULL_COLOR,selectionInactiveBackgroundOpaque:f.NULL_COLOR,ansi:p.ansi.slice(),contrastCache:p.contrastCache,halfContrastCache:p.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:a,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:g,deviceCellHeight:l,deviceCharWidth:m,deviceCharHeight:y,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:h}},s.configEquals=function(g,l){for(let m=0;m<g.colors.ansi.length;m++)if(g.colors.ansi[m].rgba!==l.colors.ansi[m].rgba)return!1;return g.devicePixelRatio===l.devicePixelRatio&&g.customGlyphs===l.customGlyphs&&g.lineHeight===l.lineHeight&&g.letterSpacing===l.letterSpacing&&g.fontFamily===l.fontFamily&&g.fontSize===l.fontSize&&g.fontWeight===l.fontWeight&&g.fontWeightBold===l.fontWeightBold&&g.allowTransparency===l.allowTransparency&&g.deviceCharWidth===l.deviceCharWidth&&g.deviceCharHeight===l.deviceCharHeight&&g.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&g.minimumContrastRatio===l.minimumContrastRatio&&g.colors.foreground.rgba===l.colors.foreground.rgba&&g.colors.background.rgba===l.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const f=o(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},457:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(o,f){this._renderCallback=o,this._coreBrowserService=f,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const f=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,f>0)return void this._restartInterval(f)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const f=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(f)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const f=o(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(p,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"║":{1:(p,a)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╒":{1:(p,a)=>`M.5,1 L.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╓":{1:(p,a)=>`M${.5-p},1 L${.5-p},.5 L1,.5 M${.5+p},.5 L${.5+p},1`},"╔":{1:(p,a)=>`M1,${.5-a} L${.5-p},${.5-a} L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1`},"╕":{1:(p,a)=>`M0,${.5-a} L.5,${.5-a} L.5,1 M0,${.5+a} L.5,${.5+a}`},"╖":{1:(p,a)=>`M${.5+p},1 L${.5+p},.5 L0,.5 M${.5-p},.5 L${.5-p},1`},"╗":{1:(p,a)=>`M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M0,${.5-a} L${.5+p},${.5-a} L${.5+p},1`},"╘":{1:(p,a)=>`M.5,0 L.5,${.5+a} L1,${.5+a} M.5,${.5-a} L1,${.5-a}`},"╙":{1:(p,a)=>`M1,.5 L${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╚":{1:(p,a)=>`M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0 M1,${.5+a} L${.5-p},${.5+a} L${.5-p},0`},"╛":{1:(p,a)=>`M0,${.5+a} L.5,${.5+a} L.5,0 M0,${.5-a} L.5,${.5-a}`},"╜":{1:(p,a)=>`M0,.5 L${.5+p},.5 L${.5+p},0 M${.5-p},.5 L${.5-p},0`},"╝":{1:(p,a)=>`M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0 M0,${.5+a} L${.5+p},${.5+a} L${.5+p},0`},"╞":{1:(p,a)=>`M.5,0 L.5,1 M.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╟":{1:(p,a)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1 M${.5+p},.5 L1,.5`},"╠":{1:(p,a)=>`M${.5-p},0 L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1 M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0`},"╡":{1:(p,a)=>`M.5,0 L.5,1 M0,${.5-a} L.5,${.5-a} M0,${.5+a} L.5,${.5+a}`},"╢":{1:(p,a)=>`M0,.5 L${.5-p},.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╣":{1:(p,a)=>`M${.5+p},0 L${.5+p},1 M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0`},"╤":{1:(p,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a} M.5,${.5+a} L.5,1`},"╥":{1:(p,a)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},1 M${.5+p},.5 L${.5+p},1`},"╦":{1:(p,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1`},"╧":{1:(p,a)=>`M.5,0 L.5,${.5-a} M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╨":{1:(p,a)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╩":{1:(p,a)=>`M0,${.5+a} L1,${.5+a} M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0 M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0`},"╪":{1:(p,a)=>`M.5,0 L.5,1 M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╫":{1:(p,a)=>`M0,.5 L1,.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╬":{1:(p,a)=>`M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1 M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0 M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(p,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,1,.5`},"╮":{1:(p,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,0,.5`},"╯":{1:(p,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,0,.5`},"╰":{1:(p,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(p,a,h,c,u,v,x,S){const k=s.blockElementDefinitions[a];if(k)return function(I,T,D,N,$,U){for(let P=0;P<T.length;P++){const H=T[P],L=$/8,A=U/8;I.fillRect(D+H.x*L,N+H.y*A,H.w*L,H.h*A)}}(p,k,h,c,u,v),!0;const w=g[a];if(w)return function(I,T,D,N,$,U){let P=l.get(T);P||(P=new Map,l.set(T,P));const H=I.fillStyle;if(typeof H!="string")throw new Error(`Unexpected fillStyle type "${H}"`);let L=P.get(H);if(!L){const A=T[0].length,j=T.length,z=I.canvas.ownerDocument.createElement("canvas");z.width=A,z.height=j;const K=(0,f.throwIfFalsy)(z.getContext("2d")),Y=new ImageData(A,j);let te,Q,W,M;if(H.startsWith("#"))te=parseInt(H.slice(1,3),16),Q=parseInt(H.slice(3,5),16),W=parseInt(H.slice(5,7),16),M=H.length>7&&parseInt(H.slice(7,9),16)||1;else{if(!H.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${H}" when drawing pattern glyph`);[te,Q,W,M]=H.substring(5,H.length-1).split(",").map(G=>parseFloat(G))}for(let G=0;G<j;G++)for(let V=0;V<A;V++)Y.data[4*(G*A+V)]=te,Y.data[4*(G*A+V)+1]=Q,Y.data[4*(G*A+V)+2]=W,Y.data[4*(G*A+V)+3]=T[G][V]*(255*M);K.putImageData(Y,0,0),L=(0,f.throwIfFalsy)(I.createPattern(z,null)),P.set(H,L)}I.fillStyle=L,I.fillRect(D,N,$,U)}(p,w,h,c,u,v),!0;const E=s.boxDrawingDefinitions[a];if(E)return function(I,T,D,N,$,U,P){I.strokeStyle=I.fillStyle;for(const[H,L]of Object.entries(T)){let A;I.beginPath(),I.lineWidth=P*Number.parseInt(H),A=typeof L=="function"?L(.15,.15/U*$):L;for(const j of A.split(" ")){const z=j[0],K=y[z];if(!K){console.error(`Could not find drawing instructions for "${z}"`);continue}const Y=j.substring(1).split(",");Y[0]&&Y[1]&&K(I,b(Y,$,U,D,N,!0,P))}I.stroke(),I.closePath()}}(p,E,h,c,u,v,S),!0;const R=s.powerlineDefinitions[a];return!!R&&(function(I,T,D,N,$,U,P,H){const L=new Path2D;L.rect(D,N,$,U),I.clip(L),I.beginPath();const A=P/12;I.lineWidth=H*A;for(const j of T.d.split(" ")){const z=j[0],K=y[z];if(!K){console.error(`Could not find drawing instructions for "${z}"`);continue}const Y=j.substring(1).split(",");Y[0]&&Y[1]&&K(I,b(Y,$,U,D,N,!1,H,(T.leftPadding??0)*(A/2),(T.rightPadding??0)*(A/2)))}T.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()}(p,R,h,c,u,v,x,S),!0)};const l=new Map;function m(p,a,h=0){return Math.max(Math.min(p,a),h)}const y={C:(p,a)=>p.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]),L:(p,a)=>p.lineTo(a[0],a[1]),M:(p,a)=>p.moveTo(a[0],a[1])};function b(p,a,h,c,u,v,x,S=0,k=0){const w=p.map(E=>parseFloat(E)||parseInt(E));if(w.length<2)throw new Error("Too few arguments for instruction");for(let E=0;E<w.length;E+=2)w[E]*=a-S*x-k*x,v&&w[E]!==0&&(w[E]=m(Math.round(w[E]+.5)-.5,a,0)),w[E]+=c+S*x;for(let E=1;E<w.length;E+=2)w[E]*=h,v&&w[E]!==0&&(w[E]=m(Math.round(w[E]+.5)-.5,h,0)),w[E]+=u;return w}},56:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const f=o(859);s.observeDevicePixelDimensions=function(g,l,m){let y=new l.ResizeObserver(b=>{const p=b.find(c=>c.target===g);if(!p)return;if(!("devicePixelContentBoxSize"in p))return y==null||y.disconnect(),void(y=void 0);const a=p.devicePixelContentBoxSize[0].inlineSize,h=p.devicePixelContentBoxSize[0].blockSize;a>0&&h>0&&m(a,h)});try{y.observe(g,{box:["device-pixel-content-box"]})}catch{y.disconnect(),y=void 0}return(0,f.toDisposable)(()=>y==null?void 0:y.disconnect())}},374:(_,s)=>{function o(g){return 57508<=g&&g<=57558}function f(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(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=f,s.allowRescaling=function(g,l,m,y){return l===1&&m>Math.ceil(1.5*y)&&g!==void 0&&g>255&&!f(g)&&!o(g)&&!function(b){return 57344<=b&&b<=63743}(g)},s.treatGlyphAsBackgroundColor=function(g){return o(g)||function(l){return 9472<=l&&l<=9631}(g)},s.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}}}},s.computeNextVariantOffset=function(g,l,m=0){return(g-(2*Math.round(l)-m))%(2*Math.round(l))}},296:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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,l,m,y=!1){if(this.selectionStart=l,this.selectionEnd=m,!l||!m||l[0]===m[0]&&l[1]===m[1])return void this.clear();const b=g.buffers.active.ydisp,p=l[1]-b,a=m[1]-b,h=Math.max(p,0),c=Math.min(a,g.rows-1);h>=g.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=p,this.viewportEndRow=a,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=l[0],this.endCol=m[0])}isCellSelected(g,l,m){return!!this.hasSelection&&(m-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&m>=this.viewportCappedStartRow&&l<this.endCol&&m<=this.viewportCappedEndRow:l<this.startCol&&m>=this.viewportCappedStartRow&&l>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},509:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const f=o(237),g=o(860),l=o(374),m=o(160),y=o(345),b=o(485),p=o(385),a=o(147),h=o(855),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class v{get pages(){return this._pages}constructor(E,R,I){this._document=E,this._config=R,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new a.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new y.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new y.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=k(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new p.IdleTaskQueue;for(let R=33;R<126;R++)E.enqueue(()=>{if(!this._cacheMap.get(R,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const I=this._drawToCache(R,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(R,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,I)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(v.maxAtlasPages&&this._pages.length>=Math.max(4,v.maxAtlasPages)){const R=this._pages.filter(P=>2*P.canvas.width<=(v.maxTextureSize||4096)).sort((P,H)=>H.canvas.width!==P.canvas.width?H.canvas.width-P.canvas.width:H.percentageUsed-P.percentageUsed);let I=-1,T=0;for(let P=0;P<R.length;P++)if(R[P].canvas.width!==T)I=P,T=R[P].canvas.width;else if(P-I==3)break;const D=R.slice(I,I+4),N=D.map(P=>P.glyphs[0].texturePage).sort((P,H)=>P>H?1:-1),$=this.pages.length-D.length,U=this._mergePages(D,$);U.version++;for(let P=N.length-1;P>=0;P--)this._deletePage(N[P]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const E=new x(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,R){const I=2*E[0].canvas.width,T=new x(this._document,I,E);for(const[D,N]of E.entries()){const $=D*N.canvas.width%I,U=Math.floor(D/2)*N.canvas.height;T.ctx.drawImage(N.canvas,$,U);for(const H of N.glyphs)H.texturePage=R,H.sizeClipSpace.x=H.size.x/I,H.sizeClipSpace.y=H.size.y/I,H.texturePosition.x+=$,H.texturePosition.y+=U,H.texturePositionClipSpace.x=H.texturePosition.x/I,H.texturePositionClipSpace.y=H.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(N.canvas);const P=this._activePages.indexOf(N);P!==-1&&this._activePages.splice(P,1)}return T}_deletePage(E){this._pages.splice(E,1);for(let R=E;R<this._pages.length;R++){const I=this._pages[R];for(const T of I.glyphs)T.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(E,R,I,T,D){return this._getFromCacheMap(this._cacheMapCombined,E,R,I,T,D)}getRasterizedGlyph(E,R,I,T,D){return this._getFromCacheMap(this._cacheMap,E,R,I,T,D)}_getFromCacheMap(E,R,I,T,D,N=!1){return u=E.get(R,I,T,D),u||(u=this._drawToCache(R,I,T,D,N),E.set(R,I,T,D,u)),u}_getColorFromAnsiIndex(E){if(E>=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,R,I,T){if(this._config.allowTransparency)return m.NULL_COLOR;let D;switch(E){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(R);break;case 50331648:const N=a.AttributeData.toColorRGB(R);D=m.channels.toColor(N[0],N[1],N[2]);break;default:D=I?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(E,R,I,T,D,N,$,U,P,H){const L=this._getMinimumContrastColor(E,R,I,T,D,N,$,P,U,H);if(L)return L;let A;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&N<8&&(N+=8),A=this._getColorFromAnsiIndex(N);break;case 50331648:const j=a.AttributeData.toColorRGB(N);A=m.channels.toColor(j[0],j[1],j[2]);break;default:A=$?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(A=m.color.opaque(A)),U&&(A=m.color.multiplyOpacity(A,f.DIM_OPACITY)),A}_resolveBackgroundRgba(E,R,I){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,R,I,T){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&T&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,R,I,T,D,N,$,U,P,H){if(this._config.minimumContrastRatio===1||H)return;const L=this._getContrastCache(P),A=L.getColor(E,T);if(A!==void 0)return A||void 0;const j=this._resolveBackgroundRgba(R,I,$),z=this._resolveForegroundRgba(D,N,$,U),K=m.rgba.ensureContrastRatio(j,z,this._config.minimumContrastRatio/(P?2:1));if(!K)return void L.setColor(E,T,null);const Y=m.channels.toColor(K>>24&255,K>>16&255,K>>8&255);return L.setColor(E,T,Y),Y}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,R,I,T,D=!1){const N=typeof E=="number"?String.fromCharCode(E):E,$=Math.min(this._config.deviceCellWidth*Math.max(N.length,2)+4,this._textureSize);this._tmpCanvas.width<$&&(this._tmpCanvas.width=$);const U=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<U&&(this._tmpCanvas.height=U),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=R,this._workAttributeData.extended.ext=T,this._workAttributeData.isInvisible())return c;const P=!!this._workAttributeData.isBold(),H=!!this._workAttributeData.isInverse(),L=!!this._workAttributeData.isDim(),A=!!this._workAttributeData.isItalic(),j=!!this._workAttributeData.isUnderline(),z=!!this._workAttributeData.isStrikethrough(),K=!!this._workAttributeData.isOverline();let Y=this._workAttributeData.getFgColor(),te=this._workAttributeData.getFgColorMode(),Q=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(H){const le=Y;Y=Q,Q=le;const X=te;te=W,W=X}const M=this._getBackgroundColor(W,Q,H,L);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=M.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const G=P?this._config.fontWeightBold:this._config.fontWeight,V=A?"italic":"";this._tmpCtx.font=`${V} ${G} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=f.TEXT_BASELINE;const re=N.length===1&&(0,l.isPowerlineGlyph)(N.charCodeAt(0)),ie=N.length===1&&(0,l.isRestrictedPowerlineGlyph)(N.charCodeAt(0)),me=this._getForegroundColor(R,W,Q,I,te,Y,H,L,P,(0,l.treatGlyphAsBackgroundColor)(N.charCodeAt(0)));this._tmpCtx.fillStyle=me.css;const ue=ie?0:4;let Re=!1;this._config.customGlyphs!==!1&&(Re=(0,g.tryDrawCustomChar)(this._tmpCtx,N,ue,ue,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let xe,pe=!re;if(xe=typeof E=="number"?this._unicodeService.wcwidth(E):this._unicodeService.getStringCellWidth(E),j){this._tmpCtx.save();const le=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),X=le%2==1?.5:0;if(this._tmpCtx.lineWidth=le,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())pe=!1,this._tmpCtx.strokeStyle=`rgb(${a.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{pe=!1;let Me=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Me<8&&(Me+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Me).css}this._tmpCtx.beginPath();const J=ue,se=Math.ceil(ue+this._config.deviceCharHeight)-X-(D?2*le:0),ve=se+le,Ee=se+2*le;let Le=this._workAttributeData.getUnderlineVariantOffset();for(let Me=0;Me<xe;Me++){this._tmpCtx.save();const de=J+Me*this._config.deviceCellWidth,ye=J+(Me+1)*this._config.deviceCellWidth,Xe=de+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(de,se),this._tmpCtx.lineTo(ye,se),this._tmpCtx.moveTo(de,Ee),this._tmpCtx.lineTo(ye,Ee);break;case 3:const Te=le<=1?Ee:Math.ceil(ue+this._config.deviceCharHeight-le/2)-X,Yt=le<=1?se:Math.ceil(ue+this._config.deviceCharHeight+le/2)-X,li=new Path2D;li.rect(de,se,this._config.deviceCellWidth,Ee-se),this._tmpCtx.clip(li),this._tmpCtx.moveTo(de-this._config.deviceCellWidth/2,ve),this._tmpCtx.bezierCurveTo(de-this._config.deviceCellWidth/2,Yt,de,Yt,de,ve),this._tmpCtx.bezierCurveTo(de,Te,Xe,Te,Xe,ve),this._tmpCtx.bezierCurveTo(Xe,Yt,ye,Yt,ye,ve),this._tmpCtx.bezierCurveTo(ye,Te,ye+this._config.deviceCellWidth/2,Te,ye+this._config.deviceCellWidth/2,ve);break;case 4:const Ze=Le===0?0:Le>=le?2*le-Le:le-Le;Le>=le||Ze===0?(this._tmpCtx.setLineDash([Math.round(le),Math.round(le)]),this._tmpCtx.moveTo(de+Ze,se),this._tmpCtx.lineTo(ye,se)):(this._tmpCtx.setLineDash([Math.round(le),Math.round(le)]),this._tmpCtx.moveTo(de,se),this._tmpCtx.lineTo(de+Ze,se),this._tmpCtx.moveTo(de+Ze+le,se),this._tmpCtx.lineTo(ye,se)),Le=(0,l.computeNextVariantOffset)(ye-de,le,Le);break;case 5:const Xt=.6,Jt=.3,ft=ye-de,st=Math.floor(Xt*ft),$t=Math.floor(Jt*ft),yt=ft-st-$t;this._tmpCtx.setLineDash([st,$t,yt]),this._tmpCtx.moveTo(de,se),this._tmpCtx.lineTo(ye,se);break;default:this._tmpCtx.moveTo(de,se),this._tmpCtx.lineTo(ye,se)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Re&&this._config.fontSize>=12&&!this._config.allowTransparency&&N!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Me=this._tmpCtx.measureText(N);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Me&&Me.actualBoundingBoxDescent>0){this._tmpCtx.save();const de=new Path2D;de.rect(J,se-Math.ceil(le/2),this._config.deviceCellWidth*xe,Ee-se+Math.ceil(le/2)),this._tmpCtx.clip(de),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=M.css,this._tmpCtx.strokeText(N,ue,ue+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(K){const le=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),X=le%2==1?.5:0;this._tmpCtx.lineWidth=le,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ue,ue+X),this._tmpCtx.lineTo(ue+this._config.deviceCharWidth*xe,ue+X),this._tmpCtx.stroke()}if(Re||this._tmpCtx.fillText(N,ue,ue+this._config.deviceCharHeight),N==="_"&&!this._config.allowTransparency){let le=S(this._tmpCtx.getImageData(ue,ue,this._config.deviceCellWidth,this._config.deviceCellHeight),M,me,pe);if(le)for(let X=1;X<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=M.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(N,ue,ue+this._config.deviceCharHeight-X),le=S(this._tmpCtx.getImageData(ue,ue,this._config.deviceCellWidth,this._config.deviceCellHeight),M,me,pe),le);X++);}if(z){const le=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),X=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=le,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ue,ue+Math.floor(this._config.deviceCharHeight/2)-X),this._tmpCtx.lineTo(ue+this._config.deviceCharWidth*xe,ue+Math.floor(this._config.deviceCharHeight/2)-X),this._tmpCtx.stroke()}this._tmpCtx.restore();const ze=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ge;if(ge=this._config.allowTransparency?function(le){for(let X=0;X<le.data.length;X+=4)if(le.data[X+3]>0)return!1;return!0}(ze):S(ze,M,me,pe),ge)return c;const _e=this._findGlyphBoundingBox(ze,this._workBoundingBox,$,ie,Re,ue);let fe,be;for(;;){if(this._activePages.length===0){const le=this._createNewPage();fe=le,be=le.currentRow,be.height=_e.size.y;break}fe=this._activePages[this._activePages.length-1],be=fe.currentRow;for(const le of this._activePages)_e.size.y<=le.currentRow.height&&(fe=le,be=le.currentRow);for(let le=this._activePages.length-1;le>=0;le--)for(const X of this._activePages[le].fixedRows)X.height<=be.height&&_e.size.y<=X.height&&(fe=this._activePages[le],be=X);if(be.y+_e.size.y>=fe.canvas.height||be.height>_e.size.y+2){let le=!1;if(fe.currentRow.y+fe.currentRow.height+_e.size.y>=fe.canvas.height){let X;for(const J of this._activePages)if(J.currentRow.y+J.currentRow.height+_e.size.y<J.canvas.height){X=J;break}if(X)fe=X;else if(v.maxAtlasPages&&this._pages.length>=v.maxAtlasPages&&be.y+_e.size.y<=fe.canvas.height&&be.height>=_e.size.y&&be.x+_e.size.x<=fe.canvas.width)le=!0;else{const J=this._createNewPage();fe=J,be=J.currentRow,be.height=_e.size.y,le=!0}}le||(fe.currentRow.height>0&&fe.fixedRows.push(fe.currentRow),be={x:0,y:fe.currentRow.y+fe.currentRow.height,height:_e.size.y},fe.fixedRows.push(be),fe.currentRow={x:0,y:be.y+be.height,height:0})}if(be.x+_e.size.x<=fe.canvas.width)break;be===fe.currentRow?(be.x=0,be.y+=be.height,be.height=0):fe.fixedRows.splice(fe.fixedRows.indexOf(be),1)}return _e.texturePage=this._pages.indexOf(fe),_e.texturePosition.x=be.x,_e.texturePosition.y=be.y,_e.texturePositionClipSpace.x=be.x/fe.canvas.width,_e.texturePositionClipSpace.y=be.y/fe.canvas.height,_e.sizeClipSpace.x/=fe.canvas.width,_e.sizeClipSpace.y/=fe.canvas.height,be.height=Math.max(be.height,_e.size.y),be.x+=_e.size.x,fe.ctx.putImageData(ze,_e.texturePosition.x-this._workBoundingBox.left,_e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,_e.size.x,_e.size.y),fe.addGlyph(_e),fe.version++,_e}_findGlyphBoundingBox(E,R,I,T,D,N){R.top=0;const $=T?this._config.deviceCellHeight:this._tmpCanvas.height,U=T?this._config.deviceCellWidth:I;let P=!1;for(let H=0;H<$;H++){for(let L=0;L<U;L++){const A=H*this._tmpCanvas.width*4+4*L+3;if(E.data[A]!==0){R.top=H,P=!0;break}}if(P)break}R.left=0,P=!1;for(let H=0;H<N+U;H++){for(let L=0;L<$;L++){const A=L*this._tmpCanvas.width*4+4*H+3;if(E.data[A]!==0){R.left=H,P=!0;break}}if(P)break}R.right=U,P=!1;for(let H=N+U-1;H>=N;H--){for(let L=0;L<$;L++){const A=L*this._tmpCanvas.width*4+4*H+3;if(E.data[A]!==0){R.right=H,P=!0;break}}if(P)break}R.bottom=$,P=!1;for(let H=$-1;H>=0;H--){for(let L=0;L<U;L++){const A=H*this._tmpCanvas.width*4+4*L+3;if(E.data[A]!==0){R.bottom=H,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:R.right-R.left+1,y:R.bottom-R.top+1},sizeClipSpace:{x:R.right-R.left+1,y:R.bottom-R.top+1},offset:{x:-R.left+N+(T||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-R.top+N+(T||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=v;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(E){this._glyphs.push(E),this._usedPixels+=E.size.x*E.size.y}constructor(E,R,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const T of I)this._glyphs.push(...T.glyphs),this._usedPixels+=T._usedPixels;this.canvas=k(E,R,R),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function S(w,E,R,I){const T=E.rgba>>>24,D=E.rgba>>>16&255,N=E.rgba>>>8&255,$=R.rgba>>>24,U=R.rgba>>>16&255,P=R.rgba>>>8&255,H=Math.floor((Math.abs(T-$)+Math.abs(D-U)+Math.abs(N-P))/12);let L=!0;for(let A=0;A<w.data.length;A+=4)w.data[A]===T&&w.data[A+1]===D&&w.data[A+2]===N||I&&Math.abs(w.data[A]-T)+Math.abs(w.data[A+1]-D)+Math.abs(w.data[A+2]-N)<H?w.data[A+3]=0:L=!1;return L}function k(w,E,R){const I=w.createElement("canvas");return I.width=E,I.height=R,I}},160:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,f=0,g=0,l=0;var m,y,b,p,a;function h(u){const v=u.toString(16);return v.length<2?"0"+v:v}function c(u,v){return u<v?(v+.05)/(u+.05):(u+.05)/(v+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(v,x,S,k){return k!==void 0?`#${h(v)}${h(x)}${h(S)}${h(k)}`:`#${h(v)}${h(x)}${h(S)}`},u.toRgba=function(v,x,S,k=255){return(v<<24|x<<16|S<<8|k)>>>0},u.toColor=function(v,x,S,k){return{css:u.toCss(v,x,S,k),rgba:u.toRgba(v,x,S,k)}}}(m||(s.channels=m={})),function(u){function v(x,S){return l=Math.round(255*S),[o,f,g]=a.toChannels(x.rgba),{css:m.toCss(o,f,g,l),rgba:m.toRgba(o,f,g,l)}}u.blend=function(x,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const k=S.rgba>>24&255,w=S.rgba>>16&255,E=S.rgba>>8&255,R=x.rgba>>24&255,I=x.rgba>>16&255,T=x.rgba>>8&255;return o=R+Math.round((k-R)*l),f=I+Math.round((w-I)*l),g=T+Math.round((E-T)*l),{css:m.toCss(o,f,g),rgba:m.toRgba(o,f,g)}},u.isOpaque=function(x){return(255&x.rgba)==255},u.ensureContrastRatio=function(x,S,k){const w=a.ensureContrastRatio(x.rgba,S.rgba,k);if(w)return m.toColor(w>>24&255,w>>16&255,w>>8&255)},u.opaque=function(x){const S=(255|x.rgba)>>>0;return[o,f,g]=a.toChannels(S),{css:m.toCss(o,f,g),rgba:S}},u.opacity=v,u.multiplyOpacity=function(x,S){return l=255&x.rgba,v(x,l*S/255)},u.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}}(y||(s.color=y={})),function(u){let v,x;try{const S=document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d",{willReadFrequently:!0});k&&(v=k,v.globalCompositeOperation="copy",x=v.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return o=parseInt(S.slice(1,2).repeat(2),16),f=parseInt(S.slice(2,3).repeat(2),16),g=parseInt(S.slice(3,4).repeat(2),16),m.toColor(o,f,g);case 5:return o=parseInt(S.slice(1,2).repeat(2),16),f=parseInt(S.slice(2,3).repeat(2),16),g=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),m.toColor(o,f,g,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const k=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return o=parseInt(k[1]),f=parseInt(k[2]),g=parseInt(k[3]),l=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),m.toColor(o,f,g,l);if(!v||!x)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=x,v.fillStyle=S,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[o,f,g,l]=v.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(o,f,g,l),css:S}}}(b||(s.css=b={})),function(u){function v(x,S,k){const w=x/255,E=S/255,R=k/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}u.relativeLuminance=function(x){return v(x>>16&255,x>>8&255,255&x)},u.relativeLuminance2=v}(p||(s.rgb=p={})),function(u){function v(S,k,w){const E=S>>24&255,R=S>>16&255,I=S>>8&255;let T=k>>24&255,D=k>>16&255,N=k>>8&255,$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));for(;$<w&&(T>0||D>0||N>0);)T-=Math.max(0,Math.ceil(.1*T)),D-=Math.max(0,Math.ceil(.1*D)),N-=Math.max(0,Math.ceil(.1*N)),$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));return(T<<24|D<<16|N<<8|255)>>>0}function x(S,k,w){const E=S>>24&255,R=S>>16&255,I=S>>8&255;let T=k>>24&255,D=k>>16&255,N=k>>8&255,$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));for(;$<w&&(T<255||D<255||N<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),D=Math.min(255,D+Math.ceil(.1*(255-D))),N=Math.min(255,N+Math.ceil(.1*(255-N))),$=c(p.relativeLuminance2(T,D,N),p.relativeLuminance2(E,R,I));return(T<<24|D<<16|N<<8|255)>>>0}u.blend=function(S,k){if(l=(255&k)/255,l===1)return k;const w=k>>24&255,E=k>>16&255,R=k>>8&255,I=S>>24&255,T=S>>16&255,D=S>>8&255;return o=I+Math.round((w-I)*l),f=T+Math.round((E-T)*l),g=D+Math.round((R-D)*l),m.toRgba(o,f,g)},u.ensureContrastRatio=function(S,k,w){const E=p.relativeLuminance(S>>8),R=p.relativeLuminance(k>>8);if(c(E,R)<w){if(R<E){const D=v(S,k,w),N=c(E,p.relativeLuminance(D>>8));if(N<w){const $=x(S,k,w);return N>c(E,p.relativeLuminance($>>8))?D:$}return D}const I=x(S,k,w),T=c(E,p.relativeLuminance(I>>8));if(T<w){const D=v(S,k,w);return T>c(E,p.relativeLuminance(D>>8))?I:D}return I}},u.reduceLuminance=v,u.increaseLuminance=x,u.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(a||(s.rgba=a={})),s.toPaddedHex=h,s.contrastRatio=c},345:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===o)return void this._listeners.splice(f,1)}}})),this._event}fire(o,f){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,o,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,f){return o(g=>f.fire(g))},s.runAndSubscribe=function(o,f){return f(void 0),o(g=>f(g))}},859:(_,s)=>{function o(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},s.toDisposable=function(f){return{dispose:f}},s.disposeArray=o,s.getDisposeArrayDisposable=function(f){return{dispose:()=>o(f)}}},485:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,l,m){this._data[g]||(this._data[g]={}),this._data[g][l]=m}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(f,g,l,m,y){this._data.get(f,g)||this._data.set(f,g,new o),this._data.get(f,g).set(l,m,y)}get(f,g,l,m){var y;return(y=this._data.get(f,g))==null?void 0:y.get(l,m)}clear(){this._data.clear()}}},399:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,f=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=o.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),s.isIpad=f==="iPad",s.isIphone=f==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),s.isLinux=f.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},385:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const f=o(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let b=0,p=0,a=y.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),p=Math.max(b,p),h=y.timeRemaining(),1.5*p>h)return a-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-b))}ms`),void this._start();a=h}this.clear()}}class l extends g{_requestCallback(y){return setTimeout(()=>y(this._createDeadline(16)))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const b=Date.now()+y;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}s.PriorityTaskQueue=l,s.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:l,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},147:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new o;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,m=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=f},782:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const f=o(133),g=o(855),l=o(147);class m extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const p=new m;return p.setFromCharData(b),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(b[g.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(b[g.CHAR_DATA_CHAR_INDEX].length===2){const a=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const h=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(a-55296)+h-56320+65536|b[g.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[g.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=b[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=m},855:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,f=0,g=o.length){let l="";for(let m=f;m<g;++m){let y=o[m];y>65535?(y-=65536,l+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):l+=String.fromCharCode(y)}return l},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,f){const g=o.length;if(!g)return 0;let l=0,m=0;if(this._interim){const y=o.charCodeAt(m++);56320<=y&&y<=57343?f[l++]=1024*(this._interim-55296)+y-56320+65536:(f[l++]=this._interim,f[l++]=y),this._interim=0}for(let y=m;y<g;++y){const b=o.charCodeAt(y);if(55296<=b&&b<=56319){if(++y>=g)return this._interim=b,l;const p=o.charCodeAt(y);56320<=p&&p<=57343?f[l++]=1024*(b-55296)+p-56320+65536:(f[l++]=b,f[l++]=p)}else b!==65279&&(f[l++]=b)}return l}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,f){const g=o.length;if(!g)return 0;let l,m,y,b,p=0,a=0,h=0;if(this.interim[0]){let v=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let S,k=0;for(;(S=63&this.interim[++k])&&k<4;)x<<=6,x|=S;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-k;for(;h<E;){if(h>=g)return 0;if(S=o[h++],(192&S)!=128){h--,v=!0;break}this.interim[k++]=S,x<<=6,x|=63&S}v||(w===2?x<128?h--:f[p++]=x:w===3?x<2048||x>=55296&&x<=57343||x===65279||(f[p++]=x):x<65536||x>1114111||(f[p++]=x)),this.interim.fill(0)}const c=g-4;let u=h;for(;u<g;){for(;!(!(u<c)||128&(l=o[u])||128&(m=o[u+1])||128&(y=o[u+2])||128&(b=o[u+3]));)f[p++]=l,f[p++]=m,f[p++]=y,f[p++]=b,u+=4;if(l=o[u++],l<128)f[p++]=l;else if((224&l)==192){if(u>=g)return this.interim[0]=l,p;if(m=o[u++],(192&m)!=128){u--;continue}if(a=(31&l)<<6|63&m,a<128){u--;continue}f[p++]=a}else if((240&l)==224){if(u>=g)return this.interim[0]=l,p;if(m=o[u++],(192&m)!=128){u--;continue}if(u>=g)return this.interim[0]=l,this.interim[1]=m,p;if(y=o[u++],(192&y)!=128){u--;continue}if(a=(15&l)<<12|(63&m)<<6|63&y,a<2048||a>=55296&&a<=57343||a===65279)continue;f[p++]=a}else if((248&l)==240){if(u>=g)return this.interim[0]=l,p;if(m=o[u++],(192&m)!=128){u--;continue}if(u>=g)return this.interim[0]=l,this.interim[1]=m,p;if(y=o[u++],(192&y)!=128){u--;continue}if(u>=g)return this.interim[0]=l,this.interim[1]=m,this.interim[2]=y,p;if(b=o[u++],(192&b)!=128){u--;continue}if(a=(7&l)<<18|(63&m)<<12|(63&y)<<6|63&b,a<65536||a>1114111)continue;f[p++]=a}}return p}}},776:function(_,s,o){var f=this&&this.__decorate||function(a,h,c,u){var v,x=arguments.length,S=x<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,c):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(a,h,c,u);else for(var k=a.length-1;k>=0;k--)(v=a[k])&&(S=(x<3?v(S):x>3?v(h,c,S):v(h,c))||S);return x>3&&S&&Object.defineProperty(h,c,S),S},g=this&&this.__param||function(a,h){return function(c,u){h(c,u,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const l=o(859),m=o(97),y={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let b,p=s.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let h=0;h<a.length;h++)typeof a[h]=="function"&&(a[h]=a[h]())}_log(a,h,c){this._evalLazyOptionalParams(c),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(a,...h){var c;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,a,h)}debug(a,...h){var c;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,a,h)}info(a,...h){var c;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,a,h)}warn(a,...h){var c;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,a,h)}error(a,...h){var c;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,a,h)}};s.LogService=p=f([g(0,m.IOptionsService)],p),s.setTraceLogger=function(a){b=a},s.traceCall=function(a,h,c){if(typeof c.value!="function")throw new Error("not supported");const u=c.value;c.value=function(...v){if(b.logLevel!==m.LogLevelEnum.TRACE)return u.apply(this,v);b.trace(`GlyphRenderer#${u.name}(${v.map(S=>JSON.stringify(S)).join(", ")})`);const x=u.apply(this,v);return b.trace(`GlyphRenderer#${u.name} return`,x),x}}},726:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",f="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[f]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const l=function(m,y,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,a,h){a[o]===a?a[f].push({id:p,index:h}):(a[f]=[{id:p,index:h}],a[o]=a)})(l,m,b)};return l.toString=()=>g,s.serviceRegistry.set(g,l),l}},97:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const f=o(726);var g;s.IBufferService=(0,f.createDecorator)("BufferService"),s.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),s.ICoreService=(0,f.createDecorator)("CoreService"),s.ICharsetService=(0,f.createDecorator)("CharsetService"),s.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,f.createDecorator)("LogService"),s.IOptionsService=(0,f.createDecorator)("OptionsService"),s.IOscLinkService=(0,f.createDecorator)("OscLinkService"),s.IUnicodeService=(0,f.createDecorator)("UnicodeService"),s.IDecorationService=(0,f.createDecorator)("DecorationService")}},r={};function n(_){var s=r[_];if(s!==void 0)return s.exports;var o=r[_]={exports:{}};return i[_].call(o.exports,o,o.exports,n),o.exports}var d={};return(()=>{var _=d;Object.defineProperty(_,"__esModule",{value:!0}),_.WebglAddon=void 0;const s=n(345),o=n(859),f=n(399),g=n(666),l=n(776);class m extends o.Disposable{constructor(b){if(f.isSafari&&(0,f.getSafariVersion)()<16){const p={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",p))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=b,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(b){const p=b._core;if(!b.element)return void this.register(p.onWillOpen(()=>this.activate(b)));this._terminal=b;const a=p.coreService,h=p.optionsService,c=p,u=c._renderService,v=c._characterJoinerService,x=c._charSizeService,S=c._coreBrowserService,k=c._decorationService,w=c._logService,E=c._themeService;(0,l.setTraceLogger)(w),this._renderer=this.register(new g.WebglRenderer(b,v,x,S,a,k,h,E,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),u.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const R=this._terminal._core._renderService;R.setRenderer(this._terminal._core._createRenderer()),R.handleResize(b.cols,b.rows)}))}get textureAtlas(){var b;return(b=this._renderer)==null?void 0:b.textureAtlas}clearTextureAtlas(){var b;(b=this._renderer)==null||b.clearTextureAtlas()}}_.WebglAddon=m})(),d})())})(K_);var Xw=K_.exports;function Jw(e){return e.replace(/\r?\n/g,`\r
106
+ `)}function Zw(e,t){let i=t,r=!1,n=!1,d=!1;const _=g=>{/\S/.test(g)&&(r=!0,i&&(n=!0)),i&&g.length&&(d=!0)},s=/\x1b\[([0-9;]*)m/g;let o=0,f=s.exec(e);for(;f;){_(e.slice(o,f.index)),o=s.lastIndex;const g=f[1]===""?[0]:f[1].split(";").map(Number);for(let l=0;l<g.length;l+=1){const m=g[l];if(m===0||m===49)i=!1;else if(m>=40&&m<=47||m>=100&&m<=107)i=!0;else if(m===38||m===48){const y=m===48;g[l+1]===5?(l+=2,y&&(i=!0)):g[l+1]===2&&(l+=4,y&&(i=!0))}}f=s.exec(e)}return _(e.slice(o)),{bgEnd:i,hasText:r,hasShadeText:n,hasShadeBlank:d}}function Qw(e){const t=[];let i=!1,r=[],n=-1,d=!1;const _=()=>{n>=0&&d&&(t[n]+="\x1B[49m"),n=-1,d=!1},s=()=>{if(r.length){t.push("\x1B[0m");for(let o=1;o<r.length;o+=1)t.push("");r=[]}};for(const o of e){const f=Zw(o,i);f.hasShadeText?(t.push(...r),r=[],t.push(o),n=t.length-1,d=f.bgEnd):!f.hasText&&(i||f.bgEnd||f.hasShadeBlank)?r.push(o):(_(),s(),t.push(o)),i=f.bgEnd}return _(),s(),t}function ey(e){const t=Jw(e.replace(/\n$/,""));return Qw(t.split(`\r
107
+ `)).join(`\r
108
+ `)}function ty(e,t,i=0){if(!e||!e.vis)return"\x1B[?25l";const r=i?Math.min(t|0,i|0):t|0,n=Math.max(1,r-Math.max(0,e.row|0)),d=Math.max(0,e.col|0)+1;return`\x1B[${n};${d}H\x1B[?25h`}function iy(e,{base:t=1e3,max:i=1e4,factor:r=2,jitter:n=.2,rng:d=Math.random}={}){if(e<=0)return 0;const _=Math.min(i,t*r**(e-1));return Math.round(_*(1+n*(d()*2-1)))}const ry=1e3;function sy(e){return e<8e3?ry:e<6e4?5e3:1e4}const ny=.95,oy=.015,ay=.1,ly=50;function cy(e,t,i=ny,r=oy){const n=e*t,d=e*i**(t/16);return{delta:n,v:d,done:Math.abs(d)<r}}function uy(e,t,i=ay,r=ly){return t<=r&&Math.abs(e)>=i}const hy={failCount:0,connected:!0};function hl(e,t,{threshold:i=2}={}){switch(t){case"ok":case"reset":return{failCount:0,connected:!0};case"fail":{const r=e.failCount+1;return{failCount:r,connected:r<i}}default:return e}}function q_(e,t,i){var s,o;let r=t;for(;r>0&&((s=e.getLine(r))!=null&&s.isWrapped);)r--;let n="";const d=[];let _=r;do{const f=e.getLine(_);if(!f)break;for(let g=0;g<i;g++){const l=f.getCell(g);if(!l)continue;const m=l.getWidth();m!==0&&(n+=l.getChars()||" ",d.push({row:_,col:g,w:m}))}_++}while(_<e.length&&((o=e.getLine(_))!=null&&o.isWrapped));return{text:n,cells:d}}function dy(e){var s;const t=e.buffer.active,i=e.cols,r=t.baseY,n=r+e.rows,d=[];let _=r;for(;_>0&&((s=t.getLine(_))!=null&&s.isWrapped);)_--;for(;_<n;){if(!t.getLine(_)){_++;continue}const{text:o,cells:f}=q_(t,_,i);for(const{start:g,end:l}of U_(o)){let m=g;for(;m<l;){const y=f[m].row;let b=m;for(;b<l&&f[b].row===y;)b++;const p=f[m].col,a=f[b-1],h=a.col+a.w;y>=r&&y<n&&d.push({y,x:p,width:h-p,path:o.slice(g,l)}),m=b}}_=f.length?f[f.length-1].row+1:_+1}return d}function fy(e,t){const i=e.buffer.active,r=e.cols,n=t-1;if(n<0||n>=i.length)return[];const{text:d,cells:_}=q_(i,n,r),s=[];for(const{start:o,end:f}of U_(d)){const g=_[o],l=_[f-1];n<g.row||n>l.row||s.push({range:{start:{x:g.col+1,y:g.row+1},end:{x:l.col+l.w,y:l.row+1}},path:d.slice(o,f)})}return s}const py=20,_y=100,po=5e3,my=15,gy=B.forwardRef(function({pane:t,onAuthFail:i,onDocLinkTap:r},n){const d=B.useRef(null),_=B.useRef(null),s=B.useRef([]),o=B.useRef(r);o.current=r;const f=B.useRef(d0()),g=B.useRef(null),[l,m]=B.useState(!1),[y,b]=B.useState(!0),p=B.useRef(!1),[a,h]=B.useState(null),[c,u]=B.useState(!1),v=B.useRef(null),[x,S]=B.useState(""),[k,w]=B.useState(!1),E=B.useRef(null),R=B.useRef(null),[I,T]=B.useState(""),[D,N]=B.useState(!1),$=B.useRef(null),U=B.useRef(null);B.useImperativeHandle(n,()=>({getSize:()=>{const L=_.current;return L?{cols:L.cols,rows:L.rows}:null},flash:()=>{const L=()=>{const A=_.current;A&&S(`${A.cols}×${A.rows} · ${A.options.fontSize}px`)};L(),w(!0),clearTimeout(E.current),clearInterval(R.current),R.current=setInterval(L,400),E.current=setTimeout(()=>{w(!1),clearInterval(R.current)},3e3)},getFontSize:()=>{const L=_.current;return L?{size:L.options.fontSize,auto:f.current==null}:null},setFontSize:L=>{var z;const A=_.current;if(!A)return null;const j=Math.max(8,Math.min(40,Math.round(L)));return A.options.fontSize=j,f.current=j,rd(j),(z=$.current)==null||z.call($),j},autoFont:()=>{var A;const L=_.current;L&&(L.options.fontSize=14,f.current=null,f0(),(A=$.current)==null||A.call($))},wake:()=>{var L;return(L=U.current)==null?void 0:L.call(U)}}),[]),B.useEffect(()=>()=>{clearTimeout(E.current),clearInterval(R.current)},[]),B.useEffect(()=>{var rr;const L=new Yw.Terminal({disableStdin:!0,scrollback:po+100,convertEol:!1,fontSize:f.current??14,fontFamily:"ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, 'Cascadia Mono', 'Roboto Mono', 'Noto Sans Mono', 'DejaVu Sans Mono', 'Courier New', 'JetBrainsMono Nerd Font', 'TW Unifont', monospace",theme:{selectionBackground:"rgba(74,124,255,0.45)"},cursorInactiveStyle:"block"});L.open(d.current),_.current=L;const A=L.registerLinkProvider({provideLinks(ce,Ae){if(!o.current){Ae(void 0);return}const je=fy(L,ce).map(({range:Se,path:De})=>({range:Se,text:De,decorations:{pointerCursor:!0,underline:!1},activate:ne=>{var F;return(F=o.current)==null?void 0:F.call(o,De,(ne==null?void 0:ne.clientX)??0,(ne==null?void 0:ne.clientY)??0)}}));Ae(je.length?je:void 0)}});let j=null;const z=()=>{try{j=new Xw.WebglAddon,j.onContextLoss(()=>j.dispose()),L.loadAddon(j)}catch{j=null}};z();const K=d.current.querySelector(".xterm-helper-textarea");K&&(K.readOnly=!0,K.tabIndex=-1,K.setAttribute("inputmode","none"),K.setAttribute("aria-hidden","true"));let Y=null,te=!1,Q=!1,W=!1,M=!1;const G=()=>Math.min(po,Math.max(24,L.rows+py));let V=G(),re=null,ie="",me=null,ue=0,Re=null,xe=Date.now();m(!1),N(!1);let pe=!1;const ze=()=>{te||pe||(pe=!0,requestAnimationFrame(()=>{te||N(!0)}))};let ge=hy;const _e=ce=>{ge=ce,b(ce.connected)};if((rr=document.fonts)!=null&&rr.load){const ce=f.current??14;Promise.all([document.fonts.load(`${ce}px "JetBrainsMono Nerd Font"`).catch(()=>{}),document.fonts.load(`${ce}px "TW Unifont"`,"⏵").catch(()=>{})]).then(()=>{if(!(te||!j)){try{j.dispose()}catch{}z(),L.refresh(0,L.rows-1)}})}const fe=()=>L.buffer.active,be=(ce="")=>{const Ae=fe();T(M&&!X()?`历史模式 · 行 ${Ae.viewportY}/${Ae.baseY}${Q?" · 拉取中":""}${ce}`:"")},le=()=>fe().viewportY>=fe().baseY,X=()=>fe().baseY-fe().viewportY<=my,J=()=>fe().viewportY<=3,se=()=>{!M||Q||V>=po||!J()||(V=Math.min(V+_y,po),be(" · 拉取↑"),$i(V,!0))};let ve=0;const Ee=()=>{te||L.write(ty(me,L.rows,ue))},Le=(ce=0)=>{if(te||!d.current||!L.rows)return;const Ae=d.current.clientHeight,je=d.current.querySelector(".xterm-screen"),Se=je?je.getBoundingClientRect().height:0;if(!Ae||!Se)return;const De=Se/L.rows;if(f.current==null&&ve&&ce<4){const F=ve*De;if(F>Ae+4){const Z=L.options.fontSize||14,ae=Math.max(6,Math.round(Z*(Ae/F)));if(ae<Z){L.options.fontSize=ae,requestAnimationFrame(()=>Le(ce+1));return}}}const ne=Math.max(1,Math.floor(Ae/De));if(ne!==L.rows){L.write(`\x1B[?25l\x1B[${L.rows};1H`,()=>{te||(L.resize(L.cols,ne),L.scrollToBottom(),ce<4?requestAnimationFrame(()=>Le(ce+1)):(Ee(),ze()))});return}Ee(),ze()},Me=()=>requestAnimationFrame(()=>Le(0));$.current=Me;const de=()=>Me();window.addEventListener("resize",de),window.addEventListener("orientationchange",de);const ye=(ce,Ae)=>{var ae;const je=(ae=d.current)==null?void 0:ae.querySelector(".xterm-screen");if(!je||!L.cols||!L.rows)return null;const Se=je.getBoundingClientRect(),De=Se.width/L.cols,ne=Se.height/L.rows;if(!De||!ne)return null;const F=Math.max(0,Math.min(L.cols-1,Math.floor((ce-Se.left)/De))),Z=Math.max(0,Math.min(L.rows-1,Math.floor((Ae-Se.top)/ne)));return{col:F,row:fe().viewportY+Z}};let Xe=null;const Te=(ce,Ae)=>{var F,Z;const je=ye(ce,Ae);if(!je)return;const Se=((F=fe().getLine(je.row))==null?void 0:F.translateToString(!1))??"";let De=je.col,ne=je.col;if(/\S/.test(Se[je.col]||"")){for(;De>0&&/\S/.test(Se[De-1]);)De--;for(;ne<L.cols-1&&/\S/.test(Se[ne+1]);)ne++}Xe={col:De,row:je.row},p.current=!0,h(null),clearTimeout(v.current),u(!0),L.select(De,je.row,ne-De+1),(Z=navigator.vibrate)==null||Z.call(navigator,12)},Yt=(ce,Ae)=>{const je=ye(ce,Ae);if(!je||!Xe)return;const Se=L.cols,De=Xe.row*Se+Xe.col,ne=je.row*Se+je.col,F=Math.min(De,ne);L.select(F%Se,Math.floor(F/Se),Math.abs(ne-De)+1)},li=()=>{Xe=null,p.current=!1,h(null),clearTimeout(v.current),u(!1),L.clearSelection()},Ze=d.current;let Xt=0,Jt=0,ft=0,st=0,$t=!1,yt=0,Zr=0,gi=!1,vi=null;const tr=()=>{vi&&(clearTimeout(vi),vi=null)},St=ce=>Math.hypot(ce[0].clientX-ce[1].clientX,ce[0].clientY-ce[1].clientY);let xr=0,kr=0,We=0,Zt=0,zi=0,ci=null;const wi=()=>{ci!=null&&(cancelAnimationFrame(ci),ci=null)};g.current=wi;const Er=(ce,Ae,je)=>{if(!ce)return;let Se=je,De=null;const ne=F=>{if(De==null){De=F,ci=requestAnimationFrame(ne);return}const Z=F-De;De=F;const ae=cy(Se,Z);Se=ae.v;const Be=ce[Ae];ce[Ae]=Be+ae.delta;const Ie=Math.abs(ae.delta)>=1&&ce[Ae]===Be;if(ae.done||Ie){ci=null;return}ci=requestAnimationFrame(ne)};ci=requestAnimationFrame(ne)},Lr=ce=>{if(xe=Date.now(),tr(),wi(),p.current&&li(),gi=!1,ce.touches.length===2){$t=!0,st=-1,yt=St(ce.touches),Zr=L.options.fontSize||14;return}if($t=!1,ce.touches.length!==1){st=-1;return}Xt=ce.touches[0].clientX,Jt=ce.touches[0].clientY,ft=Ze.scrollLeft,st=0,xr=Xt,kr=Jt,We=ce.timeStamp,Zt=0,zi=0,vi=setTimeout(()=>{vi=null,gi=!0,st=-1,Te(Xt,Jt)},500)},Qr=ce=>{if($t&&ce.touches.length===2){if(yt>0){const Se=Math.max(8,Math.min(40,Math.round(Zr*(St(ce.touches)/yt))));Se!==(L.options.fontSize||14)&&(L.options.fontSize=Se,f.current=Se)}ce.preventDefault(),ce.stopPropagation();return}if(gi&&ce.touches.length===1){Yt(ce.touches[0].clientX,ce.touches[0].clientY),ce.preventDefault(),ce.stopPropagation();return}if(ce.touches.length===1&&(be(),se()),ce.touches.length!==1)return;const Ae=ce.touches[0].clientX-Xt,je=ce.touches[0].clientY-Jt;if((Math.abs(Ae)>6||Math.abs(je)>6)&&tr(),st===0){if(Math.abs(Ae)<6&&Math.abs(je)<6)return;st=Math.abs(Ae)>Math.abs(je)?1:-1}if(st===1){Ze.scrollLeft=ft-Ae;const Se=ce.touches[0].clientX,De=ce.timeStamp-We;De>0&&(Zt=(xr-Se)/De),xr=Se,We=ce.timeStamp,ce.preventDefault(),ce.stopPropagation()}else{const Se=ce.touches[0].clientY,De=ce.timeStamp-We;De>0&&(zi=(kr-Se)/De),kr=Se,We=ce.timeStamp}},Et=ce=>{if(tr(),gi&&ce.touches.length===0){gi=!1,clearTimeout(v.current),v.current=setTimeout(()=>u(!1),3500);const Ae=L.getSelection();if(Ae&&Ae.trim()){const je=ce.changedTouches[0],Se=Ze.getBoundingClientRect(),De=Math.max(8,Math.min(Se.width-72,je.clientX-Se.left)),ne=Math.max(8,je.clientY-Se.top-46);h({x:De,y:ne})}else li();return}if($t&&ce.touches.length<2){$t=!1,rd(L.options.fontSize||14),Me();return}ce.touches.length===0&&uy(st===1?Zt:zi,ce.timeStamp-We)&&(st===1?Er(Ze,"scrollLeft",Zt):st===-1&&Er(Ze.querySelector(".xterm-viewport"),"scrollTop",zi))};Ze.addEventListener("touchstart",Lr,{capture:!0,passive:!0}),Ze.addEventListener("touchmove",Qr,{capture:!0,passive:!1}),Ze.addEventListener("touchend",Et,{capture:!0,passive:!0});const yi=ce=>{for(const{deco:Se,marker:De}of s.current)Se.dispose(),De.dispose();if(s.current=[],!o.current)return;const Ae=ce.buffer.active,je=Ae.baseY+Ae.cursorY;for(const{y:Se,x:De,width:ne}of dy(ce)){const F=ce.registerMarker(Se-je);if(!F)continue;const Z=ce.registerDecoration({marker:F,x:De,width:ne});if(!Z){F.dispose();continue}Z.onRender(ae=>{ae.classList.add("doc-deco")}),s.current.push({deco:Z,marker:F})}},$i=async(ce,Ae)=>{if(Q||te)return;Q=!0;const je=Ae?fe().length-fe().viewportY:0;try{const Se=await I0(t,ce,Re);if(te)return;if(_e(hl(ge,"ok")),Se.unchanged){m(Ae);return}Re=Se.hash,xe=Date.now();let De=!1;Se.width&&Se.width!==L.cols&&(L.resize(Se.width,L.rows),De=!0);const ne=ve;Se.height&&(ve=Se.height);const F=!M,Z=Se.cur?`${Se.cur.row},${Se.cur.col},${Se.cur.vis?1:0}`:"";if(!De&&!F&&Se.ansi===re&&Z===ie){m(Ae);return}const ae=ey(Se.ansi);if(ue=ae?ae.split(`
109
+ `).length:0,await new Promise(Be=>L.write("\x1B[?25l\x1B[0m\x1B[2J\x1B[3J\x1B[H"+ae,Be)),te)return;re=Se.ansi,ie=Z,me=Se.cur,Ae?L.scrollToLine(Math.max(0,fe().length-je)):L.scrollToBottom(),M=!0;try{yi(L)}catch{}m(Ae),Ee(),(De||F||ve!==ne)&&Me(),F&&setTimeout(ze,400)}catch(Se){Se instanceof it?i==null||i():te||_e(hl(ge,"fail"))}finally{Q=!1,W&&!te&&(W=!1,Qt())}},ir=async()=>{if(!(Q||te)&&!p.current){if(M&&!X()){m(!0);return}V=G(),await $i(V,!le())}};let Si=0;async function Ui(ce){if(!te&&ce===Si&&await ir(),te||document.hidden||ce!==Si)return;const Ae=ge.failCount>0?iy(ge.failCount):sy(Date.now()-xe);Y=setTimeout(()=>Ui(ce),Ae)}const Qt=()=>{Si+=1,Y&&(clearTimeout(Y),Y=null),Ui(Si)};Qt();const Ti=()=>{if(xe=Date.now(),Q){W=!0;return}Qt()};U.current=Ti;const Lt=()=>{document.hidden?(Si+=1,Y&&(clearTimeout(Y),Y=null)):(_e(hl(ge,"reset")),V=G(),xe=Date.now(),Qt())};document.addEventListener("visibilitychange",Lt);const es=L.onScroll(()=>{if(!te){if(le()){m(!1),T("");return}m(!0),be(),se()}});return()=>{te=!0,$.current=null,U.current=null,g.current=null,tr(),wi(),Y&&clearTimeout(Y),clearTimeout(v.current),document.removeEventListener("visibilitychange",Lt),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),Ze.removeEventListener("touchstart",Lr,{capture:!0}),Ze.removeEventListener("touchmove",Qr,{capture:!0}),Ze.removeEventListener("touchend",Et,{capture:!0}),es.dispose(),A.dispose();for(const{deco:ce,marker:Ae}of s.current)ce.dispose(),Ae.dispose();s.current=[],L.dispose(),_.current=null}},[t]);const P=()=>{var A,j,z,K;(A=g.current)==null||A.call(g);const L=(j=d.current)==null?void 0:j.querySelector(".xterm-viewport");L&&(L.scrollTop=L.scrollHeight),(z=_.current)==null||z.scrollToBottom(),m(!1),T(""),(K=U.current)==null||K.call(U)},H=async()=>{const L=_.current,A=L==null?void 0:L.getSelection();if(A){let j=!1;if(navigator.clipboard&&window.isSecureContext)try{await navigator.clipboard.writeText(A),j=!0}catch{}if(!j){const z=document.createElement("textarea");z.value=A,z.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(z),z.focus(),z.select();try{document.execCommand("copy")}catch{}document.body.removeChild(z)}}L==null||L.clearSelection(),p.current=!1,h(null),clearTimeout(v.current),u(!1)};return C.jsxs("div",{className:"terminal-wrap",children:[C.jsx("div",{ref:d,className:D?"terminal":"terminal terminal--loading"}),!y&&C.jsx("div",{className:"term-banner term-banner--err",children:"⚠ 连接断开,重连中…"}),k&&C.jsx("div",{className:"dbg",children:x}),y&&I&&C.jsx("div",{className:"term-banner term-banner--hist",children:I}),I&&C.jsx("button",{className:"new-output",onClick:P,children:"↓ 回到底部"}),c&&C.jsx("div",{className:"sel-hint",children:"按住拖动选择文字,松手后点「复制」"}),a&&C.jsx("button",{className:"copy-bubble",style:{left:a.x,top:a.y},onClick:H,children:"复制"})]})});function Y_(e,{delay:t=400,interval:i=120}={}){let r=null,n=null;const d=()=>{r&&clearTimeout(r),n&&clearInterval(n),r=null,n=null};return{start:()=>{d(),e(),r=setTimeout(()=>{n=setInterval(e,i)},t)},stop:d}}const vy=[["esc","left"],["up","down"],["tab","right"],["n1","slash"],["n2","at"],["n3","bang"],["ctrlc","space"],["compact","clear"],["model","btw"],["effort","plugin"],["loop","skill"],["stab","ctrll"],["ctrlo","ctrle"]],wy={esc:"Esc",up:"▲",tab:"Tab",left:"◀",down:"▼",right:"▶",n1:"1",n2:"2",n3:"3",slash:"/",at:"@",space:"Space",ctrlc:"Ctrl+C",bang:"!",stab:"Shift+Tab",ctrll:"Ctrl+L",ctrlo:"Ctrl+O",ctrle:"Ctrl+E",compact:"/compact",clear:"/clear",model:"/model",btw:"/btw",effort:"/effort",plugin:"/plugin",loop:"/loop",skill:"/skill"},yy=new Set(["up","down","left","right"]),yd={esc:"Escape",space:"Space",up:"Up",down:"Down",left:"Left",right:"Right",tab:"Tab",stab:"BTab",ctrlc:"C-c",ctrll:"C-l",ctrlo:"C-o",ctrle:"C-e"},Sd={slash:"/",at:"@",n1:"1",n2:"2",n3:"3",bang:"!",compact:"/compact",clear:"/clear",model:"/model",btw:"/btw ",effort:"/effort",plugin:"/plugin",loop:"/loop ",skill:"/skill"};function Sy(e){return e in yd?{kind:"key",name:yd[e]}:e in Sd?{kind:"text",ch:Sd[e]}:null}function by({onKey:e,onText:t}){const i=r=>{const n=Sy(r);n&&(n.kind==="key"?e(n.name):t(n.ch))};return C.jsx("div",{className:"keybar",children:C.jsx("div",{className:"keybar-scroll",children:vy.map(r=>C.jsx(Cy,{col:r,dispatch:i},r.join()))})})}function Cy({col:e,dispatch:t}){return C.jsx("div",{className:"keybar-col",children:e.map(i=>C.jsx(xy,{id:i,dispatch:t},i))})}function xy({id:e,dispatch:t}){const i=B.useRef(null),r=B.useRef(t);r.current=t;const n=wy[e];if(!yy.has(e))return C.jsx("button",{type:"button",className:"keybar-key","data-key":e,onClick:()=>t(e),children:n});const d=s=>{s.cancelable&&s.preventDefault(),i.current||(i.current=Y_(()=>r.current(e))),i.current.start()},_=()=>{var s;return(s=i.current)==null?void 0:s.stop()};return C.jsx("button",{type:"button",className:"keybar-key","data-key":e,onPointerDown:d,onPointerUp:_,onPointerCancel:_,onPointerLeave:_,children:n})}function ky({open:e,recent:t=[],favorites:i=[],onPick:r,onToggleFav:n,onRemoveRecent:d,onClose:_}){if(!e)return null;const s=i.length===0&&t.length===0;return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"cmd-backdrop",onClick:_}),C.jsxs("div",{className:"cmd-panel",role:"dialog","aria-label":O("cmd.panel"),children:[C.jsxs("div",{className:"cmd-head",children:[C.jsx("span",{className:"cmd-title",children:O("cmd.title")}),C.jsx("button",{className:"cmd-close",onClick:_,"aria-label":O("common.close"),children:C.jsx(hd,{})})]}),C.jsxs("div",{className:"cmd-list",children:[s&&C.jsx("div",{className:"cmd-empty",children:O("cmd.empty")}),i.length>0&&C.jsxs("div",{className:"cmd-section fav",children:[C.jsx("span",{className:"cmd-section-name",children:O("cmd.favorites")}),C.jsx("span",{className:"cmd-scope",children:O("cmd.scopeGlobal")})]}),i.map(o=>C.jsxs("div",{className:"cmd-row",children:[C.jsx("span",{className:"cmd-text",onClick:()=>r(o),children:o}),C.jsx("button",{className:"cmd-star on",onClick:()=>n(o),"aria-label":O("cmd.unfavorite"),children:C.jsx(dd,{})})]},`f:${o}`)),t.length>0&&C.jsxs("div",{className:"cmd-section recent",children:[C.jsx("span",{className:"cmd-section-name",children:O("cmd.recent")}),C.jsx("span",{className:"cmd-scope",children:O("cmd.scopeSession")})]}),t.map(o=>{const f=i.includes(o);return C.jsxs("div",{className:"cmd-row",children:[C.jsx("span",{className:"cmd-text",onClick:()=>r(o),children:o}),C.jsx("button",{className:`cmd-star ${f?"on":""}`,onClick:()=>n(o),"aria-label":O(f?"cmd.unfavorite":"cmd.favorite"),children:C.jsx(dd,{})}),C.jsx("button",{className:"cmd-del",onClick:()=>d(o),"aria-label":O("common.delete"),children:C.jsx(hd,{})})]},`r:${o}`)})]})]})]})}function X_({active:e,disabled:t,onToggle:i}){return C.jsx("button",{type:"button",className:`input-mic${e?" on":""}`,"aria-label":O(e?"mic.stop":"mic.start"),"aria-pressed":e,disabled:t,onClick:i,children:C.jsx(Sw,{})})}function Ey(e,t){const i=t/16e3,r=Math.floor(e.length/i),n=new Int16Array(r);for(let d=0;d<r;d++){let _=e[Math.floor(d*i)];_>1?_=1:_<-1&&(_=-1),n[d]=_<0?_*32768:_*32767}return new Uint8Array(n.buffer)}function Ly(e=1280){let t=new Uint8Array(0);return{push(i){const r=new Uint8Array(t.length+i.length);r.set(t),r.set(i,t.length);const n=[];let d=0;for(;r.length-d>=e;)n.push(r.slice(d,d+e)),d+=e;return t=r.slice(d),n},flush(){if(t.length===0)return null;const i=t;return t=new Uint8Array(0),i}}}function bd(e){let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return btoa(t)}const Ry="data:text/javascript;base64,Ly8gd2ViL3NyYy92b2ljZS9wY20td29ya2xldC5qcwovLyBNaW5pbWFsIEF1ZGlvV29ya2xldDogZm9yd2FyZCBlYWNoIHJlbmRlciBxdWFudHVtJ3MgbW9ubyBzYW1wbGVzIHRvIHRoZSBtYWluIHRocmVhZCwgd2hpY2ggZG9lcyB0aGUKLy8gKHVuaXQtdGVzdGVkKSBkb3duc2FtcGxlL2ZyYW1lL2VuY29kZS4gS2VwdCB0cml2aWFsIG9uIHB1cnBvc2Ug4oCUIHdvcmtsZXQgY29kZSBjYW4ndCBiZSB1bml0LXRlc3RlZC4KY2xhc3MgUGNtRm9yd2FyZGVyIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBwcm9jZXNzKGlucHV0cykgewogICAgY29uc3QgY2ggPSBpbnB1dHNbMF0gJiYgaW5wdXRzWzBdWzBdOwogICAgaWYgKGNoICYmIGNoLmxlbmd0aCkgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKGNoLnNsaWNlKDApKTsgLy8gY29weTogdGhlIGJ1ZmZlciBpcyByZXVzZWQgYWZ0ZXIgcHJvY2VzcygpCiAgICByZXR1cm4gdHJ1ZTsKICB9Cn0KcmVnaXN0ZXJQcm9jZXNzb3IoJ3BjbS1mb3J3YXJkZXInLCBQY21Gb3J3YXJkZXIpOwo=";function Ty({getUserMedia:e=i=>navigator.mediaDevices.getUserMedia(i),AudioCtor:t=window.AudioContext||window.webkitAudioContext}={}){let i=null,r=null,n=null,d=null;const _=Ly(1280);async function s(f){r=await e({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),i=new t,await i.resume(),await i.audioWorklet.addModule(Ry),d=i.createMediaStreamSource(r),n=new AudioWorkletNode(i,"pcm-forwarder"),n.port.onmessage=g=>{const l=Ey(g.data,i.sampleRate);for(const m of _.push(l))f(bd(m))},d.connect(n),n.connect(i.destination)}async function o(){try{n&&(n.port.onmessage=null)}catch{}try{d&&d.disconnect(),n&&n.disconnect()}catch{}try{r&&r.getTracks().forEach(g=>g.stop())}catch{}try{i&&await i.close()}catch{}const f=_.flush();return i=r=n=d=null,f?bd(f):null}return{start:s,stop:o}}const Dy={language:"zh_cn",domain:"iat",accent:"mandarin",vad_eos:1e4,dwa:"wpgs",ptt:1,nunum:1},xu="audio/L16;rate=16000";function Ay(e,t){return{common:{app_id:e},business:{...Dy},data:{status:0,format:xu,encoding:"raw",audio:t}}}function My(e){return{data:{status:1,format:xu,encoding:"raw",audio:e}}}function Iy(){return{data:{status:2,format:xu,encoding:"raw",audio:""}}}function Cd(){return{sentences:new Map}}function Py(e,t){var d;const i=(d=t==null?void 0:t.data)==null?void 0:d.result;if(!i||!Array.isArray(i.ws))return e;const r=i.ws.map(_=>(_.cw||[]).map(s=>s.w).join("")).join(""),n=new Map(e.sentences);if(i.pgs==="rpl"&&Array.isArray(i.rg))for(let _=i.rg[0];_<=i.rg[1];_++)n.delete(_);return n.set(i.sn,r),{sentences:n}}function xd(e){return[...e.sentences.keys()].sort((t,i)=>t-i).map(t=>e.sentences.get(t)).join("")}const Oy=55e3,Ny=4e3;function J_({onText:e,deps:t={}}){const i=t.signAsr||K0,r=t.WebSocketCtor||window.WebSocket,n=t.makeRecorder||(()=>Ty()),[d,_]=B.useState("idle"),[s,o]=B.useState(""),f=B.useRef("idle"),g=B.useCallback(E=>{f.current=E,_(E)},[]),l=B.useRef(null),m=B.useRef(null),y=B.useRef(Cd()),b=B.useRef(""),p=B.useRef(!1),a=B.useRef(null),h=B.useRef(null),c=B.useRef(null),u=B.useRef(e);u.current=e;const v=B.useCallback(()=>{clearTimeout(a.current),clearTimeout(h.current);try{l.current&&l.current.close()}catch{}l.current=null,m.current=null,p.current=!1},[]),x=B.useCallback(()=>{var E;f.current!=="idle"&&((E=u.current)==null||E.call(u,xd(y.current)),o(""),g("idle"),v())},[v,g]),S=B.useCallback(E=>{const R=l.current;!R||R.readyState!==1||(R.send(JSON.stringify(p.current?My(E):Ay(b.current,E))),p.current=!0)},[]),k=B.useCallback(async()=>{if(f.current==="recording"){g("finalizing"),clearTimeout(a.current);try{const E=m.current?await m.current.stop():null;E&&S(E);const R=l.current;R&&R.readyState===1?(R.send(JSON.stringify(Iy())),h.current=setTimeout(()=>x(),Ny)):x()}catch{g("error"),v()}}},[S,v,g,x]);c.current=k;const w=B.useCallback(async()=>{if(!(f.current!=="idle"&&f.current!=="error")){g("requesting"),o(""),y.current=Cd(),p.current=!1;try{const{url:E,appId:R}=await i();b.current=R;const I=new r(E);l.current=I,I.onmessage=D=>{var $;const N=JSON.parse(D.data);y.current=Py(y.current,N),o(xd(y.current)),(($=N==null?void 0:N.data)==null?void 0:$.status)===2&&x()},I.onerror=()=>{g("error"),v()},I.onclose=()=>{(f.current==="recording"||f.current==="finalizing")&&x()};const T=n();m.current=T,await T.start(S),g("recording"),a.current=setTimeout(()=>{var D;(D=c.current)==null||D.call(c)},Oy)}catch{g("error"),v()}}},[i,r,n,S,v,g,x]);return B.useEffect(()=>v,[v]),{state:d,partial:s,start:w,stop:k}}const Z_="tw_asr";function By(){try{const e=localStorage.getItem(Z_);return e==null?null:e==="1"}catch{return null}}function Q_(){const[e,t]=B.useState(By);return B.useEffect(()=>{let i=!0;return Promise.resolve().then(I_).then(r=>{if(!i)return;const n=!!(r!=null&&r.asr);t(n);try{localStorage.setItem(Z_,n?"1":"0")}catch{}}).catch(()=>{}),()=>{i=!1}},[]),e}function ku(e){B.useEffect(()=>{if(!e||!("wakeLock"in navigator))return;let t=null,i=!1;const r=async()=>{try{const d=await navigator.wakeLock.request("screen");if(i){try{d.release()}catch{}return}t=d}catch{}},n=()=>{document.visibilityState==="visible"&&!i&&r()};return r(),document.addEventListener("visibilitychange",n),()=>{i=!0,document.removeEventListener("visibilitychange",n);try{t&&t.release()}catch{}t=null}},[e])}function Mi(e,t){const i=B.useRef(t);i.current=t,B.useEffect(()=>{if(!e)return;window.history.pushState({overlay:!0},"");const r=()=>{var n;return(n=i.current)==null?void 0:n.call(i)};return window.addEventListener("popstate",r),()=>{var n;window.removeEventListener("popstate",r),(n=window.history.state)!=null&&n.overlay&&window.history.back()}},[e])}function jy({pane:e,onAuthFail:t,onKey:i,onText:r,cwd:n=null,recent:d=[],favorites:_=[],onSent:s,onToggleFav:o,onRemoveRecent:f},g){const[l,m]=B.useState(""),[y,b]=B.useState(!1);Mi(y,()=>b(!1));const[p,a]=B.useState(null),h=B.useRef(null),c=B.useRef(null),u=B.useRef(null),v=B.useRef({head:"",tail:""}),x=B.useRef(null),S=B.useRef(!1),w=J_({onText:M=>{if(S.current){S.current=!1;return}const{head:G,tail:V}=v.current;m(G+M+V),x.current=G.length+M.length}}),E=Q_(),R=w.state==="recording"||w.state==="finalizing";ku(R),B.useEffect(()=>()=>clearTimeout(u.current),[]),B.useEffect(()=>{if(w.state!=="recording"&&w.state!=="finalizing"||S.current)return;const{head:M,tail:G}=v.current;m(M+w.partial+G),x.current=M.length+w.partial.length},[w.partial,w.state]),B.useLayoutEffect(()=>{const M=h.current;if(!M)return;let G=!1;if(x.current!=null){const V=x.current;if(x.current=null,document.activeElement===M)try{M.setSelectionRange(V,V)}catch{}G=V>=l.length}U(M),G&&(M.scrollTop=M.scrollHeight)},[l]);const I=()=>{if(R){w.stop();return}const M=h.current,G=M?M.selectionStart:l.length;v.current={head:l.slice(0,G),tail:l.slice(G)},w.start()},T=B.useRef(null),D=B.useRef(i);D.current=i;const N=M=>{M.cancelable&&M.preventDefault(),T.current||(T.current=Y_(()=>D.current("BSpace"))),T.current.start()},$=()=>{var M;return(M=T.current)==null?void 0:M.stop()},U=M=>{M&&(M.style.height="auto",M.style.height=`${M.scrollHeight+2}px`)},P=()=>{R&&(S.current=!0,w.stop())},H=async()=>{if(e){P();try{await fc(e,l,!0),s==null||s(l),m(""),requestAnimationFrame(()=>U(h.current))}catch(M){M instanceof it&&(t==null||t())}}},L=M=>{m(M),b(!1),requestAnimationFrame(()=>{var G;(G=h.current)==null||G.focus(),U(h.current)})};B.useImperativeHandle(g,()=>({fill:L}),[]);const A=M=>{if(!M.length)return;let G;if(M.length===1)G=M[0];else{const V=M[0].slice(0,M[0].lastIndexOf("/")+1);G=M.every(re=>re.startsWith(V))?`${V}{${M.map(re=>re.slice(V.length)).join(",")}}`:M.join(" ")}m(V=>V&&!/\s$/.test(V)?`${V} ${G}`:V+G),requestAnimationFrame(()=>{var V;(V=h.current)==null||V.focus(),U(h.current)})},j=async M=>{const G=Array.from(M||[]);if(!G.length)return;clearTimeout(u.current);const V=G.length,re=[],ie=[];for(let me=0;me<V;me++){const ue=G[me],Re=V>1?`(${me+1}/${V})`:"";a({label:O("dock.upload.progress",{name:ue.name,tag:Re}),pct:0});try{const xe=await P_(n||"",ue,pe=>a({label:O("dock.upload.progress",{name:ue.name,tag:Re}),pct:pe}),!0);xe!=null&&xe.path&&re.push(xe.path)}catch(xe){if(xe instanceof it){t==null||t(),a(null);return}ie.push(ue.name)}}re.length&&A(re),ie.length?(a({label:O("dock.upload.failed",{names:ie.join("、")}),error:!0}),u.current=setTimeout(()=>a(null),3500)):a(null)},z=async()=>{if(!(!e||!l)){P();try{await fc(e,l,!1),s==null||s(l),m(""),requestAnimationFrame(()=>U(h.current))}catch(M){M instanceof it&&(t==null||t())}}},K=B.useRef(null),Y=B.useRef(!1),te=M=>{M.cancelable&&M.preventDefault(),Y.current=!1,l&&(K.current=setTimeout(()=>{var G;Y.current=!0,(G=navigator.vibrate)==null||G.call(navigator,12),z()},450))},Q=()=>{if(clearTimeout(K.current),K.current=null,Y.current){Y.current=!1;return}H()},W=()=>{clearTimeout(K.current),K.current=null,Y.current=!1};return C.jsxs("div",{className:"bottom-dock",children:[C.jsxs("div",{className:"dock-left",children:[C.jsxs("div",{className:"keyrow",children:[C.jsx(by,{onKey:i,onText:r}),C.jsxs("div",{className:"keyrow-stack",children:[C.jsx("button",{type:"button",className:"keyrow-del","aria-label":O("common.delete"),onPointerDown:N,onPointerUp:$,onPointerCancel:$,onPointerLeave:$,children:"⌫"}),C.jsx("button",{type:"button",className:"keyrow-enter",onClick:()=>i("Enter"),children:"Enter"})]})]}),p&&C.jsxs("div",{className:`dock-upload${p.error?" error":""}`,children:[C.jsxs("span",{className:"dock-upload-label",children:[p.label,!p.error&&` ${Math.round(p.pct*100)}%`]}),!p.error&&C.jsx("span",{className:"dock-upload-track",children:C.jsx("span",{className:"dock-upload-fill",style:{width:`${Math.round(p.pct*100)}%`}})})]}),C.jsx("div",{className:"dock-input-row",children:C.jsxs("div",{className:`input-wrap${R?" recording":""}`,children:[C.jsx("button",{type:"button",className:"input-upload","aria-label":O("dock.upload.aria"),title:O("dock.upload.title"),disabled:!!p&&!p.error,onClick:()=>{var M;return(M=c.current)==null?void 0:M.click()},children:C.jsx(N_,{})}),C.jsx("input",{ref:c,className:"browse-file-input",type:"file",multiple:!0,onChange:M=>{j(M.target.files),M.target.value=""}}),C.jsx("textarea",{ref:h,className:"input-text",rows:1,value:l,onPointerDown:M=>{R&&(P(),M.currentTarget.focus())},onChange:M=>{m(M.target.value),U(M.target)},placeholder:O("dock.input.placeholder"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),!l&&C.jsx("button",{type:"button",className:"input-cmd","aria-label":O("dock.phrases"),title:O("dock.phrases"),onClick:()=>b(M=>!M),children:C.jsx(xw,{})}),E&&C.jsx(X_,{active:R,disabled:w.state==="requesting",onToggle:I}),C.jsx("button",{type:"button",className:"input-send","aria-label":O("dock.send"),title:O("dock.send.hint"),disabled:!l,onPointerDown:te,onPointerUp:Q,onPointerCancel:W,onPointerLeave:W,children:C.jsx(O_,{})})]})})]}),C.jsx(ky,{open:y,recent:d,favorites:_,onPick:L,onToggleFav:o,onRemoveRecent:f,onClose:()=>b(!1)})]})}const Fy=B.forwardRef(jy);function Hy({onSaved:e}){const[t,i]=B.useState(""),r=n=>{n.preventDefault();const d=t.trim();d&&(i0(d),e())};return C.jsxs("form",{className:"token-prompt",onSubmit:r,children:[C.jsx("h2",{children:O("token.title")}),C.jsx("input",{value:t,onChange:n=>i(n.target.value),placeholder:O("token.placeholder")}),C.jsx("button",{type:"submit",children:O("common.save")})]})}function Eu({open:e,title:t,actions:i=[],onClose:r}){const[n,d]=B.useState(null);if(B.useEffect(()=>{e||d(null)},[e]),!e)return null;const _=o=>{var f;if(!o.disabled){if(o.confirm&&n!==o.key){d(o.key);return}d(null),(f=o.onClick)==null||f.call(o)}},s=o=>C.jsx("button",{className:`sheet-action ${o.danger?"danger":""} ${n===o.key?"armed":""}`,disabled:o.disabled,onClick:()=>_(o),children:o.confirm&&n===o.key?o.confirmLabel||O("actionsheet.confirmAgain"):o.label},o.key);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-backdrop",onClick:r}),C.jsxs("div",{className:"settings-card",role:"dialog","aria-label":t,"aria-modal":"true",children:[C.jsxs("div",{className:"settings-head",children:[C.jsx("span",{className:"settings-title",children:t}),C.jsx("button",{className:"settings-close",onClick:r,"aria-label":O("common.close"),children:"✕"})]}),C.jsxs("div",{className:"settings-section sheet-actions",children:[i.map((o,f)=>Array.isArray(o)?C.jsx("div",{className:"sheet-row",children:o.map(s)},`row-${f}`):s(o)),C.jsx("button",{className:"fontbtn sheet-cancel",onClick:r,children:O("common.cancel")})]})]})]})}const zy=/\.(?:md|markdown|html|htm|txt|log|sh)$/i,kd=300;function Ed(e){const t=e.lastIndexOf("/");return t<0?{dir:"",frag:e}:{dir:e.slice(0,t+1),frag:e.slice(t+1)}}const $y=e=>e.replace(/\/+$/,"")||"/",dl=(e,t)=>e===t?"":e.startsWith(`${t}/`)?e.slice(t.length+1):e,_o=(e,t,i)=>{let r=null;for(const n of t||[])(e===n||e!=null&&e.startsWith(`${n}/`))&&(!r||n.length>r.length)&&(r=n);return r||i},Uy=e=>e==null?"":e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function em({path:e,onNavigate:t,onOpenDoc:i,onJumpToCwd:r,pendingFile:n,onPendingConsumed:d,pickMode:_=!1,allowMkdir:s=!_,onPick:o}){const[f,g]=B.useState(""),[l,m]=B.useState(null),[y,b]=B.useState(!1),[p,a]=B.useState(""),[h,c]=B.useState(""),[u,v]=B.useState(""),[x,S]=B.useState(null),[k,w]=B.useState(!1),[E,R]=B.useState(!1),[I,T]=B.useState(""),[D,N]=B.useState(null),$=B.useRef(null),U=B.useRef(!1),P=B.useRef(null),H=B.useRef(null),L=B.useRef(null),A=async(X,{sync:J=!1,notify:se=!1,fallbackHome:ve=!1}={})=>{a("");try{const Ee=await M_(X??void 0);if(U.current=Ee.path,m(Ee),J){const Le=dl(Ee.path,_o(Ee.path,Ee.roots,Ee.home));g(Le?`${Le}/`:"")}se&&(t==null||t(Ee.path),R(!1),T(""))}catch{if(ve&&X!=null){A(null,{sync:!0});return}a(O("filebrowser.openDirFailed"))}};B.useEffect(()=>{e!==U.current&&A(e,{sync:!0,fallbackHome:_})},[e]),B.useEffect(()=>()=>{clearTimeout(P.current),clearTimeout(H.current)},[]),B.useEffect(()=>{if(!y)return;const X=J=>{var se;(se=L.current)!=null&&se.contains(J.target)||b(!1)};return document.addEventListener("pointerdown",X,!0),()=>document.removeEventListener("pointerdown",X,!0)},[y]);const j=X=>{c(X),clearTimeout(H.current),H.current=setTimeout(()=>c(""),2500)},z=X=>{const J=l==null?void 0:l.home;if(!J){g(X);return}const se=(l==null?void 0:l.roots)||[J];let ve=X;(ve==="~"||ve.startsWith("~/"))&&(ve=J+ve.slice(1));let Ee=_o(l==null?void 0:l.path,se,J);ve.startsWith("/")&&(Ee=_o(ve,se,J),ve=ve===Ee?"":ve.startsWith(`${Ee}/`)?ve.slice(Ee.length+1):ve.replace(/^\/+/,"")),g(ve);const Le=$y(`${Ee}/${Ed(ve).dir}`);Le!==U.current&&(clearTimeout(P.current),P.current=setTimeout(()=>{Le!==U.current&&A(Le,{notify:!0})},250))},K=async X=>{const J=Mr(l.path,X);try{await navigator.clipboard.writeText(J),j(O("filebrowser.copiedPath",{abs:J}))}catch{j(J)}},Y=X=>i(Mr(l.path,X)),te=X=>A(Mr(l.path,X),{sync:!0,notify:!0}),Q=()=>(l==null?void 0:l.parent)&&A(l.parent,{sync:!0,notify:!0}),W=async()=>{const X=I.trim();if(!(!X||!l)){a("");try{await V0(l.path,X),await A(l.path,{}),R(!1),T("")}catch{a(O("filebrowser.mkdirFailed"))}}},M=async X=>{a(""),N({label:O("filebrowser.downloading",{name:X}),pct:0});try{await tw(Mr(l.path,X),J=>N({label:O("filebrowser.downloading",{name:X}),pct:J})),v(X)}catch{a(O("filebrowser.downloadFailed"))}finally{N(null)}},G=()=>{const X=x;S(null),X&&M(X)},V=l==null?void 0:l.home,re=(l==null?void 0:l.roots)||(V?[V]:[]),ie=_o(l==null?void 0:l.path,re,V),me=X=>X===V?"~":/\/tmp$/.test(X)?"tmp":X.includes("/var/folders/")?"TMPDIR":X.split("/").filter(Boolean).pop()||"/",ue=X=>{b(!1),X!==ie&&A(X,{sync:!0,notify:!0})},Re=(X,J)=>!X||!J||X===J?!1:(X.startsWith(`${J}/`)?X.slice(J.length+1):X).split("/").some(ve=>ve.startsWith(".")),xe=!!l&&l.path!==V&&!Re(l.path,ie),pe=async X=>{const J=(Array.isArray(X)?X:[X]).filter(Boolean);if(!J.length)return[];w(!0),a("");const se=J.length,ve=[];for(let Ee=0;Ee<se;Ee++){const Le=J[Ee],Me=se>1?`(${Ee+1}/${se})`:"";N({label:O("filebrowser.uploading",{name:Le.name,tag:Me}),pct:0});try{await P_(l.path,Le,de=>N({label:O("filebrowser.uploading",{name:Le.name,tag:Me}),pct:de}))}catch(de){ve.push(Le.name),se===1&&a((de==null?void 0:de.message)||O("filebrowser.uploadFailed"))}}return await A(l.path,{}),w(!1),N(null),ve.length&&se>1&&a(O("filebrowser.uploadPartialFailed",{names:ve.join("、")})),ve},ze=async()=>{n&&(await pe(n)).length===0&&(d==null||d())},ge=X=>{if(_||X.key!=="Enter")return;const J=f.trim();J&&zy.test(J)&&(l!=null&&l.home)&&i(Mr(l.home,J))},_e=Ed(f).frag.toLowerCase(),fe=((l==null?void 0:l.entries)||[]).filter(X=>(!_||X.type==="dir")&&(!_e||X.name.toLowerCase().includes(_e))),be=fe.length>kd?fe.slice(0,kd):fe,le=fe.length-be.length;return C.jsxs("div",{className:"browse-view",children:[C.jsxs("div",{className:"browse-bar",children:[r&&C.jsx("button",{className:"browse-cwd","aria-label":O("filebrowser.sessionDir"),title:O("filebrowser.jumpToSessionDir"),onClick:r,children:C.jsx(uw,{})}),C.jsx("button",{className:"browse-up","aria-label":O("filebrowser.parentDir"),disabled:!(l!=null&&l.parent),onClick:Q,children:C.jsx(O_,{})}),C.jsxs("div",{className:"browse-path",children:[re.length>1?C.jsxs("div",{className:"dd browse-root-dd",ref:L,children:[C.jsxs("button",{type:"button",className:"browse-root","aria-haspopup":"listbox","aria-expanded":y,"aria-label":O("filebrowser.rootSelect"),onClick:()=>b(X=>!X),children:[C.jsxs("span",{children:[me(ie),"/"]}),C.jsx("span",{className:`dd-caret${y?" open":""}`,"aria-hidden":"true",children:"▾"})]}),y&&C.jsx("div",{className:"dd-menu",role:"listbox",children:re.map(X=>C.jsxs("button",{type:"button",role:"option","aria-selected":X===ie,title:X,className:`dd-option${X===ie?" is-selected":""}`,onClick:()=>ue(X),children:[C.jsxs("span",{className:"dd-option-label",children:[me(X),"/"]}),X===ie&&C.jsx("span",{className:"dd-check","aria-hidden":"true",children:"✓"})]},X))})]}):C.jsx("span",{className:"browse-home","aria-hidden":"true",children:"~/"}),C.jsx("input",{className:"browse-input",value:f,placeholder:O("filebrowser.pathPlaceholder"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,onChange:X=>z(X.target.value),onKeyDown:ge})]}),s&&C.jsx("button",{className:"browse-mkdir","aria-label":O("filebrowser.newFolder"),title:O("filebrowser.newFolder"),disabled:!l,onClick:()=>{R(X=>!X),T("")},children:C.jsx(ow,{})}),!_&&C.jsx("button",{className:"browse-upload","aria-label":O("filebrowser.uploadFile"),title:O(xe?"filebrowser.uploadToCurrentDir":"filebrowser.enterSubdirToUpload"),disabled:!xe||k,onClick:()=>{var X;return(X=$.current)==null?void 0:X.click()},children:C.jsx(mw,{})}),!_&&C.jsx("input",{ref:$,className:"browse-file-input",type:"file",multiple:!0,onChange:X=>{pe(Array.from(X.target.files||[])),X.target.value=""}})]}),E&&C.jsxs("div",{className:"browse-newfolder",children:[C.jsx("input",{className:"browse-newfolder-input",autoFocus:!0,value:I,placeholder:O("filebrowser.folderNamePlaceholder"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,onChange:X=>T(X.target.value),onKeyDown:X=>{X.key==="Enter"&&W()}}),C.jsx("button",{className:"browse-newfolder-ok",onClick:W,children:O("filebrowser.createBtn")}),C.jsx("button",{className:"browse-newfolder-x","aria-label":O("common.cancel"),onClick:()=>{R(!1),T("")},children:"✕"})]}),!_&&n&&C.jsxs("div",{className:"browse-pending",children:[C.jsxs("span",{className:"browse-pending-text",children:[O("filebrowser.uploadPendingTo",{name:n.name}),!xe&&C.jsx("em",{className:"browse-pending-hint",children:O("filebrowser.enterSubdirFirst")})]}),C.jsx("button",{className:"browse-pending-btn",disabled:!xe||k,onClick:ze,children:O("filebrowser.upload")})]}),p&&C.jsx("div",{className:"bind-error browse-err",children:p}),h&&C.jsx("div",{className:"browse-notice",children:h}),!_&&u&&C.jsxs("div",{className:"browse-saved",children:[C.jsx("span",{className:"browse-saved-text",children:O("filebrowser.savedToDownloads",{name:u})}),C.jsx("button",{className:"browse-saved-close","aria-label":O("common.close"),onClick:()=>v(""),children:"×"})]}),!_&&D&&C.jsxs("div",{className:"browse-progress",children:[C.jsxs("span",{className:"browse-progress-label",children:[D.label," ",Math.round(D.pct*100),"%"]}),C.jsx("span",{className:"browse-progress-track",children:C.jsx("span",{className:"browse-progress-fill",style:{width:`${Math.round(D.pct*100)}%`}})})]}),C.jsxs("div",{className:"browse-list",children:[be.length===0&&!p&&C.jsx("div",{className:"browse-empty",children:O("filebrowser.noMatches")}),be.map(X=>C.jsxs("div",{className:"browse-entry-row",children:[C.jsxs("button",{className:"browse-entry",onClick:()=>X.type==="dir"?te(X.name):X.type==="doc"||X.type==="image"?Y(X.name):j(O("filebrowser.previewUnsupported")),children:[C.jsx("span",{className:"browse-entry-icon",children:X.type==="dir"?C.jsx(Mn,{}):X.type==="image"?C.jsx(cw,{}):C.jsx(lw,{})}),C.jsx("span",{className:"browse-entry-name",children:X.name}),X.type!=="dir"&&C.jsx("span",{className:"browse-entry-size",children:Uy(X.size)})]}),X.type!=="dir"&&C.jsx("button",{className:"browse-copy","aria-label":O("filebrowser.copyAbsPath"),title:O("filebrowser.copyAbsPath"),onClick:()=>K(X.name),children:C.jsx(gw,{})}),X.type!=="dir"&&C.jsx("button",{className:"browse-dl","aria-label":O("filebrowser.download"),onClick:()=>S(X.name),children:C.jsx(_w,{})})]},X.name)),le>0&&C.jsx("div",{className:"browse-overflow",children:O("filebrowser.tooMany",{shown:be.length,total:fe.length})})]}),_&&l&&C.jsx("div",{className:"browse-pick-bar",children:C.jsx("button",{className:"browse-pick-confirm",onClick:()=>o==null?void 0:o(l.path),children:O("filebrowser.pickThisDir",{path:dl(l.path,l.home)?`~/${dl(l.path,l.home)}`:"~"})})}),C.jsx(Eu,{open:!!x,title:x?O("filebrowser.downloadConfirm",{name:x}):"",actions:[{key:"dl",label:O("filebrowser.download"),onClick:G}],onClose:()=>S(null)})]})}const Wy=()=>{};function Fn({open:e,seedCwd:t=null,hint:i=null,pane:r=null,allowMkdir:n=!1,onPick:d,onClose:_,inset:s=0}){const[o,f]=B.useState(t),g=B.useRef(!1);e&&!g.current?(g.current=!0,o!==t&&f(t)):!e&&g.current&&(g.current=!1);const l=r?async()=>{try{const{cwd:m}=await Vr(r);m&&f(m)}catch{}}:null;return e?C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-backdrop dirpick-backdrop",onClick:_}),C.jsxs("div",{className:"settings-card dirpick-card",style:{transform:`translate(-50%, calc(-50% + ${s/2}px))`,"--kb-inset":`${s}px`},role:"dialog","aria-label":O("dirpicker.title"),"aria-modal":"true",children:[C.jsxs("div",{className:"settings-head",children:[C.jsx("span",{className:"settings-title",children:O("dirpicker.title")}),C.jsx("button",{className:"settings-close",onClick:_,"aria-label":O("common.close"),children:"✕"})]}),i&&C.jsx("div",{className:"dirpick-hint",children:i}),C.jsx(em,{path:o,onNavigate:f,onOpenDoc:Wy,onJumpToCwd:l,pickMode:!0,allowMkdir:n,onPick:d})]})]}):null}function Vy({open:e,onClose:t,termRef:i,onColAdjust:r,onColRestore:n,onOpenChangelog:d,changelogUnread:_,activePreview:s=null,pane:o=null,lastPreviewDir:f=null,dynamicEnabled:g=!1,getColCount:l=null,onStartPreview:m,onStartDynamicPreview:y,onOpenPreview:b,onRenew:p,onStop:a}){var ze;const[h,c]=B.useState(null),[u,v]=B.useState(null),[x,S]=B.useState(!1),[k,w]=B.useState(z_()),[E,R]=B.useState(!1),[I,T]=B.useState(""),[D,N]=B.useState(!1),[$,U]=B.useState(null),[P,H]=B.useState("off"),[L,A]=B.useState(""),[j,z]=B.useState(!1),[K,Y]=B.useState(""),[te,Q]=B.useState(!1),W=F_(s==null?void 0:s.expiresAt,!!s&&e);B.useEffect(()=>{z(!1),Y("")},[s==null?void 0:s.name,e]);const M=ge=>({"port not listening":O("settings.err_port_not_listening"),"bad port":O("settings.err_bad_port"),"dynamic disabled":O("settings.err_dynamic_disabled")})[ge]||ge||O("settings.err_start_failed"),G=async()=>{const ge=Number(L);if(ge){Y(""),Q(!0);try{await(y==null?void 0:y(ge)),t==null||t()}catch(_e){Y(M(_e==null?void 0:_e.message))}finally{Q(!1)}}},V=async()=>{let ge=f;if(!ge&&o)try{ge=(await Vr(o)).cwd||null}catch{}U(ge),N(!0)};B.useEffect(()=>{var ge,_e;e&&(c(((_e=(ge=i.current)==null?void 0:ge.getFontSize)==null?void 0:_e.call(ge))??null),v((l==null?void 0:l())??null))},[e,i,l]);const re=async()=>{R(!0),T("");try{k?(await Nw(),w(!1),T(O("settings.notify_disabled"))):(await Ow(),w(!0),T(O("settings.notify_enabled")))}catch(ge){T(ge.message||O("settings.notify_failed"))}finally{R(!1)}};if(!e)return null;const ie=ge=>{var be,le,X,J;const _e=(le=(be=i.current)==null?void 0:be.getFontSize)==null?void 0:le.call(be),fe=(J=(X=i.current)==null?void 0:X.setFontSize)==null?void 0:J.call(X,((_e==null?void 0:_e.size)??14)+ge);fe!=null&&c({size:fe,auto:!1})},me=()=>{var ge,_e;(_e=(ge=i.current)==null?void 0:ge.autoFont)==null||_e.call(ge),c({size:null,auto:!0})},ue=h!=null&&h.auto?O("settings.font_auto"):h!=null&&h.size?`${h.size}px`:"—",Re=u!=null?`${u} 列`:"—",xe=ge=>{r==null||r(ge),v((l==null?void 0:l())??null)},pe=()=>{n==null||n(),v(null)};return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-backdrop",onClick:t}),C.jsxs("div",{className:"settings-card",role:"dialog","aria-label":O("settings.title"),"aria-modal":"true",children:[C.jsxs("div",{className:"settings-head",children:[C.jsx("span",{className:"settings-title",children:O("settings.title")}),C.jsx("button",{className:"settings-close",onClick:t,"aria-label":O("common.close"),children:"✕"})]}),C.jsx("div",{className:"settings-group",children:O("settings.group_global")}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("settings.language")}),C.jsxs("div",{className:"lang-drop",children:[x&&C.jsx("div",{className:"lang-drop-backdrop",onClick:()=>S(!1)}),C.jsxs("button",{className:"lang-trigger",onClick:()=>S(ge=>!ge),children:[C.jsx("span",{children:(ze=Zh.find(ge=>ge.code===hc()))==null?void 0:ze.label}),C.jsx("span",{className:"lang-chevron",children:x?"▴":"▾"})]}),x&&C.jsx("div",{className:"lang-menu",children:Zh.map(ge=>C.jsx("button",{className:`lang-option${ge.code===hc()?" active":""}`,onClick:()=>e0(ge.code),children:ge.label},ge.code))})]})]}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("settings.font_size")}),C.jsxs("div",{className:"settings-btns",children:[C.jsx("button",{className:"fontbtn",onClick:()=>ie(-1),"aria-label":O("settings.font_decrease"),children:"A−"}),C.jsx("span",{className:"settings-value",children:ue}),C.jsx("button",{className:"fontbtn",onClick:()=>ie(1),"aria-label":O("settings.font_increase"),children:"A+"}),C.jsx("button",{className:"fontbtn",onClick:me,title:O("settings.font_auto_title"),children:O("settings.font_auto")})]})]}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("settings.whats_new")}),C.jsx("div",{className:"settings-btns",children:C.jsxs("button",{className:"fontbtn",onClick:d,children:[O("settings.view_changelog"),_&&C.jsx("span",{className:"settings-dot","aria-label":O("settings.has_update")})]})})]}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("settings.push_notifications")}),Ma()?C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"settings-btns",children:[C.jsx("button",{className:"fontbtn",onClick:re,disabled:E,"aria-pressed":k,children:O(k?"settings.notify_on":"settings.notify_enable")}),E&&C.jsx("span",{className:"spinner",role:"status","aria-label":O("settings.processing")}),!E&&I&&C.jsx("span",{className:"settings-note",children:I})]}),C.jsx("div",{className:"settings-hint",children:O("settings.push_hint")})]}):C.jsx("div",{className:"settings-value",style:{display:"block"},children:O("settings.push_unsupported")})]}),C.jsx("div",{className:"settings-group",children:O("settings.group_session")}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("settings.screen_cols")}),C.jsxs("div",{className:"settings-btns cols-btns",children:[C.jsx("button",{className:"fontbtn col-step",onClick:()=>xe(-10),children:"−10"}),C.jsx("button",{className:"fontbtn col-step col-fine",onClick:()=>xe(-1),children:"−1"}),C.jsx("span",{className:"settings-value",children:Re}),C.jsx("button",{className:"fontbtn col-step col-fine",onClick:()=>xe(1),children:"+1"}),C.jsx("button",{className:"fontbtn col-step",onClick:()=>xe(10),children:"+10"}),C.jsxs("button",{className:"fontbtn",onClick:pe,children:["↺ ",O("settings.cols_restore")]})]})]}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O(g?"settings.preview_site":"settings.preview_static_site")}),s?C.jsxs("div",{className:"preview-active",children:[C.jsxs("div",{className:"preview-active-head",children:[C.jsxs("span",{className:"preview-running",children:[C.jsx("span",{className:"live-dot"}),s.kind==="dynamic"?O("settings.preview_running_dynamic"):O("settings.preview_running_static")]}),C.jsx("span",{className:"preview-remain-s",title:O("settings.preview_remain_title"),children:O("settings.preview_remain",{time:j_(W)})})]}),C.jsxs("div",{className:"settings-btns",children:[C.jsx("button",{className:"fontbtn",onClick:()=>{b==null||b(),t==null||t()},children:O("common.open")}),C.jsx("button",{className:"fontbtn",onClick:()=>p==null?void 0:p(),children:O("settings.preview_renew")}),j?C.jsxs(C.Fragment,{children:[C.jsx("button",{className:"fontbtn preview-confirm-danger",onClick:()=>{z(!1),a==null||a()},children:O("settings.preview_confirm_stop")}),C.jsx("button",{className:"fontbtn",onClick:()=>z(!1),children:O("common.cancel")})]}):C.jsx("button",{className:"fontbtn",onClick:()=>z(!0),children:O("settings.preview_stop")})]}),C.jsxs("div",{className:"settings-hint",children:[O("settings.preview_name",{name:s.name}),s.kind==="dynamic"?O("settings.preview_port",{port:s.port}):s.dir?`(${s.dir})`:""]})]}):C.jsxs("div",{className:"preview-start",children:[C.jsxs("div",{className:"preview-seg",role:"tablist","aria-label":O("settings.preview_type"),children:[C.jsx("button",{role:"tab",className:P==="off"?"on":"","aria-selected":P==="off",onClick:()=>H("off"),children:O("settings.preview_off")}),C.jsx("button",{role:"tab",className:P==="static"?"on":"","aria-selected":P==="static",onClick:()=>H("static"),children:O("settings.preview_static")}),g&&C.jsx("button",{role:"tab",className:P==="dynamic"?"on":"","aria-selected":P==="dynamic",onClick:()=>{Y(""),H("dynamic")},children:O("settings.preview_dynamic")})]}),P==="off"&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-hint",children:O(g?"settings.preview_off_hint_both":"settings.preview_off_hint")}),!g&&C.jsx("div",{className:"settings-hint preview-dynamic-disabled",children:O("settings.preview_dynamic_disabled")})]}),P==="static"&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-btns",children:C.jsx("button",{className:"fontbtn",onClick:V,children:O("settings.preview_pick_dir")})}),C.jsx("div",{className:"settings-hint",children:O("settings.preview_static_hint")})]}),P==="dynamic"&&C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"settings-btns",children:[C.jsx("input",{className:"preview-port",type:"number",inputMode:"numeric",min:"1",max:"65535",placeholder:O("settings.preview_port_placeholder"),value:L,onChange:ge=>{A(ge.target.value),Y("")},"aria-label":O("settings.preview_port_label")}),C.jsx("button",{className:"fontbtn",disabled:!L||te,onClick:G,children:O(te?"settings.preview_starting":"settings.preview_start")})]}),K?C.jsx("div",{className:"settings-hint settings-err",children:K}):C.jsx("div",{className:"settings-hint",children:O("settings.preview_dynamic_hint")})]})]})]})]}),C.jsx(Fn,{open:D,seedCwd:$,pane:o,hint:O("settings.dir_picker_hint"),onPick:ge=>{N(!1),m==null||m(ge),t==null||t()},onClose:()=>N(!1)})]})}function Gy({rows:e,top:t,open:i,onToggle:r,onClose:n,onSelectRow:d,onMarkAllRead:_,hooksStatus:s,onEnableHooks:o}){const f=[];for(const u of e){const v=f[f.length-1];v&&v.session===u.session?v.items.push(u):f.push({session:u.session,items:[u]})}const g=Date.now(),l=e.some(u=>u.view==="done"),m=Tw(e),[y,b]=B.useState(!1),[p,a]=B.useState(!1),h=f.length===0&&s==="absent",c=async()=>{b(!0),a(!1);try{const u=await(o==null?void 0:o());(!u||u.status!=="installed")&&a(!0)}catch{a(!0)}finally{b(!1)}};return C.jsxs(C.Fragment,{children:[C.jsxs("button",{className:"topbar-icon inbox-btn",onClick:r,"aria-label":O("inbox.title"),title:O("inbox.title"),children:[C.jsx(pw,{}),t&&C.jsx("span",{className:`inbox-dot ${t}`,"aria-hidden":"true"})]}),i&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"inbox-backdrop",onClick:n}),C.jsxs("div",{className:"inbox-panel",role:"dialog","aria-label":O("inbox.title"),children:[C.jsxs("div",{className:"inbox-head",children:[C.jsx("span",{children:O("inbox.title")}),C.jsxs("div",{className:"inbox-summary",children:[C.jsxs("span",{className:"inbox-chip working",children:[O("inbox.working")," ",m.working]}),C.jsxs("span",{className:"inbox-chip done",children:[O("inbox.done")," ",m.done]}),C.jsxs("span",{className:"inbox-chip needs",children:[O("inbox.needs")," ",m.needs]})]}),l&&C.jsx("button",{className:"inbox-readall",onClick:_,children:O("inbox.clearDone")})]}),f.length===0?h?C.jsxs("div",{className:"inbox-empty inbox-enable",children:[C.jsx("div",{className:"inbox-enable-title",children:O("inbox.enableTitle")}),C.jsx("div",{className:"inbox-enable-hint",children:O("inbox.enableHint")}),C.jsx("button",{className:"inbox-enable-btn",onClick:c,disabled:y,children:O(y?"inbox.enabling":"inbox.enableBtn")}),p&&C.jsx("div",{className:"inbox-enable-err",children:O("inbox.enableFailed")})]}):C.jsx("div",{className:"inbox-empty",children:O("inbox.empty")}):f.map(u=>C.jsxs("div",{className:"inbox-group",children:[C.jsx("div",{className:"inbox-group-title",children:u.session}),u.items.map(v=>C.jsxs("button",{className:"inbox-row",onClick:()=>d(v),children:[C.jsxs("div",{className:"inbox-row-head",children:[C.jsx("span",{className:`inbox-chip ${v.view}`,children:Lw[v.view]}),C.jsx("span",{className:"inbox-loc",children:v.windowName||v.window}),C.jsx("span",{className:"inbox-time",children:Aw(v.ts,g)})]}),v.msg&&C.jsx("div",{className:"inbox-msg",children:v.msg})]},v.pane))]},u.session))]})]})]})}const mc="tw_claude_hooks";function Ky(){try{return localStorage.getItem(mc)||null}catch{return null}}function qy(){const[e,t]=B.useState(Ky);B.useEffect(()=>{let r=!0;return Promise.resolve().then(I_).then(n=>{if(!r)return;const d=(n==null?void 0:n.claudeHooks)||"installed";t(d);try{localStorage.setItem(mc,d)}catch{}}).catch(()=>{}),()=>{r=!1}},[]);const i=B.useCallback(async()=>{const r=await q0();if(r!=null&&r.status){t(r.status);try{localStorage.setItem(mc,r.status)}catch{}}return r},[]);return{status:e,enable:i}}function Yy({value:e,options:t,onChange:i,ariaLabel:r}){const[n,d]=B.useState(!1),_=B.useRef(null),s=t.find(o=>o.value===e)||t[0];return B.useEffect(()=>{if(!n)return;const o=f=>{var g;(g=_.current)!=null&&g.contains(f.target)||d(!1)};return document.addEventListener("pointerdown",o,!0),()=>document.removeEventListener("pointerdown",o,!0)},[n]),C.jsxs("div",{className:"dd",ref:_,children:[C.jsxs("button",{type:"button",className:"field dd-trigger","aria-haspopup":"listbox","aria-expanded":n,"aria-label":r,onClick:()=>d(o=>!o),children:[C.jsx("span",{className:"dd-value",children:s==null?void 0:s.label}),C.jsx("span",{className:`dd-caret${n?" open":""}`,"aria-hidden":"true",children:"▾"})]}),n&&C.jsx("div",{className:"dd-menu",role:"listbox",children:t.map(o=>C.jsxs("button",{type:"button",role:"option","aria-selected":o.value===e,className:`dd-option${o.value===e?" is-selected":""}`,onClick:()=>{i==null||i(o.value),d(!1)},children:[C.jsx("span",{className:"dd-option-label",children:o.label}),o.value===e&&C.jsx("span",{className:"dd-check","aria-hidden":"true",children:"✓"})]},o.value||"__none__"))})]})}const tm=[{value:"",label:O("startup.preset_shell")},{value:"claude",label:O("startup.preset_claude")},{value:"claude --continue",label:O("startup.preset_claude_continue")}],Io="__custom__",Xy=[...tm,{value:Io,label:O("startup.custom")}];function im({value:e="",onChange:t}){const i=tm.some(f=>f.value===e),[r,n]=B.useState(i?e:Io),[d,_]=B.useState(i?"":e),s=f=>{n(f),t==null||t(f===Io?d:f)},o=f=>{const g=f.target.value;_(g),t==null||t(g)};return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-label",children:O("startup.label")}),C.jsx(Yy,{value:r,options:Xy,onChange:s,ariaLabel:O("startup.aria")}),r===Io&&C.jsx("input",{className:"bind-input startup-custom",value:d,placeholder:O("startup.custom_placeholder"),onChange:o,autoCapitalize:"off",autoCorrect:"off",spellCheck:!1})]})}const Jy=/^[A-Za-z0-9-]{1,16}$/;function Zy({open:e,onClose:t,onBound:i,bound:r,onAuthFail:n,inset:d=0}){const[_,s]=B.useState(""),[o,f]=B.useState(""),[g,l]=B.useState(!1),[m,y]=B.useState("bind"),[b,p]=B.useState(null),[a,h]=B.useState(k_()),[c,u]=B.useState(!1),v=B.useRef(null);if(B.useEffect(()=>{e&&(s(""),f(""),l(!1),y("bind"),p(null),u(!1),setTimeout(()=>{var k;return(k=v.current)==null?void 0:k.focus()},0))},[e]),!e)return null;const x=async()=>{if(g)return;const k=_.trim();if(k){if(r.includes(k)){f(O("bind.alreadyBound"));return}if(m==="create"){l(!0),f(""),E_(a);try{await F0(k,b||void 0,a||void 0),i(k)}catch(w){w instanceof it?n==null||n():(y("bind"),f(O("bind.createFailed"))),l(!1)}return}l(!0),f("");try{(await en()).some(E=>E.name===k)?i(k):Jy.test(k)?(y("create"),l(!1)):(f(O("bind.invalidName")),l(!1))}catch(w){w instanceof it?n==null||n():f(O("bind.checkFailed")),l(!1)}}},S=O(m==="create"?g?"bind.creating":"bind.createAndOpen":g?"bind.checking":"bind.bind");return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-backdrop",onClick:t}),C.jsxs("div",{className:"settings-card",style:{transform:`translate(-50%, calc(-50% + ${d/2}px))`},role:"dialog","aria-label":O("bind.title"),"aria-modal":"true",children:[C.jsxs("div",{className:"settings-head",children:[C.jsx("span",{className:"settings-title",children:O("bind.title")}),C.jsx("button",{className:"settings-close",onClick:t,"aria-label":O("common.close"),children:"✕"})]}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("bind.sessionName")}),C.jsx("input",{ref:v,className:"bind-input",value:_,placeholder:O("bind.namePlaceholder"),onChange:k=>{s(k.target.value),f(""),y("bind"),p(null)},onKeyDown:k=>{k.key==="Enter"&&x()}}),o&&C.jsx("div",{className:"bind-error",children:o}),!o&&m==="create"&&C.jsx("div",{className:"bind-hint",children:O("bind.createHint",{name:_.trim()})}),m==="create"&&C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"opt",children:[C.jsx("div",{className:"settings-label",children:O("bind.startDir")}),C.jsxs("button",{type:"button",className:"field cwd-field",onClick:()=>u(!0),children:[C.jsx("span",{className:"cwd-path",children:b||O("bind.homeDirDefault")}),C.jsx("span",{className:"cwd-action",children:O("bind.choose")})]}),b&&C.jsx("button",{type:"button",className:"cwd-reset",onClick:()=>p(null),children:O("bind.reset")})]}),C.jsx("div",{className:"opt",children:C.jsx(im,{value:a,onChange:h})})]}),C.jsxs("div",{className:"settings-btns bind-actions",children:[C.jsx("button",{className:"fontbtn",onClick:t,children:O("common.cancel")}),C.jsx("button",{className:"fontbtn bind-confirm",onClick:x,disabled:g,children:S})]})]})]}),C.jsx(Fn,{open:c,seedCwd:b,allowMkdir:!0,onPick:k=>{p(k),u(!1)},onClose:()=>u(!1),inset:d})]})}const Qy=/^[A-Za-z0-9-]{1,16}$/;function e1({open:e,onClose:t,onCreate:i,paneId:r,inset:n=0}){const[d,_]=B.useState(""),[s,o]=B.useState(""),[f,g]=B.useState(!1),[l,m]=B.useState(null),[y,b]=B.useState(""),[p,a]=B.useState(k_()),[h,c]=B.useState(!1),u=B.useRef(null);if(B.useEffect(()=>{e&&(_(""),o(""),g(!1),m(null),b(""),c(!1),setTimeout(()=>{var x;return(x=u.current)==null?void 0:x.focus()},0),r&&Vr(r).then(({cwd:x})=>b(x||"")).catch(()=>{}))},[e,r]),!e)return null;const v=async()=>{if(f)return;const x=d.trim();if(x&&!Qy.test(x)){o(O("newwindow.name_rule"));return}g(!0),o(""),E_(p);try{await i(x,l||void 0,p||void 0)}catch{g(!1)}};return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-backdrop",onClick:t}),C.jsxs("div",{className:"settings-card",style:{transform:`translate(-50%, calc(-50% + ${n/2}px))`},role:"dialog","aria-label":O("newwindow.title"),"aria-modal":"true",children:[C.jsxs("div",{className:"settings-head",children:[C.jsx("span",{className:"settings-title",children:O("newwindow.title")}),C.jsx("button",{className:"settings-close",onClick:t,"aria-label":O("common.close"),children:"✕"})]}),C.jsxs("div",{className:"settings-section",children:[C.jsxs("div",{className:"opt",children:[C.jsx("div",{className:"settings-label",children:O("newwindow.window_name")}),C.jsx("input",{ref:u,className:"bind-input",value:d,placeholder:O("newwindow.name_placeholder"),onChange:x=>{_(x.target.value),o("")},onKeyDown:x=>{x.key==="Enter"&&v()}}),s&&C.jsx("div",{className:"bind-error",children:s})]}),C.jsxs("div",{className:"opt",children:[C.jsx("div",{className:"settings-label",children:O("newwindow.start_dir")}),C.jsxs("button",{type:"button",className:"field cwd-field",onClick:()=>c(!0),children:[C.jsx("span",{className:"cwd-path",children:l||(y?O("newwindow.session_dir_named",{dir:y}):O("newwindow.session_dir_default"))}),C.jsx("span",{className:"cwd-action",children:O("newwindow.choose")})]}),l&&C.jsx("button",{type:"button",className:"cwd-reset",onClick:()=>m(null),children:O("newwindow.reset_to_session_dir")})]}),C.jsx("div",{className:"opt",children:C.jsx(im,{value:p,onChange:a})}),C.jsxs("div",{className:"settings-btns bind-actions",children:[C.jsx("button",{className:"fontbtn",onClick:t,children:O("common.cancel")}),C.jsx("button",{className:"fontbtn bind-confirm",onClick:v,disabled:f,children:O(f?"newwindow.creating":"common.create")})]})]})]}),C.jsx(Fn,{open:h,seedCwd:l||y||null,pane:r,allowMkdir:!0,onPick:x=>{m(x),c(!1)},onClose:()=>c(!1),inset:n})]})}const t1=/^[A-Za-z0-9-]{1,16}$/;function i1({open:e,title:t,currentName:i="",onClose:r,onSubmit:n,inset:d=0}){const[_,s]=B.useState(i),[o,f]=B.useState(""),[g,l]=B.useState(!1),m=B.useRef(null);if(B.useEffect(()=>{e&&(s(i),f(""),l(!1),setTimeout(()=>{var b;return(b=m.current)==null?void 0:b.focus()},0))},[e,i]),!e)return null;const y=async()=>{if(g)return;const b=_.trim();if(!t1.test(b)){f(O("rename.name_rule"));return}l(!0),f("");try{await n(b)}catch(p){f((p==null?void 0:p.message)||O("rename.failed")),l(!1)}};return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"settings-backdrop",onClick:r}),C.jsxs("div",{className:"settings-card",style:{transform:`translate(-50%, calc(-50% + ${d/2}px))`},role:"dialog","aria-label":t,"aria-modal":"true",children:[C.jsxs("div",{className:"settings-head",children:[C.jsx("span",{className:"settings-title",children:t}),C.jsx("button",{className:"settings-close",onClick:r,"aria-label":O("common.close"),children:"✕"})]}),C.jsxs("div",{className:"settings-section",children:[C.jsx("div",{className:"settings-label",children:O("rename.new_name")}),C.jsx("input",{ref:m,className:"bind-input",value:_,placeholder:O("rename.name_placeholder"),onChange:b=>{s(b.target.value),f("")},onKeyDown:b=>{b.key==="Enter"&&y()}}),o&&C.jsx("div",{className:"bind-error",children:o}),C.jsxs("div",{className:"settings-btns bind-actions",children:[C.jsx("button",{className:"fontbtn",onClick:r,children:O("common.cancel")}),C.jsx("button",{className:"fontbtn bind-confirm",onClick:y,disabled:g,children:O(g?"rename.saving":"common.save")})]})]})]})]})}function r1({onOpenDoc:e}){const[t,i]=B.useState(()=>aa()),r=n=>{w0(n),i(aa())};return t.length===0?C.jsx("div",{className:"home-view",children:C.jsxs("div",{className:"home-empty",children:[O("home.empty"),C.jsx("span",{children:O("home.emptyHint")})]})}):C.jsx("div",{className:"home-view",children:t.map(n=>C.jsxs("div",{className:"home-recent-row",children:[C.jsxs("button",{className:"home-recent",onClick:()=>e(n.path),title:n.path,children:[C.jsx("span",{className:"home-name",children:n.name}),C.jsx("span",{className:"home-path",children:n.path})]}),C.jsx("button",{className:"home-x","aria-label":O("home.remove"),onClick:()=>r(n.path),children:"✕"})]},n.path))})}function Lu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=Lu();function rm(e){Jr=e}const sm=/[&<>"']/,s1=new RegExp(sm.source,"g"),nm=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,n1=new RegExp(nm.source,"g"),o1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ld=e=>o1[e];function ii(e,t){if(t){if(sm.test(e))return e.replace(s1,Ld)}else if(nm.test(e))return e.replace(n1,Ld);return e}const a1=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l1(e){return e.replace(a1,(t,i)=>(i=i.toLowerCase(),i==="colon"?":":i.charAt(0)==="#"?i.charAt(1)==="x"?String.fromCharCode(parseInt(i.substring(2),16)):String.fromCharCode(+i.substring(1)):""))}const c1=/(^|[^\[])\^/g;function qe(e,t){let i=typeof e=="string"?e:e.source;t=t||"";const r={replace:(n,d)=>{let _=typeof d=="string"?d:d.source;return _=_.replace(c1,"$1"),i=i.replace(n,_),r},getRegex:()=>new RegExp(i,t)};return r}function Rd(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const dn={exec:()=>null};function Td(e,t){const i=e.replace(/\|/g,(d,_,s)=>{let o=!1,f=_;for(;--f>=0&&s[f]==="\\";)o=!o;return o?"|":" |"}),r=i.split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function mo(e,t,i){const r=e.length;if(r===0)return"";let n=0;for(;n<r&&e.charAt(r-n-1)===t;)n++;return e.slice(0,r-n)}function u1(e,t){if(e.indexOf(t[1])===-1)return-1;let i=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function Dd(e,t,i,r){const n=t.href,d=t.title?ii(t.title):null,_=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const s={type:"link",raw:i,href:n,title:d,text:_,tokens:r.inlineTokens(_)};return r.state.inLink=!1,s}return{type:"image",raw:i,href:n,title:d,text:ii(_)}}function h1(e,t){const i=e.match(/^(\s+)(?:```)/);if(i===null)return t;const r=i[1];return t.split(`
110
+ `).map(n=>{const d=n.match(/^\s+/);if(d===null)return n;const[_]=d;return _.length>=r.length?n.slice(r.length):n}).join(`
111
+ `)}class ca{constructor(t){Qe(this,"options");Qe(this,"rules");Qe(this,"lexer");this.options=t||Jr}space(t){const i=this.rules.block.newline.exec(t);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(t){const i=this.rules.block.code.exec(t);if(i){const r=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:mo(r,`
112
+ `)}}}fences(t){const i=this.rules.block.fences.exec(t);if(i){const r=i[0],n=h1(r,i[3]||"");return{type:"code",raw:r,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:n}}}heading(t){const i=this.rules.block.heading.exec(t);if(i){let r=i[2].trim();if(/#$/.test(r)){const n=mo(r,"#");(this.options.pedantic||!n||/ $/.test(n))&&(r=n.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const i=this.rules.block.hr.exec(t);if(i)return{type:"hr",raw:i[0]}}blockquote(t){const i=this.rules.block.blockquote.exec(t);if(i){let r=i[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
113
+ $1`);r=mo(r.replace(/^ *>[ \t]?/gm,""),`
114
+ `);const n=this.lexer.state.top;this.lexer.state.top=!0;const d=this.lexer.blockTokens(r);return this.lexer.state.top=n,{type:"blockquote",raw:i[0],tokens:d,text:r}}}list(t){let i=this.rules.block.list.exec(t);if(i){let r=i[1].trim();const n=r.length>1,d={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const _=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let s="",o="",f=!1;for(;t;){let g=!1;if(!(i=_.exec(t))||this.rules.block.hr.test(t))break;s=i[0],t=t.substring(s.length);let l=i[2].split(`
115
+ `,1)[0].replace(/^\t+/,h=>" ".repeat(3*h.length)),m=t.split(`
116
+ `,1)[0],y=0;this.options.pedantic?(y=2,o=l.trimStart()):(y=i[2].search(/[^ ]/),y=y>4?1:y,o=l.slice(y),y+=i[1].length);let b=!1;if(!l&&/^ *$/.test(m)&&(s+=m+`
117
+ `,t=t.substring(m.length+1),g=!0),!g){const h=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),c=new RegExp(`^ {0,${Math.min(3,y-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),u=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:\`\`\`|~~~)`),v=new RegExp(`^ {0,${Math.min(3,y-1)}}#`);for(;t;){const x=t.split(`
118
+ `,1)[0];if(m=x,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),u.test(m)||v.test(m)||h.test(m)||c.test(t))break;if(m.search(/[^ ]/)>=y||!m.trim())o+=`
119
+ `+m.slice(y);else{if(b||l.search(/[^ ]/)>=4||u.test(l)||v.test(l)||c.test(l))break;o+=`
120
+ `+m}!b&&!m.trim()&&(b=!0),s+=x+`
121
+ `,t=t.substring(x.length+1),l=m.slice(y)}}d.loose||(f?d.loose=!0:/\n *\n *$/.test(s)&&(f=!0));let p=null,a;this.options.gfm&&(p=/^\[[ xX]\] /.exec(o),p&&(a=p[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),d.items.push({type:"list_item",raw:s,task:!!p,checked:a,loose:!1,text:o,tokens:[]}),d.raw+=s}d.items[d.items.length-1].raw=s.trimEnd(),d.items[d.items.length-1].text=o.trimEnd(),d.raw=d.raw.trimEnd();for(let g=0;g<d.items.length;g++)if(this.lexer.state.top=!1,d.items[g].tokens=this.lexer.blockTokens(d.items[g].text,[]),!d.loose){const l=d.items[g].tokens.filter(y=>y.type==="space"),m=l.length>0&&l.some(y=>/\n.*\n/.test(y.raw));d.loose=m}if(d.loose)for(let g=0;g<d.items.length;g++)d.items[g].loose=!0;return d}}html(t){const i=this.rules.block.html.exec(t);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(t){const i=this.rules.block.def.exec(t);if(i){const r=i[1].toLowerCase().replace(/\s+/g," "),n=i[2]?i[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:r,raw:i[0],href:n,title:d}}}table(t){const i=this.rules.block.table.exec(t);if(!i||!/[:|]/.test(i[2]))return;const r=Td(i[1]),n=i[2].replace(/^\||\| *$/g,"").split("|"),d=i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(`
122
+ `):[],_={type:"table",raw:i[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const s of n)/^ *-+: *$/.test(s)?_.align.push("right"):/^ *:-+: *$/.test(s)?_.align.push("center"):/^ *:-+ *$/.test(s)?_.align.push("left"):_.align.push(null);for(const s of r)_.header.push({text:s,tokens:this.lexer.inline(s)});for(const s of d)_.rows.push(Td(s,_.header.length).map(o=>({text:o,tokens:this.lexer.inline(o)})));return _}}lheading(t){const i=this.rules.block.lheading.exec(t);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(t){const i=this.rules.block.paragraph.exec(t);if(i){const r=i[1].charAt(i[1].length-1)===`
123
+ `?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const i=this.rules.block.text.exec(t);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(t){const i=this.rules.inline.escape.exec(t);if(i)return{type:"escape",raw:i[0],text:ii(i[1])}}tag(t){const i=this.rules.inline.tag.exec(t);if(i)return!this.lexer.state.inLink&&/^<a /i.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(t){const i=this.rules.inline.link.exec(t);if(i){const r=i[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const _=mo(r.slice(0,-1),"\\");if((r.length-_.length)%2===0)return}else{const _=u1(i[2],"()");if(_>-1){const o=(i[0].indexOf("!")===0?5:4)+i[1].length+_;i[2]=i[2].substring(0,_),i[0]=i[0].substring(0,o).trim(),i[3]=""}}let n=i[2],d="";if(this.options.pedantic){const _=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);_&&(n=_[1],d=_[3])}else d=i[3]?i[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(this.options.pedantic&&!/>$/.test(r)?n=n.slice(1):n=n.slice(1,-1)),Dd(i,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer)}}reflink(t,i){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const n=(r[2]||r[1]).replace(/\s+/g," "),d=i[n.toLowerCase()];if(!d){const _=r[0].charAt(0);return{type:"text",raw:_,text:_}}return Dd(r,d,r[0],this.lexer)}}emStrong(t,i,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!n||n[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const _=[...n[0]].length-1;let s,o,f=_,g=0;const l=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,i=i.slice(-1*t.length+_);(n=l.exec(i))!=null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s)continue;if(o=[...s].length,n[3]||n[4]){f+=o;continue}else if((n[5]||n[6])&&_%3&&!((_+o)%3)){g+=o;continue}if(f-=o,f>0)continue;o=Math.min(o,o+f+g);const m=[...n[0]][0].length,y=t.slice(0,_+n.index+m+o);if(Math.min(_,o)%2){const p=y.slice(1,-1);return{type:"em",raw:y,text:p,tokens:this.lexer.inlineTokens(p)}}const b=y.slice(2,-2);return{type:"strong",raw:y,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){const i=this.rules.inline.code.exec(t);if(i){let r=i[2].replace(/\n/g," ");const n=/[^ ]/.test(r),d=/^ /.test(r)&&/ $/.test(r);return n&&d&&(r=r.substring(1,r.length-1)),r=ii(r,!0),{type:"codespan",raw:i[0],text:r}}}br(t){const i=this.rules.inline.br.exec(t);if(i)return{type:"br",raw:i[0]}}del(t){const i=this.rules.inline.del.exec(t);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(t){const i=this.rules.inline.autolink.exec(t);if(i){let r,n;return i[2]==="@"?(r=ii(i[1]),n="mailto:"+r):(r=ii(i[1]),n=r),{type:"link",raw:i[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let i;if(i=this.rules.inline.url.exec(t)){let n,d;if(i[2]==="@")n=ii(i[0]),d="mailto:"+n;else{let _;do _=i[0],i[0]=((r=this.rules.inline._backpedal.exec(i[0]))==null?void 0:r[0])??"";while(_!==i[0]);n=ii(i[0]),i[1]==="www."?d="http://"+i[0]:d=i[0]}return{type:"link",raw:i[0],text:n,href:d,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=i[0]:r=ii(i[0]),{type:"text",raw:i[0],text:r}}}}const d1=/^(?: *(?:\n|$))+/,f1=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,p1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Hn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,om=/(?:[*+-]|\d{1,9}[.)])/,am=qe(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,om).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Ru=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m1=/^[^\n]+/,Tu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,g1=qe(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Tu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),v1=qe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,om).getRegex(),Ia="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Du=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,w1=qe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Du).replace("tag",Ia).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lm=qe(Ru).replace("hr",Hn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ia).getRegex(),y1=qe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lm).getRegex(),Au={blockquote:y1,code:f1,def:g1,fences:p1,heading:_1,hr:Hn,html:w1,lheading:am,list:v1,newline:d1,paragraph:lm,table:dn,text:m1},Ad=qe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Hn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ia).getRegex(),S1={...Au,table:Ad,paragraph:qe(Ru).replace("hr",Hn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ad).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ia).getRegex()},b1={...Au,html:qe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Du).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:dn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:qe(Ru).replace("hr",Hn).replace("heading",` *#{1,6} *[^
124
+ ]`).replace("lheading",am).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},cm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,C1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,um=/^( {2,}|\\)\n(?!\s*$)/,x1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,zn="\\p{P}\\p{S}",k1=qe(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,zn).getRegex(),E1=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,L1=qe(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,zn).getRegex(),R1=qe("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,zn).getRegex(),T1=qe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,zn).getRegex(),D1=qe(/\\([punct])/,"gu").replace(/punct/g,zn).getRegex(),A1=qe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),M1=qe(Du).replace("(?:-->|$)","-->").getRegex(),I1=qe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",M1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ua=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,P1=qe(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ua).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hm=qe(/^!?\[(label)\]\[(ref)\]/).replace("label",ua).replace("ref",Tu).getRegex(),dm=qe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tu).getRegex(),O1=qe("reflink|nolink(?!\\()","g").replace("reflink",hm).replace("nolink",dm).getRegex(),Mu={_backpedal:dn,anyPunctuation:D1,autolink:A1,blockSkip:E1,br:um,code:C1,del:dn,emStrongLDelim:L1,emStrongRDelimAst:R1,emStrongRDelimUnd:T1,escape:cm,link:P1,nolink:dm,punctuation:k1,reflink:hm,reflinkSearch:O1,tag:I1,text:x1,url:dn},N1={...Mu,link:qe(/^!?\[(label)\]\((.*?)\)/).replace("label",ua).getRegex(),reflink:qe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ua).getRegex()},gc={...Mu,escape:qe(cm).replace("])","~|])").getRegex(),url:qe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},B1={...gc,br:qe(um).replace("{2,}","*").getRegex(),text:qe(gc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},go={normal:Au,gfm:S1,pedantic:b1},Ks={normal:Mu,gfm:gc,breaks:B1,pedantic:N1};class Ni{constructor(t){Qe(this,"tokens");Qe(this,"options");Qe(this,"state");Qe(this,"tokenizer");Qe(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jr,this.options.tokenizer=this.options.tokenizer||new ca,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={block:go.normal,inline:Ks.normal};this.options.pedantic?(i.block=go.pedantic,i.inline=Ks.pedantic):this.options.gfm&&(i.block=go.gfm,this.options.breaks?i.inline=Ks.breaks:i.inline=Ks.gfm),this.tokenizer.rules=i}static get rules(){return{block:go,inline:Ks}}static lex(t,i){return new Ni(i).lex(t)}static lexInline(t,i){return new Ni(i).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
125
+ `),this.blockTokens(t,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const r=this.inlineQueue[i];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,i=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,o,f)=>o+" ".repeat(f.length));let r,n,d,_;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(r=s.call({lexer:this},t,i))?(t=t.substring(r.raw.length),i.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&i.length>0?i[i.length-1].raw+=`
126
+ `:i.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),n=i[i.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=`
127
+ `+r.raw,n.text+=`
128
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),n=i[i.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=`
129
+ `+r.raw,n.text+=`
130
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),i.push(r);continue}if(d=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const o=t.slice(1);let f;this.options.extensions.startBlock.forEach(g=>{f=g.call({lexer:this},o),typeof f=="number"&&f>=0&&(s=Math.min(s,f))}),s<1/0&&s>=0&&(d=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(d))){n=i[i.length-1],_&&n.type==="paragraph"?(n.raw+=`
131
+ `+r.raw,n.text+=`
132
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(r),_=d.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),n=i[i.length-1],n&&n.type==="text"?(n.raw+=`
133
+ `+r.raw,n.text+=`
134
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(r);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}inlineTokens(t,i=[]){let r,n,d,_=t,s,o,f;if(this.tokens.links){const g=Object.keys(this.tokens.links);if(g.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(_))!=null;)g.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(_=_.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+_.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(_))!=null;)_=_.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+_.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(_))!=null;)_=_.slice(0,s.index)+"++"+_.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(o||(f=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(g=>(r=g.call({lexer:this},t,i))?(t=t.substring(r.raw.length),i.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),n=i[i.length-1],n&&r.type==="text"&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):i.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),n=i[i.length-1],n&&r.type==="text"&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):i.push(r);continue}if(r=this.tokenizer.emStrong(t,_,f)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),i.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),i.push(r);continue}if(d=t,this.options.extensions&&this.options.extensions.startInline){let g=1/0;const l=t.slice(1);let m;this.options.extensions.startInline.forEach(y=>{m=y.call({lexer:this},l),typeof m=="number"&&m>=0&&(g=Math.min(g,m))}),g<1/0&&g>=0&&(d=t.substring(0,g+1))}if(r=this.tokenizer.inlineText(d)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(f=r.raw.slice(-1)),o=!0,n=i[i.length-1],n&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):i.push(r);continue}if(t){const g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return i}}class ha{constructor(t){Qe(this,"options");this.options=t||Jr}code(t,i,r){var d;const n=(d=(i||"").match(/^\S*/))==null?void 0:d[0];return t=t.replace(/\n$/,"")+`
135
+ `,n?'<pre><code class="language-'+ii(n)+'">'+(r?t:ii(t,!0))+`</code></pre>
136
+ `:"<pre><code>"+(r?t:ii(t,!0))+`</code></pre>
137
+ `}blockquote(t){return`<blockquote>
138
+ ${t}</blockquote>
139
+ `}html(t,i){return t}heading(t,i,r){return`<h${i}>${t}</h${i}>
140
+ `}hr(){return`<hr>
141
+ `}list(t,i,r){const n=i?"ol":"ul",d=i&&r!==1?' start="'+r+'"':"";return"<"+n+d+`>
142
+ `+t+"</"+n+`>
143
+ `}listitem(t,i,r){return`<li>${t}</li>
144
+ `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
145
+ `}table(t,i){return i&&(i=`<tbody>${i}</tbody>`),`<table>
146
+ <thead>
147
+ `+t+`</thead>
148
+ `+i+`</table>
149
+ `}tablerow(t){return`<tr>
150
+ ${t}</tr>
151
+ `}tablecell(t,i){const r=i.header?"th":"td";return(i.align?`<${r} align="${i.align}">`:`<${r}>`)+t+`</${r}>
152
+ `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,i,r){const n=Rd(t);if(n===null)return r;t=n;let d='<a href="'+t+'"';return i&&(d+=' title="'+i+'"'),d+=">"+r+"</a>",d}image(t,i,r){const n=Rd(t);if(n===null)return r;t=n;let d=`<img src="${t}" alt="${r}"`;return i&&(d+=` title="${i}"`),d+=">",d}text(t){return t}}class Iu{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,i,r){return""+r}image(t,i,r){return""+r}br(){return""}}class Bi{constructor(t){Qe(this,"options");Qe(this,"renderer");Qe(this,"textRenderer");this.options=t||Jr,this.options.renderer=this.options.renderer||new ha,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Iu}static parse(t,i){return new Bi(i).parse(t)}static parseInline(t,i){return new Bi(i).parseInline(t)}parse(t,i=!0){let r="";for(let n=0;n<t.length;n++){const d=t[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]){const _=d,s=this.options.extensions.renderers[_.type].call({parser:this},_);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(_.type)){r+=s||"";continue}}switch(d.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const _=d;r+=this.renderer.heading(this.parseInline(_.tokens),_.depth,l1(this.parseInline(_.tokens,this.textRenderer)));continue}case"code":{const _=d;r+=this.renderer.code(_.text,_.lang,!!_.escaped);continue}case"table":{const _=d;let s="",o="";for(let g=0;g<_.header.length;g++)o+=this.renderer.tablecell(this.parseInline(_.header[g].tokens),{header:!0,align:_.align[g]});s+=this.renderer.tablerow(o);let f="";for(let g=0;g<_.rows.length;g++){const l=_.rows[g];o="";for(let m=0;m<l.length;m++)o+=this.renderer.tablecell(this.parseInline(l[m].tokens),{header:!1,align:_.align[m]});f+=this.renderer.tablerow(o)}r+=this.renderer.table(s,f);continue}case"blockquote":{const _=d,s=this.parse(_.tokens);r+=this.renderer.blockquote(s);continue}case"list":{const _=d,s=_.ordered,o=_.start,f=_.loose;let g="";for(let l=0;l<_.items.length;l++){const m=_.items[l],y=m.checked,b=m.task;let p="";if(m.task){const a=this.renderer.checkbox(!!y);f?m.tokens.length>0&&m.tokens[0].type==="paragraph"?(m.tokens[0].text=a+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&m.tokens[0].tokens[0].type==="text"&&(m.tokens[0].tokens[0].text=a+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:a+" "}):p+=a+" "}p+=this.parse(m.tokens,f),g+=this.renderer.listitem(p,b,!!y)}r+=this.renderer.list(g,s,o);continue}case"html":{const _=d;r+=this.renderer.html(_.text,_.block);continue}case"paragraph":{const _=d;r+=this.renderer.paragraph(this.parseInline(_.tokens));continue}case"text":{let _=d,s=_.tokens?this.parseInline(_.tokens):_.text;for(;n+1<t.length&&t[n+1].type==="text";)_=t[++n],s+=`
153
+ `+(_.tokens?this.parseInline(_.tokens):_.text);r+=i?this.renderer.paragraph(s):s;continue}default:{const _='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(_),"";throw new Error(_)}}}return r}parseInline(t,i){i=i||this.renderer;let r="";for(let n=0;n<t.length;n++){const d=t[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]){const _=this.options.extensions.renderers[d.type].call({parser:this},d);if(_!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(d.type)){r+=_||"";continue}}switch(d.type){case"escape":{const _=d;r+=i.text(_.text);break}case"html":{const _=d;r+=i.html(_.text);break}case"link":{const _=d;r+=i.link(_.href,_.title,this.parseInline(_.tokens,i));break}case"image":{const _=d;r+=i.image(_.href,_.title,_.text);break}case"strong":{const _=d;r+=i.strong(this.parseInline(_.tokens,i));break}case"em":{const _=d;r+=i.em(this.parseInline(_.tokens,i));break}case"codespan":{const _=d;r+=i.codespan(_.text);break}case"br":{r+=i.br();break}case"del":{const _=d;r+=i.del(this.parseInline(_.tokens,i));break}case"text":{const _=d;r+=i.text(_.text);break}default:{const _='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(_),"";throw new Error(_)}}}return r}}class fn{constructor(t){Qe(this,"options");this.options=t||Jr}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}}Qe(fn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Kr,vc,fm;class j1{constructor(...t){$u(this,Kr);Qe(this,"defaults",Lu());Qe(this,"options",this.setOptions);Qe(this,"parse",Vn(this,Kr,vc).call(this,Ni.lex,Bi.parse));Qe(this,"parseInline",Vn(this,Kr,vc).call(this,Ni.lexInline,Bi.parseInline));Qe(this,"Parser",Bi);Qe(this,"Renderer",ha);Qe(this,"TextRenderer",Iu);Qe(this,"Lexer",Ni);Qe(this,"Tokenizer",ca);Qe(this,"Hooks",fn);this.use(...t)}walkTokens(t,i){var n,d;let r=[];for(const _ of t)switch(r=r.concat(i.call(this,_)),_.type){case"table":{const s=_;for(const o of s.header)r=r.concat(this.walkTokens(o.tokens,i));for(const o of s.rows)for(const f of o)r=r.concat(this.walkTokens(f.tokens,i));break}case"list":{const s=_;r=r.concat(this.walkTokens(s.items,i));break}default:{const s=_;(d=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&d[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{const f=s[o].flat(1/0);r=r.concat(this.walkTokens(f,i))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,i)))}}return r}use(...t){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const _=i.renderers[d.name];_?i.renderers[d.name]=function(...s){let o=d.renderer.apply(this,s);return o===!1&&(o=_.apply(this,s)),o}:i.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const _=i[d.level];_?_.unshift(d.tokenizer):i[d.level]=[d.tokenizer],d.start&&(d.level==="block"?i.startBlock?i.startBlock.push(d.start):i.startBlock=[d.start]:d.level==="inline"&&(i.startInline?i.startInline.push(d.start):i.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(i.childTokens[d.name]=d.childTokens)}),n.extensions=i),r.renderer){const d=this.defaults.renderer||new ha(this.defaults);for(const _ in r.renderer){if(!(_ in d))throw new Error(`renderer '${_}' does not exist`);if(_==="options")continue;const s=_,o=r.renderer[s],f=d[s];d[s]=(...g)=>{let l=o.apply(d,g);return l===!1&&(l=f.apply(d,g)),l||""}}n.renderer=d}if(r.tokenizer){const d=this.defaults.tokenizer||new ca(this.defaults);for(const _ in r.tokenizer){if(!(_ in d))throw new Error(`tokenizer '${_}' does not exist`);if(["options","rules","lexer"].includes(_))continue;const s=_,o=r.tokenizer[s],f=d[s];d[s]=(...g)=>{let l=o.apply(d,g);return l===!1&&(l=f.apply(d,g)),l}}n.tokenizer=d}if(r.hooks){const d=this.defaults.hooks||new fn;for(const _ in r.hooks){if(!(_ in d))throw new Error(`hook '${_}' does not exist`);if(_==="options")continue;const s=_,o=r.hooks[s],f=d[s];fn.passThroughHooks.has(_)?d[s]=g=>{if(this.defaults.async)return Promise.resolve(o.call(d,g)).then(m=>f.call(d,m));const l=o.call(d,g);return f.call(d,l)}:d[s]=(...g)=>{let l=o.apply(d,g);return l===!1&&(l=f.apply(d,g)),l}}n.hooks=d}if(r.walkTokens){const d=this.defaults.walkTokens,_=r.walkTokens;n.walkTokens=function(s){let o=[];return o.push(_.call(this,s)),d&&(o=o.concat(d.call(this,s))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,i){return Ni.lex(t,i??this.defaults)}parser(t,i){return Bi.parse(t,i??this.defaults)}}Kr=new WeakSet,vc=function(t,i){return(r,n)=>{const d={...n},_={...this.defaults,...d};this.defaults.async===!0&&d.async===!1&&(_.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),_.async=!0);const s=Vn(this,Kr,fm).call(this,!!_.silent,!!_.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(_.hooks&&(_.hooks.options=_),_.async)return Promise.resolve(_.hooks?_.hooks.preprocess(r):r).then(o=>t(o,_)).then(o=>_.hooks?_.hooks.processAllTokens(o):o).then(o=>_.walkTokens?Promise.all(this.walkTokens(o,_.walkTokens)).then(()=>o):o).then(o=>i(o,_)).then(o=>_.hooks?_.hooks.postprocess(o):o).catch(s);try{_.hooks&&(r=_.hooks.preprocess(r));let o=t(r,_);_.hooks&&(o=_.hooks.processAllTokens(o)),_.walkTokens&&this.walkTokens(o,_.walkTokens);let f=i(o,_);return _.hooks&&(f=_.hooks.postprocess(f)),f}catch(o){return s(o)}}},fm=function(t,i){return r=>{if(r.message+=`
154
+ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+ii(r.message+"",!0)+"</pre>";return i?Promise.resolve(n):n}if(i)return Promise.reject(r);throw r}};const Gr=new j1;function Ge(e,t){return Gr.parse(e,t)}Ge.options=Ge.setOptions=function(e){return Gr.setOptions(e),Ge.defaults=Gr.defaults,rm(Ge.defaults),Ge};Ge.getDefaults=Lu;Ge.defaults=Jr;Ge.use=function(...e){return Gr.use(...e),Ge.defaults=Gr.defaults,rm(Ge.defaults),Ge};Ge.walkTokens=function(e,t){return Gr.walkTokens(e,t)};Ge.parseInline=Gr.parseInline;Ge.Parser=Bi;Ge.parser=Bi.parse;Ge.Renderer=ha;Ge.TextRenderer=Iu;Ge.Lexer=Ni;Ge.lexer=Ni.lex;Ge.Tokenizer=ca;Ge.Hooks=fn;Ge.parse=Ge;Ge.options;Ge.setOptions;Ge.use;Ge.walkTokens;Ge.parseInline;Bi.parse;Ni.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function Md(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function F1(e){if(Array.isArray(e))return e}function H1(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var r,n,d,_,s=[],o=!0,f=!1;try{if(d=(i=i.call(e)).next,t!==0)for(;!(o=(r=d.call(i)).done)&&(s.push(r.value),s.length!==t);o=!0);}catch(g){f=!0,n=g}finally{try{if(!o&&i.return!=null&&(_=i.return(),Object(_)!==_))return}finally{if(f)throw n}}return s}}function z1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
155
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $1(e,t){return F1(e)||H1(e,t)||U1(e,t)||z1()}function U1(e,t){if(e){if(typeof e=="string")return Md(e,t);var i={}.toString.call(e).slice(8,-1);return i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set"?Array.from(e):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Md(e,t):void 0}}const pm=Object.entries,Id=Object.setPrototypeOf,W1=Object.isFrozen,V1=Object.getPrototypeOf,G1=Object.getOwnPropertyDescriptor;let Ft=Object.freeze,mi=Object.seal,os=Object.create,_m=typeof Reflect<"u"&&Reflect,wc=_m.apply,yc=_m.construct;Ft||(Ft=function(t){return t});mi||(mi=function(t){return t});wc||(wc=function(t,i){for(var r=arguments.length,n=new Array(r>2?r-2:0),d=2;d<r;d++)n[d-2]=arguments[d];return t.apply(i,n)});yc||(yc=function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return new t(...r)});const Tr=_t(Array.prototype.forEach),K1=_t(Array.prototype.lastIndexOf),Pd=_t(Array.prototype.pop),rs=_t(Array.prototype.push),q1=_t(Array.prototype.splice),Ot=Array.isArray,tn=_t(String.prototype.toLowerCase),fl=_t(String.prototype.toString),Od=_t(String.prototype.match),ss=_t(String.prototype.replace),Nd=_t(String.prototype.indexOf),Y1=_t(String.prototype.trim),X1=_t(Number.prototype.toString),J1=_t(Boolean.prototype.toString),Bd=typeof BigInt>"u"?null:_t(BigInt.prototype.toString),jd=typeof Symbol>"u"?null:_t(Symbol.prototype.toString),ct=_t(Object.prototype.hasOwnProperty),qs=_t(Object.prototype.toString),bt=_t(RegExp.prototype.test),ns=Z1(TypeError);function _t(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return wc(e,t,r)}}function Z1(e){return function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return yc(e,i)}}function Ne(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tn;if(Id&&Id(e,null),!Ot(t))return e;let r=t.length;for(;r--;){let n=t[r];if(typeof n=="string"){const d=i(n);d!==n&&(W1(t)||(t[r]=d),n=d)}e[n]=!0}return e}function Q1(e){for(let t=0;t<e.length;t++)ct(e,t)||(e[t]=null);return e}function At(e){const t=os(null);for(const r of pm(e)){var i=$1(r,2);const n=i[0],d=i[1];ct(e,n)&&(Ot(d)?t[n]=Q1(d):d&&typeof d=="object"&&d.constructor===Object?t[n]=At(d):t[n]=d)}return t}function eS(e){switch(typeof e){case"string":return e;case"number":return X1(e);case"boolean":return J1(e);case"bigint":return Bd?Bd(e):"0";case"symbol":return jd?jd(e):"Symbol()";case"undefined":return qs(e);case"function":case"object":{if(e===null)return qs(e);const t=e,i=Ii(t,"toString");if(typeof i=="function"){const r=i(t);return typeof r=="string"?r:qs(r)}return qs(e)}default:return qs(e)}}function Ii(e,t){for(;e!==null;){const r=G1(e,t);if(r){if(r.get)return _t(r.get);if(typeof r.value=="function")return _t(r.value)}e=V1(e)}function i(){return null}return i}function tS(e){try{return bt(e,""),!0}catch{return!1}}const Fd=Ft(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pl=Ft(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_l=Ft(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),iS=Ft(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ml=Ft(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),rS=Ft(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hd=Ft(["#text"]),zd=Ft(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),gl=Ft(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$d=Ft(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vo=Ft(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sS=mi(/{{[\w\W]*|^[\w\W]*}}/g),nS=mi(/<%[\w\W]*|^[\w\W]*%>/g),oS=mi(/\${[\w\W]*/g),aS=mi(/^data-[\-\w.\u00B7-\uFFFF]+$/),lS=mi(/^aria-[\-\w]+$/),Ud=mi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cS=mi(/^(?:\w+script|data):/i),uS=mi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hS=mi(/^html$/i),dS=mi(/^[a-z][.\w]*(-[.\w]+)+$/i),Ai={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},fS=function(){return typeof window>"u"?null:window},pS=function(t,i){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const n="data-tt-policy-suffix";i&&i.hasAttribute(n)&&(r=i.getAttribute(n));const d="dompurify"+(r?"#"+r:"");try{return t.createPolicy(d,{createHTML(_){return _},createScriptURL(_){return _}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Wd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function mm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fS();const t=ne=>mm(ne);if(t.version="3.4.8",t.removed=[],!e||!e.document||e.document.nodeType!==Ai.document||!e.Element)return t.isSupported=!1,t;let i=e.document;const r=i,n=r.currentScript;e.DocumentFragment;const d=e.HTMLTemplateElement,_=e.Node,s=e.Element,o=e.NodeFilter,f=e.NamedNodeMap;f===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const g=e.DOMParser,l=e.trustedTypes,m=s.prototype,y=Ii(m,"cloneNode"),b=Ii(m,"remove"),p=Ii(m,"nextSibling"),a=Ii(m,"childNodes"),h=Ii(m,"parentNode"),c=Ii(m,"shadowRoot"),u=Ii(m,"attributes"),v=_&&_.prototype?Ii(_.prototype,"nodeType"):null,x=_&&_.prototype?Ii(_.prototype,"nodeName"):null;if(typeof d=="function"){const ne=i.createElement("template");ne.content&&ne.content.ownerDocument&&(i=ne.content.ownerDocument)}let S,k="",w=0;const E=function(F){if(w>0)throw ns('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');w++;try{return S.createHTML(F)}finally{w--}},R=i,I=R.implementation,T=R.createNodeIterator,D=R.createDocumentFragment,N=R.getElementsByTagName,$=r.importNode;let U=Wd();t.isSupported=typeof pm=="function"&&typeof h=="function"&&I&&I.createHTMLDocument!==void 0;const P=sS,H=nS,L=oS,A=aS,j=lS,z=cS,K=uS,Y=dS;let te=Ud,Q=null;const W=Ne({},[...Fd,...pl,..._l,...ml,...Hd]);let M=null;const G=Ne({},[...zd,...gl,...$d,...vo]);let V=Object.seal(os(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,ie=null;const me=Object.seal(os(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ue=!0,Re=!0,xe=!1,pe=!0,ze=!1,ge=!0,_e=!1,fe=!1,be=!1,le=!1,X=!1,J=!1,se=!0,ve=!1;const Ee="user-content-";let Le=!0,Me=!1,de={},ye=null;const Xe=Ne({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Te=null;const Yt=Ne({},["audio","video","img","source","image","track"]);let li=null;const Ze=Ne({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xt="http://www.w3.org/1998/Math/MathML",Jt="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xhtml";let st=ft,$t=!1,yt=null;const Zr=Ne({},[Xt,Jt,ft],fl);let gi=Ne({},["mi","mo","mn","ms","mtext"]),vi=Ne({},["annotation-xml"]);const tr=Ne({},["title","style","font","a","script"]);let St=null;const xr=["application/xhtml+xml","text/html"],kr="text/html";let We=null,Zt=null;const zi=i.createElement("form"),ci=function(F){return F instanceof RegExp||F instanceof Function},wi=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Zt&&Zt===F)return;(!F||typeof F!="object")&&(F={}),F=At(F),St=xr.indexOf(F.PARSER_MEDIA_TYPE)===-1?kr:F.PARSER_MEDIA_TYPE,We=St==="application/xhtml+xml"?fl:tn,Q=ct(F,"ALLOWED_TAGS")&&Ot(F.ALLOWED_TAGS)?Ne({},F.ALLOWED_TAGS,We):W,M=ct(F,"ALLOWED_ATTR")&&Ot(F.ALLOWED_ATTR)?Ne({},F.ALLOWED_ATTR,We):G,yt=ct(F,"ALLOWED_NAMESPACES")&&Ot(F.ALLOWED_NAMESPACES)?Ne({},F.ALLOWED_NAMESPACES,fl):Zr,li=ct(F,"ADD_URI_SAFE_ATTR")&&Ot(F.ADD_URI_SAFE_ATTR)?Ne(At(Ze),F.ADD_URI_SAFE_ATTR,We):Ze,Te=ct(F,"ADD_DATA_URI_TAGS")&&Ot(F.ADD_DATA_URI_TAGS)?Ne(At(Yt),F.ADD_DATA_URI_TAGS,We):Yt,ye=ct(F,"FORBID_CONTENTS")&&Ot(F.FORBID_CONTENTS)?Ne({},F.FORBID_CONTENTS,We):Xe,re=ct(F,"FORBID_TAGS")&&Ot(F.FORBID_TAGS)?Ne({},F.FORBID_TAGS,We):At({}),ie=ct(F,"FORBID_ATTR")&&Ot(F.FORBID_ATTR)?Ne({},F.FORBID_ATTR,We):At({}),de=ct(F,"USE_PROFILES")?F.USE_PROFILES&&typeof F.USE_PROFILES=="object"?At(F.USE_PROFILES):F.USE_PROFILES:!1,ue=F.ALLOW_ARIA_ATTR!==!1,Re=F.ALLOW_DATA_ATTR!==!1,xe=F.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ze=F.SAFE_FOR_TEMPLATES||!1,ge=F.SAFE_FOR_XML!==!1,_e=F.WHOLE_DOCUMENT||!1,le=F.RETURN_DOM||!1,X=F.RETURN_DOM_FRAGMENT||!1,J=F.RETURN_TRUSTED_TYPE||!1,be=F.FORCE_BODY||!1,se=F.SANITIZE_DOM!==!1,ve=F.SANITIZE_NAMED_PROPS||!1,Le=F.KEEP_CONTENT!==!1,Me=F.IN_PLACE||!1,te=tS(F.ALLOWED_URI_REGEXP)?F.ALLOWED_URI_REGEXP:Ud,st=typeof F.NAMESPACE=="string"?F.NAMESPACE:ft,gi=ct(F,"MATHML_TEXT_INTEGRATION_POINTS")&&F.MATHML_TEXT_INTEGRATION_POINTS&&typeof F.MATHML_TEXT_INTEGRATION_POINTS=="object"?At(F.MATHML_TEXT_INTEGRATION_POINTS):Ne({},["mi","mo","mn","ms","mtext"]),vi=ct(F,"HTML_INTEGRATION_POINTS")&&F.HTML_INTEGRATION_POINTS&&typeof F.HTML_INTEGRATION_POINTS=="object"?At(F.HTML_INTEGRATION_POINTS):Ne({},["annotation-xml"]);const Z=ct(F,"CUSTOM_ELEMENT_HANDLING")&&F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING=="object"?At(F.CUSTOM_ELEMENT_HANDLING):os(null);if(V=os(null),ct(Z,"tagNameCheck")&&ci(Z.tagNameCheck)&&(V.tagNameCheck=Z.tagNameCheck),ct(Z,"attributeNameCheck")&&ci(Z.attributeNameCheck)&&(V.attributeNameCheck=Z.attributeNameCheck),ct(Z,"allowCustomizedBuiltInElements")&&typeof Z.allowCustomizedBuiltInElements=="boolean"&&(V.allowCustomizedBuiltInElements=Z.allowCustomizedBuiltInElements),ze&&(Re=!1),X&&(le=!0),de&&(Q=Ne({},Hd),M=os(null),de.html===!0&&(Ne(Q,Fd),Ne(M,zd)),de.svg===!0&&(Ne(Q,pl),Ne(M,gl),Ne(M,vo)),de.svgFilters===!0&&(Ne(Q,_l),Ne(M,gl),Ne(M,vo)),de.mathMl===!0&&(Ne(Q,ml),Ne(M,$d),Ne(M,vo))),me.tagCheck=null,me.attributeCheck=null,ct(F,"ADD_TAGS")&&(typeof F.ADD_TAGS=="function"?me.tagCheck=F.ADD_TAGS:Ot(F.ADD_TAGS)&&(Q===W&&(Q=At(Q)),Ne(Q,F.ADD_TAGS,We))),ct(F,"ADD_ATTR")&&(typeof F.ADD_ATTR=="function"?me.attributeCheck=F.ADD_ATTR:Ot(F.ADD_ATTR)&&(M===G&&(M=At(M)),Ne(M,F.ADD_ATTR,We))),ct(F,"ADD_URI_SAFE_ATTR")&&Ot(F.ADD_URI_SAFE_ATTR)&&Ne(li,F.ADD_URI_SAFE_ATTR,We),ct(F,"FORBID_CONTENTS")&&Ot(F.FORBID_CONTENTS)&&(ye===Xe&&(ye=At(ye)),Ne(ye,F.FORBID_CONTENTS,We)),ct(F,"ADD_FORBID_CONTENTS")&&Ot(F.ADD_FORBID_CONTENTS)&&(ye===Xe&&(ye=At(ye)),Ne(ye,F.ADD_FORBID_CONTENTS,We)),Le&&(Q["#text"]=!0),_e&&Ne(Q,["html","head","body"]),Q.table&&(Ne(Q,["tbody"]),delete re.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw ns('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ns('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ae=S;S=F.TRUSTED_TYPES_POLICY;try{k=E("")}catch(Be){throw S=ae,Be}}else S===void 0&&F.TRUSTED_TYPES_POLICY!==null&&(S=pS(l,n)),S&&typeof k=="string"&&(k=E(""));(U.uponSanitizeElement.length>0||U.uponSanitizeAttribute.length>0)&&Q===W&&(Q=At(Q)),U.uponSanitizeAttribute.length>0&&M===G&&(M=At(M)),Ft&&Ft(F),Zt=F},Er=Ne({},[...pl,..._l,...iS]),Lr=Ne({},[...ml,...rS]),Qr=function(F){let Z=h(F);(!Z||!Z.tagName)&&(Z={namespaceURI:st,tagName:"template"});const ae=tn(F.tagName),Be=tn(Z.tagName);return yt[F.namespaceURI]?F.namespaceURI===Jt?Z.namespaceURI===ft?ae==="svg":Z.namespaceURI===Xt?ae==="svg"&&(Be==="annotation-xml"||gi[Be]):!!Er[ae]:F.namespaceURI===Xt?Z.namespaceURI===ft?ae==="math":Z.namespaceURI===Jt?ae==="math"&&vi[Be]:!!Lr[ae]:F.namespaceURI===ft?Z.namespaceURI===Jt&&!vi[Be]||Z.namespaceURI===Xt&&!gi[Be]?!1:!Lr[ae]&&(tr[ae]||!Er[ae]):!!(St==="application/xhtml+xml"&&yt[F.namespaceURI]):!1},Et=function(F){rs(t.removed,{element:F});try{h(F).removeChild(F)}catch{b(F)}},yi=function(F,Z){try{rs(t.removed,{attribute:Z.getAttributeNode(F),from:Z})}catch{rs(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(F),F==="is")if(le||X)try{Et(Z)}catch{}else try{Z.setAttribute(F,"")}catch{}},$i=function(F){let Z=null,ae=null;if(be)F="<remove></remove>"+F;else{const Ve=Od(F,/^[\r\n\t ]+/);ae=Ve&&Ve[0]}St==="application/xhtml+xml"&&st===ft&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const Be=S?E(F):F;if(st===ft)try{Z=new g().parseFromString(Be,St)}catch{}if(!Z||!Z.documentElement){Z=I.createDocument(st,"template",null);try{Z.documentElement.innerHTML=$t?k:Be}catch{}}const Ie=Z.body||Z.documentElement;return F&&ae&&Ie.insertBefore(i.createTextNode(ae),Ie.childNodes[0]||null),st===ft?N.call(Z,_e?"html":"body")[0]:_e?Z.documentElement:Ie},ir=function(F){return T.call(F.ownerDocument||F,F,o.SHOW_ELEMENT|o.SHOW_COMMENT|o.SHOW_TEXT|o.SHOW_PROCESSING_INSTRUCTION|o.SHOW_CDATA_SECTION,null)},Si=function(F){var Z,ae;F.normalize();const Be=T.call(F.ownerDocument||F,F,o.SHOW_TEXT|o.SHOW_COMMENT|o.SHOW_CDATA_SECTION|o.SHOW_PROCESSING_INSTRUCTION,null);let Ie=Be.nextNode();for(;Ie;){let lt=Ie.data;Tr([P,H,L],Pt=>{lt=ss(lt,Pt," ")}),Ie.data=lt,Ie=Be.nextNode()}const Ve=(Z=(ae=F.querySelectorAll)===null||ae===void 0?void 0:ae.call(F,"template"))!==null&&Z!==void 0?Z:[];Tr(Array.from(Ve),lt=>{Qt(lt.content)&&Si(lt.content)})},Ui=function(F){const Z=x?x(F):null;return typeof Z!="string"||We(Z)!=="form"?!1:typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||F.attributes!==u(F)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function"||F.nodeType!==v(F)||F.childNodes!==a(F)},Qt=function(F){if(!v||typeof F!="object"||F===null)return!1;try{return v(F)===Ai.documentFragment}catch{return!1}},Ti=function(F){if(!v||typeof F!="object"||F===null)return!1;try{return typeof v(F)=="number"}catch{return!1}};function Lt(ne,F,Z){Tr(ne,ae=>{ae.call(t,F,Z,Zt)})}const es=function(F){let Z=null;if(Lt(U.beforeSanitizeElements,F,null),Ui(F))return Et(F),!0;const ae=We(x?x(F):F.nodeName);if(Lt(U.uponSanitizeElement,F,{tagName:ae,allowedTags:Q}),ge&&F.hasChildNodes()&&!Ti(F.firstElementChild)&&bt(/<[/\w!]/g,F.innerHTML)&&bt(/<[/\w!]/g,F.textContent)||ge&&F.namespaceURI===ft&&ae==="style"&&Ti(F.firstElementChild)||F.nodeType===Ai.progressingInstruction||ge&&F.nodeType===Ai.comment&&bt(/<[/\w]/g,F.data))return Et(F),!0;if(re[ae]||!(me.tagCheck instanceof Function&&me.tagCheck(ae))&&!Q[ae]){if(!re[ae]&&Ae(ae)&&(V.tagNameCheck instanceof RegExp&&bt(V.tagNameCheck,ae)||V.tagNameCheck instanceof Function&&V.tagNameCheck(ae)))return!1;if(Le&&!ye[ae]){const Ie=h(F),Ve=a(F);if(Ve&&Ie){const lt=Ve.length;for(let Pt=lt-1;Pt>=0;--Pt){const Ut=y(Ve[Pt],!0);Ie.insertBefore(Ut,p(F))}}}return Et(F),!0}return(v?v(F):F.nodeType)===Ai.element&&!Qr(F)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&bt(/<\/no(script|embed|frames)/i,F.innerHTML)?(Et(F),!0):(ze&&F.nodeType===Ai.text&&(Z=F.textContent,Tr([P,H,L],Ie=>{Z=ss(Z,Ie," ")}),F.textContent!==Z&&(rs(t.removed,{element:F.cloneNode()}),F.textContent=Z)),Lt(U.afterSanitizeElements,F,null),!1)},rr=function(F,Z,ae){if(ie[Z]||se&&(Z==="id"||Z==="name")&&(ae in i||ae in zi))return!1;const Be=M[Z]||me.attributeCheck instanceof Function&&me.attributeCheck(Z,F);if(!(Re&&!ie[Z]&&bt(A,Z))){if(!(ue&&bt(j,Z))){if(!Be||ie[Z]){if(!(Ae(F)&&(V.tagNameCheck instanceof RegExp&&bt(V.tagNameCheck,F)||V.tagNameCheck instanceof Function&&V.tagNameCheck(F))&&(V.attributeNameCheck instanceof RegExp&&bt(V.attributeNameCheck,Z)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(Z,F))||Z==="is"&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&bt(V.tagNameCheck,ae)||V.tagNameCheck instanceof Function&&V.tagNameCheck(ae))))return!1}else if(!li[Z]){if(!bt(te,ss(ae,K,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&F!=="script"&&Nd(ae,"data:")===0&&Te[F])){if(!(xe&&!bt(z,ss(ae,K,"")))){if(ae)return!1}}}}}}return!0},ce=Ne({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ae=function(F){return!ce[tn(F)]&&bt(Y,F)},je=function(F){Lt(U.beforeSanitizeAttributes,F,null);const Z=F.attributes;if(!Z||Ui(F))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let Be=Z.length;for(;Be--;){const Ie=Z[Be],Ve=Ie.name,lt=Ie.namespaceURI,Pt=Ie.value,Ut=We(Ve),ts=Pt;let ht=Ve==="value"?ts:Y1(ts);if(ae.attrName=Ut,ae.attrValue=ht,ae.keepAttr=!0,ae.forceKeepAttr=void 0,Lt(U.uponSanitizeAttribute,F,ae),ht=ae.attrValue,ve&&(Ut==="id"||Ut==="name")&&Nd(ht,Ee)!==0&&(yi(Ve,F),ht=Ee+ht),ge&&bt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ht)){yi(Ve,F);continue}if(Ut==="attributename"&&Od(ht,"href")){yi(Ve,F);continue}if(ae.forceKeepAttr)continue;if(!ae.keepAttr){yi(Ve,F);continue}if(!pe&&bt(/\/>/i,ht)){yi(Ve,F);continue}ze&&Tr([P,H,L],Ns=>{ht=ss(ht,Ns," ")});const Os=We(F.nodeName);if(!rr(Os,Ut,ht)){yi(Ve,F);continue}if(S&&typeof l=="object"&&typeof l.getAttributeType=="function"&&!lt)switch(l.getAttributeType(Os,Ut)){case"TrustedHTML":{ht=E(ht);break}case"TrustedScriptURL":{ht=S.createScriptURL(ht);break}}if(ht!==ts)try{lt?F.setAttributeNS(lt,Ve,ht):F.setAttribute(Ve,ht),Ui(F)?Et(F):Pd(t.removed)}catch{yi(Ve,F)}}Lt(U.afterSanitizeAttributes,F,null)},Se=function(F){let Z=null;const ae=ir(F);for(Lt(U.beforeSanitizeShadowDOM,F,null);Z=ae.nextNode();)if(Lt(U.uponSanitizeShadowNode,Z,null),es(Z),je(Z),Qt(Z.content)&&Se(Z.content),(v?v(Z):Z.nodeType)===Ai.element){const Ie=c?c(Z):Z.shadowRoot;Qt(Ie)&&(De(Ie),Se(Ie))}Lt(U.afterSanitizeShadowDOM,F,null)},De=function(F){const Z=v?v(F):F.nodeType;if(Z===Ai.element){const Ie=c?c(F):F.shadowRoot;Qt(Ie)&&(De(Ie),Se(Ie))}const ae=a?a(F):F.childNodes;if(!ae)return;const Be=[];Tr(ae,Ie=>{rs(Be,Ie)});for(const Ie of Be)De(Ie);if(Z===Ai.element){const Ie=x?x(F):null;if(typeof Ie=="string"&&We(Ie)==="template"){const Ve=F.content;Qt(Ve)&&De(Ve)}}};return t.sanitize=function(ne){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,ae=null,Be=null,Ie=null;if($t=!ne,$t&&(ne="<!-->"),typeof ne!="string"&&!Ti(ne)&&(ne=eS(ne),typeof ne!="string"))throw ns("dirty is not a string, aborting");if(!t.isSupported)return ne;if(fe||wi(F),t.removed=[],typeof ne=="string"&&(Me=!1),Me){const Pt=x?x(ne):ne.nodeName;if(typeof Pt=="string"){const Ut=We(Pt);if(!Q[Ut]||re[Ut])throw ns("root node is forbidden and cannot be sanitized in-place")}if(Ui(ne))throw ns("root node is clobbered and cannot be sanitized in-place");De(ne)}else if(Ti(ne))Z=$i("<!---->"),ae=Z.ownerDocument.importNode(ne,!0),ae.nodeType===Ai.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?Z=ae:Z.appendChild(ae),De(ae);else{if(!le&&!ze&&!_e&&ne.indexOf("<")===-1)return S&&J?E(ne):ne;if(Z=$i(ne),!Z)return le?null:J?k:""}Z&&be&&Et(Z.firstChild);const Ve=ir(Me?ne:Z);for(;Be=Ve.nextNode();)es(Be),je(Be),Qt(Be.content)&&Se(Be.content);if(Me)return ze&&Si(ne),ne;if(le){if(ze&&Si(Z),X)for(Ie=D.call(Z.ownerDocument);Z.firstChild;)Ie.appendChild(Z.firstChild);else Ie=Z;return(M.shadowroot||M.shadowrootmode)&&(Ie=$.call(r,Ie,!0)),Ie}let lt=_e?Z.outerHTML:Z.innerHTML;return _e&&Q["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&bt(hS,Z.ownerDocument.doctype.name)&&(lt="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
156
+ `+lt),ze&&Tr([P,H,L],Pt=>{lt=ss(lt,Pt," ")}),S&&J?E(lt):lt},t.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wi(ne),fe=!0},t.clearConfig=function(){Zt=null,fe=!1},t.isValidAttribute=function(ne,F,Z){Zt||wi({});const ae=We(ne),Be=We(F);return rr(ae,Be,Z)},t.addHook=function(ne,F){typeof F=="function"&&rs(U[ne],F)},t.removeHook=function(ne,F){if(F!==void 0){const Z=K1(U[ne],F);return Z===-1?void 0:q1(U[ne],Z,1)[0]}return Pd(U[ne])},t.removeHooks=function(ne){U[ne]=[]},t.removeAllHooks=function(){U=Wd()},t}var _S=mm();const mS=/[^\n]*?(?:[。!?…]+|[.!?]+(?=\s|$)|\n+|$)/gu,gS=/[。!?…]$|[.!?]$/;function vS(e,t){for(let i=e.parentNode;i&&i!==t;i=i.parentNode){const r=i.nodeName;if(r==="PRE"||r==="SCRIPT"||r==="STYLE"||r==="CODE")return!0}return!1}function wS(e){if(!e)return[];if(e.querySelector("span.tts-sent"))return yS(e);const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:s=>s.nodeValue&&s.nodeValue.trim()&&!vS(s,e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),i=[];for(;t.nextNode();)i.push(t.currentNode);const r=[],n=[];let d=0;for(const s of i){const o=s.ownerDocument.createDocumentFragment();for(const f of s.nodeValue.matchAll(mS)){const g=f[0];if(g==="")continue;const l=s.ownerDocument.createElement("span");l.className="tts-sent",l.textContent=g,o.appendChild(l),(n[d]||(n[d]=[])).push(l),r[d]=(r[d]||"")+g,gS.test(g)&&d++}s.parentNode.replaceChild(o,s)}const _=[];return r.forEach((s,o)=>{const f=(s||"").replace(/\s+/g," ").trim();if(!f)return;const g=_.length;_.push(f);for(const l of n[o]||[])l.dataset.tts=String(g)}),_}function yS(e){const t=[];return e.querySelectorAll("span.tts-sent[data-tts]").forEach(i=>{const r=Number(i.dataset.tts);t[r]=(t[r]||"")+i.textContent}),t.map(i=>(i||"").replace(/\s+/g," ").trim())}const gm="tw_doc_rate",Po=[1,1.25,1.5],Vd=()=>{const e=Number(localStorage.getItem(gm));return Po.includes(e)?e:1};function SS(){const e=typeof window<"u"&&window.speechSynthesis||null,[t,i]=B.useState({playing:!1,paused:!1,idx:-1}),[r,n]=B.useState(Vd),d=B.useRef({sentences:[],idx:-1,playing:!1,rate:Vd()});d.current.rate=r;const _=()=>((e==null?void 0:e.getVoices())||[]).find(y=>/^zh/i.test(y.lang))||null,s=y=>{const b=d.current;if(!e)return;if(y<0||y>=b.sentences.length){o();return}b.idx=y,i({playing:!0,paused:!1,idx:y});const p=new SpeechSynthesisUtterance(b.sentences[y]);p.rate=b.rate;const a=_();a?(p.voice=a,p.lang=a.lang):p.lang="zh-CN";const h=()=>{b.playing&&b.idx===y&&s(y+1)};p.onend=h,p.onerror=h,e.speak(p)},o=()=>{const y=d.current;y.playing=!1,y.idx=-1,e&&e.cancel(),i({playing:!1,paused:!1,idx:-1})},f=y=>{if(!e||!y||!y.length)return;e.cancel();const b=d.current;if(b.sentences=y,b.playing=!0,b.idx=-1,i({playing:!0,paused:!1,idx:-1}),e.getVoices().length){s(0);return}const p=()=>{e.removeEventListener("voiceschanged",p),b.playing&&b.idx===-1&&s(0)};e.addEventListener("voiceschanged",p),setTimeout(p,300)},g=()=>{e&&d.current.playing&&(e.pause(),i(y=>({...y,paused:!0})))},l=()=>{e&&d.current.playing&&(e.resume(),i(y=>({...y,paused:!1})))},m=()=>{const y=Po[(Po.indexOf(r)+1)%Po.length]||1;localStorage.setItem(gm,String(y)),d.current.rate=y,n(y);const b=d.current;e&&b.playing&&b.idx>=0&&(e.cancel(),s(b.idx))};return B.useEffect(()=>()=>{d.current.playing=!1,e&&e.cancel()},[e]),{supported:!!e,playing:t.playing,paused:t.paused,idx:t.idx,rate:r,play:f,pause:g,resume:l,stop:o,cycleRate:m}}const Gd=6,bS=500,Kd=10,CS=300,qd=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function xS({url:e,name:t}){const[i,r]=B.useState({s:1,x:0,y:0}),[n,d]=B.useState(""),[_,s]=B.useState(!1),o=B.useRef(i);o.current=i;const f=B.useRef(null),g=B.useRef(null),l=B.useRef(null),m=B.useRef(new Map),y=B.useRef(null),b=B.useRef(null),p=B.useRef(null),a=B.useRef({moved:!1,lpFired:!1,pinched:!1}),h=B.useRef(0);if(!e)return C.jsx("div",{className:"doc-image-msg",children:O("imageviewer.loadFailed")});const c=(T,D,N)=>{const $=g.current,U=l.current;if(!$||!U)return{x:D,y:N};const P=Math.max(0,(U.offsetWidth*T-$.clientWidth)/2),H=Math.max(0,(U.offsetHeight*T-$.clientHeight)/2);return{x:Math.min(P,Math.max(-P,D)),y:Math.min(H,Math.max(-H,N))}},u=(T,D,N)=>{if(T=Math.min(Gd,Math.max(1,T)),T<=1){r({s:1,x:0,y:0});return}const $=c(T,D,N);r({s:T,x:$.x,y:$.y})},v=T=>u(o.current.s*T,o.current.x,o.current.y),x=()=>{p.current&&(clearTimeout(p.current),p.current=null)},S=T=>{d(T),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(""),2500)},k=()=>{s(!1);const T=document.createElement("a");T.href=e,T.download=t||"image",document.body.appendChild(T),T.click(),T.remove(),S(O("imageviewer.saved"))},w=async()=>{var T;s(!1);try{const D=await(await fetch(e)).blob(),N=new File([D],t||"image",{type:Aa(t)||D.type||"application/octet-stream"});if((T=navigator.canShare)!=null&&T.call(navigator,{files:[N]})){await navigator.share({files:[N]});return}}catch{return}S(O("imageviewer.shareUnsupported"))},E=T=>{var N,$;($=(N=T.currentTarget).setPointerCapture)==null||$.call(N,T.pointerId),m.current.set(T.pointerId,{x:T.clientX,y:T.clientY});const D=m.current.size;if(D===2){x(),a.current.pinched=!0;const[U,P]=[...m.current.values()];y.current={dist:qd(U,P)||1,s:o.current.s}}else D===1&&(a.current.moved=!1,a.current.lpFired=!1,a.current.pinched=!1,b.current={x:T.clientX,y:T.clientY},x(),p.current=setTimeout(()=>{p.current=null,m.current.size===1&&!a.current.moved&&(a.current.lpFired=!0,s(!0))},bS))},R=T=>{if(m.current.has(T.pointerId)){if(m.current.set(T.pointerId,{x:T.clientX,y:T.clientY}),m.current.size>=2&&y.current){const[D,N]=[...m.current.values()];u(y.current.s*(qd(D,N)/y.current.dist),o.current.x,o.current.y);return}if(b.current){const D=T.clientX-b.current.x,N=T.clientY-b.current.y;(Math.abs(D)>Kd||Math.abs(N)>Kd)&&(a.current.moved=!0,x()),o.current.s>1&&(b.current={x:T.clientX,y:T.clientY},u(o.current.s,o.current.x+D,o.current.y+N))}}},I=T=>{if(x(),m.current.delete(T.pointerId),m.current.size===1){y.current=null;const[D]=[...m.current.values()];b.current={x:D.x,y:D.y}}else if(m.current.size===0){if(!a.current.moved&&!a.current.lpFired&&!a.current.pinched){const N=T.timeStamp||0;N-h.current<CS?(h.current=0,o.current.s>1?u(1,0,0):u(2,0,0)):h.current=N}y.current=null,b.current=null,a.current={moved:!1,lpFired:!1,pinched:!1}}};return C.jsxs("div",{ref:g,className:"doc-image-wrap",onPointerDown:E,onPointerMove:R,onPointerUp:I,onPointerCancel:I,onContextMenu:T=>T.preventDefault(),children:[C.jsx("img",{ref:l,className:"doc-image",src:e,alt:t,draggable:!1,style:{transform:`translate(${i.x}px, ${i.y}px) scale(${i.s})`}}),C.jsxs("div",{className:"doc-image-zoom",onPointerDown:T=>T.stopPropagation(),children:[C.jsx("button",{onClick:()=>v(1/1.5),disabled:i.s<=1,"aria-label":O("imageviewer.zoomOut"),children:"−"}),C.jsxs("span",{className:"doc-image-zoom-val","aria-hidden":"true",children:[Math.round(i.s*100),"%"]}),C.jsx("button",{onClick:()=>v(1.5),disabled:i.s>=Gd,"aria-label":O("imageviewer.zoomIn"),children:"+"})]}),n&&C.jsx("div",{className:"doc-image-note",role:"status",children:n}),C.jsx(Eu,{open:_,title:t||O("imageviewer.imageTitle"),actions:[{key:"save",label:O("imageviewer.saveImage"),onClick:k},{key:"share",label:O("imageviewer.shareImage"),onClick:w}],onClose:()=>s(!1)})]})}const vl=Qi.length-1;function kS({type:e,name:t,content:i}){const[r,n]=B.useState(()=>b0()),d=B.useRef(null),_=SS();ku(_.playing&&!_.paused);const s=B.useMemo(()=>e==="markdown"?_S.sanitize(Ge.parse(i||"")):"",[e,i]);if(B.useEffect(()=>{_.stop()},[s]),B.useEffect(()=>{var y;const l=d.current;if(!l||(l.querySelectorAll(".tts-active").forEach(b=>b.classList.remove("tts-active")),_.idx<0))return;const m=l.querySelectorAll(`.tts-sent[data-tts="${_.idx}"]`);m.forEach(b=>b.classList.add("tts-active")),(y=m[0])==null||y.scrollIntoView({block:"center",behavior:"smooth"})},[_.idx]),e==="image")return C.jsx(xS,{url:i,name:t});if(e==="html")return C.jsx("iframe",{className:"doc-iframe",sandbox:"allow-scripts",srcDoc:i||"",title:t});const o=l=>{const m=Math.min(vl,Math.max(0,r+l));n(m),C0(m)};if(e==="text")return C.jsxs("div",{className:"doc-md-wrap",children:[C.jsx("div",{className:"doc-zoom",children:C.jsxs("div",{className:"doc-fonts",children:[C.jsx("button",{className:"doc-zoom-btn",onClick:()=>o(-1),disabled:r<=0,"aria-label":O("doc.fontSmaller"),children:"A−"}),C.jsx("button",{className:"doc-zoom-btn",onClick:()=>o(1),disabled:r>=vl,"aria-label":O("doc.fontLarger"),children:"A+"})]})}),C.jsx("pre",{className:"doc-text",style:{fontSize:`${Qi[r]}px`},children:i||""})]});const f=()=>{if(_.playing){_.paused?_.resume():_.pause();return}const l=wS(d.current);l.length&&_.play(l)},g=_.playing&&!_.paused;return C.jsxs("div",{className:"doc-md-wrap",children:[C.jsxs("div",{className:"doc-zoom",children:[_.supported&&C.jsxs("div",{className:"doc-tts",children:[C.jsx("button",{className:"doc-zoom-btn doc-zoom-icon",onClick:f,"aria-label":g?O("doc.pauseRead"):_.paused?O("doc.resumeRead"):O("doc.read"),children:g?C.jsx(ww,{}):C.jsx(vw,{})}),C.jsx("button",{className:"doc-zoom-btn doc-zoom-icon",onClick:_.stop,disabled:!_.playing,"aria-label":O("doc.stopRead"),children:C.jsx(yw,{})}),C.jsxs("button",{className:"doc-zoom-btn",onClick:_.cycleRate,"aria-label":O("doc.rate"),children:[_.rate,"×"]})]}),C.jsxs("div",{className:"doc-fonts",children:[C.jsx("button",{className:"doc-zoom-btn",onClick:()=>o(-1),disabled:r<=0,"aria-label":O("doc.fontSmaller"),children:"A−"}),C.jsx("button",{className:"doc-zoom-btn",onClick:()=>o(1),disabled:r>=vl,"aria-label":O("doc.fontLarger"),children:"A+"})]})]}),C.jsx("div",{ref:d,className:"doc-md",style:{fontSize:`${Qi[r]}px`},dangerouslySetInnerHTML:{__html:s}})]})}function ES({open:e,pane:t,windowId:i,tabs:r,active:n,onActivate:d,onCloseTab:_,onMinimize:s,onOpenDoc:o,pendingShare:f,onPendingConsumed:g}){const l=r.find(D=>D.key===n)||r[0],[m,y]=B.useState("recent"),[b,p]=B.useState(null),a=l.type==="home",h=B.useRef(null),c=B.useRef(b);c.current=b;const u=B.useRef(n);u.current=n;const v=B.useRef(i);v.current=i;const x=B.useRef(s);x.current=s;const S=B.useRef(d);S.current=d;const k=B.useRef(n),w=B.useRef(0),E=B.useRef([]),R=()=>{window.history.pushState({fileOverlay:!0},""),w.current+=1},I=D=>{e&&D!==c.current&&(E.current.push({prev:c.current}),R()),p(D),al(i,D)};B.useEffect(()=>{const D=k.current;k.current=n,e&&D==="home"&&n!=="home"&&R()},[n,e]),B.useEffect(()=>{if(!e)return;E.current=[],w.current=0,R();const D=()=>{var N,$;if(w.current=Math.max(0,w.current-1),u.current!=="home"){const U=u.current,P=U.slice(0,U.lastIndexOf("/"))||"/";(N=S.current)==null||N.call(S,"home"),y("browse"),p(P),al(v.current,P);return}if(E.current.length){const{prev:U}=E.current.pop();p(U),U&&al(v.current,U);return}($=x.current)==null||$.call(x)};return window.addEventListener("popstate",D),()=>{window.removeEventListener("popstate",D),w.current>0&&(window.history.go(-w.current),w.current=0)}},[e]);const T=async()=>{try{const{cwd:D}=await Vr(t);D&&p(D)}catch{}};return B.useEffect(()=>{f&&y("browse")},[f]),B.useEffect(()=>{if(!e){h.current=null;return}if(h.current===i)return;h.current=i,E.current=[],y("browse");let D=!1;return(async()=>{const N=a0(i);let $=null;if(N)try{await M_(N),$=N}catch{}if(!$&&t)try{const{cwd:U}=await Vr(t);$=U}catch{}!D&&$&&p($)})(),()=>{D=!0}},[e,i,t]),Ta.createPortal(C.jsxs("div",{className:`file-sheet ${e?"open":""}`,"aria-hidden":!e,children:[C.jsxs("div",{className:"file-tabs",children:[C.jsx("div",{className:"file-tabs-scroll",children:r.map(D=>C.jsxs("div",{className:`file-tab ${D.key===n?"active":""}`,children:[C.jsx("button",{className:"file-tab-label",onClick:()=>d(D.key),children:D.key==="home"?C.jsxs(C.Fragment,{children:[C.jsx(Mn,{}),O("filemanager.files")]}):D.name}),D.key!=="home"&&C.jsx("button",{className:"file-tab-x","aria-label":O("filemanager.closeTab"),onClick:()=>_(D.key),children:"✕"})]},D.key))}),C.jsx("button",{className:"file-min","aria-label":O("filemanager.minimize"),title:O("filemanager.minimize"),onClick:s,children:C.jsx(In,{})})]}),C.jsx("div",{className:"file-body",children:a?C.jsxs("div",{className:"home-pane",children:[C.jsxs("div",{className:"file-seg",role:"tablist",children:[C.jsxs("button",{className:`file-seg-btn ${m==="recent"?"on":""}`,role:"tab","aria-selected":m==="recent",onClick:()=>y("recent"),children:[C.jsx(dw,{}),O("filemanager.recent")]}),C.jsxs("button",{className:`file-seg-btn ${m==="browse"?"on":""}`,role:"tab","aria-selected":m==="browse",onClick:()=>y("browse"),children:[C.jsx(Mn,{}),O("filemanager.directory")]})]}),m==="recent"?C.jsx(r1,{onOpenDoc:o}):C.jsx(em,{path:b,onNavigate:I,onOpenDoc:o,onJumpToCwd:t?T:null,pendingFile:f,onPendingConsumed:g})]}):C.jsx(kS,{type:l.type,name:l.name,content:l.content})})]}),document.body)}function LS(e){if(!e)return[];const t=[];let i=null,r=null;for(const n of e.split(`
157
+ `)){if(n.startsWith("diff --git")){const _=n.match(/ b\/(.*)$/);i={path:_?_[1]:n.slice(11),hunks:[]},t.push(i),r=null;continue}if(!i)continue;if(n.startsWith("@@")){r={header:n,lines:[]},i.hunks.push(r);continue}if(!r)continue;const d=n[0];d==="+"?r.lines.push({type:"add",text:n.slice(1)}):d==="-"?r.lines.push({type:"del",text:n.slice(1)}):d===" "&&r.lines.push({type:"ctx",text:n.slice(1)})}return t}const RS=e=>String(e||"").replace(/\/+$/,"").split("/").pop()||e;function da(e,t){const i=(e&&e!==" "?e:t)||"?";return i==="?"?"?":i}function TS({open:e,pane:t,windowId:i,inset:r=0,onClose:n}){const d=B.useRef(!0);B.useEffect(()=>()=>{d.current=!1},[]);const[_,s]=B.useState([]),[o,f]=B.useState(null),[g,l]=B.useState([]),m=g.length?g[g.length-1]:null,[y,b]=B.useState(!1),[p,a]=B.useState(null),[h,c]=B.useState(null),[u,v]=B.useState(null),[x,S]=B.useState(null),[k,w]=B.useState(null),[E,R]=B.useState(20),[I,T]=B.useState(!1),[D,N]=B.useState({changes:!0,commits:!0}),[$,U]=B.useState(!1),P=B.useRef(null),[H,L]=B.useState(null),[A,j]=B.useState(null),z=B.useRef(g);z.current=g;const K=B.useRef(y);K.current=y;const Y=B.useRef(n);Y.current=n;const te=B.useRef(0),Q=()=>{window.history.pushState({gitOverlay:!0},""),te.current+=1},W=J=>{Q(),l(se=>[...se,J])},M=()=>{Q(),b(!0)};B.useEffect(()=>{if(!e)return;Q();const J=()=>{var se;if(te.current=Math.max(0,te.current-1),K.current){b(!1);return}if(z.current.length){l(ve=>ve.slice(0,-1));return}(se=Y.current)==null||se.call(Y)};return window.addEventListener("popstate",J),()=>{window.removeEventListener("popstate",J),te.current>0&&(window.history.go(-te.current),te.current=0)}},[e]),B.useEffect(()=>{if(!e)return;let J=!1;l([]),w(null),j(null);const se=bu(i);return se.length?(s(se),f(ve=>ve&&se.includes(ve)?ve:se[0]),()=>{J=!0}):(s([]),f(null),(async()=>{try{if(!t)return;const{cwd:ve}=await Vr(t);if(!ve)return;const{repos:Ee=[]}=await ld(ve);if(J||!Ee.length)return;const Le=ad(i,Ee.map(Me=>Me.path));if(J)return;s(Le),f(Le[0]??null)}catch{J||j(O("git.errReadRepo"))}})(),()=>{J=!0})},[e,t,i]),B.useEffect(()=>{if(!e||!t)return;let J=!1;return Vr(t).then(({cwd:se})=>{!J&&se&&a(se)}).catch(()=>{}),()=>{J=!0}},[e,t]),B.useEffect(()=>{if(!e||!o){c(null),v(null);return}let J=!1;return c(null),v(null),S(null),w(null),R(20),j(null),(async()=>{try{const[se,ve]=await Promise.all([X0(o),Z0(o)]);if(J)return;c(se.changes??[]),v(ve.branches??[])}catch{J||j(O("git.errLoad"))}})(),()=>{J=!0}},[e,o]),B.useEffect(()=>{if(!e||!o){S(null);return}let J=!1;return(async()=>{try{const{commits:se=[]}=await J0(o,{ref:k||void 0,limit:E});J||S(se)}catch{J||S([])}finally{J||T(!1)}})(),()=>{J=!0}},[e,o,k,E]);const G=!o||!m?"":m.kind==="diff"?`${o}|diff|${m.path}|${m.commit||""}|${m.staged?1:0}`:`${o}|commit|${m.hash}`;B.useEffect(()=>{if(!e||!o||!m){L(null);return}let J=!1;return j(null),L(null),(async()=>{try{let se;if(m.kind==="diff"){const{diff:ve,truncated:Ee}=await Q0(o,{path:m.path,commit:m.commit,staged:m.staged});se={files:LS(ve),truncated:Ee}}else se=await ew(o,m.hash);J||L({key:G,payload:se})}catch{J||j(O("git.errLoad"))}})(),()=>{J=!0}},[e,G]);const V=B.useCallback(()=>{window.history.back()},[]),re=J=>{f(J),l([]),w(null)},ie=async J=>{window.history.back();try{const{repos:se=[]}=await ld(J);if(!d.current)return;if(!se.length){j(O("git.errNoRepoInDir"));return}const ve=ad(i,se.map(Le=>Le.path));s(ve);const Ee=se.map(Le=>Le.path).find(Le=>!_.includes(Le))||se[0].path;re(Ee)}catch{d.current&&j(O("git.errReadDir"))}},me=J=>{const se=D0(i,J);s(se),o===J&&(f(se[0]??null),l([]),w(null))},ue=(u||[]).find(J=>J.current)||null,Re=J=>{const se=J===(ue==null?void 0:ue.name)?null:J;se!==k&&(w(se),S(null),R(20))},xe=J=>N(se=>({...se,[J]:!se[J]})),pe=x!=null&&x.length>=E,ze=J=>{if(!pe||I)return;const se=J.currentTarget;se.scrollHeight-se.scrollTop-se.clientHeight<80&&(T(!0),R(ve=>ve+20))},ge=k||(ue==null?void 0:ue.name)||null,_e=!!k&&k!==(ue==null?void 0:ue.name),fe=k?(u||[]).find(J=>J.name===k):ue,be=H&&H.key===G?H.payload:null,le=!!m,X=(m==null?void 0:m.kind)==="commit"?O("git.commitDetail"):(m==null?void 0:m.kind)==="diff"?m.path||O("git.diff"):"";return Ta.createPortal(C.jsxs("div",{className:`file-sheet git-sheet ${e?"open":""}`,"aria-hidden":!e,style:{"--kb-inset":`${r}px`},children:[C.jsxs("div",{className:"file-tabs git-head",children:[le?C.jsxs("div",{className:"git-drill-head",children:[C.jsx("button",{className:"git-back","aria-label":O("common.back"),title:O("common.back"),onClick:V,children:"‹"}),C.jsxs("span",{className:"git-drill-title",children:[C.jsx(B_,{}),C.jsx("span",{className:"git-title-text",children:X})]})]}):C.jsxs("div",{className:"git-tabs-scroll",children:[C.jsx("button",{className:"git-tab-add","aria-label":O("git.bindRepo"),title:O("git.bindRepo"),onClick:M,children:"+"}),_.map(J=>C.jsxs("div",{className:`git-tab ${J===o?"active":""}`,children:[C.jsx("button",{className:"git-tab-label",onClick:()=>re(J),children:RS(J)}),C.jsx("button",{className:"git-tab-x","aria-label":O("common.close"),title:O("common.close"),onClick:()=>me(J),children:"✕"})]},J))]}),C.jsx("button",{className:"file-min","aria-label":O("git.collapse"),title:O("git.collapse"),onClick:()=>n==null?void 0:n(),children:C.jsx(In,{})})]}),!le&&o&&C.jsxs("div",{className:"git-branch-bar",children:[C.jsxs("span",{className:"git-branch-bar-name",children:[C.jsx("span",{className:"git-branch-glyph",children:"⎇"})," ",ge||"—",!_e&&ge&&C.jsx("span",{className:"git-branch-cur-tag",children:O("git.currentBranch")}),fe&&(fe.ahead||fe.behind)?C.jsxs("span",{className:"git-branch-bar-track",children:[fe.ahead?C.jsxs("span",{className:"git-ahead",children:["↑",fe.ahead]}):null,fe.behind?C.jsxs("span",{className:"git-behind",children:["↓",fe.behind]}):null]}):null]}),C.jsxs("div",{className:"git-branch-dd",children:[C.jsxs("button",{className:`git-branch-trigger ${_e?"other":""}`,onClick:()=>U(J=>!J),"aria-haspopup":"listbox","aria-expanded":$,title:O("git.switchViewedBranch"),children:[C.jsx("span",{className:"git-branch-trigger-name",children:O("git.switchBranch")}),C.jsx("span",{className:"git-branch-caret",children:C.jsx(In,{})})]}),$&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"git-dd-backdrop",onClick:()=>U(!1)}),C.jsxs("div",{className:"git-dd-menu",role:"listbox",children:[(u||[]).length===0&&C.jsx("div",{className:"git-empty",children:O("git.noBranches")}),(u||[]).map(J=>{const se=k?J.name===k:J.current;return C.jsxs("button",{role:"option","aria-selected":se,className:`git-dd-item ${J.current?"current":""} ${se?"viewing":""}`,onClick:()=>{Re(J.name),U(!1)},children:[C.jsx("span",{className:"git-branch-dot",children:J.current?"●":""}),C.jsx("span",{className:"git-row-path",children:J.name}),J.upstream&&C.jsxs("span",{className:"git-branch-up",children:[J.upstream,J.ahead?C.jsxs("span",{className:"git-ahead",children:[" ↑",J.ahead]}):null,J.behind?C.jsxs("span",{className:"git-behind",children:[" ↓",J.behind]}):null]})]},J.name)})]})]})]})]}),C.jsxs("div",{className:"git-body",children:[A&&C.jsx("div",{className:"git-error",children:A}),!o&&!A&&C.jsx("div",{className:"git-empty",children:O("git.noRepoBound")}),le&&o&&!A&&C.jsx("div",{className:"git-scroll",children:be?m.kind==="diff"?C.jsx(IS,{data:be}):C.jsx(MS,{data:be,onOpenFile:J=>W({kind:"diff",path:J,commit:m.hash})}):C.jsx("div",{className:"git-loading",children:O("common.loading")})}),!le&&o&&!A&&C.jsxs(C.Fragment,{children:[C.jsx(Yd,{variant:"top",title:O("git.changes"),count:h==null?void 0:h.length,expanded:D.changes,onToggle:()=>xe("changes"),children:h==null?C.jsx("div",{className:"git-loading",children:O("common.loading")}):C.jsx(DS,{data:{changes:h},onOpenFile:(J,se)=>W({kind:"diff",path:J,staged:se})})}),C.jsx(Yd,{variant:"mid",title:O("git.commits"),subtitle:_e?ge:null,expanded:D.commits,onToggle:()=>xe("commits"),bodyRef:P,onScroll:ze,children:x==null?C.jsx("div",{className:"git-loading",children:O("common.loading")}):C.jsxs(C.Fragment,{children:[C.jsx(AS,{data:{commits:x},onOpen:J=>W({kind:"commit",hash:J})}),pe&&C.jsx("div",{className:"git-more",children:O(I?"common.loading":"git.pullToLoadMore")})]})})]})]}),C.jsx(Fn,{open:y,seedCwd:p,pane:t,inset:r,hint:O("git.pickerHint"),onPick:ie,onClose:()=>window.history.back()})]}),document.body)}function Yd({variant:e,title:t,subtitle:i,count:r,expanded:n,onToggle:d,onScroll:_,bodyRef:s,children:o}){return C.jsxs("div",{className:`git-section git-section--${e} ${n?"open":""}`,children:[C.jsxs("button",{className:"git-section-head",onClick:d,"aria-expanded":n,children:[C.jsx("span",{className:"git-section-caret",children:C.jsx(In,{})}),C.jsx("span",{className:"git-section-title",children:t}),i&&C.jsx("span",{className:"git-section-sub",children:i}),r!=null&&C.jsx("span",{className:"git-section-count",children:r})]}),n&&C.jsx("div",{className:"git-section-body",ref:s,onScroll:_,children:o})]})}function DS({data:e,onOpenFile:t}){const i=(e==null?void 0:e.changes)??[];return i.length?C.jsx("div",{className:"git-list",children:i.map((r,n)=>{const d=!!(r.x&&r.x!==" "&&r.x!=="?");return C.jsxs("button",{className:"git-row",onClick:()=>t(r.path,d),children:[C.jsx("span",{className:`git-badge git-badge-${da(r.x,r.y).toLowerCase().replace("?","q")}`,children:da(r.x,r.y)}),C.jsx("span",{className:"git-row-path",children:r.path})]},`${r.path}-${n}`)})}):C.jsx("div",{className:"git-empty",children:O("git.cleanTree")})}function AS({data:e,onOpen:t}){const i=(e==null?void 0:e.commits)??[];return i.length?C.jsx("div",{className:"git-list",children:i.map(r=>C.jsxs("button",{className:"git-row git-commit-row",onClick:()=>t(r.hash),children:[C.jsx("span",{className:"git-hash",children:r.short}),C.jsxs("span",{className:"git-commit-main",children:[C.jsx("span",{className:"git-row-path",children:r.subject}),C.jsxs("span",{className:"git-commit-meta",children:[r.author," · ",r.relDate]})]})]},r.hash))}):C.jsx("div",{className:"git-empty",children:O("git.noCommits")})}function MS({data:e,onOpenFile:t}){if(!e)return null;const i=e.files??[];return C.jsxs("div",{className:"git-commit-detail",children:[e.message&&C.jsx("pre",{className:"git-commit-msg",children:e.message}),C.jsx("div",{className:"git-list",children:i.map((r,n)=>C.jsxs("button",{className:"git-row",onClick:()=>t(r.path),children:[C.jsx("span",{className:`git-badge git-badge-${da(r.x,r.y).toLowerCase().replace("?","q")}`,children:da(r.x,r.y)}),C.jsx("span",{className:"git-row-path",children:r.path})]},`${r.path}-${n}`))})]})}const Xd=Qi.length-1;function IS({data:e}){const[t,i]=B.useState(()=>k0()),r=d=>{const _=Math.min(Xd,Math.max(0,t+d));i(_),E0(_)};if(!e)return null;const n=e.files??[];return n.length?C.jsxs("div",{className:"git-diff-wrap",style:{fontSize:`${Qi[t]}px`},children:[C.jsxs("div",{className:"git-diff-zoom",children:[C.jsx("button",{className:"doc-zoom-btn",onClick:()=>r(-1),disabled:t<=0,"aria-label":O("git.fontSmaller"),children:"A−"}),C.jsx("button",{className:"doc-zoom-btn",onClick:()=>r(1),disabled:t>=Xd,"aria-label":O("git.fontLarger"),children:"A+"})]}),e.truncated&&C.jsx("div",{className:"git-diff-trunc",children:O("git.diffTruncated")}),n.map((d,_)=>C.jsxs("div",{className:"git-diff-file",children:[n.length>1&&C.jsx("div",{className:"git-diff-fname",children:d.path}),C.jsx("div",{className:"git-diff",children:d.hunks.map((s,o)=>C.jsxs("div",{className:"git-diff-hunk-block",children:[C.jsx("div",{className:"git-diff-line git-diff-hunk",children:s.header}),s.lines.map((f,g)=>C.jsxs("div",{className:`git-diff-line git-diff-${f.type}`,children:[f.type==="add"?"+":f.type==="del"?"-":" ",f.text]},g))]},o))})]},`${d.path}-${_}`))]}):C.jsx("div",{className:"git-empty",children:O("git.noDiff")})}const wo=8,Jd=12;function PS({path:e,x:t,y:i,onOpen:r,onClose:n}){const d=e.split("/").filter(Boolean).pop()||e,_=B.useRef(null),[s,o]=B.useState(null);return B.useLayoutEffect(()=>{const f=_.current;if(!f)return;const g=f.offsetWidth,l=f.offsetHeight,m=window.innerWidth,y=window.innerHeight,b=Math.min(Math.max(t-g/2,wo),m-g-wo);let p=i+Jd;p+l>y-wo&&(p=Math.max(wo,i-Jd-l)),o({left:b,top:p})},[t,i,e]),C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"doclink-backdrop",onClick:n}),C.jsxs("div",{ref:_,className:"doclink-pop",style:s?{left:s.left,top:s.top}:{left:0,top:0,visibility:"hidden"},role:"dialog","aria-label":O("doclink.title"),children:[C.jsxs("div",{className:"doclink-name",children:[C.jsx(Mn,{}),d]}),C.jsx("div",{className:"doclink-path",children:e}),C.jsxs("div",{className:"doclink-actions",children:[C.jsx("button",{className:"doclink-cancel",onClick:n,children:O("common.cancel")}),C.jsx("button",{className:"doclink-open",onClick:()=>r(e),children:O("common.open")})]})]})]})}const OS=()=>`${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;function NS(e){const t=(e??"").trim();return t?{id:OS(),text:t}:null}function BS(e,t,i){const r=[...e];if(t<0||t>=r.length||i<0||i>=r.length||t===i)return r;const[n]=r.splice(t,1);return r.splice(i,0,n),r}function jS({open:e,session:t,window:i,onClose:r,onSend:n,onCountChange:d}){const[_,s]=B.useState([]),[o,f]=B.useState(""),[g,l]=B.useState(null),[m,y]=B.useState(null),b=B.useRef(null),p=B.useRef({head:"",tail:""}),a=B.useRef(null),h=B.useRef(!1),c=B.useRef({active:!1}),u=L=>{od(t,i,L),s(L),d==null||d(L.length)},v=L=>{L&&(L.style.height="auto",L.style.height=`${L.scrollHeight+2}px`)};B.useEffect(()=>{if(!e)return;const L=D_(t,i);s(L),d==null||d(L.length),f(""),l(null)},[e,t,i]);const S=J_({onText:L=>{if(h.current){h.current=!1;return}const{head:A,tail:j}=p.current;f(A+L+j),a.current=A.length+L.length}}),k=Q_(),w=S.state==="recording"||S.state==="finalizing";ku(w),B.useEffect(()=>{if(S.state!=="recording"&&S.state!=="finalizing"||h.current)return;const{head:L,tail:A}=p.current;f(L+S.partial+A),a.current=L.length+S.partial.length},[S.partial,S.state]),B.useLayoutEffect(()=>{const L=b.current;if(!L||(v(L),a.current==null))return;const A=a.current;if(a.current=null,document.activeElement===L)try{L.setSelectionRange(A,A)}catch{}},[o]);const E=()=>{if(w){S.stop();return}const L=b.current,A=L?L.selectionStart:o.length;p.current={head:o.slice(0,A),tail:o.slice(A)},S.start()},R=()=>{w&&(h.current=!0,S.stop())},I=()=>{R();const L=o.trim();if(L){if(g)u(_.map(A=>A.id===g?{...A,text:L}:A));else{const A=NS(L);A&&u([..._,A])}f(""),l(null)}},T=L=>{l(L.id),f(L.text),requestAnimationFrame(()=>{var A;return(A=b.current)==null?void 0:A.focus()})},D=()=>{l(null),f("")},N=L=>{u(_.filter(A=>A.id!==L)),L===g&&D()},$=(L,A)=>{var j,z;L.cancelable&&L.preventDefault(),(z=(j=L.currentTarget).setPointerCapture)==null||z.call(j,L.pointerId),c.current={active:!0,pointerId:L.pointerId,id:A},y(A)},U=L=>{var Y;const A=c.current;if(!A.active||L.pointerId!==A.pointerId)return;const j=(Y=L.currentTarget.closest(".idea-list"))==null?void 0:Y.querySelectorAll("[data-idea]");if(!j||!j.length)return;const z=L.clientY;let K=j.length-1;for(let te=0;te<j.length;te++){const Q=j[te].getBoundingClientRect();if(z<Q.top+Q.height/2){K=te;break}}s(te=>{const Q=te.findIndex(W=>W.id===A.id);return Q<0||Q===K?te:BS(te,Q,K)})},P=L=>{const A=c.current;!A.active||L.pointerId!==A.pointerId||(c.current={active:!1},y(null),s(j=>(od(t,i,j),j)))};if(!e)return null;const H=g!=null;return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"cmd-backdrop",onClick:r}),C.jsxs("div",{className:"idea-panel",role:"dialog","aria-label":O("idea.title"),children:[C.jsxs("div",{className:"cmd-head",children:[C.jsxs("span",{className:"cmd-title",children:[O("idea.title"),i?` · ${i}`:"",_.length>0&&C.jsx("span",{className:"idea-head-count",children:_.length})]}),C.jsx("button",{className:"cmd-close",onClick:r,"aria-label":O("common.close"),children:"✕"})]}),C.jsxs("div",{className:`idea-compose${w?" recording":""}`,children:[C.jsx("textarea",{ref:b,className:"idea-input",rows:1,placeholder:O(H?"idea.editPlaceholder":"idea.addPlaceholder"),value:o,readOnly:w,onChange:L=>f(L.target.value)}),H&&C.jsx("button",{className:"idea-cancel",onClick:D,children:O("common.cancel")}),k&&C.jsx(X_,{active:w,disabled:S.state==="requesting",onToggle:E}),C.jsx("button",{className:"idea-act",onClick:I,disabled:!o.trim(),"aria-label":O(H?"common.save":"idea.add"),children:H?C.jsx(hw,{}):C.jsx(N_,{})})]}),C.jsx("div",{className:"idea-list",children:_.length===0?C.jsx("div",{className:"cmd-empty",children:O("idea.empty")}):_.map(L=>C.jsxs("div",{"data-idea":L.id,className:`idea-row${L.id===m?" dragging":""}${L.id===g?" editing":""}`,children:[C.jsx("button",{type:"button",className:"idea-handle","aria-label":O("idea.dragSort"),onPointerDown:A=>$(A,L.id),onPointerMove:U,onPointerUp:P,onPointerCancel:P,children:"≡"}),C.jsx("span",{className:"idea-text",onClick:()=>T(L),children:L.text}),C.jsx("button",{className:"idea-send",onClick:()=>n==null?void 0:n(L.text),"aria-label":O("idea.fillInput"),children:O("idea.send")}),C.jsx("button",{className:"idea-del",onClick:()=>N(L.id),"aria-label":O("common.delete"),children:"✕"})]},L.id))})]})]})}function FS({open:e,onClose:t}){return e?C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"cmd-backdrop",onClick:t}),C.jsxs("div",{className:"changelog-panel",role:"dialog","aria-label":O("changelog.title"),children:[C.jsxs("div",{className:"cmd-head",children:[C.jsx("span",{className:"cmd-title",children:O("changelog.title")}),C.jsx("button",{className:"cmd-close",onClick:t,"aria-label":O("common.close"),children:"✕"})]}),C.jsx("div",{className:"changelog-list",children:A_.map(i=>{const r=i.items[hc()]||i.items.en||i.items.zh||[];return C.jsxs("div",{className:"rel",children:[C.jsx("div",{className:"rel-date",children:i.date}),C.jsx("ul",{className:"rel-items",children:r.map((n,d)=>C.jsx("li",{children:n},d))})]},i.v)})})]})]}):null}function HS(){const[e,t]=B.useState(0);return B.useEffect(()=>{const i=window.visualViewport;if(!i)return;const r=()=>{const n=window.innerHeight-i.height-i.offsetTop;t(Math.max(0,Math.round(n)))};return r(),i.addEventListener("resize",r),i.addEventListener("scroll",r),()=>{i.removeEventListener("resize",r),i.removeEventListener("scroll",r)}},[]),e}function Zd(e){history.replaceState(null,"",`#${encodeURIComponent(e)}`)}const yo=e=>{try{return decodeURIComponent(e)}catch{return e}};function Qd(){const e=location.hash.replace(/^#/,""),t=e.match(/^\/s\/([^/]*)\/w\/([^/]*)\/p\/(.*)$/);return t?{session:yo(t[1]),window:yo(t[2]),pane:yo(t[3])}:{session:yo(e)||null,window:null,pane:null}}const zS="tmw-share-v1",$S="/__share__/";function US(e=typeof location<"u"?location.search:""){try{return new URLSearchParams(e).has("share")}catch{return!1}}function WS(){if(typeof location>"u"||typeof history>"u")return;const e=new URL(location.href);e.searchParams.delete("share"),history.replaceState(null,"",e.pathname+e.search+e.hash)}async function VS(){if(typeof caches>"u")return null;let e;try{e=await caches.open(zS)}catch{return null}const t=await e.keys();if(!t.length)return null;const i=t[t.length-1],r=await e.match(i);if(await e.delete(i),!r)return null;const n=await r.blob();let d="shared";try{d=decodeURIComponent(new URL(i.url).pathname.slice($S.length))||"shared"}catch{}return new File([n],d,{type:n.type||r.headers.get("Content-Type")||""})}const Ys=(e,t)=>t&&e.some(i=>i.id===t)?t:e[0].id;function GS(){var ae,Be,Ie,Ve,lt,Pt,Ut,ts,ht,Os,Ns,Pu,Ou,Nu,Bu,ju,Fu,Hu;const[e,t]=B.useState(!Xr()),[i,r]=B.useState(!1),[n,d]=B.useState(!1),[_,s]=B.useState(!1),[o,f]=B.useState(!1),[g,l]=B.useState(null),[m,y]=B.useState(null),[b,p]=B.useState(!1),[a,h]=B.useState(!1),[c,u]=B.useState(null),[v,x]=B.useState(null),[S,k]=B.useState(null),[w,E]=B.useState(null),R=$w(),[I,T]=B.useState(Wr),[D,N]=B.useState(oa),[$,U]=B.useState([]),[P,H]=B.useState(null),[L,A]=B.useState([]),[j,z]=B.useState(null),[K,Y]=B.useState(!1),[te,Q]=B.useState(!1),[W,M]=B.useState(!0),[G,V]=B.useState({}),[re,ie]=B.useState(!1),{status:me,enable:ue}=qy(),[Re,xe]=B.useState(!1),[pe,ze]=B.useState(0),[ge,_e]=B.useState(!1),[fe,be]=B.useState(L0),[le,X]=B.useState(ed),[J,se]=B.useState(o0),ve=B.useRef(null),Ee=B.useRef(null),Le=B.useRef(null),Me=B.useRef(null),de=B.useCallback(()=>t(!0),[]),ye=B.useCallback(async()=>{try{const q=await rw();A(q.previews||[]),z(q.domain??null),Y(!!q.dynamicEnabled)}catch{}},[]);B.useEffect(()=>{ye()},[ye]);const Xe=P?nw({session:(ae=P.session)==null?void 0:ae.name,windowName:(Be=P.window)==null?void 0:Be.name,windowId:(Ie=P.window)==null?void 0:Ie.id}):null,Te=L.find(q=>q.name===Xe&&q.expiresAt>Date.now())||null,Yt=(Te==null?void 0:Te.expiresAt)??null,li=!!Te;B.useEffect(()=>{li||Q(!1)},[li]),B.useEffect(()=>{if(Yt==null)return;const q=setTimeout(ye,Math.max(0,Yt-Date.now())+500);return()=>clearTimeout(q)},[Yt,ye]);const Ze=B.useCallback(()=>{n?(d(!1),requestAnimationFrame(()=>Q(!0))):Q(!0)},[n]),Xt=B.useCallback(async q=>{var ee;if(Xe)try{await ll(Xe,{dir:q}),c0((ee=P==null?void 0:P.window)==null?void 0:ee.id,q),await ye(),Ze()}catch{}},[Xe,(Ve=P==null?void 0:P.window)==null?void 0:Ve.id,ye,Ze]),Jt=B.useCallback(async q=>{Xe&&(await ll(Xe,{port:q}),await ye(),Ze())},[Xe,ye,Ze]),ft=B.useCallback(async()=>{if(Xe)try{await sw(Xe),await ye()}catch{}},[Xe,ye]),st=B.useCallback(async()=>{if(!Te)return;const q=Te.kind==="dynamic"?{port:Te.port}:{dir:Te.dir};try{await ll(Te.name,q),await ye()}catch{}},[Te==null?void 0:Te.name,Te==null?void 0:Te.kind,Te==null?void 0:Te.dir,Te==null?void 0:Te.port,ye]),$t=B.useCallback(()=>{r0(),d(!1),s(!1),r(!1),H(null),M(!0),t(!0)},[]),yt=HS();Mi(te,()=>Q(!1)),Mi(i,()=>r(!1)),Mi(re,()=>ie(!1)),Mi(_,()=>s(!1)),Mi(o,()=>f(!1)),Mi(Re,()=>xe(!1)),Mi(!!v,()=>x(null)),Mi(n||ge,()=>{ge?_e(!1):d(!1)}),Mi(!!m||!!g,()=>{g?l(null):y(null)});const Zr=B.useCallback(async q=>{var he,Ce;const ee=P==null?void 0:P.paneId;if(ee)try{await P0(ee,[q]),(Ce=(he=ve.current)==null?void 0:he.wake)==null||Ce.call(he)}catch(ke){ke instanceof it&&de()}},[P,de]),gi=B.useCallback(async q=>{var he,Ce;const ee=P==null?void 0:P.paneId;if(ee)try{await fc(ee,q,!1),(Ce=(he=ve.current)==null?void 0:he.wake)==null||Ce.call(he)}catch(ke){ke instanceof it&&de()}},[P,de]),vi=B.useCallback(async q=>{var ke,Pe,Oe,He,ei;const ee=(ke=P==null?void 0:P.window)==null?void 0:ke.id,he=Le.current??((Oe=(Pe=ve.current)==null?void 0:Pe.getSize())==null?void 0:Oe.cols);if(!ee||!he)return;const Ce=Math.max(20,Math.min(500,he+q));Le.current=Ce,(ei=(He=ve.current)==null?void 0:He.flash)==null||ei.call(He);try{Me.current==null&&(Me.current=await B0(ee).then(Rt=>Rt.layout||"").catch(()=>"")),P.panes&&P.panes.length>1?await N0(P.paneId,Ce):await O0(ee,Ce)}catch(Rt){Rt instanceof it&&de()}},[P,de]),tr=B.useCallback(async()=>{var he;const q=(he=P==null?void 0:P.window)==null?void 0:he.id;if(!q)return;const ee=Me.current;Le.current=null,Me.current=null;try{await j0(q,ee)}catch(Ce){Ce instanceof it&&de()}},[P,de]),St=B.useCallback(async(q,ee=null)=>{var Oe;const he=await Gs(q.id);if(!he.length)return!1;const Ce=(ee==null?void 0:ee.window)&&he.find(He=>He.id===ee.window)||he.find(He=>He.id===Ys(he,h0(q.id))),ke=await ho(Ce.id);if(!ke.length)return!1;const Pe=ee!=null&&ee.pane&&ke.some(He=>He.id===ee.pane)?ee.pane:Ys(ke,co(Ce.id));return H({session:q,windows:he,window:Ce,panes:ke,paneId:Pe}),Vs({sessionId:q.id,windowId:Ce.id,paneId:Pe}),Zd(q.name),Le.current=((Oe=ke.find(He=>He.id===Pe))==null?void 0:Oe.width)??null,Me.current=null,!0},[]),xr=B.useCallback(async q=>{var ee;try{const he=await ho(q.id);if(!he.length)return;const Ce=Ys(he,co(q.id));H(ke=>ke&&{...ke,window:q,panes:he,paneId:Ce}),Vs({sessionId:P.session.id,windowId:q.id,paneId:Ce}),Le.current=((ee=he.find(ke=>ke.id===Ce))==null?void 0:ee.width)??null,Me.current=null}catch(he){he instanceof it&&de()}},[P,de]),kr=B.useCallback(async(q,ee,he)=>{var Pe,Oe,He,ei;const Ce=(Pe=P==null?void 0:P.session)==null?void 0:Pe.id,ke=P==null?void 0:P.paneId;if(!(!Ce||!ke))try{const{id:Rt}=await H0(Ce,ke,q||void 0,ee,he),$n=await Gs(Ce),Un=$n.find(Rr=>Rr.id===Rt)||$n[$n.length-1],Wn=await ho(Un.id);if(!Wn.length)return;const Pa=Ys(Wn,co(Un.id));H(Rr=>Rr&&{...Rr,windows:$n,window:Un,panes:Wn,paneId:Pa}),Vs({sessionId:Ce,windowId:Un.id,paneId:Pa}),Le.current=((Oe=Wn.find(Rr=>Rr.id===Pa))==null?void 0:Oe.width)??null,Me.current=null,f(!1),(ei=(He=ve.current)==null?void 0:He.wake)==null||ei.call(He)}catch(Rt){if(Rt instanceof it){de();return}throw Rt}},[P,de]),We=B.useCallback(async q=>{var Ce,ke;const ee=g;if(!ee)return;const he=(Ce=P==null?void 0:P.session)==null?void 0:Ce.id;if(ee.kind==="session"){try{await z0(ee.id,q)}catch(Pe){throw Pe instanceof it?(de(),Pe):/\b409\b/.test(Pe.message)?new Error(ee("app.nameExists")):new Error(ee("app.renameFailed"))}T(n0(ee.name,q)),fo(),Zd(q),H(Pe=>Pe&&Pe.session.id===ee.id?{...Pe,session:{...Pe.session,name:q}}:Pe)}else{try{await $0(ee.id,q)}catch(Oe){throw Oe instanceof it?(de(),Oe):new Error(ee("app.renameFailed"))}T0((ke=P==null?void 0:P.session)==null?void 0:ke.name,ee.name||ee.id,q);const Pe=await Gs(he);H(Oe=>Oe&&{...Oe,windows:Pe,window:Pe.find(He=>He.id===Oe.window.id)||Oe.window})}l(null)},[g,P,de]),Zt=B.useCallback(async()=>{var Pe;const q=m,ee=P==null?void 0:P.session;if(!q||!ee)return;const he=ee.id,Ce=P.windows.length<=1;try{await U0(q.id)}catch(Oe){if(Oe instanceof it){de();return}window.alert(O("app.deleteFailed")),y(null);return}if(y(null),Ce){T(Qh(ee.name)),fo(),H(null);return}const ke=await Gs(he);if(q.id===P.window.id&&ke.length){const Oe=ke.find(Rt=>Rt.active)||ke[0],He=await ho(Oe.id);if(!He.length)return;const ei=Ys(He,co(Oe.id));H(Rt=>Rt&&{...Rt,windows:ke,window:Oe,panes:He,paneId:ei}),Vs({sessionId:he,windowId:Oe.id,paneId:ei}),Le.current=((Pe=He.find(Rt=>Rt.id===ei))==null?void 0:Pe.width)??null,Me.current=null}else H(Oe=>Oe&&{...Oe,windows:ke})},[m,P,de]),zi=B.useCallback(async q=>{var ke;const ee=m,he=(ke=P==null?void 0:P.session)==null?void 0:ke.id;if(!ee||!he)return;const Ce=ul(P.windows,ee.id,q);if(Ce)try{await W0(ee.id,Ce.id);const Pe=await Gs(he);H(Oe=>Oe&&{...Oe,windows:Pe,window:Pe.find(He=>He.id===Oe.window.id)||Oe.window}),y(Pe.find(Oe=>Oe.id===ee.id)||null)}catch(Pe){if(Pe instanceof it){de(),y(null);return}window.alert(O("app.moveFailed")),y(null)}},[m,P,de]),ci=Cu(()=>{P!=null&&P.session&&l({kind:"session",id:P.session.id,name:P.session.name})}),wi=B.useCallback(async q=>{try{const ee=(await en()).find(he=>he.name===q);if(!ee){window.alert(O("app.sessionGone",{name:q}));return}await St(ee)&&r(!1)}catch(ee){ee instanceof it&&de()}},[St,de]),Er=B.useCallback(async q=>{ie(!1),X(td(q.pane,q.ts));try{const ee=(await en()).find(he=>he.name===q.session);if(!ee){window.alert(O("app.sessionGone",{name:q.session}));return}r(!1),await St(ee,{window:q.window,pane:q.pane})}catch(ee){ee instanceof it&&de()}},[St,de]),Lr=B.useCallback(()=>{const q=pd(G);id(q),se(q)},[G]),Qr=B.useCallback(q=>{T(s0(q)),fo(),s(!1),wi(q)},[wi]),Et=B.useCallback(q=>{T(Qh(q)),fo(),H(ee=>ee&&ee.session.name===q?null:ee)},[]),yi=B.useCallback(q=>{H(ee=>ee&&(Vs({windowId:ee.window.id,paneId:q}),{...ee,paneId:q}))},[]);B.useEffect(()=>{var q;U((q=P==null?void 0:P.session)!=null&&q.name?yu(P.session.name):[])},[(lt=P==null?void 0:P.session)==null?void 0:lt.name]);const $i=(Pt=P==null?void 0:P.session)==null?void 0:Pt.name,ir=((Ut=P==null?void 0:P.window)==null?void 0:Ut.name)||((ts=P==null?void 0:P.window)==null?void 0:ts.id);B.useEffect(()=>{ze($i&&ir?D_($i,ir).length:0)},[$i,ir]),B.useEffect(()=>{P!=null&&P.paneId&&Bw(P.paneId)},[P==null?void 0:P.paneId]),B.useEffect(()=>{var he;const q=P==null?void 0:P.paneId;if(!q)return;const ee=(he=G[q])==null?void 0:he.ts;ee!=null&&ed()[q]!==ee&&X(td(q,ee))},[P==null?void 0:P.paneId,G]),B.useEffect(()=>{if(!US())return;WS();let q=!1;return(async()=>{const ee=await VS();q||!ee||(u(ee),R.activate("home"),p(!0))})(),()=>{q=!0}},[]),B.useEffect(()=>{if(e||typeof navigator>"u"||!("serviceWorker"in navigator))return;const q=async({session:Ce,window:ke,pane:Pe})=>{if(Ce)try{const He=(await en()).find(ei=>ei.name===Ce);He&&(r(!1),await St(He,{window:ke,pane:Pe}))}catch(Oe){Oe instanceof it&&de()}},ee=Ce=>{const ke=Ce.data;ke&&ke.type==="navigate"&&q(ke)},he=()=>{const Ce=Qd();Ce.session&&(Ce.window||Ce.pane)&&q(Ce)};return navigator.serviceWorker.addEventListener("message",ee),window.addEventListener("hashchange",he),()=>{navigator.serviceWorker.removeEventListener("message",ee),window.removeEventListener("hashchange",he)}},[e,St,de]);const Si=B.useCallback(q=>{var he,Ce,ke;(Ce=(he=ve.current)==null?void 0:he.wake)==null||Ce.call(he);const ee=(ke=P==null?void 0:P.session)==null?void 0:ke.name;ee&&U(m0(ee,q))},[P]),Ui=B.useCallback(q=>{N(oa().includes(q)?_0(q):p0(q))},[]),Qt=B.useCallback(q=>{var he;const ee=(he=P==null?void 0:P.session)==null?void 0:he.name;ee&&U(g0(ee,q))},[P]),Ti=((Os=(ht=P==null?void 0:P.panes)==null?void 0:ht.find(q=>q.id===P.paneId))==null?void 0:Os.cwd)||null,Lt=async q=>{if(M0(q)){const he=q.split("/").pop()||q;if(R.tabs.some(ke=>ke.key===q)){R.openDoc(q,{type:"image",name:he}),p(!0);return}const Ce=await iw(q);R.openDoc(q,{type:"image",name:he,content:Ce}),sd({path:q,name:he,type:"image",ts:Date.now()}),p(!0);return}const ee=await G0(q);R.openDoc(q,{type:ee.type,name:ee.name,content:ee.content}),sd({path:q,name:ee.name,type:ee.type,ts:Date.now()}),p(!0)},es=q=>{const ee=R.tabs.find(he=>he.key===q);(ee==null?void 0:ee.type)==="image"&&ee.content&&URL.revokeObjectURL(ee.content),R.closeTab(q)},rr=q=>{const ee=/-> (\d+)/.exec((q==null?void 0:q.message)||""),he=ee?Number(ee[1]):0;return O(he===404?"app.docNotFound":he===413?"app.docTooLarge":he===400?"app.docUnsupported":"app.docOpenFailed")},ce=async q=>{if(W_(q)){try{await Lt(q)}catch(he){k(rr(he))}return}const ee=nd(P==null?void 0:P.paneId)??Ti;if(ee)try{await Lt(Mr(ee,q));return}catch{}x({rawPath:q})},Ae=async q=>{try{await Lt(Mr(q,v.rawPath))}catch(ee){k(rr(ee));return}P!=null&&P.paneId&&y0(P.paneId,q),setTimeout(()=>x(null),0)},je=(q,ee,he)=>E({path:q,x:ee,y:he}),Se=q=>{E(null),ce(q)};if(B.useEffect(()=>{if(!S)return;const q=setTimeout(()=>k(null),4e3);return()=>clearTimeout(q)},[S]),B.useEffect(()=>{if(e)return;const q=Wr();if(!q.length){M(!1);return}let ee=!1;return(async()=>{try{const he=await en();if(ee||!he.length)return;const Ce=he.filter(He=>q.includes(He.name));if(!Ce.length)return;const ke=Qd();let Pe=ke.session?Ce.find(He=>He.name===ke.session):null;const Oe=Pe?{window:ke.window,pane:ke.pane}:null;if(!Pe){const He=u0();He&&(Pe=Ce.find(ei=>ei.id===He))}Pe||(Pe=Ce[0]),ee||await St(Pe,Oe)}catch(he){he instanceof it&&t(!0)}finally{ee||M(!1)}})(),()=>{ee=!0}},[e,St]),B.useEffect(()=>{if(e)return;let q=!1,ee=null;const he=async()=>{if(!document.hidden)try{const Pe=await Y0(I);q||V(Pe||{})}catch{}},Ce=()=>{he(),ee=setTimeout(Ce,5e3)};Ce();const ke=()=>{document.hidden||(clearTimeout(ee),Ce())};return document.addEventListener("visibilitychange",ke),()=>{q=!0,clearTimeout(ee),document.removeEventListener("visibilitychange",ke)}},[e,I]),B.useEffect(()=>{if(J!=null)return;const q=pd(G);q>0&&(id(q),se(q))},[G,J]),e)return C.jsx(Hy,{onSaved:()=>{t(!1),M(!0)}});const De=Rw(G,le,J??1/0),ne=Dw(De),F=!!uo&&fe!==uo,Z=()=>{d(!1),_e(!0),R0(uo),be(uo)};return C.jsxs("div",{className:"app",style:yt?{transform:`translateY(-${yt}px)`}:void 0,children:[C.jsxs("header",{className:"topbar",children:[C.jsx("button",{className:"hamburger",onClick:()=>r(!0),children:"☰"}),C.jsx("span",{className:"session-name",...ci,children:((Ns=P==null?void 0:P.session)==null?void 0:Ns.name)??"—"}),Te&&C.jsx("button",{className:"topbar-icon preview-live",onClick:()=>Q(!0),"aria-label":O("app.preview"),title:O("app.openPreview"),children:C.jsx(pc,{})}),C.jsxs("button",{className:"topbar-icon",onClick:()=>xe(!0),"aria-label":O("app.ideas"),title:O("app.ideas"),disabled:!P,children:[C.jsx(fw,{}),pe>0&&C.jsx("span",{className:"idea-badge",children:pe})]}),C.jsx(Gy,{rows:De,top:ne,open:re,onToggle:()=>ie(q=>!q),onClose:()=>ie(!1),onSelectRow:Er,onMarkAllRead:Lr,hooksStatus:me,onEnableHooks:ue}),C.jsx("button",{className:"topbar-icon",onClick:()=>p(!0),"aria-label":O("app.files"),title:O("app.files"),children:C.jsx(Mn,{})}),C.jsx("button",{className:"topbar-icon",onClick:()=>h(!0),"aria-label":"Git",title:"Git",children:C.jsx(B_,{})}),C.jsxs("button",{className:"topbar-icon",onClick:()=>d(!0),"aria-label":O("app.settings"),title:O("app.settings"),children:[C.jsx(aw,{}),F&&C.jsx("span",{className:"topbar-dot","aria-hidden":"true"})]})]}),C.jsx(Vy,{open:n,onClose:()=>d(!1),termRef:ve,getColCount:()=>{var q,ee;return Le.current??((ee=(q=ve.current)==null?void 0:q.getSize())==null?void 0:ee.cols)},onColAdjust:q=>vi(q),onColRestore:tr,onOpenChangelog:Z,changelogUnread:F,activePreview:Te,pane:P==null?void 0:P.paneId,lastPreviewDir:l0((Pu=P==null?void 0:P.window)==null?void 0:Pu.id),dynamicEnabled:K,onStartPreview:Xt,onStartDynamicPreview:Jt,onOpenPreview:Ze,onRenew:st,onStop:ft}),C.jsx(FS,{open:ge,onClose:()=>_e(!1)}),C.jsx(Uw,{open:i,currentSessionName:(Ou=P==null?void 0:P.session)==null?void 0:Ou.name,bound:I,onSelectSession:wi,onUnbind:Et,onBind:()=>s(!0),onClose:()=>r(!1),onLogout:$t}),C.jsx(Zy,{open:_,bound:I,onBound:Qr,onClose:()=>s(!1),onAuthFail:de,inset:yt}),C.jsx(e1,{open:o,onClose:()=>f(!1),onCreate:kr,paneId:P==null?void 0:P.paneId,inset:yt}),C.jsx(i1,{open:!!g,title:(g==null?void 0:g.kind)==="session"?O("app.renameSession"):O("app.renameWindow"),currentName:(g==null?void 0:g.name)||"",onClose:()=>l(null),onSubmit:We,inset:yt}),C.jsx(Eu,{open:!!m,title:m?m.name||m.id:"",onClose:()=>y(null),actions:m?[...P&&P.windows.length>1?[[{key:"move-left",label:O("app.moveLeft"),disabled:!ul(P.windows,m.id,"left"),onClick:()=>zi("left")},{key:"move-right",label:O("app.moveRight"),disabled:!ul(P.windows,m.id,"right"),onClick:()=>zi("right")}]]:[],{key:"rename",label:O("common.rename"),onClick:()=>{l({kind:"window",id:m.id,name:m.name||""}),y(null)}},{key:"delete",label:O("app.deleteWindow"),danger:!0,confirm:!0,confirmLabel:P&&P.windows.length<=1?O("app.deleteLastWindowConfirm"):O("app.deleteConfirm"),onClick:Zt}]:[]}),C.jsx(ES,{open:b,pane:P==null?void 0:P.paneId,windowId:(Nu=P==null?void 0:P.window)==null?void 0:Nu.id,tabs:R.tabs,active:R.active,onActivate:R.activate,onCloseTab:es,onMinimize:()=>p(!1),onOpenDoc:ce,pendingShare:c,onPendingConsumed:()=>u(null)}),C.jsx(TS,{open:a,pane:P==null?void 0:P.paneId,windowId:(Bu=P==null?void 0:P.window)==null?void 0:Bu.id,inset:yt,onClose:()=>h(!1)}),C.jsx(kw,{open:te&&!!Te,name:Te==null?void 0:Te.name,kind:Te==null?void 0:Te.kind,domain:j,port:Te==null?void 0:Te.port,dir:Te==null?void 0:Te.dir,expiresAt:Te==null?void 0:Te.expiresAt,onRenew:st,onStop:ft,onMinimize:()=>Q(!1)}),S&&C.jsx("div",{className:"doc-toast",role:"alert",onClick:()=>k(null),children:S}),w&&C.jsx(PS,{path:w.path,x:w.x,y:w.y,onOpen:Se,onClose:()=>E(null)}),C.jsx(jS,{open:Re,session:(ju=P==null?void 0:P.session)==null?void 0:ju.name,window:((Fu=P==null?void 0:P.window)==null?void 0:Fu.name)||((Hu=P==null?void 0:P.window)==null?void 0:Hu.id),onClose:()=>xe(!1),onSend:q=>{var ee;(ee=Ee.current)==null||ee.fill(q),xe(!1)},onCountChange:ze}),C.jsx(Fn,{open:!!v,seedCwd:nd(P==null?void 0:P.paneId)??Ti??null,pane:(P==null?void 0:P.paneId)??null,hint:v?C.jsxs(C.Fragment,{children:[O("app.cannotLocate")," ",C.jsx("code",{children:v.rawPath}),O("app.pickItsDir")]}):null,onPick:Ae,onClose:()=>x(null),inset:yt}),P?C.jsxs(C.Fragment,{children:[C.jsx(qw,{windows:P.windows,currentWindowId:P.window.id,panes:P.panes,currentPaneId:P.paneId,onSelectWindow:xr,onSelectPane:yi,onNewWindow:()=>f(!0),onManageWindow:q=>y(q),trackWindowId:m==null?void 0:m.id}),P.paneId&&C.jsx(gy,{ref:ve,pane:P.paneId,onAuthFail:de,onDocLinkTap:je},P.paneId),C.jsx(Fy,{ref:Ee,pane:P.paneId,onAuthFail:de,onKey:Zr,onText:gi,cwd:Ti,recent:$,favorites:D,onSent:Si,onToggleFav:Ui,onRemoveRecent:Qt})]}):W?C.jsx("div",{className:"loading",children:O("common.loading")}):I.length===0?C.jsxs("button",{className:"empty-cta",onClick:()=>s(!0),children:[O("app.noBoundSession"),C.jsx("span",{children:O("app.tapToBind")})]}):C.jsx("div",{className:"loading",children:O("app.selectSessionHint")})]})}function KS(){typeof navigator>"u"||!("serviceWorker"in navigator)||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}p_(document.getElementById("root")).render(C.jsx(GS,{}));KS();if(typeof window<"u"&&window.__hideBootSplash){const e=[...document.querySelectorAll('link[rel="stylesheet"]')].filter(i=>i.media==="print"),t=e.length?new Promise(i=>{let r=e.length;e.forEach(n=>n.addEventListener("load",()=>{--r||i()},{once:!0}))}):Promise.resolve();requestAnimationFrame(()=>requestAnimationFrame(()=>t.then(()=>window.__hideBootSplash())))}