Files
argus/.obsidian/plugins/terminal/main.js

192 lines
1.9 MiB
JavaScript
Raw Normal View History

2025-07-26 21:45:07 -04:00
// repository: https://github.com/polyipseity/obsidian-terminal
"use strict";var _T=Object.create;var Ae=Object.defineProperty;var TT=Object.getOwnPropertyDescriptor;var OT=Object.getOwnPropertyNames;var RT=Object.getPrototypeOf,QT=Object.prototype.hasOwnProperty;var sm=e=>{throw TypeError(e)};var GT=(e,t,s)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var s0=(e,t)=>()=>(e&&(t=e(e=0)),t);var o1=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a0=(e,t)=>{for(var s in t)Ae(e,s,{get:t[s],enumerable:!0})},am=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of OT(t))!QT.call(e,i)&&i!==s&&Ae(e,i,{get:()=>t[i],enumerable:!(r=TT(t,i))||r.enumerable});return e};var T1=(e,t,s)=>(s=e!=null?_T(RT(e)):{},am(t||!e||!e.__esModule?Ae(s,"default",{value:e,enumerable:!0}):s,e)),KT=e=>am(Ae({},"__esModule",{value:!0}),e);var I1=(e,t,s)=>GT(e,typeof t!="symbol"?t+"":t,s),Eo=(e,t,s)=>t.has(e)||sm("Cannot "+s);var i1=(e,t,s)=>(Eo(e,t,"read from private field"),s?s.call(e):t.get(e)),x1=(e,t,s)=>t.has(e)?sm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L1=(e,t,s,r)=>(Eo(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),V3=(e,t,s)=>(Eo(e,t,"access private method"),s);function G(...e){return self.activeWindow.requestAnimationFrame(...e)}function O(...e){return self.activeWindow.setTimeout(...e)}var x=s0(()=>{});var Ce=o1((P41,rm)=>{"use strict";x();var UT=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};rm.exports=UT});var we=o1((Z41,im)=>{"use strict";x();var VT="2.0.0",PT=Number.MAX_SAFE_INTEGER||9007199254740991,YT=16,ZT=250,jT=["major","premajor","minor","preminor","patch","prepatch","prerelease"];im.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:YT,MAX_SAFE_BUILD_LENGTH:ZT,MAX_SAFE_INTEGER:PT,RELEASE_TYPES:jT,SEMVER_SPEC_VERSION:VT,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var h8=o1((r5,cm)=>{"use strict";x();var{MAX_SAFE_COMPONENT_LENGTH:So,MAX_SAFE_BUILD_LENGTH:NT,MAX_LENGTH:JT}=we(),WT=Ce();r5=cm.exports={};var qT=r5.re=[],XT=r5.safeRe=[],K1=r5.src=[],$T=r5.safeSrc=[],U1=r5.t={},eO=0,xo="[a-zA-Z0-9-]",tO=[["\\s",1],["\\d",JT],[xo,NT]],sO=e=>{for(let[t,s]of tO)e=e.split(`${t}*`).join(`${t}{0,${s}}`).split(`${t}+`).join(`${t}{1,${s}}`);return e},m0=(e,t,s)=>{let r=sO(t),i=eO++;WT(e,i,t),U1[e]=i,K1[i]=t,$T[i]=r,qT[i]=new RegExp(t,s?"g":void 0),XT[i]=new RegExp(r,s?"g":void 0)};m0("NUMERICIDENTIFIER","0|[1-9]\\d*");m0("NUMERICIDENTIFIERLOOSE","\\d+");m0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xo}*`);m0("MAINVERSION",`(${K1[U1.NUMERICIDENTIFIER]})\\.(${K1[U1.NUMERICIDENTIFIER]})\\.(${K1[U1.NUMERICIDENTIFIER]})`);m0("MAINVERSIONLOOSE",`(${K1[U1.NUMERICIDENTIFIERLOOSE]})\\.(${K1[U1.NUMERICIDENTIFIERLOOSE]})\\.(${K1[U1.NUMERICIDENTIFIERLOOSE]})`);m0("PRERELEASEIDENTIFIER",`(?:${K1[U1.NONNUMERICIDENTIFIER]}|${K1[U1.NUMERICIDENTIFIER]})`);m0("PRERELEASEIDENTIFIERLOOSE",`(?:${K1[U1.NONNUMERICIDENTIFIER]}|${K1[U1.NUMERICIDENTIFIERLOOSE]})`);m0("PRERELEASE",`(?:-(${K1[U1.PRERELEASEIDENTIFIER]}(?:\\.${K1[U1.PRERELEASEIDENTIFIER]})*))`);m0("PRERELEASELOOSE",`(?:-?(${K1[U1.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${K1[U1.PRERELEASEIDENTIFIERLOOSE]})*))`);m0("BUILDIDENTIFIER",`${xo}+`);m0("BUILD",`(?:\\+(${K1[U1.BUILDIDENTIFIER]}(?:\\.${K1[U1.BUILDIDENTIFIER]})*))`);m0("FULLPLAIN",`v?${K1[U1.MAINVERSION]}${K1[U1.PRERELEASE]}?${K1[U1.BUILD]}?`);m0("FULL",`^${K1[U1.FULLPLAIN]}$`);m0("LOOSEPLAIN",`[v=\\s]*${K1[U1.MAINVERSIONLOOSE]}${K1[U1.PRERELEASELOOSE]}?${K1[U1.BUILD]}?`);m0("LOOSE",`^${K1[U1.LOOSEPLAIN]}$`);m0("GTLT","((?:<|>)?=?)");m0("XRANGEIDENTIFIERLOOSE",`${K1[U1.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);m0("XRANGEIDENTIFIER",`${K1[U1.NUMERICIDENTIFIER]}|x|X|\\*`);m0("XRANGEPLAIN",`[v=\\s]*(${K1[U1.XRANGEIDENTIFIER]})(?:\\.(${K1[U1.XRANGEIDENTIFIER]})(?:\\.(${K1[U1.XRANGEIDENTIFIER]})(?:${K1[U1.PRERELEASE]})?${K1[U1.BUILD]}?)?)?`);m0("XRANGEPLAINLOOSE",`[v=\\s]*(${K1[U1.XRANGEIDENTIFIERLOOSE]})(?:\\.(${K1[U1.XRANGEIDENTIFIERLOOSE]})(?:\\.(${K1[U1.XRANGEIDENTIFIERLOOSE]})(?:${K1[U1.PRERELEASELOOSE]})?${K1[U1.BUILD]
* Echos the value of a value. Trys to print the value out
* in the best way possible given the different types.
*
* @param {Object} obj The object to print out.
* @param {Object} opts Optional options object that alters the output.
* @license MIT (© Joyent)
*/function A7(e,t){var s={seen:[],stylize:sP};return arguments.length>=3&&(s.depth=arguments[2]),arguments.length>=4&&(s.colors=arguments[3]),Vv(t)?s.showHidden=t:t&&lP(s,t),I8(s.showHidden)&&(s.showHidden=!1),I8(s.depth)&&(s.depth=2),I8(s.colors)&&(s.colors=!1),I8(s.customInspect)&&(s.customInspect=!0),s.colors&&(s.stylize=aP),Xa(s,e,s.depth)}A7.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};A7.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function sP(e,t){return e}function Vv(e){return typeof e=="boolean"}function I8(e){return e===void 0}function aP(e,t){var s=A7.styles[t];return s?"\x1B["+A7.colors[s][0]+"m"+e+"\x1B["+A7.colors[s][1]+"m":e}function Qo(e){return typeof e=="function"}function Pv(e){return typeof e=="string"}function rP(e){return typeof e=="number"}function Yv(e){return e===null}function Zv(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Go(e){return $a(e)&&Po(e)==="[object RegExp]"}function $a(e){return typeof e=="object"&&e!==null}function Ko(e){return $a(e)&&(Po(e)==="[object Error]"||e instanceof Error)}function Uv(e){return $a(e)&&Po(e)==="[object Date]"}function Po(e){return Object.prototype.toString.call(e)}function iP(e){var t={};return e.forEach(function(s,r){t[s]=!0}),t}function cP(e,t,s,r,i){for(var a=[],c=0,o=t.length;c<o;++c)Zv(t,String(c))?a.push(Vo(e,t,s,r,String(c),!0)):a.push("");return i.forEach(function(l){l.match(/^\d+$/)||a.push(Vo(e,t,s,r,l,!0))}),a}function Uo(e){return"["+Error.prototype.toString.call(e)+"]"}function Xa(e,t,s){if(e.customInspect&&t&&Qo(t.inspect)&&t.inspect!==A7&&!(t.constructor&&t.constructor.prototype===t)){var r=t.inspect(s,e);return Pv(r)||(r=Xa(e,r,s)),r}var i=oP(e,t);if(i)return i;var a=Object.keys(t),c=iP(a);try{e.showHidden&&Object.getOwnPropertyNames&&(a=Object.getOwnPropertyNames(t))}catch(p){}if(Ko(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Uo(t);if(a.length===0){if(Qo(t)){var o=t.name?": "+t.name:"";return e.stylize("[Function"+o+"]","special")}if(Go(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Uv(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Ko(t))return Uo(t)}var l="",n=!1,u=["{","}"];if(Array.isArray(t)&&(n=!0,u=["[","]"]),Qo(t)){var g=t.name?": "+t.name:"";l=" [Function"+g+"]"}if(Go(t)&&(l=" "+RegExp.prototype.toString.call(t)),Uv(t)&&(l=" "+Date.prototype.toUTCString.call(t)),Ko(t)&&(l=" "+Uo(t)),a.length===0&&(!n||t.length==0))return u[0]+l+u[1];if(s<0)return Go(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var f;return n?f=cP(e,t,s,c,a):f=a.map(function(p){return Vo(e,t,s,c,p,n)}),e.seen.pop(),nP(f,l,u)}function Vo(e,t,s,r,i,a){var c,o,l;l={value:void 0};try{l.value=t[i]}catch(n){}try{Object.getOwnPropertyDescriptor&&(l=Object.getOwnPropertyDescriptor(t,i)||l)}catch(n){}if(l.get?l.set?o=e.stylize("[Getter/Setter]","special"):o=e.stylize("[Getter]","special"):l.set&&(o=e.stylize("[Setter]","special")),Zv(r,i)||(c="["+i+"]"),o||(e.seen.indexOf(l.value)<0?(Yv(s)?o=Xa(e,l.value,null):o=Xa(e,l.value,s-1),o.indexOf(`
`)>-1&&(a?o=o.split(`
`).map(function(n){return" "+n}).join(`
`).substr(2):o=`
`+o.split(`
`).map(function(n){return" "+n}).join(`
`))):o=e.stylize("[Circular]","special")),I8(c)){if(a&&i.match(/^\d+$/))return o;c=JSON.stringify(""+i),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+o}function oP(e,t){if(I8(t))return e.stylize("undefined","undefined");if(Pv(t)){var s="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(s,"string")}if(rP(t))return e.stylize(""+t,"number");if(Vv(t))return e.stylize(""+t,"boolean");if(Yv(t))return e.stylize("null","null")}function nP(e,t,s){var r=0,i=e.reduce(function(a,c){return r++,c.indexOf(`
`)>=0&&r++,a+c.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?s[0]+(t===""?"":t+`
`)+" "+e.join(`,
`)+" "+s[1]:s[0]+t+" "+e.join(", ")+" "+s[1]}function lP(e,t){if(!t||!$a(t))return e;for(var s=Object.keys(t),r=s.length;r--;)e[s[r]]=t[s[r]];return e}});var Jv=o1((_o1,Nv)=>{"use strict";x();var N3=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process=="undefined"||typeof process.domain=="undefined")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||N3.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||N3.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||N3.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=N3.DEFAULT_MAX_PENDING};N3.DEFAULT_TIMEOUT=0;N3.DEFAULT_MAX_OCCUPATION_TIME=0;N3.DEFAULT_MAX_EXECUTION_TIME=0;N3.DEFAULT_MAX_PENDING=1e3;N3.prototype.acquire=function(e,t,s,r){if(Array.isArray(e))return this._acquireBatch(e,t,s,r);if(typeof t!="function")throw new Error("You must pass a function to execute");var i=null,a=null,c=null;typeof s!="function"&&(r=s,s=null,c=new this.Promise(function(w,y){i=w,a=y})),r=r||{};var o=!1,l=null,n=null,u=null,g=this,f=function(w,y,C){n&&(clearTimeout(n),n=null),u&&(clearTimeout(u),u=null),w&&(g.queues[e]&&g.queues[e].length===0&&delete g.queues[e],g.domainReentrant&&delete g.domains[e]),o||(c?y?a(y):i(C):typeof s=="function"&&s(y,C),o=!0),w&&g.queues[e]&&g.queues[e].length>0&&g.queues[e].shift()()},p=function(w){if(o)return f(w);l&&(clearTimeout(l),l=null),g.domainReentrant&&w&&(g.domains[e]=process.domain);var y=r.maxExecutionTime||g.maxExecutionTime;if(y&&(u=O(function(){g.queues[e]&&f(w,new Error("Maximum execution time is exceeded "+e))},y)),t.length===1){var C=!1;try{t(function(M,b){C||(C=!0,f(w,M,b))})}catch(M){C||(C=!0,f(w,M))}}else g._promiseTry(function(){return t()}).then(function(M){f(w,void 0,M)},function(M){f(w,M)})};g.domainReentrant&&process.domain&&(p=process.domain.bind(p));var h=r.maxPending||g.maxPending;if(!g.queues[e])g.queues[e]=[],p(!0);else if(g.domainReentrant&&process.domain&&process.domain===g.domains[e])p(!1);else if(g.queues[e].length>=h)f(!1,new Error("Too many pending tasks in queue "+e));else{var v=function(){p(!0)};r.skipQueue?g.queues[e].unshift(v):g.queues[e].push(v);var d=r.timeout||g.timeout;d&&(l=O(function(){l=null,f(!1,new Error("async-lock timed out in queue "+e))},d))}var m=r.maxOccupationTime||g.maxOccupationTime;if(m&&(n=O(function(){g.queues[e]&&f(!1,new Error("Maximum occupation time is exceeded in queue "+e))},m)),c)return c};N3.prototype._acquireBatch=function(e,t,s,r){typeof s!="function"&&(r=s,s=null);var i=this,a=function(o,l){return function(n){i.acquire(o,l,n,r)}},c=e.reduceRight(function(o,l){return a(l,o)},t);if(typeof s=="function")c(s);else return new this.Promise(function(o,l){c.length===1?c(function(n,u){n?l(n):o(u)}):o(c())})};N3.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0};N3.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};Nv.exports=N3});var er=o1((Oo1,Wv)=>{"use strict";x();Wv.exports=Jv()});var Jn=o1((Rb1,IA)=>{"use strict";x();var BA=Object.prototype.toString;IA.exports=function(t){var s=BA.call(t),r=s==="[object Arguments]";return r||(r=s!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&BA.call(t.callee)==="[object Function]"),r}});var QA=o1((Gb1,RA)=>{"use strict";x();var OA;Object.keys||(st=Object.prototype.hasOwnProperty,Wn=Object.prototype.toString,kA=Jn(),qn=Object.prototype.propertyIsEnumerable,DA=!qn.call({toString:null},"toString"),HA=qn.call(function(){},"prototype"),at=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Qr=function(e){var t=e.constructor;return t&
`)>=0)return!1;return!0}function aN(e,t){var s;if(e.indent===" ")s=" ";else if(typeof e.indent=="number"&&e.indent>0)s=p5.call(Array(e.indent+1)," ");else return null;return{base:s,prev:p5.call(Array(t+1),s)}}function bl(e,t){if(e.length===0)return"";var s=`
`+t.prev+t.base;return s+p5.call(e,","+s)+`
`+t.prev}function ii(e,t){var s=zl(e),r=[];if(s){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=W5(e,i)?t(e[i],e):""}var a=typeof vl=="function"?vl(e):[],c;if(W8){c={};for(var o=0;o<a.length;o++)c["$"+a[o]]=a[o]}for(var l in e)W5(e,l)&&(s&&String(Number(l))===l&&l<e.length||W8&&c["$"+l]instanceof Symbol||(hz.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if(typeof vl=="function")for(var n=0;n<a.length;n++)uz.call(e,a[n])&&r.push("["+t(a[n])+"]: "+t(e[a[n]],e));return r}});var Cz=o1((JM1,Az)=>{"use strict";x();var rN=dt(),iN=s4(),ni=function(e,t,s){for(var r=e,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,s||(i.next=e.next,e.next=i),i},cN=function(e,t){if(e){var s=ni(e,t);return s&&s.value}},oN=function(e,t,s){var r=ni(e,t);r?r.value=s:e.next={key:t,next:e.next,value:s}},nN=function(e,t){return e?!!ni(e,t):!1},lN=function(e,t){if(e)return ni(e,t,!0)};Az.exports=function(){var t,s={assert:function(r){if(!s.has(r))throw new iN("Side channel does not contain "+rN(r))},delete:function(r){var i=t&&t.next,a=lN(t,r);return a&&i&&i===a&&(t=void 0),!!a},get:function(r){return cN(t,r)},has:function(r){return nN(t,r)},set:function(r,i){t||(t={next:void 0}),oN(t,r,i)}};return s}});var Sl=o1((qM1,zz)=>{"use strict";x();var hN=g5(),vt=X2(),uN=dt(),gN=s4(),wz=hN("%Map%",!0),pN=vt("Map.prototype.get",!0),mN=vt("Map.prototype.set",!0),dN=vt("Map.prototype.has",!0),vN=vt("Map.prototype.delete",!0),fN=vt("Map.prototype.size",!0);zz.exports=!!wz&&function(){var t,s={assert:function(r){if(!s.has(r))throw new gN("Side channel does not contain "+uN(r))},delete:function(r){if(t){var i=vN(t,r);return fN(t)===0&&(t=void 0),i}return!1},get:function(r){if(t)return pN(t,r)},has:function(r){return t?dN(t,r):!1},set:function(r,i){t||(t=new wz),mN(t,r,i)}};return s}});var yz=o1(($M1,bz)=>{"use strict";x();var AN=g5(),hi=X2(),CN=dt(),li=Sl(),wN=s4(),q8=AN("%WeakMap%",!0),zN=hi("WeakMap.prototype.get",!0),bN=hi("WeakMap.prototype.set",!0),yN=hi("WeakMap.prototype.has",!0),MN=hi("WeakMap.prototype.delete",!0);bz.exports=q8?function(){var t,s,r={assert:function(i){if(!r.has(i))throw new wN("Side channel does not contain "+CN(i))},delete:function(i){if(q8&&i&&(typeof i=="object"||typeof i=="function")){if(t)return MN(t,i)}else if(li&&s)return s.delete(i);return!1},get:function(i){return q8&&i&&(typeof i=="object"||typeof i=="function")&&t?zN(t,i):s&&s.get(i)},has:function(i){return q8&&i&&(typeof i=="object"||typeof i=="function")&&t?yN(t,i):!!s&&s.has(i)},set:function(i,a){q8&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new q8),bN(t,i,a)):li&&(s||(s=li()),s.set(i,a))}};return r}:li});var xl=o1((tE1,Mz)=>{"use strict";x();var EN=s4(),SN=dt(),xN=Cz(),LN=Sl(),BN=yz(),IN=BN||LN||xN;Mz.exports=function(){var t,s={assert:function(r){if(!s.has(r))throw new EN("Side channel does not contain "+SN(r))},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,i){t||(t=IN()),t.set(r,i)}};return s}});var Sz=o1((aE1,Ez)=>{"use strict";x();var kN=Xr(),ft=xl()(),q5=s4(),Ll={assert:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new q5("`O` is not an object");if(typeof t!="string")throw new q5("`slot` must be a string");if(ft.assert(e),!Ll.has(e,t))throw new q5("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new q5("`O` is not an object");if(typeof t!="string")throw new q5("`slot` must be a string");var s=ft.get(e);return s&&s["$"+t]},has:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new q5("`O` is not an object");if(typeof t!="string")throw new q5("`slot` must be a string");var s=ft.get(e);return!!s&&kN(s,"$"+t)},set:function(e,t,s){if(!e||typeof e!="object"&&typeof e!="function")throw new q5("`O` is not an object");if(typeof t!="string")throw new q5("`slot` must be a string");var r=ft.get(e);r||(r={},ft.set(e,r)),r["$"+t]=s}};Object.freeze&&Object.freeze(Ll);Ez.exports=Ll});var Bz=o1((iE1,Lz)=>{"use strict";x();var At=Sz(),DN=SyntaxError,xz=typeof Sto
`+a.stack)}}function e3(e,t){t=t||{},t.hasComment&&(e=XW(e)),t.encoding==="base64"?e=Pi(e):t.encoding==="uri"&&(e=decodeURIComponent(e)),(t.isJSON||t.encoding)&&(e=JSON.parse(e)),this.sourcemap=e}e3.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)};typeof Buffer!="undefined"?typeof Buffer.from=="function"?e3.prototype.toBase64=eq:e3.prototype.toBase64=tq:e3.prototype.toBase64=sq;function eq(){var e=this.toJSON();return Buffer.from(e,"utf8").toString("base64")}function tq(){var e=this.toJSON();if(typeof e=="number")throw new TypeError("The json to encode must not be of type number.");return new Buffer(e,"utf8").toString("base64")}function sq(){var e=this.toJSON();return btoa(unescape(encodeURIComponent(e)))}e3.prototype.toURI=function(){var e=this.toJSON();return encodeURIComponent(e)};e3.prototype.toComment=function(e){var t,s,r;return e!=null&&e.encoding==="uri"?(t="",s=this.toURI()):(t=";base64",s=this.toBase64()),r="sourceMappingURL=data:application/json;charset=utf-8"+t+","+s,e!=null&&e.multiline?"/*# "+r+" */":"//# "+r};e3.prototype.toObject=function(){return JSON.parse(this.toJSON())};e3.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error('property "'+e+'" already exists on the sourcemap, use set property instead');return this.setProperty(e,t)};e3.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this};e3.prototype.getProperty=function(e){return this.sourcemap[e]};h2.fromObject=function(e){return new e3(e)};h2.fromJSON=function(e){return new e3(e,{isJSON:!0})};h2.fromURI=function(e){return new e3(e,{encoding:"uri"})};h2.fromBase64=function(e){return new e3(e,{encoding:"base64"})};h2.fromComment=function(e){var t,s;return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),t=h2.commentRegex.exec(e),s=t&&t[4]||"uri",new e3(e,{encoding:s,hasComment:!0})};function yM(e){return new e3(e,{isJSON:!0})}h2.fromMapFileComment=function(e,t){if(typeof t=="string")throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var s=$W(e,t);return s!=null&&typeof s.then=="function"?s.then(yM):yM(s)};h2.fromSource=function(e){var t=e.match(h2.commentRegex);return t?h2.fromComment(t.pop()):null};h2.fromMapFileSource=function(e,t){if(typeof t=="string")throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var s=e.match(h2.mapFileCommentRegex);return s?h2.fromMapFileComment(s.pop(),t):null};h2.removeComments=function(e){return e.replace(h2.commentRegex,"")};h2.removeMapFileComments=function(e){return e.replace(h2.mapFileCommentRegex,"")};h2.generateMapFileComment=function(e,t){var s="sourceMappingURL="+e;return t&&t.multiline?"/*# "+s+" */":"//# "+s}});var G7=o1((tL1,fL)=>{"use strict";x();var vL=H2(),VX=(e,t,s=!1)=>{if(e instanceof vL)return e;try{return new vL(e,t)}catch(r){if(!s)return null;throw r}};fL.exports=VX});var CL=o1((aL1,AL)=>{"use strict";x();var PX=G7(),YX=(e,t)=>{let s=PX(e,t);return s?s.version:null};AL.exports=YX});var zL=o1((iL1,wL)=>{"use strict";x();var ZX=G7(),jX=(e,t)=>{let s=ZX(e.trim().replace(/^[=v]+/,""),t);return s?s.version:null};wL.exports=jX});var ML=o1((oL1,yL)=>{"use strict";x();var bL=H2(),NX=(e,t,s,r,i)=>{typeof s=="string"&&(i=r,r=s,s=void 0);try{return new bL(e instanceof bL?e.version:e,s).inc(t,r,i).version}catch(a){return null}};yL.exports=NX});var xL=o1((lL1,SL)=>{"use strict";x();var EL=G7(),JX=(e,t)=>{let s=EL(e,null,!0),r=EL(t,null,!0),i=s.compare(r);if(i===0)return null;let a=i>0,c=a?s:r,o=a?r:s,l=!!c.prerelease.length;if(!!o.prerelease.length&&!l){if(!o.patch&&!o.minor)return"major";if(o.compareMain(c)===0)return o.minor&&!o.patch?"minor":"patch"}let u=l?"pre":"";return s.major!==r.major?u+"major":s.minor!==r.minor?u+"minor":s.patch!==r.patch?u+"patch":"prerelease"};SL.exports=JX});var BL=o1((uL1,LL)=>{"use strict";x();var WX=H2(),qX=(e,t)=>new WX(e,t)
`&&(d+=w),m=!1;else switch(w){case v:return d;case"\\":m=!0;break;default:d+=w}}throw new Error("Unterminated string")}function g(h){let v="",d=!1;for(;h.offset<h.input.length;){let m=h.input[h.offset++];if(d)/[\dA-Fa-f]/.test(m)?(h.offset--,v+=f(h)):v+=m,d=!1;else switch(m){case"\\":d=!0;break;case",":return v;default:/\s/.test(m)?v.endsWith(" ")||(v+=" "):v+=m}}return v}function f(h){let v="";for(;h.offset<h.input.length;){let d=h.input[h.offset++];if(/\s/.test(d))return p(v);if(v.length>=6||!/[\dA-Fa-f]/.test(d))return h.offset--,p(v);v+=d}return p(v)}function p(h){return String.fromCodePoint(parseInt(h,16))}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(h){if(typeof h!="string")throw new Error("Font family must be a string");let v={input:h,offset:0},d=[],m="";for(;v.offset<v.input.length;){let w=v.input[v.offset++];switch(w){case"'":case'"':m+=u(v,w);break;case",":d.push(m),m="";break;default:/\s/.test(w)||(v.offset--,m+=g(v),d.push(m),m="")}}return d}},89:l=>{"use strict";l.exports=e},56:l=>{"use strict";l.exports=t},978:l=>{"use strict";l.exports=r},269:l=>{"use strict";l.exports=s},82:()=>{},456:()=>{}},a={};function c(l){var n=a[l];if(n!==void 0)return n.exports;var u=a[l]={exports:{}};return i[l].call(u.exports,u,u.exports,c),u.exports}c.n=l=>{var n=l&&l.__esModule?()=>l.default:()=>l;return c.d(n,{a:n}),n},c.d=(l,n)=>{for(var u in n)c.o(n,u)&&!c.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:n[u]})},c.o=(l,n)=>Object.prototype.hasOwnProperty.call(l,n),c.r=l=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.LigaturesAddon=void 0;let n=c(833);l.LigaturesAddon=class{constructor(u){this._fallbackLigatures=((u==null?void 0:u.fallbackLigatures)||["<--","<---","<<-","<-","->","->>","-->","--->","<==","<===","<<=","<=","=>","=>>","==>","===>",">=",">>=","<->","<-->","<--->","<---->","<=>","<==>","<===>","<====>","-------->","<~~","<~","~>","~~>","::",":::","==","!=","===","!==",":=",":-",":+","<*","<*>","*>","<|","<|>","|>","+:","-:","=:",":>","++","+++","<!--","<!---","<***>"]).sort((g,f)=>f.length-g.length)}activate(u){this._terminal=u,this._characterJoinerId=(0,n.enableLigatures)(u,this._fallbackLigatures)}dispose(){var u;this._characterJoinerId!==void 0&&((u=this._terminal)===null||u===void 0||u.deregisterCharacterJoiner(this._characterJoinerId),this._characterJoinerId=void 0)}}})(),o})())});var qD=o1((zc,Bu)=>{x();(function(e,t){typeof zc=="object"&&typeof Bu=="object"?Bu.exports=t():typeof define=="function"&&define.amd?define([],t):typeof zc=="object"?zc.SearchAddon=t():e.SearchAddon=t()})(self,()=>(()=>{"use strict";var e={345:(i,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let o=0;o<this._listeners.length;o++)if(this._listeners[o]===c)return void this._listeners.splice(o,1)}}})),this._event}fire(c,o){let l=[];for(let n=0;n<this._listeners.length;n++)l.push(this._listeners[n]);for(let n=0;n<l.length;n++)l[n].call(void 0,c,o)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,o){return c(l=>o.fire(l))},a.runAndSubscribe=function(c,o){return o(void 0),c(l=>o(l))}},859:(i,a)=>{function c(o){for(let l of o)l.dispose();o.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let o of this._disposables)o.dispose();this._disposables.length=0}register(o){return this._disposables.push(o),o}unregister(o){let l=this._disposables.indexOf(o);l!==-1&&this._disposa
`,this._lastCursorRow=h+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=d,this._currentRow="",this._nullCellCount=0}_diffStyle(h,v){let d=[],m=!l(h,v),w=!n(h,v),y=!u(h,v);if(m||w||y)if(h.isAttributeDefault())v.isAttributeDefault()||d.push(0);else{if(m){let C=h.getFgColor();h.isFgRGB()?d.push(38,2,C>>>16&255,C>>>8&255,255&C):h.isFgPalette()?C>=16?d.push(38,5,C):d.push(8&C?90+(7&C):30+(7&C)):d.push(39)}if(w){let C=h.getBgColor();h.isBgRGB()?d.push(48,2,C>>>16&255,C>>>8&255,255&C):h.isBgPalette()?C>=16?d.push(48,5,C):d.push(8&C?100+(7&C):40+(7&C)):d.push(49)}y&&(h.isInverse()!==v.isInverse()&&d.push(h.isInverse()?7:27),h.isBold()!==v.isBold()&&d.push(h.isBold()?1:22),h.isUnderline()!==v.isUnderline()&&d.push(h.isUnderline()?4:24),h.isOverline()!==v.isOverline()&&d.push(h.isOverline()?53:55),h.isBlink()!==v.isBlink()&&d.push(h.isBlink()?5:25),h.isInvisible()!==v.isInvisible()&&d.push(h.isInvisible()?8:28),h.isItalic()!==v.isItalic()&&d.push(h.isItalic()?3:23),h.isDim()!==v.isDim()&&d.push(h.isDim()?2:22),h.isStrikethrough()!==v.isStrikethrough()&&d.push(h.isStrikethrough()?9:29))}return d}_nextCell(h,v,d,m){if(h.getWidth()===0)return;let w=h.getChars()==="",y=this._diffStyle(h,this._cursorStyle);if(w?!n(this._cursorStyle,h):y.length>0){this._nullCellCount>0&&(n(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=d,this._lastContentCursorCol=this._lastCursorCol=m,this._currentRow+=`\x1B[${y.join(";")}m`;let C=this._buffer.getLine(d);C!==void 0&&(C.getCell(m,this._cursorStyle),this._cursorStyleRow=d,this._cursorStyleCol=m)}w?this._nullCellCount+=h.getWidth():(this._nullCellCount>0&&(n(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=h.getChars(),this._lastContentCursorRow=this._lastCursorRow=d,this._lastContentCursorCol=this._lastCursorCol=m+h.getWidth())}_serializeString(h){let v=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(v=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let d="";for(let C=0;C<v;C++)d+=this._allRows[C],C+1<v&&(d+=this._allRowSeparators[C]);if(!h){let C=this._buffer.baseY+this._buffer.cursorY,M=this._buffer.cursorX,b=E=>{E>0?d+=`\x1B[${E}C`:E<0&&(d+=`\x1B[${-E}D`)};(C!==this._lastCursorRow||M!==this._lastCursorCol)&&((m=C-this._lastCursorRow)>0?d+=`\x1B[${m}B`:m<0&&(d+=`\x1B[${-m}A`),b(M-this._lastCursorCol))}var m;let w=this._terminal._core._inputHandler._curAttrData,y=this._diffStyle(w,this._cursorStyle);return y.length>0&&(d+=`\x1B[${y.join(";")}m`),d}}i.SerializeAddon=class{activate(p){this._terminal=p}_serializeBufferByScrollback(p,h,v){let d=h.length,m=v===void 0?d:c(v+p.rows,0,d);return this._serializeBufferByRange(p,h,{start:d-m,end:d-1},!1)}_serializeBufferByRange(p,h,v,d){return new g(h,p).serialize({start:{x:0,y:typeof v.start=="number"?v.start:v.start.line},end:{x:p.cols,y:typeof v.end=="number"?v.end:v.end.line}},d)}_serializeBufferAsHTML(p,h){var w;let v=p.buffer.active,d=new f(v,p,h);if(!h.onlySelection){let y=v.length,C=h.scrollback,M=C===void 0?y:c(C+p.rows,0,y);return d.serialize({start:{x:0,y:y-M},end:{x:p.cols,y:y-1}})}let m=(w=this._terminal)==null?void 0:w.getSelectionPosition();return m!==void 0?d.serialize({start:{x:m.start.x,y:m.start.y},end:{x:m.end.x,y:m.end.y}}):""}_serializeModes(p){let h="",v=p.modes;if(v.applicationCursorKeysMode&&(h+="\x1B[?1h"),v.applicationKeypadMode&&(h+="\x1B[?66h"),v.bracketedPasteMode&&(h+="\x1B[?2004h"),v.insertMode&&(h+="\x1B[4h"),v.originMode&&(h+="\x1B[?6h"),v.reverseWraparoundMode&&(h+="\x1B[?45h"),v.sendFocusMode&&(h+="\x1B[?1004h"),v.wraparoundMode===!1&&(h+="\x1B[?7l"),v.mouseTrackingMode!=="none")switch(v.mouseTrackingMode){case"x10":h+="\x1B[?9h";break;case"vt200":h+="\x1
layout (location = 0) in vec2 a_unitquad;
layout (location = 1) in vec2 a_cellpos;
layout (location = 2) in vec2 a_offset;
layout (location = 3) in vec2 a_size;
layout (location = 4) in float a_texpage;
layout (location = 5) in vec2 a_texcoord;
layout (location = 6) in vec2 a_texsize;
uniform mat4 u_projection;
uniform vec2 u_resolution;
out vec2 v_texcoord;
flat out int v_texpage;
void main() {
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
v_texpage = int(a_texpage);
v_texcoord = a_texcoord + a_unitquad * a_texsize;
}`,function(Y){let P="";for(let N=1;N<Y;N++)P+=` else if (v_texpage == ${N}) { outColor = texture(u_texture[${N}], v_texcoord); }`;return`#version 300 es
precision lowp float;
in vec2 v_texcoord;
flat in int v_texpage;
uniform sampler2D u_texture[${Y}];
out vec4 outColor;
void main() {
if (v_texpage == 0) {
outColor = texture(u_texture[0], v_texcoord);
} ${P}
}`}(l.TextureAtlas.maxAtlasPages))),this.register((0,u.toDisposable)(()=>S.deleteProgram(this._program))),this._projectionLocation=(0,o.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,o.throwIfFalsy)(S.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,o.throwIfFalsy)(S.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let k=new Float32Array([0,0,1,0,0,1,1,1]),I=S.createBuffer();this.register((0,u.toDisposable)(()=>S.deleteBuffer(I))),S.bindBuffer(S.ARRAY_BUFFER,I),S.bufferData(S.ARRAY_BUFFER,k,S.STATIC_DRAW),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let H=new Uint8Array([0,1,2,3]),R=S.createBuffer();this.register((0,u.toDisposable)(()=>S.deleteBuffer(R))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,R),S.bufferData(S.ELEMENT_ARRAY_BUFFER,H,S.STATIC_DRAW),this._attributesBuffer=(0,o.throwIfFalsy)(S.createBuffer()),this.register((0,u.toDisposable)(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,2,S.FLOAT,!1,p,0),S.vertexAttribDivisor(2,1),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,S.FLOAT,!1,p,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(3,1),S.enableVertexAttribArray(4),S.vertexAttribPointer(4,1,S.FLOAT,!1,p,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(4,1),S.enableVertexAttribArray(5),S.vertexAttribPointer(5,2,S.FLOAT,!1,p,5*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(5,1),S.enableVertexAttribArray(6),S.vertexAttribPointer(6,2,S.FLOAT,!1,p,7*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(6,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,p,9*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.useProgram(this._program);let T=new Int32Array(l.TextureAtlas.maxAtlasPages);for(let Y=0;Y<l.TextureAtlas.maxAtlasPages;Y++)T[Y]=Y;S.uniform1iv(this._textureLocation,T),S.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),this._atlasTextures=[];for(let Y=0;Y<l.TextureAtlas.maxAtlasPages;Y++){let P=new g.GLTexture((0,o.throwIfFalsy)(S.createTexture()));this.register((0,u.toDisposable)(()=>S.deleteTexture(P.texture))),S.activeTexture(S.TEXTURE0+Y),S.bindTexture(S.TEXTURE_2D,P.texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,1,1,0,S.RGBA,S.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Y]=P}S.enable(S.BLEND),S.blendFunc(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(C,M,b,E,S,k,I,H,R){this._updateCell(this._vertices.attributes,C,M,b,E,S,k,I,H,R)}_updateCell(C,M,b,E,S,k,I,H,R,T){v=(b*this._terminal.cols+M)*f,E!==n.NULL_CELL_CODE&&E!==void 0?this._atlas&&(h=H&&H.length>1?this._atlas.getRasterizedGlyphCombinedChar(H,S,k,I,!1):this._atlas.getRasterizedGlyph(E,S,k,I,!1),d=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),S!==T&&h.offset.x>d?(m=h.offset.x-d,C[v]=-(h.offset.x-m)+this._dimensions.device.char.left,C[v+1]=-h.offset.y+this._dimensions.device.char.top,C[v+2]=(h.size.x-m)/this._dimensions.device.canvas.width,C[v+3]=h.size.y/this._dimensions.device.canvas.height,C[v+4]=h.texturePage,C[v+5]=h.texturePositionClipSpace.x+m/this._atlas.pages[h.texturePage].canvas.width,C[v+6]=h.texturePositionClipSpace.y,C[v+7]=h.sizeClipSpace.x-m/this._atlas.pages[h.texturePage].canvas.width,C[v+8]=h.sizeClipSpace.y):(C[v]=-h.offset.x+this._dimensions.device.char.left,C[v+1]=-h.offset.y+this._dimensions.device.char.top,C[v+2]=h.size.x/this._dimensions.device.canvas.width,C[v+3]=h.size.y/this._dimensions.device.canvas.height,C[v+4]=h.texturePage,C[v+5]=h.texturePositionClipSpace.x,C[v+6]=h.texturePositionClipSpace.y,C[v+7]=h.sizeClipSpace.x,C[v+8]=h.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,o.all
layout (location = 0) in vec2 a_position;
layout (location = 1) in vec2 a_size;
layout (location = 2) in vec4 a_color;
layout (location = 3) in vec2 a_unitquad;
uniform mat4 u_projection;
out vec4 v_color;
void main() {
vec2 zeroToOne = a_position + (a_unitquad * a_size);
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
v_color = a_color;
}`,`#version 300 es
precision lowp float;
in vec4 v_color;
out vec4 outColor;
void main() {
outColor = v_color;
}`)),this.register((0,l.toDisposable)(()=>I.deleteProgram(this._program))),this._projectionLocation=(0,o.throwIfFalsy)(I.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=I.createVertexArray(),I.bindVertexArray(this._vertexArrayObject);let H=new Float32Array([0,0,1,0,0,1,1,1]),R=I.createBuffer();this.register((0,l.toDisposable)(()=>I.deleteBuffer(R))),I.bindBuffer(I.ARRAY_BUFFER,R),I.bufferData(I.ARRAY_BUFFER,H,I.STATIC_DRAW),I.enableVertexAttribArray(3),I.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let T=new Uint8Array([0,1,2,3]),Y=I.createBuffer();this.register((0,l.toDisposable)(()=>I.deleteBuffer(Y))),I.bindBuffer(I.ELEMENT_ARRAY_BUFFER,Y),I.bufferData(I.ELEMENT_ARRAY_BUFFER,T,I.STATIC_DRAW),this._attributesBuffer=(0,o.throwIfFalsy)(I.createBuffer()),this.register((0,l.toDisposable)(()=>I.deleteBuffer(this._attributesBuffer))),I.bindBuffer(I.ARRAY_BUFFER,this._attributesBuffer),I.enableVertexAttribArray(0),I.vertexAttribPointer(0,2,I.FLOAT,!1,g,0),I.vertexAttribDivisor(0,1),I.enableVertexAttribArray(1),I.vertexAttribPointer(1,2,I.FLOAT,!1,g,2*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(1,1),I.enableVertexAttribArray(2),I.vertexAttribPointer(2,4,I.FLOAT,!1,g,4*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(2,1),this._updateCachedColors(k.colors),this.register(this._themeService.onChangeColors(P=>{this._updateCachedColors(P),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){let E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),E.uniformMatrix4fv(this._projectionLocation,!1,u.PROJECTION_MATRIX),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,b.attributes,E.DYNAMIC_DRAW),E.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,b.count)}handleResize(){this._updateViewportRectangle()}setDimensions(b){this._dimensions=b}_updateCachedColors(b){this._bgFloat=this._colorToFloat32Array(b.background),this._cursorFloat=this._colorToFloat32Array(b.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(b){let E=this._terminal,S=this._vertices,k,I,H,R,T,Y,P,N,_,V,W,q=1;for(k=0;k<E.rows;k++){for(H=-1,R=0,T=0,Y=!1,I=0;I<E.cols;I++)P=(k*E.cols+I)*n.RENDER_MODEL_INDICIES_PER_CELL,N=b.cells[P+n.RENDER_MODEL_BG_OFFSET],_=b.cells[P+n.RENDER_MODEL_FG_OFFSET],V=!!(67108864&_),(N!==R||_!==T&&(Y||V))&&((R!==0||Y&&T!==0)&&(W=8*q++,this._updateRectangle(S,W,T,R,H,I,k)),H=I,R=N,T=_,Y=V);(R!==0||Y&&T!==0)&&(W=8*q++,this._updateRectangle(S,W,T,R,H,E.cols,k))}S.count=q}updateCursor(b){let E=this._verticesCursor,S=b.cursor;if(!S||S.style==="block")return void(E.count=0);let k,I=0;S.style!=="bar"&&S.style!=="outline"||(k=8*I++,this._addRectangleFloat(E.attributes,k,S.x*this._dimensions.device.cell.width,S.y*this._dimensions.device.cell.height,S.style==="bar"?S.dpr*S.cursorWidth:S.dpr,this._dimensions.device.cell.height,this._cursorFloat)),S.style!=="underline"&&S.style!=="outline"||(k=8*I++,this._addRectangleFloat(E.attributes,k,S.x*this._dimensions.device.cell.width,(S.y+1)*this._dimensions.device.cell.height-S.dpr,S.width*this._dimensions.device.cell.width,S.dpr,this._cursorFloat)),S.style==="outline"&&(k=8*I++,this._addRectangleFloat(E.attributes,k,S.x*this._dimensions.device.cell.width,S.y*this._dimensions.device.cell.height,S.width*this._dimensions.device.cell.width,S.dpr,this._cursorFloat),k=8*I++,this._addRectangleFloat(E.attributes,k,(S.x+S.width)*this._dimensions.device.cell.width-S.dpr,S.y*this._dimensions.device.cell.height,S.dpr,this._dimensions.device.cell.height,this._cursorFloat)),E.count=I}_updateRectangle(b,E,S,k,I,H,R){if(67108864&S)switch(50331648&S){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&S].rgba;break;case 50331648:p=(16777215&S)<<8;break;default:p=this._themeService.colors.foreground.rgba}else
`))),this.register(this._terminal.onA11yTab(C=>this._handleTab(C))),this.register(this._terminal.onKey(C=>this._handleKey(C.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let m=0;m<d;m++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),/\p{Control}/u.test(d)||this._charsToConsume.push(d)}_refreshRows(d,m){this._liveRegionDebouncer.refresh(d,m,this._terminal.rows)}_renderRows(d,m){let w=this._terminal.buffer,y=w.lines.length.toString();for(let C=d;C<=m;C++){let M=w.lines.get(w.ydisp+C),b=[],E=(M==null?void 0:M.translateToString(!0,void 0,void 0,b))||"",S=(w.ydisp+C+1).toString(),k=this._rowElements[C];k&&(E.length===0?(k.innerText="\xA0",this._rowColumns.set(k,[0,1])):(k.textContent=E,this._rowColumns.set(k,b)),k.setAttribute("aria-posinset",S),k.setAttribute("aria-setsize",y))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,m){let w=d.target,y=this._rowElements[m===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==y)return;let C,M;if(m===0?(C=w,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(C=this._rowElements.shift(),M=w,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){let b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{let b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var E,S;if(this._rowElements.length===0)return;let d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let m={node:d.anchorNode,offset:d.anchorOffset},w={node:d.focusNode,offset:d.focusOffset};if((m.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||m.node===w.node&&m.offset>w.offset)&&([m,w]=[w,m]),m.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(m={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(m.node))return;let y=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:y,offset:(S=(E=y.textContent)==null?void 0:E.length)!=null?S:0}),!this._rowContainer.contains(w.node))return;let C=({node:k,offset:I})=>{let H=k instanceof Text?k.parentNode:k,R=parseInt(H==null?void 0:H.getAttribute("aria-posinset"),10)-1;if(isNaN(R))return console.warn("row is invalid. Race condition?"),null;let T=this._rowColumns.get(H);if(!T)return console.warn("columns is null. Race condition?"),null;let Y=I<T.length?T[I]:T.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++R,Y=0),{row:R,column:Y}},M=C(m),b=C(w);if(M&&b){if(M.row>b.row||M.row===b.row&&M.column>=b.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(b.row-M.row)*this._terminal.cols-M.column+b.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus
WARNING: This link could potentially be dangerous`)){let v=window.open();if(v){try{v.opener=null}catch(d){}v.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=g=o([l(0,u.IBufferService),l(1,u.IOptionsService),l(2,u.IOscLinkService)],g)},6193:(i,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,o){this._renderCallback=c,this._coreBrowserService=o,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,o,l){this._rowCount=l,c=c!==void 0?c:0,o=o!==void 0?o:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,o):o,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();let c=Math.max(this._rowStart,0),o=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,o),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(i,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;let o=c(3614),l=c(3656),n=c(3551),u=c(9042),g=c(3730),f=c(1680),p=c(3107),h=c(5744),v=c(2950),d=c(1296),m=c(428),w=c(4269),y=c(5114),C=c(8934),M=c(3230),b=c(9312),E=c(4725),S=c(6731),k=c(8055),I=c(8969),H=c(8460),R=c(844),T=c(6114),Y=c(8437),P=c(2584),N=c(7399),_=c(5941),V=c(9074),W=c(2585),q=c(5435),a1=c(4567),c1=c(779);class m1 extends I.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(e1={}){super(e1),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new R.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(V.DecorationService),this._instantiationService.setService(W.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(c1.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((j,h1)=>this.refresh(j,h1))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRe
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),v.isLinux&&b&&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(b){let E=this._getMouseBufferCoords(b),S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(S&&k&&E)&&this._areCoordsInSelection(E,S,k)}isCellInSelection(b,E){let S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k)&&this._areCoordsInSelection([b,E],S,k)}_areCoordsInSelection(b,E,S){return b[1]>E[1]&&b[1]<S[1]||E[1]===S[1]&&b[1]===E[1]&&b[0]>=E[0]&&b[0]<S[0]||E[1]<S[1]&&b[1]===S[1]&&b[0]<S[0]||E[1]<S[1]&&b[1]===E[1]&&b[0]>=E[0]}_selectWordAtCursor(b,E){var I,H;let S=(H=(I=this._linkifier.currentLink)==null?void 0:I.link)==null?void 0:H.range;if(S)return this._model.selectionStart=[S.start.x-1,S.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(S,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let k=this._getMouseBufferCoords(b);return!!k&&(this._selectWordAt(k,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,E){this._model.clearSelection(),b=Math.max(b,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){let E=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(b){let E=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1],S=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=S?0:(E>S&&(E-=S),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(b){return v.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.leng
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL="\x7F"}(c||(a.C0=c={})),function(n){n.PAD="\x80",n.HOP="\x81",n.BPH="\x82",n.NBH="\x83",n.IND="\x84",n.NEL="\x85",n.SSA="\x86",n.ESA="\x87",n.HTS="\x88",n.HTJ="\x89",n.VTS="\x8A",n.PLD="\x8B",n.PLU="\x8C",n.RI="\x8D",n.SS2="\x8E",n.SS3="\x8F",n.DCS="\x90",n.PU1="\x91",n.PU2="\x92",n.STS="\x93",n.CCH="\x94",n.MW="\x95",n.SPA="\x96",n.EPA="\x97",n.SOS="\x98",n.SGCI="\x99",n.SCI="\x9A",n.CSI="\x9B",n.ST="\x9C",n.OSC="\x9D",n.PM="\x9E",n.APC="\x9F"}(o||(a.C1=o={})),function(n){n.ST=`${c.ESC}\\`}(l||(a.C1_ESCAPED=l={}))},7399:(i,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;let o=c(2584),l={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:["'",'"']};a.evaluateKeyboardEvent=function(n,u,g,f){let p={type:0,cancel:!1,key:void 0},h=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?p.key=u?o.C0.ESC+"OA":o.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?p.key=u?o.C0.ESC+"OD":o.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?p.key=u?o.C0.ESC+"OC":o.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(p.key=u?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 8:p.key=n.ctrlKey?"\b":o.C0.DEL,n.altKey&&(p.key=o.C0.ESC+p.key);break;case 9:if(n.shiftKey){p.key=o.C0.ESC+"[Z";break}p.key=o.C0.HT,p.cancel=!0;break;case 13:p.key=n.altKey?o.C0.ESC+o.C0.CR:o.C0.CR,p.cancel=!0;break;case 27:p.key=o.C0.ESC,n.altKey&&(p.key=o.C0.ESC+o.C0.ESC),p.cancel=!0;break;case 37:if(n.metaKey)break;h?(p.key=o.C0.ESC+"[1;"+(h+1)+"D",p.key===o.C0.ESC+"[1;3D"&&(p.key=o.C0.ESC+(g?"b":"[1;5D"))):p.key=u?o.C0.ESC+"OD":o.C0.ESC+"[D";break;case 39:if(n.metaKey)break;h?(p.key=o.C0.ESC+"[1;"+(h+1)+"C",p.key===o.C0.ESC+"[1;3C"&&(p.key=o.C0.ESC+(g?"f":"[1;5C"))):p.key=u?o.C0.ESC+"OC":o.C0.ESC+"[C";break;case 38:if(n.metaKey)break;h?(p.key=o.C0.ESC+"[1;"+(h+1)+"A",g||p.key!==o.C0.ESC+"[1;3A"||(p.key=o.C0.ESC+"[1;5A")):p.key=u?o.C0.ESC+"OA":o.C0.ESC+"[A";break;case 40:if(n.metaKey)break;h?(p.key=o.C0.ESC+"[1;"+(h+1)+"B",g||p.key!==o.C0.ESC+"[1;3B"||(p.key=o.C0.ESC+"[1;5B")):p.key=u?o.C0.ESC+"OB":o.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(p.key=o.C0.ESC+"[2~");break;case 46:p.key=h?o.C0.ESC+"[3;"+(h+1)+"~":o.C0.ESC+"[3~";break;case 36:p.key=h?o.C0.ESC+"[1;"+(h+1)+"H":u?o.C0.ESC+"OH":o.C0.ESC+"[H";break;case 35:p.key=h?o.C0.ESC+"[1;"+(h+1)+"F":u?o.C0.ESC+"OF":o.C0.ESC+"[F";break;case 33:n.shiftKey?p.type=2:n.ctrlKey?p.key=o.C0.ESC+"[5;"+(h+1)+"~":p.key=o.C0.ESC+"[5~";break;case 34:n.shiftKey?p.type=3:n.ctrlKey?p.key=o.C0.ESC+"[6;"+(h+1)+"~":p.key=o.C0.ESC+"[6~";break;case 112:p.key=h?o.C0.ESC+"[1;"+(h+1)+"P":o.C0.ESC+"OP";break;case 113:p.key=h?o.C0.ESC+"[1;"+(h+1)+"Q":o.C0.ESC+"OQ";break;case 114:p.key=h?o.C0.ESC+"[1;"+(h+1)+"R":o.C0.ESC+"OR";break;case 115:p.key=h?o.C0.ESC+"[1;"+(h+1)+"S":o.C0.ESC+"OS";break;case 116:p.key=h?o.C0.ESC+"[15;"+(h+1)+"~":o.C0.ESC+"[15~";break;case 117:p.key=h?o.C0.ESC+"[17;"+(h+1)+"~":o.C0.ESC+"[17~";break;case 118:p.key=h?o.C0.ESC+"[18;"+(h+1)+"~":o.C0.ESC+"[18~";break;case 119:p.key=h?o.C0.ESC+"[19;"+(h+1)+"~":o.C0.ESC+"[19~";break;case 120:p.key=h?o.C0.ESC+"[20;"+(h+1)+"~":o.C0.ESC+"[20~";break;case 121:p.key=h?o.C0.ESC+"[21;"+(h+1)+"~":o.C0.ESC+"[21~";break;case 122:p.key=h?o.C0.ESC+"[23;"+(h+1)+"~":o.C0.ESC+"[23~";break;case 123:p.key=h?o.C0.ESC+"[24;"+(h+1)+"~":o.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(g&&!f||!n.altKey||n.metaKey)!g||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?p.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(p.key=o.C0.US),n.key==="@"&&(p.key=o.C0.NUL)):n.keyCode===65&&(p.type=1);else{let
`,d)}paste(v){this._core.paste(v)}refresh(v,d){this._verifyIntegers(v,d),this._core.refresh(v,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return a}_verifyIntegers(...v){for(let d of v)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(let d of v)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}i.Terminal=p})(),r})())});var CH=o1((xD1,r6)=>{x();/*!
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var z2=require("fs"),Qu=require("os"),i4=require("path"),rH=require("crypto"),w5={fs:z2.constants,os:Qu.constants},iH="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",oH=/XXXXXX/,v21=3,nH=(w5.O_CREAT||w5.fs.O_CREAT)|(w5.O_EXCL||w5.fs.O_EXCL)|(w5.O_RDWR||w5.fs.O_RDWR),f21=Qu.platform()==="win32",A21=w5.EBADF||w5.os.errno.EBADF,C21=w5.ENOENT||w5.os.errno.ENOENT,lH=448,hH=384,w21="exit",F9=[],uH=z2.rmdirSync.bind(z2),gH=!1;function z21(e,t){return z2.rm(e,{recursive:!0},t)}function pH(e){return z2.rmSync(e,{recursive:!0})}function Gu(e,t){let s=_9(e,t),r=s[0],i=s[1];try{vH(r)}catch(c){return i(c)}let a=r.tries;(function c(){try{let o=dH(r);z2.stat(o,function(l){if(!l)return a-- >0?c():i(new Error("Could not get a unique tmp filename, max tries reached "+o));i(null,o)})}catch(o){i(o)}})()}function Ku(e){let t=_9(e),s=t[0];vH(s);let r=s.tries;do{let i=dH(s);try{z2.statSync(i)}catch(a){return i}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function b21(e,t){let s=_9(e,t),r=s[0],i=s[1];Gu(r,function(c,o){if(c)return i(c);z2.open(o,nH,r.mode||hH,function(n,u){if(n)return i(n);if(r.discardDescriptor)return z2.close(u,function(f){return i(f,o,void 0,Tu(o,-1,r,!1))});{let g=r.discardDescriptor||r.detachDescriptor;i(null,o,u,Tu(o,g?-1:u,r,!1))}})})}function y21(e){let t=_9(e),s=t[0],r=s.discardDescriptor||s.detachDescriptor,i=Ku(s);var a=z2.openSync(i,nH,s.mode||hH);return s.discardDescriptor&&(z2.closeSync(a),a=void 0),{name:i,fd:a,removeCallback:Tu(i,r?-1:a,s,!0)}}function M21(e,t){let s=_9(e,t),r=s[0],i=s[1];Gu(r,function(c,o){if(c)return i(c);z2.mkdir(o,r.mode||lH,function(n){if(n)return i(n);i(null,o,mH(o,r,!1))})})}function E21(e){let t=_9(e),s=t[0],r=Ku(s);return z2.mkdirSync(r,s.mode||lH),{name:r,removeCallback:mH(r,s,!0)}}function S21(e,t){let s=function(r){if(r&&!Ru(r))return t(r);t()};0<=e[0]?z2.close(e[0],function(){z2.unlink(e[1],s)}):z2.unlink(e[1],s)}function x21(e){let t=null;try{0<=e[0]&&z2.closeSync(e[0])}catch(s){if(!I21(s)&&!Ru(s))throw s}finally{try{z2.unlinkSync(e[1])}catch(s){Ru(s)||(t=s)}}if(t!==null)throw t}function Tu(e,t,s,r){let i=Ec(x21,[t,e],r),a=Ec(S21,[t,e],r,i);return s.keep||F9.unshift(i),r?i:a}function mH(e,t,s){let r=t.unsafeCleanup?z21:z2.rmdir.bind(z2),i=t.unsafeCleanup?pH:uH,a=Ec(i,e,s),c=Ec(r,e,s,a);return t.keep||F9.unshift(a),s?a:c}function Ec(e,t,s,r){let i=!1;return function a(c){if(!i){let o=r||a,l=F9.indexOf(o);return l>=0&&F9.splice(l,1),i=!0,s||e===uH||e===pH?e(t):e(t,c||function(){})}}}function L21(){if(gH)for(;F9.length;)try{F9[0]()}catch(e){}}function cH(e){let t=[],s=null;try{s=rH.randomBytes(e)}catch(i){s=rH.pseudoRandomBytes(e)}for(var r=0;r<e;r++)t.push(iH[s[r]%iH.length]);return t.join("")}function B21(e){return e===null||T3(e)||!e.trim()}function T3(e){return typeof e=="undefined"}function _9(e,t){if(typeof e=="function")return[{},e];if(T3(e))return[{},t];let s={};for(let r of Object.getOwnPropertyNames(e))s[r]=e[r];return[s,t]}function dH(e){let t=e.tmpdir;if(!T3(e.name))return i4.join(t,e.dir,e.name);if(!T3(e.template))return i4.join(t,e.dir,e.template).replace(oH,cH(6));let s=[e.prefix?e.prefix:"tmp","-",process.pid,"-",cH(12),e.postfix?"-"+e.postfix:""].join("");return i4.join(t,e.dir,s)}function vH(e){e.tmpdir=AH(e);let t=e.tmpdir;if(T3(e.name)||_u(e.name,"name",t),T3(e.dir)||_u(e.dir,"dir",t),!T3(e.template)&&(_u(e.template,"template",t),!e.template.match(oH)))throw new Error(`Invalid template, found "${e.template}".`);if(!T3(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);e.tries=T3(e.name)?e.tries||v21:1,e.keep=!!e.keep,e.detachDescriptor=!!e.detachDescriptor,e.discardDescriptor=!!e.discardDescriptor,e.unsafeCleanup=!!e.unsafeCleanup,e.dir=T3(e.dir)?"":i4.relative(t,Ou(e.dir,t)),e.template=T3(e.template)?void 0:i4.relative(t,Ou(e.template,t)),e.template=B21(e.template)?void 0:i4.relative(e.dir,e.template),e.name=T3(e.name)?void 0:e.name,e.prefix=T3(e.prefix)?"":e.prefix,e.postfix=T3(e.postfix)?"":e.postfix}function Ou(e,t){return e.startsWith(t)?i4.resolve(e):i4.res
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/var Dx=T1(Yo(),1),Hx=T1(er(),1);x();var tr=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},d4=(...e)=>e.reduce((t,s)=>{if(s===void 0)return t;if(Array.isArray(s))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(s).forEach(r=>{["__proto__","constructor","prototype"].includes(r)||(Array.isArray(t[r])&&Array.isArray(s[r])?t[r]=d4.options.mergeArrays?d4.options.uniqueArrayItems?Array.from(new Set(t[r].concat(s[r]))):[...t[r],...s[r]]:s[r]:tr(t[r])&&tr(s[r])?t[r]=d4(t[r],s[r]):!tr(t[r])&&tr(s[r])?t[r]=d4(s[r],void 0):t[r]=s[r]===void 0?d4.options.allowUndefinedOverrides?s[r]:t[r]:s[r])}),t},{}),Zo={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};d4.options=Zo;d4.withOptions=(e,...t)=>{d4.options=Object.assign(Object.assign({},Zo),e);let s=d4(...t);return d4.options=Zo,s};x();x();var qv="5";var Xv,$v,ef;typeof window!="undefined"&&((ef=($v=(Xv=window.__svelte)!=null?Xv:window.__svelte={}).v)!=null?ef:$v.v=new Set).add(qv);x();x();x();var k8="[";var Se="]",H6={};var M2=Symbol(),U4=Symbol("filename"),tf=Symbol("hmr"),sf="http://www.w3.org/1999/xhtml";x();x();x();x();var sr=!0;x();var rf,cf,af=(cf=(rf=globalThis.process)==null?void 0:rf.env)==null?void 0:cf.NODE_ENV,B1=af&&!af.toLowerCase().startsWith("prod");x();x();var V4=Array.isArray,of=Array.prototype.indexOf,jo=Array.from,No=Object.keys,F2=Object.defineProperty,y3=Object.getOwnPropertyDescriptor,ar=Object.getOwnPropertyDescriptors,Jo=Object.prototype,nf=Array.prototype,C7=Object.getPrototypeOf,Wo=Object.isExtensible;function qo(e){return typeof e=="function"}var n3=()=>{};function xe(e){for(var t=0;t<e.length;t++)e[t]()}x();x();var N2=Symbol("$state"),Le=Symbol("legacy props"),lf=Symbol(""),rr=Symbol("proxy path");x();x();function ir(e){return e===this.v}function Be(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function D8(e){return!Be(e,this.v)}x();function Xo(){if(B1){let e=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function hf(){if(B1){let e=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function uf(e){if(B1){let t=new Error(`effect_in_teardown
\`${e}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function gf(){if(B1){let e=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function pf(e){if(B1){let t=new Error(`effect_orphan
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function mf(){if(B1){let e=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function df(){if(B1){let e=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function vf(e){if(B1){let t=new Error(`props_invalid_value
Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_invalid_value")}function ff(e){if(B1){let t=new Error(`rune_outside_svelte
The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function Af(){if(B1){let e=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Cf(){if(B1){let e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wf(){if(B1){let e=new Error("state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}x();var Q5=!1,o5=!1;x();x();x();var Ie=null;function G5(e){let t=Error(),s=t.stack;if(s){let r=s.split(`
`),i=[`
`];for(let a=0;a<r.length;a++){let c=r[a];if(c!=="Error"){if(c.includes("validate_each_keys"))return null;c.includes("svelte/src/internal")||i.push(c)}}if(i.length===1)return null;F2(t,"stack",{value:i.join(`
`)}),F2(t,"name",{value:`${e}Error`})}return t}function n5(e,t){return e.label=t,cr(e.v,t),e}function cr(e,t){var s;return(s=e==null?void 0:e[rr])==null||s.call(e,t),e}x();x();function or(e){if(B1){let t=new Error(`lifecycle_outside_component
\`${e}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var S0=null;function ke(e){S0=e}var P4=null;function De(e){P4=e}function He(e,t=!1,s){var r=S0={p:S0,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Q5&&!t&&(S0.l={s:null,u:null,r1:[],r2:K5(!1)}),J3(()=>{r.d=!0}),B1&&(S0.function=s,P4=s)}function Fe(e){var c,o;let t=S0;if(t!==null){e!==void 0&&(t.x=e);let l=t.e;if(l!==null){var s=n0,r=f0;t.e=null;try{for(var i=0;i<l.length;i++){var a=l[i];E2(a.effect),g2(a.reaction),h3(a.fn)}}finally{E2(s),g2(r)}}S0=t.p,B1&&(P4=(o=(c=t.p)==null?void 0:c.function)!=null?o:null),t.m=!0}return e||{}}function l5(){return!Q5||S0!==null&&S0.l===null}x();var gP=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Y4(e){if(typeof e!="object"||e===null||N2 in e)return e;let t=C7(e);if(t!==Jo&&t!==nf)return e;var s=new Map,r=V4(e),i=W3(0),a=B1&&o5?G5("CreatedAt"):null,c=f0,o=u=>{var g=f0;g2(c);var f=u();return g2(g),f};r&&s.set("length",W3(e.length,a));var l="";function n(u){l=u,n5(i,`${l} version`);for(let[g,f]of s)n5(f,w7(l,g))}return new Proxy(e,{defineProperty(u,g,f){return(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Af(),o(()=>{var p=s.get(g);p===void 0?(p=W3(f.value,a),s.set(g,p),B1&&typeof g=="string"&&n5(p,w7(l,g))):A2(p,f.value,!0)}),!0},deleteProperty(u,g){var f=s.get(g);if(f===void 0){if(g in u){let v=o(()=>W3(M2,a));s.set(g,v),en(i),B1&&n5(v,w7(l,g))}}else{if(r&&typeof g=="string"){var p=s.get("length"),h=Number(g);Number.isInteger(h)&&h<p.v&&A2(p,h)}A2(f,M2),en(i)}return!0},get(u,g,f){var d;if(g===N2)return e;if(B1&&g===rr)return n;var p=s.get(g),h=g in u;if(p===void 0&&(!h||(d=y3(u,g))!=null&&d.writable)&&(p=o(()=>{var m=Y4(h?u[g]:M2),w=W3(m,a);return B1&&n5(w,w7(l,g)),w}),s.set(g,p)),p!==void 0){var v=v0(p);return v===M2?void 0:v}return Reflect.get(u,g,f)},getOwnPropertyDescriptor(u,g){var f=Reflect.getOwnPropertyDescriptor(u,g);if(f&&"value"in f){var p=s.get(g);p&&(f.value=v0(p))}else if(f===void 0){var h=s.get(g),v=h==null?void 0:h.v;if(h!==void 0&&v!==M2)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return f},has(u,g){var v;if(g===N2)return!0;var f=s.get(g),p=f!==void 0&&f.v!==M2||Reflect.has(u,g);if(f!==void 0||n0!==null&&(!p||(v=y3(u,g))!=null&&v.writable)){f===void 0&&(f=o(()=>{var d=p?Y4(u[g]):M2,m=W3(d,a);return B1&&n5(m,w7(l,g)),m}),s.set(g,f));var h=v0(f);if(h===M2)return!1}return p},set(u,g,f,p){var b;var h=s.get(g),v=g in u;if(r&&g==="length")for(var d=f;d<h.v;d+=1){var m=s.get(d+"");m!==void 0?A2(m,M2):d in u&&(m=o(()=>W3(M2,a)),s.set(d+"",m),B1&&n5(m,w7(l,d)))}if(h===void 0)(!v||(b=y3(u,g))!=null&&b.writable)&&(h=o(()=>{var E=W3(void 0,a);return A2(E,Y4(f)),E}),s.set(g,h),B1&&n5(h,w7(l,g)));else{v=h.v!==M2;var w=o(()=>Y4(f));A2(h,w)}var y=Reflect.getOwnPropertyDescriptor(u,g);if(y!=null&&y.set&&y.set.call(p,f),!v){if(r&&typeof g=="string"){var C=s.get("length"),M=Number(g);Number.isInteger(M)&&M>=C.v&&A2(C,M+1)}en(i)}return!0},ownKeys(u){v0(i);var g=Reflect.ownKeys(u).filter(h=>{var v=s.get(h);return v===void 0||v.v!==M2});for(var[f,p]of s)p.v!==M2&&!(f in u)&&g.push(f);return g},setPrototypeOf(){Cf()}})}function w7(e,t){var s;return typeof t=="symbol"?`${e}[Symbol(${(s=t.description)!=null?s:""})]`:gP.test(t)?`${e}.${t}`:/^\d+$/.test(t)?`${e}[${t}]`:`${e}['${t}']`}function en(e,t=1){A2(e,e.v+t)}function nr(e){try{if(e!==null&&typeof e=="object"&&N2 in e)return e[N2]}catch(t){}return e}x();function F6(e){var t=2050,s=f0!==null&&(f0.f&2)!==0?f0:null;n0===null||s!==null&&(s.f&256)!==0?t|=256:n0.f|=1048576;let r={ctx:S0,deps:null,effects:null,equals:ir,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:s!=null?s:n0};return B1&&o5&&(r.created=G5("CreatedAt")),r}function ur(e){let t=F6(e);return t.equals=D8,t}function lr(e){var t=e.effects;if(t!==null){e.effects=null;for(var s=0;s<t.length;s+=1)W2(t[s])}}var tn=[];function pP(e){for(var t=e.parent;t!==null;){if((t.f&2)===0)return t;t=t.parent}return null}function rn(e){var t,s=n0;if(E2(pP(e)),B1){let r=z7;sn(new Set);try{tn.includes(e)&&hf(),tn.push(e),
%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${s}\`, will be ignored in favour of the server value
https://svelte.dev/e/hydration_attribute_changed`,Oe,Re):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function _8(e){B1?console.warn(`%c[svelte] hydration_mismatch
%c${e?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${e}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,Oe,Re):console.warn("https://svelte.dev/e/hydration_mismatch")}function Ef(){B1?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,Oe,Re):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function pr(e){B1?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,Oe,Re):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Sf(e){B1?console.warn(`%c[svelte] transition_slide_display
%cThe \`slide\` transition does not work correctly for elements with \`display: ${e}\`
https://svelte.dev/e/transition_slide_display`,Oe,Re):console.warn("https://svelte.dev/e/transition_slide_display")}var w0=!1;function Z4(e){w0=e}var F0;function _2(e){if(e===null)throw _8(),H6;return F0=e}function x3(){return _2(f4(F0))}function M7(e){if(w0){if(f4(F0)!==null)throw _8(),H6;F0=e}}x();function xf(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:s,lastIndexOf:r,includes:i}=e;e.indexOf=function(a,c){let o=s.call(this,a,c);if(o===-1){for(let l=c!=null?c:0;l<this.length;l+=1)if(nr(this[l])===a){pr("array.indexOf(...)");break}}return o},e.lastIndexOf=function(a,c){let o=r.call(this,a,c!=null?c:this.length-1);if(o===-1){for(let l=0;l<=(c!=null?c:this.length-1);l+=1)if(nr(this[l])===a){pr("array.lastIndexOf(...)");break}}return o},e.includes=function(a,c){let o=i.call(this,a,c);if(!o){for(let l=0;l<this.length;l+=1)if(nr(this[l])===a){pr("array.includes(...)");break}}return o},Array.__svelte_cleanup=()=>{e.indexOf=s,e.lastIndexOf=r,e.includes=i}}var ln,Lf,Qe,Bf,If;function dr(){if(ln===void 0){ln=window,Lf=document,Qe=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,s=Text.prototype;Bf=y3(t,"firstChild").get,If=y3(t,"nextSibling").get,Wo(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Wo(s)&&(s.__t=void 0),B1&&(e.__svelte_meta=null,xf())}}function Y5(e=""){return document.createTextNode(e)}function L3(e){return Bf.call(e)}function f4(e){return If.call(e)}function E7(e,t){if(!w0)return L3(e);var s=L3(F0);if(s===null)s=F0.appendChild(Y5());else if(t&&s.nodeType!==3){var r=Y5();return s==null||s.before(r),_2(r),r}return _2(s),s}function Z5(e,t=1,s=!1){let r=w0?F0:e;for(var i;t--;)i=r,r=f4(r);if(!w0)return r;var a=r==null?void 0:r.nodeType;if(s&&a!==3){var c=Y5();return r===null?i==null||i.after(c):r.before(c),_2(c),c}return _2(r),r}function vr(e){e.textContent=""}function Df(e){n0===null&&f0===null&&pf(e),f0!==null&&(f0.f&256)!==0&&n0===null&&gf(),U5&&uf(e)}function mP(e,t){var s=t.last;s===null?t.last=t.first=e:(s.next=e,e.prev=s,t.last=e)}function S7(e,t,s,r=!0){var l;var i=n0;if(B1)for(;i!==null&&(i.f&262144)!==0;)i=i.parent;var a={ctx:S0,deps:null,nodes_start:null,nodes_end:null,f:e|2048,first:null,fn:t,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(B1&&(a.component_function=P4),s)try{F8(a),a.f|=32768}catch(n){throw W2(a),n}else t!==null&&Te(a);var c=s&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&1048704)===0;if(!c&&r&&(i!==null&&mP(a,i),f0!==null&&(f0.f&2)!==0)){var o=f0;((l=o.effects)!=null?l:o.effects=[]).push(a)}return a}function J3(e){let t=S7(8,null,!1);return u3(t,1024),t.teardown=e,t}function O8(e){var i;Df("$effect");var t=n0!==null&&(n0.f&32)!==0&&S0!==null&&!S0.m;if(B1&&F2(e,"name",{value:"$effect"}),t){var s=S0;((i=s.e)!=null?i:s.e=[]).push({fn:e,effect:n0,reaction:f0})}else{var r=h3(e);return r}}function gn(e){let t=S7(64,e,!0);return()=>{W2(t)}}function Hf(e){let t=S7(64,e,!0);return(s={})=>new Promise(r=>{s.outro?T6(t,()=>{W2(t),r(void 0)}):(W2(t),r(void 0))})}function h3(e){return S7(4,e,!1)}function q2(e){return S7(8,e,!0)}function Cr(e,t=[],s=F6){if(B1)return q2(()=>{var i=n0,a=()=>e(...c.map(v0));F2(i.fn,"name",{value:"{expression}"}),F2(a,"name",{value:"{expression}"});let c=t.map(s);B3(a)});let r=t.map(s);return B3(()=>e(...r.map(v0)))}function B3(e,t=0){return S7(24|t,e,!0)}function e4(e,t=!0){return S7(40,e,!0,t)}function pn(e){var t=e.teardown;if(t!==null){let s=U5,r=f0;hn(!0),g2(null);try{t.call(null)}finally{hn(s),g2(r)}}}function mn(e,t=!1){var s=e.first;for(e.first=e.last=null;s!==null;){var r=s.next;(s.f&64)!==0?s.parent=null:W2(s,t),s=r}}function Ff(e){for(var t=e.first;t!==null;){var s=t.next;(t.f&32)===0&&W2(t),t=s}}function W2(e,t=!0){var s=!1;(t||(e.f&524288)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(_f(e.nodes_start,e.nodes_end),s=!0),mn(e,t&&!s),Ue(e,0),u3(e,16384);var r=e.transitions;if(r!==null)for(let a of r)a.stop();pn(e);var i=e.parent;i!==null&&i.first!==null&&dn(e),B1&&(e.component_function=null),e.next=e.p
${r}in ${((c=t.fn)==null?void 0:c.name)||"<unknown>"}`,a=t.ctx;a!==null;)i+=`
${r}in ${(o=a.function)==null?void 0:o[U4].split("/").pop()}`,a=a.p;F2(e,"message",{value:e.message+`
${i}
`}),e.stack&&F2(e,"stack",{value:e.stack.split(`
`).filter(l=>!l.includes("svelte/src/internal")).join(`
`)})}}var x7=!1,R8=null,L7=!1,U5=!1;function hn(e){U5=e}var Ze=[],je=[],f0=null,$3=!1;function g2(e){f0=e}var n0=null;function E2(e){n0=e}var E3=null;function on(e){f0!==null&&f0.f&2097152&&(E3===null?E3=[e]:E3.push(e))}var g3=null,t4=0,X3=null;function yf(e){X3=e}var Yf=1,zr=0,V5=!1,br=null;function _e(){return++Yf}function y7(e){var g,f;var t=e.f;if((t&2048)!==0)return!0;if((t&4096)!==0){var s=e.deps,r=(t&256)!==0;if(s!==null){var i,a,c=(t&512)!==0,o=r&&n0!==null&&!V5,l=s.length;if(c||o){var n=e,u=n.parent;for(i=0;i<l;i++)a=s[i],(c||!((g=a==null?void 0:a.reactions)!=null&&g.includes(n)))&&((f=a.reactions)!=null?f:a.reactions=[]).push(n);c&&(n.f^=512),o&&u!==null&&(u.f&256)===0&&(n.f^=256)}for(i=0;i<l;i++)if(a=s[i],y7(a)&&cn(a),a.wv>e.wv)return!0}(!r||n0!==null&&!V5)&&u3(e,1024)}return!1}function Zf(e,t,s=!0){var r=e.reactions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];E3!=null&&E3.includes(e)||((a.f&2)!==0?Zf(a,t,!1):t===a&&(s?u3(a,2048):(a.f&1024)!==0&&u3(a,4096),Te(a)))}}function hr(e){var p,h;var t=g3,s=t4,r=X3,i=f0,a=V5,c=E3,o=S0,l=$3,n=e.f;g3=null,t4=0,X3=null,V5=(n&256)!==0&&($3||!L7||f0===null),f0=(n&96)===0?e:null,E3=null,ke(e.ctx),$3=!1,zr++,e.f|=2097152;try{var u=(0,e.fn)(),g=e.deps;if(g3!==null){var f;if(Ue(e,t4),g!==null&&t4>0)for(g.length=t4+g3.length,f=0;f<g3.length;f++)g[t4+f]=g3[f];else e.deps=g=g3;if(!V5)for(f=t4;f<g.length;f++)((h=(p=g[f]).reactions)!=null?h:p.reactions=[]).push(e)}else g!==null&&t4<g.length&&(Ue(e,t4),g.length=t4);if(l5()&&X3!==null&&!$3&&g!==null&&(e.f&6146)===0)for(f=0;f<X3.length;f++)Zf(X3[f],e);return i!==null&&i!==e&&(zr++,X3!==null&&(r===null?r=X3:r.push(...X3))),u}catch(v){Uf(v)}finally{g3=t,t4=s,X3=r,f0=i,V5=a,E3=c,ke(o),$3=l,e.f^=2097152}}function fP(e,t){let s=t.reactions;if(s!==null){var r=of.call(s,e);if(r!==-1){var i=s.length-1;i===0?s=t.reactions=null:(s[r]=s[i],s.pop())}}s===null&&(t.f&2)!==0&&(g3===null||!g3.includes(t))&&(u3(t,4096),(t.f&768)===0&&(t.f^=512),lr(t),Ue(t,0))}function Ue(e,t){var s=e.deps;if(s!==null)for(var r=t;r<s.length;r++)fP(e,s[r])}function F8(e){var t=e.f;if((t&16384)===0){u3(e,1024);var s=n0,r=L7;if(n0=e,L7=!0,B1){var i=P4;De(e.component_function)}try{(t&16)!==0?Ff(e):mn(e),pn(e);var a=hr(e);if(e.teardown=typeof a=="function"?a:null,e.wv=Yf,B1&&o5&&(e.f&2048)!==0&&e.deps!==null)for(var c of e.deps)c.set_during_effect&&(c.wv=_e(),c.set_during_effect=!1);B1&&je.push(e)}finally{L7=r,n0=s,B1&&De(i)}}}function Vf(){console.error("Last ten effects were: ",je.slice(-10).map(e=>e.fn)),je=[]}function AP(){try{mf()}catch(e){if(B1&&F2(e,"stack",{value:""}),R8!==null)if(B1)try{Ye(e,R8)}catch(t){throw Vf(),t}else Ye(e,R8);else throw B1&&Vf(),e}}function An(){var e=L7;try{var t=0;for(L7=!0;Ze.length>0;){t++>1e3&&AP();var s=Ze,r=s.length;Ze=[];for(var i=0;i<r;i++){var a=wP(s[i]);CP(a)}H8.clear()}}finally{x7=!1,L7=e,R8=null,B1&&(je=[])}}function CP(e){var t=e.length;if(t!==0)for(var s=0;s<t;s++){var r=e[s];(r.f&24576)===0&&y7(r)&&(F8(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null?dn(r):r.fn=null))}}function Te(e){x7||(x7=!0,queueMicrotask(An));for(var t=R8=e;t.parent!==null;){t=t.parent;var s=t.f;if((s&96)!==0){if((s&1024)===0)return;t.f^=1024}}Ze.push(t)}function wP(e){for(var t=[],s=e;s!==null;){var r=s.f,i=(r&96)!==0,a=i&&(r&1024)!==0;if(!a&&(r&8192)===0){(r&4)!==0?t.push(s):i?s.f^=1024:y7(s)&&F8(s);var c=s.first;if(c!==null){s=c;continue}}var o=s.parent;for(s=s.next;s===null&&o!==null;)s=o.next,o=o.parent}return t}function Ne(e){var t;for(e&&(x7=!0,An(),x7=!0,t=e());;){if(Gf(),Ze.length===0)return x7=!1,R8=null,B1&&(je=[]),t;x7=!0,An()}}function v0(e){var t=e.f,s=(t&2)!==0;if(br!==null&&br.add(e),f0!==null&&!$3){if(!(E3!=null&&E3.includes(e))){var r=f0.deps;e.rv<zr&&(e.rv=zr,g3===null&&r!==null&&r[t4]===e?t4++:g3===null?g3=[e]:(!V5||!g3.includes(e))&&g3.push(e))}}else if(s&&e.deps===null&&e.effects===null){var i=e,a=i.parent;a!==null&&(a.f&256)===0&&(i.f^=256)}if(s&&(i=e,y7(i)&&cn(i)),B1&&o5&&!$3&&Ie!==null&&f0!==null&&Ie.reaction===f0)if(e.trace)e.trace();else{var c=G5("TracedAt");if(c){var o=Ie.entries.get(e);o===void
\r\f\xA0\v\uFEFF`];function aA(e,t,s){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),s){for(var i in s)if(s[i])r=r?r+" "+i:i;else if(r.length)for(var a=i.length,c=0;(c=r.indexOf(i,c))>=0;){var o=c+a;(c===0||sA.includes(r[c-1]))&&(o===r.length||sA.includes(r[o]))?r=(c===0?"":r.substring(0,c))+r.substring(o+1):c=o}}return r===""?null:r}x();function K8(e,t,s,r,i,a){var c=e.__className;if(w0||c!==s||c===void 0){var o=aA(s,r,a);(!w0||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):t?e.className=o:e.setAttribute("class",o)),e.__className=s}else if(a&&i!==a)for(var l in a){var n=!!a[l];(i==null||n!==!!i[l])&&e.classList.toggle(l,n)}return a}x();x();var VP=Symbol("class"),PP=Symbol("style"),YP=Symbol("is custom element"),ZP=Symbol("is html");function Bn(e){if(w0){var t=!1,s=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;j4(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var i=e.checked;j4(e,"checked",null),e.checked=i}}};e.__on_r=s,Qf(s),Er()}}function j4(e,t,s,r){var i=jP(e);if(w0&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")){r||JP(e,t,s!=null?s:"");return}i[t]!==(i[t]=s)&&(t==="loading"&&(e[lf]=s),s==null?e.removeAttribute(t):typeof s!="string"&&NP(e).includes(t)?e[t]=s:e.setAttribute(t,s))}function jP(e){var t;return(t=e.__attributes)!=null?t:e.__attributes={[YP]:e.nodeName.includes("-"),[ZP]:e.namespaceURI===sf}}var rA=new Map;function NP(e){var t=rA.get(e.nodeName);if(t)return t;rA.set(e.nodeName,t=[]);for(var s,r=e,i=Element.prototype;i!==r;){s=ar(r);for(var a in s)s[a].set&&t.push(a);r=C7(r)}return t}function JP(e,t,s){var r;B1&&(t==="srcset"&&WP(e,s)||Ln((r=e.getAttribute(t))!=null?r:"",s)||Mf(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(s)))}function Ln(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function iA(e){return e.split(",").map(t=>t.trim().split(" ").filter(Boolean))}function WP(e,t){var s=iA(e.srcset),r=iA(t);return r.length===s.length&&r.every(([i,a],c)=>a===s[c][1]&&(Ln(s[c][0],i)||Ln(i,s[c][0])))}x();x();x();var qP=sr?()=>performance.now():()=>Date.now(),N4={tick:e=>(sr?G:n3)(e),now:()=>qP(),tasks:new Set};function cA(){let e=N4.now();N4.tasks.forEach(t=>{t.c(e)||(N4.tasks.delete(t),t.f())}),N4.tasks.size!==0&&N4.tick(cA)}function oA(e){let t;return N4.tasks.size===0&&N4.tick(cA),{promise:new Promise(s=>{N4.tasks.add(t={c:e,f:s})}),abort(){N4.tasks.delete(t)}}}function Ir(e,t){Je(()=>{e.dispatchEvent(new CustomEvent(t))})}function tY(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;let t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}function nA(e){let t={},s=e.split(";");for(let r of s){let[i,a]=r.split(":");if(!i||a===void 0)break;let c=tY(i.trim());t[c]=a.trim()}return t}var sY=e=>e;function kn(e,t,s,r){var y;var i=(e&1)!==0,a=(e&2)!==0,c=i&&a,o=(e&4)!==0,l=c?"both":i?"in":"out",n,u=t.inert,g=t.style.overflow,f,p;function h(){var b;var C=f0,M=n0;g2(null),E2(null);try{return n!=null?n:n=s()(t,(b=r==null?void 0:r())!=null?b:{},{direction:l})}finally{g2(C),E2(M)}}var v={is_global:o,in(){var C;if(t.inert=u,!i){p==null||p.abort(),(C=p==null?void 0:p.reset)==null||C.call(p);return}a||f==null||f.abort(),Ir(t,"introstart"),f=In(t,h(),p,1,()=>{Ir(t,"introend"),f==null||f.abort(),f=n=void 0,t.style.overflow=g})},out(C){if(!a){C==null||C(),n=void 0;return}t.inert=!0,Ir(t,"outrostart"),p=In(t,h(),f,0,()=>{Ir(t,"outroend"),C==null||C()})},stop:()=>{f==null||f.abort(),p==null||p.abort()}},d=n0;if(((y=d.transitions)!=null?y:d.transitions=[]).push(v),i&&Br){var m=o;if(!m){for(var w=d.parent;w&&(w.f&65536)!==0;)for(;(w=w.parent)&&(w.f&16)===0;);m=!w||(w.f&32768)!==0}m&&h3(()=>{Z0(()=>v.in())})}}function In(e,t,s,r,i){var a=r===1;if(qo(t)){var c,o=!1;return A4(()=>{if(!o){var d=t({direction:a?"in":"out"});c=In(e,d,s,r,i)}}),{abort:()=>{o=!0,c==null||c.abort()},deactivate:()=>c.deactivate(),reset:()=>c.reset(),t:()=>c.t()}}if(s==null||s.deactivate(),!(t!=null&&t.duration))return i(),{abort
${e.name}: ${e.message}`,s==null?void 0:s.settings.value.errorNoticeTimeout,s);l0(r).console.error(`${t()}
`,e)}function qh(e,t){return e2(t)[e]}function Xh(e,t){q4(e,[t],s=>{s.history=!0},E0)}async function Xx(e,t,s){await IX(e,[t],async({fs:r})=>{if("open"in r&&r.open.length===1){let{length:i}=r.open;return await r.open((await Py.writeFile({data:await s.text(),directory:Hi.Cache,encoding:s9.UTF8,path:s.name})).uri),!0}return!1},j2(!1))||(0,Wx.saveAs)(s)}function v9(e,t){if(q4(e,[t.leaf,e.app.workspace],(s,r)=>{s.updateHeader(),r.requestUpdateLayout()},E0),"titleEl"in t){let{titleEl:s}=t;y9(s,Node)&&(s.textContent=t.getDisplayText())}}function S9(e){let t=p2(e,"div",s=>{s.classList.add(j0.VERTICAL_TAB_CONTENT_CONTAINER)});return Object.freeze({element:p2(t,"div",s=>{s.classList.add(j0.VERTICAL_TAB_CONTENT)}),remover(){t.remove()}})}function $h(e){let t=p2(e,"div");return e.firstChild&&p2(t,"div"),t}function eu(e,t,s){return Object.assign(e2(e),{[t]:s})}var I3,kt,Dt,f9=(I3=class extends rc.ItemView{constructor(s,r){L1(I3,kt,I3.type.namespaced(s));super(r);I1(this,"element");x1(this,Dt,I3.State.DEFAULT);this.context=s;let{contentEl:i}=this;this.navigation=!0,this.element=p2(p2(i,"div",a=>{a.classList.add(j0.ALLOW_FOLD_HEADINGS,j0.ALLOW_FOLD_LISTS,j0.IS_READABLE_LINE_WIDTH,j0.MARKDOWN_PREVIEW_VIEW,j0.MARKDOWN_RENDERED,j0.NODE_INSERT_EVENT,j0.SHOW_INDENTATION_GUIDE)}),"div",a=>{a.classList.add(j0.MARKDOWN_PREVIEW_SECTION,j0.MARKDOWN_PREVIEW_SIZER);function c(o){var f;let{button:l,target:n}=o;if(![0,1].includes(l)||!y9(n,Node))return;let u=Array.from(a.querySelectorAll("a.internal-link")).find(p=>p.contains(n));if(!u)return;let g=(f=u.getAttribute("data-href"))!=null?f:"";if(g.startsWith("#")){g=g.slice(1);for(let p of Array.from(a.querySelectorAll("*[data-heading]"))){let h=p.getAttribute("data-heading");if(!(h===null||h.toLowerCase().replaceAll(" ","-")!==g)){p.scrollIntoView({block:"start",inline:"start"}),F3(o);return}}}}a.addEventListener("click",c),a.addEventListener("auxclick",c)})}get state(){return i1(this,Dt)}set state(s){L1(this,Dt,s),v9(this.context,this)}getViewType(){return i1(I3,kt)}getDisplayText(){let{context:{language:{value:s,language:r}},state:{displayTextI18nKey:i}}=this;return i===null?"":Ox(s.t(i),r)}getIcon(){let{context:{language:{value:s}},state:{iconI18nKey:r}}=this;return r===null?super.getIcon():s.t(r)}async setState(s,r){let{context:i,element:a}=this,c=qh(I3.type.namespaced(i),s),{value:o,valid:l}=I3.State.fix(c);l||hs(i,c,o),await super.setState(s,r);let{data:n}=o;this.state=o,await rc.MarkdownRenderer.render(this.app,n,a,"",this),Xh(i,r)}getState(){return eu(super.getState(),I3.type.namespaced(this.context),this.state)}async onOpen(){await super.onOpen();let{context:s,context:{language:{onChangeLanguage:r}}}=this;this.register(r.listen(()=>{v9(s,this)}))}},kt=new WeakMap,Dt=new WeakMap,I1(I3,"type",new E9("documentation")),x1(I3,kt),I3),_X=class{constructor(e){this.context=e}async open(e,t){let{context:s,context:{app:{workspace:r}}}=this;return new Promise(i=>{r.onLayoutReady(()=>{i(r.getLeaf("tab").setViewState({active:e,state:Wh(s,new Map([[f9.type,t]])),type:f9.type.namespaced(s)}))})})}};(e=>{function t(r){let{type:i}=e;return r.registerView(i.namespaced(r),a=>new e(r,a)),new _X(r)}e.register=t;let s;(r=>{r.DEFAULT=F1({data:"",displayTextI18nKey:null,iconI18nKey:null});function i(a){let c=e2(a);return M4(a,{data:v1(r.DEFAULT,c,"data",["string"]),displayTextI18nKey:v1(r.DEFAULT,c,"displayTextI18nKey",["string","null"]),iconI18nKey:v1(r.DEFAULT,c,"iconI18nKey",["string","null"])})}r.fix=i})(s=e.State||(e.State={}))})(f9||(f9={}));async function eL(e,t={},s){let r="errors.missing-translation",i=!1,a=SA({cleanCode:!0,initImmediate:!0,missingInterpolationHandler(l,n){if(i)self.console.warn(n,l);else{i=!0;try{self.console.warn(a.t("errors.missing-interpolation",{interpolation:{escapeValue:!1},name:n[1],text:l,value:n[0]}))}finally{i=!1}}return n[0]},nonExplicitSupportedLngs:!0,ns:[...new Set(Object.values(e).flatMap(l=>Object.keys(l)))],parseMissingKeyHandler(l,n){return l===r?self.console.warn(l,n):self.console.warn(a.t(r,{interpolation:{escapeValue:!1},key:l,value:n!=null?n:l})),n!=null?n:l},retur
${(0,lc.fromObject)(TX(...e).toJSON()).toComment()}`}var xE=new WeakMap;function TX(e,t,s){var i,a;let r=xE.get(e);if(!r){let c=new e(Oh).toString(),o=c.indexOf(Oh);if(o===-1)self.console.error(Oh,c,e),r={column:0,line:1};else{let l=Yx(c.slice(0,o));r={column:(a=(i=l.at(-1))==null?void 0:i.length)!=null?a:0,line:l.length}}xE.set(e,r)}return OX(t,{...s,offset:r})}function OX(e,t){var u,g,f,p;let s=(0,lc.fromSource)(e),r=(u=t==null?void 0:t.offset)!=null?u:{column:0,line:1},i={skipValidation:!0};d5(i,"file",t==null?void 0:t.file),d5(i,"sourceRoot",t==null?void 0:t.sourceRoot);let a=null;try{s&&(a=new L9.TraceMap(s.toJSON()))}catch(h){}let c=new hL.SourceMapGenerator(i),o=(g=t==null?void 0:t.source)!=null?g:U2(a==null?void 0:a.sources)?"":".",l=[],n=new Set(((f=t==null?void 0:t.deletions)!=null?f:[]).map(({line:h,column:v})=>`${h}:${v}`));for(let[h,v]of Object.entries(Yx(e))){let d=Number(h),m=0;for(let[w,y]of Object.entries(v)){let C=Number(w);if(n.has(`${1+d}:${C}`)){--m;continue}l.push(y);let M={generated:{column:r.column+C,line:r.line+d},original:{column:C+m,line:1+d},source:o};if(a){let b=(0,L9.originalPositionFor)(a,M.original);b.source!==null&&(M.original=b,M.source=b.source,d5(M,"name",(p=b.name)!=null?p:void 0))}c.addMapping(M)}l.push(`
`)}if(l.pop(),a)for(let h of a.sources){if(h===null)continue;let v=(0,L9.sourceContentFor)(a,h);v!==null&&c.setSourceContent(h,v)}return c.setSourceContent(o,l.join("")),c}function RX(e){let t=self.document.querySelector(`.${j0.STATUS_BAR}`);return t&&e&&e(t),t}var j6,O7,pL=(j6=class extends gL.Component{constructor(s){super();x1(this,O7,[]);this.context=s}onload(){super.onload(),this.register(()=>{b9(i1(this,O7)),this.update()}),this.context.app.workspace.onLayoutReady(()=>{this.update()})}hide(s){return i1(this,O7).push(s),this.update(),()=>{sc(i1(this,O7),s),this.update()}}update(){RX(s=>{i1(this,O7).some(r=>r())?s.classList.add(j6.class):s.classList.remove(j6.class)})}},O7=new WeakMap,I1(j6,"class",xt.HIDE_STATUS_BAR),j6);var gs,I9=class{constructor(t=NaN){this.maxHistory=t;I1(this,"logger",new qi);x1(this,gs,[]);this.logger.listen(s=>{let r=i1(this,gs);r.push(s),r.splice(0,r.length-t)})}get history(){return i1(this,gs)}};gs=new WeakMap;(t=>{let e;(r=>r.TYPES=F1(["info","error","warn","debug","windowError","unhandledRejection"]))(e=t.Event||(t.Event={}))})(I9||(I9={}));function QX(e,t){function s(r,i){let a=!1;return function(...o){if(!a){a=!0;try{try{t.logger.emit({data:o,type:r}).catch(E0)}catch(l){this.error(l)}finally{i.apply(this,o)}}finally{a=!1}}}}return P6(e,{debug(r){return s("debug",r)},error(r){return s("error",r)},log(r){return s("info",r)},warn(r){return s("warn",r)}})}function GX(e,t){let s=a=>{t.logger.emit({data:a,type:"windowError"}).catch(E0)},r=a=>{t.logger.emit({data:a,type:"unhandledRejection"}).catch(E0)},i=new y4({async:!1,settled:!0},()=>{e.removeEventListener("error",s,{capture:!0})},()=>{e.removeEventListener("unhandledrejection",r,{capture:!0})});try{return e.addEventListener("error",s,{capture:!0,passive:!0}),e.addEventListener("unhandledrejection",r,{capture:!0,passive:!0}),()=>{i.call()}}catch(a){throw i.call(),a}}function mL(e,t){let s=new y4({async:!1,settled:!0});try{return s.push(QX(e.console,t)),s.push(GX(e,t)),()=>{s.call()}}catch(r){throw s.call(),r}}function KX(e,t){let s=new y4({async:!1,settled:!0});try{let{workspace:r}=e,i=new I9(t==null?void 0:t.maxHistory),a=null;return s.push(()=>{a&&a()}),a=nc(r,c=>mL(c,i)),Object.freeze({enableLoggingPatch(c){if(c){if(a)return;a=nc(r,o=>mL(o,this.log));return}if(a)try{a()}finally{a=null}},log:i,unpatch(){s.call()}})}catch(r){throw s.call(),r}}var B9,hc=class extends M9{constructor(s,r){super();this.app=s;this.options=r;x1(this,B9,!1)}load(){i1(this,B9)||(super.load(),this.register(()=>{L1(this,B9,!1)}),L1(this,B9,!0))}load0(){let s=KX(this.app,this.options);return this.register(s.unpatch),s}};B9=new WeakMap;function UX(e,t){let{settings:s}=e;return P6(t,{require(r){return function(...a){try{return r.apply(this,a)}catch(c){if(!s.value.exposeInternalModules)throw c;return us(new Map,...a)}}},toString:_x()})}function dL(e){let{app:{workspace:t}}=e;e.register(nc(t,s=>UX(e,s)))}x();x();x();var As=T1(NB(),1),wu=5,$6="utf-8",C5="python3",D9=`${$6}:backslashreplace`,fc=0,R0=F1([fc.toString(),"SIGINT","SIGTERM"]),JB=1024,Cs=1/0,WB=10,zu=F1({Python:{platforms:w2.DESKTOP,version:new As.SemVer("3.10.0")},psutil:{platforms:["win32"],version:new As.SemVer("5.9.5")},pywinctl:{platforms:["win32"],version:new As.SemVer("0.0.50")},typing_extensions:{platforms:["win32"],version:new As.SemVer("4.7.1")}}),qB=.1,XB=5,$B=.5,eI=.5,bu="C:\\Windows\\System32\\cmd.exe",tI="C:\\Windows\\System32\\conhost.exe",K7;(r=>{r.LUCIDE_HEART="lucide-heart",r.SVG_ICON="svg-icon";let s;(a=>a.TERMINAL="terminal")(s=r.Namespaced||(r.Namespaced={}))})(K7||(K7={}));var ws=F1({activate(e,t,s){ec(l0(e),t)}}),H9=F1({debug(e,...t){self.console.debug(e,...t)},error(e,...t){self.console.error(e,...t)},info(e,...t){self.console.info(e,...t)},trace(e,...t){self.console.trace(e,...t)},warn(e,...t){self.console.warn(e,...t)}}),V1=F1({documentOverride:null}),J0=F1({}),c2=F1({}),yu=F1({}),U7=F1({bashIntegrated:{args:[],executable:"/bin/bash",name:"",platforms:{darwin:!0,linux:!0},pythonExecutable:C5,restoreHistory:!1,successExitCodes:R0,terminalOptions:V1,type:"integrated",useWin32Conhost:!0}
* @license
* MIT License
*
* Copyright (c) 2014-present, Lee Byron and other contributors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/var Ts="delete",G0=5,l4=1<<G0,f3=l4-1,L0={};function Nu(){return{value:!1}}function B4(e){e&&(e.value=!0)}function ag(){}function T9(e){return e.size===void 0&&(e.size=e.__iterate(jH)),e.size}function a7(e,t){if(typeof t!="number"){var s=t>>>0;if(""+s!==t||s===4294967295)return NaN;t=s}return t<0?T9(e)+t:t}function jH(){return!0}function _c(e,t,s){return(e===0&&!JH(e)||s!==void 0&&e<=-s)&&(t===void 0||s!==void 0&&t>=s)}function Os(e,t){return NH(e,t,0)}function Tc(e,t){return NH(e,t,t)}function NH(e,t,s){return e===void 0?s:JH(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function JH(e){return e<0||e===0&&1/e===-1/0}var WH="@@__IMMUTABLE_ITERABLE__@@";function u4(e){return!!(e&&e[WH])}var kc="@@__IMMUTABLE_KEYED__@@";function t2(e){return!!(e&&e[kc])}var Dc="@@__IMMUTABLE_INDEXED__@@";function I4(e){return!!(e&&e[Dc])}function rg(e){return t2(e)||I4(e)}var s3=function(t){return u4(t)?t:R3(t)},k4=function(e){function t(s){return t2(s)?s:c7(s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(s3),Y7=function(e){function t(s){return I4(s)?s:$4(s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(s3),P9=function(e){function t(s){return u4(s)&&!rg(s)?s:j9(s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(s3);s3.Keyed=k4;s3.Indexed=Y7;s3.Set=P9;var qH="@@__IMMUTABLE_SEQ__@@";function ig(e){return!!(e&&e[qH])}var XH="@@__IMMUTABLE_RECORD__@@";function Z7(e){return!!(e&&e[XH])}function M5(e){return u4(e)||Z7(e)}var r7="@@__IMMUTABLE_ORDERED__@@";function y5(e){return!!(e&&e[r7])}var Y9=0,g4=1,p4=2,Ju=typeof Symbol=="function"&&Symbol.iterator,$H="@@iterator",Oc=Ju||$H,k0=function(t){this.next=t};k0.prototype.toString=function(){return"[Iterator]"};k0.KEYS=Y9;k0.VALUES=g4;k0.ENTRIES=p4;k0.prototype.inspect=k0.prototype.toSource=function(){return this.toString()};k0.prototype[Oc]=function(){return this};function s2(e,t,s,r){var i=e===Y9?t:e===g4?s:[t,s];return r?r.value=i:r={value:i,done:!1},r}function A3(){return{value:void 0,done:!0}}function eF(e){return Array.isArray(e)?!0:!!Rc(e)}function yH(e){return e&&typeof e.next=="function"}function Wu(e){var t=Rc(e);return t&&t.call(e)}function Rc(e){var t=e&&(Ju&&e[Ju]||e[$H]);if(typeof t=="function")return t}function O21(e){var t=Rc(e);return t&&t===e.entries}function R21(e){var t=Rc(e);return t&&t===e.keys}var Z9=Object.prototype.hasOwnProperty;function tF(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var R3=function(e){function t(s){return s==null?og():M5(s)?s.toSeq():G21(s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(r,i){var a=this._cache;if(a){for(var c=a.length,o=0;o!==c;){var l=a[i?c-++o:o++];if(r(l[1],l[0],this)===!1)break}return o}return this.__iterateUncached(r,i)},t.prototype.__iterator=function(r,i){var a=this._cache;if(a){var c=a.length,o=0;return new k0(function(){if(o===c)return A3();var l=a[i?c-++o:o++];return s2(r,l[0],l[1])})}return this.__iteratorUncached(r,i)},t}(s3),c7=function(e){function t(s){return s==null?og().toKeyedSeq():u4(s)?t2(s)?s.toSeq():s.fromEntrySeq():Z7(s)?s.toSeq():ng(s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(R3),$4=function(e){function t(s){return s==null?og():u4(s)?t2(s)?s.entrySeq():s.toIndexedSeq():Z7(s)?s.toSeq().entrySeq():sF(s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){retur
`;function W7(e){return e.replace(s6(S5),`
`).replace(s6(`
`),S5)}async function u2(e,t){return new Promise(s=>{e.write(t,s)})}var o7,J7,y2,Ps,Ys,Zs,Dg,x2=class x2{constructor(t){x1(this,Zs);I1(this,"terminal");I1(this,"lock",new QF.default({maxPending:Cs}));x1(this,o7);x1(this,J7,!1);x1(this,y2,[0]);x1(this,Ps,F1({cursor:0,string:""}));x1(this,Ys,{xx:0});this.terminal=new GF.Terminal({...t,cols:x2.margin,rows:x2.margin});let{terminal:{buffer:s,parser:r}}=this,i=(()=>{let a=l=>()=>(L1(this,J7,!1),l),c=a(!0),o=a(!1);return l=>l?c:o})();L1(this,o7,s.active.getNullCell());for(let a of KF)r.registerCsiHandler(a,i(x2.allowedIdentifiers.csi.has(a)));for(let a of T31)r.registerDcsHandler(a,i(x2.allowedIdentifiers.dcs.has(a)));for(let a of O31)r.registerEscHandler(a,i(x2.allowedIdentifiers.esc.has(a)));for(let a of R31)r.registerOscHandler(a,i(x2.allowedIdentifiers.osc.has(a)))}get value(){return i1(this,Ps)}async write(t,s=!0){let{terminal:r,lock:i}=this,{buffer:{active:a}}=r,c=l=>l.split(x2.splitters),o=c(t);await z9(i,x2.writeLock,s,async()=>{var l,n,u,g;for(let f=o.shift();f!==void 0;f=o.shift()){let{cursorX:p,cursorY:h}=a,v=(n=(l=i1(this,y2))[h])!=null?n:l[h]=0,d=a.getLine(h);switch(f){case"":break;case Vs:{await u2(r,f);let[m]=o;if(m!==void 0){L1(this,J7,!0);let w=0;for(let y of m)if(await u2(r,y),w+=y.length,!i1(this,J7))break;L1(this,J7,!1),o[0]=m.slice(w)}break}case"\r":{let m=(u=d==null?void 0:d.translateToString(!1,p,v))!=null?u:"";r.resize(r.cols,r.rows+1),await u2(r,`${_0.erase.inLine()}${_0.cursor.down()}${Us}L`),i1(this,y2)[h]=p,Ux(i1(this,y2),h+1,0),o.unshift(...c(`${m}${_0.cursor.horizontalAbsolute(1)}`));break}case"\x7F":{if(d){let m=0;for(let w=p-1,y=d.getCell(w,i1(this,o7));m<=0&&y;y=d.getCell(--w,i1(this,o7)))m=y.getWidth();if(m>0)await u2(r,`${_0.cursor.back(m)}${Us}${m}P`),i1(this,y2)[h]-=m;else if(h>0){let w=d.translateToString(!1,0,v),y=(g=i1(this,y2)[h-1])!=null?g:0;await u2(r,`${Us}M${_0.cursor.up()}${_0.cursor.horizontalAbsolute(1+y)}`),ac(i1(this,y2),h),o.unshift(...c(`${w}${_0.cursor.horizontalAbsolute(1+y)}`))}}break}default:{let m=RF*f.length;r.resize(r.cols+m,r.rows),await u2(r,`${Us}${m}@${f}`),i1(this,y2)[h]+=m;let w=m-(a.cursorX-p);await u2(r,`${Us}${w}P`),i1(this,y2)[h]-=w;break}}await V3(this,Zs,Dg).call(this)}})}async setValue(t){let s=W7(t).replace(s6(S5),"\r");await this.lock.acquire(x2.writeLock,async()=>{await this.clear(!1),await this.write(s,!1)})}async clear(t=!0){return z9(this.lock,x2.writeLock,t,async()=>{let s=this.value;return this.terminal.reset(),b9(i1(this,y2)),i1(this,y2).push(0),await V3(this,Zs,Dg).call(this),s})}dispose(){this.terminal.dispose()}};o7=new WeakMap,J7=new WeakMap,y2=new WeakMap,Ps=new WeakMap,Ys=new WeakMap,Zs=new WeakSet,Dg=async function(){var n,u,g;let{terminal:t,lock:s}=this,{buffer:{active:r}}=t;if(!s.isBusy(x2.writeLock))throw new Error;let{cursorX:i,cursorY:a}=r;a>=i1(this,y2).length&&(a=i1(this,y2).length-1),i>((n=i1(this,y2)[a])!=null?n:0)&&(i=(u=i1(this,y2)[a])!=null?u:0),await u2(t,_0.cursor.position(1+a,1+i));let c=[[],[]],o=0;for(let f of i1(this,y2)){let p=r.getLine(o);if(p&&o===a){let h=i-i1(this,Ys).xx<0?-1:1;for(let v=p.getCell(i,i1(this,o7));v&&v.getWidth()<=0;v=p.getCell(i+=h,i1(this,o7)));c[0].push(p.translateToString(!1,0,i)),c[1].push(p.translateToString(!1,i,f)),await u2(t,_0.cursor.horizontalAbsolute(1+i))}else c[a>o?0:1].push((g=p==null?void 0:p.translateToString(!1,0,f))!=null?g:"");++o}let l=c[0].join(`
`);L1(this,Ps,F1({cursor:l.length,string:`${l}${c[1].join(`
`)}`})),i1(this,Ys).xx=i,t.resize(Math.max(...i1(this,y2))+x2.margin,i1(this,y2).length+x2.margin)},I1(x2,"margin",RF),I1(x2,"splitters",new RegExp(`(${Vh([Vs,"\x7F","\r"]).source})`,"u")),I1(x2,"writeLock","write"),I1(x2,"allowedIdentifiers",F1({csi:D4([{final:"@",intermediates:"",prefix:""},{final:"A",intermediates:"",prefix:""},{final:"B",intermediates:"",prefix:""},{final:"C",intermediates:"",prefix:""},{final:"D",intermediates:"",prefix:""},{final:"E",intermediates:"",prefix:""},{final:"F",intermediates:"",prefix:""},{final:"G",intermediates:"",prefix:""},{final:"H",intermediates:"",prefix:""},{final:"I",intermediates:"",prefix:""},{final:"J",intermediates:"",prefix:""},{final:"J",intermediates:"",prefix:"?"},{final:"K",intermediates:"",prefix:""},{final:"K",intermediates:"",prefix:"?"},{final:"L",intermediates:"",prefix:""},{final:"M",intermediates:"",prefix:""},{final:"P",intermediates:"",prefix:""},{final:"S",intermediates:"",prefix:""},{final:"T",intermediates:"",prefix:""},{final:"X",intermediates:"",prefix:""},{final:"Z",intermediates:"",prefix:""},{final:"`",intermediates:"",prefix:""},{final:"a",intermediates:"",prefix:""},{final:"b",intermediates:"",prefix:""},{final:"d",intermediates:"",prefix:""},{final:"e",intermediates:"",prefix:""},{final:"f",intermediates:"",prefix:""},{final:"g",intermediates:"",prefix:""},{final:"h",intermediates:"",prefix:""},{final:"h",intermediates:"",prefix:"?"},{final:"l",intermediates:"",prefix:""},{final:"l",intermediates:"",prefix:"?"},{final:"m",intermediates:"",prefix:""},{final:"n",intermediates:"",prefix:""},{final:"m",intermediates:"",prefix:"?"},{final:"p",intermediates:"$",prefix:""},{final:"p",intermediates:"",prefix:"!"},{final:"q",intermediates:'"',prefix:""},{final:"q",intermediates:"SP",prefix:""},{final:"r",intermediates:"",prefix:""},{final:"s",intermediates:"",prefix:""},{final:"u",intermediates:"",prefix:""}]),dcs:D4([{final:"q",intermediates:"",prefix:""},{final:"|",intermediates:"\\",prefix:""},{final:"q",intermediates:"",prefix:"+"},{final:"p",intermediates:"",prefix:"+"},{final:"q",intermediates:"",prefix:"$"}]),esc:D4([{final:"7",intermediates:"",prefix:""},{final:"8",intermediates:"",prefix:""},{final:"D",intermediates:"",prefix:""},{final:"E",intermediates:"",prefix:""},{final:"H",intermediates:"",prefix:""},{final:"M",intermediates:"",prefix:""},{final:"P",intermediates:"",prefix:""},{final:"[",intermediates:"",prefix:""},{final:"\\",intermediates:"",prefix:""},{final:"]",intermediates:"",prefix:""},{final:"^",intermediates:"",prefix:""},{final:"_",intermediates:"",prefix:""}]),osc:D4([0,1,2,4,8,10,11,12,104,110,111,112])}));var Vc=x2,Pc;(t=>{async function e(s,r,i=0){let{options:a,cols:c}=s,{string:o,cursor:l}=r,n=W7(o.slice(0,l)),u=W7(o.slice(l)),g=new GF.Terminal({...a,cols:c,rows:1,scrollback:1/0}),{buffer:{active:f}}=g,{baseY:p}=f;await u2(g,`${_0.cursor.horizontalAbsolute(1+i)}${n}`);let{cursorX:h,baseY:v}=f;await u2(g,u);let{cursorX:d,baseY:m}=f;return F1({cols:c,cursor:[h,v-p],endX:d,lines:L8(p,m+1).map(w=>{var y,C;return(C=(y=f.getLine(w))==null?void 0:y.translateToString(!0,w===p?i:0,w===m?d:c))!=null?C:""}),rows:m-p+1,startX:i})}t.info=e})(Pc||(Pc={}));x();var Q31=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],jF=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),UF(t.onToken)){var r=t.onToken;t.onToken=function(i){return r.push(i)}}return UF(t.onComment)&&(t.onComment=W31(t,t.onComment)),t}function W31(e,t){return function(s,r,i,a,c,o){var l={type:s?"Block":"Line",value:r,start:i,end:a};e.locations&&(l.loc=new qc(this,c,o)),e.ranges&&(l.range=[i,a]),t.push(l)}}var Js=1,$9=2,Kg=4,$F=8,Ug=16,e_=32,Xc=64,t_=128,q7=256,Ws=512,$c=Js|$9|q7;function Vg(e,t){return $9|(e?Kg:0)|(t?$F:0)}var jc=0,Pg=1,l6=2,s_=3,a_=4,r_=5,L2=function(t,s,r){this.options=t=J31(t),this.sourceFile=t.sourceFile,this.keywords=n7(K31[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var i="";t.allowReserved!==!0&&(i=Hg[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(i+=" await")),this.reservedWords=n7(i);var a=(i?i+" ":"")+Hg.strict;this.reservedWordsStrict=n7(a),this.reservedWordsStrictBind=n7(a+" "+Hg.strictBind),this.input=String(s),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(G3).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=J.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Js),this.regexpState=null,this.privateNameStack=[]},L5={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};L2.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};L5.inFunction.get=function(){return(this.currentVarScope().flags&$9)>0};L5.inGenerator.get=function(){return(this.currentVarScope().flags&$F)>0};L5.inAsync.get=function(){return(this.currentVarScope().flags&Kg)>0};L5.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],s=t.flags;if(s&(q7|Ws))return!1;if(s&$9)return(s&Kg)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};L5.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&Xc)>0||this.options.allowSuperOutsideMethod};L5.allowDirectSuper.get=function(){return(this.currentThisScope().flags&t_)>0};L5.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};L5.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],s=t.flags;if(s&(q7|Ws)||s&$9&&!(s&Ug))return!0}return!1};L5.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&q7)>0};L2.extend=function(){for(var t=[],s=arguments.length;s--;)t[s]=arguments[s];for(var r=this,i=0;i<t.length;i++)r=t[i](r);return r};L2.parse=function(t,s){return new this(s,t).parse()};L2.parseExpressionAt=function(t,s,r){var i=new this(r,t,s);return i.nextToken(),i.parseExpression()};L2.tokenizer=function(t,s){return new this(s,t)};Object.defineProperties(L2.prototype,L5);var w3=L2.prototype,q31=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;w3.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){r3.lastIndex=e,e+=r3.exec(this.input)[0].length;var t=q31.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){r3.lastIndex=e+t[0].length;var s=r3.exec(this.input),r=s.index+s[0].length,i=this.input.charAt(r);return i===";"||i==="}"||G3.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,r3.lastIndex=e,e+=r3.exec(this.input)[0].length,this.input[e]===";"&&e++}};w3.eat=function(e){return this.type===e?(this.next(),!0):!1};w3.isContextual=function(e){return this.type===J.name&&this.value===e&&!this.containsEsc};w3.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};w3.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};w3.canInsertSemicolon=function(){return this.type===J.eof||this.type===J.braceR||G3.test(this.input.slice(this.lastTokEnd,this.start))};w3.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};w3.semicolon=function(){!this.eat(J.semi)&&!this.insertSemicolon()&&this.unexpected()};w3.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};w3.expect=function(e){this.eat(e)||this.une
`),cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
`),cooked:this.value},this.next(),s.tail=this.type===J.backQuote,this.finishNode(s,"TemplateElement")};g0.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(s.quasis=[r];!r.tail;)this.type===J.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(J.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(J.braceR),s.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")};g0.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===J.name||this.type===J.num||this.type===J.string||this.type===J.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===J.star)&&!G3.test(this.input.slice(this.lastTokEnd,this.start))};g0.parseObj=function(e,t){var s=this.startNode(),r=!0,i={};for(s.properties=[],this.next();!this.eat(J.braceR);){if(r)r=!1;else if(this.expect(J.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(J.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),s.properties.push(a)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")};g0.parseProperty=function(e,t){var s=this.startNode(),r,i,a,c;if(this.options.ecmaVersion>=9&&this.eat(J.ellipsis))return e?(s.argument=this.parseIdent(!1),this.type===J.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(s,"RestElement")):(s.argument=this.parseMaybeAssign(!1,t),this.type===J.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(s,"SpreadElement"));this.options.ecmaVersion>=6&&(s.method=!1,s.shorthand=!1,(e||t)&&(a=this.start,c=this.startLoc),e||(r=this.eat(J.star)));var o=this.containsEsc;return this.parsePropertyName(s),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(s)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(J.star),this.parsePropertyName(s)):i=!1,this.parsePropertyValue(s,e,r,i,a,c,t,o),this.finishNode(s,"Property")};g0.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var s=e.kind==="get"?0:1;if(e.value.params.length!==s){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};g0.parsePropertyValue=function(e,t,s,r,i,a,c,o){(s||r)&&this.type===J.colon&&this.unexpected(),this.eat(J.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,c),e.kind="init"):this.options.ecmaVersion>=6&&this.type===J.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(s,r),e.kind="init"):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==J.comma&&this.type!==J.braceR&&this.type!==J.eq?((s||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((s||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===J.eq&&c?(c.shorthandAssign<0&&(c.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()};g0.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(J.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(J.bracketR),e.key;e.computed=!1}return e.key=this.type===J.num||this.type===J.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};g0.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};g0.parseMethod=function(e,t,s){var r=this.s
`;break;default:e+=String.fromCharCode(s);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};M0.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(J.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
`&&++this.pos;case`
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};M0.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return o6(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return q9(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};M0.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return s===null&&this.invalidStringToken(t,"Bad character escape sequence"),s};M0.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(l7(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(s,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var c=this.readCodePoint();(t?x5:l7)(c,r)||this.invalidStringToken(a,"Invalid Unicode escape"),e+=o6(c),s=this.pos}else break;t=!1}return e+this.input.slice(s,this.pos)};M0.readWord=function(){var e=this.readWord1(),t=J.name;return this.keywords.test(e)&&(t=Gg[e]),this.finishToken(t,e)};var b41="8.15.0";L2.acorn={Parser:L2,version:b41,defaultOptions:Og,Position:Ns,SourceLocation:qc,getLineInfo:XF,Node:to,TokenType:D0,tokTypes:J,keywordTypes:Gg,TokContext:e5,tokContexts:a2,isIdentifierChar:l7,isIdentifierStart:x5,Token:Zg,isNewLine:q9,lineBreak:G3,lineBreakG:Y31,nonASCIIwhitespace:WF};function L_(e,t){return L2.parse(e,t)}var jg=T1(Yo(),1);x();async function te(e){let t=await e();return new Promise((s,r)=>{t.once("spawn",()=>{s(t)}).once("error",r)})}async function X7(e,t){return new Promise((s,r)=>{let i=e.write(t,a=>{a?r(a):i&&s()});i||e.once("drain",s)})}var Wg=T1(er(),1);x();var I5=class extends y4{constructor(...t){super({async:!1,settled:!0},...t)}activate(t){}dispose(){this.call()}},Xs,ao=class{constructor(t){this.element=t;x1(this,Xs,new I5)}activate(t){let{element:s}=this,r=a=>{var c,o;t.paste(Array.from((o=(c=a.dataTransfer)==null?void 0:c.files)!=null?o:[]).map(l=>l.path).filter(cs).map(l=>l.replace(s6('"'),'\\"')).map(l=>l.includes(" ")?`"${l}"`:l).join(" ")),F3(a)},i=F3;i1(this,Xs).push(()=>{s.removeEventListener("dragover",i)},()=>{s.removeEventListener("drop",r)}),s.addEventListener("drop",r),s.addEventListener("dragover",i)}dispose(){i1(this,Xs).dispose()}};Xs=new WeakMap;var se,h6=class{constructor(t,s){this.canvasSupplier=t;this.webglSupplier=s;I1(this,"renderer",null);x1(this,se,null)}use(t){var i;let s=i1(this,se);if(!s)return;let{element:r}=s;switch((i=this.renderer)==null||i.dispose(),t){case"dom":this.renderer=null;break;case"canvas":try{let a=this.canvasSupplier();s.loadAddon(this.renderer=a);break}catch(a){l0(r).console.warn(a),this.use("dom")}break;case"webgl":{try{let a=this.webglSupplier(),c=a.onContextLoss(()=>{try{this.use("webgl")}finally{c.dispose()}});s.loadAddon(this.renderer=a)}catch(a){l0(r).console.warn(a),this.use("canvas")}break}}}activate(t){L1(this,se,t)}dispose(){var t;(t=this.renderer)==null||t.dispose(),L1(this,se,null)}};se=new WeakMap;(t=>t.RENDERER_OPTIONS=F1(["dom","canvas","webgl"]))(h6||(h6={}));x();var B_=T1(e0()),I_=m3.from(()=>(0,B_.decompressFromBase64)("GYJw9gtgBGDOUEsIAcwgC5QBQCgr6gFMAPQgYwDdkoBDeAfRPKoBo8CRCaATWhznmwJQA7jQTpkCXnSj0xEqdyEEF6WOhroArrHrowjYhLJhuhPnJF6DjMivwiQEi7PnP0hNgEocoSFCwhAA25AYg8EioGFAAIoTANNrB6ADKIWFolvTxicl
`))return;i.acquire(O4.syncLock,async()=>{var m;let{length:p}=i1(this,R4);if(p<=0||((m=i1(this,R4)[p-1])!=null?m:"").includes(`
`))return;L1(this,e8,i1(this,e8)+(p+(g==="ArrowDown"?1:-1))),L1(this,e8,i1(this,e8)%p);let h=i1(this,R4)[i1(this,e8)];if(h===void 0)return;let v=!0,d=r.setValue(h).finally(()=>{v=!1}).then(async()=>this.syncBuffer(a,!1));for(;v;)await this.syncBuffer(a,!1);await d}).catch(u);break;default:return}c=!0,F3(n)}),s.onResize(()=>{o||(o=!0,this.syncBuffer([s]).finally(()=>{o=!1}).catch(n=>{l0(s.element).console.error(n)}))})].map(n=>()=>{n.dispose()}));this.onExit.catch(E0).finally(()=>{l.call()}),await this.write(this.log.history,[s])}format(s){let r=i1(this,ea).get(s);if(r===void 0){let{colors:i}=O4,{data:a,type:c}=s,o=[];switch(c){case"debug":case"error":case"info":case"warn":o.push(i[c]),r=$i(this.options(o),...a);break;case"windowError":o.push(i.error),r=$i(this.options(o),a.message,a);break;case"unhandledRejection":o.push(i.error),r=$i(this.options(o),a.reason,a);break}i1(this,ea).set(s,r=`${_0.styles(o)}${r}${_0.style.reset}`)}return r}options(s){let{context:{depth:r}}=this;return F1({customInspect:!1,depth:r,showHidden:!0,stylize(i,a){let{[a]:c}=jg.default.styles;if(c){let{[c]:[o,l]}=jg.default.colors;return`${Yc}${o}m${i}${Yc}${l}m${_0.styles(s)}`}return i}})}async eval(){let{buffer:s,context:r,lock:i,self0:a,sourceRoot:c,terminals:o}=this,l=a(),n=await i.acquire(O4.syncLock,async()=>{let{string:m}=await s.clear(),{length:w}=i1(this,R4);return i1(this,R4).splice(w-1,1,m,""),L1(this,e8,w),await this.syncBuffer(o,!1),m});l.console.log(n);let u=(()=>{try{return L_(n,{allowAwaitOutsideFunction:!0,allowHashBang:!0,allowImportExportEverywhere:!1,allowReserved:!0,allowReturnOutsideFunction:!1,allowSuperOutsideMethod:!1,ecmaVersion:"latest",locations:!0,preserveParens:!1,ranges:!1,sourceType:"script"})}catch(m){return l.console.error(m),null}})();if(!u)return;let g=u.body[u.body.length-1],f=g?`${n.slice(0,g.start)}return [(${n.slice(g.start)})]`:"",p=g==null?void 0:g.loc,h=[];if(p){let{start:m,end:w}=p,y=0;for(let{}of"return [(")h.push({column:m.column+y,line:m.line}),++y;m.line!==w.line&&(y=0);for(let{}of")]")h.push({column:w.column+y,line:w.line}),++y}async function v(m,w=[]){let y=Tx(l);return new y(O4.contextVar,uL(y,m,{deletions:w,file:"<stdin>",sourceRoot:`${c}${c&&"/"}<stdin>`}))(r)}let d=await(async()=>{if(f)try{let m=await v(f,h);if(!Array.isArray(m)||m.length!==1)throw new Error(String(m));return[m[0]]}catch(m){if(!(m instanceof SyntaxError))return l.console.error(m),null}try{return await v(n),[]}catch(m){return l.console.error(m),null}})();d&&l.console.log(d[0])}async syncBuffer(s=this.terminals,r=!0){let i=[...s];return new Promise((a,c)=>{z9(this.lock,O4.syncLock,r,async()=>{let o=i.map(async l=>{var b,E,S;let n=i1(this,u6).get(l),u=await Pc.info(l,this.buffer.value,n==null?void 0:n.startX),{rows:g,buffer:{active:f}}=l,{baseY:p}=f,h=(E=(b=n==null?void 0:n.startYMarker)==null?void 0:b.line)!=null?E:p,v=(S=n==null?void 0:n.renderEndY)!=null?S:0,d=Math.min(u.rows,g),m=u.rows-d,w=h+v-p,y=Math.max(-w,0),C=d-1,M=u.rows-1-u.cursor[1];await u2(l,`${_0.cursor.position(1+w+y,1+(v>0?0:u.startX))}${_0.erase.display()}${u.lines.slice(v+y,u.rows).join(S5)}${_0.cursor.horizontalAbsolute(1+(m>0?0:u.startX))}${C>0?_0.cursor.up(C):""}${_0.erase.display()}${u.lines.slice(m,u.rows).join(S5)}${_0.cursor.horizontalAbsolute(1+(u.cursor[1]<m?0:u.cursor[0]))}${M>0?_0.cursor.up(M):""}`),n&&(n.renderEndY=u.rows-1)});a(Promise.all(o).then(E0)),await Promise.allSettled(o)}).catch(c)})}async write(s,r=this.terminals,i=!0){let a=[...r],c=`${_0.erase.inLine()+W7(s.map(o=>this.format(o)).join(`
`)).replace(s6(S5),`${S5}${_0.erase.inLine()}`)}${S5}`;await z9(this.lock,O4.syncLock,i,async()=>{await Promise.allSettled(a.map(async o=>{var f,p;let{buffer:{active:l}}=o,n=i1(this,u6).get(o),{baseY:u}=l,g=(p=(f=n==null?void 0:n.startYMarker)==null?void 0:f.line)!=null?p:u+l.cursorY;await u2(o,`${_0.cursor.position(1+(g-u),1)}${_0.erase.display()}${c}`),V3(this,re,ro).call(this,o,{close(){var h;(h=this.startYMarker)==null||h.dispose()},renderEndY:0,startX:l.cursorX,startYMarker:o.registerMarker()})})),await this.syncBuffer(a,!1)})}};ea=new WeakMap,R4=new WeakMap,e8=new WeakMap,u6=new WeakMap,re=new WeakSet,ro=function(s,r){var i;(i=i1(this,u6).get(s))==null||i.close(),r?i1(this,u6).set(s,r):i1(this,u6).delete(s)},I1(O4,"colors",F1({debug:"blue",error:"red",info:"white",warn:"yellow"})),I1(O4,"syncLock","sync"),I1(O4,"contextVar","$$");var t8=O4;(t=>{class e extends M9{constructor(i){super();this.context=i}async load0(){let{context:{earlyPatch:{onLoaded:i},manifest:{id:a}}}=this,{log:c}=await i,o=os(()=>new ie(new t(l0,c,`plugin:${a}`)));return this.register(async()=>o().kill()),o}}t.Manager=e})(t8||(t8={}));var Jg=class e{constructor(t,{args:s,cwd:r,executable:i,useWin32Conhost:a,pythonExecutable:c}){this.context=t;I1(this,"shell");I1(this,"conhost");I1(this,"onExit");I1(this,"resizer");this.conhost=a!=null?a:!1;let{conhost:o}=this,{language:{value:l},settings:n}=t,u=(async()=>{if(j3(c))return null;let[f,p,h]=await Promise.all([Ng,F_,D_]),v=await te(()=>f.spawn(c,["-c",h],{env:{...p.env,PYTHONIOENCODING:D9},stdio:["pipe","pipe","pipe"],windowsHide:!0}));try{v.once("exit",(d,m)=>{d!==0&&A5(()=>l.t("errors.resizer-exited-unexpectedly",{code:d!=null?d:m,interpolation:{escapeValue:!1}}),n.value.errorNoticeTimeout,t)}).stderr.on("data",d=>{self.console.error(d.toString($6))})}catch(d){self.console.warn(d)}return v})(),g=(async()=>{let f=await u.catch(()=>null);try{let[p,h,v]=await Promise.all([Ng,H_,M41]),d=await v.file({discardDescriptor:!0,postfix:".bat"});try{let m=e.escapeArgument(d.path);await h.writeFile(d.path,`@echo off\r
setlocal EnableDelayedExpansion\r
${[i,...s!=null?s:[]].map(C=>e.escapeArgument(C)).join(" ")} & echo !ERRORLEVEL! > ${m}`,{encoding:$6,flag:"w"});let w=F1(o?[tI,d.path]:[d.path]),y=await te(()=>p.spawn(w[0],w.slice(1),{cwd:r,shell:!o,stdio:["pipe","pipe","pipe"],windowsHide:!f}));return[y,d,u.then(async C=>{var M;if(C)try{await X7(C.stdin,`${(M=y.pid)!=null?M:-1}
`);let b=self.setInterval(()=>{X7(C.stdin,`
`).catch(E=>{})},eI*H3);C.once("exit",()=>{self.clearInterval(b)})}catch(b){throw C.kill(),b}return C}).catch(C=>{let M=k3(C);throw D3(M,()=>l.t("errors.error-spawning-resizer"),t),M})]}catch(m){throw await d.cleanup(),m}}catch(p){throw f==null||f.kill(),p}})();this.resizer=g.then(async([,,f])=>f),this.shell=g.then(([f])=>f),this.onExit=g.then(async([f,p])=>new Promise(h=>{f.once("exit",(v,d)=>{h((async()=>{var m,w;try{let y=await H_,C=parseInt((await y.readFile(p.path,{encoding:$6,flag:"r"})).trim(),10);return isNaN(C)?(m=v!=null?v:d)!=null?m:NaN:C}catch(y){return(w=v!=null?v:d)!=null?w:NaN}finally{(async()=>{try{await Zx(self,XB),await p.cleanup()}catch(y){self.console.warn(y)}})()}})())})}))}static escapeArgument(t){return`"${t.replace(s6('"'),'"""')}"`}async kill(){if(!(await this.shell).kill())throw new Error(this.context.language.value.t("errors.error-killing-pseudoterminal"))}async resize(t,s){let{resizer:r,context:i}=this,a=await r;if(!a)throw new Error(i.language.value.t("errors.resizer-disabled"));await X7(a.stdin,`${t}x${s}
`)}async pipe(t){let s=!this.conhost,r=await this.shell,i=c=>{if(!s){s=!0;return}u2(t,c).catch(o=>{l0(t.element).console.error(o)})};await qg(t,!0),t.loadAddon(new I5(()=>{r.stdout.removeListener("data",i)},()=>{r.stderr.removeListener("data",i)})),r.stdout.on("data",i),r.stderr.on("data",i);let a=t.onData(async c=>X7(r.stdin,c));this.onExit.catch(E0).finally(()=>{a.dispose()})}},lo,ho=class ho{constructor(t,{args:s,cwd:r,executable:i,terminal:a,pythonExecutable:c}){this.context=t;I1(this,"shell");I1(this,"onExit");let{language:o}=t;this.shell=te(async()=>{if(j3(c))throw new Error(o.value.t("errors.no-Python-to-spawn-Unix-pseudoterminal"));let[l,n,u]=await Promise.all([Ng,F_,I_]),g={...n.env,PYTHONIOENCODING:D9};return j3(a)||(g.TERM=a),l.spawn(c,["-c",u,i].concat(s!=null?s:[]),{cwd:r,env:g,stdio:["pipe","pipe","pipe","pipe"],windowsHide:!0})}).then(l=>{try{l.stderr.on("data",n=>{self.console.error(n.toString($6))})}catch(n){self.console.warn(n)}return l}),this.onExit=this.shell.then(async l=>new Promise(n=>{l.once("exit",(u,g)=>{var f;n((f=u!=null?u:g)!=null?f:NaN)})}))}async kill(){if(!(await this.shell).kill())throw new Error(this.context.language.value.t("errors.error-killing-pseudoterminal"))}async pipe(t){let s=await this.shell,r=a=>{u2(t,a).catch(c=>{l0(t.element).console.error(c)})};await qg(t,!0),t.loadAddon(new I5(()=>{s.stdout.removeListener("data",r)},()=>{s.stderr.removeListener("data",r)})),s.stdout.on("data",r),s.stderr.on("data",r);let i=t.onData(async a=>X7(s.stdin,a));this.onExit.catch(E0).finally(()=>{i.dispose()})}async resize(t,s){let[r,i]=await Promise.all([this.shell,y41]),a=r.stdio[i1(ho,lo)];if(!(a instanceof i.Writable))throw new TypeError(q6(a));await X7(a,`${t}x${s}
`)}};lo=new WeakMap,x1(ho,lo,3);var co=ho,t5;(r=>(r.PLATFORM_PSEUDOTERMINALS=F1({darwin:co,linux:co,win32:Jg}),r.SUPPORTED_PLATFORMS=r4()(r.PLATFORM_PSEUDOTERMINALS),r.PLATFORM_PSEUDOTERMINAL=X6(r.SUPPORTED_PLATFORMS,w2.CURRENT)?r.PLATFORM_PSEUDOTERMINALS[w2.CURRENT]:null))(t5||(t5={}));var uo;(t=>{function e(s){let r=e2(s);return M4(s,{...It.LocalSettings.fix(s).value,lastReadChangelogVersion:Lx(rs,String(r.lastReadChangelogVersion),xx)})}t.fix=e})(uo||(uo={}));var P1;(n=>{n.optionals=F1([]);function t(u){let g=x0(u);for(let f of n.optionals)delete g[f];return g}n.persistent=t,n.DEFAULT=F1({addToCommand:!0,addToContextMenu:!0,createInstanceNearExistingOnes:!0,errorNoticeTimeout:Wi,exposeInternalModules:!0,focusOnNewInstance:!0,hideStatusBar:"focused",interceptLogging:!0,language:"",newInstanceBehavior:"newHorizontalSplit",noticeTimeout:5,openChangelogOnUpdate:!0,pinNewInstance:!0,preferredRenderer:"webgl",profiles:Object.fromEntries(["darwinExternalDefault","darwinIntegratedDefault","developerConsole","linuxExternalDefault","linuxIntegratedDefault","win32ExternalDefault","win32IntegratedDefault"].map(u=>[u,V7[u]]))}),n.DEFAULTABLE_LANGUAGES=F1(["",...X4.LANGUAGES]),n.NEW_INSTANCE_BEHAVIORS=F1(["replaceTab","newTab","newLeftTab","newLeftSplit","newRightTab","newRightSplit","newHorizontalSplit","newVerticalSplit","newWindow"]),n.HIDE_STATUS_BAR_OPTIONS=F1(["never","always","focused","running"]),n.PREFERRED_RENDERER_OPTIONS=h6.RENDERER_OPTIONS;let o;(C=>{C.TYPES=F1(["","invalid","developerConsole","external","integrated"]);function g(M,b,E){for(let S of Object.values(b))if(p(M,S)&&(E===void 0||f(S,E)))return S;return null}C.defaultOfType=g;function f(M,b){if(!("platforms"in M))return!0;let E=e2(M.platforms),S=E[b];return!!(typeof S=="boolean"&&S)}C.isCompatible=f;function p(M,b){return b.type===M}C.isType=p;function h(M){let{name:b}=M;return typeof b=="string"?b:""}C.name=h;function v([M,b]){let E=h(b);return Object.freeze({id:M,name:E,nameOrID:E||M,profile:b})}C.info=v,C.DEFAULTS=F1({"":V7.empty,developerConsole:{name:"",restoreHistory:!1,successExitCodes:R0,terminalOptions:V1,type:"developerConsole"},external:{args:[],executable:"",name:"",platforms:{darwin:!1,linux:!1,win32:!1},restoreHistory:!1,successExitCodes:R0,terminalOptions:V1,type:"external"},integrated:{args:[],executable:"",name:"",platforms:{darwin:!1,linux:!1,win32:!1},pythonExecutable:"",restoreHistory:!1,successExitCodes:R0,terminalOptions:V1,type:"integrated",useWin32Conhost:!0},invalid:{type:"invalid"}});function m(M){let b=e2(M),E=(S,k,I)=>{let H={};for(let R of I){let T=R;if(!(T in k))continue;let Y=k[T];H[T]=typeof Y=="boolean"?Y:S[T]}return H};return M4(M,(()=>{var k,I;let S=X6(C.TYPES,b.type)?b.type:"invalid";switch(S){case"":return{name:v1(C.DEFAULTS[S],b,"name",["string"]),restoreHistory:v1(C.DEFAULTS[S],b,"restoreHistory",["boolean"]),successExitCodes:Q7(C.DEFAULTS[S],b,"successExitCodes",["string"]),terminalOptions:y(b.terminalOptions).value,type:S};case"developerConsole":return{name:v1(C.DEFAULTS[S],b,"name",["string"]),restoreHistory:v1(C.DEFAULTS[S],b,"restoreHistory",["boolean"]),successExitCodes:Q7(C.DEFAULTS[S],b,"successExitCodes",["string"]),terminalOptions:y(b.terminalOptions).value,type:S};case"external":return{args:Q7(C.DEFAULTS[S],b,"args",["string"]),executable:v1(C.DEFAULTS[S],b,"executable",["string"]),name:v1(C.DEFAULTS[S],b,"name",["string"]),platforms:E(C.DEFAULTS[S].platforms,(k=b.platforms)!=null?k:{},t5.SUPPORTED_PLATFORMS),restoreHistory:v1(C.DEFAULTS[S],b,"restoreHistory",["boolean"]),successExitCodes:Q7(C.DEFAULTS[S],b,"successExitCodes",["string"]),terminalOptions:y(b.terminalOptions).value,type:S};case"integrated":return{args:Q7(C.DEFAULTS[S],b,"args",["string"]),executable:v1(C.DEFAULTS[S],b,"executable",["string"]),name:v1(C.DEFAULTS[S],b,"name",["string"]),platforms:E(C.DEFAULTS[S].platforms,(I=b.platforms)!=null?I:{},t5.SUPPORTED_PLATFORMS),pythonExecutable:v1(C.DEFAULTS[S],b,"pythonExecutable",["string"]),restoreHistory:v1(C.DEFAULTS[S],b,"restoreHistory",["boolean"]),successExitCodes:Q7(C.DEFAULTS[S],b,"successEx
`),a.value.noticeTimeout,i)}catch(h){D3(k3(h),()=>l.t("errors.error-checking-Python"),i)}finally{n=!1,s.update()}})(),s.update())}),n&&g.setCta()}).addExtraButton(A0(l.t(`asset:components.profile.${o.type}.Python-executable-icon`),l.t("components.profile.reset"),()=>{o.pythonExecutable=P1.Profile.DEFAULTS[o.type].pythonExecutable},async()=>this.postMutate()))}).newSetting(r,u=>{u.setName(l.t(`components.profile.${o.type}.use-win32-conhost`)).setDesc(l.t(`components.profile.${o.type}.use-win32-conhost-description`)).addToggle(I0(()=>o.useWin32Conhost,g=>{o.useWin32Conhost=g},async()=>this.postMutate())).addExtraButton(A0(l.t(`asset:components.profile.${o.type}.use-win32-conhost-icon`),l.t("components.profile.reset"),()=>{o.useWin32Conhost=P1.Profile.DEFAULTS[o.type].useWin32Conhost},async()=>this.postMutate()))})}break}}}};aa=new WeakMap,oe=new WeakMap,a8=new WeakMap,p6=new WeakMap;var go=class extends f5{constructor(s,r,i){var u,g,f,p,h,v,d;let{value:a}=s.language,c=x0(r),o=new Map(c.map(([m,w])=>[w,m])),l=(u=i==null?void 0:i.callback)!=null?u:()=>{},n=(g=i==null?void 0:i.keygen)!=null?g:()=>self.crypto.randomUUID();super(s,(m,w,y,C)=>{m.addButton(M=>M.setIcon(a.t("asset:components.profile-list.edit-icon")).setTooltip(a.t("components.profile-list.edit")).onClick(()=>{new sa(s,y(),async b=>{await C(E=>{is(E),Object.assign(E,b)})}).open()}).setDisabled(!w))},a4,c.map(([,m])=>m),{...i,async callback(m){await l(m.map(w=>{let y=o.get(w);return y===void 0&&o.set(w,y=tc([...o.values()],n)),[y,x0(w)]}))},descriptor:(f=i==null?void 0:i.descriptor)!=null?f:m=>{var y;let w=(y=o.get(m))!=null?y:"";return a.t(`components.profile-list.descriptor-${P1.Profile.isCompatible(m,w2.CURRENT)?"":"incompatible"}`,{info:P1.Profile.info([w,m]),interpolation:{escapeValue:!1}})},namer:(p=i==null?void 0:i.namer)!=null?p:m=>{var y;let w=(y=o.get(m))!=null?y:"";return a.t(`components.profile-list.namer-${P1.Profile.isCompatible(m,w2.CURRENT)?"":"incompatible"}`,{info:P1.Profile.info([w,m]),interpolation:{escapeValue:!1}})},presetPlaceholder:(h=i==null?void 0:i.presetPlaceholder)!=null?h:()=>a.t("components.profile-list.preset-placeholder"),presets:(v=i==null?void 0:i.presets)!=null?v:Mu.map(m=>({get name(){return s.language.value.t(`profile-presets.${m}`)},get value(){return x0(V7[m])}})),title:(d=i==null?void 0:i.title)!=null?d:()=>a.t("components.profile-list.title")});I1(this,"dataKeys");this.dataKeys=o}};var $_=T1(k9(),1);var ap=class extends lL{constructor(s,r){super(s);this.context=s;this.docs=r}onLoad(){super.onLoad();let{containerEl:s,context:r,context:{language:{value:i},localSettings:a,settings:c,version:o},docs:l,ui:n}=this;this.newDescriptionWidget(),this.newLanguageWidget(P1.DEFAULTABLE_LANGUAGES,u=>u?i.t(`language:${u}`):i.t("settings.language-default"),P1.DEFAULT),n.newSetting(s,u=>{u.setName(i.t("settings.documentation")).addButton(g=>g.setIcon(i.t("asset:settings.documentations.donate-icon")).setTooltip(i.t("settings.documentations.donate")).setCta().onClick(()=>{l.open("donate")})).addButton(g=>g.setIcon(i.t("asset:settings.documentations.readme-icon")).setTooltip(i.t("settings.documentations.readme")).setCta().onClick(()=>{l.open("readme"),tu(s)})).addButton(g=>{g.setIcon(i.t("asset:settings.documentations.changelog-icon")).setTooltip(i.t("settings.documentations.changelog")).onClick(()=>{l.open("changelog"),tu(s)}),(o===null||(0,$_.default)(a.value.lastReadChangelogVersion,o))&&g.setCta()})}),this.newAllSettingsWidget(P1.DEFAULT,P1.fix),n.newSetting(s,u=>{u.setName(i.t("settings.add-to-command")).addToggle(I0(()=>c.value.addToCommand,async g=>c.mutate(f=>{f.addToCommand=g}),()=>{this.postMutate()})).addExtraButton(A0(i.t("asset:settings.add-to-command-icon"),i.t("settings.reset"),async()=>c.mutate(g=>{g.addToCommand=P1.DEFAULT.addToCommand}),()=>{this.postMutate()}))}).newSetting(s,u=>{u.setName(i.t("settings.add-to-context-menu")).addToggle(I0(()=>c.value.addToContextMenu,async g=>c.mutate(f=>{f.addToContextMenu=g}),()=>{this.postMutate()})).addExtraButton(A0(i.t("asset:settings.add-to-context-menu-icon"),i.t("settings.reset"),a
// repository: https://github.com/polyipseity/obsidian-terminal
/* nosourcemap */