nvim-lua.kickstart.nvim/debuggers/vscode-js-debug/js-debug/src/dapDebugServer.js

184 lines
794 KiB
JavaScript
Raw Normal View History

2025-01-19 11:54:28 +01:00
"use strict";(()=>{var FO=Object.create;var mp=Object.defineProperty;var M_=Object.getOwnPropertyDescriptor;var UO=Object.getOwnPropertyNames;var WO=Object.getPrototypeOf,jO=Object.prototype.hasOwnProperty;var H=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var zs=(r,e)=>()=>(r&&(e=r(r=0)),e);var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),VO=(r,e)=>{for(var t in e)mp(r,t,{get:e[t],enumerable:!0})},qO=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of UO(e))!jO.call(r,i)&&i!==t&&mp(r,i,{get:()=>e[i],enumerable:!(n=M_(e,i))||n.enumerable});return r};var _=(r,e,t)=>(t=r!=null?FO(WO(r)):{},qO(e||!r||!r.__esModule?mp(t,"default",{value:r,enumerable:!0}):t,r));var E=(r,e,t,n)=>{for(var i=n>1?void 0:n?M_(e,t):e,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(e,t,i):s(i))||i);return n&&i&&mp(e,t,i),i},g=(r,e)=>(t,n)=>e(t,n,r);var je=v((EJ,N_)=>{"use strict";var DH=Object.defineProperty,GO=Object.getOwnPropertyDescriptor,KO=Object.getOwnPropertyNames,XO=Object.prototype.hasOwnProperty,zO=(r,e)=>{for(var t in e)DH(r,t,{get:e[t],enumerable:!0})},JO=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of KO(e))!XO.call(r,i)&&i!==t&&DH(r,i,{get:()=>e[i],enumerable:!(n=GO(e,i))||n.enumerable});return r},YO=r=>JO(DH({},"__esModule",{value:!0}),r),k_={};zO(k_,{config:()=>rN,t:()=>O_});N_.exports=YO(k_);var QO=H("fs"),ZO=H("fs/promises");async function eN(r){if(r.protocol==="file:")return await(0,ZO.readFile)(r,"utf8");if(r.protocol==="http:"||r.protocol==="https:"){let e=await fetch(r.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${r}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}function tN(r){return(0,QO.readFileSync)(r,"utf8")}var lu;function rN(r){if("contents"in r){typeof r.contents=="string"?lu=JSON.parse(r.contents):lu=r.contents;return}if("fsPath"in r){let e=tN(r.fsPath),t=JSON.parse(e);lu=R_(t)?t.contents.bundle:t;return}if(r.uri){let e=r.uri;return typeof r.uri=="string"&&(e=new URL(r.uri)),new Promise((t,n)=>{eN(e).then(i=>{try{let o=JSON.parse(i);lu=R_(o)?o.contents.bundle:o,t()}catch(o){n(o)}}).catch(i=>{n(i)})})}}function O_(...r){let e=r[0],t,n,i;if(typeof e=="string")t=e,n=e,r.splice(0,1),i=!r||typeof r[0]!="object"?r:r[0];else if(e instanceof Array){let s=r.slice(1);if(e.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let a=e[0];for(let c=1;c<e.length;c++)a+=`{${c-1}}`+e[c];return O_(a,...s)}else n=e.message,t=n,e.comment&&e.comment.length>0&&(t+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),i=e.args??{};let o=lu?.[t];return o?typeof o=="string"?Hp(o,i):o.comment?Hp(o.message,i):Hp(n,i):Hp(n,i)}var nN=/{([^}]+)}/g;function Hp(r,e){return Object.keys(e).length===0?r:r.replace(nN,(t,n)=>e[n]??t)}function R_(r){return typeof r?.contents?.bundle=="object"&&typeof r?.version=="string"}});var TH=v(()=>{var B_;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(r);typeof t.Reflect<"u"&&(n=i(t.Reflect,n)),e(n,t),typeof t.Reflect>"u"&&(t.Reflect=r);function i(c,u){return function(l,p){Object.defineProperty(c,l,{configurable:!0,writable:!0,value:p}),u&&u(l,p)}}function o(){try{return Function("return this;")()}catch{}}function s(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return o()||s()}})(function(e,t){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!a&&!c,l={create:a?function(){ret
but it has asynchronous dependencies.`};V.LAZY_IN_SYNC=gN;V.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier";V.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var yN=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"The number of constructor arguments in the derived class "+(r[0]+" must be >= than the number of constructor arguments of its base class.")};V.ARGUMENTS_LENGTH_MISMATCH=yN;V.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.";V.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE='Invalid Container option. Default scope must be a string ("singleton" or "transient").';V.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean";V.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean";V.MULTIPLE_PRE_DESTROY_METHODS="Cannot apply @preDestroy decorator multiple times in the same class";V.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";V.ASYNC_UNBIND_REQUIRED="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)";var bN=function(r,e){return"@postConstruct error in class "+r+": "+e};V.POST_CONSTRUCT_ERROR=bN;var vN=function(r,e){return"@preDestroy error in class "+r+": "+e};V.PRE_DESTROY_ERROR=vN;var IN=function(r,e){return"onDeactivation() error in class "+r+": "+e};V.ON_DEACTIVATION_ERROR=IN;var _N=function(r,e){return"It looks like there is a circular dependency in one of the '"+r+"' bindings. Please investigate bindings with "+("service identifier '"+e+"'.")};V.CIRCULAR_DEPENDENCY_IN_FACTORY=_N;V.STACK_OVERFLOW="Maximum call stack size exceeded"});var kH=v(hn=>{"use strict";var AN=hn&&hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wN=hn&&hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SN=hn&&hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AN(e,r,t);return wN(e,r),e};Object.defineProperty(hn,"__esModule",{value:!0});hn.MetadataReader=void 0;var RH=SN(tt()),EN=function(){function r(){}return r.prototype.getConstructorMetadata=function(e){var t=Reflect.getMetadata(RH.PARAM_TYPES,e),n=Reflect.getMetadata(RH.TAGGED,e);return{compilerGeneratedMetadata:t,userGeneratedMetadata:n||{}}},r.prototype.getPropertiesMetadata=function(e){var t=Reflect.getMetadata(RH.TAGGED_PROP,e)||[];return t},r}();hn.MetadataReader=EN});var nA=v(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.BindingCount=void 0;wp.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}});var OH=v(_r=>{"use strict";var xN=_r&&_r.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PN=_r&&_r.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),LN=_r&&_r.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&xN(e,r,t);return PN(e,r),e};Object.defineProperty(_r,"__esModule",{value:!0});_r.tryAndThrowErrorIfStackOverflow=_r.isStackOverflowExeption=void 0;var $N=LN(Et());function iA(r){return r instanceof RangeError||r.message===$N.STACK_OVERFLOW}_r.isStackOverflowExeption=iA;var CN=function(r,e){try{return r()}catch(t){throw iA(t)&&(t=e()),t}};_r.tryAndThrowErrorIfStackOverflow=CN});var No=v(rt=>{"use strict";var DN=rt
Registered bindings:`,i.forEach(function(o){var s="Object";o.implementationType!==null&&(s=cA(o.implementationType)),n=n+`
`+s,o.constraint.metaData&&(n=n+" - "+o.constraint.metaData)})),n}rt.listRegisteredBindingsForServiceIdentifier=kN;function sA(r,e){return r.parentRequest===null?!1:r.parentRequest.serviceIdentifier===e?!0:sA(r.parentRequest,e)}function ON(r){function e(n,i){i===void 0&&(i=[]);var o=oA(n.serviceIdentifier);return i.push(o),n.parentRequest!==null?e(n.parentRequest,i):i}var t=e(r);return t.reverse().join(" --> ")}function aA(r){r.childRequests.forEach(function(e){if(sA(e,e.serviceIdentifier)){var t=ON(e);throw new Error(RN.CIRCULAR_DEPENDENCY+" "+t)}else aA(e)})}rt.circularDependencyToException=aA;function NN(r,e){if(e.isTagged()||e.isNamed()){var t="",n=e.getNamedTag(),i=e.getCustomTags();return n!==null&&(t+=n.toString()+`
`),i!==null&&i.forEach(function(o){t+=o.toString()+`
`})," "+r+`
`+r+" - "+t}else return" "+r}rt.listMetadataForTarget=NN;function cA(r){if(r.name)return r.name;var e=r.toString(),t=e.match(/^function\s*([^\s(]+)/);return t?t[1]:"Anonymous function: "+e}rt.getFunctionName=cA;function BN(r){return r.toString().slice(7,-1)}rt.getSymbolDescription=BN});var uA=v(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Context=void 0;var FN=Oi(),UN=function(){function r(e){this.id=(0,FN.id)(),this.container=e}return r.prototype.addPlan=function(e){this.plan=e},r.prototype.setCurrentRequest=function(e){this.currentRequest=e},r}();Sp.Context=UN});var Jr=v(mn=>{"use strict";var WN=mn&&mn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),jN=mn&&mn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),VN=mn&&mn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&WN(e,r,t);return jN(e,r),e};Object.defineProperty(mn,"__esModule",{value:!0});mn.Metadata=void 0;var qN=VN(tt()),GN=function(){function r(e,t){this.key=e,this.value=t}return r.prototype.toString=function(){return this.key===qN.NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},r}();mn.Metadata=GN});var lA=v(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Plan=void 0;var KN=function(){function r(e,t){this.parentContext=e,this.rootRequest=t}return r}();Ep.Plan=KN});var Pp=v(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.LazyServiceIdentifier=void 0;var XN=function(){function r(e){this._cb=e}return r.prototype.unwrap=function(){return this._cb()},r}();xp.LazyServiceIdentifier=XN});var pA=v(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.QueryableString=void 0;var zN=function(){function r(e){this.str=e}return r.prototype.startsWith=function(e){return this.str.indexOf(e)===0},r.prototype.endsWith=function(e){var t="",n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},r.prototype.contains=function(e){return this.str.indexOf(e)!==-1},r.prototype.equals=function(e){return this.str===e},r.prototype.value=function(){return this.str},r}();Lp.QueryableString=zN});var NH=v(Hn=>{"use strict";var JN=Hn&&Hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),YN=Hn&&Hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),QN=Hn&&Hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&JN(e,r,t);return YN(e,r),e};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.Target=void 0;var ui=QN(tt()),ZN=Oi(),eB=No(),dA=Jr(),tB=pA(),rB=function(){function r(e,t,n,i){this.id=(0,ZN.id)(),this.type=e,this.serviceIdentifier=n;var o=typeof t=="symbol"?(0,eB.getSymbolDescription)(t):t;this.name=new tB.QueryableString(o||""),this.identifier=t,this.metadata=new Array;var s=null;typeof i=="string"?s=new dA.Metadata(ui.NAMED_TAG,i):i instanceof dA.Metadata&&(s=i),s!==null&&this.metadata.push(s)}return r.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t<n.length;t++){var i=n[t];if(i.key===e)return!0}return!1},r.prototype.isArray=function(){return this.hasTag(ui.MULTI_INJECT_TAG)},r.prototype.matchesArray=function(e){return this.matchesTag(ui.MULTI_INJECT_TAG)(e)},r.prototype.isNamed=function(){return this.hasTag(ui.NAMED_TAG)},r.prototype.isTagged=function(){return this.metadata.some(function(e){return ui.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})})},r.prototype.isOptional=function(){return this.matchesTag(ui.OPT
`:10,t=typeof r=="string"?"\r":13;return r[r.length-1]===e&&(r=r.slice(0,r.length-1)),r[r.length-1]===t&&(r=r.slice(0,r.length-1)),r}});var vS=v((eQ,yu)=>{"use strict";var gu=H("path"),yS=hg(),bS=r=>{r={cwd:process.cwd(),path:process.env[yS()],execPath:process.execPath,...r};let e,t=gu.resolve(r.cwd),n=[];for(;e!==t;)n.push(gu.join(t,"node_modules/.bin")),e=t,t=gu.resolve(t,"..");let i=gu.resolve(r.cwd,r.execPath,"..");return n.push(i),n.concat(r.path).join(gu.delimiter)};yu.exports=bS;yu.exports.default=bS;yu.exports.env=r=>{r={env:process.env,...r};let e={...r.env},t=yS({env:e});return r.path=e[t],e[t]=yu.exports(r),e}});var _S=v((tQ,_g)=>{"use strict";var IS=(r,e)=>{for(let t of Reflect.ownKeys(e))Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t));return r};_g.exports=IS;_g.exports.default=IS});var wS=v((rQ,nd)=>{"use strict";var bW=_S(),rd=new WeakMap,AS=(r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",o=function(...s){if(rd.set(o,++n),n===1)t=r.apply(this,s),r=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t};return bW(o,r),rd.set(o,n),o};nd.exports=AS;nd.exports.default=AS;nd.exports.callCount=r=>{if(!rd.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return rd.get(r)}});var SS=v(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.SIGNALS=void 0;var vW=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"
${n.message}`:m,D=[w,e,r].filter(Boolean).join(`
`);return y?(n.originalMessage=n.message,n.message=D):n=new Error(D),n.shortMessage=w,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=r,n.stderr=e,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=u,n.killed=l&&!c,n};CS.exports=BW});var MS=v((cQ,wg)=>{"use strict";var sd=["stdin","stdout","stderr"],FW=r=>sd.some(e=>r[e]!==void 0),TS=r=>{if(!r)return;let{stdio:e}=r;if(e===void 0)return sd.map(n=>r[n]);if(FW(r))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${sd.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let t=Math.max(e.length,sd.length);return Array.from({length:t},(n,i)=>e[i])};wg.exports=TS;wg.exports.node=r=>{let e=TS(r);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var RS=v((uQ,ad)=>{ad.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ad.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ad.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var NS=v((lQ,Iu)=>{var UW=H("assert"),bu=RS(),WW=/^win/i.test(process.platform),cd=H("events");typeof cd!="function"&&(cd=cd.EventEmitter);var _t;process.__signal_exit_emitter__?_t=process.__signal_exit_emitter__:(_t=process.__signal_exit_emitter__=new cd,_t.count=0,_t.emitted={});_t.infinite||(_t.setMaxListeners(1/0),_t.infinite=!0);Iu.exports=function(r,e){UW.equal(typeof r,"function","a callback must be provided for exit handler"),vu===!1&&kS();var t="exit";e&&e.alwaysLast&&(t="afterexit");var n=function(){_t.removeListener(t,r),_t.listeners("exit").length===0&&_t.listeners("afterexit").length===0&&Eg()};return _t.on(t,r),n};Iu.exports.unload=Eg;function Eg(){vu&&(vu=!1,bu.forEach(function(r){try{process.removeListener(r,xg[r])}catch{}}),process.emit=Sg,process.reallyExit=OS,_t.count-=1)}function la(r,e,t){_t.emitted[r]||(_t.emitted[r]=!0,_t.emit(r,e,t))}var xg={};bu.forEach(function(r){xg[r]=function(){var t=process.listeners(r);t.length===_t.count&&(Eg(),la("exit",null,r),la("afterexit",null,r),WW&&r==="SIGHUP"&&(r="SIGINT"),process.kill(process.pid,r))}});Iu.exports.signals=function(){return bu};Iu.exports.load=kS;var vu=!1;function kS(){vu||(vu=!0,_t.count+=1,bu=bu.filter(function(r){try{return process.on(r,xg[r]),!0}catch{return!1}}),process.emit=VW,process.reallyExit=jW)}var OS=process.reallyExit;function jW(r){process.exitCode=r||0,la("exit",process.exitCode,null),la("afterexit",process.exitCode,null),OS.call(process,process.exitCode)}var Sg=process.emit;function VW(r,e){if(r==="exit"){e!==void 0&&(process.exitCode=e);var t=Sg.apply(this,arguments);return la("exit",process.exitCode,null),la("afterexit",process.exitCode,null),t}else return Sg.apply(this,arguments)}});var FS=v((pQ,BS)=>{"use strict";var qW=H("os"),GW=NS(),KW=1e3*5,XW=(r,e="SIGTERM",t={})=>{let n=r(e);return zW(r,e,t,n),n},zW=(r,e,t,n)=>{if(!JW(e,t,n))return;let i=QW(t),o=setTimeout(()=>{r("SIGKILL")},i);o.unref&&o.unref()},JW=(r,{forceKillAfterTimeout:e},t)=>YW(r)&&e!==!1&&t,YW=r=>r===qW.constants.signals.SIGTERM||typeof r=="string"&&r.toUpperCase()==="SIGTERM",QW=({forceKillAfterTimeout:r=!0})=>{if(r===!0)return KW;if(!Number.isFinite(r)||r<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`);return r},ZW=(r,e)=>{r.kill()&&(e.isCanceled=!0)},e2=(r,e,t)=>{r.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},t2=(r,{timeout:e,killSignal:t="SIGTERM"},n)=>{if(e===0||e===void 0)return n;let i,o=new Promise((a,c)=>{i=setTimeout(()=>{e2(r,t,c)},e)}),s=n.finally(()=>{clearTimeout(i)});return Promise.race([o,s])},r2=({timeout:r})=>{if(r!==void 0&&(!Number.isFinite(r)||r<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${r}\` (${type
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var mP=v((Jte,hP)=>{"use strict";var Iq=Hf(),{MAX_LENGTH:pP,CHAR_BACKSLASH:My,CHAR_BACKTICK:_q,CHAR_COMMA:Aq,CHAR_DOT:wq,CHAR_LEFT_PARENTHESES:Sq,CHAR_RIGHT_PARENTHESES:Eq,CHAR_LEFT_CURLY_BRACE:xq,CHAR_RIGHT_CURLY_BRACE:Pq,CHAR_LEFT_SQUARE_BRACKET:dP,CHAR_RIGHT_SQUARE_BRACKET:fP,CHAR_DOUBLE_QUOTE:Lq,CHAR_SINGLE_QUOTE:$q,CHAR_NO_BREAK_SPACE:Cq,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Dq}=lP(),Tq=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(pP,t.maxLength):pP;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},o=[i],s=i,a=i,c=0,u=r.length,l=0,p=0,d,f=()=>r[l++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});l<u;)if(s=o[o.length-1],d=f(),!(d===Dq||d===Cq)){if(d===My){h({type:"text",value:(e.keepEscaping?d:"")+f()});continue}if(d===fP){h({type:"text",value:"\\"+d});continue}if(d===dP){c++;let m;for(;l<u&&(m=f());){if(d+=m,m===dP){c++;continue}if(m===My){d+=f();continue}if(m===fP&&(c--,c===0))break}h({type:"text",value:d});continue}if(d===Sq){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:d});continue}if(d===Eq){if(s.type!=="paren"){h({type:"text",value:d});continue}s=o.pop(),h({type:"text",value:d}),s=o[o.length-1];continue}if(d===Lq||d===$q||d===_q){let m=d,y;for(e.keepQuotes!==!0&&(d="");l<u&&(y=f());){if(y===My){d+=y+f();continue}if(y===m){e.keepQuotes===!0&&(d+=y);break}d+=y}h({type:"text",value:d});continue}if(d===xq){p++;let y={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=h(y),o.push(s),h({type:"open",value:d});continue}if(d===Pq){if(s.type!=="brace"){h({type:"text",value:d});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:d}),p--,s=o[o.length-1];continue}if(d===Aq&&p>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Iq(s)}]}h({type:"comma",value:d}),s.commas++;continue}if(d===wq&&p>0&&s.commas===0){let m=s.nodes;if(p===0||m.length===0){h({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let y=m[m.length-1];y.value+=a.value+d,a=y,s.ranges--;continue}h({type:"dot",value:d});continue}h({type:"text",value:d})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let m=o[o.length-1],y=m.nodes.indexOf(s);m.nodes.splice(y,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};hP.exports=Tq});var yP=v((Yte,gP)=>{"use strict";var HP=Hf(),Mq=oP(),Rq=cP(),kq=mP(),ar=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=ar.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(ar.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};ar.parse=(r,e={})=>kq(r,e);ar.stringify=(r,e={})=>HP(typeof r=="string"?ar.parse(r,e):r,e);ar.compile=(r,e={})=>(typeof r=="string"&&(r=ar.parse(r,e)),Mq(r,e));ar.expand=(r,e={})=>{typeof r=="string"&&(r=ar.parse(r,e));let t=Rq(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};ar.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?ar.compile(r,e):ar.expand(r,e);gP.exports=ar});var Qu=v((Qte,AP)=>{"use strict";var Oq=H("path"),Vn="\\\\/",bP=`[^${Vn}]`,bi="\\.",Nq="\\+",Bq="\\?",bf="\\/",Fq="(?=.)",vP="[^/]",Ry=`(?:${bf}|$)`,IP=`(?:^|${bf})`,ky=`${bi}{1,2}${Ry}`,Uq=`(?!${bi})`,Wq=`(?
`).join(`\r
`)),o.removeListener("error",o$),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(hl,this)})),a(l,i)}};a$.exports=bb;function MG(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function hl(r){r._state=s$,r.emit("close")}function o$(){this.destroy()}function ml(r,e,t,n){t=t||Uf.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Uf.STATUS_CODES[e]}\r
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
`)+`\r
\r
`+t)}function ps(r,e,t,n,i){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ps),r.emit("wsClientError",o,t,e)}else ml(t,n,i)}});var w$=v((roe,A$)=>{"use strict";A$.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var E$=v((noe,S$)=>{S$.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var L$=v((ioe,P$)=>{"use strict";var jG=E$(),VG=Array.prototype.concat,qG=Array.prototype.slice,x$=P$.exports=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var o=e[n];jG(o)?t=VG.call(t,qG.call(o)):t.push(o)}return t};x$.wrap=function(r){return functi
`).map(c=>c.trim().replace(VC,""))].filter(c=>!!c),s=this.getPreferredPath();s&&o.push(s);let a=new Set;for(let c of o)for(let u of n){let l=q4.posix.join(c.trim(),u);try{await this.fs.access(l),a.add(l)}catch{}}return a}createPriorities(e){let t=this.env.HOME&&(0,pv.escapeRegexSpecialChars)(this.env.HOME),n=this.getPreferredPath(),i=e.reduce((o,s)=>[...o,{regex:new RegExp(`^/Applications/.*${s.name}`),weight:s.weight+100,quality:s.quality},{regex:new RegExp(`^${t}/Applications/.*${s.name}`),weight:s.weight,quality:s.quality},{regex:new RegExp(`^/Volumes/.*${s.name}`),weight:s.weight-100,quality:s.quality}],[]);return n&&i.unshift({regex:new RegExp((0,pv.escapeRegexSpecialChars)(n)),weight:151,quality:"custom"}),i}};Ph.DarwinFinderBase=dv});var qC=v($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.DarwinChromeBrowserFinder=void 0;var K4=Si(),X4=Lh(),fv=class extends X4.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",quality:"stable"},{path:"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",quality:"canary"},{path:"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta",quality:"beta"},{path:"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Google Chrome Canary","/Contents/MacOS/Google Chrome Beta","/Contents/MacOS/Google Chrome Dev","/Contents/MacOS/Google Chrome"],t=["/Applications/Google Chrome.app","/Applications/Google Chrome Canary.app"],n=await this.findLaunchRegisteredApps("google chrome[A-Za-z() ]*.app",t,e);return(0,K4.sort)(n,this.createPriorities([{name:"Chrome.app",weight:0,quality:"stable"},{name:"Chrome Canary.app",weight:1,quality:"canary"},{name:"Chrome Beta.app",weight:2,quality:"beta"},{name:"Chrome Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.CHROME_PATH}};$h.DarwinChromeBrowserFinder=fv});var GC=v(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.DarwinEdgeBrowserFinder=void 0;var z4=Si(),J4=Lh(),hv=class extends J4.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",quality:"stable"},{path:"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",quality:"canary"},{path:"/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",quality:"beta"},{path:"/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Microsoft Edge Canary","/Contents/MacOS/Microsoft Edge Beta","/Contents/MacOS/Microsoft Edge Dev","/Contents/MacOS/Microsoft Edge"],t=["/Applications/Microsoft Edge.app"],n=await this.findLaunchRegisteredApps("Microsoft Edge[A-Za-z ]*.app",t,e);return(0,z4.sort)(n,this.createPriorities([{name:"Microsoft Edge.app",weight:0,quality:"stable"},{name:"Microsoft Edge Canary.app",weight:1,quality:"canary"},{name:"Microsoft Edge Beta.app",weight:2,quality:"beta"},{name:"Microsoft Edge Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.EDGE_PATH}};Ch.DarwinEdgeBrowserFinder=hv});var KC=v(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.DarwinFirefoxBrowserFinder=void 0;var Y4=Si(),Q4=Lh(),mv=class extends Q4.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Firefox.app/Contents/MacOS/firefox",quality:"stable"},{path:"/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox",quality:"dev"},{path:"/Applications/Firefox Nightly.app/Contents/MacOS/firefox",quality:"canary"}]}async findAllInner(){let e=["/Contents/MacOS/firefox"],t=["/Applications/Firefox.app"],n=await this.findLaunchRegisteredApps("Firefox[A-Za-z ]*.app",t,e);return(0,Y4.sort)(n,this.createPriorities([{name:"Firefox.app",weight:0,quality:"stable"},{name:"Firefox Nightly.app",weight:1,quality:"canary"},{name:"Firefox Developer Edition.app",weight:2,quality:"dev"}]))}getP
Please report this to https://github.com/szmarczak/http2-wrapper/`);h(m)}return}n[0].resolve(f);return}}if(s in this.queue){if(a in this.queue[s]){this.queue[s][a].listeners.push(...n),this._tryToCreateNewSession(s,a);return}}else this.queue[s]={};let c=()=>{s in this.queue&&this.queue[s][a]===u&&(delete this.queue[s][a],Object.keys(this.queue[s]).length===0&&delete this.queue[s])},u=()=>{let l=`${a}:${s}`,p=!1;try{let d=UK.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(l),...t});d[Gt]=0,d[vc]=!1;let f=()=>d[Gt]<d.remoteSettings.maxConcurrentStreams,h=!0;d.socket.once("session",y=>{this.tlsSessionCache.set(l,y)}),d.once("error",y=>{for(let{reject:w}of n)w(y);this.tlsSessionCache.delete(l)}),d.setTimeout(this.timeout,()=>{d.destroy()}),d.once("close",()=>{if(p){h&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[s];y.splice(y.indexOf(d),1),y.length===0&&delete this.sessions[s]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:w}of n)w(y);c()}this._tryToCreateNewSession(s,a)});let m=()=>{if(!(!(s in this.queue)||!f())){for(let y of d[Nr])if(y in this.queue[s]){let{listeners:w}=this.queue[s][y];for(;w.length!==0&&f();)w.shift().resolve(d);let D=this.queue[s];if(D[y].listeners.length===0&&(delete D[y],Object.keys(D).length===0)){delete this.queue[s];break}if(!f())break}}};d.on("origin",()=>{d[Nr]=d.originSet,f()&&(m(),Kv(this.sessions[s],d))}),d.once("remoteSettings",()=>{if(d.ref(),d.unref(),this._sessionsCount++,u.destroyed){let y=new Error("Agent has been destroyed");for(let w of n)w.reject(y);d.destroy();return}d[Nr]=d.originSet;{let y=this.sessions;if(s in y){let w=y[s];w.splice(VK(w,d,qK),0,d)}else y[s]=[d]}this._freeSessionsCount+=1,p=!0,this.emit("session",d),m(),c(),d[Gt]===0&&this._freeSessionsCount>this.maxFreeSessions&&d.close(),n.length!==0&&(this.getSession(a,t,n),n.length=0),d.on("remoteSettings",()=>{m(),Kv(this.sessions[s],d)})}),d[cT]=d.request,d.request=(y,w)=>{if(d[vc])throw new Error("The session is gracefully closing. No new streams are allowed.");let D=d[cT](y,w);return d.ref(),++d[Gt],d[Gt]===d.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,D.once("close",()=>{if(h=f(),--d[Gt],!d.destroyed&&!d.closed&&(GK(this.sessions[s],d),f()&&!d.closed)){h||(this._freeSessionsCount++,h=!0);let j=d[Gt]===0;j&&d.unref(),j&&(this._freeSessionsCount>this.maxFreeSessions||d[vc])?d.close():(Kv(this.sessions[s],d),m())}}),D}}catch(d){for(let f of n)f.reject(d);c()}};u.listeners=n,u.completed=!1,u.destroyed=!1,this.queue[s][a]=u,this._tryToCreateNewSession(s,a)})}request(e,t,n,i){return new Promise((o,s)=>{this.getSession(e,t,[{reject:s,resolve:a=>{try{o(a.request(n,i))}catch(c){s(c)}}}])})}createConnection(e,t){return r.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let n=e.port||443,i=e.hostname||e.host;return typeof t.servername>"u"&&(t.servername=i),FK.connect(n,i,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[Gt]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let n of t)n.destroy(e);for(let t of Object.values(this.queue))for(let n of Object.values(t))n.destroyed=!0;this.queue={}}get freeSessions(){return uT({agent:this,isFree:!0})}get busySessions(){return uT({agent:this,isFree:!1})}};ws.kCurrentStreamsCount=Gt;ws.kGracefullyClosing=vc;pT.exports={Agent:ws,globalAgent:new ws}});var Jv=v((ppe,dT)=>{"use strict";var{Readable:KK}=H("stream"),zv=class extends KK{constructor(e,t){super({highWaterMark:t,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_
`).reverse(),c=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(`
`).reverse();for(;c.length!==0&&c[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,s)}${a.reverse().join(`
`)}${c.reverse().join(`
`)}`}}};me.RequestError=et;var am=class extends et{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};me.MaxRedirectsError=am;var cm=class extends et{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};me.HTTPError=cm;var um=class extends et{constructor(e,t){super(e.message,e,t),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};me.CacheError=um;var lm=class extends et{constructor(e,t){super(e.message,e,t),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};me.UploadError=lm;var pm=class extends et{constructor(e,t,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=t}};me.TimeoutError=pm;var Fl=class extends et{constructor(e,t){super(e.message,e,t),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};me.ReadError=Fl;var dm=class extends et{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};me.UnsupportedProtocolError=dm;var eX=["socket","connect","continue","information","upgrade","timeout"],fm=class extends tM.Duplex{constructor(e,t={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ac]=0,this[Sc]=0,this.requestInitialized=!1,this[im]=new Set,this.redirects=[],this[Ec]=!1,this[om]=!1,this[Bl]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),o=()=>this._lockWrite();this.on("pipe",u=>{u.prependListener("data",i),u.on("data",o),u.prependListener("end",i),u.on("end",o)}),this.on("unpipe",u=>{u.off("data",i),u.off("data",o),u.off("end",i),u.off("end",o)}),this.on("pipe",u=>{u instanceof II.IncomingMessage&&(this.options.headers={...u.headers,...this.options.headers})});let{json:s,body:a,form:c}=t;if((s||a||c)&&this._lockWrite(),me.kIsNormalizedAlready in t)this.options=t;else try{this.options=this.constructor.normalizeArguments(e,t,n)}catch(u){S.default.nodeStream(t.body)&&t.body.destroy(),this.destroy(u);return}(async()=>{var u;try{this.options.body instanceof T9.ReadStream&&await Y9(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(u=this[wt])===null||u===void 0||u.destroy();return}for(let p of this[Bl])p();this[Bl].length=0,this.requestInitialized=!0}catch(l){if(l instanceof et){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,t,n){var i,o,s,a,c;let u=t;if(S.default.object(e)&&!S.default.urlInstance(e))t={...n,...e,...t};else{if(e&&t&&t.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");t={...n,...t},e!==void 0&&(t.url=e),S.default.urlInstance(t.url)&&(t.url=new fo.URL(t.url.toString()))}if(t.cache===!1&&(t.cache=void 0),t.dnsCache===!1&&(t.dnsCache=void 0),S.assert.any([S.default.string,S.default.undefined],t.method),S.assert.any([S.default.object,S.default.undefined],t.headers),S.assert.any([S.default.string,S.default.urlInstance,S.default.undefined],t.prefixUrl),S.assert.any([S.default.object,S.default.undefined],t.cookieJar),S.assert.any([S.default.object,S.default.string,S.default.undefined],t.searchParams),S.assert.any([S.default.object,S.default.string,S.default.undefined],t.cache),S.assert.any([S.default.object,S.default.number,S.default.undefined],t.timeout),S.assert.any([S.default.object,S.default.undefined],t.context),S.assert.any([S.default.object,S.default.undefined],t.hooks),S.assert.any([S.default.boolean,S.default.undefined],t.decompress),S.assert.any([S.default.boolean,S.default.undefined],t.ignoreInvalidCookies),S.assert.any([S.default.boolean,S.default.undefined],t.followRedirect),S.assert.any([S.default.number,S.default.undefined],t.maxRedirects),S.a
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var zM=zs(()=>{XM()});async function kI(r=CX){let{stdout:e}=await r("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),t=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!t)throw new vm(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=t.groups,i=DX[n];if(!i)throw new vm(`Unknown browser ID: ${n}`);return i}var JM,YM,CX,DX,vm,QM=zs(()=>{JM=H("node:util"),YM=H("node:child_process"),CX=(0,JM.promisify)(YM.execFile),DX={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},vm=class extends Error{}});var rR={};VO(rR,{default:()=>tR});async function tR(){if(Im.default.platform==="darwin"){let r=await TI();return{name:await RI(r),id:r}}if(Im.default.platform==="linux"){let{stdout:r}=await TX("xdg-mime",["query","default","x-scheme-handler/http"]),e=r.trim();return{name:MX(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Im.default.platform==="win32")return kI();throw new Error("Only macOS, Linux, and Windows are supported")}var ZM,Im,eR,TX,MX,nR=zs(()=>{ZM=H("node:util"),Im=_(H("node:process"),1),eR=H("node:child_process");VM();zM();QM();TX=(0,ZM.promisify)(eR.execFile),MX=r=>r.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var cR=v((gfe,aR)=>{"use strict";function kX(r){var e=new r,t=e;function n(){var o=e;return o.next?e=o.next:(e=new r,t=e),o.next=null,o}function i(o){t.next=o,t=o}return{get:n,release:i}}aR.exports=kX});var lR=v((yfe,NI)=>{"use strict";var OX=cR();function uR(r,e,t){if(typeof r=="function"&&(t=e,e=r,r=null),t<1)throw new Error("fastqueue concurrency must be greater than 1");var n=OX(NX),i=null,o=null,s=0,a=null,c={push:m,drain:jr,saturated:jr,pause:l,paused:!1,concurrency:t,running:u,resume:f,idle:h,length:p,getQueue:d,unshift:y,empty:jr,kill:D,killAndDrain:j,error:X};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var B=i,Z=0;B;)B=B.next,Z++;return Z}function d(){for(var B=i,Z=[];B;)Z.push(B.value),B=B.next;return Z}function f(){if(c.paused){c.paused=!1;for(var B=0;B<c.concurrency;B++)s++,w()}}function h(){return s===0&&c.length()===0}function m(B,Z){var O=n.get();O.context=r,O.release=w,O.value=B,O.callback=Z||jr,O.errorHandler=a,s===c.concurrency||c.paused?o?(o.next=O,o=O):(i=O,o=O,c.saturated()):(s++,e.call(r,O.value,O.worked))}function y(B,Z){var O=n.get();O.context=r,O.release=w,O.value=B,O.callback=Z||jr,s===c.concurrency||c.paused?i?(O.next=i,i=O):(i=O,o=O,c.saturated()):(s++,e.call(r,O.value,O.worked))}function w(B){B&&n.release(B);var Z=i;Z?c.paused?s--:(o===i&&(o=null),i=Z.next,Z.next=null,e.call(r,Z.value,Z.worked),o===null&&c.empty()):--s===0&&c.drain()}function D(){i=null,o=null,c.drain=jr}function j(){i=null,o=null,c.drain(),c.drain=jr}function X(B){a=B}}function jr(){}function NX(){this.value=null,this.callback=jr,this.next=null,this.release=jr,this.context=null,this.errorHandler=null;var r=this;this.worked=function(t,n){var i=r.callback,o=r.errorHandler,s=r.value;r.value=null,r.callback=jr,r.errorHandler&&o(t,s),i.call(r.context,t,n),r.release(r)}}function BX(r,e,t){typeof r=="function"&&(t=e,e=r,r=null);function n(l,p){e.call(this,l).then(function(d){p(null,d)},p)}var i=uR(r,n,t),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=u,i;function a(l){var p=new Promise(function(d,f){o(l,function(h,m){if(h){f(h);return}d(m)})});return p.catch(jr),p}function c(l){var p=new Promise(function(d,f){s(l,function(h,m){if(h){f(h);return}d(m)})});return p.catc
`);let n;for(;(n=W6.exec(t))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
`),o=o.replace(/\\r/g,"\r")),e[i]=o}return e}function V6(r){let e=x1(r),t=bt.configDotenv({path:e});if(!t.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=E1(r).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),c=K6(t,a);o=bt.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=i)throw a}return bt.parse(o)}function q6(r){console.log(`[dotenv@${I_}][INFO] ${r}`)}function G6(r){console.log(`[dotenv@${I_}][WARN] ${r}`)}function sH(r){console.log(`[dotenv@${I_}][DEBUG] ${r}`)}function E1(r){return r&&r.DOTENV_KEY&&r.DOTENV_KEY.length>0?r.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function K6(r,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=t.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=t.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=r.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function x1(r){let e=null;if(r&&r.path&&r.path.length>0)if(Array.isArray(r.path))for(let t of r.path)oH.existsSync(t)&&(e=t.endsWith(".vault")?t:`${t}.vault`);else e=r.path.endsWith(".vault")?r.path:`${r.path}.vault`;else e=v_.resolve(process.cwd(),".env.vault");return oH.existsSync(e)?e:null}function X6(r){return r[0]==="~"?v_.join(B6.homedir(),r.slice(1)):r}function z6(r){q6("Loading env from encrypted .env.vault");let e=bt._parseVault(r),t=process.env;return r&&r.processEnv!=null&&(t=r.processEnv),bt.populate(t,e,r),{parsed:e}}function J6(r){let e=v_.resolve(process.cwd(),".env"),t="utf8",n=!!(r&&r.debug);if(r){if(r.path!=null){let i=r.path;if(Array.isArray(i)){for(let o of r.path)if(oH.existsSync(o)){i=o;break}}e=X6(i)}r.encoding!=null?t=r.encoding:n&&sH("No encoding is specified. UTF-8 is used by default")}try{let i=bt.parse(oH.readFileSync(e,{encoding:t})),o=process.env;return r&&r.processEnv!=null&&(o=r.processEnv),bt.populate(o,i,r),{parsed:i}}catch(i){return n&&sH(`Failed to load ${e} ${i.message}`),{error:i}}}function Y6(r){if(E1(r).length===0)return bt.configDotenv(r);let e=x1(r);return e?bt._configVault(r):(G6(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),bt.configDotenv(r))}function Q6(r,e){let t=Buffer.from(e.slice(-64),"hex"),n=Buffer.from(r,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=F6.createDecipheriv("aes-256-gcm",t,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function Z6(r,e,t={}){let n=!!(t&&t.debug),i=!!(t&&t.override);if(typeof e!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(e))Object.prototype.hasOwnProperty.call(r,o)?(i===!0&&(r[o]=e[o]),n&&sH(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):r[o]=e[o]}var bt={configDotenv:J6,_configVault:z6,_parseVault:V6,config:Y6,decrypt:Q6,parse:j6,populate:Z6};Mi.exports.configDotenv=bt.configDotenv;Mi.exports._configVault=bt._configVault;Mi.exports._parseVault=bt._parseVault;Mi.exports.config=bt.config;Mi.exports.decrypt=bt.decrypt;Mi.
${this.file}
`})}dispose(){this.stream&&(this.stream.end(),this.stream=void 0)}write(e){this.stream&&(this.stream.write(JSON.stringify(e,oN)+`
`),"flush"in this.stream&&typeof this.stream.flush=="function"&&this.stream.flush(Ip.constants.Z_SYNC_FLUSH))}};var sN={runtime:null,"runtime.sourcecreate":null,"runtime.assertion":null,"runtime.launch":null,"runtime.target":null,"runtime.welcome":null,"runtime.exception":null,"runtime.sourcemap":null,"runtime.breakpoints":null,"sourcemap.parsing":null,"perf.function":null,"cdp.send":null,"cdp.receive":null,"dap.send":null,"dap.receive":null,internal:null,proxyActivity:null},MJ=Object.keys(sN),U=Symbol("ILogger");function aN(r,e=(0,J_.tmpdir)()){if(r===!1)return{stdio:!1,logFile:null};let t={stdio:!0,logFile:Y_.join(e,`vscode-debugadapter-${(0,z_.randomBytes)(4).toString("hex")}.json.gz`)};return r===!0?t:{...t,...r}}function Q_(r,e){let t=aN(e),n={sinks:[]};return t.logFile&&n.sinks.push(new vp(t.logFile,r)),n}var Ve=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return this}get base1(){return new ke(this.lineNumber+1,this.columnNumber+1)}get base01(){return new zr(this.lineNumber,this.columnNumber+1)}compare(e){let t=e.base0;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber}},ke=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return new Ve(this.lineNumber-1,this.columnNumber-1)}get base1(){return this}get base01(){return new zr(this.lineNumber-1,this.columnNumber)}compare(e){let t=e.base1;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber||0}},zr=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return new Ve(this.lineNumber-1,this.columnNumber)}get base1(){return new ke(this.lineNumber,this.columnNumber+1)}get base01(){return this}compare(e){let t=e.base01;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber}},nr=class r{constructor(e,t){this.begin=e;this.end=t}static{this.ZERO=new r(new Ve(0,0),new Ve(0,0))}static{this.INFINITE=new r(new Ve(0,0),new Ve(1/0,1/0))}static simplify(e){if(e.length===0)return[];let t=e.slice().sort((o,s)=>o.begin.compare(s.begin)),n=[],i=t[0];for(let o=1;o<t.length;o++){let s=t[o];i.end.compare(s.begin)>=0?i=new r(i.begin,s.end):(n.push(i),i=s)}return n.push(i),n}contains(e){return e.compare(this.begin)>=0&&e.compare(this.end)<=0}toString(){let e=this.begin.base0,t=this.end.base0;return`Range[${e.lineNumber}:${e.columnNumber} -> ${t.lineNumber}:${t.columnNumber}]`}};var ue=r=>isFinite(r)?new Promise(e=>setTimeout(e,r)):new Promise(()=>{}),Z_=(r,e)=>{let t=setTimeout(r,e);return{dispose:()=>clearTimeout(t)}};function Qs(r){return new Promise((e,t)=>{let n=r.length;for(let i of r)i.then(o=>{o?(e(o),n=-1):--n===0&&e(void 0)}).catch(t)})}async function eA(r,e){for(let t=0;t<r.length;t++)if(await e(r[t]))return t;return-1}function ge(){let r=null,e=null,t=!1,n,i=new Promise((o,s)=>{r=a=>{t=!0,n=a,o(a)},e=a=>{t=!0,s(a)}});return{resolve:r,reject:e,promise:i,get settledValue(){return n},hasSettled:()=>t}}var Pa=_(q());var G0=_(je()),K0=H("path"),X0=H("url");var DE=H("fs");var pi=_(H("fs")),xw=_(H("util"));async function oa({access:r},e){if(!e)return!1;try{return await r(e),!0}catch{return!1}}async function Ni({stat:r},e){if(e)try{return await r(e)}catch{return}}function Pw(r){return new Promise(e=>{pi.readFile(r,"utf8",async(t,n)=>{e(t?"":n)})})}var OY=xw.promisify(pi.writeFile);var Jt=Symbol("FsUtils"),Qr=class{constructor(e){this.fs=e}realPath(e){return this.fs.realpath(e)}async exists(e){try{return await this.fs.access(e,pi.constants.F_OK),!0}catch{return!1}}readFile(e){return this.fs.readFile(e)}},pg=class{constructor(e){this.dap=e}async realPath(){throw new Error("not implemented")}async exists(e){try{let{doesExists:t}=await this.dap.remoteFileExistsRequest({localFilePath:e});return t}catch{return!1}}readFile(){throw new Error("not implemented")}},ed=class{constructor(e,t,n){this.remoteFilePrefix=e;this.localFsUtils=t;this.remoteFsUtils=n}static create(e,t,n){let i=new Qr(t);return e!==void 0?new this(e.toLowerCase(),i,new pg(n)):i}async exists(e){return this.selectFs(e).exists(e)}async readFile(e){return this.selectFs(e).readFile(e)}async realPath(e){return this
});`),uj=Buffer.from("(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { "),lj=Buffer.from(`
}.call(this, exports, require, module, __filename, __dirname); });`),pj=Buffer.from("#!"),dj=Buffer.from("\r")[0],fj=Buffer.from(`
`)[0],hj=(r,e)=>r.slice(0,e.length).equals(e),xE=(r,e,t)=>{let n=e.length===64?Wo.shaHash:Wo.hash;if(n(r)===e)return!0;if(t){if(hj(r,pj)){let i=r.indexOf(fj);return r[i-1]===dj&&i--,n(r.slice(i))===e}if(n(Buffer.concat([aj,r,cj]))===e)return!0}return n(Buffer.concat([uj,r,lj]))===e},PE=r=>r instanceof Buffer?r:Buffer.from(r,"utf-8");async function mj(r){switch(r.type){case 0:try{let e=await Fg.promises.readFile(r.file);return{id:r.id,hash:r.mode===0?(0,Wo.hash)(e):(0,Wo.shaHash)(e)}}catch{return{id:r.id}}case 1:try{return{id:r.id,hash:(0,Wo.hash)(PE(r.data))}}catch{return{id:r.id}}case 2:try{let e=await Fg.promises.readFile(r.file);return{id:r.id,matches:xE(e,r.expected,r.checkNode)}}catch{return{id:r.id,matches:!1}}case 3:try{return{id:r.id,matches:xE(PE(r.data),r.expected,r.checkNode)}}catch{return{id:r.id,matches:!1}}}}function Hj(r){r.on("message",e=>{mj(e).then(t=>r.postMessage(t))})}Ug.parentPort&&Hj(Ug.parentPort);var vd=class{constructor(e=3,t=(0,LE.join)(__dirname,"hash.js")){this.maxFailures=e;this.hasherScriptPath=t;this.idCounter=0;this.failureCount=0;this.deferredMap=new Map;this.deferCleanup=q_(3e4,()=>this.cleanup())}async hashBytes(e,t){return(await this.send({type:1,data:t,mode:e,id:this.idCounter++})).hash}async hashFile(e,t){return(await this.send({type:0,file:t,mode:e,id:this.idCounter++})).hash}async verifyBytes(e,t,n){return(await this.send({type:3,data:e,id:this.idCounter++,expected:t,checkNode:n})).matches}async verifyFile(e,t,n){return(await this.send({type:2,file:e,id:this.idCounter++,expected:t,checkNode:n})).matches}dispose(){this.cleanup(),this.deferCleanup.clear()}send(e){let t=this.getProcess();if(!t)throw new Error("hash.js process unexpectedly exited");this.deferCleanup();let n=ge();return this.deferredMap.set(e.id,{deferred:n,request:e}),t.postMessage(e),n.promise}cleanup(){this.instance&&(this.instance.removeAllListeners("exit"),this.instance.terminate(),this.instance=void 0,this.failureCount=0)}getProcess(){if(this.instance)return this.instance;if(this.failureCount>this.maxFailures)return;let e=this.instance=new $E.Worker(this.hasherScriptPath);return e.setMaxListeners(1/0),e.on("message",t=>{let n=t,i=this.deferredMap.get(n.id);i&&(i.deferred.resolve(n),this.deferredMap.delete(n.id))}),e.on("exit",()=>{this.instance=void 0,this.failureCount++;let t=this.getProcess();if(t){this.deferCleanup();for(let{request:n}of this.deferredMap.values())t.postMessage(n)}else{for(let{deferred:n}of this.deferredMap.values())n.reject(new Error("hash.js process unexpectedly exited"));this.deferredMap.clear(),this.deferCleanup.clear()}}),e}};var CE=new vd;async function TE(r,e,t){return!r||fE(r)?void 0:e?(typeof t=="string"?await CE.verifyBytes(t,e,!0):await CE.verifyFile(r,e,!0))?r:void 0:await new Qr(DE.promises).exists(r)?r:void 0}var en="node:",di="<node_internals>";var ME,da,gj,xu=class{constructor(){this._indexes={__proto__:null},this.array=[]}};ME=(r,e)=>r._indexes[e],da=(r,e)=>{let t=ME(r,e);if(t!==void 0)return t;let{array:n,_indexes:i}=r;return i[e]=n.push(e)-1},gj=r=>{let{array:e,_indexes:t}=r;if(e.length===0)return;let n=e.pop();t[n]=void 0};var RE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",OE=new Uint8Array(64),NE=new Uint8Array(128);for(let r=0;r<RE.length;r++){let e=RE.charCodeAt(r);OE[r]=e,NE[e]=r}var Wg=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(r){return Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString()}}:{decode(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e}};function BE(r){let e=new Int32Array(5),t=[],n=0;do{let i=yj(r,n),o=[],s=!0,a=0;e[0]=0;for(let c=n;c<i;c++){let u;c=Pu(r,c,e,0);let l=e[0];l<a&&(s=!1),a=l,kE(r,c,i)?(c=Pu(r,c,e,1),c=Pu(r,c,e,2),c=Pu(r,c,e,3),kE(r,c,i)?(c=Pu(r,c,e,4),u=[l,e[1],e[2],e[3],e[4]]):u=[l,e[1],e[2],e[3]]):u=[l],o.push(u)}s||bj(o),t.push(o),n=i+1}while(n<=r.length);return t}function yj(r,e){let t=r.indexOf(";",e);return t===-1?r.length:t}function Pu(r,e,t,n){let i=0,o=0,s=0;do{let c=r.charCodeAt(e++);s=NE[c],i|=(s&31)<<o,o+=5}while(s&32);let a=i&1;return i>>>=1,a&&(i=-2147
`),o=i.length-1;if(r.write(i[0].trim()),o>0){r.write(n);for(let s=1;s<o;s++)r.write(t+i[s].trim()+n);r.write(t+i[o].trim())}}function Ft(r,e,t,n){let{length:i}=e;for(let o=0;o<i;o++){let s=e[o];r.write(t),s.type[0]==="L"?r.write("// "+s.value.trim()+`
`,s):(r.write("/*"),sV(r,s.value,t,n),r.write("*/"+n))}}function aV(r){let e=r;for(;e!=null;){let{type:t}=e;if(t[0]==="C"&&t[1]==="a")return!0;if(t[0]==="M"&&t[1]==="e"&&t[2]==="m")e=e.object;else return!1}}function ty(r,e){let{generator:t}=r,{declarations:n}=e;r.write(e.kind+" ");let{length:i}=n;if(i>0){t.VariableDeclarator(n[0],r);for(let o=1;o<i;o++)r.write(", "),t.VariableDeclarator(n[o],r)}}var h0,m0,H0,g0,y0,b0,cV={Program(r,e){let t=e.indent.repeat(e.indentLevel),{lineEnd:n,writeComments:i}=e;i&&r.comments!=null&&Ft(e,r.comments,t,n);let o=r.body,{length:s}=o;for(let a=0;a<s;a++){let c=o[a];i&&c.comments!=null&&Ft(e,c.comments,t,n),e.write(t),this[c.type](c,e),e.write(n)}i&&r.trailingComments!=null&&Ft(e,r.trailingComments,t,n)},BlockStatement:b0=function(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e,o=t+e.indent;e.write("{");let s=r.body;if(s!=null&&s.length>0){e.write(n),i&&r.comments!=null&&Ft(e,r.comments,o,n);let{length:a}=s;for(let c=0;c<a;c++){let u=s[c];i&&u.comments!=null&&Ft(e,u.comments,o,n),e.write(o),this[u.type](u,e),e.write(n)}e.write(t)}else i&&r.comments!=null&&(e.write(n),Ft(e,r.comments,o,n),e.write(t));i&&r.trailingComments!=null&&Ft(e,r.trailingComments,o,n),e.write("}"),e.indentLevel--},ClassBody:b0,StaticBlock(r,e){e.write("static "),this.BlockStatement(r,e)},EmptyStatement(r,e){e.write(";")},ExpressionStatement(r,e){let t=e.expressionsPrecedence[r.expression.type];t===nn||t===3&&r.expression.left.type[0]==="O"?(e.write("("),this[r.expression.type](r.expression,e),e.write(")")):this[r.expression.type](r.expression,e),e.write(";")},IfStatement(r,e){e.write("if ("),this[r.test.type](r.test,e),e.write(") "),this[r.consequent.type](r.consequent,e),r.alternate!=null&&(e.write(" else "),this[r.alternate.type](r.alternate,e))},LabeledStatement(r,e){this[r.label.type](r.label,e),e.write(": "),this[r.body.type](r.body,e)},BreakStatement(r,e){e.write("break"),r.label!=null&&(e.write(" "),this[r.label.type](r.label,e)),e.write(";")},ContinueStatement(r,e){e.write("continue"),r.label!=null&&(e.write(" "),this[r.label.type](r.label,e)),e.write(";")},WithStatement(r,e){e.write("with ("),this[r.object.type](r.object,e),e.write(") "),this[r.body.type](r.body,e)},SwitchStatement(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e;e.indentLevel++;let o=t+e.indent,s=o+e.indent;e.write("switch ("),this[r.discriminant.type](r.discriminant,e),e.write(") {"+n);let{cases:a}=r,{length:c}=a;for(let u=0;u<c;u++){let l=a[u];i&&l.comments!=null&&Ft(e,l.comments,o,n),l.test?(e.write(o+"case "),this[l.test.type](l.test,e),e.write(":"+n)):e.write(o+"default:"+n);let{consequent:p}=l,{length:d}=p;for(let f=0;f<d;f++){let h=p[f];i&&h.comments!=null&&Ft(e,h.comments,s,n),e.write(s),this[h.type](h,e),e.write(n)}}e.indentLevel-=2,e.write(t+"}")},ReturnStatement(r,e){e.write("return"),r.argument&&(e.write(" "),this[r.argument.type](r.argument,e)),e.write(";")},ThrowStatement(r,e){e.write("throw "),this[r.argument.type](r.argument,e),e.write(";")},TryStatement(r,e){if(e.write("try "),this[r.block.type](r.block,e),r.handler){let{handler:t}=r;t.param==null?e.write(" catch "):(e.write(" catch ("),this[t.param.type](t.param,e),e.write(") ")),this[t.body.type](t.body,e)}r.finalizer&&(e.write(" finally "),this[r.finalizer.type](r.finalizer,e))},WhileStatement(r,e){e.write("while ("),this[r.test.type](r.test,e),e.write(") "),this[r.body.type](r.body,e)},DoWhileStatement(r,e){e.write("do "),this[r.body.type](r.body,e),e.write(" while ("),this[r.test.type](r.test,e),e.write(");")},ForStatement(r,e){if(e.write("for ("),r.init!=null){let{init:t}=r;t.type[0]==="V"?ty(e,t):this[t.type](t,e)}e.write("; "),r.test&&this[r.test.type](r.test,e),e.write("; "),r.update&&this[r.update.type](r.update,e),e.write(") "),this[r.body.type](r.body,e)},ForInStatement:h0=function(r,e){e.write(`for ${r.await?"await ":""}(`);let{left:t}=r;t.type[0]==="V"?ty(e,t):this[t.type](t,e),e.write(r.type[3]==="I"?" in ":" of "),this[r.right.type](r.right,e),e.write(") "),this[r.body.type](r.body,e)},ForOfStatement:h0,Debu
`,this.indentLevel=t.startingIndentLevel!=null?t.startingIndentLevel:0,this.writeComments=t.comments?t.comments:!1,t.sourceMap!=null&&(this.write=t.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=t.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:t.sourceMap.file||t.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,t){this.output+=e,this.map(e,t)}writeToStreamAndMap(e,t){this.output.write(e),this.map(e,t)}map(e,t){if(t!=null){let{type:o}=t;if(o[0]==="L"&&o[2]==="n"){this.column=0,this.line++;return}if(t.loc!=null){let{mapping:s}=this;s.original=t.loc.start,s.name=t.name,this.sourceMap.addMapping(s)}if(o[0]==="T"&&o[8]==="E"||o[0]==="L"&&o[1]==="i"&&typeof t.value=="string"){let{length:s}=e,{column:a,line:c}=this;for(let u=0;u<s;u++)e[u]===`
`?(a=0,c++):a++;this.column=a,this.line=c;return}}let{length:n}=e,{lineEnd:i}=this;n>0&&(this.lineEndSize>0&&(i.length===1?e[n-1]===i:e.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function fi(r,e){let t=new ry(e);return t.generator[r.type](r,t),t.output}var I0=H("./vendor/acorn.js"),Cd=H("./vendor/acorn-loose.js");var Ld={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},lV=Object.keys(Ld);for(let r of lV)Object.freeze(Ld[r]);Object.freeze(Ld);var ny=Ld;var iy={ecmaVersion:"latest",locations:!0,allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReserved:!0,allowReturnOutsideFunction:!0},Fi=r=>r.start,oy=r=>r.end,_0=(r,e)=>r.slice(Fi(e),oy(e)),Tn=(r,e=!1)=>(e?I0.parse:Cd.parse)(r,iy),Tu=r=>{let e=Tn(r);for(let t of e.body)t.type==="FunctionDeclaration"&&t.id&&(0,Cd.isDummy)(t.id)&&(t.id=null);return e.body};function A0(r,e,t){return e.length>1||e[0].type!=="FunctionDeclaration"?E0(r,e,!0,t):w0(r,[{type:"ReturnStatement",argument:{type:"CallExpression",optional:!1,arguments:[{type:"ThisExpression"},...r.map(n=>({type:"Identifier",name:n}))],callee:{type:"MemberExpression",property:{type:"Identifier",name:"call"},computed:!1,optional:!1,object:{type:"FunctionExpression
//# sourceURL=${r}
`,sy=()=>`eval-${(0,P0.randomBytes)(4).toString("hex")}.cdp`;function hi(r,e){return hV(""+r,e)}function hV(r,e){let t=(0,x0.parseExpressionAt)(r,0,{ecmaVersion:"latest",locations:!0});if(t.type!=="FunctionExpression")throw new Error(`Could not find function declaration for:
${r}`);let n=t.params.map(a=>{if(a.type!=="Identifier")throw new Error("Parameter must be identifier");return a.name}),{start:i,end:o}=t.body,s=a=>`
${a.map((c,u)=>`let ${n[u]} = ${c}`).join("; ")};
${r.slice(i+1,o-1)}
`;return{expr:(...a)=>`(()=>{${s(a)}})();
${Ne(e)}`,decl:(...a)=>`function(...runtimeArgs){${s(a)};
${Ne(e)}}`}}var qo=class extends Error{constructor(t){super(t.text);this.details=t}},Ru=class{constructor(e){this.objectId=e}};function nt(r,e){let t=""+r,n=t.lastIndexOf("}");t=t.slice(0,n)+Ne(e)+t.slice(n);let i=async({cdp:o,args:s,...a})=>{let c=await o.Runtime.callFunctionOn({functionDeclaration:t,arguments:s.map(u=>u instanceof Ru?{objectId:u.objectId}:{value:u}),...a});if(!c)throw new qo({exceptionId:0,text:"No response from CDP",lineNumber:0,columnNumber:0});if(c.exceptionDetails)throw new qo(c.exceptionDetails);return c.result};return i.source=t,i}var L0=()=>"globalThis.__jsDebugIsReady = true; "+Ne();var ku=new Set(["page","iframe","worker","service_worker"]),Md=new Set(["page","iframe"]),ay=new Set(["page","iframe"]),mV=ay,Rd=class r{constructor(e,t,n,i,o,s,a,c,u){this._manager=e;this._targetInfo=t;this.launchConfig=s;this.sessionId=a;this.logger=c;this._attached=!1;this._onNameChangedEmitter=new C;this.onNameChanged=this._onNameChangedEmitter.event;this.entryBreakpoint=void 0;this._children=new Map;this.sourcePathResolver=this._manager._sourcePathResolver;this._cdp=n,n.pause(),this.parentTarget=i,this._waitingForDebugger=o,this._updateFromInfo(t),this._ondispose=u}get targetInfo(){return this._targetInfo}get targetId(){return this._targetInfo.targetId}get independentLifeycle(){return ay.has(this.type())}get supplementalConfig(){let e=this.type();return{__browserTargetType:e,__usePerformanceFromParent:e!=="page"}}targetOrigin(){return this._manager._targetOrigin}id(){return this.sessionId}cdp(){return this._cdp}name(){return this._computeName()}fileName(){return this._targetInfo.url}type(){return this._targetInfo.type}afterBind(){return this._cdp.resume(),Promise.resolve()}initialize(){return Promise.resolve()}async runIfWaitingForDebugger(){await Promise.all([this._cdp.Runtime.runIfWaitingForDebugger({}),this._cdp.Runtime.evaluate({expression:L0()})])}parent(){return this.parentTarget&&!ku.has(this.parentTarget.type())?this.parentTarget.parentTarget:this.parentTarget}children(){let e=[];for(let t of this._children.values())ku.has(t.type())?e.push(t):e.push(...t.children());return e}canStop(){return mV.has(this.type())}stop(){if(this._manager.targetList().includes(this))if(this.type()==="service_worker"){if(this._manager.serviceWorkerModel.stopWorker(this.id()),!this.parentTarget)return;this._manager.serviceWorkerModel.stopWorker(this.parentTarget.id())}else this._cdp.Target.closeTarget({targetId:this._targetInfo.targetId})}canRestart(){return ay.has(this.type())}restart(){this._cdp.Page.reload({})}waitingForDebugger(){return this._waitingForDebugger}canAttach(){return!this._attached}async attach(){return this._waitingForDebugger=!1,this._attached=!0,Promise.resolve(this._cdp)}canDetach(){return this._attached}async detach(){this._attached=!1,this._manager._detachedFromTarget(this.sessionId)}executionContextName(e){let t=e.auxData,n=e.name;if(!t)return n;let i=t.frameId,o=i?this._manager.frameModel.frameForId(i):void 0;return o&&t.isDefault&&!o.parentFrame()?"top":o&&t.isDefault?o.displayName():o?`${n}`:n}supportsCustomBreakpoints(){return Md.has(this.type())}supportsXHRBreakpoints(){return Md.has(this.type())}scriptUrlToUrl(e){return Wi(this._targetInfo.url,e)||e}_updateFromInfo(e){this._targetInfo={...e,type:this._targetInfo.type},this._onNameChangedEmitter.fire()}setComputeNameFn(e){this._customNameComputeFn=e,this._onNameChangedEmitter.fire()}_computeName(){let e=this._customNameComputeFn?.(this);if(e)return e;if(this.type()==="service_worker"){let i=this._manager.serviceWorkerModel.version(this.id());if(i)return i.label()+" [Service Worker]"}let t=this._targetInfo.title;if(!(t&&this._manager.targetList().some(i=>i instanceof r&&i!==this&&i._targetInfo.title===this._targetInfo.title)))return t;try{let i=new $0.URL(this._targetInfo.url);i.protocol==="data:"?t=" <data>":i?t+=` (${this._targetInfo.url.replace(/^[a-z]+:\/\/|\/$/gi,"")})`:t+=` (${this._targetInfo.url})`}catch{t+=` (${this._targetInfo.url})`}return t}async _detached(){await this._manager.serviceWorkerModel.detached(this._cdp),this._ondispose(thi
`);t!==-1;t=e.indexOf(`
`,t+1))this.lines.push(t+1)}getLineOffset(e){return e>=this.lines.length?this.source.length:this.lines[e]}convert(e){let t=e.base0;if(t.lineNumber>this.lines.length)return this.source.length;let n=this.lines[t.lineNumber],i=this.lines[t.lineNumber+1]??this.source.length+1;return n+Math.min(i-n-1,t.columnNumber)}};var Nd=process.platform!=="win32";function uy(){return Nd}function Bd(r){return Nd?r:r.toLowerCase()}function Fd(r,e){return Nd?r===e:r.toLowerCase()===e.toLowerCase()}function Go(){return uy()?new Map:new Mn(Bd)}var R0=process.platform==="win32"?process.env.PATHEXT?.toLowerCase().split(";"):void 0,B0=r=>{let e=Bd(sr.basename(r));if(R0){for(let t of R0)if(e.endsWith(t))return e.slice(0,-t.length)}return e},ly=async(r,e)=>{for(;;){let t=await e(r);if(t!==void 0)return t;let n=sr.dirname(r);if(n===r)return;r=n}},Ud=(r,e,t)=>ly(e,async n=>await r.exists(sr.join(n,t))?n:void 0),gV=new Set(["localhost","127.0.0.1","::1"]);var k0=r=>gV.has(r.toLowerCase()),yV=r=>{try{return new kn.URL(r).hostname.replace(/^\[|\]$/g,"")}catch{return r}};var ga=ko(async r=>{let e=yV(r);if(k0(e))return!0;try{let t=await N0.promises.lookup(e);return k0(t.address)}catch{return!1}});function Wi(r,e){try{return new kn.URL(e,r).href}catch{}}function py(r){try{return new kn.URL(r).pathname}catch{return}}function Wd(r,e){try{return new kn.URL(e),e}catch{}let t;try{t=new kn.URL(r||"")}catch{return e}let n=t.protocol+"//";return t.username&&(n+=t.username+":"+t.password+"@"),n+=t.host,n+=sr.dirname(t.pathname),n[n.length-1]!=="/"&&(n+="/"),n+=e,n}function jd(r){try{return new kn.URL(r),!0}catch{return!1}}function F0(r){return r.replace(/\/$/,"").replace(/\\$/,"")}var bV=/^https:\/\/([a-z0-9\-]+)\+\.vscode-resource\.vscode-(?:webview|cdn)\.net\/(.+)/i,O0="vscode-file://vscode-app/";function We(r){let e=bV.exec(r);if(e)r=`${e[1]}:///${e[2]}`;else if(r.startsWith("vscode-webview-resource://"))r=new kn.URL(r).pathname.replace(/%2F/gi,"/").replace(/^\/([a-z0-9\-]+)(\/{1,2})/i,(n,i,o)=>o.length===1?`${i}:///`:`${i}://`);else if(r.startsWith(O0))r=r.slice(O0.length);else if(!Er(r))return;return r=r.replace("file:///",""),r=decodeURIComponent(r),r.startsWith("/")&&process.platform==="win32"&&r[1]!=="/"&&(r="/"+r),r[0]!=="/"&&!r.match(/^[A-Za-z]:/)&&(r="/"+r),Xe(r)}function U0(r){return Er(r)&&(r=r.replace("file:///","\\\\"),r=r.replace(/\//g,"\\"),r=decodeURIComponent(r)),r}function He(r){return dy==="win32"?"file:///"+Vi(r):"file://"+Vi(r)}function ya(r){return r.startsWith("/")?"file://"+Vi(r):"file:///"+Vi(r)}function $t(r){return sr.posix.isAbsolute(r)||sr.win32.isAbsolute(r)}function At(r){return!!r&&r.startsWith("data:")}var cy=(r,e,t)=>{if(!t||r===":"){e.add(r);return}if(r==="/"){e.add(`\\${r}`);return}M0(r)?e.add(`\\${r}`):e.add(r);let n=encodeURIComponent(r);r!=="\\"&&n!==r&&e.add(n)},vV=r=>{switch(r.size){case 0:return"";case 1:return ma(r.values());default:let e=[...r];return e.some(t=>t.length>1)?`(?:${e.join("|")})`:`[${e.join("")}]`}},Nu=new Set;function Bu(r,e,t,n,i=Nd){let o="";for(let s of r.slice(e,t))i?cy(s,Nu,n):(cy(s.toLowerCase(),Nu,n),cy(s.toUpperCase(),Nu,n)),o+=vV(Nu),Nu.clear();return o}function Sr(r,[e,t]=[0,r.length]){if(t<=e)return r;let n=[],i=Bu(r,0,e,!1),o=Bu(r,t,r.length,!1),s=r.slice(e,t);for(let a of[decodeURIComponent(s),We(s)]){if(!a)continue;let c=Bu(a,0,a.length,!0);n.push(IV(`${i}${c}${o}`).concat("($|\\?)"))}return n.join("|")}var IV=r=>r.replace(/^(file:\\\/\\\/\\\/)?([a-z]):/i,(e,t="",n)=>`${t}[${n.toUpperCase()}${n.toLowerCase()}]:`);function Er(r){return r.startsWith("file:///")}var dy=process.platform;function Vi(r){return r=on(r),dy==="win32"?(kg(r)&&(r=r.slice(1)),r.split(/[\\//]/g).map((e,t)=>t>0?encodeURIComponent(e):e).join("/")):r.split("/").map(encodeURIComponent).join("/")}function on(r){return r&&dy==="win32"&&r[1]===":"?r[0].toUpperCase()+r.substring(1):r}var qi=(r,e=[])=>{let t=r.urlFilter||"file"in r&&r.file||r.url,n=t?AV(t,...e):void 0;return i=>!i.url.startsWith("devtools://")&&n?.(i.url)!==!1},ba=r=>e=>e.type==="page"&&!e.url.startsWith("edge://force-signin")&&r(e);function _V(r){return!!r&&!s
`);return a!==-1&&(s=s.substring(0,a)),s.trim()}function qd(r,e,t){let n=t.generatedPositionFor({source:r,line:e.lineNumber,column:e.columnNumber-1,bias:Dn}),i=a=>{if(a.line===null||a.column===null)return 1e11;let c=t.originalPositionFor(a);return c.line!==null?Math.abs(e.lineNumber-c.line):1e11},o=i(n),s=t.allGeneratedPositionsFor({source:r,line:e.lineNumber,column:e.columnNumber-1}).filter(a=>a.line!==null&&a.column!==null).sort((a,c)=>a.line!==c.line?a.line-c.line:a.column-c.column).map(a=>[a,i(a)]);return s.push([n,o]),s.sort(([a,c],[u,l])=>c-l||a.line-u.line||a.column-u.column),s[0][0]}var fy=(r,e)=>!!e&&((e.type==="FunctionExpression"||e.type==="FunctionDeclaration"||e.type==="ArrowFunctionExpression")&&e.params.includes(r)||(e.type==="ForInStatement"||e.type==="ForOfStatement")&&e.left===r||e.type==="VariableDeclarator"&&e.id===r||e.type==="AssignmentPattern"&&e.left===r||e.type==="CatchClause"&&e.param===r||"kind"in e&&e.kind==="init"&&e.value===r||e.type==="RestElement"&&e.argument===r||e.type==="AssignmentPattern"&&e.left===r);function Gi(r){try{new Function(r)}catch(e){return e}}function EV(r,e){let t=Tn(r),n,i;return Ui(t,{enter:o=>{let s=o;e>=s.start&&e<s.end&&(o.type==="CallExpression"||o.type==="NewExpression"?i=o:n=o)}}),i||n}var W0=/^[^()]+/g;function q0(r,e){try{let n=EV(r,e);if(n&&"callee"in n){let i=n.callee;return{text:`${r.slice(i.start,i.end)}(...)`,start:i.start,end:i.end}}else{let i=n;return{text:r.slice(i.start,i.end),start:i.start,end:i.end}}}catch{}W0.lastIndex=e-1;let t=W0.exec(r);if(t)return{text:t[0],start:e,end:e+t[0].length}}var Ko=class{constructor(e,t,n,i,o,s,a,c){this.url=t;this.inlineScriptOffset=s;this.runtimeScriptOffset=a;this.contentHash=c;this._scripts=[];this.hasBeenAnnounced=!1;this.sourceReference=e.getSourceReference(t),this._contentGetter=ne(i),this._container=e,this.absolutePath=n||"",this._fqname=this._fullyQualifiedName(),this._name=this._humanName(),this.setSourceMapUrl(o),this._existingAbsolutePath=this.checkContentHash(c)}get sendLazy(){return!this.url}checkContentHash(e){return TE(this.absolutePath,this.inlineScriptOffset||this.runtimeScriptOffset?void 0:e,this._container._fileContentOverridesForTest.get(this.absolutePath))}offsetScriptToSource(e){return this.runtimeScriptOffset?{...e,lineNumber:Math.max(1,e.lineNumber-this.runtimeScriptOffset.lineOffset),columnNumber:e.columnNumber-this.runtimeScriptOffset.columnOffset}:e}offsetSourceToScript(e){return this.runtimeScriptOffset?{...e,lineNumber:e.lineNumber+this.runtimeScriptOffset.lineOffset,columnNumber:e.columnNumber+this.runtimeScriptOffset.columnOffset}:e}async equalsDap(e){let t=await this._existingAbsolutePath;return t?!e.sourceReference&&t===e.path:e.sourceReference===this.sourceReference}setSourceMapUrl(e){if(!e){this.sourceMap=void 0;return}this.sourceMap={type:0,sourceByUrl:new Map,value:ge(),metadata:e}}addScript(e){this._scripts.push(e)}filterScripts(e){this._scripts=this._scripts.filter(e)}get scripts(){return this._scripts}get getSuggestedMimeType(){if(this.url.endsWith(".wat"))return"text/wat";if(!/\.[^/]+$/.test(this.url)||this.url.includes("?"))return"text/javascript"}async content(){let e=await this._contentGetter();return this.inlineScriptOffset?.lineOffset&&(e=`
`.repeat(this.inlineScriptOffset.lineOffset)+e),e}async prettyPrint(){if(!this._container)return;if(Xo(this)&&this.sourceMap.metadata.sourceMapUrl.endsWith("-pretty.map")){let c=this.sourceMap.value.settledValue;return c&&{map:c,source:[...this.sourceMap.sourceByUrl.values()][0]}}let e=await this.content();if(!e)return;let t=this.url||`eval://${this.sourceReference}.js`,n=t+"-pretty.map",o=t.split(/[\/\\]/).pop()+"-pretty.js",s=await j0(o,e,t,n);if(!s)return;this.setSourceMapUrl({compiledPath:this.absolutePath,sourceMapUrl:""}),this.sourceMap.value.resolve(s);let a=this;return await this._container._addSourceMapSources(a,s),{map:s,source:[...a.sourceMap.sourceByUrl.values()][0]}}async toDap(){let e=await this._existingAbsolutePath,t={name:this._name,path:this._fqname,sourceReference:this.sourceReference,presentationHint:this.blackboxed()?"deemphasize":void 0,origin:this.blackboxed()?G0.t("Skipped by skipFiles"):void 0};return e&&(t.sourceReference=0,t.path=e),this.hasBeenAnnounced||(this.hasBeenAnnounced=!0,this._container.emitLoadedSource(this)),t}existingAbsolutePath(){return this._existingAbsolutePath}async prettyName(){let e=await this._existingAbsolutePath;return e||this._fqname}_humanName(){if($t(this._fqname)){for(let e of this._container.rootPaths)if(mE(e,this._fqname))return Oe((0,K0.relative)(e,this._fqname))}return this._fqname}_fullyQualifiedName(){if(!this.url)return"<eval>/VM"+this.sourceReference;if(this.url.endsWith(".repl"))return"repl";if(this.url.startsWith(en))return di+"/"+this.url.slice(en.length);if(this.absolutePath.startsWith(di))return this.absolutePath;if($t(this.url))return this.url;let e=We(this.url);if(e)return e;let t=this.url;try{let n=[],i=new X0.URL(this.url);if(i.protocol==="data:")return"<eval>/VM"+this.sourceReference;i.hostname&&n.push(i.hostname),i.port&&n.push("\uA789"+i.port),i.pathname&&n.push(/^\/[a-z]:/.test(i.pathname)?i.pathname.slice(1):i.pathname);let o=i.searchParams?.toString();o&&n.push("?"+o),t=n.join("")}catch{}return t.endsWith("/")&&(t+="(index)"),this.inlineScriptOffset&&(t+=`\uA789${this.inlineScriptOffset.lineOffset+1}:${this.inlineScriptOffset.columnOffset+1}`),t}blackboxed(){return this._container.isSourceSkipped(this.url)}};var Uu;(n=>{async function r(i){return i.value.promise}n.waitForValue=r;function e(i,o){return i.type===0&&i.value.settledValue?Promise.resolve(i.value.settledValue):Promise.race([r(i),ue(o)])}n.waitForValueWithTimeout=e;async function t(i){return await r(i),i.sourceByUrl}n.waitForSources=t})(Uu||={});var Je=class extends Ko{constructor(){super(...arguments);this.compiledToSourceUrl=new Map}},Kd=class extends Ko{constructor(t,n,i){super(t,n.url,i,()=>Promise.resolve("Binary content not shown, see the decompiled WAT file"),void 0,void 0,void 0,void 0);this.event=n;this.sourceMap={type:1,value:ge(),sourceByUrl:new Map}}checkContentHash(){return Promise.resolve(void 0)}offsetScriptToSource(t){return t}offsetSourceToScript(t){return t}},Wt=r=>!!r&&r instanceof Ko&&!!r.sourceMap,Xo=r=>Wt(r)&&r.sourceMap.type===0,zo=r=>Wt(r)&&r.sourceMap.type===1,hy=r=>!!r&&typeof r.getDisassembly=="function";function z0(r,e){if(!e)return r;let{lineNumber:t,columnNumber:n}=r;return e&&(t+=e.lineOffset,t<=1&&(n+=e.columnOffset)),{...r,lineNumber:t,columnNumber:n}}function J0(r,e){if(!e)return r;let{lineNumber:t,columnNumber:n}=r;return e&&(t=Math.max(1,t-e.lineOffset),t<=1&&(n=Math.max(1,n-e.columnOffset))),{...r,lineNumber:t,columnNumber:n}}var Y0=r=>({lineNumber:r.lineNumber+1,columnNumber:r.columnNumber+1}),mi=r=>({lineNumber:r.lineNumber-1,columnNumber:r.columnNumber-1});var Q0=H("os");var xV={"pwa-extensionHost":null,"node-terminal":null,"pwa-node":null,"pwa-chrome":null,"pwa-msedge":null},PV={"extension.js-debug.addCustomBreakpoints":null,"extension.js-debug.addXHRBreakpoints":null,"extension.js-debug.editXHRBreakpoints":null,"extension.pwa-node-debug.attachNodeProcess":null,"extension.js-debug.clearAutoAttachVariables":null,"extension.js-debug.setAutoAttachVariables":null,"extension.js-debug.autoAttachToProcess":null,"extension.js-debug.createDebuggerTermin
`})}function ve(r,e=9222){return{__errorMarker:!0,error:{id:e,format:r,showUser:!1}}}function ye(r,e=9223){return{__errorMarker:!0,error:{id:e,format:r,showUser:!0}}}var yy=()=>ye(we.t("Attribute 'runtimeVersion' requires Node.js version manager 'nvs', 'nvm' or 'fnm' to be installed."),9224),ux=()=>ye(we.t("Attribute 'runtimeVersion' with a flavor/architecture requires 'nvs' to be installed."),9225),lx=()=>ye(we.t("Attribute 'runtimeVersion' requires Node.js version manager 'nvm-windows' or 'nvs'."),9226),by=(r,e)=>ye(we.t("Node.js version '{0}' not installed using version manager {1}.",r,e),9226),px=r=>ye(we.t("Cannot launch debug target in terminal ({0}).",r),9227),dx=r=>ye(we.t("Can't load environment variables from file ({0}).",r),9228),fx=r=>ye(we.t("The configured `cwd` {0} does not exist.",r),9245),vy=(r,e)=>ye(we.t(`Can't find Node.js binary "{0}": {1}. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json`,r,e),9229),hx=(r,e)=>ye(we.t('The Node version in "{0}" is outdated (version {1}), we require at least Node 8.x.',e,r),9230),Iy=r=>ye(we.t('Invalid hit condition "{0}". Expected an expression like "> 42" or "== 2".',r),9231),Sa=()=>ye(we.t("An error occurred taking a profile from the target."),9235),mx=()=>ye(we.t("Please stop the running profile before starting a new one."),9236),Hx=r=>ve(r,9238),Jd=(r,e,t)=>ye(e==="*"&&!t.length?we.t('Unable to find an installation of the browser on your system. Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json.'):we.t('Unable to find {0} version {1}. Available auto-discovered versions are: {2}. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable.',r,e,JSON.stringify([...new Set(t)])),9233),_y=r=>ye(we.t('Unable to launch browser: "{0}"',r.message),9240),qu=r=>ye(r??we.t("Unable to attach to browser"),9242),Yd=()=>ye(we.t('Target page not found. You may need to update your "urlFilter" to match the page you want to debug.'),9241);var gx=()=>ve(we.t("Variables not available in async stacks"),9234),Ki=(r,e)=>ye(we.t("Syntax error setting breakpoint with condition {0} on line {1}: {2}",JSON.stringify(r.condition),r.line,e),9237),Ay=()=>ve(we.t("Thread not found"),9244),Qd=(r,e)=>ye(we.t("Could not read source map for {0}: {1}",r,e)),yx=()=>ye(we.t("UWP webview debugging is not available on your platform.")),bx=()=>ye(we.t("Networking not available.")),vx=()=>ye(we.t("Could not connect to any UWP Webview pipe. Make sure your webview is hosted in debug mode, and that the `pipeName` in your `launch.json` is correct.")),Gu=()=>ye(we.t("Could not find a location for the variable")),Ix=r=>typeof r=="object"&&!!r&&"__errorMarker"in r,_x=(r,e)=>r instanceof T&&r.cause.id===e,Ax=r=>ye(we.t("The browser process exited with code {0} before connecting to the debug server. Make sure the `runtimeExecutable` is configured correctly and that it can run without errors.",r));var wx=new WeakSet;var VV="Request",qV=r=>r.endsWith("Request"),Yt=Symbol("IDapApi"),Ea=Symbol("IRootDapApi"),Ku=class{constructor(e,t){this.transport=e;this.logger=t;this._pendingRequests=new Map;this._requestHandlers=new Map;this._eventListeners=new Map;this.disposables=[];this._initialized=ge();this.closed=!1;this._sequence=1,this.disposables.push(this.transport.messageReceived(n=>this._onMessage(n.message,n.receivedTime))),this._dap=this._createApi()}get initializedBlocker(){return this._initialized.promise}attachTelemetry(e){this.telemetryReporter=e,e.attachDap(this._dap)}dap(){return this._dap}_createApi(){return new Proxy({},{get:(e,t)=>{if(t!=="then")return t==="on"?(n,i)=>(this._requestHandlers.set(n,i),()=>this._requestHandlers.delete(n)):t==="off"?n=>this._requestHandlers.delete(n):n=>{if(qV(t))return this.enqueueRequest(t.slice(0,-VV.length),n);this._send({seq:0,type:"event",event:t,body:n})}}})}createTestApi(){let e=(i,o)=>{let s=this._eventListeners.get(i);s||(s=new Set,this._eventListeners.set(i,s)),s.add(o)},t=(i,o)=>{let s=this._
`,category:"stderr"}),this.hasWarnedAboutMaps.add(e)}return n()}}dispose(){}async parseSourceMapDirect(e,t){let n=We(t);n&&(n=this.pathResolve.rebaseRemoteToLocal(n));let i=await e.fetch(n||t);if(!i.ok)throw i.error;let o=i.body;return o.slice(0,3)===")]}"&&(o=o.substring(o.indexOf(`
`))),JSON.parse(o)}};Xu=E([(0,On.injectable)(),g(0,(0,On.inject)(Se)),g(1,(0,On.inject)(Ea)),g(2,(0,On.inject)(U))],Xu);var Xi=class extends Xu{constructor(){super(...arguments);this.knownMaps=new Mn(t=>t.toLowerCase())}load(t,n){let i=this.knownMaps.get(n.sourceMapUrl);if(!i)return this.loadNewSourceMap(t,n);let o=n.cacheKey,s=i.metadata.cacheKey;return i.reloadIfNoMtime?o&&s&&o===s?(i.reloadIfNoMtime=!1,i.prom):this.loadNewSourceMap(t,n):s&&o&&o!==s?this.loadNewSourceMap(t,n):i.prom}loadNewSourceMap(t,n){let i=super.load(t,n);return this.knownMaps.set(n.sourceMapUrl,{metadata:n,reloadIfNoMtime:!1,prom:i}),i}dispose(){this.knownMaps.clear()}invalidateCache(){for(let t of this.knownMaps.values())t.reloadIfNoMtime=!0}};Xi=E([(0,On.injectable)()],Xi);var zi=Symbol("IRenameProvider"),xa=class{constructor(e,t,n){this.logger=e;this.sourceMapFactory=t;this.launchConfig=n;this.renames=new Map}provideOnStackframe(e){if(!this.launchConfig.sourceMapRenames)return xr.None;let t=e.uiLocation();return t===void 0?xr.None:"then"in t?t.then(n=>this.provideForSource(n?.source)):this.provideForSource(t?.source)}provideForSource(e){if(!this.launchConfig.sourceMapRenames||!(e instanceof Je))return xr.None;let t=ma(e.compiledToSourceUrl.keys());if(!t)throw new Error("unreachable");if(!Xo(t))return xr.None;let n=this.renames.get(t.url);if(n)return n;let i=this.sourceMapFactory.load(t.sourceMap.metadata).then(async o=>{if(!o?.hasNames)return xr.None;let s=await t.content();return s?await this.createFromSourceMap(o,s):xr.None}).catch(()=>xr.None);return this.renames.set(t.url,i),i}async createFromSourceMap(e,t){let n=Date.now(),i;try{i=await ax(t,e)}catch(s){return this.logger.info("runtime",`Error parsing content for source tree: ${s}}`,{url:e.metadata.compiledPath}),xr.None}let o=Date.now();return this.logger.info("runtime",`renames calculated in ${o-n}ms`,{url:e.metadata.compiledPath}),new xr(i)}};xa=E([(0,Pa.injectable)(),g(0,(0,Pa.inject)(U)),g(1,(0,Pa.inject)(Nn)),g(2,(0,Pa.inject)(de))],xa);var xr=class r{constructor(e){this.renames=e}static{this.None=new r(new wa(nr.ZERO))}getOriginalName(e,t){return this.getClosestRename(t,n=>n.compiled===e)?.original}getCompiledName(e,t){return this.getClosestRename(t,n=>n.original===e)?.compiled}getClosestRename(e,t){return this.renames.findDeepest(e,n=>n.data?.find(t))}};var La=Symbol("IContainer"),Bn=Symbol("StoragePath"),Ct=Symbol("IInitializeParams"),Fn=Symbol("VSCodeApi"),Qo=Symbol("IsVSCode"),Sx=Symbol("ExtensionContext"),Ey=Symbol("ProcessEnv"),xy=Symbol("execa"),$e=Symbol("FS"),Hi="ExtensionLocation",Zo=Symbol("IBrowserFinder"),KZ=Symbol("DwarfDebugging"),Ex=Symbol("SessionSubStates"),Sy=new WeakMap,Ye=(r,e)=>{if(!(typeof e=="object"&&e&&"dispose"in e))return e;let t=e,n=Sy.get(r.container);return n?n.push(t):Sy.set(r.container,[t]),e},ef=r=>{Sy.get(r)?.forEach(e=>e.dispose())},XZ=Symbol("IExtensionContribution"),zZ=Symbol("IDebugTerminalOptionsProviders");var Dt=Symbol("ITelemetryReporter");var xx=_(q());var Ji=Symbol("IShutdownParticipants"),$a=class{constructor(){this.participants=[]}register(e,t){if(this.shutdownStage!==void 0&&this.shutdownStage>=e)return t(!0),Ys;for(;this.participants.length<=e;)this.participants.push(new Set);return this.participants[e].add(t),{dispose:()=>this.participants[e].delete(t)}}async shutdownContext(){(this.shutdownStage===void 0||this.shutdownStage<0)&&await Promise.all([...this.participants[0]].map(e=>e(!1)))}async shutdownAll(){for(this.shutdownStage=0;this.shutdownStage<this.participants.length;this.shutdownStage++)await Promise.all([...this.participants[this.shutdownStage]].map(e=>e(!0)))}};$a=E([(0,xx.injectable)()],$a);var Xn=_(q());var tf=class{constructor(e=!1,t=!1){this.verified=e;this.hit=t}},rf=class{constructor(){this._statisticsById=new Map}registerBreakpoints(e){e.forEach(t=>{t.id!==void 0&&!this._statisticsById.has(t.id)&&this._statisticsById.set(t.id,new tf(t.verified,!1))})}registerResolvedBreakpoint(e){this.getStatistics(e).verified=!0}registerBreakpointHit(e){this.getStatistics(e).hit=!0}getStatistics(e){let t=this._statisticsById.get(e)
//# sourceURL=logpoint-${c}.cdp`}};Yi=E([(0,uf.injectable)(),g(0,(0,uf.inject)(Pr))],Yi);var ZV=new os({line:0},void 0),vte=new os({line:0},"false"),lf=Symbol("IBreakpointConditionFactory"),Na=class{constructor(e,t,n){this.logPointCompiler=e;this.evaluator=t;this.breakOnError=n.__breakOnConditionalError}getConditionFor(e){return e.condition?af.parse(e,e.condition,this.breakOnError,this.evaluator):e.logMessage?this.logPointCompiler.compile(e,e.logMessage):e.hitCondition?Oa.parse(e.hitCondition):ZV}};Na=E([(0,Ba.injectable)(),g(0,(0,Ba.inject)(Yi)),g(1,(0,Ba.inject)(Pr)),g(2,(0,Ba.inject)(de))],Na);var ff=H("path");var pf=(r,e)=>r.lineNumber===e.lineNumber&&r.columnNumber===e.columnNumber;var df=r=>!("location"in r),Mx=r=>"location"in r,eq=(r,e)=>r.url&&e===r.url||r.urlRegex&&new RegExp(r.urlRegex).test(e),Fa=class{constructor(e,t,n){this._manager=e;this._source=t;this._originalPosition=n;this.isEnabled=!1;this.setInCdpScriptIds=new Set;this.cdpScriptIds=this.setInCdpScriptIds;this.cdpBreakpoints=[];this._cdpIds=new Set}get enabled(){return this.isEnabled}get cdpIds(){return this._cdpIds}get source(){return this._source}get originalPosition(){return this._originalPosition}async updateSourceLocation(e,t,n){this._source=t,this._originalPosition=n;let i=[];for(let o of this.cdpBreakpoints)o.state===1&&i.push(this.updateUiLocations(e,o.cdpId,o.locations));await Promise.all(i)}async refreshUiLocations(e){await Promise.all(this.cdpBreakpoints.filter(t=>t.state===1).map(t=>this.updateUiLocations(e,t.cdpId,t.locations)))}async enable(e){if(this.isEnabled)return;this.isEnabled=!0;let t=[this._setPredicted(e)],n=this._manager._sourceContainer.source(this.source);if((!n||!(n instanceof Je))&&t.push(this._setByPath(e,n?.offsetSourceToScript(this.originalPosition)||this.originalPosition)),await Promise.all(t),n&&this.isEnabled){let i=await this._manager._sourceContainer.currentSiblingUiLocations({lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber,source:n});await Promise.all(i.map(o=>this._setByUiLocation(e,n.offsetSourceToScript(o))))}}async updateUiLocations(e,t,n){this.updateExistingCdpRef(t,a=>({...a,locations:n}));let i=(await Promise.all(n.map(a=>e.rawLocationToUiLocation(e.rawLocation(a))))).find(a=>!!a);if(!i)return;let o=this._manager._sourceContainer.source(this.source);if(!o)return;let s=await this._manager._sourceContainer.currentSiblingUiLocations(i);this.updateExistingCdpRef(t,a=>{let c=s.filter(u=>u.source===o);return{...a,locations:n,uiLocations:c.length?c:s}})}compare(e){let t=this.originalPosition,n=e.originalPosition;return t.lineNumber!==n.lineNumber?t.lineNumber-n.lineNumber:t.columnNumber-n.columnNumber}async disable(){if(!this.isEnabled)return;this.isEnabled=!1;let e=this.cdpBreakpoints.map(t=>this.removeCdpBreakpoint(t));await Promise.all(e)}async updateForNewLocations(e,t){let n=this._manager._sourceContainer.source(this.source);if(!n)return[];let i=await this._manager._sourceContainer.currentSiblingUiLocations({lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber,source:n},await t.source);if(!i.length)return[];let o=[];for(let s of i)o.push(this._setForSpecific(e,t,n.offsetSourceToScript(s)));for(let s of this.cdpBreakpoints){if(!df(s.args)||!eq(s.args,t.url))continue;let a=s.args;i.some(c=>c.columnNumber-1===a.columnNumber&&c.lineNumber-1===a.lineNumber)||(this._manager.logger.verbose("runtime.sourcemap","Adjusted breakpoint due to overlaid sourcemap",{url:n.url}),o.push(this.removeCdpBreakpoint(s)))}return await Promise.all(o),i}executionContextWasCleared(){this.updateCdpRefs(e=>e.filter(t=>df(t.args)))}hasResolvedAt(e,t){let{lineNumber:n,columnNumber:i}=t.base0;return this.cdpBreakpoints.some(o=>o.state===1&&o.locations.some(s=>s.scriptId===e&&s.lineNumber===n&&(s.columnNumber===void 0||s.columnNumber===i)))}getBreakCondition(){}updateExistingCdpRef(e,t){this.updateCdpRefs(n=>n.map(i=>i.state!==1||i.cdpId!==e?i:t(i)))}updateCdpRefs(e){let t=this;t.cdpBreakpoints=e(this.cdpBreakpoints);let n=new Set;this.setInCdpScriptIds.clear(
`)}originalPositionFor(e){return this.disassembledPositionFor(e)}async disassembledPositionFor(e){let{byteOffsetsOfLines:t}=await this.doDisassemble(),n=C0(t,e.base0.columnNumber,(i,o)=>i-o);if(n!==t.length)return{url:this.decompiledUrl,position:new Ve(n,0)}}async compiledPositionFor(e,t){if(e!==this.decompiledUrl)return[];let{byteOffsetsOfLines:n}=await this.doDisassemble(),{lineNumber:i}=t.base0;if(i>=n.length)return[];let o=n[t.base0.lineNumber];return[new Ve(0,o)]}dispose(){}async*getDisassembledStream(){let{scriptId:e}=this.event,t=await this.cdp.Debugger.disassembleWasmModule({scriptId:e});if(t)for(yield t.chunk;t.streamId;){let n=await this.cdp.Debugger.nextWasmDisassemblyChunk({streamId:t.streamId});if(!n)return;yield n.chunk}}},Jy=class extends Ef{constructor(t,n,i,o,s){super(t,n,s);this.moduleId=i;this.worker=o;this.mappedLines=new Map}get codeOffset(){return this.event.codeOffset||0}async originalPositionFor(t){let n=await this.worker.rpc.sendMessage("rawLocationToSourceLocation",{codeOffset:t.base0.columnNumber-this.codeOffset,inlineFrameIndex:t.base0.lineNumber,rawModuleId:this.moduleId});return n.length?{position:new Ve(n[0].lineNumber,n[0].columnNumber),url:n[0].sourceFileURL}:super.originalPositionFor(t)}async compiledPositionFor(t,n){if(t===this.decompiledUrl)return super.compiledPositionFor(t,n);let{lineNumber:i,columnNumber:o}=n.base0,s=await this.worker.rpc.sendMessage("sourceLocationToRawLocation",{lineNumber:i,columnNumber:o===0?-1:o,rawModuleId:this.moduleId,sourceFileURL:t});if(o===0&&s.length===0){let a=await this.getMappedLines(t),c=a.find(u=>u>i);if(!a.includes(i)&&c)return this.compiledPositionFor(t,new Ve(c,0))}return s.filter(a=>a.rawModuleId===this.moduleId).map(a=>new Ve(0,this.codeOffset+a.startOffset))}dispose(){return this.worker.rpc.sendMessage("removeRawModule",this.moduleId)}async getVariablesInScope(t,n){let i={codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId};return(await this.worker.rpc.sendMessage("listVariablesInScope",i)).map(s=>({name:s.name,scope:s.scope,type:s.type,evaluate:async()=>{let a=await this.worker.rpc.sendMessage("evaluate",s.name,i,this.worker.getStopId(t));return a?new Yy(a,this.worker.rpc):v8}}))}async getFunctionStack(t){let n=await this.worker.rpc.sendMessage("getFunctionInfo",{codeOffset:t.base0.columnNumber-this.codeOffset,inlineFrameIndex:t.base0.lineNumber,rawModuleId:this.moduleId});return"frames"in n?n.frames:[]}async getStepSkipList(t,n,i,o){if(i===this.decompiledUrl)return[];let s={codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId},a=()=>o&&i?this.worker.rpc.sendMessage("sourceLocationToRawLocation",{lineNumber:o.base0.lineNumber,columnNumber:-1,rawModuleId:this.moduleId,sourceFileURL:i}):[],c;switch(t){case 2:{c=await this.worker.rpc.sendMessage("getInlinedFunctionRanges",s);break}case 1:{let u=await Promise.all([this.worker.rpc.sendMessage("getInlinedCalleesRanges",s),a()]);c=Oo(u);break}case 0:c=await a();break;default:c=[];break}return c.map(u=>new nr(new Ve(0,u.startOffset+this.codeOffset),new Ve(0,u.endOffset+this.codeOffset)))}async evaluate(t,n,i){try{return await this.worker.rpc.sendMessage("evaluate",i,{codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId},this.worker.getStopId(t))??void 0}catch(o){throw new T(ve(o.message))}}getMappedLines(t){let n=this.mappedLines.get(t);if(n)return n;let i=(async()=>{try{let o=await this.worker.rpc.sendMessage("getMappedLines",this.moduleId,t);return new Uint32Array(o?.sort((s,a)=>s-a)||[])}catch{return new Uint32Array}})();return this.mappedLines.set(t,i),i}},v8={type:"null",description:"no properties"},Yy=class r{constructor(e,t){if(this.type=e.type,this.description=e.description,this.linearMemoryAddress=e.linearMemoryAddress,this.linearMemorySize=e.linearMemoryAddress,e.objectId&&e.hasChildren){let n=e.objectId;this.getChildren=ne(()=>this._getChildren(t,n))}}async _getChildren(e,t){return(await e.sendMessage("getProperties",t)
`,category:"stderr"}),t.resolve(void 0)}if(this._sourceByReference.get(e.sourceReference)!==e)return t.resolve(void 0);this.logger.verbose("sourcemap.parsing","Creating sources from source map",{sourceMapId:n.id,metadata:n.metadata});try{await this._addSourceMapSources(e,n)}finally{t.resolve(n)}this.scriptSkipper.initializeSkippingValueForSource(e)}removeSource(e,t=!1){let n=this._sourceByReference.get(e.sourceReference);if(n!==void 0){if(this.logger.assert(e===n,"Expected source to be the same as the existing reference"),this._sourceByReference.delete(e.sourceReference),this._sourceByOriginalUrl.get(e.url)===e&&this._sourceByOriginalUrl.delete(e.url),e instanceof Je){this._sourceMapSourcesByUrl.delete(e.url);for(let[i,o]of e.compiledToSourceUrl)i.sourceMap.sourceByUrl.delete(o)}this._sourceByAbsolutePath.delete(e.absolutePath),Wt(e)&&(this._permanentlyDisabledSourceMaps.delete(e),this._temporarilyDisabledSourceMaps.delete(e)),!t&&e.hasBeenAnnounced&&e.toDap().then(i=>this._dap.loadedSource({reason:"removed",source:i})),zo(e)&&e.sourceMap.value.promise.then(i=>i?.dispose()),Wt(e)&&this._removeSourceMapSources(e,t)}}emitLoadedSource(e){return e.hasBeenAnnounced=!0,e.toDap().then(t=>this._dap.loadedSource({reason:"new",source:t}))}async _addSourceMapSources(e,t){let n=[];for(let i of t.sources){if(i===null)continue;let o=await this.sourcePathResolver.urlToAbsolutePath({url:i,map:t}),s=o?He(o):t.computedSourceUrl(i),a=this._sourceMapSourcesByUrl.get(s);if(e===a)continue;if(a)if(_8(e.url))this.removeSource(a);else{a.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,a);continue}this.logger.verbose("runtime.sourcecreate","Creating source from source map",{inputUrl:i,sourceMapId:t.id,absolutePath:o,resolvedUrl:s});let c=o&&He(o),u=this.sourceMapFactory.guardSourceMapFn(t,()=>t.sourceContentFor(i),()=>null),l;if(u){let d=Ia(u);if(d&&(!At(d)&&o?l=Wi(o?He(o):i,d):l=d),o&&l){let f={sourceMapUrl:l,compiledPath:o};this.sourcePathResolver.shouldResolveSourceMap(f)||(l=void 0)}}let p=new Je(this,s,o,u!==null?()=>Promise.resolve(u):c?()=>this.resourceProvider.fetch(c).then(d=>d.body):()=>e.content(),l?{compiledPath:o||s,sourceMapUrl:l,cacheKey:t.metadata.cacheKey}:void 0,void 0,e.runtimeScriptOffset);p.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,p),n.push(this._addSource(p))}await Promise.all(n)}_removeSourceMapSources(e,t){for(let n of e.sourceMap.sourceByUrl.keys()){let i=e.sourceMap.sourceByUrl.get(n);i&&(e.sourceMap.sourceByUrl.delete(n),i.compiledToSourceUrl.delete(e),!i.compiledToSourceUrl.size&&this.removeSource(i,t))}}async waitForSourceMapSources(e){return Wt(e)?[...(await Uu.waitForSources(e.sourceMap)).values()]:[]}async revealUiLocation(e){this._dap.revealLocationRequested({source:await e.source.toDap(),line:e.lineNumber,column:e.columnNumber})}disableSourceMapForSource(e,t=!1){t?this._permanentlyDisabledSourceMaps.add(e):this._temporarilyDisabledSourceMaps.add(e)}clearDisabledSourceMaps(e){e?this._temporarilyDisabledSourceMaps.delete(e):this._temporarilyDisabledSourceMaps.clear()}};mt=E([(0,Cr.injectable)(),g(0,(0,Cr.inject)(Yt)),g(1,(0,Cr.inject)(Nn)),g(2,(0,Cr.inject)(U)),g(3,(0,Cr.inject)(de)),g(4,(0,Cr.inject)(Ct)),g(5,(0,Cr.inject)(Se)),g(6,(0,Cr.inject)(Qi)),g(7,(0,Cr.inject)(Jo)),g(8,(0,Cr.inject)(xf))],mt);var nL=r=>r.originalPosition.columnNumber===1&&r.originalPosition.lineNumber===1,iL=500,oL=Symbol("DontCompare");var Dr=class{constructor(e,t,n,i,o,s,a){this.logger=n;this.launchConfig=i;this.conditionFactory=o;this.suggester=s;this._breakpointsPredictor=a;this._resolvedBreakpoints=new Map;this._totalBreakpointsCount=0;this._launchBlocker=new Set;this._predictorDisabledForTest=!1;this._breakpointsStatisticsCalculator=new rf;this.entryBreakpointMode=0;this._enabledFilter=()=>!0;this._byDapId=new Map;this._byPath=Go();this._byRef=new Map;this.moduleEntryBreakpoints=Go();this._dap=e,this._sourceContainer=t,a?.onLongParse(()=>e.longPrediction({})),t.onScript(c=>{c.source.then(u=>{let l=this._thread;l&&this._byRef.get(u.sourceReference)?.forEach(p=>p.updateForNewLocations(l,c))})}),t.onSourceMa
`)){let t=I$.exec(e)||_$.exec(e);if(!t){yield e+`
`;continue}let[,n,i,o,s,a]=t;n&&(yield n),yield new wb(i,new ke(Number(o),Number(s))),a&&(yield a),yield`
`}}},wb=class{constructor(e,t){this.path=e;this.position=t}toString(){return`${this.path}:${this.position.lineNumber}:${this.position.columnNumber}`}};var Qn=class{constructor(e,t){this._tokens=[];this._separator=t||"",this._budget=e-1-this._separator.length}append(e){if(e.length>this.budget()){this.appendEllipsis();return}this._append(e)}_append(e){this._tokens.length&&(this._budget-=this._separator.length),this._tokens.push(e),this._budget-=e.length}appendEllipsis(){this._tokens[this._tokens.length-1]!=="\u2026"&&this._append("\u2026")}checkBudget(){return this._budget<=0&&this.appendEllipsis(),this._budget>0}budget(){return this._budget-(this._tokens.length?this._separator.length:0)}build(){return this._tokens.join(this._separator)}isEmpty(){return!this._tokens.length}};var G$=_(V$());var i4=1e4;function o4(r,e){if(!r.includes("%"))return[{type:"string",value:r}];let t=[];function n(c){if(!c)return;let u=t[t.length-1];u?.type==="string"?u.value+=c:t.push({type:"string",value:c})}function i(c,u,l){t.push({type:"specifier",specifier:c,precision:u,substitutionIndex:l})}let o=0,s=0,a=new RegExp(`%%|%(?:(\\d+)\\$)?(?:\\.(\\d*))?([${e.join("")}])`,"g");for(let c=a.exec(r);c;c=a.exec(r)){let u=c.index;if(u>o&&n(r.substring(o,u)),c[0]==="%%")n("%");else{let[,l,p,d]=c;l&&Number(l)>0&&(s=Number(l)-1);let f=p?Number(p):void 0;i(d,f,s),++s}o=u+c[0].length}return n(r.substring(o)),t}function Lb(r,e,t){let n=o4(r,Array.from(t.keys())),i=new Set,o=t.get("");if(!o)throw new Error("Expected to hav a default formatter");let s=new Qn(i4),a=!1;for(let c=0;s.checkBudget()&&c<n.length;++c){let u=n[c];if(u.type==="string"){s.append(u.value);continue}let l=u.substitutionIndex;if(l>=e.length){s.append("%"+(u.precision||"")+u.specifier);continue}i.add(l),u.specifier==="c"&&(a=!0);let p=t.get(u.specifier)||o;s.append(p(e[l],{budget:s.budget(),quoted:!1,ansi:!0}))}a&&s.append("\x1B[0m");for(let c=0;s.checkBudget()&&c<e.length;++c)i.has(c)||(i.add(c),(r||c)&&s.append(" "),s.append(o(e[c],{budget:s.budget(),quoted:!1,ansi:!0})));return{result:s.build(),usedAllSubs:i.size===e.length}}function q$(r){try{return new G$.default(r).ansi256().object().ansi256}catch{}}function K$(r){let e=/\s*(.*?)\s*:\s*(.*?)\s*(?:;|$)/g,t="\x1B[0m",n=e.exec(r);for(;n!==null;){if(n.length===3)switch(n[1]){case"color":let i=q$(n[2]);i&&(t+=`\x1B[38;5;${i}m`);break;case"background":case"background-color":let o=q$(n[2]);o&&(t+=`\x1B[48;5;${o}m`);break;case"font-weight":n[2]==="bold"&&(t+="\x1B[1m");break;case"font-style":n[2]==="italic"&&(t+="\x1B[3m");break;case"text-decoration":n[2]==="underline"&&(t+="\x1B[4m");break;default:}n=e.exec(r)}return t}var z$=r=>r.replace(/\n/gm,"\\n").replace(/\r/gm,"\\r").replace(/\t/gm,"\\t"),a4={budget:1e5,quoted:!0},X$={budget:1e3,quoted:!0,postProcess:z$},c4={budget:1/0,quoted:!1},u4={budget:1e3,quoted:!0,postProcess:z$},l4={budget:1e5,quoted:!0},Yf=r=>{switch(r){case"repl":return a4;case"hover":return X$;case"propertyValue":return X$;case"watch":return u4;case"copy":case"clipboard":return c4;default:return l4}};var p4=30,d4=100,$b=20,f4=1e4,h4=3,J$=120,Cb=new Set(["null","regexp","date"]);function ds(r){return r.type==="function"||r.type==="object"&&!Cb.has(r.subtype)}function Db(r){return r.subtype==="array"||r.subtype==="typedarray"}function fs(r,e,t){let n=Yf(e),i=Qf(r,n,t);return r.preview?.subtype==="regexp"?i:n.postProcess?.(i)??i}function Qf(r,e,t){return r.type==="function"?r.description?rC(r.description,e.budget):"<function>":r.type==="object"&&r.subtype==="node"?r.description:"preview"in r&&r.preview?Zf(r.preview,e.budget,t):tC(r,e,t)}function Zf(r,e,t){return Db(r)?m4(r,e):r.subtype==="internal#entry"?Rn(r.description||"",e):r.type==="function"?rC(r.description,e):ds(r)?H4(r,e,t):y4(r,e,t)}function m4(r,e){let t=new Qn(e),n=r.description,i=n.match(/[^(]*\(([\d]+)\)/);if(!i)return n;let o=parseInt(i[1],10);n.startsWith("Array(")&&(n=n.substring(5)),t.append(Rn(n,t.budget())),t.append(" ");let s=new Qn(t.budget()-2,", "),a=-1;for(let c of r.properties){if(!s.checkBudget())break;if(isNaN(c.name))continue;let u=parseInt(c.name,1
`);return i===-1?{title:t}:{title:t.substring(0,i)}}return{title:t.substring(0,n.index-1),stackTrace:t.substring(n.index+2)}}function _l(r,e,t,n){if(r.type==="number"){if("unserializableValue"in r)return r.unserializableValue;let s=r.value!==void 0?r.value:+r.description;return n?.hex?s.toString(16):String(s)}if(r.type==="bigint"){let s=r.unserializableValue||r.description;return n?.hex?BigInt(s.slice(0,-1)).toString(16):s}let i=r,o=typeof i.value=="number"?i.value:+String(i.description);return Rn(String(e?Math.floor(o):o),t)}function b4(r,e){return Ha(String(typeof r.value<"u"?r.value:r.description),e)}function nC(r){let e=[],t=new Set([void 0]),n=new Map;for(let l of r.properties.filter(p=>p.valuePreview)){let p=new Map;p.set(void 0,l.name),n.set(void 0,Math.max(n.get(void 0)||0,l.name.length)),e.push(p),l.valuePreview?.properties.map(d=>{d.value&&(t.add(d.name),p.set(d.name,d.value),n.set(d.name,Math.max(n.get(d.name)||0,d.value.length)))})}for(let l of t.values())l&&n.set(l,Math.max(n.get(l)||0,l.length));let i=Array.from(n.values()).reduce((l,p)=>l+p,0),o=J$-4-(t.size-1)*3;if(i>o){let l=o/i;for(let p of n.keys()){let d=Math.max(h4,n.get(p)*l|0);n.set(p,d)}}let s=[];for(let l of t.values())s.push("-".repeat(n.get(l)));let a="[-"+s.join("-|-")+"-]",c=[];c.push(a.replace("[","\u256D").replace(/\|/g,"\u252C").replace("]","\u256E").replace(/-/g,"\u2504"));let u=[];for(let l of t.values())u.push(Q$(l||"",n.get(l)));c.push("\u250A "+u.join(" \u250A ")+" \u250A"),c.push(a.replace("[","\u251C").replace(/\|/g,"\u253C").replace("]","\u2524").replace(/-/g,"\u2504"));for(let l of e){let p=[];for(let d of t.values())p.push(Q$(l.get(d)||"",n.get(d)));c.push("\u250A "+p.join(" \u250A ")+" \u250A")}return c.push(a.replace("[","\u2570").replace(/\|/g,"\u2534").replace("]","\u256F").replace(/-/g,"\u2504")),c.map(l=>Rn(l,J$)).join(`
`)}var Tb=new Map([["",(r,e)=>Qf(r,e)],["s",(r,e)=>b4(r,e.budget)],["i",(r,e)=>_l(r,!0,e.budget,void 0)],["d",(r,e)=>_l(r,!0,e.budget,void 0)],["f",(r,e)=>_l(r,!1,e.budget,void 0)],["c",r=>K$(r.value)],["o",(r,e)=>Qf(r,e)],["O",(r,e)=>Qf(r,e)]]);function Q$(r,e){return r.length===e?r:r.length<e?r+" ".repeat(e-r.length):Rn(r,e)}var Zt=_(je());var Al=_(q());async function Mb(r){let e=await r.uiLocation();return e?e.source.blackboxed()?2:Wt(e.source)&&!e.isMapped&&e.unmappedReason===3?1:0:0}var v4=new Set(["breakpoint","exception","entry"]),I4=256,oo=class{constructor(e,t){this.launchConfig=e;this.logger=t;this._smartStepCount=0}resetSmartStepCount(){this._smartStepCount>0&&(this.logger.verbose("internal",`smartStep: skipped ${this._smartStepCount} steps`),this._smartStepCount=0)}async getSmartStepDirection(e,t){if(!this.launchConfig.smartStep||v4.has(e.reason))return;let n=(await e.stackTrace.loadFrames(1)).find(Ro(Mt));if((n&&await Mb(n))===0){this.resetSmartStepCount();return}return this._smartStepCount++>I4?2:t?.reason==="step"?t.direction:0}};oo=E([(0,Al.injectable)(),g(0,(0,Al.inject)(de)),g(1,(0,Al.inject)(U))],oo);var oC=nt(function(){return[Symbol.for("debug.description"),Symbol.for("nodejs.util.inspect.custom")]}),sC=hi(function(r,e){let t={},n="<<default preview>>";if(typeof this!="object"||!this)return t;for(let[i,o]of Object.entries(this)){if(e)try{let s=e.call(o,n);if(s!==n){t[i]=String(s);continue}}catch(s){t[i]=`<<indescribable>>${JSON.stringify([String(s),i])}`;continue}if(typeof o=="object"&&o){let s;for(let a of runtimeArgs[0])if(typeof o[a]=="function")try{s=o[a](2);break}catch{}!s&&!String(o.toString).includes("[native code]")&&(s=String(o)),s&&!s.startsWith("[object ")&&(t[i]=s.length>=r?s.slice(0,r)+"\u2026":s)}}return t}),eh=hi(function(r,e){if(e)try{let t="<<default preview>>",n=e.call(this,t);if(n!==t)return String(n)}catch(t){return`<<indescribable>>${JSON.stringify([String(t),"object"])}`}if(typeof this=="object"&&this){let t;for(let n of[Symbol.for("debug.description"),Symbol.for("nodejs.util.inspect.custom")])if(typeof this[n]=="function")try{t=this[n](2);break}catch{}if(!t&&!String(this.toString).includes("[native code]")&&(t=String(this)),t&&!t.startsWith("[object "))return t.length>=r?t.slice(0,r)+"\u2026":t}});var he=_(je()),AC=H("crypto");var Rr=class r{constructor(e=process.hrtime()){this.value=e}get ms(){return this.s*1e3}get s(){return this.value[0]+this.value[1]/1e9}elapsed(){return new r().subtract(this)}subtract(e){let t=this.value[1]-e.value[1],n=this.value[0]-e.value[0];return t<0&&(t+=1e9,n--),new r([n,t])}};var sc=class{constructor(e,t,n,i,o,s){this.launchConfig=e;this.targetInfo=t;this.parentTarget=n;this.targetOriginValue=i;this.cdp=o;this.logger=s;this.onNameChanged=new C().event;this.attached=!1;this.isWaitingForDebugger=!0;o.pause()}id(){return this.targetInfo.targetId}name(){return this.targetInfo.title}fileName(){return this.targetInfo.url}type(){return"node"}parent(){return this.parentTarget}children(){return[]}canStop(){return!1}stop(){}canRestart(){return!1}restart(){}canAttach(){return!this.attached}async attach(){return await this.cdp.Runtime.enable({}),this.launchConfig.noDebug||await this.cdp.Debugger.enable({}),this.attached=!0,this.cdp}canDetach(){return this.attached}async detach(){await this.cdp.Debugger.resume({}),await this.cdp.NodeWorker.detach({sessionId:this.targetInfo.targetId}),this.attached=!1}targetOrigin(){return this.targetOriginValue}afterBind(){return this.cdp.resume(),Promise.resolve()}async runIfWaitingForDebugger(){this.isWaitingForDebugger=!1,await this.cdp.Runtime.runIfWaitingForDebugger({})}initialize(){return Promise.resolve()}waitingForDebugger(){return this.isWaitingForDebugger}supportsCustomBreakpoints(){return!1}supportsXHRBreakpoints(){return!1}scriptUrlToUrl(e){return e[0]==="/"||process.platform==="win32"&&e[1]===":"&&e[2]==="\\"?He(e):e}executionContextName(){return this.targetInfo.title}};var Me=_(je()),th=new Map;function rh(){if(th.size)return th;function r(o,s){for(let a of s)a.group=o,th.set(a.id,a)}function e(o,s){let a=s||o;re
`;function i(s){if(s instanceof Uint8Array)return Uint8Array;if(s instanceof Uint8ClampedArray)return Uint8ClampedArray;if(s instanceof Uint16Array)return Uint16Array;if(s instanceof Uint32Array)return Uint32Array;if(s instanceof BigUint64Array)return BigUint64Array;if(s instanceof Int8Array)return Int8Array;if(s instanceof Int32Array)return Int32Array;if(s instanceof BigInt64Array)return BigInt64Array;if(s instanceof Float32Array)return Float32Array;if(s instanceof Float64Array)return Float64Array}function o(s,a=0,c=[]){switch(typeof s){case"bigint":return`${s}n`;case"boolean":return s.toString();case"function":{let p=s.toString().replace(/^[^\s]+\(/,"function(").split(/\r?\n/g),d=/^$/;for(let f of p){let h=/^[ \t]+/.exec(f);if(h){d=new RegExp(`^[ \\t]{0,${h[0].length}}`);break}}return p.map((f,h)=>h===0?f:(f=f.replace(d,""),h===p.length-1?t.repeat(a)+f:t.repeat(a+1)+f)).join(n)}case"number":return`${s}`;case"object":if(s===null)return"null";if(c.includes(s))return"[Circular]";if(s instanceof Date)return`"${s.toISOString()}"`;if(typeof Node<"u"&&r instanceof Node)return r.outerHTML;let u=i(s);if(u)return`new ${u.name}([${s.join(", ")}])`;if(s instanceof ArrayBuffer)return`new Uint8Array([${new Uint8Array(s).join(", ")}]).buffer`;if(s instanceof Array)return["[",...s.map(p=>t.repeat(a+1)+o(p,a+1,[...c,s])+","),t.repeat(a)+"]"].join(n);let l=s;return["{",...Object.keys(l).map(p=>t.repeat(a+1)+(/^[$a-z_][0-9a-z_$]*$/i.test(p)?p:JSON.stringify(p))+": "+o(l[p],a+1,[...c,s])+","),t.repeat(a)+"}"].join(n);case"string":return JSON.stringify(s);case"symbol":return s.toString();case"undefined":return"undefined";default:return String(s)}}try{return o(r)}catch{return""+r}}),cC=nt(`
function(spaces2) {
const result = ${kb.expr("this","spaces2")};
return result;
}
`);var kr=_(je());var so=_(q());var uC=nt(function(){let r={__proto__:this.__proto__},e=Object.getOwnPropertyNames(this);for(let t=0;t<e.length;++t){let n=e[t],i=n>>>0;if(String(i>>>0)===n&&i>>>0!==4294967295)continue;let o=Object.getOwnPropertyDescriptor(this,n);o&&Object.defineProperty(r,n,o)}return r});var lC=nt(function(r,e){let t={},n=r===-1?0:r,i=e===-1?this.length:r+e;for(let o=n;o<i&&o<this.length;++o){let s=Object.getOwnPropertyDescriptor(this,o);s&&Object.defineProperty(t,o,s)}return t});var pC=nt(function(r,e){let t={},n=r===-1?0:r,i=e===-1?this.childNodes.length:r+e;for(let o=n;o<i&&o<this.childNodes.length;++o){let s=this.childNodes[o];s.nodeName==="#comment"?t[o]=`<!-- ${s.textContent} -->`:s.nodeName==="#text"?t[o]=s.textContent||"":t[o]=s}return t});var dC=nt(function(r){return r.call(this)});var Ob=nt(function(r,e){let{buffer:t,byteLength:n,byteOffset:i}=this instanceof ArrayBuffer?new DataView(this):this instanceof WebAssembly.Memory?new DataView(this.buffer):this,o=i+Math.min(r,n),s=Math.max(0,Math.min(e,n-r));return a(new Uint8Array(t,o,s));function a(c){let u="0123456789abcdef",l="";for(let p=0;p<c.length;p++){let d=c[p];l+=u[d>>>4]+u[d&15]}return l}});var Nb=nt(function(r,e){let t=c(e),{buffer:n,byteLength:i,byteOffset:o}=this instanceof ArrayBuffer?new DataView(this):this instanceof WebAssembly.Memory?new DataView(this.buffer):this,s=o+Math.min(r,i),a=Math.max(0,Math.min(t.length,i-r));return new Uint8Array(n,s,a).set(t.subarray(0,a)),a;function c(u){let l=new Uint8Array(u.length>>>1);for(let p=0;p<u.length;p+=2)l[p>>>1]=parseInt(u.slice(p,p+2),16);return l}});var cc=(()=>{let r=0,e=2147483646;return()=>r++%e+1})(),Qb=r=>{if(typeof r=="string")return{value:r};let e=r;return e.objectId?{objectId:e.objectId}:e.unserializableValue?{unserializableValue:e.unserializableValue}:{value:e.value}},A4=new Set(["typedarray","dataview","arraybuffer","webassemblymemory"]);var yC=1024,w4=/^[$a-z_][0-9a-z_$]*$/i,S4=/^#[0-9a-z_$]+$/i,E4=r=>r.hasOwnProperty("configurable"),fC=(r,e,t)=>{let n=A0(r,Tu(e),t);return fi(n)},hC="<<indescribable>>",bC=r=>{if(!r.startsWith(hC))return r;let e,t;try{[e,t]=JSON.parse(r.slice(hC.length))}catch{return r}return kr.t("{0} (couldn't describe: {1})",e,t)},Bb=r=>!!r&&typeof r=="object"&&"readMemory"in r&&"writeMemory"in r,mC={PARAMETER:{name:kr.t("Parameters"),sortOrder:-10},LOCAL:{name:kr.t("Locals"),sortOrder:-9},GLOBAL:{name:kr.t("Globals"),sortOrder:-8}},wl=class r{constructor(e,t,n,i,o,s,a,c){this.cdp=e;this.parent=t;this.vars=i;this.locationProvider=o;this.currentRef=s;this.settings=a;this.clientCapabilities=c;this.name=n.name,this.presentationHint=n.presentationHint,this.sortOrder=n.sortOrder||0}get customDescriptionGenerator(){return this.settings.customDescriptionGenerator}createVariable(e,t,...n){let i=new e(new r(this.cdp,this.currentRef?.(),t,this.vars,this.locationProvider,()=>i,this.settings,this.clientCapabilities),...n);return i.id>0&&this.vars.add(i),i}createVariableByType(e,t,n){if(Db(t))return this.createVariable(sh,e,t);if(t.objectId){if(t.type==="function")return this.createVariable(qb,e,t,n);if(t.subtype==="map"||t.subtype==="set")return this.createVariable(Gb,e,t,n);if(t.subtype==="node")return this.createVariable(Vb,e,t,n);if(!Cb.has(t.subtype))return this.createVariable(ms,e,t,n)}return this.createVariable(dr,e,t)}async getDescriptionSymbols(e){return this.settings.descriptionSymbols??=oC({cdp:this.cdp,args:[],objectId:e}).then(t=>({objectId:t.objectId}),()=>({value:[]})),await this.settings.descriptionSymbols}async createObjectPropertyVars(e,t){let n=[];if(this.settings.customPropertiesGenerator){let{result:u,errorDescription:l}=await this.evaluateCodeForObject(e,this.settings.customPropertiesGenerator,[]);u&&u.type!=="undefined"?e=u:n.push([this.createVariable(Wb,{name:"",sortOrder:-1},u,u?.description||l||kr.t("Unknown error"))])}if(!e.objectId)return[];t&&this.cdp.DotnetDebugger.setEvaluationOptions({options:t,type:"variable"});let[i,o,s]=await Promise.all([this.cdp.Runtime.getProperties({objectId:e.objectId,accessorPropertiesOnly:!0,ownProperties:!1,gen
//# sourceURL=eval-${(0,AC.randomBytes)(4).toString("hex")}.repl
`,tv=class{async enqueue(e,t){if(this.queue?.operation===e&&await new Promise(n=>setTimeout(n)),!this.queue||this.queue.operation!==e){let n=this.queue?.result.then(t,t)??t(),i=this.queue={operation:e,result:n.finally(()=>{this.queue===i&&(this.queue=void 0)})}}return this.queue.result}};var uc=class r{constructor(e,t,n,i,o,s,a,c,u,l,p,d,f,h,m){this.target=i;this.logger=s;this.evaluator=a;this.completer=c;this.launchConfig=u;this._breakpointManager=l;this.console=p;this.exceptionPause=d;this._smartStepper=f;this.shutdown=h;this._executionContexts=new Map;this._excludedCallers=[];this.stateQueue=new tv;this._onPausedEmitter=new C;this.disposed=!1;this.debuggerReady=ge();this.onPaused=this._onPausedEmitter.event;this._dap=new ev(n),this._sourceContainer=e,this._cdp=t,this.id=r._lastThreadId++,this.replVariables=new ao(o,this._cdp,n,u,m,this),e.onSourceMappedSteppingChange(()=>this.refreshStackTrace()),this._initialize()}static{this._lastThreadId=0}static{this._allThreadsByDebuggerId=new Map}setExcludedCallers(e){this._excludedCallers=e}cdp(){return this._cdp}name(){return this.target.name()}pausedDetails(){return this._pausedDetails}pausedVariables(){return this._pausedVariables}defaultExecutionContext(){for(let e of this._executionContexts.values())if(e.isDefault)return e}resume(){return this.stateQueue.enqueue("resume",async()=>(this._sourceContainer.clearDisabledSourceMaps(),!await this._cdp.Debugger.resume({})&&this._pausedDetails!==void 0?ve(he.t("Unable to resume")):{allThreadsContinued:!1}))}pause(){return this.stateQueue.enqueue("pause",async()=>(this._expectedPauseReason={reason:"pause"},await this._cdp.Debugger.pause({})?{}:ve(he.t("Unable to pause"))))}stepOver(){return this.stateQueue.enqueue("stepOver",async()=>{this._expectedPauseReason={reason:"step",direction:1};let e=await this.getCurrentSkipList(1);return await this._cdp.Debugger.stepOver({skipList:e})?{}:ve(he.t("Unable to step next"))})}stepInto(e){return this.stateQueue.enqueue("stepInto",async()=>{this._waitingForStepIn={lastDetails:this._pausedDetails},this._expectedPauseReason={reason:"step",direction:0};let t=this._pausedDetails?.stepInTargets?.[e];if(t){let n=await this._cdp.Debugger.setBreakpoint({location:t.breakLocation});if(this._waitingForStepIn.intoTargetBreakpoint=n?.breakpointId,await this._cdp.Debugger.resume({}))return{}}else{let n=await this.getCurrentSkipList(0);if(await this._cdp.Debugger.stepInto({breakOnAsyncCall:!0,skipList:n}))return{}}return ve(he.t("Unable to step in"))})}stepOut(){return this.stateQueue.enqueue("stepOut",async()=>(this._expectedPauseReason={reason:"step",direction:2},await this._cdp.Debugger.stepOut({})?{}:ve(he.t("Unable to step out"))))}async getCurrentSkipList(e){if(!this._pausedDetails)return;let[t]=await this._pausedDetails.stackTrace.loadFrames(1);if(!t||!wC(t))return;let n=await t.getStepSkipList(e);if(n)return nr.simplify(n).map(i=>({start:i.begin.base0,end:i.end.base0,scriptId:t.root.scriptId}))}_stackFrameNotFoundError(){return ve(he.t("Stack frame not found"))}_evaluateOnAsyncFrameError(){return ve(he.t("Unable to evaluate on async stack frame"))}async restartFrame(e){let t=this._pausedDetails?.stackTrace.frame(e.frameId)?.root;if(!t)return this._stackFrameNotFoundError();let n=t.callFrameId();return n?await this._cdp.Debugger.restartFrame({callFrameId:n,mode:"StepInto"})?(this._expectedPauseReason={reason:"frame_entry",description:he.t("Paused on frame entry")},t.canExplicitlyBeRestarted||await this._cdp.Debugger.stepInto({}),{}):ye(he.t("Frame could not be restarted")):ye(he.t("Cannot restart asynchronous frame"))}async stackTrace(e){return this._pausedDetails?this._pausedDetails.stackTrace.toDap(e):ve(he.t("Thread is not paused"))}async scopes(e){let t=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId):void 0;return t?t.scopes():this._stackFrameNotFoundError()}async exceptionInfo(){let e=this._pausedDetails&&this._pausedDetails.exception;if(!e)return ve(he.t("Thread is not paused on exception"));let t=hs(e);return{exceptionId:t.title,breakMode:"all",details:{stackTrace:t.stackTra
`)+`
`}async toDap(e){let t=e.startFrame||0,n=(e.levels||50)+t,i=await this.loadFrames(n,e.noFuncEval);n=Math.min(i.length,e.levels?n:i.length);let o=[];for(let s=t;s<n;s++)o.push(i[s].toDap(e.format));return{stackFrames:await Promise.all(o),totalFrames:this._asyncStackTraceId?1e6:i.length}}},nv=bp(),uh=class{constructor(e="async"){this.label=e;this.frameId=nv()}async toDap(){return{name:this.label,id:0,line:0,column:0,presentationHint:"label"}}async formatAsNative(){return` --- ${this.label} ---`}async format(){return`\u25C0 ${this.label} \u25B6`}},SC="<anonymous>",C4=/^class\s+(.+) {($|\n)/;async function D4(r,e,t){if(!e.functionName)return SC;if(e.functionName.includes("."))return e.functionName;let n;if(e.this.objectId&&t&&(n=(await r.cdp().Runtime.callFunctionOn({functionDeclaration:eh.decl("64","null"),objectId:e.this.objectId,returnByValue:!0}))?.result.value),!n&&e.this.description){n=e.this.description;let s=C4.exec(n);s&&(n=s[1])}if(!n)return e.functionName;let i=n.indexOf(`
`);i!==-1&&(n=n.slice(0,i).trim());let o=e.functionName;return n===o?`${n}.constructor`:n?`${n}.${o}`:o}function T4(r){return r.functionName||SC}var Mt=class r{constructor(e,t,n,i=!1){this.callFrame=t;this.isAsync=i;this.frameId=nv();this.root=this;this.getLocationInfo=ne(async()=>{let e=this.uiLocation(),t=await Mb(this),n=this.overrideName||("this"in this.callFrame?await D4(this._thread,this.callFrame,t===0):T4(this.callFrame));return{isSmartStepped:t,name:n,uiLocation:await e}});this.completions=ne(async()=>{if(!this._scope)return[];let e=this._thread.pausedVariables();if(!e)return[];let t=[];for(let i=0;i<this._scope.chain.length;i++){let o=this._scopeVariable(i,this._scope);o&&t.push(e.getVariableNames({variablesReference:o.id}).then(s=>s.map(({name:a})=>({label:a,type:"property"}))))}let n=await Promise.all(t);return[].concat(...n)});this._rawLocation=n,this.uiLocation=ne(()=>e.rawLocationToUiLocation(n)),this._thread=e;let o=n.scriptId?e.getScriptById(n.scriptId):void 0;this.isReplEval=o?o.url.endsWith(".repl"):!1}get rawPosition(){return new ke(this._rawLocation.lineNumber,this._rawLocation.columnNumber)}get rawScopeChain(){return this._scope?.chain||[]}static fromRuntime(e,t,n){return new r(e,t,e.rawLocation(t),n)}static fromDebugger(e,t){let n=new r(e,t,e.rawLocation(t));return n._scope={chain:t.scopeChain,thisObject:t.this,returnValue:t.returnValue,variables:new Array(t.scopeChain.length).fill(void 0),callFrameId:t.callFrameId},n}get scriptId(){return"scriptId"in this.callFrame?this.callFrame.scriptId:this.callFrame.location.scriptId}get scriptSource(){return this._thread._sourceContainer.getScriptById(this.scriptId)}get canExplicitlyBeRestarted(){return!!this.callFrame.canBeRestarted}equivalentTo(e){return e instanceof r&&e._rawLocation.columnNumber===this._rawLocation.columnNumber&&e._rawLocation.lineNumber===this._rawLocation.lineNumber&&e._rawLocation.scriptId===this._rawLocation.scriptId}callFrameId(){return this._scope?this._scope.callFrameId:void 0}async scopes(){let e=this._scope;if(!e)throw new T(gx());return{scopes:(await Promise.all(e.chain.map(async(n,i)=>{let o="",s;switch(n.type){case"global":o=Zt.t("Global");break;case"local":o=Zt.t("Local"),s="locals";break;case"with":o=Zt.t("With Block"),s="locals";break;case"closure":o=Zt.t("Closure"),s="arguments";break;case"catch":o=Zt.t("Catch Block"),s="locals";break;case"block":o=Zt.t("Block"),s="locals";break;case"script":o=Zt.t("Script");break;case"eval":o=Zt.t("Eval");break;case"module":o=Zt.t("Module");break;default:o=n.type.substr(0,1).toUpperCase()+n.type.substr(1);break}n.name&&n.type==="closure"?o=Zt.t("Closure ({0})",n.name):n.name&&(o=`${o}: ${n.name}`);let a=this._scopeVariable(i,e);if(!a)return;let c={name:o,presentationHint:s,expensive:n.type==="global",variablesReference:a.id};if(n.startLocation){let u=this._thread.rawLocation(n.startLocation),l=await this._thread.rawLocationToUiLocation(u);if(c.line=(l||u).lineNumber,c.column=(l||u).columnNumber,l&&(c.source=await l.source.toDap()),n.endLocation){let p=this._thread.rawLocation(n.endLocation),d=await this._thread.rawLocationToUiLocation(p);c.endLine=(d||p).lineNumber,c.endColumn=(d||p).columnNumber}}return c}))).filter(It)}}getStepSkipList(e){return Promise.resolve(void 0)}async toDap(e){let{isSmartStepped:t,name:n,uiLocation:i}=await this.getLocationInfo(),o=i?await i.source.toDap():void 0,s=t?"deemphasize":"normal";t&&o&&(o.origin=t===1?Zt.t("Skipped by smartStep"):Zt.t("Skipped by skipFiles"));let a=(i||this._rawLocation).lineNumber,c=(i||this._rawLocation).columnNumber,u=n;return o&&e&&(e.module&&(u+=` [${o.name}]`),e.line&&(u+=` Line ${a}`)),{id:this.frameId,name:u,line:a,column:c,source:o,presentationHint:s,canRestart:this.callFrame.canBeRestarted??!this.isAsync}}async formatAsNative(){let{name:e,uiLocation:t}=await this.getLocationInfo(),n=await t?.source.existingAbsolutePath()||await t?.source.prettyName()||this.callFrame.url,{lineNumber:i,columnNumber:o}=t||this._rawLocation;return` at ${e} (${n}:${i}:${o})`}async format(){let{name:e,uiLocation:t}=await this.getLocationInfo(),n
`;return o.usedAllSubs&&!t.some(ds)?{output:s}:this.formatComplexStringOutput(e,s,t,n)}async formatComplexStringOutput(e,t,n,i){(n.some(s=>s.subtype==="error")||no.isStackLike(t))&&(await this.getUiLocation(e),t=await e.replacePathsInStackTrace(t),i=!0);let o=e.replVariables.createVariableForOutput(t,n,i?this.stackTrace(e):void 0);return{output:t,variablesReference:o.id}}},lh=class extends Hs{async toDap(e){return this.event.args[0]?.value==="console.assert"&&(this.event.args[0].value=EC.t("Assertion failed")),{category:"stderr",...await this.formatDefaultString(e,this.event.args,!0),...await this.getUiLocation(e)}}},gs=class extends Hs{constructor(t,n,i){super(t);this.includeStack=n;this.category=i}async toDap(t){return{category:this.category,...await this.formatDefaultString(t,this.event.args,this.includeStack),...await this.getUiLocation(t)}}},co=class extends gs{constructor(e){super(e,!1,"stdout")}},ph=class extends gs{constructor(e){super(e,!0,"stdout")}},dh=class extends gs{constructor(e){super(e,!0,"stderr")}},fh=class extends gs{constructor(e){super(e,!0,"stderr")}},hh=class extends Hs{async toDap(e){return{category:"stdout",group:this.event.type==="startGroupCollapsed"?"startCollapsed":"start",...await this.formatDefaultString(e,this.event.args),...await this.getUiLocation(e)}}},mh=class extends gs{constructor(e){super(e,!1,"stdout")}async toDap(e){return this.event.args[0]?.preview?{category:"stdout",output:"",variablesReference:e.replVariables.createVariableForOutput("",this.event.args,void 0,this.event.type).id,...await this.getUiLocation(e)}:super.toDap(e)}};var El=class extends Hs{constructor(){super(...arguments);this.stackTrace=ne(t=>{if(this.event.stackTrace)return Ai.fromRuntime(t,this.event.stackTrace);if(this.event.scriptId)return Ai.fromRuntime(t,{callFrames:[{functionName:"(program)",lineNumber:this.event.lineNumber,columnNumber:this.event.columnNumber,scriptId:this.event.scriptId,url:this.event.url||""}]})})}async toDap(t){let n=this.event.exception?hs(this.event.exception):{title:""},i=n.title;i.startsWith("Uncaught")||(i=`Uncaught ${this.event.exception?.className??"Error"} `+i);let o=this.stackTrace(t),s=this.event.exception&&!n.stackTrace?[this.event.exception]:[];return no.isStackLike(i)?i=await t.replacePathsInStackTrace(i):o&&(i+=`
`+await o.formatAsNative()),{category:"stderr",output:i,variablesReference:o||s.length?t.replVariables.createVariableForOutput(i,s,o).id:void 0,...await this.getUiLocation(t)}}};var Hh=_(je());var xC=nt(function(){return this});var ch=class{constructor(e,t){this.protoObj=e;this.cdp=t}async toDap(e){if(!this.protoObj.objectId)return{category:"stderr",output:Hh.t("Only objects can be queried")};let t=await this.cdp.Runtime.queryObjects({prototypeObjectId:this.protoObj.objectId,objectGroup:"console"});if(await this.cdp.Runtime.releaseObject({objectId:this.protoObj.objectId}),!t)return{category:"stderr",output:Hh.t("Could not query the provided object")};let n;try{n=await xC({cdp:this.cdp,args:[],objectId:t.objects.objectId,objectGroup:"console",generatePreview:!0})}catch(s){return{category:"stderr",output:Hh.t(s.message)}}let i="\x1B[32mobjects: "+fs(n,"repl")+"\x1B[0m";return{category:"stdout",output:"",variablesReference:e.replVariables.createVariableForOutput(i,[n]).id}}};var gh=Symbol("IConsole");var ys=_(q()),$C=H("os"),CC=H("path");var iv=H("path"),PC=(0,iv.join)(__dirname,"diagnosticTool.js"),LC=(0,iv.join)(__dirname,"diagnosticTool.css");var Zn=Symbol("ITarget"),qt=Symbol("ILauncher");var uo=class{constructor(e,t,n,i){this.fs=e;this.sources=t;this.breakpoints=n;this.target=i}async generateObject(){let[e]=await Promise.all([this.dumpSources()]);return{breakpoints:this.dumpBreakpoints(),sources:e,config:this.target.launchConfig}}async generateHtml(e=(0,CC.join)((0,$C.tmpdir)(),"js-debug-diagnostics.html")){return await this.fs.writeFile(e,`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>${await this.fs.readFile(LC,"utf-8")}<</style>
</head>
<body>
<script>window.DUMP=${JSON.stringify(await this.generateObject())}</script>
<script>${await this.fs.readFile(PC,"utf-8")}</script>
</body>
</html>`),e}dumpBreakpoints(){let e=[];for(let t of[this.breakpoints.appliedByPath,this.breakpoints.appliedByRef])for(let n of t.values())for(let i of n){let o=i.diagnosticDump();e.push({source:o.source,params:o.params,cdp:o.cdp.map(s=>s.state===1?{...s,uiLocations:s.uiLocations.map(a=>this.dumpUiLocation(a))}:{...s,done:void 0})})}return e}dumpSources(){let e=[],t=0;for(let n of this.sources.sources)e.push((async()=>({uniqueId:t++,url:n.url,sourceReference:n.sourceReference,absolutePath:n.absolutePath,actualAbsolutePath:await n.existingAbsolutePath(),scriptIds:n.scripts.map(i=>i.scriptId),prettyName:await n.prettyName(),compiledSourceRefToUrl:n instanceof Je?[...n.compiledToSourceUrl.entries()].map(([i,o])=>[i.sourceReference,o]):void 0,sourceMap:Xo(n)?{url:n.sourceMap.metadata.sourceMapUrl,metadata:n.sourceMap.metadata,sources:ci(Object.fromEntries(n.sourceMap.sourceByUrl),i=>i.sourceReference)}:void 0}))());return Promise.all(e)}dumpUiLocation(e){return{lineNumber:e.lineNumber,columnNumber:e.columnNumber,sourceReference:e.source.sourceReference}}};uo=E([(0,ys.injectable)(),g(0,(0,ys.inject)($e)),g(1,(0,ys.inject)(mt)),g(2,(0,ys.inject)(Dr)),g(3,(0,ys.inject)(Zn))],uo);var lo=_(q());var pc=Symbol("IExceptionPauseService");var lc=class{constructor(e,t,n,i,o){this.evaluator=e;this.scriptSkipper=t;this.dap=n;this.sourceContainer=o;this.state={cdp:"none"};this.blocker=ge();this.noDebug=!!i.noDebug,this.breakOnError=i.__breakOnConditionalError,this.blocker.resolve()}get launchBlocker(){return this.blocker.promise}async setBreakpoints(e){if(!this.noDebug){try{this.state=this.parseBreakpointRequest(e)}catch(t){if(!(t instanceof T))throw t;this.dap.output({category:"stderr",output:t.message});return}this.cdp?await this.sendToCdp(this.cdp):this.state.cdp!=="none"&&this.blocker.hasSettled()&&(this.blocker=ge())}}async shouldPauseAt(e){if(e.reason!=="exception"&&e.reason!=="promiseRejection"||this.state.cdp==="none"||e.callFrames.some(n=>this.sourceContainer.getSourceScriptById(n.location.scriptId)?.url.endsWith(".cdp"))||this.shouldScriptSkip(e))return!1;let t=this.state.condition;if(e.data?.uncaught){if(t.uncaught&&!await this.evalCondition(e,t.uncaught))return!1}else if(t.caught&&!await this.evalCondition(e,t.caught))return!1;return!0}async apply(e){this.cdp=e,this.state.cdp!=="none"&&await this.sendToCdp(e)}async sendToCdp(e){await e.Debugger.setPauseOnExceptions({state:this.state.cdp}),this.blocker.resolve()}async evalCondition(e,t){return!!(await t({callFrameId:e.callFrames[0].callFrameId},i=>i==="error"?e.data:void 0))?.result.value}shouldScriptSkip(e){if(e.data?.uncaught||!e.callFrames.length)return!1;let t=this.sourceContainer.getScriptById(e.callFrames[0].location.scriptId);return!!t&&this.scriptSkipper.isScriptSkipped(t.url)}parseBreakpointRequest(e){let t=(e.filterOptions??[]).concat(e.filters.map(a=>({filterId:a}))),n="none",i=[],o=[];for(let{filterId:a,condition:c}of t)a==="all"?(n="all",c&&i.push(a)):a==="uncaught"&&(n==="none"&&(n="uncaught"),c&&o.push(a));let s=a=>{if(a.length===0)return;let c="!!("+t.map(p=>p.condition).filter(It).join(") || !!(")+")",u=Gi(c);if(u)throw new T(Ki({line:0,condition:c},u.message));let l=Ly(c,this.breakOnError);return this.evaluator.prepare(l,{hoist:["error"]}).invoke};return n==="none"?{cdp:n}:{cdp:n,condition:{caught:s(i),uncaught:s(o)}}}};lc=E([(0,lo.injectable)(),g(0,(0,lo.inject)(Pr)),g(1,(0,lo.inject)(Qi)),g(2,(0,lo.inject)(Yt)),g(3,(0,lo.inject)(de)),g(4,(0,lo.inject)(mt))],lc);var vh=_(q());var yh=class{constructor(){this.didEnable=new WeakSet}async retrieve(e){this.didEnable.has(e)||(this.didEnable.add(e),await e.Performance.enable({}));let t=await e.Performance.getMetrics({});if(!t)return{error:"Error in CDP"};let n={};for(let i of t.metrics)n[i.name]=i.value;return{metrics:n}}};var bh=class{async retrieve(e){let t=await e.Runtime.evaluate({expression:`({
memory: process.memoryUsage(),
cpu: process.cpuUsage(),
timestamp: Date.now(),
resourceUsage: process.resourceUsage && process.resourceUsage(),
})${Ne()}`,returnByValue:!0});return t?t.exceptionDetails?{error:t.exceptionDetails.text}:{metrics:t.result.value}:{error:"No response from CDP"}}};var Ih=Symbol("IPerformanceProvider"),bs=class{constructor(e){this.target=e}create(){return this.target.type()==="node"?new bh:new yh}};bs=E([(0,vh.injectable)(),g(0,(0,vh.inject)(Zn))],bs);var lv=_(je()),RC=H("crypto"),po=_(q()),kC=H("os"),OC=H("path");var wh=_(q());var ov=_(je()),vs=_(q()),_h=H("path");var dc=class{constructor(e){this.sources=e;this.locationIdCounter=0;this.locationsByRef=new Map}getLocationIdFor(e){let t=[e.functionName,e.url,e.scriptId,e.lineNumber,e.columnNumber].join(":"),n=this.locationsByRef.get(t);if(n)return n.id;let i=this.locationIdCounter++;return this.locationsByRef.set(t,{id:i,callFrame:e,locations:(async()=>{let o=await this.sources.getScriptById(e.scriptId)?.source;if(!o)return[];let s=await this.sources.currentSiblingUiLocations({lineNumber:e.lineNumber+1,columnNumber:e.columnNumber+1,source:o});return Promise.all(s.map(async a=>({...a,source:await a.source.toDap()})))})()}),i}getLocations(){return Promise.all([...this.locationsByRef.values()].sort((e,t)=>e.id-t.id).map(async e=>({callFrame:e.callFrame,locations:await e.locations})))}};var gt=class{constructor(e,t,n,i){this.cdp=e;this.fs=t;this.sources=n;this.launchConfig=i}static canApplyTo(){return!0}async start(e,t){if(!await this.cdp.Profiler.start({}))throw new T(Sa());return new sv(this.cdp,this.fs,this.sources,this.launchConfig.__workspaceFolder,t)}async save(e,t){let n=await DC(e,this.sources,this.launchConfig.__workspaceFolder);(0,_h.isAbsolute)(t)||(t=(0,_h.join)(this.launchConfig.__workspaceFolder,t)),await this.fs.writeFile(t,JSON.stringify(n))}};gt.type="cpu",gt.extension=".cpuprofile",gt.label=ov.t("CPU Profile"),gt.description=ov.t("Generates a .cpuprofile file you can open in VS Code or the Edge/Chrome devtools"),gt.editable=!0,gt=E([(0,vs.injectable)(),g(0,(0,vs.inject)(Be)),g(1,(0,vs.inject)($e)),g(2,(0,vs.inject)(mt)),g(3,(0,vs.inject)(de))],gt);var sv=class{constructor(e,t,n,i,o){this.cdp=e;this.fs=t;this.sources=n;this.workspaceFolder=i;this.file=o;this.stopEmitter=new C;this.disposed=!1;this.onUpdate=new C().event;this.onStop=this.stopEmitter.event}async dispose(){this.disposed||(this.disposed=!0,this.stopEmitter.fire())}async stop(){let e=await this.cdp.Profiler.stop({});if(!e)throw new T(Sa());await this.dispose();let t=await DC(e.profile,this.sources,this.workspaceFolder);await this.fs.writeFile(this.file,JSON.stringify(t))}};async function DC(r,e,t){let n=new dc(e),i=r.nodes.map(o=>({...o,locationId:n.getLocationIdFor(o.callFrame),positionTicks:o.positionTicks?.map(s=>({...s,startLocationId:n.getLocationIdFor({...o.callFrame,lineNumber:s.line-1,columnNumber:0}),endLocationId:n.getLocationIdFor({...o.callFrame,lineNumber:s.line,columnNumber:0})}))}));return{...r,nodes:i,$vscode:{rootPath:t,locations:await n.getLocations()}}}var av=_(je()),Is=_(q());var fr=class{constructor(e,t,n,i){this.cdp=e;this.fs=t;this.sources=n;this.launchConfig=i}static canApplyTo(){return!0}async start(e,t){if(await this.cdp.HeapProfiler.enable({}),!await this.cdp.HeapProfiler.startSampling({}))throw new T(Sa());return new cv(this.cdp,this.fs,this.sources,this.launchConfig.__workspaceFolder,t)}};fr.type="heap",fr.extension=".heapprofile",fr.label=av.t("Heap Profile"),fr.description=av.t("Generates a .heapprofile file you can open in VS Code or the Edge/Chrome devtools"),fr.editable=!0,fr=E([(0,Is.injectable)(),g(0,(0,Is.inject)(Be)),g(1,(0,Is.inject)($e)),g(2,(0,Is.inject)(mt)),g(3,(0,Is.inject)(de))],fr);var cv=class{constructor(e,t,n,i,o){this.cdp=e;this.fs=t;this.sources=n;this.workspaceFolder=i;this.file=o;this.stopEmitter=new C;this.disposed=!1;this.onUpdate=new C().event;this.onStop=this.stopEmitter.event}async dispose(){this.disposed||(this.disposed=!0,await this.cdp.HeapProfiler.disable({}),this.stopEmitter.fire())}async stop(){let e=await this.cdp.HeapProfiler.stopSampling({});if(!e)throw new T(Sa());await this.dispose();let t=await this.annotateSources(e.profile);await this.f
`,category:"console"})}),this.cdp.Profiler.on("consoleProfileFinished",async n=>{let i=this.saveConsoleProfile(e,n),o=this.shutdown.register(0,()=>i);await i,o.dispose()}),t.onPaused(()=>this.stopProfiling(e))}async start(e,t,n){if(this.profile)throw new T(mx());this.profile=this.startProfileInner(e,t,n).catch(i=>{throw this.profile=void 0,i}),await this.profile}async saveConsoleProfile(e,t){let n;if(t.title){n=t.title.replace(/[\/\\]/g,"-");let i=this.seenConsoleProfileNames[t.title]||0;this.seenConsoleProfileNames[t.title]=i+1,i>0&&(n+=`-${i}`)}else n=MC();n+=gt.extension,await this.basicCpuProfiler.save(t.profile,n),e.output({output:lv.t('CPU profile saved as "{0}" in your workspace folder',n)+`
`,category:"console"})}async startProfileInner(e,t,n){let i=!1,o;if(n.stopAtBreakpoint?.length){let l=new Set(n.stopAtBreakpoint);i=!0,o=p=>!(p instanceof Lr)||l.has(p.dapId)}else o=()=>!1;await this.breakpoints.applyEnabledFilter(o);let s=(0,OC.join)((0,kC.tmpdir)(),`vscode-js-profile-${(0,RC.randomBytes)(4).toString("hex")}`),a=await this.factory.get(n.type).start(n,s),c={file:s,profile:a,enableFilter:o,keptDebuggerOn:i};a.onUpdate(l=>e.profilerStateUpdate({label:l,running:!0})),a.onStop(()=>this.disposeProfile(c));let u=!!t.pausedDetails();return i?await t.resume():u&&(await this.cdp.Debugger.disable({}),u&&t.onResumed()),e.profileStarted({file:c.file,type:n.type}),c}async stopProfiling(e){let t=await this.profile?.catch(()=>{});return!t||!this.profile?{}:(this.profile=void 0,await t?.profile.stop(),e.profilerStateUpdate({label:"",running:!1}),{})}async disposeProfile({profile:e,enableFilter:t,keptDebuggerOn:n}){n||await this.cdp.Debugger.enable({}),await this.breakpoints.applyEnabledFilter(void 0,t),e.dispose()}};fc=E([(0,po.injectable)(),g(0,(0,po.inject)(Be)),g(1,(0,po.inject)(Sh)),g(2,(0,po.inject)(gt)),g(3,(0,po.inject)(Dr)),g(4,(0,po.inject)(Ji))],fc);var _s=class r{constructor(e,t,n,i){this.asyncStackPolicy=t;this.launchConfig=n;this._services=i;this._disposables=new Ae;this._customBreakpoints=[];this._xhrBreakpoints=[];this._threadDeferred=ge();this.breakpointIdCounter=bp();this._cdpProxyProvider=this._services.get(qf);this._configurationDoneDeferred=ge(),this.sourceContainer=i.get(mt),this.breakpointManager=i.get(Dr);let o=i.get(Ih),s=i.get(Dt);s.onFlush(()=>{s.report("breakpointStats",this.breakpointManager.statisticsForTelemetry()),s.report("statistics",this.sourceContainer.statistics())}),this.dap=e,this.dap.on("initialize",a=>this.onInitialize(a)),this.dap.on("setBreakpoints",a=>this._onSetBreakpoints(a)),this.dap.on("setExceptionBreakpoints",a=>this.setExceptionBreakpoints(a)),this.dap.on("configurationDone",()=>this.configurationDone()),this.dap.on("loadedSources",()=>this._onLoadedSources()),this.dap.on("disableSourcemap",a=>this._onDisableSourcemap(a)),this.dap.on("source",a=>this._onSource(a)),this.dap.on("threads",()=>this._onThreads()),this.dap.on("stackTrace",a=>this._withThread(c=>c.stackTrace(a))),this.dap.on("variables",a=>this._onVariables(a)),this.dap.on("readMemory",a=>this._onReadMemory(a)),this.dap.on("writeMemory",a=>this._onWriteMemory(a)),this.dap.on("setVariable",a=>this._onSetVariable(a)),this.dap.on("setExpression",a=>this._onSetExpression(a)),this.dap.on("continue",()=>this._withThread(a=>a.resume())),this.dap.on("pause",()=>this._withThread(a=>a.pause())),this.dap.on("next",()=>this._withThread(a=>a.stepOver())),this.dap.on("stepIn",a=>this._withThread(c=>c.stepInto(a.targetId))),this.dap.on("stepOut",()=>this._withThread(a=>a.stepOut())),this.dap.on("restartFrame",a=>this._withThread(c=>c.restartFrame(a))),this.dap.on("scopes",a=>this._withThread(c=>c.scopes(a))),this.dap.on("evaluate",a=>this.onEvaluate(a)),this.dap.on("completions",a=>this._withThread(c=>c.completions(a))),this.dap.on("exceptionInfo",()=>this._withThread(a=>a.exceptionInfo())),this.dap.on("setCustomBreakpoints",a=>this.setCustomBreakpoints(a)),this.dap.on("toggleSkipFileStatus",a=>this._toggleSkipFileStatus(a)),this.dap.on("toggleSkipFileStatus",a=>this._toggleSkipFileStatus(a)),this.dap.on("prettyPrintSource",a=>this._prettyPrintSource(a)),this.dap.on("locations",a=>this._onLocations(a)),this.dap.on("revealPage",()=>this._withThread(a=>a.revealPage())),this.dap.on("getPerformance",()=>this._withThread(a=>o.retrieve(a.cdp()))),this.dap.on("breakpointLocations",a=>this._breakpointLocations(a)),this.dap.on("createDiagnostics",a=>this._dumpDiagnostics(a)),this.dap.on("requestCDPProxy",()=>this._requestCDPProxy()),this.dap.on("setExcludedCallers",a=>this._onSetExcludedCallers(a)),this.dap.on("saveDiagnosticLogs",({toFile:a})=>this._saveDiagnosticLogs(a)),this.dap.on("setSourceMapStepping",a=>this._setSourceMapStepping(a)),this.dap.on("stepInTargets",a=>this._stepInTargets(a)),this.dap.on("setDebuggerProperty",a=>th
`)),{}}async launchBlocker(){await this._configurationDoneDeferred.promise,await this._thread?.debuggerReady.promise,await this._services.get(pc).launchBlocker,await this.breakpointManager.launchBlocker()}async _onSetExcludedCallers({callers:e}){return(await this._threadDeferred.promise).setExcludedCallers(e),{}}async onInitialize(e){console.assert(e.linesStartAt1),console.assert(e.columnsStartAt1),this._services.get(Hl).value=e;let t=r.capabilities(!0);return setTimeout(()=>this.dap.initialized({}),0),setTimeout(()=>this._thread?.dapInitialized(),0),t}static capabilities(e=!1){return{supportsConfigurationDoneRequest:!0,supportsFunctionBreakpoints:!1,supportsConditionalBreakpoints:!0,supportsHitConditionalBreakpoints:!0,supportsEvaluateForHovers:!0,supportsReadMemoryRequest:!0,supportsWriteMemoryRequest:!0,exceptionBreakpointFilters:[{filter:"all",label:Or.t("Caught Exceptions"),default:!1,supportsCondition:!0,description:Or.t("Breaks on all throw errors, even if they're caught later."),conditionDescription:'error.name == "MyError"'},{filter:"uncaught",label:Or.t("Uncaught Exceptions"),default:!1,supportsCondition:!0,description:Or.t("Breaks only on errors or promise rejections that are not handled."),conditionDescription:'error.name == "MyError"'}],supportsStepBack:!1,supportsSetVariable:!0,supportsRestartFrame:!0,supportsGotoTargetsRequest:!1,supportsStepInTargetsRequest:!0,supportsCompletionsRequest:!0,supportsModulesRequest:!1,additionalModuleColumns:[],supportedChecksumAlgorithms:[],supportsRestartRequest:!0,supportsExceptionOptions:!1,supportsValueFormattingOptions:!0,supportsExceptionInfoRequest:!0,supportTerminateDebuggee:!0,supportsDelayedStackTraceLoading:!0,supportsLoadedSourcesRequest:!0,supportsLogPoints:!0,supportsTerminateThreadsRequest:!1,supportsSetExpression:!0,supportsTerminateRequest:!1,completionTriggerCharacters:[".","[",'"',"'"],supportsBreakpointLocationsRequest:!0,supportsClipboardContext:!0,supportsExceptionFilterOptions:!0,supportsEvaluationOptions:!!e,supportsDebuggerProperties:!!e,supportsSetSymbolOptions:!!e,supportsANSIStyling:!0}}async _onSetBreakpoints(e){return this.breakpointManager.setBreakpoints(e,e.breakpoints?.map(()=>this.breakpointIdCounter())??[])}async setExceptionBreakpoints(e){return await this._services.get(pc).setBreakpoints(e),{}}async configurationDone(){return this._configurationDoneDeferred.resolve(),{}}async _onLoadedSources(){return{sources:await this.sourceContainer.loadedSources()}}async _onDisableSourcemap(e){let t=this.sourceContainer.source(e.source);if(!t)return ve(Or.t("Source not found"));if(!(t instanceof Je))return ve(Or.t("Source not a source map"));for(let n of t.compiledToSourceUrl.keys())this.sourceContainer.disableSourceMapForSource(n,!0);return await this._thread?.refreshStackTrace(),{}}async _onSource(e){e.source||(e.source={sourceReference:e.sourceReference}),e.source.path=on(e.source.path);let t=this.sourceContainer.source(e.source);if(!t)return ve(Or.t("Source not found"));let n=await t.content();return n===void 0?(t instanceof Je&&this.dap.suggestDisableSourcemap({source:e.source}),ve(Or.t("Unable to retrieve source content"))):{content:n,mimeType:t.getSuggestedMimeType}}async _onThreads(){let e=[];return this._thread&&e.push({id:this._thread.id,name:this._thread.name()}),{threads:e}}findVariableStore(e){if(!this._thread)return;let t=this._thread.pausedVariables();if(t&&e(t))return t;if(e(this._thread.replVariables))return this._thread.replVariables}async _onLocations(e){let t=this.findVariableStore(o=>o.hasVariable(e.locationReference));if(!t||!this._thread)throw Gu();let n=await t.getLocations(e.locationReference),i=await this._thread.rawLocationToUiLocationWithWaiting(this._thread.rawLocation(n));if(!i)throw Gu();return{source:await i.source.toDap(),line:i.lineNumber,column:i.columnNumber}}async _onVariables(e){return{variables:await this.findVariableStore(n=>n.hasVariable(e.variablesReference))?.getVariables(e)??[]}}async _onReadMemory(e){let t=e.memoryReference,n=await this.findVariableStore(i=>i.hasMemory(t))?.readMemory(t,e.offset??0,e.coun
`)))}function l(d){o+=d+`
`;let f=d.match(/^DevTools listening on (ws:\/\/.*)$/);f&&(p(),t(f[1]))}function p(){c.dispose(),i.removeListener("line",l),i.removeListener("close",s),a.dispose()}})}async function jk(r,e,t,n){let i=r.launchUnelevatedRequest({process:e,args:t});await Jn(i,n,"Could not launch browser unelevated")}var Vk=()=>{};async function Kk(r,e,t,n,i,o,s={}){let{onStderr:a=Vk,onStdout:c=Vk,args:u=[],dumpio:l=!1,cwd:p=process.cwd(),env:d=yt.empty,connection:f="pipe",cleanUp:h="wholeBrowser",url:m,inspectUri:y}=s,w=new Ao(u),D=w.getSuggestedConnection();s.includeLaunchArgs!==!1?(w=H_(w,s),D===void 0&&(w=w.setConnection(f),D=f)):D===void 0&&(D="pipe");let j=["pipe","pipe","pipe"];D==="pipe"&&(l?j=["ignore","pipe","pipe","pipe","pipe"]:j=["ignore","ignore","ignore","pipe","pipe"]);let X;if(!!(i.supportsLaunchUnelevatedProcessRequest&&s.launchUnelevated)&&typeof D=="number"&&D!==0)await jk(r,e,w.toArray(),o),X=new Vm(t);else{t.info("runtime.launch",`Launching Chrome from ${e}`);let O=rp(e,w.toArray(),await oa(Gk.promises,p)?p:process.cwd()),G=qk.spawn(O.executable,O.args,{detached:!0,env:d.defined(),shell:O.shell,cwd:O.cwd,stdio:j});if(G.pid===void 0)throw await Promise.race([ue(1e3).then(()=>new Error("Unable to launch the executable (undefined pid)")),new Promise(re=>G.once("error",re))]);X=new qm(G,t)}l?(X.stderr?.on("data",O=>a(O.toString())),X.stdout?.on("data",O=>c(O.toString()))):(X.stderr?.resume(),X.stdout?.resume());let Z=()=>{h==="wholeBrowser"&&X.kill()};process.on("exit",Z),X.onExit(()=>process.removeListener("exit",Z));try{if(s.promisedPort){let O;D=await Promise.race([s.promisedPort,new Promise((G,re)=>{O=X.onExit(xe=>{re(new T(Ax(xe)))})})]).finally(()=>O.dispose())}return{process:X,canReconnect:typeof D=="number",createConnection:async O=>{let G=await X.transport({connection:D,inspectUri:y||void 0,url:m||void 0},O);return new it(G,t,n)}}}catch(O){throw X.kill(),O}}function H_(r,e={}){let{userDataDir:t=null,ignoreDefaultArgs:n=!1}=e,i=n===!0?new Ao:Ao.default;return n instanceof Array&&(i=i.filter(o=>!n.includes(o))),t&&(i=i.add("--user-data-dir",t)),i=i.merge(r),r.toArray().every(o=>o.startsWith("-"))&&e.hasUserNavigation&&(i=i.add("about:blank")),i}async function Xk(r,e,t,n){let{browserWSEndpoint:i,browserURL:o}=r;if(i){let s=await gr.create(i,e);return new it(s,t,n)}else if(o){let s=await jm(o,e,t),a=r.inspectUri?Um(r.inspectUri,r.pageURL,s):s,c=await gr.create(a,e);return new it(c,t,n)}throw new Error("Either browserURL or browserWSEndpoint needs to be specified")}var qr=class{constructor(e,t,n){this.logger=e;this.pathResolver=t;this.vscode=n;this._disposables=[];this._onTerminatedEmitter=new C;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new C;this.onTargetListChanged=this._onTargetListChangedEmitter.event}dispose(){for(let e of this._disposables)e.dispose();this._disposables=[],this._attemptTimer&&clearTimeout(this._attemptTimer),this._targetManager&&this._targetManager.dispose()}resolveParams(e){return e.request==="attach"&&(e.type==="pwa-chrome"||e.type==="pwa-msedge"&&typeof e.useWebView!="object")&&e.browserAttachLocation==="workspace"}async launch(e,t){return this.resolveParams(e)?(this._lastLaunchParams={...e,timeout:1/0},await this.attemptToAttach(this._lastLaunchParams,t),{blockSessionTermination:!0}):{blockSessionTermination:!1}}_scheduleAttach(e,t){this._attemptTimer=setTimeout(()=>{this._attemptTimer=void 0,this.attemptToAttach(e,{...t,cancellationToken:Vt})},1e3)}createTargetManager(e,t,n){return _o.connect(e,void 0,this.pathResolver,t,this.logger,n.telemetryReporter,n.targetOrigin)}async attemptToAttach(e,t){let n=await this.acquireConnectionForBrowser(t,e);this._connection=n,n.onDisconnected(()=>{this._connection=void 0,this._targetManager&&(this._targetManager.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire()),this._lastLaunchParams===e&&e.restart?this._scheduleAttach(e,t):this._onTerminatedEmitter.fire({killed:!0,code:0})},void 0,this._disposables);let i=this._targetManager=await this.createTargetManager(n,e,t);if(!i)return;i.serviceWor
`).shift()||""),h=t.port||f;i.resolve(h);let m=`ws://${t.address}:${h}/devtools/${p.type}/${p.id}`,y=await gr.create(m,Vt),w=new it(y,this.logger,n);await w.rootSession().Runtime.runIfWaitingForDebugger({}),w.close()})});return c.on("error",i.reject),c.on("close",()=>i.resolve(t.port)),c.listen(a),t.userDataDir=t.userDataDir||(0,t1.join)((0,e1.tmpdir)(),`vscode-js-debug-userdatadir_${t.port}`),t.env=t.env||{},t.env.WEBVIEW2_USER_DATA_FOLDER=t.userDataDir.toString(),t.env.WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=`--remote-debugging-port=${t.port}`,t.env.WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER="true",t.env.WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER=s,i.promise}async findBrowserPath(t){let n=await this.findBrowserByExe(this.browserFinder,t);if(!n||!await oa(this.fs,n))throw new T(Jd("Edge",t,(await this.browserFinder.findAll()).map(i=>i.quality)));return n}};Nc=E([(0,pn.injectable)(),g(0,(0,pn.inject)(Bn)),g(1,(0,pn.inject)(U)),g(2,(0,pn.inject)(Zo)),g(2,(0,pn.tagged)("browser","edge")),g(3,(0,pn.inject)($e)),g(4,(0,pn.inject)(Se)),g(5,(0,pn.inject)(Ct))],Nc);var $i=_(q());var r1=H("crypto"),Km=_(q());var E6=0,ni=class{constructor(e){this.portLeaseTracker=e;this.teardown=new WeakMap}async launch(e,t,n){this.server&&this.server.close();let i=`/${(0,r1.randomBytes)(20).toString("hex")}`,o=this.server=await Vf(this.portLeaseTracker,{perMessageDeflate:!0,host:"127.0.0.1",path:i}),s=++E6;e.launchBrowserInCompanion({...n,serverPort:o.address().port,path:i,launchId:s});let a=await Jn(new Promise((u,l)=>{o.once("connection",u),o.once("error",l)}),t,"Timed out waiting for browser connection"),c=new gr(a);return this.teardown.set(c,()=>e.killCompanionBrowser({launchId:s})),c}close(e){this.teardown.get(e)?.()}dispose(){this.server?.close(),this.server=void 0}};ni=E([(0,Km.injectable)(),g(0,(0,Km.inject)(Mr))],ni);var Bc=class extends qr{constructor(t,n,i,o){super(n,i,o);this.helper=t}resolveParams(t){return t.request==="attach"&&(t.type==="pwa-chrome"||t.type==="pwa-msedge")&&t.browserAttachLocation==="ui"}async acquireConnectionForBrowser(t,n){let i=await this.helper.launch(t.dap,t.cancellationToken,{type:n.type==="pwa-chrome"?"chrome":"edge",params:n,attach:{host:n.address,port:n.port}});return new it(i,this.logger,t.telemetryReporter)}};Bc=E([(0,$i.injectable)(),g(0,(0,$i.inject)(ni)),g(1,(0,$i.inject)(U)),g(2,(0,$i.inject)(Se)),g(3,(0,$i.optional)()),g(3,(0,$i.inject)(Fn))],Bc);var Ci=_(q());var Fc=class extends ri{constructor(t,n,i,o,s,a){super(t,n,i,o,s);this.helper=a}resolveParams(t){return(t.type==="pwa-chrome"||t.type==="pwa-msedge")&&t.request==="launch"&&t.browserLaunchLocation==="ui"?t:void 0}async launchBrowser(t,n,i,o){let s=await this.helper.launch(n,i,{type:t.type==="pwa-chrome"?"chrome":"edge",browserArgs:H_(new Ao(t.runtimeArgs||[]),{hasUserNavigation:!!t.url,ignoreDefaultArgs:!t.includeDefaultArgs}).setConnection(t.port||"pipe").toArray(),params:t});return{canReconnect:!1,createConnection:()=>Promise.resolve(new it(s,this.logger,o)),process:{onExit:new C().event,onError:new C().event,transport:()=>Promise.resolve(s),kill:()=>this.helper.close(s)}}}async findBrowserPath(){throw new Error("not implemented")}};Fc=E([(0,Ci.injectable)(),g(0,(0,Ci.inject)(Bn)),g(1,(0,Ci.inject)(U)),g(2,(0,Ci.inject)(Se)),g(3,(0,Ci.inject)(Ct)),g(4,(0,Ci.inject)($e)),g(5,(0,Ci.inject)(ni))],Fc);var xo=_(q()),u1=H("net");var Uc=class extends qr{constructor(e,t,n){super(e,t,n)}resolveParams(e){return e.request==="attach"&&e.type==="pwa-msedge"&&typeof e.useWebView=="object"}async acquireConnectionForBrowser(e,t){let{getAppContainerProcessTokens:n}=await Promise.resolve().then(()=>_(c1())),i=n(t.useWebView.pipeName);if(!i)throw new T(yx());let o=i.map(c=>(0,u1.connect)(c)),s;try{s=await Jn(Qs(o.map(c=>new Promise(u=>c.on("error",()=>u(void 0)).on("connect",()=>u(c))))),e.cancellationToken)}finally{for(let c of o)c!==s&&c.destroy()}if(!s)throw new T(vx());let a=new Vr(this.logger,s);return new it(a,this.logger,e.telemetryReporter)}};Uc=E([(0,xo.injectable)(),g(0,(0,xo.inject)(U)),g(1,(0,xo.inject)(Se)),g(2,(0,xo.optional)()),g(2,(0,xo.inject)(Fn))],Uc);var qc
`)).on("data",a=>{let c=s(a.toString());c&&(t=e(c,t))}),o.on("close",(a,c)=>{a===0?n(t):c?i(new Error(`process terminated with signal: ${c}`)):a&&i(new Error(`process terminated with exit code: ${a}`))})})}};var Zc=class extends Qc{constructor(t){super();this.fsUtils=t}async getWorkingDirectory(t){try{let{stdout:n}=await Bm("lsof",["-a","-dcwd","-Fn",`-p${t}`]),i=n.trim().split(`
`).pop().slice(1);return i&&(0,X1.isAbsolute)(i)&&await this.fsUtils.exists(i)?i:void 0}catch(n){if(n instanceof tp)return;throw n}}createProcess(){return this.spawn("ps",["-xo",`pid=PID,ppid=PPID,comm=${"a".repeat(256)},command=COMMAND`])}createParser(){let t;return n=>{if(!t){t=n.indexOf("COMMAND");return}let i=/^\W*([0-9]+)\W*([0-9]+)\W*/.exec(n);if(i)return{pid:Number(i[1]),ppid:Number(i[2]),command:n.slice(i[0].length,t).trim(),args:n.slice(t).trim()}}}};var dH=class extends Zc{createProcess(){return this.spawn("ps",["-axo","pid=PID,ppid=PPID,comm:30,command=COMMAND"])}createParser(){let e=super.createParser();return t=>{let n=e(t);if(!n)return;let i=n.args.indexOf(n.command);if(i===-1)return n;for(i=i+n.command.length;i<n.args.length&&n.args[i]!==" ";)i++;return n.command=n.args.substr(0,i),n.args=n.args.substr(i+1),n}}};var z1=H("path");var fH=class extends Qc{async getWorkingDirectory(){}createProcess(){let e=(0,z1.join)(process.env.WINDIR||"C:\\Windows","System32","wbem","WMIC.exe");return this.spawn(e,["process","get","CommandLine,CreationDate,ParentProcessId,ProcessId"])}createParser(){let e=/^(.*)\s+([0-9]+)\.[0-9]+[+-][0-9]+\s+([0-9]+)\s+([0-9]+)$/;return t=>{let n=e.exec(t.trim());if(!n||n.length!==5)return;let i=Number(n[4]),o=Number(n[3]),s=Number(n[2]),a=n[1].trim();if(!isNaN(i)&&!isNaN(o)&&a){let c=a;if(a[0]==='"'){let u=a.indexOf('"',1);u>0&&(c=a.substr(1,u-1),a=a.substr(u+2))}else{let u=a.indexOf(" ");u>0?(c=a.substr(0,u),a=a.substr(u+1)):a=""}return{pid:i,ppid:o,command:c,args:a,date:s}}}}};var J1=new Qr(Y1.promises),Q1=process.platform==="win32"?new fH:process.platform==="darwin"?new Zc(J1):new dH(J1),pJ=ne(()=>{let r=["--inspect(?:-brk)?","(?:=",["(?:",["(?:","(?<address>\\[[0-9a-f:]*\\]|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+|(?:[a-z][a-z0-9\\.]*))","(?::(?<port1>\\d+))?",")"],"|",["(?:",":?","(?<port2>\\d+)?",")"],")"],")?"].flat(1/0).join("");return new RegExp(r,"i")});function Z1(r){let e=/--inspect-port=(\d+)/,t,n,i=pJ().exec(r);if(i?.groups){let o=i.groups.port1||i.groups.port2;n=o?Number(o):9229,t=i.groups.address??"127.0.0.1"}return i=e.exec(r),i&&i.length===2&&(t||="127.0.0.1",n=parseInt(i[1])),{address:t,port:n}}async function eO(r,e,t,n=Vt){let i=await dJ(r.pid,t);if(!i)return[];let o=[],s=i.children.slice();for(;s.length;){let a=s.pop();s=s.concat(a.children);let{port:c}=Z1(a.args);c&&o.push(m_(`http://${r.hostname}:${c}`,n,t,!0).then(u=>si.attach({ipcAddress:r.ipcAddress,scriptName:"Child Process",inspectorURL:u,waitForDebugger:!0,dynamicAttach:!0,pid:String(a.pid),openerId:e})).catch(u=>t.info("internal","Could not spawn WD for child process",{err:u,port:c,child:a})))}return(await Promise.all(o)).filter(a=>!!a)}async function dJ(r,e){let t=new Map;t.set(0,{children:[],pid:0,ppid:0,command:"",args:""});try{await Q1.lookup(({pid:i,ppid:o,command:s,args:a})=>(i!==o&&t.set(i,{pid:i,ppid:o,command:s,args:a,children:[]}),t),null)}catch(i){e.warn("internal","Error getting child process tree",i);return}let n=t.values();for(let i of n){let o=t.get(i.ppid);o&&o!==i&&o.children.push(i)}return!isNaN(r)&&r>0?t.get(r):t.get(0)}var tO=_(q());var ai=class{create(e){return e===!1?new x_:e===!0?new hH({maxAttempts:1/0,delay:1e3}):new hH({maxAttempts:e.maxAttempts??1/0,delay:e.delay??1e3})}};ai=E([(0,tO.injectable)()],ai);var hH=class r{constructor(e,t=0){this.options=e;this.attempt=t}get delay(){return this.options.delay}next(){return this.attempt===this.options.maxAttempts?void 0:new r(this.options,this.attempt+1)}reset(){return this.attempt?new r(this.options):this}},x_=class{constructor(){this.delay=-1}next(){}reset(){return this}};var eu=class extends Do{constructor(t,n,i,o,s=new ai){super(t,n,o,i);this.restarters=s}resolveParams(t){return t.type==="pwa-node"&&t.request==="attach"?t:void 0}async launchProgram(t){let n=async(o,s)=>{let a=this.program,c;try{t.params.websocketAddress?c=t.params.websocketAddress:c=await kc(`http://${t.params.address}:${t.params.port}`,s&&t.params.timeout>0?ut.withTimeout(t.params.timeout).token:t.context.cancellationToken,this.logger,t.params.remoteHostHeader)}catch(p){if(a
`,c.delay)});let u=new Us;this.program=u;let l=await Promise.race([ue(c.delay),u.stopped]);this.program===u&&(l?this.onProgramTerminated(a):n(c,u))};return n(this.restarters.create(t.params.restart))}async terminate(t){await super.terminate(),t&&this.telemetry&&un(this.telemetry.processId,this.logger)}createLifecycle(t,n,i){if(i.openerId)return{};let o;return{initialized:async()=>{o=this.onFirstInitialize(t,n,i),await o},close:()=>{this.targetList().length&&this.program?.stop(),o?.then(s=>s.dispose())}}}async onFirstInitialize(t,n,i){let o=new pH;await o.startTouchLoop();let s=new br("node",void 0);try{s=await this.resolveNodePath(n.params)}catch{}let[a]=await Promise.all([this.gatherTelemetryFromCdp(t,n),this.setEnvironmentVariables(t,n,o.path,i.targetId,s)]);return this.telemetry=a,a&&n.params.attachExistingChildren&&eO({pid:a.processId,nodePath:s.path,hostname:n.params.address,ipcAddress:n.serverAddress},i.targetId,this.logger).catch(c=>this.logger.warn("internal","Error watching child processes",{err:c})),o}async setEnvironmentVariables(t,n,i,o,s){if(!n.params.autoAttachChildProcesses)return;if(!await ga(n.params.address)){this.logger.warn("runtime.target","Cannot attach to children of remote process");return}let a=await this.resolveEnvironment(n,s,{requireLease:i,openerId:o});return this.appendEnvironmentVariables(t,a)}};eu=E([(0,Ws.injectable)(),g(0,(0,Ws.inject)(Co)),g(1,(0,Ws.inject)(U)),g(2,(0,Ws.inject)(dn)),g(3,(0,Ws.inject)(Mr))],eu);var vr=_(q()),nu=H("path");function nO(r){if(!r.runtimeArgs||r.attachSimplePort)return;let e=[];for(let t of r.runtimeArgs)/^--inspect-brk(=|$)/.test(t)?r.stopOnEntry=r.stopOnEntry||!0:e.push(t);r.runtimeArgs=e}var iO=H("crypto"),tu=H("fs"),oO=H("os"),sO=_(H("path")),mH=class r{constructor(){this.path=sO.join((0,oO.tmpdir)(),`node-debug-callback-${(0,iO.randomBytes)(8).toString("hex")}`);this.disposed=!1}static{this.pollInterval=200}read(e=r.pollInterval){return this.readPromise?this.readPromise:(this.readPromise=new Promise((t,n)=>{let i=setInterval(()=>{if(this.disposed){clearInterval(i),t(void 0);return}if((0,tu.existsSync)(this.path)){try{t(JSON.parse((0,tu.readFileSync)(this.path,"utf-8")))}catch(o){n(o)}finally{this.dispose()}clearInterval(i)}},e)}),this.readPromise)}dispose(){if(!this.disposed){this.disposed=!0;try{(0,tu.unlinkSync)(this.path)}catch{}}}};var js=_(H("path"));var fp=Symbol("IProgramLauncher"),HH=r=>{let e=r.program;if(e&&js.isAbsolute(e)){let t=js.relative(r.cwd,e);e=js.isAbsolute(t)?t:`.${js.sep}${t}`}return e?[...r.runtimeArgs,e,...Ou(r.args)]:[...r.runtimeArgs,...Ou(r.args)]};var fJ=async(r,e)=>{if(typeof e.stopOnEntry=="string")return(0,nu.resolve)(e.cwd,e.stopOnEntry);if(e.program)return(0,nu.resolve)(e.cwd,e.program);for(let t of Ou(e.args)){if(t.startsWith("-"))continue;let n=(0,nu.resolve)(e.cwd,t);if(await r.exists(n))return n}},ru=class extends ii{constructor(t,n,i,o,s,a,c,u,l){super(t,n,l,u);this.bpPredictor=i;this.launchers=o;this.restarters=s;this.fsUtils=a;this.packageJson=c}resolveParams(t){let n;if(t.type==="pwa-node"&&t.request==="launch"?n={...t}:"server"in t&&t.server&&"program"in t.server&&(n={...t.server}),!!n)return nO(n),n}async launchProgram(t){t.params.program&&(t.params.program=await this.tryGetCompiledFile(t.params.program)),this.attachSimplePort=await this.getSimpleAttachPortIfAny(t.params);let n=async i=>{this.program&&this.program.stop();let o=await this.resolveNodePath(t.params,t.params.runtimeExecutable||void 0),s=o.warning;s&&t.context.dap.output({category:"stderr",output:s.message});let a=new mH,c=await this.resolveEnvironment(t,o,{fileCallback:a.path});this.attachSimplePort?(t.params.attachSimplePort||t.context.dap.output({category:"stderr",output:"Using legacy attach mode for --inspect-brk in npm scripts. We recommend removing --inspect-brk, and using `stopOnEntry` in your launch.json if you need it."}),c=c.merge({NODE_OPTIONS:null})):c=D1(o,c);let u={...t.params,env:c.value},l="--experimental-network-inspection";t.params.experimentalNetworking==="off"||(o.has(2)||t.params.experimentalNetworking==="on")&&(u.runtimeArgs=[l
`});let c=(0,lO.spawn)(i,o,{shell:s,cwd:a,env:yt.merge(yt.processEnv(),t.env).defined()});return t.outputCapture==="console"?this.discardStdio(n.dap,c):this.captureStdio(n.dap,c),new lH(c,this.logger,t.killBehavior)}captureStdio(e,t){t.stdout.pipe(new yH).on("data",n=>e.output({category:"stdout",output:n.toString()})).resume(),t.stderr.pipe(new yH).on("data",n=>e.output({category:"stderr",output:n.toString()})).resume()}discardStdio(e,t){let n=[],i=()=>{n&&e.output({category:"stderr",output:Buffer.concat(n).toString()})},o=Buffer.from("Debugger attached."),s=a=>{a.includes(o)?(n=void 0,t.stderr.removeListener("data",s)):n&&n.push(a)};t.stderr.on("data",s),t.on("error",a=>{i(),e.output({category:"stderr",output:a.stack||a.message})}),t.on("exit",a=>{a!==null&&a>0&&(i(),e.output({category:"stderr",output:`Process exited with code ${a}\r
`}))}),t.stdout.resume(),t.stderr.resume()}};su=E([(0,bH.injectable)(),g(0,(0,bH.inject)(U))],su);var yH=class extends wo{constructor(){super(3);this.etxSpotted=!1;this.splitSuffix=Buffer.from(`
`)}_transform(t,n,i){return!this.etxSpotted&&t.includes(3)&&(this.etxSpotted=!0),this.etxSpotted?super._transform(t,n,i):(this.push(t),i())}};var vH=_(q());var au=class{constructor(e){this.logger=e}canLaunch(e){return e.internalConsoleOptions,e.console!=="internalConsole"}async launchProgram(e,t,n){let i={kind:t.console==="integratedTerminal"?"integrated":"external",title:t.name,cwd:t.cwd,args:[e,...HH(t)],env:Js(t.env),argsCanBeInterpretedByShell:!Array.isArray(t.args)},o;try{o=await this.sendLaunchRequest(i,n)}catch(s){throw new T(px(s.message))}return new zc(o,this.logger,t.killBehavior)}sendLaunchRequest(e,t){return t.dap.runInTerminalRequest(e)}};au=E([(0,vH.injectable)(),g(0,(0,vH.inject)(U))],au);var pO=_(q());var cu=class{getTreatment(e,t){return Promise.resolve(t)}};cu=E([(0,pO.injectable)()],cu);var dO=_(q());var Vs=class{constructor(){this.flushEmitter=new C;this.onFlush=this.flushEmitter.event}report(){}reportOperation(){}attachDap(){}flush(){this.flushEmitter.fire()}dispose(){}};Vs=E([(0,dO.injectable)()],Vs);var fO=r=>{},hO=r=>{};var HO=(r,e,t,n)=>{let i=new AH.Container;return i.parent=r,i.bind(de).toConstantValue(e.launchConfig),i.bind(La).toConstantValue(i),i.bind(Yt).toConstantValue(t),i.bind(Be).toConstantValue(n),i.bind(Zn).toConstantValue(e),i.bind(A1).toConstantValue(e.targetOrigin()),i.bind(Jo).to(xs).inSingletonScope(),i.bind(Hl).to(ro).inSingletonScope(),i.bind(Nn).to(Yo).inSingletonScope(),i.bind(lf).to(Na).inSingletonScope(),i.bind(Yi).toSelf().inSingletonScope(),e.sourcePathResolver&&i.bind(Se).toConstantValue(e.sourcePathResolver),i.bind(bs).toSelf(),i.bind(Ih).toDynamicValue(o=>o.container.get(bs).create()).inSingletonScope(),e.parent()&&(i.bind(ns).to(rs).inSingletonScope(),i.bind(Wn).to(Ma).inSingletonScope()),i.bind(Dt).to(process.env.DA_TEST_DISABLE_TELEMETRY?Vs:Gn).inSingletonScope().onActivation(Ye),i.bind(Dr).toSelf().inSingletonScope(),i.bind(mt).toSelf().inSingletonScope(),i.bind(uo).toSelf().inSingletonScope(),i.bind(Qi).to(ei).inSingletonScope(),i.bind(oo).toSelf().inSingletonScope(),i.bind(pc).to(lc).inSingletonScope(),i.bind(Gf).to(rc).inSingletonScope(),i.bind(Pr).to(Ra).inSingletonScope(),i.bind(gh).to(mc).inSingletonScope(),i.bind(Ji).to($a).inSingletonScope(),i.bind(xf).to(Ka).inSingletonScope().onActivation(Ye),i.bind(gt).toSelf(),i.bind(fr).toSelf(),i.bind(hr).toSelf(),i.bind(Sh).to(wi).inSingletonScope(),i.bind(Eh).to(fc).inSingletonScope(),i.bind(qf).to(ec).inSingletonScope().onActivation(Ye),i},gO=r=>{let e=new AH.Container;e.parent=r,e.bind(La).toConstantValue(e),e.bind(U).to(Wr).inSingletonScope().onActivation(Ye),e.bind(Jo).to(xs).inSingletonScope(),e.bind(Dt).to(process.env.DA_TEST_DISABLE_TELEMETRY?Vs:Gn).inSingletonScope().onActivation(Ye),e.bind(Un).to(Un).inSingletonScope(),e.bind(gi).to(gi).inSingletonScope(),e.bind(Pc).to(xc).inSingletonScope(),e.bind(Da).to(Rc).inSingletonScope(),e.bind(Co).to(Xc),e.bind(ni).toSelf().inSingletonScope().onActivation(Ye),e.bind(ai).toSelf(),e.bind(qt).to(fn).onActivation(Ye),e.bind(qt).to(Jc).onActivation(Ye),e.bind(qt).to(Yc).onActivation(Ye),e.bind(qt).to(ru).onActivation(Ye),e.bind(fp).to(su),e.bind(fp).to(au),e.bind(Bs).to(Kc).inSingletonScope(),hO(e),e.bind(qt).to(eu).onActivation(Ye),e.bind(ks).toSelf().inSingletonScope().onActivation(Ye),e.bind(qt).toService(ks),e.bind(qt).to(Nc).inSingletonScope().onActivation(Ye),e.bind(qt).to(Fc).inSingletonScope().onActivation(Ye),e.bind(qt).to(Bc).inSingletonScope().onActivation(Ye),e.bind(qt).to(Uc).inSingletonScope().onActivation(Ye),e.bind(qt).to(qr).onActivation(Ye),e.bind(qt).toDynamicValue(()=>r.get(Ns).createLauncher(e.get(U))).inSingletonScope(),e.isBound(il)||e.bind(il).to(Hc).inSingletonScope(),e.bind(Qy).to(Ga).inSingletonScope().onActivation(Ye);let t=n=>i=>new n(i.container.get(Ey),i.container.get($e),i.container.get(xy));return e.bind(Zo).toDynamicValue(t(_H.ChromeBrowserFinder)).inSingletonScope().whenTargetTagged("browser","chrome"),e.bind(Zo).toDynamicValue(t(_H.EdgeBrowserFinder)).inSingletonScope().whenTargetTagged("browser","edge"),e},yO=r=>{let e=new AH.Contain
`})}var SO=r=>!!r.value,qs=class r{constructor(e){this.value=e;this.threadData=ge();this._state=0;this._children=new Set;this._stateChangeEmitter=new C;e&&r.targetNodes.set(e,this)}static{this.targetNodes=new WeakMap}get state(){return this._state}set state(e){e>this._state&&(this._state=e,this._stateChangeEmitter.fire(e))}add(e){this._children.add(e)}remove(e){this._children.delete(e)}async waitUntil(e){return this._state>=e?Promise.resolve():new Promise(t=>{let n=this._stateChangeEmitter.event(i=>{i>=e&&(n.dispose(),t())})})}async waitUntilChildrenAre(e){await Promise.all([...this._children].map(t=>t.waitUntil(e)))}*all(){SO(this)&&(yield this);for(let e of this._children)yield*e.all()}};var EO=`\r
\r
`,vJ=0,xH=class{constructor(e,t,n){this.inputStream=e;this.outputStream=t;this._contentLength=-1;this._connectionId=vJ++;this.msgEmitter=new C;this.messageReceived=this.msgEmitter.event;this.endedEmitter=new C;this.closed=this.endedEmitter.event;this._handleData=e=>{let t=new Rr;for(this._rawData=Buffer.concat([this._rawData,e]);;){if(this._contentLength>=0){if(this._rawData.length>=this._contentLength){let n=this._rawData.toString("utf8",0,this._contentLength);if(this._rawData=this._rawData.slice(this._contentLength),this._contentLength=-1,n.length>0)try{let i=JSON.parse(n);this.logger?.verbose("dap.receive",void 0,{connectionId:this._connectionId,message:i}),this.msgEmitter.fire({message:i,receivedTime:t})}catch(i){console.error("Error handling data: "+(i&&i.message))}continue}}else{let n=this._rawData.indexOf(EO);if(n!==-1){let o=this._rawData.toString("utf8",0,n).split(`\r
`);for(let s=0;s<o.length;s++){let a=o[s].split(/: +/);a[0]==="Content-Length"&&(this._contentLength=+a[1])}this._rawData=this._rawData.slice(n+EO.length);continue}}break}};this.logger=n,this._rawData=Buffer.alloc(0),e.on("end",()=>this.endedEmitter.fire()),e.on("data",this._handleData)}send(e,t=!0,n){let i=JSON.stringify(e);if(t){let s=e;e.type==="response"&&e.command==="source"&&(s={...e,body:{...e.body,content:"<script source>"}}),this.logger?.verbose("dap.send",void 0,{connectionId:this._connectionId,message:s})}let o=`Content-Length: ${Buffer.byteLength(i,"utf8")}\r
\r
${i}`;if(this.outputStream.destroyed){this.logger?.warn("dap.send","Message not sent. Connection was closed."),n?.();return}this.outputStream.write(o,"utf8",s=>{n?.(),s&&(console.log(e),this.logger?.error("dap.send","Error while writing to output stream",s),this.close())})}close(){this.inputStream.destroy(),this.outputStream.destroy()}setLogger(e){return this.logger=e,this}};process.env.L10N_FSPATH_TO_BUNDLE&&PH.config({fsPath:process.env.L10N_FSPATH_TO_BUNDLE});var IJ=PO.mkdtempSync(LH.join($O.tmpdir(),"vscode-js-debug-"));function _J(r){let e,t=[],n=[],i=[],o=ge(),s=0,a;return r.on("setBreakpoints",async c=>{let u=c.breakpoints?.map(()=>++s)??[];return t.push({params:c,ids:u}),{breakpoints:u.map(p=>({id:p,verified:!1,message:PH.t("breakpoint.provisionalBreakpoint","Unbound breakpoint")}))}}),r.on("setExceptionBreakpoints",async c=>(e=c,{})),r.on("setCustomBreakpoints",async c=>(n=c.ids,i=c.xhr,{})),r.on("configurationDone",async()=>(o.resolve(),{})),r.on("threads",async()=>({threads:[]})),r.on("loadedSources",async()=>({sources:[]})),r.on("initialize",async c=>(a=c,setTimeout(()=>r.initialized({}),0),_s.capabilities())),new Promise(c=>{let u=async l=>{await o.promise;let p=ge();if(!a)throw new Error("cannot call launch/attach before initialize");return c({initializeParams:a,setExceptionBreakpointsParams:e,setBreakpointsParams:t,customBreakpoints:n,xhrBreakpoints:i,launchParams:l,deferred:p}),p.promise};r.on("launch",l=>u(l)),r.on("attach",u)})}var L_=class{constructor(e,t){this.dapRoot=e;this.services=t;this.sessions=new Map}async acquireDap(e){let t=this.sessions.get(e.id());if(t){let{connection:s}=await t.promise;return s}let n=e.parent(),i;if(n){let s=this.sessions.get(n.id())?.settledValue;if(!s)throw new Error("Expected parent session to have a settled value");i=s.connection.dap()}else i=this.dapRoot;let o=ge();return this.sessions.set(e.id(),o),i.startDebuggingRequest({request:e.launchConfig.request,configuration:{type:e.launchConfig.type,name:e.name(),__pendingTargetId:e.id()}}).catch(s=>o.reject(s)),o.promise.then(s=>s.connection)}async initAdapter(e,t){let n=this.sessions.get(t.id())?.settledValue;if(!n)throw new Error(`Expected to find pending init for target ${t.id()}`);n.setExceptionBreakpointsParams&&await e.setExceptionBreakpoints(n.setExceptionBreakpointsParams);for(let{params:i,ids:o}of n.setBreakpointsParams)await e.breakpointManager.setBreakpoints(i,o);return await e.setCustomBreakpoints({xhr:n.xhrBreakpoints,ids:n.customBreakpoints}),await e.onInitialize(n.initializeParams),await e.configurationDone(),await e.launchBlocker(),n.deferred.resolve({}),!0}releaseDap(e){this.sessions.delete(e.id())}hasPendingTarget(e){return this.sessions.get(e)?.hasSettled()===!1}handleConnection(e){if(!("__pendingTargetId"in e.launchParams)||!e.launchParams.__pendingTargetId)throw new Error("Incoming session is missing __pendingTargetId");let t=e.launchParams.__pendingTargetId,n=this.sessions.get(t);if(!n)throw new Error(`__pendingTargetId ${t} not found`);n.resolve(e)}};function xO(r){let e=yO({storagePath:IJ,isVsCode:!1}),t=new Set,n=LO.createServer(async i=>{try{let o=new Gc,s=new xH(i,i,o),a=new Ku(s,o),c=a.dap(),u=await _J(c);if("__pendingTargetId"in u.launchParams){let l=u.launchParams.__pendingTargetId,p=l&&[...t].find(d=>d.hasPendingTarget(l));if(!p)throw new Error(`Cannot find pending target for ${l}`);o.connectTo(p.services.get(U)),p.handleConnection({...u,connection:a})}else{let l=gO(e),p=new L_(c,l);t.add(p),l.bind(Ct).toConstantValue(u.initializeParams),o.connectTo(l.get(U));let d=new SH(p,a,l,new rH("targetOrigin"));s.closed(()=>{d.dispose(),t.delete(p)}),u.deferred.resolve(await d.boot(u.launchParams,c))}}catch(o){return console.error(o),i.destroy()}}).on("error",i=>{console.error(i),process.exit(1)}).listen(r,()=>{let i=n.address();console.log(`Debug server listening at ${typeof i=="string"?i:`${i.address}:${i.port}`}`)})}var[,AJ,P_="8123",wJ="localhost"]=process.argv;process.argv.includes("--help")?console.log(`Usage: ${LH.basename(AJ)} [port|socket path=8123] [host=localhost]`):isNaN(Number(P_))?xO({pa
/*! Bundled license information:
reflect-metadata/Reflect.js:
(*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** *)
is-number/index.js:
(*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*)
to-regex-range/index.js:
(*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*)
fill-range/index.js:
(*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*)
normalize-path/index.js:
(*!
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*)
is-extglob/index.js:
(*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-glob/index.js:
(*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
is-windows/index.js:
(*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*)
*/